@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.mjs
CHANGED
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
rowActions,
|
|
47
47
|
toArgv,
|
|
48
48
|
uniqueDiagnostics
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-5X3CA44U.mjs";
|
|
50
50
|
|
|
51
51
|
// src/index.ts
|
|
52
52
|
import { projectCanvasView as projectCanvasView2 } from "@lace-cloud/proto";
|
|
@@ -55,9 +55,9 @@ import { Toast } from "@lace-cloud/ui/feedback";
|
|
|
55
55
|
// src/App.tsx
|
|
56
56
|
import { ReactFlowProvider } from "@xyflow/react";
|
|
57
57
|
import {
|
|
58
|
-
Fragment as
|
|
58
|
+
Fragment as Fragment15,
|
|
59
59
|
useCallback as useCallback11,
|
|
60
|
-
useEffect as
|
|
60
|
+
useEffect as useEffect13,
|
|
61
61
|
useLayoutEffect as useLayoutEffect5,
|
|
62
62
|
useMemo as useMemo12,
|
|
63
63
|
useRef as useRef12,
|
|
@@ -68,7 +68,7 @@ import "./App-IFIOMNV7.css";
|
|
|
68
68
|
|
|
69
69
|
// src/Canvas.tsx
|
|
70
70
|
import "@xyflow/react/dist/style.css";
|
|
71
|
-
import "./Canvas-
|
|
71
|
+
import "./Canvas-VQQEZSPA.css";
|
|
72
72
|
import { drawnRect as drawnRect2, extentOf as extentOf3, instanceAddress as instanceAddress4, localIn as localIn3 } from "@lace-cloud/proto";
|
|
73
73
|
import {
|
|
74
74
|
applyEdgeChanges,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
useNodesInitialized,
|
|
78
78
|
useReactFlow as useReactFlow3
|
|
79
79
|
} from "@xyflow/react";
|
|
80
|
-
import { useCallback as useCallback8, useEffect as
|
|
80
|
+
import { useCallback as useCallback8, useEffect as useEffect9, useLayoutEffect as useLayoutEffect3, useMemo as useMemo6, useRef as useRef8, useState as useState8 } from "react";
|
|
81
81
|
|
|
82
82
|
// src/components/CanvasControls.tsx
|
|
83
83
|
import { IconButton } from "@lace-cloud/ui";
|
|
@@ -279,21 +279,25 @@ function isEmphasized(action, ctx) {
|
|
|
279
279
|
|
|
280
280
|
// src/utils/key-chord.ts
|
|
281
281
|
var BARE_KEYS = ["Delete", "Backspace"];
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
282
|
+
var MODIFIERS = ["Mod", "Ctrl"];
|
|
283
|
+
function parseChord(spec, mac) {
|
|
284
|
+
if (BARE_KEYS.some((bare) => bare === spec)) {
|
|
285
|
+
return { modifier: void 0, shift: false, key: spec };
|
|
286
|
+
}
|
|
287
|
+
const [head, ...rest] = spec.split("+");
|
|
288
|
+
const modifier = MODIFIERS.find((m) => m === head);
|
|
289
|
+
if (!modifier || modifier === "Ctrl" && mac) return void 0;
|
|
290
|
+
if (rest.length === 1 && rest[0] !== "") return { modifier, shift: false, key: rest[0] };
|
|
287
291
|
if (rest.length === 2 && rest[0] === "Shift" && rest[1] !== "") {
|
|
288
|
-
return {
|
|
292
|
+
return { modifier, shift: true, key: rest[1] };
|
|
289
293
|
}
|
|
290
294
|
return void 0;
|
|
291
295
|
}
|
|
292
296
|
var MAC_GLYPHS = { Backspace: "\u232B", Delete: "\u2326" };
|
|
293
297
|
function formatChord(spec, mac) {
|
|
294
|
-
const chord = parseChord(spec);
|
|
298
|
+
const chord = parseChord(spec, mac);
|
|
295
299
|
if (!chord) return void 0;
|
|
296
|
-
if (!chord.
|
|
300
|
+
if (!chord.modifier) return mac ? MAC_GLYPHS[chord.key] ?? chord.key : chord.key;
|
|
297
301
|
const key = chord.key.length === 1 ? chord.key.toUpperCase() : chord.key;
|
|
298
302
|
if (mac) return `${chord.shift ? "\u21E7" : ""}\u2318${key}`;
|
|
299
303
|
return ["Ctrl", ...chord.shift ? ["Shift"] : [], key].join("+");
|
|
@@ -711,8 +715,8 @@ import {
|
|
|
711
715
|
groupPinY,
|
|
712
716
|
NODE_ROW_HEIGHT
|
|
713
717
|
} from "@lace-cloud/proto";
|
|
714
|
-
import { Handle, Position } from "@xyflow/react";
|
|
715
|
-
import { useCallback as useCallback3, useEffect as
|
|
718
|
+
import { Handle as Handle2, Position as Position2 } from "@xyflow/react";
|
|
719
|
+
import { useCallback as useCallback3, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef3, useState as useState4 } from "react";
|
|
716
720
|
|
|
717
721
|
// src/state/canvas-context.ts
|
|
718
722
|
import { createContext, useContext } from "react";
|
|
@@ -877,6 +881,141 @@ function BadgeRow({ badges }) {
|
|
|
877
881
|
)) });
|
|
878
882
|
}
|
|
879
883
|
|
|
884
|
+
// src/components/nodes/CallHandles.tsx
|
|
885
|
+
import { Handle, Position, useUpdateNodeInternals } from "@xyflow/react";
|
|
886
|
+
import { useEffect as useEffect2 } from "react";
|
|
887
|
+
|
|
888
|
+
// src/utils/handleId.ts
|
|
889
|
+
var NODE_HANDLE = "node";
|
|
890
|
+
function parseHandleId(handleId, prefix) {
|
|
891
|
+
if (!handleId) return null;
|
|
892
|
+
const marker = `${prefix}:`;
|
|
893
|
+
if (!handleId.startsWith(marker)) return null;
|
|
894
|
+
const name = handleId.slice(marker.length);
|
|
895
|
+
return name.length > 0 ? name : null;
|
|
896
|
+
}
|
|
897
|
+
function sourceHandleId(output) {
|
|
898
|
+
return `out:${output}`;
|
|
899
|
+
}
|
|
900
|
+
function targetHandleId(input) {
|
|
901
|
+
return `in:${input}`;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
// src/components/nodes/pinColor.ts
|
|
905
|
+
var STRING = {
|
|
906
|
+
fill: "var(--lace-pin-string-fill)",
|
|
907
|
+
stroke: "var(--lace-pin-string-stroke)",
|
|
908
|
+
ring: "var(--lace-pin-string-ring)"
|
|
909
|
+
};
|
|
910
|
+
var NUMBER = {
|
|
911
|
+
fill: "var(--lace-pin-number-fill)",
|
|
912
|
+
stroke: "var(--lace-pin-number-stroke)",
|
|
913
|
+
ring: "var(--lace-pin-number-ring)"
|
|
914
|
+
};
|
|
915
|
+
var BOOL = {
|
|
916
|
+
fill: "var(--lace-pin-bool-fill)",
|
|
917
|
+
stroke: "var(--lace-pin-bool-stroke)",
|
|
918
|
+
ring: "var(--lace-pin-bool-ring)"
|
|
919
|
+
};
|
|
920
|
+
var LIST = {
|
|
921
|
+
fill: "var(--lace-pin-list-fill)",
|
|
922
|
+
stroke: "var(--lace-pin-list-stroke)",
|
|
923
|
+
ring: "var(--lace-pin-list-ring)"
|
|
924
|
+
};
|
|
925
|
+
var MAP = {
|
|
926
|
+
fill: "var(--lace-pin-map-fill)",
|
|
927
|
+
stroke: "var(--lace-pin-map-stroke)",
|
|
928
|
+
ring: "var(--lace-pin-map-ring)"
|
|
929
|
+
};
|
|
930
|
+
var OBJECT = {
|
|
931
|
+
fill: "var(--lace-pin-object-fill)",
|
|
932
|
+
stroke: "var(--lace-pin-object-stroke)",
|
|
933
|
+
ring: "var(--lace-pin-object-ring)"
|
|
934
|
+
};
|
|
935
|
+
var ANY = {
|
|
936
|
+
fill: "var(--lace-pin-any-fill)",
|
|
937
|
+
stroke: "var(--lace-pin-any-stroke)",
|
|
938
|
+
ring: "var(--lace-pin-any-ring)"
|
|
939
|
+
};
|
|
940
|
+
var FAMILY_COLORS = {
|
|
941
|
+
string: STRING,
|
|
942
|
+
number: NUMBER,
|
|
943
|
+
bool: BOOL,
|
|
944
|
+
boolean: BOOL,
|
|
945
|
+
list: LIST,
|
|
946
|
+
set: LIST,
|
|
947
|
+
tuple: LIST,
|
|
948
|
+
map: MAP,
|
|
949
|
+
object: OBJECT,
|
|
950
|
+
any: ANY
|
|
951
|
+
};
|
|
952
|
+
var ANY_PIN_COLOR = ANY;
|
|
953
|
+
function inferTypeFamily(type) {
|
|
954
|
+
const t = (type || "").trim().toLowerCase();
|
|
955
|
+
if (t === "" || t === "any") return "any";
|
|
956
|
+
for (const family of ["list", "set", "tuple", "map", "object"]) {
|
|
957
|
+
if (t.startsWith(family)) return family;
|
|
958
|
+
}
|
|
959
|
+
return t;
|
|
960
|
+
}
|
|
961
|
+
function pinColor(pin) {
|
|
962
|
+
const family = pin.type_family ?? inferTypeFamily(pin.type);
|
|
963
|
+
return FAMILY_COLORS[family] ?? ANY;
|
|
964
|
+
}
|
|
965
|
+
function pinFace(color, wired) {
|
|
966
|
+
return wired ? { background: color.fill, borderColor: color.stroke } : { background: "var(--lace-node-bg)", borderColor: color.ring };
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
// src/components/nodes/CallHandles.tsx
|
|
970
|
+
import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
971
|
+
var handleStyle = (top, side) => ({
|
|
972
|
+
background: ANY_PIN_COLOR.fill,
|
|
973
|
+
borderColor: ANY_PIN_COLOR.stroke,
|
|
974
|
+
borderWidth: 1,
|
|
975
|
+
borderStyle: "solid",
|
|
976
|
+
width: 8,
|
|
977
|
+
height: 8,
|
|
978
|
+
top,
|
|
979
|
+
[side]: -4
|
|
980
|
+
});
|
|
981
|
+
var CallHandles = ({
|
|
982
|
+
nodeId,
|
|
983
|
+
callWired,
|
|
984
|
+
metaWired,
|
|
985
|
+
headerHeight
|
|
986
|
+
}) => {
|
|
987
|
+
const updateNodeInternals = useUpdateNodeInternals();
|
|
988
|
+
const drawn = `${callWired}|${metaWired.join("|")}`;
|
|
989
|
+
useEffect2(() => {
|
|
990
|
+
updateNodeInternals(nodeId);
|
|
991
|
+
}, [nodeId, drawn, updateNodeInternals]);
|
|
992
|
+
return /* @__PURE__ */ jsxs3(Fragment4, { children: [
|
|
993
|
+
callWired && /* @__PURE__ */ jsx7(
|
|
994
|
+
Handle,
|
|
995
|
+
{
|
|
996
|
+
id: sourceHandleId(""),
|
|
997
|
+
type: "source",
|
|
998
|
+
position: Position.Right,
|
|
999
|
+
isConnectable: false,
|
|
1000
|
+
className: "lace-pin-handle",
|
|
1001
|
+
style: handleStyle(headerHeight / 2, "right")
|
|
1002
|
+
}
|
|
1003
|
+
),
|
|
1004
|
+
metaWired.map((meta) => /* @__PURE__ */ jsx7(
|
|
1005
|
+
Handle,
|
|
1006
|
+
{
|
|
1007
|
+
id: targetHandleId(meta),
|
|
1008
|
+
type: "target",
|
|
1009
|
+
position: Position.Left,
|
|
1010
|
+
isConnectable: false,
|
|
1011
|
+
className: "lace-pin-handle",
|
|
1012
|
+
style: handleStyle(headerHeight / 2, "left")
|
|
1013
|
+
},
|
|
1014
|
+
meta
|
|
1015
|
+
))
|
|
1016
|
+
] });
|
|
1017
|
+
};
|
|
1018
|
+
|
|
880
1019
|
// src/components/nodes/CardActions.tsx
|
|
881
1020
|
import { inertProps as inertProps2, Tooltip as Tooltip2 } from "@lace-cloud/ui";
|
|
882
1021
|
import { useCallback, useMemo } from "react";
|
|
@@ -897,7 +1036,7 @@ function useEditorEnvExtras() {
|
|
|
897
1036
|
|
|
898
1037
|
// src/components/nodes/CardActions.tsx
|
|
899
1038
|
import "./CardActions-QLTNQUVW.css";
|
|
900
|
-
import { jsx as
|
|
1039
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
901
1040
|
function CardActions({ target }) {
|
|
902
1041
|
const { ctx, runner } = useCanvas();
|
|
903
1042
|
const envExtras = useEditorEnvExtras();
|
|
@@ -916,13 +1055,13 @@ function CardActions({ target }) {
|
|
|
916
1055
|
);
|
|
917
1056
|
return actions.map((action) => {
|
|
918
1057
|
const state = actionState(action, ctx, runner.busy(action, ctx, target));
|
|
919
|
-
return /* @__PURE__ */
|
|
1058
|
+
return /* @__PURE__ */ jsx8(
|
|
920
1059
|
Tooltip2,
|
|
921
1060
|
{
|
|
922
1061
|
name: action.label,
|
|
923
1062
|
content: state.disabledReason,
|
|
924
1063
|
placement: "bottom-end",
|
|
925
|
-
children: (describedBy) => /* @__PURE__ */
|
|
1064
|
+
children: (describedBy) => /* @__PURE__ */ jsx8(
|
|
926
1065
|
"button",
|
|
927
1066
|
{
|
|
928
1067
|
type: "button",
|
|
@@ -930,7 +1069,7 @@ function CardActions({ target }) {
|
|
|
930
1069
|
"aria-label": action.label,
|
|
931
1070
|
"aria-describedby": describedBy,
|
|
932
1071
|
...inertProps2(isInert(state), runOnCard(action)),
|
|
933
|
-
children: action.icon ? /* @__PURE__ */
|
|
1072
|
+
children: action.icon ? /* @__PURE__ */ jsx8(CanvasIcon, { name: action.icon }) : action.label
|
|
934
1073
|
}
|
|
935
1074
|
)
|
|
936
1075
|
},
|
|
@@ -948,7 +1087,7 @@ import { useCallback as useCallback2, useRef as useRef2 } from "react";
|
|
|
948
1087
|
|
|
949
1088
|
// src/core/pipeline.ts
|
|
950
1089
|
import { projectCanvasView } from "@lace-cloud/proto";
|
|
951
|
-
import { useEffect as
|
|
1090
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
952
1091
|
function projectFrame(frame, arrangement) {
|
|
953
1092
|
return projectCanvasView(frame.bundle, arrangement, {
|
|
954
1093
|
canUndo: frame.canUndo,
|
|
@@ -979,7 +1118,7 @@ function carrySelection(selection, oldPath, newPath) {
|
|
|
979
1118
|
var NO_SOURCE = { source: null, end: null, session: null };
|
|
980
1119
|
function useCanvasSource(source, onCommandResult, onSessionEnd) {
|
|
981
1120
|
const [held, setHeld] = useState3({ ...NO_SOURCE, port: null });
|
|
982
|
-
|
|
1121
|
+
useEffect3(() => {
|
|
983
1122
|
const session = {};
|
|
984
1123
|
const unsubscribe = source.subscribe(
|
|
985
1124
|
(next) => setHeld({ source: next, end: null, session, port: source }),
|
|
@@ -1028,7 +1167,7 @@ function useRenameInstance() {
|
|
|
1028
1167
|
}
|
|
1029
1168
|
|
|
1030
1169
|
// src/components/nodes/GroupNode.tsx
|
|
1031
|
-
import { jsx as
|
|
1170
|
+
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1032
1171
|
var GroupHeader = ({
|
|
1033
1172
|
label,
|
|
1034
1173
|
memberCount,
|
|
@@ -1043,13 +1182,13 @@ var GroupHeader = ({
|
|
|
1043
1182
|
onEditChange,
|
|
1044
1183
|
onEditBlur,
|
|
1045
1184
|
onEditKeyDown
|
|
1046
|
-
}) => /* @__PURE__ */
|
|
1185
|
+
}) => /* @__PURE__ */ jsxs4(
|
|
1047
1186
|
"div",
|
|
1048
1187
|
{
|
|
1049
1188
|
className: `lace-group-node__header lace-group-node__header--${collapsed ? "collapsed" : "expanded"}`,
|
|
1050
1189
|
style: collapsed ? { height: GROUP_HEADER_HEIGHT } : void 0,
|
|
1051
1190
|
children: [
|
|
1052
|
-
/* @__PURE__ */
|
|
1191
|
+
/* @__PURE__ */ jsx9(
|
|
1053
1192
|
"button",
|
|
1054
1193
|
{
|
|
1055
1194
|
type: "button",
|
|
@@ -1057,11 +1196,11 @@ var GroupHeader = ({
|
|
|
1057
1196
|
className: "lace-group-node__collapse-btn",
|
|
1058
1197
|
title: collapsed ? "Expand" : "Collapse",
|
|
1059
1198
|
"aria-label": collapsed ? "Expand" : "Collapse",
|
|
1060
|
-
children: /* @__PURE__ */
|
|
1199
|
+
children: /* @__PURE__ */ jsx9(CanvasIcon, { name: collapsed ? "chevron-right" : "chevron-down" })
|
|
1061
1200
|
}
|
|
1062
1201
|
),
|
|
1063
|
-
/* @__PURE__ */
|
|
1064
|
-
editing ? /* @__PURE__ */
|
|
1202
|
+
/* @__PURE__ */ jsx9("span", { className: "lace-group-node__glyph", children: /* @__PURE__ */ jsx9(CanvasIcon, { name: "group" }) }),
|
|
1203
|
+
editing ? /* @__PURE__ */ jsx9(
|
|
1065
1204
|
"input",
|
|
1066
1205
|
{
|
|
1067
1206
|
ref: inputRef,
|
|
@@ -1072,26 +1211,29 @@ var GroupHeader = ({
|
|
|
1072
1211
|
className: "lace-group-node__rename-input",
|
|
1073
1212
|
onClick: (e) => e.stopPropagation()
|
|
1074
1213
|
}
|
|
1075
|
-
) : /* @__PURE__ */
|
|
1076
|
-
/* @__PURE__ */
|
|
1214
|
+
) : /* @__PURE__ */ jsx9("span", { className: "lace-group-node__label", onDoubleClick, title: label, children: label }),
|
|
1215
|
+
/* @__PURE__ */ jsxs4("span", { className: "lace-group-node__count", children: [
|
|
1077
1216
|
memberCount,
|
|
1078
1217
|
" ",
|
|
1079
1218
|
memberCount === 1 ? "module" : "modules"
|
|
1080
1219
|
] }),
|
|
1081
|
-
hovered && /* @__PURE__ */
|
|
1220
|
+
hovered && /* @__PURE__ */ jsx9(CardActions, { target })
|
|
1082
1221
|
]
|
|
1083
1222
|
}
|
|
1084
1223
|
);
|
|
1085
|
-
var InterfacePinRow = ({
|
|
1224
|
+
var InterfacePinRow = ({
|
|
1225
|
+
pin,
|
|
1226
|
+
y,
|
|
1227
|
+
spans
|
|
1228
|
+
}) => {
|
|
1086
1229
|
const isInput = pin.side === "input";
|
|
1087
|
-
return /* @__PURE__ */
|
|
1230
|
+
return /* @__PURE__ */ jsxs4(
|
|
1088
1231
|
"div",
|
|
1089
1232
|
{
|
|
1090
1233
|
style: {
|
|
1091
1234
|
position: "absolute",
|
|
1092
1235
|
top: y - NODE_ROW_HEIGHT / 2,
|
|
1093
|
-
left: 0,
|
|
1094
|
-
right: 0,
|
|
1236
|
+
...spans ? { left: 0, right: 0 } : { [isInput ? "left" : "right"]: 0 },
|
|
1095
1237
|
height: NODE_ROW_HEIGHT,
|
|
1096
1238
|
paddingLeft: isInput ? 12 : 8,
|
|
1097
1239
|
paddingRight: isInput ? 8 : 12,
|
|
@@ -1101,12 +1243,12 @@ var InterfacePinRow = ({ pin, y }) => {
|
|
|
1101
1243
|
},
|
|
1102
1244
|
title: pin.name,
|
|
1103
1245
|
children: [
|
|
1104
|
-
/* @__PURE__ */
|
|
1105
|
-
|
|
1246
|
+
/* @__PURE__ */ jsx9(
|
|
1247
|
+
Handle2,
|
|
1106
1248
|
{
|
|
1107
1249
|
id: pin.handleId,
|
|
1108
1250
|
type: isInput ? "target" : "source",
|
|
1109
|
-
position: isInput ?
|
|
1251
|
+
position: isInput ? Position2.Left : Position2.Right,
|
|
1110
1252
|
isConnectable: false,
|
|
1111
1253
|
className: "lace-pin-handle",
|
|
1112
1254
|
style: {
|
|
@@ -1121,12 +1263,12 @@ var InterfacePinRow = ({ pin, y }) => {
|
|
|
1121
1263
|
}
|
|
1122
1264
|
}
|
|
1123
1265
|
),
|
|
1124
|
-
/* @__PURE__ */
|
|
1266
|
+
/* @__PURE__ */ jsx9("span", { className: "lace-group-node__pin-label", style: { maxWidth: COLLAPSED_GROUP_WIDTH - 28 }, children: pin.name })
|
|
1125
1267
|
]
|
|
1126
1268
|
}
|
|
1127
1269
|
);
|
|
1128
1270
|
};
|
|
1129
|
-
var GroupNode = ({ data }) => {
|
|
1271
|
+
var GroupNode = ({ id, data }) => {
|
|
1130
1272
|
const { editable, bundle, arrangement, updateArrangement } = useCanvas();
|
|
1131
1273
|
const rename = useRenameInstance();
|
|
1132
1274
|
const [editing, setEditing] = useState4(false);
|
|
@@ -1134,7 +1276,7 @@ var GroupNode = ({ data }) => {
|
|
|
1134
1276
|
const [hovered, setHovered] = useState4(false);
|
|
1135
1277
|
const inputRef = useRef3(null);
|
|
1136
1278
|
const collapsed = data.collapsed;
|
|
1137
|
-
|
|
1279
|
+
useEffect4(() => {
|
|
1138
1280
|
if (editing && inputRef.current) {
|
|
1139
1281
|
inputRef.current.focus();
|
|
1140
1282
|
inputRef.current.select();
|
|
@@ -1188,11 +1330,24 @@ var GroupNode = ({ data }) => {
|
|
|
1188
1330
|
onEditBlur: commitRename,
|
|
1189
1331
|
onEditKeyDown: onKeyDown
|
|
1190
1332
|
};
|
|
1333
|
+
const inputs = data.interfacePins.filter((p) => p.side === "input");
|
|
1334
|
+
const outputs = data.interfacePins.filter((p) => p.side === "output");
|
|
1335
|
+
const callHandles = /* @__PURE__ */ jsx9(
|
|
1336
|
+
CallHandles,
|
|
1337
|
+
{
|
|
1338
|
+
nodeId: id,
|
|
1339
|
+
callWired: data.callWired,
|
|
1340
|
+
metaWired: data.metaWired,
|
|
1341
|
+
headerHeight: GROUP_HEADER_HEIGHT
|
|
1342
|
+
}
|
|
1343
|
+
);
|
|
1344
|
+
const pinRows = (spans) => [
|
|
1345
|
+
...inputs.map((pin, i) => /* @__PURE__ */ jsx9(InterfacePinRow, { pin, y: groupPinY(i), spans }, pin.handleId)),
|
|
1346
|
+
...outputs.map((pin, i) => /* @__PURE__ */ jsx9(InterfacePinRow, { pin, y: groupPinY(i), spans }, pin.handleId))
|
|
1347
|
+
];
|
|
1191
1348
|
if (collapsed) {
|
|
1192
|
-
const inputs = data.interfacePins.filter((p) => p.side === "input");
|
|
1193
|
-
const outputs = data.interfacePins.filter((p) => p.side === "output");
|
|
1194
1349
|
const bare = data.interfacePins.length === 0;
|
|
1195
|
-
return /* @__PURE__ */
|
|
1350
|
+
return /* @__PURE__ */ jsxs4(
|
|
1196
1351
|
"div",
|
|
1197
1352
|
{
|
|
1198
1353
|
"data-group": data.groupId,
|
|
@@ -1202,15 +1357,15 @@ var GroupNode = ({ data }) => {
|
|
|
1202
1357
|
onMouseEnter: () => setHovered(true),
|
|
1203
1358
|
onMouseLeave: () => setHovered(false),
|
|
1204
1359
|
children: [
|
|
1205
|
-
/* @__PURE__ */
|
|
1206
|
-
/* @__PURE__ */
|
|
1207
|
-
|
|
1208
|
-
|
|
1360
|
+
/* @__PURE__ */ jsx9(GroupHeader, { ...headerProps }),
|
|
1361
|
+
/* @__PURE__ */ jsx9(BadgeRow, { badges: data.badges }),
|
|
1362
|
+
callHandles,
|
|
1363
|
+
pinRows(true)
|
|
1209
1364
|
]
|
|
1210
1365
|
}
|
|
1211
1366
|
);
|
|
1212
1367
|
}
|
|
1213
|
-
return /* @__PURE__ */
|
|
1368
|
+
return /* @__PURE__ */ jsxs4(
|
|
1214
1369
|
"div",
|
|
1215
1370
|
{
|
|
1216
1371
|
"data-group": data.groupId,
|
|
@@ -1220,8 +1375,10 @@ var GroupNode = ({ data }) => {
|
|
|
1220
1375
|
onMouseEnter: () => setHovered(true),
|
|
1221
1376
|
onMouseLeave: () => setHovered(false),
|
|
1222
1377
|
children: [
|
|
1223
|
-
/* @__PURE__ */
|
|
1224
|
-
/* @__PURE__ */
|
|
1378
|
+
/* @__PURE__ */ jsx9(GroupHeader, { ...headerProps }),
|
|
1379
|
+
/* @__PURE__ */ jsx9(BadgeRow, { badges: data.badges }),
|
|
1380
|
+
callHandles,
|
|
1381
|
+
pinRows(false)
|
|
1225
1382
|
]
|
|
1226
1383
|
}
|
|
1227
1384
|
);
|
|
@@ -1238,12 +1395,12 @@ import {
|
|
|
1238
1395
|
visibleInputs
|
|
1239
1396
|
} from "@lace-cloud/proto";
|
|
1240
1397
|
import {
|
|
1241
|
-
Handle as
|
|
1242
|
-
Position as
|
|
1398
|
+
Handle as Handle3,
|
|
1399
|
+
Position as Position3,
|
|
1243
1400
|
useStore as useStore3,
|
|
1244
|
-
useUpdateNodeInternals
|
|
1401
|
+
useUpdateNodeInternals as useUpdateNodeInternals2
|
|
1245
1402
|
} from "@xyflow/react";
|
|
1246
|
-
import { useCallback as useCallback4, useEffect as
|
|
1403
|
+
import { useCallback as useCallback4, useEffect as useEffect5, useMemo as useMemo3, useRef as useRef5, useState as useState5 } from "react";
|
|
1247
1404
|
|
|
1248
1405
|
// src/core/decorate.ts
|
|
1249
1406
|
import { nodeIdForDiagnostic } from "@lace-cloud/proto";
|
|
@@ -1302,19 +1459,6 @@ function diagnosticsBadge(held) {
|
|
|
1302
1459
|
};
|
|
1303
1460
|
}
|
|
1304
1461
|
|
|
1305
|
-
// src/utils/handleId.ts
|
|
1306
|
-
var NODE_HANDLE = "node";
|
|
1307
|
-
function parseHandleId(handleId, prefix) {
|
|
1308
|
-
if (!handleId) return null;
|
|
1309
|
-
const marker = `${prefix}:`;
|
|
1310
|
-
if (!handleId.startsWith(marker)) return null;
|
|
1311
|
-
const name = handleId.slice(marker.length);
|
|
1312
|
-
return name.length > 0 ? name : null;
|
|
1313
|
-
}
|
|
1314
|
-
function sourceHandleId(output) {
|
|
1315
|
-
return `out:${output}`;
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
1462
|
// src/utils/typed-name.ts
|
|
1319
1463
|
function typedName(name, type) {
|
|
1320
1464
|
return type ? `${name}: ${type}` : name;
|
|
@@ -1325,7 +1469,7 @@ import "./ModuleNode-LPPBJZCD.css";
|
|
|
1325
1469
|
|
|
1326
1470
|
// src/components/nodes/node-config-bus.tsx
|
|
1327
1471
|
import { createContext as createContext2, useContext as useContext2, useRef as useRef4 } from "react";
|
|
1328
|
-
import { jsx as
|
|
1472
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1329
1473
|
var NodeConfigBusContext = createContext2(null);
|
|
1330
1474
|
function NodeConfigBusProvider({
|
|
1331
1475
|
onOpen,
|
|
@@ -1334,7 +1478,7 @@ function NodeConfigBusProvider({
|
|
|
1334
1478
|
const onOpenRef = useRef4(onOpen);
|
|
1335
1479
|
onOpenRef.current = onOpen;
|
|
1336
1480
|
const stableRef = useRef4((instanceId) => onOpenRef.current(instanceId));
|
|
1337
|
-
return /* @__PURE__ */
|
|
1481
|
+
return /* @__PURE__ */ jsx10(NodeConfigBusContext.Provider, { value: stableRef.current, children });
|
|
1338
1482
|
}
|
|
1339
1483
|
function useOpenNodeConfig() {
|
|
1340
1484
|
const fn = useContext2(NodeConfigBusContext);
|
|
@@ -1342,63 +1486,8 @@ function useOpenNodeConfig() {
|
|
|
1342
1486
|
return fn;
|
|
1343
1487
|
}
|
|
1344
1488
|
|
|
1345
|
-
// src/components/nodes/pinColor.ts
|
|
1346
|
-
var STRING = {
|
|
1347
|
-
fill: "var(--lace-pin-string-fill)",
|
|
1348
|
-
stroke: "var(--lace-pin-string-stroke)"
|
|
1349
|
-
};
|
|
1350
|
-
var NUMBER = {
|
|
1351
|
-
fill: "var(--lace-pin-number-fill)",
|
|
1352
|
-
stroke: "var(--lace-pin-number-stroke)"
|
|
1353
|
-
};
|
|
1354
|
-
var BOOL = {
|
|
1355
|
-
fill: "var(--lace-pin-bool-fill)",
|
|
1356
|
-
stroke: "var(--lace-pin-bool-stroke)"
|
|
1357
|
-
};
|
|
1358
|
-
var LIST = {
|
|
1359
|
-
fill: "var(--lace-pin-list-fill)",
|
|
1360
|
-
stroke: "var(--lace-pin-list-stroke)"
|
|
1361
|
-
};
|
|
1362
|
-
var MAP = {
|
|
1363
|
-
fill: "var(--lace-pin-map-fill)",
|
|
1364
|
-
stroke: "var(--lace-pin-map-stroke)"
|
|
1365
|
-
};
|
|
1366
|
-
var OBJECT = {
|
|
1367
|
-
fill: "var(--lace-pin-object-fill)",
|
|
1368
|
-
stroke: "var(--lace-pin-object-stroke)"
|
|
1369
|
-
};
|
|
1370
|
-
var ANY = {
|
|
1371
|
-
fill: "var(--lace-pin-any-fill)",
|
|
1372
|
-
stroke: "var(--lace-pin-any-stroke)"
|
|
1373
|
-
};
|
|
1374
|
-
var FAMILY_COLORS = {
|
|
1375
|
-
string: STRING,
|
|
1376
|
-
number: NUMBER,
|
|
1377
|
-
bool: BOOL,
|
|
1378
|
-
boolean: BOOL,
|
|
1379
|
-
list: LIST,
|
|
1380
|
-
set: LIST,
|
|
1381
|
-
tuple: LIST,
|
|
1382
|
-
map: MAP,
|
|
1383
|
-
object: OBJECT,
|
|
1384
|
-
any: ANY
|
|
1385
|
-
};
|
|
1386
|
-
var ANY_PIN_COLOR = ANY;
|
|
1387
|
-
function inferTypeFamily(type) {
|
|
1388
|
-
const t = (type || "").trim().toLowerCase();
|
|
1389
|
-
if (t === "" || t === "any") return "any";
|
|
1390
|
-
for (const family of ["list", "set", "tuple", "map", "object"]) {
|
|
1391
|
-
if (t.startsWith(family)) return family;
|
|
1392
|
-
}
|
|
1393
|
-
return t;
|
|
1394
|
-
}
|
|
1395
|
-
function pinColor(pin) {
|
|
1396
|
-
const family = pin.type_family ?? inferTypeFamily(pin.type);
|
|
1397
|
-
return FAMILY_COLORS[family] ?? ANY;
|
|
1398
|
-
}
|
|
1399
|
-
|
|
1400
1489
|
// src/components/nodes/ModuleNode.tsx
|
|
1401
|
-
import { Fragment as
|
|
1490
|
+
import { Fragment as Fragment5, jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1402
1491
|
var ICON_SIZE = 16;
|
|
1403
1492
|
var LABEL_ROOM = NODE_WIDTH - 28;
|
|
1404
1493
|
var labelRoom = (shared) => shared ? LABEL_ROOM / 2 - 4 : LABEL_ROOM;
|
|
@@ -1409,14 +1498,14 @@ var PROBLEM_RING = {
|
|
|
1409
1498
|
neutral: void 0
|
|
1410
1499
|
};
|
|
1411
1500
|
var PinRow = ({ pin, side, top, shared, problem, isConnectable }) => {
|
|
1412
|
-
const color = pinColor(pin);
|
|
1413
1501
|
const isInput = side === "input";
|
|
1414
1502
|
const filled = !!pin.wired;
|
|
1503
|
+
const face = pinFace(pinColor(pin), filled);
|
|
1415
1504
|
const ring = problem ? PROBLEM_RING[problem.tone] : void 0;
|
|
1416
1505
|
const isError = problem?.tone === "error";
|
|
1417
|
-
const
|
|
1418
|
-
background:
|
|
1419
|
-
borderColor: ring ??
|
|
1506
|
+
const handleStyle2 = {
|
|
1507
|
+
background: face.background,
|
|
1508
|
+
borderColor: ring ?? face.borderColor,
|
|
1420
1509
|
borderWidth: ring ? 2 : 1.5,
|
|
1421
1510
|
borderStyle: "solid",
|
|
1422
1511
|
width: 10,
|
|
@@ -1425,7 +1514,7 @@ var PinRow = ({ pin, side, top, shared, problem, isConnectable }) => {
|
|
|
1425
1514
|
top: NODE_ROW_HEIGHT2 / 2
|
|
1426
1515
|
};
|
|
1427
1516
|
const about = `${typedName(pin.name, pin.type)}${pin.description ? ` \u2014 ${pin.description}` : ""}`;
|
|
1428
|
-
return /* @__PURE__ */
|
|
1517
|
+
return /* @__PURE__ */ jsxs5(
|
|
1429
1518
|
"div",
|
|
1430
1519
|
{
|
|
1431
1520
|
className: "lace-pin-row",
|
|
@@ -1444,18 +1533,18 @@ var PinRow = ({ pin, side, top, shared, problem, isConnectable }) => {
|
|
|
1444
1533
|
title: problem ? `${problem.message}
|
|
1445
1534
|
${about}` : about,
|
|
1446
1535
|
children: [
|
|
1447
|
-
/* @__PURE__ */
|
|
1448
|
-
|
|
1536
|
+
/* @__PURE__ */ jsx11(
|
|
1537
|
+
Handle3,
|
|
1449
1538
|
{
|
|
1450
|
-
id:
|
|
1539
|
+
id: isInput ? targetHandleId(pin.name) : sourceHandleId(pin.name),
|
|
1451
1540
|
type: isInput ? "target" : "source",
|
|
1452
|
-
position: isInput ?
|
|
1541
|
+
position: isInput ? Position3.Left : Position3.Right,
|
|
1453
1542
|
isConnectable,
|
|
1454
1543
|
className: "lace-pin-handle",
|
|
1455
|
-
style:
|
|
1544
|
+
style: handleStyle2
|
|
1456
1545
|
}
|
|
1457
1546
|
),
|
|
1458
|
-
/* @__PURE__ */
|
|
1547
|
+
/* @__PURE__ */ jsx11(
|
|
1459
1548
|
"span",
|
|
1460
1549
|
{
|
|
1461
1550
|
className: `lace-module-node__pin-row-label lace-module-node__pin-row-label--${isError ? "error" : filled ? "wired" : "default"}`,
|
|
@@ -1480,7 +1569,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1480
1569
|
const [showAllInputs, setShowAllInputs] = useState5(false);
|
|
1481
1570
|
const inputRef = useRef5(null);
|
|
1482
1571
|
const renamingRef = useRef5(false);
|
|
1483
|
-
|
|
1572
|
+
useEffect5(() => {
|
|
1484
1573
|
if (editing && inputRef.current) {
|
|
1485
1574
|
inputRef.current.focus();
|
|
1486
1575
|
inputRef.current.select();
|
|
@@ -1499,12 +1588,12 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1499
1588
|
};
|
|
1500
1589
|
}, [inputs, showAllInputs]);
|
|
1501
1590
|
const inputRows = shownInputs.length + (hiddenInputCount > 0 ? 1 : 0);
|
|
1502
|
-
const updateNodeInternals =
|
|
1591
|
+
const updateNodeInternals = useUpdateNodeInternals2();
|
|
1503
1592
|
const drawnHandles = [
|
|
1504
|
-
...shownInputs.map((pin) =>
|
|
1593
|
+
...shownInputs.map((pin) => targetHandleId(pin.name)),
|
|
1505
1594
|
...outputs.map((pin) => sourceHandleId(pin.name))
|
|
1506
1595
|
].join("|");
|
|
1507
|
-
|
|
1596
|
+
useEffect5(() => {
|
|
1508
1597
|
updateNodeInternals(id);
|
|
1509
1598
|
}, [id, drawnHandles, updateNodeInternals]);
|
|
1510
1599
|
const onDoubleClick = useCallback4(
|
|
@@ -1556,7 +1645,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1556
1645
|
const bodyHeight = rowCount * NODE_ROW_HEIGHT2;
|
|
1557
1646
|
const nodeHeight = NODE_HEADER_HEIGHT + bodyHeight;
|
|
1558
1647
|
const stateClass = hasAnyError ? "lace-module-node--error" : isNew ? "lace-module-node--new" : "";
|
|
1559
|
-
return /* @__PURE__ */
|
|
1648
|
+
return /* @__PURE__ */ jsxs5(
|
|
1560
1649
|
"div",
|
|
1561
1650
|
{
|
|
1562
1651
|
className: `lace-module-node${collapsed ? " lace-module-node--collapsed" : ""}${stateClass ? ` ${stateClass}` : ""}`,
|
|
@@ -1564,7 +1653,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1564
1653
|
onMouseEnter: () => setHovered(true),
|
|
1565
1654
|
onMouseLeave: () => setHovered(false),
|
|
1566
1655
|
children: [
|
|
1567
|
-
/* @__PURE__ */
|
|
1656
|
+
/* @__PURE__ */ jsxs5(
|
|
1568
1657
|
"div",
|
|
1569
1658
|
{
|
|
1570
1659
|
className: "lace-module-node__header",
|
|
@@ -1572,7 +1661,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1572
1661
|
onClick: onHeaderClick,
|
|
1573
1662
|
title: badges.length > 0 ? badges.map((b) => b.title ?? b.label).join("\n") : data.label,
|
|
1574
1663
|
children: [
|
|
1575
|
-
/* @__PURE__ */
|
|
1664
|
+
/* @__PURE__ */ jsx11(
|
|
1576
1665
|
"button",
|
|
1577
1666
|
{
|
|
1578
1667
|
type: "button",
|
|
@@ -1580,10 +1669,10 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1580
1669
|
className: "lace-module-node__collapse-btn",
|
|
1581
1670
|
title: collapsed ? "Expand" : "Collapse",
|
|
1582
1671
|
"aria-label": collapsed ? "Expand" : "Collapse",
|
|
1583
|
-
children: /* @__PURE__ */
|
|
1672
|
+
children: /* @__PURE__ */ jsx11(CanvasIcon, { name: collapsed ? "chevron-right" : "chevron-down" })
|
|
1584
1673
|
}
|
|
1585
1674
|
),
|
|
1586
|
-
showIcon ? /* @__PURE__ */
|
|
1675
|
+
showIcon ? /* @__PURE__ */ jsx11(
|
|
1587
1676
|
"img",
|
|
1588
1677
|
{
|
|
1589
1678
|
src: data.icon_url,
|
|
@@ -1592,8 +1681,8 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1592
1681
|
style: { width: ICON_SIZE, height: ICON_SIZE },
|
|
1593
1682
|
onError: () => setImgFailed(true)
|
|
1594
1683
|
}
|
|
1595
|
-
) : /* @__PURE__ */
|
|
1596
|
-
editing ? /* @__PURE__ */
|
|
1684
|
+
) : /* @__PURE__ */ jsx11("span", { className: "lace-module-node__icon-fallback", children: /* @__PURE__ */ jsx11(CanvasIcon, { name: "module" }) }),
|
|
1685
|
+
editing ? /* @__PURE__ */ jsx11(
|
|
1597
1686
|
"input",
|
|
1598
1687
|
{
|
|
1599
1688
|
ref: inputRef,
|
|
@@ -1604,7 +1693,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1604
1693
|
className: "lace-module-node__rename-input",
|
|
1605
1694
|
onClick: (e) => e.stopPropagation()
|
|
1606
1695
|
}
|
|
1607
|
-
) : /* @__PURE__ */
|
|
1696
|
+
) : /* @__PURE__ */ jsx11(
|
|
1608
1697
|
"span",
|
|
1609
1698
|
{
|
|
1610
1699
|
className: "lace-module-node__label",
|
|
@@ -1613,33 +1702,22 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1613
1702
|
children: data.label
|
|
1614
1703
|
}
|
|
1615
1704
|
),
|
|
1616
|
-
hovered && /* @__PURE__ */
|
|
1705
|
+
hovered && /* @__PURE__ */ jsx11(CardActions, { target })
|
|
1617
1706
|
]
|
|
1618
1707
|
}
|
|
1619
1708
|
),
|
|
1620
|
-
/* @__PURE__ */
|
|
1621
|
-
|
|
1622
|
-
|
|
1709
|
+
/* @__PURE__ */ jsx11(BadgeRow, { badges }),
|
|
1710
|
+
/* @__PURE__ */ jsx11(
|
|
1711
|
+
CallHandles,
|
|
1623
1712
|
{
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
className: "lace-pin-handle",
|
|
1629
|
-
style: {
|
|
1630
|
-
background: ANY_PIN_COLOR.fill,
|
|
1631
|
-
borderColor: ANY_PIN_COLOR.stroke,
|
|
1632
|
-
borderWidth: 1,
|
|
1633
|
-
borderStyle: "solid",
|
|
1634
|
-
width: 8,
|
|
1635
|
-
height: 8,
|
|
1636
|
-
top: NODE_HEADER_HEIGHT / 2,
|
|
1637
|
-
right: -4
|
|
1638
|
-
}
|
|
1713
|
+
nodeId: id,
|
|
1714
|
+
callWired: !!data.call_wired,
|
|
1715
|
+
metaWired: data.meta_wired ?? [],
|
|
1716
|
+
headerHeight: NODE_HEADER_HEIGHT
|
|
1639
1717
|
}
|
|
1640
1718
|
),
|
|
1641
|
-
!collapsed && /* @__PURE__ */
|
|
1642
|
-
shownInputs.map((pin, i) => /* @__PURE__ */
|
|
1719
|
+
!collapsed && /* @__PURE__ */ jsxs5("div", { className: "lace-module-node__body", style: { height: bodyHeight }, children: [
|
|
1720
|
+
shownInputs.map((pin, i) => /* @__PURE__ */ jsx11(
|
|
1643
1721
|
PinRow,
|
|
1644
1722
|
{
|
|
1645
1723
|
pin,
|
|
@@ -1651,7 +1729,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1651
1729
|
},
|
|
1652
1730
|
`in:${pin.name}`
|
|
1653
1731
|
)),
|
|
1654
|
-
outputs.map((pin, i) => /* @__PURE__ */
|
|
1732
|
+
outputs.map((pin, i) => /* @__PURE__ */ jsx11(
|
|
1655
1733
|
PinRow,
|
|
1656
1734
|
{
|
|
1657
1735
|
pin,
|
|
@@ -1662,7 +1740,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1662
1740
|
},
|
|
1663
1741
|
`out:${pin.name}`
|
|
1664
1742
|
)),
|
|
1665
|
-
hiddenInputCount > 0 && /* @__PURE__ */
|
|
1743
|
+
hiddenInputCount > 0 && /* @__PURE__ */ jsxs5(
|
|
1666
1744
|
"div",
|
|
1667
1745
|
{
|
|
1668
1746
|
className: "lace-module-node__hidden-count",
|
|
@@ -1687,20 +1765,19 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1687
1765
|
}
|
|
1688
1766
|
)
|
|
1689
1767
|
] }),
|
|
1690
|
-
collapsed && /* @__PURE__ */
|
|
1768
|
+
collapsed && /* @__PURE__ */ jsxs5(Fragment5, { children: [
|
|
1691
1769
|
inputs.map((pin, i) => {
|
|
1692
|
-
const
|
|
1693
|
-
return /* @__PURE__ */
|
|
1694
|
-
|
|
1770
|
+
const face = pinFace(pinColor(pin), !!pin.wired);
|
|
1771
|
+
return /* @__PURE__ */ jsx11(
|
|
1772
|
+
Handle3,
|
|
1695
1773
|
{
|
|
1696
|
-
id:
|
|
1774
|
+
id: targetHandleId(pin.name),
|
|
1697
1775
|
type: "target",
|
|
1698
|
-
position:
|
|
1776
|
+
position: Position3.Left,
|
|
1699
1777
|
isConnectable: editable,
|
|
1700
1778
|
className: "lace-pin-handle",
|
|
1701
1779
|
style: {
|
|
1702
|
-
|
|
1703
|
-
borderColor: pin.wired ? color.stroke : color.fill,
|
|
1780
|
+
...face,
|
|
1704
1781
|
borderWidth: 1,
|
|
1705
1782
|
borderStyle: "solid",
|
|
1706
1783
|
width: 8,
|
|
@@ -1709,22 +1786,21 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1709
1786
|
left: -4
|
|
1710
1787
|
}
|
|
1711
1788
|
},
|
|
1712
|
-
|
|
1789
|
+
targetHandleId(pin.name)
|
|
1713
1790
|
);
|
|
1714
1791
|
}),
|
|
1715
1792
|
outputs.map((pin, i) => {
|
|
1716
|
-
const
|
|
1717
|
-
return /* @__PURE__ */
|
|
1718
|
-
|
|
1793
|
+
const face = pinFace(pinColor(pin), !!pin.wired);
|
|
1794
|
+
return /* @__PURE__ */ jsx11(
|
|
1795
|
+
Handle3,
|
|
1719
1796
|
{
|
|
1720
|
-
id:
|
|
1797
|
+
id: sourceHandleId(pin.name),
|
|
1721
1798
|
type: "source",
|
|
1722
|
-
position:
|
|
1799
|
+
position: Position3.Right,
|
|
1723
1800
|
isConnectable: editable,
|
|
1724
1801
|
className: "lace-pin-handle",
|
|
1725
1802
|
style: {
|
|
1726
|
-
|
|
1727
|
-
borderColor: pin.wired ? color.stroke : color.fill,
|
|
1803
|
+
...face,
|
|
1728
1804
|
borderWidth: 1,
|
|
1729
1805
|
borderStyle: "solid",
|
|
1730
1806
|
width: 8,
|
|
@@ -1733,27 +1809,27 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1733
1809
|
right: -4
|
|
1734
1810
|
}
|
|
1735
1811
|
},
|
|
1736
|
-
|
|
1812
|
+
sourceHandleId(pin.name)
|
|
1737
1813
|
);
|
|
1738
1814
|
})
|
|
1739
1815
|
] }),
|
|
1740
|
-
editable && /* @__PURE__ */
|
|
1741
|
-
/* @__PURE__ */
|
|
1742
|
-
|
|
1816
|
+
editable && /* @__PURE__ */ jsxs5(Fragment5, { children: [
|
|
1817
|
+
/* @__PURE__ */ jsx11(
|
|
1818
|
+
Handle3,
|
|
1743
1819
|
{
|
|
1744
1820
|
id: NODE_HANDLE,
|
|
1745
1821
|
type: "source",
|
|
1746
|
-
position:
|
|
1822
|
+
position: Position3.Bottom,
|
|
1747
1823
|
onClick: void 0,
|
|
1748
1824
|
className: "lace-module-node__grip"
|
|
1749
1825
|
}
|
|
1750
1826
|
),
|
|
1751
|
-
/* @__PURE__ */
|
|
1752
|
-
|
|
1827
|
+
/* @__PURE__ */ jsx11(
|
|
1828
|
+
Handle3,
|
|
1753
1829
|
{
|
|
1754
1830
|
id: NODE_HANDLE,
|
|
1755
1831
|
type: "target",
|
|
1756
|
-
position:
|
|
1832
|
+
position: Position3.Top,
|
|
1757
1833
|
isConnectableStart: false,
|
|
1758
1834
|
isConnectableEnd: connecting,
|
|
1759
1835
|
className: "lace-module-node__drop"
|
|
@@ -1768,9 +1844,9 @@ var ModuleNode_default = ModuleNode;
|
|
|
1768
1844
|
|
|
1769
1845
|
// src/components/PaperGrid.tsx
|
|
1770
1846
|
import "./PaperGrid-JG4GBRDP.css";
|
|
1771
|
-
import { jsx as
|
|
1847
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1772
1848
|
function PaperGrid() {
|
|
1773
|
-
return /* @__PURE__ */
|
|
1849
|
+
return /* @__PURE__ */ jsx12("div", { className: "lace-paper-layers lace-canvas-paper", "aria-hidden": "true" });
|
|
1774
1850
|
}
|
|
1775
1851
|
|
|
1776
1852
|
// src/core/editor-actions.ts
|
|
@@ -2093,7 +2169,9 @@ var CORE_EDITOR_ACTIONS = [
|
|
|
2093
2169
|
icon: "redo",
|
|
2094
2170
|
section: "history",
|
|
2095
2171
|
placement: "toolbar",
|
|
2096
|
-
|
|
2172
|
+
// ⇧⌘Z / Ctrl+Shift+Z everywhere, and Ctrl+Y where Windows and Linux
|
|
2173
|
+
// bind it; the first is what the tooltip spells.
|
|
2174
|
+
keys: ["Mod+Shift+z", "Ctrl+y"],
|
|
2097
2175
|
requiredPorts: ["editor"],
|
|
2098
2176
|
requiredContext: ["editable"],
|
|
2099
2177
|
enabledWhen: [{ key: "redoable", reason: "Nothing to redo" }],
|
|
@@ -2226,7 +2304,7 @@ var CORE_EDITOR_ACTIONS = [
|
|
|
2226
2304
|
];
|
|
2227
2305
|
|
|
2228
2306
|
// src/core/use-action-keys.ts
|
|
2229
|
-
import { useEffect as
|
|
2307
|
+
import { useEffect as useEffect6 } from "react";
|
|
2230
2308
|
|
|
2231
2309
|
// src/contribution-types.ts
|
|
2232
2310
|
var KEY_SCOPES = ["surface", "app"];
|
|
@@ -2249,7 +2327,7 @@ function isFormTarget(target) {
|
|
|
2249
2327
|
return tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || target.isContentEditable;
|
|
2250
2328
|
}
|
|
2251
2329
|
function useFocusWhenNoneHeld(root, mounted) {
|
|
2252
|
-
|
|
2330
|
+
useEffect6(() => {
|
|
2253
2331
|
const element = root.current;
|
|
2254
2332
|
if (!mounted || !element) return;
|
|
2255
2333
|
const doc = element.ownerDocument;
|
|
@@ -2264,24 +2342,60 @@ function useFocusWhenNoneHeld(root, mounted) {
|
|
|
2264
2342
|
return () => view?.removeEventListener("focus", takeFocus);
|
|
2265
2343
|
}, [root, mounted]);
|
|
2266
2344
|
}
|
|
2345
|
+
var focusKeepers = /* @__PURE__ */ new WeakSet();
|
|
2346
|
+
function keeperOf(focused) {
|
|
2347
|
+
for (let at = focused.parentElement; at; at = at.parentElement) {
|
|
2348
|
+
if (focusKeepers.has(at)) return at;
|
|
2349
|
+
}
|
|
2350
|
+
return void 0;
|
|
2351
|
+
}
|
|
2352
|
+
function useFocusKeptOnRemoval(target, mounted) {
|
|
2353
|
+
useEffect6(() => {
|
|
2354
|
+
const element = target.current;
|
|
2355
|
+
if (!mounted || !element) return;
|
|
2356
|
+
const doc = element.ownerDocument;
|
|
2357
|
+
focusKeepers.add(element);
|
|
2358
|
+
let held;
|
|
2359
|
+
const onFocusIn = (e) => {
|
|
2360
|
+
const focused = e.target instanceof Element ? e.target : void 0;
|
|
2361
|
+
held = focused && keeperOf(focused) === element ? focused : void 0;
|
|
2362
|
+
};
|
|
2363
|
+
const observer = new MutationObserver(() => {
|
|
2364
|
+
if (!held || held.isConnected) return;
|
|
2365
|
+
held = void 0;
|
|
2366
|
+
if (doc.activeElement === null || doc.activeElement === doc.body) {
|
|
2367
|
+
element.focus({ preventScroll: true });
|
|
2368
|
+
}
|
|
2369
|
+
});
|
|
2370
|
+
element.addEventListener("focusin", onFocusIn);
|
|
2371
|
+
observer.observe(element, { childList: true, subtree: true });
|
|
2372
|
+
return () => {
|
|
2373
|
+
observer.disconnect();
|
|
2374
|
+
element.removeEventListener("focusin", onFocusIn);
|
|
2375
|
+
focusKeepers.delete(element);
|
|
2376
|
+
};
|
|
2377
|
+
}, [target, mounted]);
|
|
2378
|
+
}
|
|
2267
2379
|
function keyScopeOf(action) {
|
|
2268
2380
|
return action.keyScope ?? "surface";
|
|
2269
2381
|
}
|
|
2270
|
-
function matchesKey(e, spec) {
|
|
2271
|
-
const chord = parseChord(spec);
|
|
2382
|
+
function matchesKey(e, spec, mac) {
|
|
2383
|
+
const chord = parseChord(spec, mac);
|
|
2272
2384
|
if (!chord) return false;
|
|
2273
2385
|
const modHeld = e.metaKey || e.ctrlKey;
|
|
2274
|
-
|
|
2386
|
+
const held = { Mod: modHeld, Ctrl: e.ctrlKey && !e.metaKey };
|
|
2387
|
+
if (chord.modifier ? !held[chord.modifier] : modHeld || e.altKey) return false;
|
|
2275
2388
|
if (e.shiftKey !== chord.shift) return false;
|
|
2276
2389
|
return e.key.toLowerCase() === chord.key.toLowerCase();
|
|
2277
2390
|
}
|
|
2278
2391
|
function useActionKeys(actions, ctx, runner, envExtras) {
|
|
2279
|
-
|
|
2392
|
+
useEffect6(() => {
|
|
2280
2393
|
if (!ctx || !envExtras) return;
|
|
2281
2394
|
const activeCtx = ctx;
|
|
2282
2395
|
const activeEnvExtras = envExtras;
|
|
2283
2396
|
const targets = targetsByCtx.get(ctx) ?? {};
|
|
2284
2397
|
const target = {};
|
|
2398
|
+
const mac = isMacPlatform();
|
|
2285
2399
|
function bind(scope) {
|
|
2286
2400
|
const { handlesFormTargets } = KEY_SCOPE_RULES[scope];
|
|
2287
2401
|
const element = targets[scope];
|
|
@@ -2293,7 +2407,7 @@ function useActionKeys(actions, ctx, runner, envExtras) {
|
|
|
2293
2407
|
if (!handlesFormTargets && isFormTarget(e.target)) return;
|
|
2294
2408
|
for (const action of keyed) {
|
|
2295
2409
|
for (const spec of action.keys ?? []) {
|
|
2296
|
-
if (matchesKey(e, spec)) {
|
|
2410
|
+
if (matchesKey(e, spec, mac)) {
|
|
2297
2411
|
e.preventDefault();
|
|
2298
2412
|
e.stopPropagation();
|
|
2299
2413
|
void runner.run(action, activeCtx, target, activeEnvExtras);
|
|
@@ -2382,7 +2496,9 @@ function useGroupLogic(nodes, edges, groups, newNodeIds, decorations) {
|
|
|
2382
2496
|
collapsed: true,
|
|
2383
2497
|
hasErrors,
|
|
2384
2498
|
badges: groupBadges,
|
|
2385
|
-
interfacePins: pinsOf(group2)
|
|
2499
|
+
interfacePins: pinsOf(group2),
|
|
2500
|
+
callWired: !!group2.call_wired,
|
|
2501
|
+
metaWired: group2.meta_wired ?? []
|
|
2386
2502
|
}
|
|
2387
2503
|
});
|
|
2388
2504
|
} else {
|
|
@@ -2397,7 +2513,9 @@ function useGroupLogic(nodes, edges, groups, newNodeIds, decorations) {
|
|
|
2397
2513
|
collapsed: false,
|
|
2398
2514
|
hasErrors: hasErrorBadge(groupBadges),
|
|
2399
2515
|
badges: groupBadges,
|
|
2400
|
-
interfacePins:
|
|
2516
|
+
interfacePins: pinsOf(group2),
|
|
2517
|
+
callWired: !!group2.call_wired,
|
|
2518
|
+
metaWired: group2.meta_wired ?? []
|
|
2401
2519
|
}
|
|
2402
2520
|
});
|
|
2403
2521
|
}
|
|
@@ -2423,8 +2541,11 @@ function useGroupLogic(nodes, edges, groups, newNodeIds, decorations) {
|
|
|
2423
2541
|
}, [nodes, edges, groups, newNodeIds, decorations]);
|
|
2424
2542
|
}
|
|
2425
2543
|
function pinsOf(group2) {
|
|
2426
|
-
const pins = (side,
|
|
2427
|
-
return [
|
|
2544
|
+
const pins = (side, handleId, of = []) => of.map((pin) => ({ ...pin, handleId: handleId(pin.name), side, color: pinColor(pin) }));
|
|
2545
|
+
return [
|
|
2546
|
+
...pins("input", targetHandleId, group2.inputs),
|
|
2547
|
+
...pins("output", sourceHandleId, group2.outputs)
|
|
2548
|
+
];
|
|
2428
2549
|
}
|
|
2429
2550
|
function renderEdgeToRfEdge(e) {
|
|
2430
2551
|
return {
|
|
@@ -2432,20 +2553,20 @@ function renderEdgeToRfEdge(e) {
|
|
|
2432
2553
|
source: e.source,
|
|
2433
2554
|
target: e.target,
|
|
2434
2555
|
sourceHandle: sourceHandleId(e.source_output),
|
|
2435
|
-
targetHandle:
|
|
2556
|
+
targetHandle: targetHandleId(e.target_input),
|
|
2436
2557
|
data: { source_output: e.source_output, target_input: e.target_input },
|
|
2437
2558
|
type: DEPENDENCY_EDGE_TYPE
|
|
2438
2559
|
};
|
|
2439
2560
|
}
|
|
2440
2561
|
|
|
2441
2562
|
// src/hooks/useNewNodeTracking.ts
|
|
2442
|
-
import { useCallback as useCallback6, useEffect as
|
|
2563
|
+
import { useCallback as useCallback6, useEffect as useEffect7, useRef as useRef6, useState as useState7 } from "react";
|
|
2443
2564
|
function useNewNodeTracking(view) {
|
|
2444
2565
|
const [addedIds, setAddedIds] = useState7(/* @__PURE__ */ new Set());
|
|
2445
2566
|
const [newNodeIds, setNewNodeIds] = useState7(/* @__PURE__ */ new Set());
|
|
2446
2567
|
const prevCardIdsRef = useRef6(/* @__PURE__ */ new Set());
|
|
2447
2568
|
const sessionLoadedRef = useRef6(false);
|
|
2448
|
-
|
|
2569
|
+
useEffect7(() => {
|
|
2449
2570
|
if (!view) return;
|
|
2450
2571
|
const nodeIds = new Set(view.nodes.map((n) => n.id));
|
|
2451
2572
|
const cardIds = /* @__PURE__ */ new Set([...nodeIds, ...view.groups.map((g) => g.id)]);
|
|
@@ -2482,7 +2603,7 @@ function useNewNodeTracking(view) {
|
|
|
2482
2603
|
// src/hooks/useViewport.ts
|
|
2483
2604
|
import { extentOf as extentOf2 } from "@lace-cloud/proto";
|
|
2484
2605
|
import { useReactFlow as useReactFlow2 } from "@xyflow/react";
|
|
2485
|
-
import { useCallback as useCallback7, useEffect as
|
|
2606
|
+
import { useCallback as useCallback7, useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useMemo as useMemo5, useRef as useRef7 } from "react";
|
|
2486
2607
|
var FIT = { duration: 300, maxZoom: 1 };
|
|
2487
2608
|
var PAN_MS = 300;
|
|
2488
2609
|
var RESIZE_MS = 200;
|
|
@@ -2561,7 +2682,7 @@ function useViewport(pane, focusIds) {
|
|
|
2561
2682
|
else if (outcome.kind === "move") move(outcome.viewport, RESIZE_MS);
|
|
2562
2683
|
};
|
|
2563
2684
|
});
|
|
2564
|
-
|
|
2685
|
+
useEffect8(() => {
|
|
2565
2686
|
if (!pane || typeof ResizeObserver === "undefined") return;
|
|
2566
2687
|
let before = sightOf(pane).visible;
|
|
2567
2688
|
let judged = before;
|
|
@@ -2621,7 +2742,7 @@ function useViewport(pane, focusIds) {
|
|
|
2621
2742
|
}
|
|
2622
2743
|
|
|
2623
2744
|
// src/Canvas.tsx
|
|
2624
|
-
import { jsx as
|
|
2745
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2625
2746
|
var nodeTypes = {
|
|
2626
2747
|
moduleNode: ModuleNode_default,
|
|
2627
2748
|
groupNode: GroupNode_default
|
|
@@ -2654,24 +2775,24 @@ function CompositeEditor({
|
|
|
2654
2775
|
const viewport = useViewport(pane, focusIds);
|
|
2655
2776
|
const xyflowInitialized = useNodesInitialized();
|
|
2656
2777
|
const nodesInitialized = xyflowInitialized || view.nodes.length === 0;
|
|
2657
|
-
|
|
2778
|
+
useEffect9(() => {
|
|
2658
2779
|
registerGoToNode((nodeId) => {
|
|
2659
2780
|
if (!getNode(nodeId)) return;
|
|
2660
2781
|
viewport.panIntoView(getNodesBounds([nodeId]));
|
|
2661
2782
|
});
|
|
2662
2783
|
}, [registerGoToNode, getNode, getNodesBounds, viewport]);
|
|
2663
|
-
|
|
2784
|
+
useEffect9(() => {
|
|
2664
2785
|
layout.panIntoView = viewport.panIntoView;
|
|
2665
2786
|
}, [layout, viewport]);
|
|
2666
2787
|
const firedRef = useRef8(false);
|
|
2667
|
-
|
|
2788
|
+
useEffect9(() => {
|
|
2668
2789
|
if (firedRef.current || !pane || !nodesInitialized || view.nodes.length === 0) return;
|
|
2669
2790
|
firedRef.current = true;
|
|
2670
2791
|
requestAnimationFrame(viewport.fit);
|
|
2671
2792
|
}, [pane, nodesInitialized, view.nodes.length, viewport]);
|
|
2672
2793
|
const groupLogic = useGroupLogic(view.nodes, view.edges, view.groups, newNodeIds, decorations);
|
|
2673
2794
|
const revealedRef = useRef8(addedIds);
|
|
2674
|
-
|
|
2795
|
+
useEffect9(() => {
|
|
2675
2796
|
if (editing) return;
|
|
2676
2797
|
const shown = [...addedIds].filter((id) => !revealedRef.current.has(id)).flatMap((id) => {
|
|
2677
2798
|
const node = groupLogic.rfNodes.find((n) => n.id === id);
|
|
@@ -2688,7 +2809,7 @@ function CompositeEditor({
|
|
|
2688
2809
|
const selectedNodeIds = useMemo6(() => new Set(selection.nodes), [selection.nodes]);
|
|
2689
2810
|
const selectedEdgeIds = useMemo6(() => new Set(selection.edges), [selection.edges]);
|
|
2690
2811
|
const [rfEdges, setRfEdges] = useState8(rfEdgesFromView);
|
|
2691
|
-
|
|
2812
|
+
useEffect9(() => {
|
|
2692
2813
|
setRfEdges((prev) => {
|
|
2693
2814
|
const held = new Set(prev.filter((e) => e.selected).map((e) => e.id));
|
|
2694
2815
|
return rfEdgesFromView.map(
|
|
@@ -2705,7 +2826,7 @@ function CompositeEditor({
|
|
|
2705
2826
|
);
|
|
2706
2827
|
const rfNodesFromView = groupLogic.rfNodes;
|
|
2707
2828
|
const [rfNodes, setRfNodes] = useState8(rfNodesFromView);
|
|
2708
|
-
|
|
2829
|
+
useEffect9(() => {
|
|
2709
2830
|
setRfNodes((prev) => {
|
|
2710
2831
|
const current = new Map(prev.map((n) => [n.id, n]));
|
|
2711
2832
|
return rfNodesFromView.map((n) => {
|
|
@@ -2743,7 +2864,7 @@ function CompositeEditor({
|
|
|
2743
2864
|
style: { stroke: "var(--lace-canvas-edge-stroke)", strokeWidth: 1.5 },
|
|
2744
2865
|
animated: false
|
|
2745
2866
|
};
|
|
2746
|
-
return /* @__PURE__ */
|
|
2867
|
+
return /* @__PURE__ */ jsxs6(
|
|
2747
2868
|
ReactFlow,
|
|
2748
2869
|
{
|
|
2749
2870
|
onInit,
|
|
@@ -2783,9 +2904,9 @@ function CompositeEditor({
|
|
|
2783
2904
|
proOptions: { hideAttribution: true },
|
|
2784
2905
|
style: { background: "var(--lace-color-bg-canvas)" },
|
|
2785
2906
|
children: [
|
|
2786
|
-
/* @__PURE__ */
|
|
2787
|
-
/* @__PURE__ */
|
|
2788
|
-
nodesInitialized ? /* @__PURE__ */
|
|
2907
|
+
/* @__PURE__ */ jsx13(CanvasControls, { onFit: viewport.fit }),
|
|
2908
|
+
/* @__PURE__ */ jsx13(PaperGrid, {}),
|
|
2909
|
+
nodesInitialized ? /* @__PURE__ */ jsx13("div", { hidden: true, "data-rendered": "" }) : null
|
|
2789
2910
|
]
|
|
2790
2911
|
}
|
|
2791
2912
|
);
|
|
@@ -2821,12 +2942,12 @@ function Canvas({ height }) {
|
|
|
2821
2942
|
}, [selection, view.edges]);
|
|
2822
2943
|
const { contextMenu, showContextMenu, dismissContextMenu } = useContextMenu();
|
|
2823
2944
|
const { addedIds, newNodeIds, clearNew } = useNewNodeTracking(view);
|
|
2824
|
-
|
|
2945
|
+
useEffect9(() => {
|
|
2825
2946
|
clearNew(...selection.nodes);
|
|
2826
2947
|
}, [selection.nodes, clearNew]);
|
|
2827
2948
|
const [pane, setPane] = useState8(null);
|
|
2828
2949
|
const surfaceRef = useRef8(null);
|
|
2829
|
-
|
|
2950
|
+
useEffect9(() => {
|
|
2830
2951
|
registerKeyTarget(ctx, "surface", surfaceRef.current);
|
|
2831
2952
|
return () => registerKeyTarget(ctx, "surface", null);
|
|
2832
2953
|
}, [ctx]);
|
|
@@ -2834,6 +2955,7 @@ function Canvas({ height }) {
|
|
|
2834
2955
|
if (isFormTarget(e.target)) return;
|
|
2835
2956
|
surfaceRef.current?.focus();
|
|
2836
2957
|
}, []);
|
|
2958
|
+
useFocusKeptOnRemoval(surfaceRef, true);
|
|
2837
2959
|
const goToNodeRef = useRef8(null);
|
|
2838
2960
|
const registerGoToNode = useCallback8((fn) => {
|
|
2839
2961
|
goToNodeRef.current = fn;
|
|
@@ -2933,7 +3055,7 @@ function Canvas({ height }) {
|
|
|
2933
3055
|
},
|
|
2934
3056
|
[runner, menuCtx, menuTarget, makeEnvExtras]
|
|
2935
3057
|
);
|
|
2936
|
-
return /* @__PURE__ */
|
|
3058
|
+
return /* @__PURE__ */ jsx13(NodeConfigBusProvider, { onOpen: onOpenNodeConfig, children: /* @__PURE__ */ jsxs6(
|
|
2937
3059
|
"div",
|
|
2938
3060
|
{
|
|
2939
3061
|
ref: surfaceRef,
|
|
@@ -2948,7 +3070,7 @@ function Canvas({ height }) {
|
|
|
2948
3070
|
outline: "none"
|
|
2949
3071
|
},
|
|
2950
3072
|
children: [
|
|
2951
|
-
/* @__PURE__ */
|
|
3073
|
+
/* @__PURE__ */ jsx13(
|
|
2952
3074
|
ContextMenu,
|
|
2953
3075
|
{
|
|
2954
3076
|
contextMenu,
|
|
@@ -2958,8 +3080,8 @@ function Canvas({ height }) {
|
|
|
2958
3080
|
onDismiss: dismissContextMenu
|
|
2959
3081
|
}
|
|
2960
3082
|
),
|
|
2961
|
-
/* @__PURE__ */
|
|
2962
|
-
/* @__PURE__ */
|
|
3083
|
+
/* @__PURE__ */ jsxs6("div", { ref: setPane, style: { position: "relative", flex: "1 1 auto", minHeight: 0 }, children: [
|
|
3084
|
+
/* @__PURE__ */ jsx13(
|
|
2963
3085
|
CompositeEditor,
|
|
2964
3086
|
{
|
|
2965
3087
|
view,
|
|
@@ -2981,7 +3103,7 @@ function Canvas({ height }) {
|
|
|
2981
3103
|
decorations
|
|
2982
3104
|
}
|
|
2983
3105
|
),
|
|
2984
|
-
view.nodes.length === 0 && view.groups.length === 0 ? /* @__PURE__ */
|
|
3106
|
+
view.nodes.length === 0 && view.groups.length === 0 ? /* @__PURE__ */ jsx13(EmptyCanvas, { editable }) : null
|
|
2985
3107
|
] })
|
|
2986
3108
|
]
|
|
2987
3109
|
}
|
|
@@ -2998,7 +3120,7 @@ function readTokenPx(el, name) {
|
|
|
2998
3120
|
|
|
2999
3121
|
// src/components/Drawer.tsx
|
|
3000
3122
|
import "./Drawer-34ZYTEWE.css";
|
|
3001
|
-
import { jsx as
|
|
3123
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3002
3124
|
var KEY_STEP = 16;
|
|
3003
3125
|
function readDrawerBounds(el) {
|
|
3004
3126
|
const min = readTokenPx(el, "--lace-size-drawer-min");
|
|
@@ -3044,8 +3166,8 @@ function Drawer({ label, children }) {
|
|
|
3044
3166
|
setWidth(clampWidth(next, bounds));
|
|
3045
3167
|
};
|
|
3046
3168
|
const style = width === null ? void 0 : { "--drawer-width": `${width}px` };
|
|
3047
|
-
return /* @__PURE__ */
|
|
3048
|
-
/* @__PURE__ */
|
|
3169
|
+
return /* @__PURE__ */ jsxs7("aside", { ref, className: "lace-app__drawer", "aria-label": label, style, children: [
|
|
3170
|
+
/* @__PURE__ */ jsx14(
|
|
3049
3171
|
"div",
|
|
3050
3172
|
{
|
|
3051
3173
|
className: "lace-app__drawer-handle",
|
|
@@ -3062,19 +3184,19 @@ function Drawer({ label, children }) {
|
|
|
3062
3184
|
onKeyDown
|
|
3063
3185
|
}
|
|
3064
3186
|
),
|
|
3065
|
-
/* @__PURE__ */
|
|
3187
|
+
/* @__PURE__ */ jsx14("div", { className: "lace-app__drawer-body", children })
|
|
3066
3188
|
] });
|
|
3067
3189
|
}
|
|
3068
3190
|
|
|
3069
3191
|
// src/components/ErrorBoundary.tsx
|
|
3070
3192
|
import React from "react";
|
|
3071
3193
|
import "./ErrorBoundary-IXSIVZFH.css";
|
|
3072
|
-
import { jsx as
|
|
3194
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3073
3195
|
function ErrorState({ message }) {
|
|
3074
|
-
return /* @__PURE__ */
|
|
3075
|
-
/* @__PURE__ */
|
|
3076
|
-
/* @__PURE__ */
|
|
3077
|
-
/* @__PURE__ */
|
|
3196
|
+
return /* @__PURE__ */ jsxs8("div", { className: "lace-error-state", role: "alert", children: [
|
|
3197
|
+
/* @__PURE__ */ jsx15("h3", { className: "lace-error-state__title", children: "Something went wrong" }),
|
|
3198
|
+
/* @__PURE__ */ jsx15("pre", { className: "lace-error-state__message", children: message }),
|
|
3199
|
+
/* @__PURE__ */ jsx15(
|
|
3078
3200
|
"button",
|
|
3079
3201
|
{
|
|
3080
3202
|
type: "button",
|
|
@@ -3095,7 +3217,7 @@ var ErrorBoundary = class extends React.Component {
|
|
|
3095
3217
|
}
|
|
3096
3218
|
render() {
|
|
3097
3219
|
if (this.state.error) {
|
|
3098
|
-
return /* @__PURE__ */
|
|
3220
|
+
return /* @__PURE__ */ jsx15(ErrorState, { message: this.state.error.message });
|
|
3099
3221
|
}
|
|
3100
3222
|
return this.props.children;
|
|
3101
3223
|
}
|
|
@@ -3104,23 +3226,23 @@ var ErrorBoundary = class extends React.Component {
|
|
|
3104
3226
|
// src/components/ToolbarAction.tsx
|
|
3105
3227
|
import { Button, IconButton as IconButton2, Spinner } from "@lace-cloud/ui";
|
|
3106
3228
|
import "./ToolbarAction-PQNWHJSU.css";
|
|
3107
|
-
import { jsx as
|
|
3229
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3108
3230
|
var TIP = "bottom-start";
|
|
3109
3231
|
function actionTip(keys, reason) {
|
|
3110
3232
|
const chord = keys?.[0] ? formatChord(keys[0], isMacPlatform()) : void 0;
|
|
3111
3233
|
if (!chord && !reason) return void 0;
|
|
3112
|
-
return /* @__PURE__ */
|
|
3113
|
-
chord ? /* @__PURE__ */
|
|
3114
|
-
reason ? /* @__PURE__ */
|
|
3234
|
+
return /* @__PURE__ */ jsxs9("span", { className: "lace-action-tip", children: [
|
|
3235
|
+
chord ? /* @__PURE__ */ jsx16("kbd", { className: "lace-action-tip__key", children: chord }) : null,
|
|
3236
|
+
reason ? /* @__PURE__ */ jsx16("span", { className: "lace-action-tip__reason", children: reason }) : null
|
|
3115
3237
|
] });
|
|
3116
3238
|
}
|
|
3117
3239
|
function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, busyLabel, onRun }) {
|
|
3118
3240
|
const busy = busyLabel !== void 0;
|
|
3119
3241
|
const inert = isInert({ disabledReason: disabledReason2, busyLabel });
|
|
3120
3242
|
const tooltip = actionTip(action.keys, disabledReason2);
|
|
3121
|
-
const glyph = action.icon ? /* @__PURE__ */
|
|
3243
|
+
const glyph = action.icon ? /* @__PURE__ */ jsx16(CanvasIcon, { name: action.icon }) : void 0;
|
|
3122
3244
|
if (action.primary) {
|
|
3123
|
-
return /* @__PURE__ */
|
|
3245
|
+
return /* @__PURE__ */ jsx16(
|
|
3124
3246
|
Button,
|
|
3125
3247
|
{
|
|
3126
3248
|
rung: true,
|
|
@@ -3139,10 +3261,10 @@ function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, bu
|
|
|
3139
3261
|
);
|
|
3140
3262
|
}
|
|
3141
3263
|
if (glyph) {
|
|
3142
|
-
return /* @__PURE__ */
|
|
3264
|
+
return /* @__PURE__ */ jsx16(
|
|
3143
3265
|
IconButton2,
|
|
3144
3266
|
{
|
|
3145
|
-
icon: busy ? /* @__PURE__ */
|
|
3267
|
+
icon: busy ? /* @__PURE__ */ jsx16(Spinner, { size: 14, "aria-hidden": "true" }) : glyph,
|
|
3146
3268
|
"aria-label": action.label,
|
|
3147
3269
|
size: "md",
|
|
3148
3270
|
"aria-disabled": inert,
|
|
@@ -3152,7 +3274,7 @@ function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, bu
|
|
|
3152
3274
|
}
|
|
3153
3275
|
);
|
|
3154
3276
|
}
|
|
3155
|
-
return /* @__PURE__ */
|
|
3277
|
+
return /* @__PURE__ */ jsx16(
|
|
3156
3278
|
Button,
|
|
3157
3279
|
{
|
|
3158
3280
|
rung: true,
|
|
@@ -3172,7 +3294,7 @@ function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, bu
|
|
|
3172
3294
|
|
|
3173
3295
|
// src/core/CommandArgsForm.tsx
|
|
3174
3296
|
import { useState as useState10 } from "react";
|
|
3175
|
-
import { jsx as
|
|
3297
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3176
3298
|
function flagsOf(path) {
|
|
3177
3299
|
return COMMANDS[path].flags;
|
|
3178
3300
|
}
|
|
@@ -3180,7 +3302,7 @@ function CommandArgsForm({ form }) {
|
|
|
3180
3302
|
const [values, setValues] = useState10({});
|
|
3181
3303
|
if (!form) return null;
|
|
3182
3304
|
const flags = isCommandPath(form.path) ? flagsOf(form.path) : {};
|
|
3183
|
-
return /* @__PURE__ */
|
|
3305
|
+
return /* @__PURE__ */ jsxs10(
|
|
3184
3306
|
"form",
|
|
3185
3307
|
{
|
|
3186
3308
|
className: "lace-command-args-form",
|
|
@@ -3191,16 +3313,16 @@ function CommandArgsForm({ form }) {
|
|
|
3191
3313
|
children: [
|
|
3192
3314
|
form.missing.map((key) => {
|
|
3193
3315
|
const flagType = flags[key]?.type;
|
|
3194
|
-
return /* @__PURE__ */
|
|
3195
|
-
/* @__PURE__ */
|
|
3196
|
-
flagType === "bool" ? /* @__PURE__ */
|
|
3316
|
+
return /* @__PURE__ */ jsxs10("label", { className: "lace-command-args-form__field", children: [
|
|
3317
|
+
/* @__PURE__ */ jsx17("span", { children: key }),
|
|
3318
|
+
flagType === "bool" ? /* @__PURE__ */ jsx17(
|
|
3197
3319
|
"input",
|
|
3198
3320
|
{
|
|
3199
3321
|
type: "checkbox",
|
|
3200
3322
|
checked: Boolean(values[key]),
|
|
3201
3323
|
onChange: (e) => setValues((prev) => ({ ...prev, [key]: e.target.checked }))
|
|
3202
3324
|
}
|
|
3203
|
-
) : /* @__PURE__ */
|
|
3325
|
+
) : /* @__PURE__ */ jsx17(
|
|
3204
3326
|
"input",
|
|
3205
3327
|
{
|
|
3206
3328
|
type: "text",
|
|
@@ -3211,9 +3333,9 @@ function CommandArgsForm({ form }) {
|
|
|
3211
3333
|
)
|
|
3212
3334
|
] }, key);
|
|
3213
3335
|
}),
|
|
3214
|
-
/* @__PURE__ */
|
|
3215
|
-
/* @__PURE__ */
|
|
3216
|
-
/* @__PURE__ */
|
|
3336
|
+
/* @__PURE__ */ jsxs10("div", { className: "lace-command-args-form__actions", children: [
|
|
3337
|
+
/* @__PURE__ */ jsx17("button", { type: "submit", children: "Continue" }),
|
|
3338
|
+
/* @__PURE__ */ jsx17("button", { type: "button", onClick: form.cancel, children: "Cancel" })
|
|
3217
3339
|
] })
|
|
3218
3340
|
]
|
|
3219
3341
|
}
|
|
@@ -3227,11 +3349,11 @@ import { nodeIdForAddress } from "@lace-cloud/proto";
|
|
|
3227
3349
|
import { useMemo as useMemo9 } from "react";
|
|
3228
3350
|
|
|
3229
3351
|
// src/core/use-command-read.ts
|
|
3230
|
-
import { useEffect as
|
|
3352
|
+
import { useEffect as useEffect10, useMemo as useMemo8, useRef as useRef10, useState as useState11 } from "react";
|
|
3231
3353
|
|
|
3232
3354
|
// src/core/panel-scope.tsx
|
|
3233
3355
|
import { createContext as createContext3, useContext as useContext3, useMemo as useMemo7 } from "react";
|
|
3234
|
-
import { jsx as
|
|
3356
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
3235
3357
|
var noopReportError = () => {
|
|
3236
3358
|
};
|
|
3237
3359
|
var PanelScopeContext = createContext3(null);
|
|
@@ -3248,7 +3370,7 @@ function PanelScope({
|
|
|
3248
3370
|
() => ({ ctx, target, paths: new Set(paths), tick, reportError }),
|
|
3249
3371
|
[ctx, target, paths, tick, reportError]
|
|
3250
3372
|
);
|
|
3251
|
-
return /* @__PURE__ */
|
|
3373
|
+
return /* @__PURE__ */ jsx18(PanelScopeContext.Provider, { value, children });
|
|
3252
3374
|
}
|
|
3253
3375
|
function usePanelScope() {
|
|
3254
3376
|
const value = useContext3(PanelScopeContext);
|
|
@@ -3294,11 +3416,11 @@ function useCommandRead(read, target) {
|
|
|
3294
3416
|
reportError: scope.reportError
|
|
3295
3417
|
};
|
|
3296
3418
|
const inputsRef = useRef10(inputs);
|
|
3297
|
-
|
|
3419
|
+
useEffect10(() => {
|
|
3298
3420
|
inputsRef.current = inputs;
|
|
3299
3421
|
});
|
|
3300
3422
|
const request = useMemo8(() => ({ key, tick: scope.tick }), [key, scope.tick]);
|
|
3301
|
-
|
|
3423
|
+
useEffect10(() => {
|
|
3302
3424
|
const { path, args: args2, commands, reportError } = inputsRef.current;
|
|
3303
3425
|
const keyChanged = prevKeyRef.current !== request.key;
|
|
3304
3426
|
prevKeyRef.current = request.key;
|
|
@@ -3400,24 +3522,24 @@ import { Button as Button2 } from "@lace-cloud/ui";
|
|
|
3400
3522
|
|
|
3401
3523
|
// src/components/Banner.tsx
|
|
3402
3524
|
import "./Banner-4TSIKYLF.css";
|
|
3403
|
-
import { jsx as
|
|
3525
|
+
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3404
3526
|
function Banner({ severity, message, className, actions }) {
|
|
3405
|
-
return /* @__PURE__ */
|
|
3527
|
+
return /* @__PURE__ */ jsxs11(
|
|
3406
3528
|
"div",
|
|
3407
3529
|
{
|
|
3408
3530
|
className: `lace-banner lace-banner--${severity} ${className}`,
|
|
3409
3531
|
role: severity === "error" ? "alert" : "status",
|
|
3410
3532
|
children: [
|
|
3411
|
-
/* @__PURE__ */
|
|
3412
|
-
/* @__PURE__ */
|
|
3413
|
-
actions ? /* @__PURE__ */
|
|
3533
|
+
/* @__PURE__ */ jsx19("span", { className: "lace-banner__icon", children: /* @__PURE__ */ jsx19(CanvasIcon, { name: severity }) }),
|
|
3534
|
+
/* @__PURE__ */ jsx19("span", { className: "lace-banner__message", children: message }),
|
|
3535
|
+
actions ? /* @__PURE__ */ jsx19("span", { className: "lace-banner__actions", children: actions }) : null
|
|
3414
3536
|
]
|
|
3415
3537
|
}
|
|
3416
3538
|
);
|
|
3417
3539
|
}
|
|
3418
3540
|
|
|
3419
3541
|
// src/core/panels/RowActionBanner.tsx
|
|
3420
|
-
import { jsx as
|
|
3542
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
3421
3543
|
function bannerMessage(opening, actions) {
|
|
3422
3544
|
return [opening, ...actions.flatMap((action) => action.choice ? [action.choice] : [])].join(
|
|
3423
3545
|
" "
|
|
@@ -3427,7 +3549,7 @@ function RowActionBanner({ ctx, panelId, severity, className, opening }) {
|
|
|
3427
3549
|
const { runner } = useCanvas();
|
|
3428
3550
|
const envExtras = useEditorEnvExtras();
|
|
3429
3551
|
const actions = rowActionsFor(ctx, panelId);
|
|
3430
|
-
return /* @__PURE__ */
|
|
3552
|
+
return /* @__PURE__ */ jsx20(
|
|
3431
3553
|
Banner,
|
|
3432
3554
|
{
|
|
3433
3555
|
severity,
|
|
@@ -3435,7 +3557,7 @@ function RowActionBanner({ ctx, panelId, severity, className, opening }) {
|
|
|
3435
3557
|
message: bannerMessage(opening, actions),
|
|
3436
3558
|
actions: actions.length === 0 ? void 0 : actions.map((action) => {
|
|
3437
3559
|
const state = actionState(action, ctx, runner.busy(action, ctx, {}));
|
|
3438
|
-
return /* @__PURE__ */
|
|
3560
|
+
return /* @__PURE__ */ jsx20(
|
|
3439
3561
|
Button2,
|
|
3440
3562
|
{
|
|
3441
3563
|
rung: true,
|
|
@@ -3456,9 +3578,9 @@ function RowActionBanner({ ctx, panelId, severity, className, opening }) {
|
|
|
3456
3578
|
}
|
|
3457
3579
|
|
|
3458
3580
|
// src/core/panels/ConflictBanner.tsx
|
|
3459
|
-
import { jsx as
|
|
3581
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
3460
3582
|
function ConflictBanner({ ctx }) {
|
|
3461
|
-
return /* @__PURE__ */
|
|
3583
|
+
return /* @__PURE__ */ jsx21(
|
|
3462
3584
|
RowActionBanner,
|
|
3463
3585
|
{
|
|
3464
3586
|
ctx,
|
|
@@ -3482,17 +3604,17 @@ var conflictPanel = {
|
|
|
3482
3604
|
import { Button as Button3 } from "@lace-cloud/ui";
|
|
3483
3605
|
|
|
3484
3606
|
// src/components/Identifier.tsx
|
|
3485
|
-
import { Fragment as
|
|
3607
|
+
import { Fragment as Fragment6 } from "react";
|
|
3486
3608
|
import "./Identifier-V6MZ37EG.css";
|
|
3487
|
-
import { jsx as
|
|
3609
|
+
import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3488
3610
|
function identifierSegments(text) {
|
|
3489
3611
|
return text.split(/(?<=[_.])/);
|
|
3490
3612
|
}
|
|
3491
3613
|
function Identifier({ text, className }) {
|
|
3492
|
-
return /* @__PURE__ */
|
|
3614
|
+
return /* @__PURE__ */ jsx22("span", { className: className ? `lace-identifier ${className}` : "lace-identifier", children: identifierSegments(text).map((segment, i) => (
|
|
3493
3615
|
// biome-ignore lint/suspicious/noArrayIndexKey: a segment's place in the name is its identity.
|
|
3494
|
-
/* @__PURE__ */
|
|
3495
|
-
i > 0 ? /* @__PURE__ */
|
|
3616
|
+
/* @__PURE__ */ jsxs12(Fragment6, { children: [
|
|
3617
|
+
i > 0 ? /* @__PURE__ */ jsx22("wbr", {}) : null,
|
|
3496
3618
|
segment
|
|
3497
3619
|
] }, i)
|
|
3498
3620
|
)) });
|
|
@@ -3500,7 +3622,7 @@ function Identifier({ text, className }) {
|
|
|
3500
3622
|
|
|
3501
3623
|
// src/core/panels/DiagnosticsPanel.tsx
|
|
3502
3624
|
import "./DiagnosticsPanel-MSK72CGM.css";
|
|
3503
|
-
import { jsx as
|
|
3625
|
+
import { jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3504
3626
|
function locationOf(file, line) {
|
|
3505
3627
|
return line === void 0 ? file : `${file}:${line}`;
|
|
3506
3628
|
}
|
|
@@ -3511,36 +3633,36 @@ function DiagnosticsPanel({ ctx }) {
|
|
|
3511
3633
|
const { runner } = useCanvas();
|
|
3512
3634
|
const envExtras = useEditorEnvExtras();
|
|
3513
3635
|
const diagnostics = ctx.diagnostics;
|
|
3514
|
-
return /* @__PURE__ */
|
|
3636
|
+
return /* @__PURE__ */ jsx23("ul", { className: "lace-diagnostics-panel", role: "list", children: diagnostics.map((d, index) => {
|
|
3515
3637
|
const key = rowKey(d, index);
|
|
3516
3638
|
const target = { diagnostic: d };
|
|
3517
3639
|
const actions = rowActionsFor(ctx, "diagnostics", target);
|
|
3518
|
-
return /* @__PURE__ */
|
|
3640
|
+
return /* @__PURE__ */ jsxs13(
|
|
3519
3641
|
"li",
|
|
3520
3642
|
{
|
|
3521
3643
|
className: `lace-diagnostics-panel__row lace-diagnostics-panel__row--${d.severity}`,
|
|
3522
3644
|
children: [
|
|
3523
|
-
/* @__PURE__ */
|
|
3524
|
-
/* @__PURE__ */
|
|
3525
|
-
/* @__PURE__ */
|
|
3526
|
-
d.file !== void 0 && /* @__PURE__ */
|
|
3645
|
+
/* @__PURE__ */ jsx23("span", { className: "lace-diagnostics-panel__icon", children: /* @__PURE__ */ jsx23(CanvasIcon, { name: d.severity }) }),
|
|
3646
|
+
/* @__PURE__ */ jsxs13("span", { className: "lace-diagnostics-panel__body", children: [
|
|
3647
|
+
/* @__PURE__ */ jsx23("span", { className: "lace-diagnostics-panel__message", children: d.message }),
|
|
3648
|
+
d.file !== void 0 && /* @__PURE__ */ jsx23(
|
|
3527
3649
|
Identifier,
|
|
3528
3650
|
{
|
|
3529
3651
|
className: "lace-diagnostics-panel__file",
|
|
3530
3652
|
text: locationOf(d.file, d.line)
|
|
3531
3653
|
}
|
|
3532
3654
|
),
|
|
3533
|
-
d.instance_id !== void 0 && /* @__PURE__ */
|
|
3655
|
+
d.instance_id !== void 0 && /* @__PURE__ */ jsx23(
|
|
3534
3656
|
Identifier,
|
|
3535
3657
|
{
|
|
3536
3658
|
className: "lace-diagnostics-panel__where",
|
|
3537
3659
|
text: d.input_name ? `${d.instance_id}.${d.input_name}` : d.instance_id
|
|
3538
3660
|
}
|
|
3539
3661
|
),
|
|
3540
|
-
d.code !== void 0 && /* @__PURE__ */
|
|
3662
|
+
d.code !== void 0 && /* @__PURE__ */ jsx23(Identifier, { className: "lace-diagnostics-panel__code", text: d.code }),
|
|
3541
3663
|
actions.map((action) => {
|
|
3542
3664
|
const state = actionState(action, ctx, runner.busy(action, ctx, target));
|
|
3543
|
-
return /* @__PURE__ */
|
|
3665
|
+
return /* @__PURE__ */ jsx23(
|
|
3544
3666
|
Button3,
|
|
3545
3667
|
{
|
|
3546
3668
|
rung: true,
|
|
@@ -3583,7 +3705,7 @@ import { createElement } from "react";
|
|
|
3583
3705
|
import { callText } from "@lace-cloud/proto";
|
|
3584
3706
|
import { Button as Button4, Panel } from "@lace-cloud/ui";
|
|
3585
3707
|
import "./EdgeInspectorPanel-JD6CVUAT.css";
|
|
3586
|
-
import { jsx as
|
|
3708
|
+
import { jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3587
3709
|
function EdgeInspectorPanel({
|
|
3588
3710
|
source,
|
|
3589
3711
|
target,
|
|
@@ -3592,23 +3714,23 @@ function EdgeInspectorPanel({
|
|
|
3592
3714
|
onDelete,
|
|
3593
3715
|
onClose
|
|
3594
3716
|
}) {
|
|
3595
|
-
const title = /* @__PURE__ */
|
|
3596
|
-
/* @__PURE__ */
|
|
3597
|
-
/* @__PURE__ */
|
|
3598
|
-
/* @__PURE__ */
|
|
3717
|
+
const title = /* @__PURE__ */ jsxs14("div", { children: [
|
|
3718
|
+
/* @__PURE__ */ jsx24("div", { className: "lace-edge-panel__title-eyebrow", children: "Connection" }),
|
|
3719
|
+
/* @__PURE__ */ jsxs14("div", { className: "lace-edge-panel__title", children: [
|
|
3720
|
+
/* @__PURE__ */ jsx24(Identifier, { text: source }),
|
|
3599
3721
|
" \u2192 ",
|
|
3600
|
-
/* @__PURE__ */
|
|
3722
|
+
/* @__PURE__ */ jsx24(Identifier, { text: target })
|
|
3601
3723
|
] })
|
|
3602
3724
|
] });
|
|
3603
|
-
const footer = onDelete ? /* @__PURE__ */
|
|
3604
|
-
return /* @__PURE__ */
|
|
3605
|
-
/* @__PURE__ */
|
|
3606
|
-
/* @__PURE__ */
|
|
3607
|
-
/* @__PURE__ */
|
|
3608
|
-
/* @__PURE__ */
|
|
3609
|
-
/* @__PURE__ */
|
|
3725
|
+
const footer = onDelete ? /* @__PURE__ */ jsx24(Button4, { rung: true, variant: "danger", fullWidth: true, onClick: onDelete, children: "Delete connection" }) : void 0;
|
|
3726
|
+
return /* @__PURE__ */ jsxs14(Panel, { title, footer, onClose, children: [
|
|
3727
|
+
/* @__PURE__ */ jsx24("div", { className: "lace-edge-panel__section-label", children: "Wiring" }),
|
|
3728
|
+
/* @__PURE__ */ jsxs14("div", { className: "lace-edge-panel__wiring", children: [
|
|
3729
|
+
/* @__PURE__ */ jsx24(Identifier, { text: sourceOutput ? `${source}.outputs.${sourceOutput}` : callText(source) }),
|
|
3730
|
+
/* @__PURE__ */ jsx24("div", { className: "lace-edge-panel__wiring-arrow", children: "\u2193" }),
|
|
3731
|
+
/* @__PURE__ */ jsx24(Identifier, { text: `${target}.inputs.${targetInput}` })
|
|
3610
3732
|
] }),
|
|
3611
|
-
onDelete && /* @__PURE__ */
|
|
3733
|
+
onDelete && /* @__PURE__ */ jsx24("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." })
|
|
3612
3734
|
] });
|
|
3613
3735
|
}
|
|
3614
3736
|
|
|
@@ -3671,9 +3793,9 @@ var edgeInspectorPanel = {
|
|
|
3671
3793
|
|
|
3672
3794
|
// src/core/panels/Markers.tsx
|
|
3673
3795
|
import { Badge } from "@lace-cloud/ui";
|
|
3674
|
-
import { jsx as
|
|
3796
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
3675
3797
|
function UnsavedMarker() {
|
|
3676
|
-
return /* @__PURE__ */
|
|
3798
|
+
return /* @__PURE__ */ jsx25(Badge, { variant: "warning", dot: true, role: "status", className: "lace-marker lace-marker--unsaved", children: "Unsaved" });
|
|
3677
3799
|
}
|
|
3678
3800
|
var unsavedMarker = {
|
|
3679
3801
|
id: "unsaved-marker",
|
|
@@ -3685,7 +3807,7 @@ var unsavedMarker = {
|
|
|
3685
3807
|
Component: UnsavedMarker
|
|
3686
3808
|
};
|
|
3687
3809
|
function UngeneratedMarker() {
|
|
3688
|
-
return /* @__PURE__ */
|
|
3810
|
+
return /* @__PURE__ */ jsx25(Badge, { variant: "neutral", role: "status", className: "lace-marker lace-marker--ungenerated", children: "Not generated" });
|
|
3689
3811
|
}
|
|
3690
3812
|
var ungeneratedMarker = {
|
|
3691
3813
|
id: "ungenerated-marker",
|
|
@@ -3717,7 +3839,7 @@ import { useMemo as useMemo11 } from "react";
|
|
|
3717
3839
|
import { useState as useState13 } from "react";
|
|
3718
3840
|
|
|
3719
3841
|
// src/hooks/useUpdateState.ts
|
|
3720
|
-
import { useCallback as useCallback10, useEffect as
|
|
3842
|
+
import { useCallback as useCallback10, useEffect as useEffect11, useRef as useRef11, useState as useState12 } from "react";
|
|
3721
3843
|
function useUpdateState(updateFn) {
|
|
3722
3844
|
const [status, setStatus] = useState12("idle");
|
|
3723
3845
|
const mountedRef = useRef11(true);
|
|
@@ -3746,7 +3868,7 @@ function useUpdateState(updateFn) {
|
|
|
3746
3868
|
scheduleReset(2e3);
|
|
3747
3869
|
}
|
|
3748
3870
|
}, [updateFn, safeSetStatus, scheduleReset]);
|
|
3749
|
-
|
|
3871
|
+
useEffect11(() => {
|
|
3750
3872
|
mountedRef.current = true;
|
|
3751
3873
|
return () => {
|
|
3752
3874
|
mountedRef.current = false;
|
|
@@ -3787,11 +3909,11 @@ function useDraft(seed, send) {
|
|
|
3787
3909
|
// src/components/AccordionSection.tsx
|
|
3788
3910
|
import { useState as useState14 } from "react";
|
|
3789
3911
|
import "./AccordionSection-5X2XWUYY.css";
|
|
3790
|
-
import { jsx as
|
|
3912
|
+
import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3791
3913
|
function AccordionSection({ title, defaultOpen = false, badge, children }) {
|
|
3792
3914
|
const [open, setOpen] = useState14(defaultOpen);
|
|
3793
|
-
return /* @__PURE__ */
|
|
3794
|
-
/* @__PURE__ */
|
|
3915
|
+
return /* @__PURE__ */ jsxs15("div", { className: `lace-accordion${open ? " lace-accordion--open" : ""}`, children: [
|
|
3916
|
+
/* @__PURE__ */ jsxs15(
|
|
3795
3917
|
"button",
|
|
3796
3918
|
{
|
|
3797
3919
|
type: "button",
|
|
@@ -3799,13 +3921,13 @@ function AccordionSection({ title, defaultOpen = false, badge, children }) {
|
|
|
3799
3921
|
onClick: () => setOpen((v) => !v),
|
|
3800
3922
|
"aria-expanded": open,
|
|
3801
3923
|
children: [
|
|
3802
|
-
/* @__PURE__ */
|
|
3803
|
-
/* @__PURE__ */
|
|
3804
|
-
badge && /* @__PURE__ */
|
|
3924
|
+
/* @__PURE__ */ jsx26("span", { className: "lace-accordion__chevron", children: /* @__PURE__ */ jsx26(CanvasIcon, { name: "chevron-right" }) }),
|
|
3925
|
+
/* @__PURE__ */ jsx26("span", { className: "lace-accordion__title", children: title }),
|
|
3926
|
+
badge && /* @__PURE__ */ jsx26("span", { className: "lace-accordion__badge", children: badge })
|
|
3805
3927
|
]
|
|
3806
3928
|
}
|
|
3807
3929
|
),
|
|
3808
|
-
/* @__PURE__ */
|
|
3930
|
+
/* @__PURE__ */ jsx26("div", { className: "lace-accordion__body", children: /* @__PURE__ */ jsx26("div", { className: "lace-accordion__body-inner", children: /* @__PURE__ */ jsx26("div", { className: "lace-accordion__body-content", children }) }) })
|
|
3809
3931
|
] });
|
|
3810
3932
|
}
|
|
3811
3933
|
|
|
@@ -3816,7 +3938,7 @@ import "./panels-shared-3HUQC7TC.css";
|
|
|
3816
3938
|
// src/components/UpdateButton.tsx
|
|
3817
3939
|
import { Button as Button5 } from "@lace-cloud/ui";
|
|
3818
3940
|
import "./UpdateButton-TJKSFVBA.css";
|
|
3819
|
-
import { jsx as
|
|
3941
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3820
3942
|
var variantByStatus = {
|
|
3821
3943
|
updating: "primary",
|
|
3822
3944
|
updated: "success",
|
|
@@ -3832,7 +3954,7 @@ function variantOf({ status, dirty }, blocked) {
|
|
|
3832
3954
|
return dirty && blocked === void 0 ? "primary" : "secondary";
|
|
3833
3955
|
}
|
|
3834
3956
|
function UpdateButton({ draft, label, blocked }) {
|
|
3835
|
-
return /* @__PURE__ */
|
|
3957
|
+
return /* @__PURE__ */ jsx27("div", { className: "lace-commit-foot", children: /* @__PURE__ */ jsx27(
|
|
3836
3958
|
Button5,
|
|
3837
3959
|
{
|
|
3838
3960
|
rung: true,
|
|
@@ -3856,7 +3978,7 @@ import { useMemo as useMemo10 } from "react";
|
|
|
3856
3978
|
import { Button as Button6, IconButton as IconButton3, Input } from "@lace-cloud/ui";
|
|
3857
3979
|
import { useState as useState15 } from "react";
|
|
3858
3980
|
import "./panels-shared-3HUQC7TC.css";
|
|
3859
|
-
import { Fragment as
|
|
3981
|
+
import { Fragment as Fragment7, jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3860
3982
|
function replaceAt(list, index, item) {
|
|
3861
3983
|
return list.map((x, i) => i === index ? item : x);
|
|
3862
3984
|
}
|
|
@@ -3864,8 +3986,8 @@ function blockTitle(block) {
|
|
|
3864
3986
|
return [block.type, ...block.labels.map((l) => `"${l}"`)].join(" ");
|
|
3865
3987
|
}
|
|
3866
3988
|
function BlockEditor({ blocks, onChange, editable, templates }) {
|
|
3867
|
-
return /* @__PURE__ */
|
|
3868
|
-
blocks.map((block, i) => /* @__PURE__ */
|
|
3989
|
+
return /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
3990
|
+
blocks.map((block, i) => /* @__PURE__ */ jsx28(
|
|
3869
3991
|
BlockCard,
|
|
3870
3992
|
{
|
|
3871
3993
|
block,
|
|
@@ -3875,7 +3997,7 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
|
|
|
3875
3997
|
},
|
|
3876
3998
|
i
|
|
3877
3999
|
)),
|
|
3878
|
-
editable && (templates ? /* @__PURE__ */
|
|
4000
|
+
editable && (templates ? /* @__PURE__ */ jsx28("div", { className: "lace-panel-row-actions", children: templates.map((t) => /* @__PURE__ */ jsxs16(
|
|
3879
4001
|
Button6,
|
|
3880
4002
|
{
|
|
3881
4003
|
variant: "secondary",
|
|
@@ -3896,7 +4018,7 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
|
|
|
3896
4018
|
]
|
|
3897
4019
|
},
|
|
3898
4020
|
t.type
|
|
3899
|
-
)) }) : /* @__PURE__ */
|
|
4021
|
+
)) }) : /* @__PURE__ */ jsx28(
|
|
3900
4022
|
NewBlockRow,
|
|
3901
4023
|
{
|
|
3902
4024
|
onAdd: (type, label) => onChange([
|
|
@@ -3910,8 +4032,8 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
|
|
|
3910
4032
|
function NewBlockRow({ onAdd }) {
|
|
3911
4033
|
const [type, setType] = useState15("");
|
|
3912
4034
|
const [label, setLabel] = useState15("");
|
|
3913
|
-
return /* @__PURE__ */
|
|
3914
|
-
/* @__PURE__ */
|
|
4035
|
+
return /* @__PURE__ */ jsxs16("div", { className: "lace-panel-row-actions", children: [
|
|
4036
|
+
/* @__PURE__ */ jsx28(
|
|
3915
4037
|
Input,
|
|
3916
4038
|
{
|
|
3917
4039
|
value: type,
|
|
@@ -3921,7 +4043,7 @@ function NewBlockRow({ onAdd }) {
|
|
|
3921
4043
|
mono: true
|
|
3922
4044
|
}
|
|
3923
4045
|
),
|
|
3924
|
-
/* @__PURE__ */
|
|
4046
|
+
/* @__PURE__ */ jsx28(
|
|
3925
4047
|
Input,
|
|
3926
4048
|
{
|
|
3927
4049
|
value: label,
|
|
@@ -3931,7 +4053,7 @@ function NewBlockRow({ onAdd }) {
|
|
|
3931
4053
|
mono: true
|
|
3932
4054
|
}
|
|
3933
4055
|
),
|
|
3934
|
-
/* @__PURE__ */
|
|
4056
|
+
/* @__PURE__ */ jsx28(
|
|
3935
4057
|
Button6,
|
|
3936
4058
|
{
|
|
3937
4059
|
variant: "secondary",
|
|
@@ -3955,13 +4077,13 @@ function BlockCard({ block, editable, onChange, onRemove }) {
|
|
|
3955
4077
|
[field]: value
|
|
3956
4078
|
})
|
|
3957
4079
|
});
|
|
3958
|
-
return /* @__PURE__ */
|
|
3959
|
-
/* @__PURE__ */
|
|
3960
|
-
/* @__PURE__ */
|
|
3961
|
-
editable && /* @__PURE__ */
|
|
4080
|
+
return /* @__PURE__ */ jsxs16("div", { className: "lace-panel-validation-block", children: [
|
|
4081
|
+
/* @__PURE__ */ jsxs16("div", { className: "lace-panel-row-actions", children: [
|
|
4082
|
+
/* @__PURE__ */ jsx28(Identifier, { className: "lace-panel-row-card__name", text: blockTitle(block) }),
|
|
4083
|
+
editable && /* @__PURE__ */ jsx28(
|
|
3962
4084
|
IconButton3,
|
|
3963
4085
|
{
|
|
3964
|
-
icon: /* @__PURE__ */
|
|
4086
|
+
icon: /* @__PURE__ */ jsx28(CanvasIcon, { name: "close" }),
|
|
3965
4087
|
"aria-label": `Remove the ${block.type} block`,
|
|
3966
4088
|
size: "md",
|
|
3967
4089
|
tooltipPlacement: "bottom-end",
|
|
@@ -3971,8 +4093,8 @@ function BlockCard({ block, editable, onChange, onRemove }) {
|
|
|
3971
4093
|
] }),
|
|
3972
4094
|
block.attributes.map((attribute, i) => (
|
|
3973
4095
|
// biome-ignore lint/suspicious/noArrayIndexKey: attributes are positional; the render keeps their order
|
|
3974
|
-
/* @__PURE__ */
|
|
3975
|
-
/* @__PURE__ */
|
|
4096
|
+
/* @__PURE__ */ jsxs16("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
4097
|
+
/* @__PURE__ */ jsx28(
|
|
3976
4098
|
Input,
|
|
3977
4099
|
{
|
|
3978
4100
|
value: attribute.name,
|
|
@@ -3983,7 +4105,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
|
|
|
3983
4105
|
readOnly: !editable
|
|
3984
4106
|
}
|
|
3985
4107
|
),
|
|
3986
|
-
/* @__PURE__ */
|
|
4108
|
+
/* @__PURE__ */ jsx28(
|
|
3987
4109
|
Input,
|
|
3988
4110
|
{
|
|
3989
4111
|
value: attribute.value,
|
|
@@ -3994,10 +4116,10 @@ function BlockCard({ block, editable, onChange, onRemove }) {
|
|
|
3994
4116
|
readOnly: !editable
|
|
3995
4117
|
}
|
|
3996
4118
|
),
|
|
3997
|
-
editable && /* @__PURE__ */
|
|
4119
|
+
editable && /* @__PURE__ */ jsx28(
|
|
3998
4120
|
IconButton3,
|
|
3999
4121
|
{
|
|
4000
|
-
icon: /* @__PURE__ */
|
|
4122
|
+
icon: /* @__PURE__ */ jsx28(CanvasIcon, { name: "close" }),
|
|
4001
4123
|
"aria-label": `Remove ${attribute.name || "the argument"}`,
|
|
4002
4124
|
size: "md",
|
|
4003
4125
|
tooltipPlacement: "bottom-end",
|
|
@@ -4006,7 +4128,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
|
|
|
4006
4128
|
)
|
|
4007
4129
|
] }, i)
|
|
4008
4130
|
)),
|
|
4009
|
-
editable && /* @__PURE__ */
|
|
4131
|
+
editable && /* @__PURE__ */ jsx28(
|
|
4010
4132
|
Button6,
|
|
4011
4133
|
{
|
|
4012
4134
|
variant: "secondary",
|
|
@@ -4015,7 +4137,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
|
|
|
4015
4137
|
children: "+ Add argument"
|
|
4016
4138
|
}
|
|
4017
4139
|
),
|
|
4018
|
-
(block.blocks.length > 0 || editable) && /* @__PURE__ */
|
|
4140
|
+
(block.blocks.length > 0 || editable) && /* @__PURE__ */ jsx28(
|
|
4019
4141
|
BlockEditor,
|
|
4020
4142
|
{
|
|
4021
4143
|
blocks: block.blocks,
|
|
@@ -4051,7 +4173,7 @@ function firstDuplicate(items, keyFn) {
|
|
|
4051
4173
|
|
|
4052
4174
|
// src/components/panels/LocalsPanel.tsx
|
|
4053
4175
|
import "./panels-shared-3HUQC7TC.css";
|
|
4054
|
-
import { Fragment as
|
|
4176
|
+
import { Fragment as Fragment8, jsx as jsx29, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4055
4177
|
function toRows(locals) {
|
|
4056
4178
|
return (locals ?? []).map((l) => ({ id: l.name, ...l }));
|
|
4057
4179
|
}
|
|
@@ -4068,10 +4190,10 @@ function LocalsContent({ locals, onSave }) {
|
|
|
4068
4190
|
const updateRow = (index, field, value) => setRows(rows.map((r, i) => i === index ? { ...r, [field]: value } : r));
|
|
4069
4191
|
const nameDupes = findDuplicateIndices(rows, (r) => r.name);
|
|
4070
4192
|
const duplicate = firstDuplicate(rows, (r) => r.name);
|
|
4071
|
-
return /* @__PURE__ */
|
|
4072
|
-
rows.map((row, i) => /* @__PURE__ */
|
|
4073
|
-
/* @__PURE__ */
|
|
4074
|
-
/* @__PURE__ */
|
|
4193
|
+
return /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
4194
|
+
rows.map((row, i) => /* @__PURE__ */ jsxs17("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
4195
|
+
/* @__PURE__ */ jsxs17("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
4196
|
+
/* @__PURE__ */ jsx29(
|
|
4075
4197
|
Input2,
|
|
4076
4198
|
{
|
|
4077
4199
|
value: row.name,
|
|
@@ -4084,10 +4206,10 @@ function LocalsContent({ locals, onSave }) {
|
|
|
4084
4206
|
readOnly: !editable
|
|
4085
4207
|
}
|
|
4086
4208
|
),
|
|
4087
|
-
editable && /* @__PURE__ */
|
|
4209
|
+
editable && /* @__PURE__ */ jsx29(
|
|
4088
4210
|
IconButton4,
|
|
4089
4211
|
{
|
|
4090
|
-
icon: /* @__PURE__ */
|
|
4212
|
+
icon: /* @__PURE__ */ jsx29(CanvasIcon, { name: "close" }),
|
|
4091
4213
|
"aria-label": "Remove local",
|
|
4092
4214
|
size: "md",
|
|
4093
4215
|
tooltipPlacement: "bottom-end",
|
|
@@ -4095,8 +4217,8 @@ function LocalsContent({ locals, onSave }) {
|
|
|
4095
4217
|
}
|
|
4096
4218
|
)
|
|
4097
4219
|
] }),
|
|
4098
|
-
nameDupes.has(i) && /* @__PURE__ */
|
|
4099
|
-
/* @__PURE__ */
|
|
4220
|
+
nameDupes.has(i) && /* @__PURE__ */ jsx29("div", { className: "lace-panel-row-error", children: "Duplicate local name" }),
|
|
4221
|
+
/* @__PURE__ */ jsx29("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx29(
|
|
4100
4222
|
Textarea,
|
|
4101
4223
|
{
|
|
4102
4224
|
value: row.value,
|
|
@@ -4110,8 +4232,8 @@ function LocalsContent({ locals, onSave }) {
|
|
|
4110
4232
|
}
|
|
4111
4233
|
) })
|
|
4112
4234
|
] }, row.id)),
|
|
4113
|
-
editable && /* @__PURE__ */
|
|
4114
|
-
/* @__PURE__ */
|
|
4235
|
+
editable && /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
4236
|
+
/* @__PURE__ */ jsx29(
|
|
4115
4237
|
Button7,
|
|
4116
4238
|
{
|
|
4117
4239
|
variant: "secondary",
|
|
@@ -4120,7 +4242,7 @@ function LocalsContent({ locals, onSave }) {
|
|
|
4120
4242
|
children: "+ Add local"
|
|
4121
4243
|
}
|
|
4122
4244
|
),
|
|
4123
|
-
/* @__PURE__ */
|
|
4245
|
+
/* @__PURE__ */ jsx29(
|
|
4124
4246
|
UpdateButton,
|
|
4125
4247
|
{
|
|
4126
4248
|
draft,
|
|
@@ -4132,13 +4254,13 @@ function LocalsContent({ locals, onSave }) {
|
|
|
4132
4254
|
] });
|
|
4133
4255
|
}
|
|
4134
4256
|
function LocalsPanel({ onClose, ...content }) {
|
|
4135
|
-
return /* @__PURE__ */
|
|
4257
|
+
return /* @__PURE__ */ jsx29(Panel2, { title: "Locals", onClose, children: /* @__PURE__ */ jsx29(LocalsContent, { ...content }) });
|
|
4136
4258
|
}
|
|
4137
4259
|
|
|
4138
4260
|
// src/components/panels/ModuleInterfacePanel.tsx
|
|
4139
4261
|
import { Button as Button8, IconButton as IconButton5, Input as Input3, Panel as Panel3, Select, Textarea as Textarea2 } from "@lace-cloud/ui";
|
|
4140
4262
|
import "./panels-shared-3HUQC7TC.css";
|
|
4141
|
-
import { Fragment as
|
|
4263
|
+
import { Fragment as Fragment9, jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4142
4264
|
function variablesToRows(variables) {
|
|
4143
4265
|
return variables.map((v) => ({
|
|
4144
4266
|
id: v.name,
|
|
@@ -4270,13 +4392,13 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4270
4392
|
const variableDupes = findDuplicateIndices(variables, (v) => v.name);
|
|
4271
4393
|
const outputDupes = findDuplicateIndices(outputs, (o) => o.name);
|
|
4272
4394
|
const exposable = settings.call_outputs.filter((text) => !outputs.some((o) => o.value === text));
|
|
4273
|
-
return /* @__PURE__ */
|
|
4274
|
-
/* @__PURE__ */
|
|
4275
|
-
/* @__PURE__ */
|
|
4276
|
-
variables.length === 0 && /* @__PURE__ */
|
|
4277
|
-
variables.map((v, i) => /* @__PURE__ */
|
|
4278
|
-
/* @__PURE__ */
|
|
4279
|
-
v.added ? /* @__PURE__ */
|
|
4395
|
+
return /* @__PURE__ */ jsxs18(Fragment9, { children: [
|
|
4396
|
+
/* @__PURE__ */ jsx30("div", { className: "lace-panel-hint", children: "The module's public surface: the variables its callers set and the outputs they read." }),
|
|
4397
|
+
/* @__PURE__ */ jsx30("h4", { className: "lace-panel-section-title", children: "Inputs" }),
|
|
4398
|
+
variables.length === 0 && /* @__PURE__ */ jsx30("div", { className: "lace-panel-hint", children: "No variables." }),
|
|
4399
|
+
variables.map((v, i) => /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
4400
|
+
/* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
4401
|
+
v.added ? /* @__PURE__ */ jsx30(
|
|
4280
4402
|
Input3,
|
|
4281
4403
|
{
|
|
4282
4404
|
label: "Name",
|
|
@@ -4287,11 +4409,11 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4287
4409
|
mono: true,
|
|
4288
4410
|
error: variableDupes.has(i)
|
|
4289
4411
|
}
|
|
4290
|
-
) : /* @__PURE__ */
|
|
4291
|
-
editable && /* @__PURE__ */
|
|
4412
|
+
) : /* @__PURE__ */ jsx30(Identifier, { className: "lace-panel-row-card__name", text: v.name }),
|
|
4413
|
+
editable && /* @__PURE__ */ jsx30(
|
|
4292
4414
|
IconButton5,
|
|
4293
4415
|
{
|
|
4294
|
-
icon: /* @__PURE__ */
|
|
4416
|
+
icon: /* @__PURE__ */ jsx30(CanvasIcon, { name: "close" }),
|
|
4295
4417
|
"aria-label": `Remove variable ${v.name}`,
|
|
4296
4418
|
size: "md",
|
|
4297
4419
|
tooltipPlacement: "bottom-end",
|
|
@@ -4299,8 +4421,8 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4299
4421
|
}
|
|
4300
4422
|
)
|
|
4301
4423
|
] }),
|
|
4302
|
-
variableDupes.has(i) && /* @__PURE__ */
|
|
4303
|
-
/* @__PURE__ */
|
|
4424
|
+
variableDupes.has(i) && /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-error", children: "Duplicate variable name" }),
|
|
4425
|
+
/* @__PURE__ */ jsx30("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx30(
|
|
4304
4426
|
Input3,
|
|
4305
4427
|
{
|
|
4306
4428
|
label: "Type",
|
|
@@ -4312,8 +4434,8 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4312
4434
|
readOnly: !editable
|
|
4313
4435
|
}
|
|
4314
4436
|
) }),
|
|
4315
|
-
v.defaultText && /* @__PURE__ */
|
|
4316
|
-
/* @__PURE__ */
|
|
4437
|
+
v.defaultText && /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx30(Input3, { label: "Default", value: v.defaultText, fullWidth: true, mono: true, readOnly: true }) }),
|
|
4438
|
+
/* @__PURE__ */ jsx30("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx30(
|
|
4317
4439
|
Textarea2,
|
|
4318
4440
|
{
|
|
4319
4441
|
label: "Description",
|
|
@@ -4325,9 +4447,9 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4325
4447
|
readOnly: !editable
|
|
4326
4448
|
}
|
|
4327
4449
|
) }),
|
|
4328
|
-
/* @__PURE__ */
|
|
4329
|
-
/* @__PURE__ */
|
|
4330
|
-
/* @__PURE__ */
|
|
4450
|
+
/* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions", children: [
|
|
4451
|
+
/* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
|
|
4452
|
+
/* @__PURE__ */ jsx30(
|
|
4331
4453
|
"input",
|
|
4332
4454
|
{
|
|
4333
4455
|
type: "checkbox",
|
|
@@ -4336,10 +4458,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4336
4458
|
disabled: !editable
|
|
4337
4459
|
}
|
|
4338
4460
|
),
|
|
4339
|
-
/* @__PURE__ */
|
|
4461
|
+
/* @__PURE__ */ jsx30("span", { children: "Required" })
|
|
4340
4462
|
] }),
|
|
4341
|
-
/* @__PURE__ */
|
|
4342
|
-
/* @__PURE__ */
|
|
4463
|
+
/* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
|
|
4464
|
+
/* @__PURE__ */ jsx30(
|
|
4343
4465
|
"input",
|
|
4344
4466
|
{
|
|
4345
4467
|
type: "checkbox",
|
|
@@ -4348,10 +4470,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4348
4470
|
disabled: !editable
|
|
4349
4471
|
}
|
|
4350
4472
|
),
|
|
4351
|
-
/* @__PURE__ */
|
|
4473
|
+
/* @__PURE__ */ jsx30("span", { children: "Ephemeral" })
|
|
4352
4474
|
] }),
|
|
4353
|
-
/* @__PURE__ */
|
|
4354
|
-
/* @__PURE__ */
|
|
4475
|
+
/* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
|
|
4476
|
+
/* @__PURE__ */ jsx30(
|
|
4355
4477
|
"input",
|
|
4356
4478
|
{
|
|
4357
4479
|
type: "checkbox",
|
|
@@ -4360,10 +4482,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4360
4482
|
disabled: !editable
|
|
4361
4483
|
}
|
|
4362
4484
|
),
|
|
4363
|
-
/* @__PURE__ */
|
|
4485
|
+
/* @__PURE__ */ jsx30("span", { children: "Sensitive" })
|
|
4364
4486
|
] }),
|
|
4365
|
-
/* @__PURE__ */
|
|
4366
|
-
/* @__PURE__ */
|
|
4487
|
+
/* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
|
|
4488
|
+
/* @__PURE__ */ jsx30(
|
|
4367
4489
|
"input",
|
|
4368
4490
|
{
|
|
4369
4491
|
type: "checkbox",
|
|
@@ -4372,13 +4494,13 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4372
4494
|
disabled: !editable
|
|
4373
4495
|
}
|
|
4374
4496
|
),
|
|
4375
|
-
/* @__PURE__ */
|
|
4497
|
+
/* @__PURE__ */ jsx30("span", { children: "Nullable" })
|
|
4376
4498
|
] })
|
|
4377
4499
|
] }),
|
|
4378
|
-
(v.validation.length > 0 || editable) && /* @__PURE__ */
|
|
4379
|
-
/* @__PURE__ */
|
|
4380
|
-
v.validation.map((block, j) => /* @__PURE__ */
|
|
4381
|
-
/* @__PURE__ */
|
|
4500
|
+
(v.validation.length > 0 || editable) && /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-content", children: [
|
|
4501
|
+
/* @__PURE__ */ jsx30("div", { className: "lace-panel-subsection-label", children: "Validation" }),
|
|
4502
|
+
v.validation.map((block, j) => /* @__PURE__ */ jsxs18("div", { className: "lace-panel-validation-block", children: [
|
|
4503
|
+
/* @__PURE__ */ jsx30(
|
|
4382
4504
|
Input3,
|
|
4383
4505
|
{
|
|
4384
4506
|
value: block.condition,
|
|
@@ -4390,7 +4512,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4390
4512
|
readOnly: !editable
|
|
4391
4513
|
}
|
|
4392
4514
|
),
|
|
4393
|
-
/* @__PURE__ */
|
|
4515
|
+
/* @__PURE__ */ jsx30(
|
|
4394
4516
|
Input3,
|
|
4395
4517
|
{
|
|
4396
4518
|
value: block.error_message,
|
|
@@ -4401,10 +4523,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4401
4523
|
readOnly: !editable
|
|
4402
4524
|
}
|
|
4403
4525
|
),
|
|
4404
|
-
editable && /* @__PURE__ */
|
|
4526
|
+
editable && /* @__PURE__ */ jsx30(
|
|
4405
4527
|
IconButton5,
|
|
4406
4528
|
{
|
|
4407
|
-
icon: /* @__PURE__ */
|
|
4529
|
+
icon: /* @__PURE__ */ jsx30(CanvasIcon, { name: "close" }),
|
|
4408
4530
|
"aria-label": "Remove validation rule",
|
|
4409
4531
|
size: "md",
|
|
4410
4532
|
tooltipPlacement: "bottom-end",
|
|
@@ -4412,15 +4534,15 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4412
4534
|
}
|
|
4413
4535
|
)
|
|
4414
4536
|
] }, block.id)),
|
|
4415
|
-
editable && /* @__PURE__ */
|
|
4537
|
+
editable && /* @__PURE__ */ jsx30(Button8, { variant: "secondary", size: "sm", onClick: () => addValidation(i), children: "+ Add validation rule" })
|
|
4416
4538
|
] })
|
|
4417
4539
|
] }, v.id)),
|
|
4418
|
-
editable && /* @__PURE__ */
|
|
4419
|
-
/* @__PURE__ */
|
|
4420
|
-
outputs.length === 0 && /* @__PURE__ */
|
|
4421
|
-
outputs.map((o, i) => /* @__PURE__ */
|
|
4422
|
-
/* @__PURE__ */
|
|
4423
|
-
/* @__PURE__ */
|
|
4540
|
+
editable && /* @__PURE__ */ jsx30(Button8, { variant: "secondary", size: "sm", onClick: addVariable, children: "+ Add variable" }),
|
|
4541
|
+
/* @__PURE__ */ jsx30("h4", { className: "lace-panel-section-title", children: "Outputs" }),
|
|
4542
|
+
outputs.length === 0 && /* @__PURE__ */ jsx30("div", { className: "lace-panel-hint", children: "No outputs." }),
|
|
4543
|
+
outputs.map((o, i) => /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
4544
|
+
/* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
4545
|
+
/* @__PURE__ */ jsx30(
|
|
4424
4546
|
Input3,
|
|
4425
4547
|
{
|
|
4426
4548
|
label: "Name",
|
|
@@ -4433,10 +4555,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4433
4555
|
error: outputDupes.has(i) || editable && !o.name.trim()
|
|
4434
4556
|
}
|
|
4435
4557
|
),
|
|
4436
|
-
editable && /* @__PURE__ */
|
|
4558
|
+
editable && /* @__PURE__ */ jsx30(
|
|
4437
4559
|
IconButton5,
|
|
4438
4560
|
{
|
|
4439
|
-
icon: /* @__PURE__ */
|
|
4561
|
+
icon: /* @__PURE__ */ jsx30(CanvasIcon, { name: "close" }),
|
|
4440
4562
|
"aria-label": `Remove output ${o.name}`,
|
|
4441
4563
|
size: "md",
|
|
4442
4564
|
tooltipPlacement: "bottom-end",
|
|
@@ -4444,7 +4566,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4444
4566
|
}
|
|
4445
4567
|
)
|
|
4446
4568
|
] }),
|
|
4447
|
-
/* @__PURE__ */
|
|
4569
|
+
/* @__PURE__ */ jsx30("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx30(
|
|
4448
4570
|
Input3,
|
|
4449
4571
|
{
|
|
4450
4572
|
label: "Value",
|
|
@@ -4457,7 +4579,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4457
4579
|
error: editable && !o.value.trim()
|
|
4458
4580
|
}
|
|
4459
4581
|
) }),
|
|
4460
|
-
/* @__PURE__ */
|
|
4582
|
+
/* @__PURE__ */ jsx30("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx30(
|
|
4461
4583
|
Textarea2,
|
|
4462
4584
|
{
|
|
4463
4585
|
label: "Description",
|
|
@@ -4469,8 +4591,8 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4469
4591
|
readOnly: !editable
|
|
4470
4592
|
}
|
|
4471
4593
|
) }),
|
|
4472
|
-
/* @__PURE__ */
|
|
4473
|
-
/* @__PURE__ */
|
|
4594
|
+
/* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
|
|
4595
|
+
/* @__PURE__ */ jsx30(
|
|
4474
4596
|
"input",
|
|
4475
4597
|
{
|
|
4476
4598
|
type: "checkbox",
|
|
@@ -4479,12 +4601,12 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4479
4601
|
disabled: !editable
|
|
4480
4602
|
}
|
|
4481
4603
|
),
|
|
4482
|
-
/* @__PURE__ */
|
|
4604
|
+
/* @__PURE__ */ jsx30("span", { children: "Sensitive" })
|
|
4483
4605
|
] }),
|
|
4484
|
-
(o.depends_on.length > 0 || editable && settings.dependency_options.length > 0) && /* @__PURE__ */
|
|
4485
|
-
/* @__PURE__ */
|
|
4486
|
-
!editable ? o.depends_on.map((dep) => /* @__PURE__ */
|
|
4487
|
-
/* @__PURE__ */
|
|
4606
|
+
(o.depends_on.length > 0 || editable && settings.dependency_options.length > 0) && /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-content", children: [
|
|
4607
|
+
/* @__PURE__ */ jsx30("div", { className: "lace-panel-subsection-label", children: "Depends on" }),
|
|
4608
|
+
!editable ? o.depends_on.map((dep) => /* @__PURE__ */ jsx30("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx30(Identifier, { text: dep }) }, dep)) : settings.dependency_options.map((dep) => /* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
|
|
4609
|
+
/* @__PURE__ */ jsx30(
|
|
4488
4610
|
"input",
|
|
4489
4611
|
{
|
|
4490
4612
|
type: "checkbox",
|
|
@@ -4492,14 +4614,14 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4492
4614
|
onChange: () => toggleDependsOn(i, dep)
|
|
4493
4615
|
}
|
|
4494
4616
|
),
|
|
4495
|
-
/* @__PURE__ */
|
|
4617
|
+
/* @__PURE__ */ jsx30(Identifier, { text: dep })
|
|
4496
4618
|
] }, dep))
|
|
4497
4619
|
] }),
|
|
4498
|
-
outputDupes.has(i) && /* @__PURE__ */
|
|
4620
|
+
outputDupes.has(i) && /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-error", children: "Output names must be unique." })
|
|
4499
4621
|
] }, o.id)),
|
|
4500
|
-
editable && /* @__PURE__ */
|
|
4501
|
-
/* @__PURE__ */
|
|
4502
|
-
exposable.length > 0 && /* @__PURE__ */
|
|
4622
|
+
editable && /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions", children: [
|
|
4623
|
+
/* @__PURE__ */ jsx30(Button8, { variant: "secondary", size: "sm", onClick: () => addOutput("", ""), children: "+ Add output" }),
|
|
4624
|
+
exposable.length > 0 && /* @__PURE__ */ jsx30(
|
|
4503
4625
|
Select,
|
|
4504
4626
|
{
|
|
4505
4627
|
"aria-label": "Expose a call's output",
|
|
@@ -4515,7 +4637,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4515
4637
|
}
|
|
4516
4638
|
)
|
|
4517
4639
|
] }),
|
|
4518
|
-
editable && /* @__PURE__ */
|
|
4640
|
+
editable && /* @__PURE__ */ jsx30(
|
|
4519
4641
|
UpdateButton,
|
|
4520
4642
|
{
|
|
4521
4643
|
draft,
|
|
@@ -4526,7 +4648,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
4526
4648
|
] });
|
|
4527
4649
|
}
|
|
4528
4650
|
function ModuleInterfacePanel({ onClose, ...content }) {
|
|
4529
|
-
return /* @__PURE__ */
|
|
4651
|
+
return /* @__PURE__ */ jsx30(Panel3, { title: "Module Interface", onClose, children: /* @__PURE__ */ jsx30(ModuleInterfaceContent, { ...content }) });
|
|
4530
4652
|
}
|
|
4531
4653
|
|
|
4532
4654
|
// src/components/panels/module-actions.ts
|
|
@@ -4645,7 +4767,7 @@ import "./panels-shared-3HUQC7TC.css";
|
|
|
4645
4767
|
// src/components/panels/ProvidersPanel.tsx
|
|
4646
4768
|
import { Button as Button9, IconButton as IconButton6, Input as Input4, Panel as Panel4 } from "@lace-cloud/ui";
|
|
4647
4769
|
import "./panels-shared-3HUQC7TC.css";
|
|
4648
|
-
import { Fragment as
|
|
4770
|
+
import { Fragment as Fragment10, jsx as jsx31, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4649
4771
|
function toRows2(providers) {
|
|
4650
4772
|
if (!providers || providers.length === 0) return [];
|
|
4651
4773
|
return providers.map((p) => ({
|
|
@@ -4696,10 +4818,10 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
4696
4818
|
(c, ei) => ei === entryIndex ? { ...c, [field]: value } : c
|
|
4697
4819
|
)
|
|
4698
4820
|
);
|
|
4699
|
-
return /* @__PURE__ */
|
|
4700
|
-
rows.map((row, pi) => /* @__PURE__ */
|
|
4701
|
-
/* @__PURE__ */
|
|
4702
|
-
/* @__PURE__ */
|
|
4821
|
+
return /* @__PURE__ */ jsxs19(Fragment10, { children: [
|
|
4822
|
+
rows.map((row, pi) => /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
4823
|
+
/* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
4824
|
+
/* @__PURE__ */ jsx31(
|
|
4703
4825
|
Input4,
|
|
4704
4826
|
{
|
|
4705
4827
|
value: row.name,
|
|
@@ -4709,7 +4831,7 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
4709
4831
|
readOnly: !editable
|
|
4710
4832
|
}
|
|
4711
4833
|
),
|
|
4712
|
-
/* @__PURE__ */
|
|
4834
|
+
/* @__PURE__ */ jsx31(
|
|
4713
4835
|
Input4,
|
|
4714
4836
|
{
|
|
4715
4837
|
value: row.alias,
|
|
@@ -4719,10 +4841,10 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
4719
4841
|
readOnly: !editable
|
|
4720
4842
|
}
|
|
4721
4843
|
),
|
|
4722
|
-
editable && /* @__PURE__ */
|
|
4844
|
+
editable && /* @__PURE__ */ jsx31(
|
|
4723
4845
|
IconButton6,
|
|
4724
4846
|
{
|
|
4725
|
-
icon: /* @__PURE__ */
|
|
4847
|
+
icon: /* @__PURE__ */ jsx31(CanvasIcon, { name: "close" }),
|
|
4726
4848
|
"aria-label": "Remove provider",
|
|
4727
4849
|
size: "md",
|
|
4728
4850
|
tooltipPlacement: "bottom-end",
|
|
@@ -4730,9 +4852,9 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
4730
4852
|
}
|
|
4731
4853
|
)
|
|
4732
4854
|
] }),
|
|
4733
|
-
/* @__PURE__ */
|
|
4734
|
-
row.configEntries.map((entry, ei) => /* @__PURE__ */
|
|
4735
|
-
/* @__PURE__ */
|
|
4855
|
+
/* @__PURE__ */ jsx31("div", { className: "lace-panel-row-sublabel", children: "Config" }),
|
|
4856
|
+
row.configEntries.map((entry, ei) => /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
4857
|
+
/* @__PURE__ */ jsx31(
|
|
4736
4858
|
Input4,
|
|
4737
4859
|
{
|
|
4738
4860
|
value: entry.key,
|
|
@@ -4742,7 +4864,7 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
4742
4864
|
readOnly: !editable
|
|
4743
4865
|
}
|
|
4744
4866
|
),
|
|
4745
|
-
/* @__PURE__ */
|
|
4867
|
+
/* @__PURE__ */ jsx31(
|
|
4746
4868
|
Input4,
|
|
4747
4869
|
{
|
|
4748
4870
|
value: entry.value,
|
|
@@ -4752,10 +4874,10 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
4752
4874
|
readOnly: !editable
|
|
4753
4875
|
}
|
|
4754
4876
|
),
|
|
4755
|
-
editable && /* @__PURE__ */
|
|
4877
|
+
editable && /* @__PURE__ */ jsx31(
|
|
4756
4878
|
IconButton6,
|
|
4757
4879
|
{
|
|
4758
|
-
icon: /* @__PURE__ */
|
|
4880
|
+
icon: /* @__PURE__ */ jsx31(CanvasIcon, { name: "close" }),
|
|
4759
4881
|
"aria-label": "Remove config key",
|
|
4760
4882
|
size: "md",
|
|
4761
4883
|
tooltipPlacement: "bottom-end",
|
|
@@ -4766,7 +4888,7 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
4766
4888
|
}
|
|
4767
4889
|
)
|
|
4768
4890
|
] }, entry.id)),
|
|
4769
|
-
editable && /* @__PURE__ */
|
|
4891
|
+
editable && /* @__PURE__ */ jsx31(
|
|
4770
4892
|
Button9,
|
|
4771
4893
|
{
|
|
4772
4894
|
variant: "secondary",
|
|
@@ -4778,9 +4900,9 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
4778
4900
|
children: "+ Add config key"
|
|
4779
4901
|
}
|
|
4780
4902
|
),
|
|
4781
|
-
(row.blocks.length > 0 || editable) && /* @__PURE__ */
|
|
4782
|
-
/* @__PURE__ */
|
|
4783
|
-
/* @__PURE__ */
|
|
4903
|
+
(row.blocks.length > 0 || editable) && /* @__PURE__ */ jsxs19(Fragment10, { children: [
|
|
4904
|
+
/* @__PURE__ */ jsx31("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
|
|
4905
|
+
/* @__PURE__ */ jsx31(
|
|
4784
4906
|
BlockEditor,
|
|
4785
4907
|
{
|
|
4786
4908
|
blocks: row.blocks,
|
|
@@ -4790,21 +4912,21 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
4790
4912
|
)
|
|
4791
4913
|
] })
|
|
4792
4914
|
] }, row.id)),
|
|
4793
|
-
editable && /* @__PURE__ */
|
|
4794
|
-
/* @__PURE__ */
|
|
4795
|
-
/* @__PURE__ */
|
|
4915
|
+
editable && /* @__PURE__ */ jsxs19(Fragment10, { children: [
|
|
4916
|
+
/* @__PURE__ */ jsx31(Button9, { variant: "secondary", size: "sm", onClick: addProvider, children: "+ Add provider" }),
|
|
4917
|
+
/* @__PURE__ */ jsx31(UpdateButton, { draft, label: "Update providers" })
|
|
4796
4918
|
] })
|
|
4797
4919
|
] });
|
|
4798
4920
|
}
|
|
4799
4921
|
function ProvidersPanel({ providers, onSave, onClose }) {
|
|
4800
|
-
return /* @__PURE__ */
|
|
4922
|
+
return /* @__PURE__ */ jsx31(Panel4, { title: "Providers", onClose, children: /* @__PURE__ */ jsx31(ProvidersContent, { providers, onSave }) });
|
|
4801
4923
|
}
|
|
4802
4924
|
|
|
4803
4925
|
// src/components/panels/ResourcesPanel.tsx
|
|
4804
4926
|
import { Badge as Badge2, Button as Button10, IconButton as IconButton7, Input as Input5, Select as Select2 } from "@lace-cloud/ui";
|
|
4805
4927
|
import { useState as useState16 } from "react";
|
|
4806
4928
|
import "./panels-shared-3HUQC7TC.css";
|
|
4807
|
-
import { Fragment as
|
|
4929
|
+
import { Fragment as Fragment11, jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4808
4930
|
function ResourcesContent({
|
|
4809
4931
|
resources,
|
|
4810
4932
|
dependencyOptions,
|
|
@@ -4814,9 +4936,9 @@ function ResourcesContent({
|
|
|
4814
4936
|
onAdd
|
|
4815
4937
|
}) {
|
|
4816
4938
|
const { editable } = useCanvas();
|
|
4817
|
-
return /* @__PURE__ */
|
|
4818
|
-
resources.length === 0 && /* @__PURE__ */
|
|
4819
|
-
resources.map((resource) => /* @__PURE__ */
|
|
4939
|
+
return /* @__PURE__ */ jsxs20(Fragment11, { children: [
|
|
4940
|
+
resources.length === 0 && /* @__PURE__ */ jsx32("div", { className: "lace-panel-hint", children: "No resources or data sources." }),
|
|
4941
|
+
resources.map((resource) => /* @__PURE__ */ jsx32(
|
|
4820
4942
|
ResourceCard,
|
|
4821
4943
|
{
|
|
4822
4944
|
resource,
|
|
@@ -4829,7 +4951,7 @@ function ResourcesContent({
|
|
|
4829
4951
|
},
|
|
4830
4952
|
resource.id
|
|
4831
4953
|
)),
|
|
4832
|
-
editable && /* @__PURE__ */
|
|
4954
|
+
editable && /* @__PURE__ */ jsx32(NewResourceRow, { managed, onAdd })
|
|
4833
4955
|
] });
|
|
4834
4956
|
}
|
|
4835
4957
|
var MANAGED_OPTION = { value: "resource", label: "Resource" };
|
|
@@ -4843,10 +4965,10 @@ function NewResourceRow({
|
|
|
4843
4965
|
const kind = managed ? chosen : "data";
|
|
4844
4966
|
const [type, setType] = useState16("");
|
|
4845
4967
|
const [name, setName] = useState16("");
|
|
4846
|
-
return /* @__PURE__ */
|
|
4847
|
-
/* @__PURE__ */
|
|
4848
|
-
/* @__PURE__ */
|
|
4849
|
-
/* @__PURE__ */
|
|
4968
|
+
return /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-card", children: [
|
|
4969
|
+
/* @__PURE__ */ jsx32("div", { className: "lace-panel-subsection-label", children: "Add a resource" }),
|
|
4970
|
+
/* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-actions", children: [
|
|
4971
|
+
/* @__PURE__ */ jsx32(
|
|
4850
4972
|
Select2,
|
|
4851
4973
|
{
|
|
4852
4974
|
"aria-label": "New resource kind",
|
|
@@ -4855,7 +4977,7 @@ function NewResourceRow({
|
|
|
4855
4977
|
onChange: (e) => setChosen(e.target.value === "data" ? "data" : "resource")
|
|
4856
4978
|
}
|
|
4857
4979
|
),
|
|
4858
|
-
/* @__PURE__ */
|
|
4980
|
+
/* @__PURE__ */ jsx32(
|
|
4859
4981
|
Input5,
|
|
4860
4982
|
{
|
|
4861
4983
|
value: type,
|
|
@@ -4865,7 +4987,7 @@ function NewResourceRow({
|
|
|
4865
4987
|
mono: true
|
|
4866
4988
|
}
|
|
4867
4989
|
),
|
|
4868
|
-
/* @__PURE__ */
|
|
4990
|
+
/* @__PURE__ */ jsx32(
|
|
4869
4991
|
Input5,
|
|
4870
4992
|
{
|
|
4871
4993
|
value: name,
|
|
@@ -4875,7 +4997,7 @@ function NewResourceRow({
|
|
|
4875
4997
|
mono: true
|
|
4876
4998
|
}
|
|
4877
4999
|
),
|
|
4878
|
-
/* @__PURE__ */
|
|
5000
|
+
/* @__PURE__ */ jsx32(
|
|
4879
5001
|
Button10,
|
|
4880
5002
|
{
|
|
4881
5003
|
variant: "secondary",
|
|
@@ -4911,20 +5033,20 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
4911
5033
|
{ field: "for_each", placeholder: "e.g. var.names" },
|
|
4912
5034
|
{ field: "provider", placeholder: "e.g. aws.west" }
|
|
4913
5035
|
];
|
|
4914
|
-
return /* @__PURE__ */
|
|
4915
|
-
/* @__PURE__ */
|
|
4916
|
-
/* @__PURE__ */
|
|
4917
|
-
/* @__PURE__ */
|
|
5036
|
+
return /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
5037
|
+
/* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-actions", children: [
|
|
5038
|
+
/* @__PURE__ */ jsx32(Badge2, { variant: resource.kind === "data" ? "info" : "neutral", children: resource.kind === "data" ? "data" : "resource" }),
|
|
5039
|
+
/* @__PURE__ */ jsx32(
|
|
4918
5040
|
Identifier,
|
|
4919
5041
|
{
|
|
4920
5042
|
className: "lace-panel-row-card__name",
|
|
4921
5043
|
text: `${resource.type}.${resource.name}`
|
|
4922
5044
|
}
|
|
4923
5045
|
),
|
|
4924
|
-
editable && /* @__PURE__ */
|
|
5046
|
+
editable && /* @__PURE__ */ jsx32(
|
|
4925
5047
|
IconButton7,
|
|
4926
5048
|
{
|
|
4927
|
-
icon: /* @__PURE__ */
|
|
5049
|
+
icon: /* @__PURE__ */ jsx32(CanvasIcon, { name: "close" }),
|
|
4928
5050
|
"aria-label": `Remove ${resource.type}.${resource.name}`,
|
|
4929
5051
|
size: "md",
|
|
4930
5052
|
tooltipPlacement: "bottom-end",
|
|
@@ -4933,7 +5055,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
4933
5055
|
)
|
|
4934
5056
|
] }),
|
|
4935
5057
|
metaArguments.map(
|
|
4936
|
-
({ field, placeholder }) => draft[field] || editable ? /* @__PURE__ */
|
|
5058
|
+
({ field, placeholder }) => draft[field] || editable ? /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx32(
|
|
4937
5059
|
Input5,
|
|
4938
5060
|
{
|
|
4939
5061
|
label: field,
|
|
@@ -4946,11 +5068,11 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
4946
5068
|
}
|
|
4947
5069
|
) }, field) : null
|
|
4948
5070
|
),
|
|
4949
|
-
/* @__PURE__ */
|
|
5071
|
+
/* @__PURE__ */ jsx32("div", { className: "lace-panel-row-sublabel", children: "Arguments" }),
|
|
4950
5072
|
draft.arguments.map((argument, i) => (
|
|
4951
5073
|
// biome-ignore lint/suspicious/noArrayIndexKey: argument rows are positional while edited
|
|
4952
|
-
/* @__PURE__ */
|
|
4953
|
-
/* @__PURE__ */
|
|
5074
|
+
/* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
5075
|
+
/* @__PURE__ */ jsx32(
|
|
4954
5076
|
Input5,
|
|
4955
5077
|
{
|
|
4956
5078
|
value: argument.name,
|
|
@@ -4962,7 +5084,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
4962
5084
|
error: argumentDupes.has(i)
|
|
4963
5085
|
}
|
|
4964
5086
|
),
|
|
4965
|
-
/* @__PURE__ */
|
|
5087
|
+
/* @__PURE__ */ jsx32(
|
|
4966
5088
|
Input5,
|
|
4967
5089
|
{
|
|
4968
5090
|
value: argument.value,
|
|
@@ -4973,10 +5095,10 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
4973
5095
|
readOnly: !editable
|
|
4974
5096
|
}
|
|
4975
5097
|
),
|
|
4976
|
-
editable && /* @__PURE__ */
|
|
5098
|
+
editable && /* @__PURE__ */ jsx32(
|
|
4977
5099
|
IconButton7,
|
|
4978
5100
|
{
|
|
4979
|
-
icon: /* @__PURE__ */
|
|
5101
|
+
icon: /* @__PURE__ */ jsx32(CanvasIcon, { name: "close" }),
|
|
4980
5102
|
"aria-label": `Remove ${argument.name || "the argument"}`,
|
|
4981
5103
|
size: "md",
|
|
4982
5104
|
tooltipPlacement: "bottom-end",
|
|
@@ -4988,7 +5110,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
4988
5110
|
)
|
|
4989
5111
|
] }, i)
|
|
4990
5112
|
)),
|
|
4991
|
-
editable && /* @__PURE__ */
|
|
5113
|
+
editable && /* @__PURE__ */ jsx32(
|
|
4992
5114
|
Button10,
|
|
4993
5115
|
{
|
|
4994
5116
|
variant: "secondary",
|
|
@@ -4997,9 +5119,9 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
4997
5119
|
children: "+ Add argument"
|
|
4998
5120
|
}
|
|
4999
5121
|
),
|
|
5000
|
-
(draft.blocks.length > 0 || editable) && /* @__PURE__ */
|
|
5001
|
-
/* @__PURE__ */
|
|
5002
|
-
/* @__PURE__ */
|
|
5122
|
+
(draft.blocks.length > 0 || editable) && /* @__PURE__ */ jsxs20(Fragment11, { children: [
|
|
5123
|
+
/* @__PURE__ */ jsx32("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
|
|
5124
|
+
/* @__PURE__ */ jsx32(
|
|
5003
5125
|
BlockEditor,
|
|
5004
5126
|
{
|
|
5005
5127
|
blocks: draft.blocks,
|
|
@@ -5008,10 +5130,10 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
5008
5130
|
}
|
|
5009
5131
|
)
|
|
5010
5132
|
] }),
|
|
5011
|
-
(draft.depends_on.length > 0 || editable && dependencyOptions.length > 0) && /* @__PURE__ */
|
|
5012
|
-
/* @__PURE__ */
|
|
5013
|
-
!editable ? draft.depends_on.map((dep) => /* @__PURE__ */
|
|
5014
|
-
/* @__PURE__ */
|
|
5133
|
+
(draft.depends_on.length > 0 || editable && dependencyOptions.length > 0) && /* @__PURE__ */ jsxs20(Fragment11, { children: [
|
|
5134
|
+
/* @__PURE__ */ jsx32("div", { className: "lace-panel-row-sublabel", children: "Depends on" }),
|
|
5135
|
+
!editable ? draft.depends_on.map((dep) => /* @__PURE__ */ jsx32("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx32(Identifier, { text: dep }) }, dep)) : dependencyOptions.map((dep) => /* @__PURE__ */ jsxs20("label", { className: "lace-panel-checkbox-row", children: [
|
|
5136
|
+
/* @__PURE__ */ jsx32(
|
|
5015
5137
|
"input",
|
|
5016
5138
|
{
|
|
5017
5139
|
type: "checkbox",
|
|
@@ -5022,10 +5144,10 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
5022
5144
|
)
|
|
5023
5145
|
}
|
|
5024
5146
|
),
|
|
5025
|
-
/* @__PURE__ */
|
|
5147
|
+
/* @__PURE__ */ jsx32(Identifier, { text: dep })
|
|
5026
5148
|
] }, dep))
|
|
5027
5149
|
] }),
|
|
5028
|
-
editable && /* @__PURE__ */
|
|
5150
|
+
editable && /* @__PURE__ */ jsx32(
|
|
5029
5151
|
UpdateButton,
|
|
5030
5152
|
{
|
|
5031
5153
|
draft: card,
|
|
@@ -5039,7 +5161,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
5039
5161
|
// src/components/panels/TerraformConfigPanel.tsx
|
|
5040
5162
|
import { Button as Button11, IconButton as IconButton8, Input as Input6, Panel as Panel5 } from "@lace-cloud/ui";
|
|
5041
5163
|
import "./panels-shared-3HUQC7TC.css";
|
|
5042
|
-
import { Fragment as
|
|
5164
|
+
import { Fragment as Fragment12, jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5043
5165
|
function toRows3(terraform) {
|
|
5044
5166
|
return (terraform?.required_providers ?? []).map((req) => ({
|
|
5045
5167
|
id: req.name,
|
|
@@ -5071,9 +5193,9 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
5071
5193
|
const { requiredVersion, providers } = draft.value;
|
|
5072
5194
|
const setProviders2 = (next) => draft.set("providers", next);
|
|
5073
5195
|
const updateProvider = (index, field, value) => setProviders2(providers.map((p, i) => i === index ? { ...p, [field]: value } : p));
|
|
5074
|
-
return /* @__PURE__ */
|
|
5075
|
-
/* @__PURE__ */
|
|
5076
|
-
/* @__PURE__ */
|
|
5196
|
+
return /* @__PURE__ */ jsxs21(Fragment12, { children: [
|
|
5197
|
+
/* @__PURE__ */ jsx33("h4", { className: "lace-panel-section-title", children: "Required Version" }),
|
|
5198
|
+
/* @__PURE__ */ jsx33("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx33(
|
|
5077
5199
|
Input6,
|
|
5078
5200
|
{
|
|
5079
5201
|
value: requiredVersion,
|
|
@@ -5083,10 +5205,10 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
5083
5205
|
readOnly: !editable
|
|
5084
5206
|
}
|
|
5085
5207
|
) }),
|
|
5086
|
-
/* @__PURE__ */
|
|
5087
|
-
providers.map((p, i) => /* @__PURE__ */
|
|
5088
|
-
/* @__PURE__ */
|
|
5089
|
-
/* @__PURE__ */
|
|
5208
|
+
/* @__PURE__ */ jsx33("h4", { className: "lace-panel-section-title", children: "Required Providers" }),
|
|
5209
|
+
providers.map((p, i) => /* @__PURE__ */ jsxs21("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
5210
|
+
/* @__PURE__ */ jsxs21("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
5211
|
+
/* @__PURE__ */ jsx33(
|
|
5090
5212
|
Input6,
|
|
5091
5213
|
{
|
|
5092
5214
|
value: p.name,
|
|
@@ -5096,10 +5218,10 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
5096
5218
|
readOnly: !editable
|
|
5097
5219
|
}
|
|
5098
5220
|
),
|
|
5099
|
-
editable && /* @__PURE__ */
|
|
5221
|
+
editable && /* @__PURE__ */ jsx33(
|
|
5100
5222
|
IconButton8,
|
|
5101
5223
|
{
|
|
5102
|
-
icon: /* @__PURE__ */
|
|
5224
|
+
icon: /* @__PURE__ */ jsx33(CanvasIcon, { name: "close" }),
|
|
5103
5225
|
"aria-label": "Remove provider",
|
|
5104
5226
|
size: "md",
|
|
5105
5227
|
tooltipPlacement: "bottom-end",
|
|
@@ -5107,7 +5229,7 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
5107
5229
|
}
|
|
5108
5230
|
)
|
|
5109
5231
|
] }),
|
|
5110
|
-
/* @__PURE__ */
|
|
5232
|
+
/* @__PURE__ */ jsx33("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx33(
|
|
5111
5233
|
Input6,
|
|
5112
5234
|
{
|
|
5113
5235
|
value: p.source,
|
|
@@ -5117,7 +5239,7 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
5117
5239
|
readOnly: !editable
|
|
5118
5240
|
}
|
|
5119
5241
|
) }),
|
|
5120
|
-
/* @__PURE__ */
|
|
5242
|
+
/* @__PURE__ */ jsx33("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx33(
|
|
5121
5243
|
Input6,
|
|
5122
5244
|
{
|
|
5123
5245
|
value: p.version,
|
|
@@ -5127,7 +5249,7 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
5127
5249
|
readOnly: !editable
|
|
5128
5250
|
}
|
|
5129
5251
|
) }),
|
|
5130
|
-
(p.aliases || editable) && /* @__PURE__ */
|
|
5252
|
+
(p.aliases || editable) && /* @__PURE__ */ jsx33("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx33(
|
|
5131
5253
|
Input6,
|
|
5132
5254
|
{
|
|
5133
5255
|
value: p.aliases,
|
|
@@ -5140,7 +5262,7 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
5140
5262
|
}
|
|
5141
5263
|
) })
|
|
5142
5264
|
] }, p.id)),
|
|
5143
|
-
editable && /* @__PURE__ */
|
|
5265
|
+
editable && /* @__PURE__ */ jsx33(
|
|
5144
5266
|
Button11,
|
|
5145
5267
|
{
|
|
5146
5268
|
variant: "secondary",
|
|
@@ -5152,17 +5274,17 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
5152
5274
|
children: "+ Add provider"
|
|
5153
5275
|
}
|
|
5154
5276
|
),
|
|
5155
|
-
/* @__PURE__ */
|
|
5156
|
-
/* @__PURE__ */
|
|
5157
|
-
editable && /* @__PURE__ */
|
|
5277
|
+
/* @__PURE__ */ jsx33("h4", { className: "lace-panel-section-title", children: "Backend" }),
|
|
5278
|
+
/* @__PURE__ */ jsx33("div", { className: "lace-panel-hint", children: "Terraform state is managed by Lace Cloud. The HTTP backend is configured automatically during generation." }),
|
|
5279
|
+
editable && /* @__PURE__ */ jsx33(UpdateButton, { draft, label: "Update terraform block" })
|
|
5158
5280
|
] });
|
|
5159
5281
|
}
|
|
5160
5282
|
function TerraformConfigPanel({ terraform, onSave, onClose }) {
|
|
5161
|
-
return /* @__PURE__ */
|
|
5283
|
+
return /* @__PURE__ */ jsx33(Panel5, { title: "Terraform Configuration", onClose, children: /* @__PURE__ */ jsx33(TerraformConfigContent, { terraform, onSave }) });
|
|
5162
5284
|
}
|
|
5163
5285
|
|
|
5164
5286
|
// src/components/panels/ModuleDetails.tsx
|
|
5165
|
-
import { Fragment as
|
|
5287
|
+
import { Fragment as Fragment13, jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5166
5288
|
function assertApplied(result) {
|
|
5167
5289
|
if (!result?.success) throw new Error("apply failed");
|
|
5168
5290
|
}
|
|
@@ -5171,18 +5293,18 @@ function ModuleDetails({ moduleKey, open = [] }) {
|
|
|
5171
5293
|
const { bundle, runner } = useCanvas();
|
|
5172
5294
|
const settings = useMemo10(() => deriveSettingsConfig(bundle, moduleKey), [bundle, moduleKey]);
|
|
5173
5295
|
if (!settings) return null;
|
|
5174
|
-
if (settings.reference) return /* @__PURE__ */
|
|
5296
|
+
if (settings.reference) return /* @__PURE__ */ jsx34(ReferenceDetails, { settings });
|
|
5175
5297
|
const apply = async (actions) => {
|
|
5176
5298
|
assertApplied(await runner.apply(actions));
|
|
5177
5299
|
};
|
|
5178
|
-
return /* @__PURE__ */
|
|
5179
|
-
/* @__PURE__ */
|
|
5300
|
+
return /* @__PURE__ */ jsxs22(Fragment13, { children: [
|
|
5301
|
+
/* @__PURE__ */ jsx34(
|
|
5180
5302
|
AccordionSection,
|
|
5181
5303
|
{
|
|
5182
5304
|
title: "Resources",
|
|
5183
5305
|
defaultOpen: open.includes("Resources"),
|
|
5184
5306
|
badge: `(${settings.resources.length})`,
|
|
5185
|
-
children: /* @__PURE__ */
|
|
5307
|
+
children: /* @__PURE__ */ jsx34(
|
|
5186
5308
|
ResourcesContent,
|
|
5187
5309
|
{
|
|
5188
5310
|
resources: settings.resources,
|
|
@@ -5196,7 +5318,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
|
|
|
5196
5318
|
)
|
|
5197
5319
|
}
|
|
5198
5320
|
),
|
|
5199
|
-
/* @__PURE__ */
|
|
5321
|
+
/* @__PURE__ */ jsx34(AccordionSection, { title: "Interface", defaultOpen: open.includes("Interface"), children: /* @__PURE__ */ jsx34(
|
|
5200
5322
|
ModuleInterfaceContent,
|
|
5201
5323
|
{
|
|
5202
5324
|
settings,
|
|
@@ -5204,13 +5326,13 @@ function ModuleDetails({ moduleKey, open = [] }) {
|
|
|
5204
5326
|
},
|
|
5205
5327
|
sectionKey(moduleKey, "Interface")
|
|
5206
5328
|
) }),
|
|
5207
|
-
/* @__PURE__ */
|
|
5329
|
+
/* @__PURE__ */ jsx34(
|
|
5208
5330
|
AccordionSection,
|
|
5209
5331
|
{
|
|
5210
5332
|
title: "Moved and import blocks",
|
|
5211
5333
|
defaultOpen: open.includes("Moved and import blocks"),
|
|
5212
5334
|
badge: settings.directives.length > 0 ? `(${settings.directives.length})` : void 0,
|
|
5213
|
-
children: /* @__PURE__ */
|
|
5335
|
+
children: /* @__PURE__ */ jsx34(
|
|
5214
5336
|
DirectivesContent,
|
|
5215
5337
|
{
|
|
5216
5338
|
directives: settings.directives,
|
|
@@ -5220,7 +5342,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
|
|
|
5220
5342
|
)
|
|
5221
5343
|
}
|
|
5222
5344
|
),
|
|
5223
|
-
/* @__PURE__ */
|
|
5345
|
+
/* @__PURE__ */ jsx34(AccordionSection, { title: "Locals", defaultOpen: open.includes("Locals"), children: /* @__PURE__ */ jsx34(
|
|
5224
5346
|
LocalsContent,
|
|
5225
5347
|
{
|
|
5226
5348
|
locals: settings.locals,
|
|
@@ -5228,7 +5350,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
|
|
|
5228
5350
|
},
|
|
5229
5351
|
sectionKey(moduleKey, "Locals")
|
|
5230
5352
|
) }),
|
|
5231
|
-
/* @__PURE__ */
|
|
5353
|
+
/* @__PURE__ */ jsx34(AccordionSection, { title: "Providers", defaultOpen: open.includes("Providers"), children: /* @__PURE__ */ jsx34(
|
|
5232
5354
|
ProvidersContent,
|
|
5233
5355
|
{
|
|
5234
5356
|
providers: settings.providers,
|
|
@@ -5236,7 +5358,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
|
|
|
5236
5358
|
},
|
|
5237
5359
|
sectionKey(moduleKey, "Providers")
|
|
5238
5360
|
) }),
|
|
5239
|
-
/* @__PURE__ */
|
|
5361
|
+
/* @__PURE__ */ jsx34(AccordionSection, { title: "Terraform Config", defaultOpen: open.includes("Terraform Config"), children: /* @__PURE__ */ jsx34(
|
|
5240
5362
|
TerraformConfigContent,
|
|
5241
5363
|
{
|
|
5242
5364
|
terraform: settings.terraform,
|
|
@@ -5253,9 +5375,9 @@ function DirectivesContent({
|
|
|
5253
5375
|
const { editable } = useCanvas();
|
|
5254
5376
|
const draft = useDraft({ blocks: directives }, ({ blocks: blocks2 }) => onSave(blocks2));
|
|
5255
5377
|
const { blocks } = draft.value;
|
|
5256
|
-
return /* @__PURE__ */
|
|
5257
|
-
blocks.length === 0 && /* @__PURE__ */
|
|
5258
|
-
/* @__PURE__ */
|
|
5378
|
+
return /* @__PURE__ */ jsxs22(Fragment13, { children: [
|
|
5379
|
+
blocks.length === 0 && /* @__PURE__ */ jsx34("div", { className: "lace-panel-hint", children: "No moved or import blocks." }),
|
|
5380
|
+
/* @__PURE__ */ jsx34(
|
|
5259
5381
|
BlockEditor,
|
|
5260
5382
|
{
|
|
5261
5383
|
blocks,
|
|
@@ -5267,32 +5389,32 @@ function DirectivesContent({
|
|
|
5267
5389
|
]
|
|
5268
5390
|
}
|
|
5269
5391
|
),
|
|
5270
|
-
editable && /* @__PURE__ */
|
|
5392
|
+
editable && /* @__PURE__ */ jsx34(UpdateButton, { draft, label: "Update moved and import blocks" })
|
|
5271
5393
|
] });
|
|
5272
5394
|
}
|
|
5273
5395
|
function ReferenceDetails({ settings }) {
|
|
5274
5396
|
const reference = settings.reference;
|
|
5275
5397
|
if (!reference) return null;
|
|
5276
|
-
return /* @__PURE__ */
|
|
5277
|
-
/* @__PURE__ */
|
|
5278
|
-
/* @__PURE__ */
|
|
5279
|
-
/* @__PURE__ */
|
|
5280
|
-
/* @__PURE__ */
|
|
5281
|
-
/* @__PURE__ */
|
|
5398
|
+
return /* @__PURE__ */ jsxs22(Fragment13, { children: [
|
|
5399
|
+
/* @__PURE__ */ jsxs22(AccordionSection, { title: "Source", defaultOpen: true, children: [
|
|
5400
|
+
/* @__PURE__ */ jsx34("div", { className: "lace-panel-hint", children: "A reference: Lace reads it where its source points and never edits it." }),
|
|
5401
|
+
/* @__PURE__ */ jsxs22("div", { className: "lace-panel-row-actions lace-panel-row-actions--stacked", children: [
|
|
5402
|
+
/* @__PURE__ */ jsx34(Input7, { label: "Source", value: reference.source, fullWidth: true, mono: true, readOnly: true }),
|
|
5403
|
+
/* @__PURE__ */ jsx34(Input7, { label: "Version", value: reference.version, fullWidth: true, mono: true, readOnly: true })
|
|
5282
5404
|
] })
|
|
5283
5405
|
] }),
|
|
5284
|
-
/* @__PURE__ */
|
|
5285
|
-
/* @__PURE__ */
|
|
5286
|
-
settings.variables.length === 0 && /* @__PURE__ */
|
|
5287
|
-
settings.variables.map((v) => /* @__PURE__ */
|
|
5288
|
-
/* @__PURE__ */
|
|
5289
|
-
settings.outputs.map((o) => /* @__PURE__ */
|
|
5406
|
+
/* @__PURE__ */ jsxs22(AccordionSection, { title: "Interface", defaultOpen: true, children: [
|
|
5407
|
+
/* @__PURE__ */ jsx34("h4", { className: "lace-panel-section-title", children: "Inputs" }),
|
|
5408
|
+
settings.variables.length === 0 && /* @__PURE__ */ jsx34("div", { className: "lace-panel-hint", children: "The IR holds no interface for this reference." }),
|
|
5409
|
+
settings.variables.map((v) => /* @__PURE__ */ jsx34("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx34(Identifier, { text: `${typedName(v.name, v.type)}${v.required ? " (required)" : ""}` }) }, v.name)),
|
|
5410
|
+
/* @__PURE__ */ jsx34("h4", { className: "lace-panel-section-title", children: "Outputs" }),
|
|
5411
|
+
settings.outputs.map((o) => /* @__PURE__ */ jsx34("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx34(Identifier, { text: typedName(o.name, o.type) }) }, o.name))
|
|
5290
5412
|
] })
|
|
5291
5413
|
] });
|
|
5292
5414
|
}
|
|
5293
5415
|
|
|
5294
5416
|
// src/components/panels/ModuleConfigPanel.tsx
|
|
5295
|
-
import { Fragment as
|
|
5417
|
+
import { Fragment as Fragment14, jsx as jsx35, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5296
5418
|
var MODE_ITEMS = [
|
|
5297
5419
|
{ value: "empty", label: "Unset" },
|
|
5298
5420
|
{ value: "literal", label: "Lit" },
|
|
@@ -5437,7 +5559,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5437
5559
|
...m,
|
|
5438
5560
|
disabled: !editable || m.value === "wired" || currentMode === "wired"
|
|
5439
5561
|
}));
|
|
5440
|
-
return /* @__PURE__ */
|
|
5562
|
+
return /* @__PURE__ */ jsx35(
|
|
5441
5563
|
ModeToggle,
|
|
5442
5564
|
{
|
|
5443
5565
|
value: currentMode,
|
|
@@ -5449,29 +5571,29 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5449
5571
|
}
|
|
5450
5572
|
function renderInputField(input) {
|
|
5451
5573
|
const currentMode = binding(input)?.mode ?? input.mode;
|
|
5452
|
-
return /* @__PURE__ */
|
|
5453
|
-
/* @__PURE__ */
|
|
5454
|
-
/* @__PURE__ */
|
|
5455
|
-
input.required && /* @__PURE__ */
|
|
5574
|
+
return /* @__PURE__ */ jsxs23("div", { className: "lace-panel-field", children: [
|
|
5575
|
+
/* @__PURE__ */ jsxs23("label", { className: "lace-panel-row-label", children: [
|
|
5576
|
+
/* @__PURE__ */ jsx35(Identifier, { text: input.name }),
|
|
5577
|
+
input.required && /* @__PURE__ */ jsx35("span", { className: "lace-mcp__required-star", children: "*" })
|
|
5456
5578
|
] }),
|
|
5457
5579
|
renderModeSelector(input),
|
|
5458
|
-
/* @__PURE__ */
|
|
5580
|
+
/* @__PURE__ */ jsxs23("div", { className: "lace-panel-row-content", children: [
|
|
5459
5581
|
currentMode === "wired" && renderWiredEditor(input),
|
|
5460
5582
|
currentMode === "variable" && renderVariableEditor(input),
|
|
5461
5583
|
currentMode === "expression" && renderExpressionEditor(input),
|
|
5462
5584
|
currentMode === "literal" && renderLiteralEditor(input)
|
|
5463
5585
|
] }),
|
|
5464
|
-
input.description && /* @__PURE__ */
|
|
5586
|
+
input.description && /* @__PURE__ */ jsx35("div", { className: "lace-panel-field__description", children: input.description })
|
|
5465
5587
|
] }, input.name);
|
|
5466
5588
|
}
|
|
5467
5589
|
function renderWiredEditor(input) {
|
|
5468
5590
|
const label = input.wired_source ?? "Not wired";
|
|
5469
|
-
return /* @__PURE__ */
|
|
5470
|
-
/* @__PURE__ */
|
|
5471
|
-
editable && /* @__PURE__ */
|
|
5591
|
+
return /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__wired-row", children: [
|
|
5592
|
+
/* @__PURE__ */ jsx35("div", { className: "lace-mcp__wired-input", children: /* @__PURE__ */ jsx35(Input8, { value: label, readOnly: true, fullWidth: true, mono: true }) }),
|
|
5593
|
+
editable && /* @__PURE__ */ jsx35(
|
|
5472
5594
|
IconButton9,
|
|
5473
5595
|
{
|
|
5474
|
-
icon: /* @__PURE__ */
|
|
5596
|
+
icon: /* @__PURE__ */ jsx35(CanvasIcon, { name: "close" }),
|
|
5475
5597
|
"aria-label": "Disconnect this input",
|
|
5476
5598
|
size: "md",
|
|
5477
5599
|
tooltipPlacement: "bottom-end",
|
|
@@ -5481,7 +5603,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5481
5603
|
] });
|
|
5482
5604
|
}
|
|
5483
5605
|
function renderVariableEditor(input) {
|
|
5484
|
-
return /* @__PURE__ */
|
|
5606
|
+
return /* @__PURE__ */ jsx35(
|
|
5485
5607
|
Input8,
|
|
5486
5608
|
{
|
|
5487
5609
|
value: binding(input)?.variable ?? "",
|
|
@@ -5497,7 +5619,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5497
5619
|
);
|
|
5498
5620
|
}
|
|
5499
5621
|
function renderExpressionEditor(input) {
|
|
5500
|
-
return /* @__PURE__ */
|
|
5622
|
+
return /* @__PURE__ */ jsx35(
|
|
5501
5623
|
Textarea3,
|
|
5502
5624
|
{
|
|
5503
5625
|
value: binding(input)?.expression ?? "",
|
|
@@ -5515,7 +5637,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5515
5637
|
const kind = literalKind(input.type);
|
|
5516
5638
|
const updateValue = (next) => setBinding(input, { value: next });
|
|
5517
5639
|
if (kind === "bool") {
|
|
5518
|
-
return /* @__PURE__ */
|
|
5640
|
+
return /* @__PURE__ */ jsxs23(
|
|
5519
5641
|
"select",
|
|
5520
5642
|
{
|
|
5521
5643
|
className: "lace-mcp__select",
|
|
@@ -5523,14 +5645,14 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5523
5645
|
onChange: (e) => updateValue(e.target.value === "true"),
|
|
5524
5646
|
disabled: !editable,
|
|
5525
5647
|
children: [
|
|
5526
|
-
/* @__PURE__ */
|
|
5527
|
-
/* @__PURE__ */
|
|
5648
|
+
/* @__PURE__ */ jsx35("option", { value: "true", children: "True" }),
|
|
5649
|
+
/* @__PURE__ */ jsx35("option", { value: "false", children: "False" })
|
|
5528
5650
|
]
|
|
5529
5651
|
}
|
|
5530
5652
|
);
|
|
5531
5653
|
}
|
|
5532
5654
|
if (kind === "number") {
|
|
5533
|
-
return /* @__PURE__ */
|
|
5655
|
+
return /* @__PURE__ */ jsx35(
|
|
5534
5656
|
Input8,
|
|
5535
5657
|
{
|
|
5536
5658
|
type: "number",
|
|
@@ -5543,7 +5665,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5543
5665
|
}
|
|
5544
5666
|
if (kind === "collection") {
|
|
5545
5667
|
const jsonStr = typeof value === "string" ? value : JSON.stringify(value ?? null, null, 2);
|
|
5546
|
-
return /* @__PURE__ */
|
|
5668
|
+
return /* @__PURE__ */ jsx35(
|
|
5547
5669
|
Textarea3,
|
|
5548
5670
|
{
|
|
5549
5671
|
value: jsonStr,
|
|
@@ -5561,7 +5683,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5561
5683
|
}
|
|
5562
5684
|
);
|
|
5563
5685
|
}
|
|
5564
|
-
return /* @__PURE__ */
|
|
5686
|
+
return /* @__PURE__ */ jsx35(
|
|
5565
5687
|
Input8,
|
|
5566
5688
|
{
|
|
5567
5689
|
value: String(value ?? ""),
|
|
@@ -5578,34 +5700,34 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5578
5700
|
);
|
|
5579
5701
|
}
|
|
5580
5702
|
if (!config) {
|
|
5581
|
-
return /* @__PURE__ */
|
|
5582
|
-
/* @__PURE__ */
|
|
5703
|
+
return /* @__PURE__ */ jsxs23(Panel6, { title: "Error", onClose, children: [
|
|
5704
|
+
/* @__PURE__ */ jsxs23("div", { className: "lace-mcp__error-title", children: [
|
|
5583
5705
|
'Failed to load configuration for "',
|
|
5584
5706
|
instance_id,
|
|
5585
5707
|
'":'
|
|
5586
5708
|
] }),
|
|
5587
|
-
/* @__PURE__ */
|
|
5709
|
+
/* @__PURE__ */ jsx35("div", { className: "lace-mcp__error-detail", children: "Instance not found in the current Bundle." })
|
|
5588
5710
|
] });
|
|
5589
5711
|
}
|
|
5590
5712
|
const dependsOn = fields.depends_on;
|
|
5591
5713
|
const setProviders2 = (next) => draft.set("providers", next);
|
|
5592
|
-
const title = /* @__PURE__ */
|
|
5593
|
-
/* @__PURE__ */
|
|
5594
|
-
/* @__PURE__ */
|
|
5714
|
+
const title = /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__title", children: [
|
|
5715
|
+
/* @__PURE__ */ jsx35("div", { className: "lace-mcp__title-eyebrow", children: "Module" }),
|
|
5716
|
+
/* @__PURE__ */ jsx35("h3", { className: "lace-mcp__title-id", children: /* @__PURE__ */ jsx35(Identifier, { text: instance_id }) })
|
|
5595
5717
|
] });
|
|
5596
|
-
const footer = editable ? /* @__PURE__ */
|
|
5597
|
-
return /* @__PURE__ */
|
|
5598
|
-
requiredInputs.length > 0 && /* @__PURE__ */
|
|
5599
|
-
optionalInputs.length > 0 && /* @__PURE__ */
|
|
5600
|
-
config.dependency_options.length > 0 && /* @__PURE__ */
|
|
5718
|
+
const footer = editable ? /* @__PURE__ */ jsx35(UpdateButton, { draft, label: "Update configuration" }) : void 0;
|
|
5719
|
+
return /* @__PURE__ */ jsxs23(Panel6, { title, footer, flush: true, onClose, children: [
|
|
5720
|
+
requiredInputs.length > 0 && /* @__PURE__ */ jsx35(AccordionSection, { title: "Required Inputs", defaultOpen: true, badge: `(${requiredInputs.length})`, children: requiredInputs.map(renderInputField) }),
|
|
5721
|
+
optionalInputs.length > 0 && /* @__PURE__ */ jsx35(AccordionSection, { title: "Optional Inputs", defaultOpen: true, badge: `(${optionalInputs.length})`, children: optionalInputs.map(renderInputField) }),
|
|
5722
|
+
config.dependency_options.length > 0 && /* @__PURE__ */ jsxs23(
|
|
5601
5723
|
AccordionSection,
|
|
5602
5724
|
{
|
|
5603
5725
|
title: "Depends On",
|
|
5604
5726
|
badge: dependsOn.length > 0 ? `(${dependsOn.length})` : void 0,
|
|
5605
5727
|
children: [
|
|
5606
|
-
/* @__PURE__ */
|
|
5607
|
-
config.dependency_options.map((option) => /* @__PURE__ */
|
|
5608
|
-
/* @__PURE__ */
|
|
5728
|
+
/* @__PURE__ */ jsx35("div", { className: "lace-mcp__depends-hint", children: "Select sibling instances this module depends on." }),
|
|
5729
|
+
config.dependency_options.map((option) => /* @__PURE__ */ jsxs23("label", { className: "lace-mcp__depends-item", children: [
|
|
5730
|
+
/* @__PURE__ */ jsx35(
|
|
5609
5731
|
"input",
|
|
5610
5732
|
{
|
|
5611
5733
|
type: "checkbox",
|
|
@@ -5618,29 +5740,29 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5618
5740
|
)
|
|
5619
5741
|
}
|
|
5620
5742
|
),
|
|
5621
|
-
/* @__PURE__ */
|
|
5743
|
+
/* @__PURE__ */ jsx35(Identifier, { className: "lace-mcp__depends-label", text: option })
|
|
5622
5744
|
] }, option))
|
|
5623
5745
|
]
|
|
5624
5746
|
}
|
|
5625
5747
|
),
|
|
5626
|
-
(fields.providers.length > 0 || editable) && /* @__PURE__ */
|
|
5748
|
+
(fields.providers.length > 0 || editable) && /* @__PURE__ */ jsxs23(
|
|
5627
5749
|
AccordionSection,
|
|
5628
5750
|
{
|
|
5629
5751
|
title: "Providers",
|
|
5630
5752
|
badge: fields.providers.length > 0 ? `(${fields.providers.length})` : void 0,
|
|
5631
5753
|
children: [
|
|
5632
|
-
/* @__PURE__ */
|
|
5754
|
+
/* @__PURE__ */ jsxs23("div", { className: "lace-mcp__depends-hint", children: [
|
|
5633
5755
|
"Map each child-local provider name to the root provider reference passed down (e.g.",
|
|
5634
5756
|
" ",
|
|
5635
|
-
/* @__PURE__ */
|
|
5757
|
+
/* @__PURE__ */ jsx35("code", { children: "aws" }),
|
|
5636
5758
|
" \u2192 ",
|
|
5637
|
-
/* @__PURE__ */
|
|
5759
|
+
/* @__PURE__ */ jsx35("code", { children: "aws.west" }),
|
|
5638
5760
|
")."
|
|
5639
5761
|
] }),
|
|
5640
5762
|
fields.providers.map((row, i) => (
|
|
5641
5763
|
// biome-ignore lint/suspicious/noArrayIndexKey: rows are positional and freely editable
|
|
5642
|
-
/* @__PURE__ */
|
|
5643
|
-
/* @__PURE__ */
|
|
5764
|
+
/* @__PURE__ */ jsxs23("div", { className: "lace-mcp__provider-row", children: [
|
|
5765
|
+
/* @__PURE__ */ jsx35(
|
|
5644
5766
|
Input8,
|
|
5645
5767
|
{
|
|
5646
5768
|
value: row.key,
|
|
@@ -5652,8 +5774,8 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5652
5774
|
readOnly: !editable
|
|
5653
5775
|
}
|
|
5654
5776
|
),
|
|
5655
|
-
/* @__PURE__ */
|
|
5656
|
-
/* @__PURE__ */
|
|
5777
|
+
/* @__PURE__ */ jsx35("span", { className: "lace-mcp__provider-arrow", children: "=" }),
|
|
5778
|
+
/* @__PURE__ */ jsx35(
|
|
5657
5779
|
Input8,
|
|
5658
5780
|
{
|
|
5659
5781
|
value: row.value,
|
|
@@ -5665,10 +5787,10 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5665
5787
|
readOnly: !editable
|
|
5666
5788
|
}
|
|
5667
5789
|
),
|
|
5668
|
-
editable && /* @__PURE__ */
|
|
5790
|
+
editable && /* @__PURE__ */ jsx35(
|
|
5669
5791
|
IconButton9,
|
|
5670
5792
|
{
|
|
5671
|
-
icon: /* @__PURE__ */
|
|
5793
|
+
icon: /* @__PURE__ */ jsx35(CanvasIcon, { name: "close" }),
|
|
5672
5794
|
"aria-label": "Remove this provider mapping",
|
|
5673
5795
|
size: "md",
|
|
5674
5796
|
tooltipPlacement: "bottom-end",
|
|
@@ -5677,7 +5799,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5677
5799
|
)
|
|
5678
5800
|
] }, i)
|
|
5679
5801
|
)),
|
|
5680
|
-
editable && /* @__PURE__ */
|
|
5802
|
+
editable && /* @__PURE__ */ jsx35(
|
|
5681
5803
|
Button12,
|
|
5682
5804
|
{
|
|
5683
5805
|
variant: "secondary",
|
|
@@ -5689,15 +5811,15 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5689
5811
|
]
|
|
5690
5812
|
}
|
|
5691
5813
|
),
|
|
5692
|
-
(fields.count || fields.for_each || editable) && /* @__PURE__ */
|
|
5693
|
-
/* @__PURE__ */
|
|
5814
|
+
(fields.count || fields.for_each || editable) && /* @__PURE__ */ jsxs23(AccordionSection, { title: "Repetition", children: [
|
|
5815
|
+
/* @__PURE__ */ jsxs23("div", { className: "lace-mcp__depends-hint", children: [
|
|
5694
5816
|
"The call's ",
|
|
5695
|
-
/* @__PURE__ */
|
|
5817
|
+
/* @__PURE__ */ jsx35("code", { children: "count" }),
|
|
5696
5818
|
" or ",
|
|
5697
|
-
/* @__PURE__ */
|
|
5819
|
+
/* @__PURE__ */ jsx35("code", { children: "for_each" }),
|
|
5698
5820
|
": one module, called once per instance."
|
|
5699
5821
|
] }),
|
|
5700
|
-
/* @__PURE__ */
|
|
5822
|
+
/* @__PURE__ */ jsx35(
|
|
5701
5823
|
Input8,
|
|
5702
5824
|
{
|
|
5703
5825
|
label: "count",
|
|
@@ -5709,7 +5831,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5709
5831
|
readOnly: !editable
|
|
5710
5832
|
}
|
|
5711
5833
|
),
|
|
5712
|
-
/* @__PURE__ */
|
|
5834
|
+
/* @__PURE__ */ jsx35(
|
|
5713
5835
|
Input8,
|
|
5714
5836
|
{
|
|
5715
5837
|
label: "for_each",
|
|
@@ -5722,26 +5844,26 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
5722
5844
|
}
|
|
5723
5845
|
)
|
|
5724
5846
|
] }),
|
|
5725
|
-
config.outputs.length > 0 && /* @__PURE__ */
|
|
5726
|
-
/* @__PURE__ */
|
|
5727
|
-
/* @__PURE__ */
|
|
5728
|
-
/* @__PURE__ */
|
|
5847
|
+
config.outputs.length > 0 && /* @__PURE__ */ jsx35(AccordionSection, { title: "Outputs", badge: `(${config.outputs.length})`, children: config.outputs.map((o) => /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__output-card", children: [
|
|
5848
|
+
/* @__PURE__ */ jsxs23("div", { className: "lace-mcp__output-header", children: [
|
|
5849
|
+
/* @__PURE__ */ jsx35(Identifier, { className: "lace-mcp__output-name", text: o.name }),
|
|
5850
|
+
/* @__PURE__ */ jsx35(Identifier, { className: "lace-mcp__output-type", text: o.type ?? "" })
|
|
5729
5851
|
] }),
|
|
5730
|
-
o.description && /* @__PURE__ */
|
|
5731
|
-
o.sensitive && /* @__PURE__ */
|
|
5852
|
+
o.description && /* @__PURE__ */ jsx35("div", { className: "lace-mcp__output-description", children: o.description }),
|
|
5853
|
+
o.sensitive && /* @__PURE__ */ jsx35("div", { className: "lace-mcp__output-sensitive", children: "sensitive" })
|
|
5732
5854
|
] }, o.name)) }),
|
|
5733
|
-
config.module_key && /* @__PURE__ */
|
|
5734
|
-
/* @__PURE__ */
|
|
5735
|
-
/* @__PURE__ */
|
|
5736
|
-
/* @__PURE__ */
|
|
5737
|
-
/* @__PURE__ */
|
|
5738
|
-
config.source && /* @__PURE__ */
|
|
5855
|
+
config.module_key && /* @__PURE__ */ jsxs23(Fragment14, { children: [
|
|
5856
|
+
/* @__PURE__ */ jsxs23("div", { className: "lace-mcp__module-heading", children: [
|
|
5857
|
+
/* @__PURE__ */ jsx35("div", { className: "lace-mcp__title-eyebrow", children: "Called module" }),
|
|
5858
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
5859
|
+
/* @__PURE__ */ jsx35(Identifier, { text: config.module_key }),
|
|
5860
|
+
config.source && /* @__PURE__ */ jsxs23("span", { className: "lace-mcp__module-source", children: [
|
|
5739
5861
|
" \xB7 ",
|
|
5740
|
-
/* @__PURE__ */
|
|
5862
|
+
/* @__PURE__ */ jsx35(Identifier, { text: config.source })
|
|
5741
5863
|
] })
|
|
5742
5864
|
] })
|
|
5743
5865
|
] }),
|
|
5744
|
-
/* @__PURE__ */
|
|
5866
|
+
/* @__PURE__ */ jsx35(ModuleDetails, { moduleKey: config.module_key }, config.module_key)
|
|
5745
5867
|
] })
|
|
5746
5868
|
] });
|
|
5747
5869
|
}
|
|
@@ -5767,11 +5889,11 @@ var moduleConfigPanel = {
|
|
|
5767
5889
|
};
|
|
5768
5890
|
|
|
5769
5891
|
// src/core/panels/SourceRefusedBanner.tsx
|
|
5770
|
-
import { jsx as
|
|
5892
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
5771
5893
|
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.";
|
|
5772
5894
|
var OUT_OF_LACE_SHAPE = "This Terraform is not in lace shape yet, so the canvas shows it read-only.";
|
|
5773
5895
|
function SourceRefusedBanner({ ctx }) {
|
|
5774
|
-
return /* @__PURE__ */
|
|
5896
|
+
return /* @__PURE__ */ jsx36(
|
|
5775
5897
|
RowActionBanner,
|
|
5776
5898
|
{
|
|
5777
5899
|
ctx,
|
|
@@ -5798,10 +5920,10 @@ import { createElement as createElement3 } from "react";
|
|
|
5798
5920
|
// src/components/panels/UnifiedSettingsPanel.tsx
|
|
5799
5921
|
import { Panel as Panel7 } from "@lace-cloud/ui";
|
|
5800
5922
|
import "./panels-shared-3HUQC7TC.css";
|
|
5801
|
-
import { jsx as
|
|
5923
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
5802
5924
|
function UnifiedSettingsPanel({ onClose }) {
|
|
5803
5925
|
const { bundle } = useCanvas();
|
|
5804
|
-
return /* @__PURE__ */
|
|
5926
|
+
return /* @__PURE__ */ jsx37(Panel7, { title: "Settings", flush: true, onClose, children: /* @__PURE__ */ jsx37(ModuleDetails, { moduleKey: bundle.entry, open: ["Interface"] }, bundle.entry) });
|
|
5805
5927
|
}
|
|
5806
5928
|
|
|
5807
5929
|
// src/core/panels/settings.ts
|
|
@@ -5858,10 +5980,10 @@ var CORE_CONTRIBUTIONS = {
|
|
|
5858
5980
|
};
|
|
5859
5981
|
|
|
5860
5982
|
// src/core/use-editing.ts
|
|
5861
|
-
import { useEffect as
|
|
5983
|
+
import { useEffect as useEffect12, useState as useState17 } from "react";
|
|
5862
5984
|
function useEditing(runner) {
|
|
5863
5985
|
const [editing, setEditing] = useState17(() => runner.editing());
|
|
5864
|
-
|
|
5986
|
+
useEffect12(() => {
|
|
5865
5987
|
setEditing(runner.editing());
|
|
5866
5988
|
return runner.onEditingChange(setEditing);
|
|
5867
5989
|
}, [runner]);
|
|
@@ -5869,7 +5991,7 @@ function useEditing(runner) {
|
|
|
5869
5991
|
}
|
|
5870
5992
|
|
|
5871
5993
|
// src/App.tsx
|
|
5872
|
-
import { jsx as
|
|
5994
|
+
import { jsx as jsx38, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5873
5995
|
var EMPTY_CONTRIBUTIONS = { overlays: [], panels: [], actions: [] };
|
|
5874
5996
|
var NO_TARGET = {};
|
|
5875
5997
|
function OverlayRunner({
|
|
@@ -5888,7 +6010,7 @@ function OverlayRunner({
|
|
|
5888
6010
|
},
|
|
5889
6011
|
[ctx.ports.presenter]
|
|
5890
6012
|
);
|
|
5891
|
-
return /* @__PURE__ */
|
|
6013
|
+
return /* @__PURE__ */ jsx38(PanelScope, { ctx, paths: overlay.paths, tick, onReadError, children: /* @__PURE__ */ jsx38(OverlayDecorations, { overlay, ctx, onDecorations }) });
|
|
5892
6014
|
}
|
|
5893
6015
|
function OverlayDecorations({
|
|
5894
6016
|
overlay,
|
|
@@ -5896,10 +6018,10 @@ function OverlayDecorations({
|
|
|
5896
6018
|
onDecorations
|
|
5897
6019
|
}) {
|
|
5898
6020
|
const decorations = overlay.useDecorations(ctx);
|
|
5899
|
-
|
|
6021
|
+
useEffect13(() => {
|
|
5900
6022
|
onDecorations(overlay.id, decorations);
|
|
5901
6023
|
}, [overlay.id, decorations, onDecorations]);
|
|
5902
|
-
|
|
6024
|
+
useEffect13(() => () => onDecorations(overlay.id, null), [overlay.id, onDecorations]);
|
|
5903
6025
|
return null;
|
|
5904
6026
|
}
|
|
5905
6027
|
function PanelSlot({ panel, ctx, tick }) {
|
|
@@ -5917,7 +6039,7 @@ function PanelSlot({ panel, ctx, tick }) {
|
|
|
5917
6039
|
return next;
|
|
5918
6040
|
});
|
|
5919
6041
|
}, []);
|
|
5920
|
-
return /* @__PURE__ */
|
|
6042
|
+
return /* @__PURE__ */ jsxs24(
|
|
5921
6043
|
PanelScope,
|
|
5922
6044
|
{
|
|
5923
6045
|
ctx,
|
|
@@ -5925,13 +6047,13 @@ function PanelSlot({ panel, ctx, tick }) {
|
|
|
5925
6047
|
tick,
|
|
5926
6048
|
onReadError,
|
|
5927
6049
|
children: [
|
|
5928
|
-
[...readErrors].map(([path, error]) => /* @__PURE__ */
|
|
6050
|
+
[...readErrors].map(([path, error]) => /* @__PURE__ */ jsxs24("p", { className: "lace-app__panel-error", children: [
|
|
5929
6051
|
"Couldn't load ",
|
|
5930
6052
|
path,
|
|
5931
6053
|
": ",
|
|
5932
6054
|
error.message
|
|
5933
6055
|
] }, path)),
|
|
5934
|
-
/* @__PURE__ */
|
|
6056
|
+
/* @__PURE__ */ jsx38(panel.Component, { ctx })
|
|
5935
6057
|
]
|
|
5936
6058
|
}
|
|
5937
6059
|
);
|
|
@@ -5945,8 +6067,8 @@ function BottomTabs({
|
|
|
5945
6067
|
const manual = manualId !== null ? panels.find((p) => p.id === manualId) : void 0;
|
|
5946
6068
|
const active = manual ?? panels[0] ?? null;
|
|
5947
6069
|
if (panels.length === 0) return null;
|
|
5948
|
-
return /* @__PURE__ */
|
|
5949
|
-
/* @__PURE__ */
|
|
6070
|
+
return /* @__PURE__ */ jsxs24("div", { className: "lace-app__bottom", children: [
|
|
6071
|
+
/* @__PURE__ */ jsx38("div", { className: "lace-app__bottom-tabs", role: "tablist", children: panels.map((panel) => /* @__PURE__ */ jsx38(
|
|
5950
6072
|
"button",
|
|
5951
6073
|
{
|
|
5952
6074
|
type: "button",
|
|
@@ -5958,7 +6080,7 @@ function BottomTabs({
|
|
|
5958
6080
|
},
|
|
5959
6081
|
panel.id
|
|
5960
6082
|
)) }),
|
|
5961
|
-
/* @__PURE__ */
|
|
6083
|
+
/* @__PURE__ */ jsx38("div", { className: "lace-app__bottom-content", children: active && /* @__PURE__ */ jsx38(PanelSlot, { panel: active, ctx, tick }) })
|
|
5962
6084
|
] });
|
|
5963
6085
|
}
|
|
5964
6086
|
function endMessage(end) {
|
|
@@ -6003,7 +6125,7 @@ function App({
|
|
|
6003
6125
|
}),
|
|
6004
6126
|
[commands, presenter, editor, results]
|
|
6005
6127
|
);
|
|
6006
|
-
|
|
6128
|
+
useEffect13(() => {
|
|
6007
6129
|
return () => {
|
|
6008
6130
|
runner.dispose();
|
|
6009
6131
|
};
|
|
@@ -6017,9 +6139,9 @@ function App({
|
|
|
6017
6139
|
},
|
|
6018
6140
|
[ports.viewState]
|
|
6019
6141
|
);
|
|
6020
|
-
const
|
|
6021
|
-
if (source &&
|
|
6022
|
-
|
|
6142
|
+
const pruned = useRef12(false);
|
|
6143
|
+
if (source && !pruned.current) {
|
|
6144
|
+
pruned.current = true;
|
|
6023
6145
|
const gced = gcArrangement(source.bundle, arrangement);
|
|
6024
6146
|
if (gced !== arrangement) {
|
|
6025
6147
|
queueMicrotask(() => {
|
|
@@ -6105,15 +6227,17 @@ function App({
|
|
|
6105
6227
|
resolved.panels.filter((panel) => panel.slot === "toolbar")
|
|
6106
6228
|
);
|
|
6107
6229
|
const rootRef = useRef12(null);
|
|
6108
|
-
|
|
6230
|
+
useEffect13(() => {
|
|
6109
6231
|
if (!ctx) return;
|
|
6110
6232
|
registerKeyTarget(ctx, "app", rootRef.current);
|
|
6111
6233
|
return () => registerKeyTarget(ctx, "app", null);
|
|
6112
6234
|
}, [ctx]);
|
|
6113
|
-
|
|
6235
|
+
const rootMounted = Boolean(ctx && view && source && envExtras);
|
|
6236
|
+
useFocusWhenNoneHeld(rootRef, rootMounted);
|
|
6237
|
+
useFocusKeptOnRemoval(rootRef, rootMounted);
|
|
6114
6238
|
useActionKeys(ctx && envExtras ? resolved.actions : [], ctx, runner, envExtras);
|
|
6115
6239
|
if (!ctx || !view || !source || !envExtras) {
|
|
6116
|
-
return end ? /* @__PURE__ */
|
|
6240
|
+
return end ? /* @__PURE__ */ jsx38(ErrorState, { message: endMessage(end) }) : null;
|
|
6117
6241
|
}
|
|
6118
6242
|
const contextValue = {
|
|
6119
6243
|
ports,
|
|
@@ -6134,8 +6258,8 @@ function App({
|
|
|
6134
6258
|
const bannerPanels = resolved.panels.filter((panel) => panel.slot === "banner");
|
|
6135
6259
|
const bottomPanels = resolved.panels.filter((panel) => panel.slot === "bottom");
|
|
6136
6260
|
const drawerPanel = resolved.panels.find((panel) => panel.slot === "drawer");
|
|
6137
|
-
return /* @__PURE__ */
|
|
6138
|
-
resolved.overlays.map((overlay) => /* @__PURE__ */
|
|
6261
|
+
return /* @__PURE__ */ jsxs24(ErrorBoundary, { children: [
|
|
6262
|
+
resolved.overlays.map((overlay) => /* @__PURE__ */ jsx38(
|
|
6139
6263
|
OverlayRunner,
|
|
6140
6264
|
{
|
|
6141
6265
|
overlay,
|
|
@@ -6145,15 +6269,15 @@ function App({
|
|
|
6145
6269
|
},
|
|
6146
6270
|
overlay.id
|
|
6147
6271
|
)),
|
|
6148
|
-
/* @__PURE__ */
|
|
6149
|
-
(toolbar.sections.length > 0 || toolbar.trailing.length > 0) && /* @__PURE__ */
|
|
6150
|
-
toolbar.sections.map((section, index) => /* @__PURE__ */
|
|
6151
|
-
index > 0 ? /* @__PURE__ */
|
|
6152
|
-
/* @__PURE__ */
|
|
6272
|
+
/* @__PURE__ */ jsx38(CanvasContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs24("div", { ref: rootRef, className: "lace-app", style: { height }, tabIndex: -1, children: [
|
|
6273
|
+
(toolbar.sections.length > 0 || toolbar.trailing.length > 0) && /* @__PURE__ */ jsxs24("div", { className: "lace-app__toolbar", children: [
|
|
6274
|
+
toolbar.sections.map((section, index) => /* @__PURE__ */ jsxs24(Fragment15, { children: [
|
|
6275
|
+
index > 0 ? /* @__PURE__ */ jsx38("span", { className: "lace-app__toolbar-separator", "aria-hidden": "true" }) : null,
|
|
6276
|
+
/* @__PURE__ */ jsxs24("div", { className: "lace-app__toolbar-section", children: [
|
|
6153
6277
|
section.actions.map((action) => (
|
|
6154
6278
|
// `runner.busy` reads the store, whose every write
|
|
6155
6279
|
// re-renders App (`resultSlots`).
|
|
6156
|
-
/* @__PURE__ */
|
|
6280
|
+
/* @__PURE__ */ jsx38(
|
|
6157
6281
|
ToolbarAction,
|
|
6158
6282
|
{
|
|
6159
6283
|
action,
|
|
@@ -6164,20 +6288,20 @@ function App({
|
|
|
6164
6288
|
action.id
|
|
6165
6289
|
)
|
|
6166
6290
|
)),
|
|
6167
|
-
section.panels.map((panel) => /* @__PURE__ */
|
|
6291
|
+
section.panels.map((panel) => /* @__PURE__ */ jsx38(PanelSlot, { panel, ctx, tick }, panel.id))
|
|
6168
6292
|
] })
|
|
6169
6293
|
] }, section.key ?? "")),
|
|
6170
|
-
toolbar.trailing.length > 0 && /* @__PURE__ */
|
|
6294
|
+
toolbar.trailing.length > 0 && /* @__PURE__ */ jsx38("div", { className: "lace-app__toolbar-end", children: toolbar.trailing.map((panel) => /* @__PURE__ */ jsx38(PanelSlot, { panel, ctx, tick }, panel.id)) })
|
|
6171
6295
|
] }),
|
|
6172
|
-
/* @__PURE__ */
|
|
6173
|
-
/* @__PURE__ */
|
|
6174
|
-
/* @__PURE__ */
|
|
6175
|
-
/* @__PURE__ */
|
|
6176
|
-
/* @__PURE__ */
|
|
6296
|
+
/* @__PURE__ */ jsx38("div", { className: "lace-app__banners", children: bannerPanels.map((panel) => /* @__PURE__ */ jsx38(PanelSlot, { panel, ctx, tick }, panel.id)) }),
|
|
6297
|
+
/* @__PURE__ */ jsxs24("div", { className: "lace-app__body", children: [
|
|
6298
|
+
/* @__PURE__ */ jsxs24("div", { className: "lace-app__main", children: [
|
|
6299
|
+
/* @__PURE__ */ jsx38("div", { className: "lace-app__canvas", children: /* @__PURE__ */ jsx38(ReactFlowProvider, { children: /* @__PURE__ */ jsx38(Canvas, { height: "100%" }) }) }),
|
|
6300
|
+
/* @__PURE__ */ jsx38(BottomTabs, { panels: bottomPanels, ctx, tick })
|
|
6177
6301
|
] }),
|
|
6178
|
-
drawerPanel && /* @__PURE__ */
|
|
6302
|
+
drawerPanel && /* @__PURE__ */ jsx38(Drawer, { label: drawerPanel.title, children: /* @__PURE__ */ jsx38(PanelSlot, { panel: drawerPanel, ctx, tick }, drawerPanel.id) })
|
|
6179
6303
|
] }),
|
|
6180
|
-
/* @__PURE__ */
|
|
6304
|
+
/* @__PURE__ */ jsx38(CommandArgsForm, { form: pendingForm })
|
|
6181
6305
|
] }) })
|
|
6182
6306
|
] });
|
|
6183
6307
|
}
|