@lace-cloud/canvas 0.13.0 → 0.15.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/LICENSE +86 -13
- package/README.md +1 -1
- package/dist/index.cjs +1314 -2069
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +105 -103
- package/dist/index.d.ts +105 -103
- package/dist/index.mjs +959 -1714
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -220,6 +220,41 @@ function ContextMenu({
|
|
|
220
220
|
] });
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
// src/components/ErrorBoundary.tsx
|
|
224
|
+
import React from "react";
|
|
225
|
+
import "./ErrorBoundary-IXSIVZFH.css";
|
|
226
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
227
|
+
function ErrorState({ message }) {
|
|
228
|
+
return /* @__PURE__ */ jsxs3("div", { className: "lace-error-state", role: "alert", children: [
|
|
229
|
+
/* @__PURE__ */ jsx3("h3", { className: "lace-error-state__title", children: "Something went wrong" }),
|
|
230
|
+
/* @__PURE__ */ jsx3("pre", { className: "lace-error-state__message", children: message }),
|
|
231
|
+
/* @__PURE__ */ jsx3(
|
|
232
|
+
"button",
|
|
233
|
+
{
|
|
234
|
+
type: "button",
|
|
235
|
+
className: "lace-error-state__reload",
|
|
236
|
+
onClick: () => window.location.reload(),
|
|
237
|
+
children: "Reload"
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
] });
|
|
241
|
+
}
|
|
242
|
+
var ErrorBoundary = class extends React.Component {
|
|
243
|
+
constructor() {
|
|
244
|
+
super(...arguments);
|
|
245
|
+
this.state = { error: null };
|
|
246
|
+
}
|
|
247
|
+
static getDerivedStateFromError(error) {
|
|
248
|
+
return { error };
|
|
249
|
+
}
|
|
250
|
+
render() {
|
|
251
|
+
if (this.state.error) {
|
|
252
|
+
return /* @__PURE__ */ jsx3(ErrorState, { message: this.state.error.message });
|
|
253
|
+
}
|
|
254
|
+
return this.props.children;
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
|
|
223
258
|
// src/components/nodes/GroupNode.tsx
|
|
224
259
|
import { Handle, Position } from "@xyflow/react";
|
|
225
260
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
@@ -232,12 +267,13 @@ var CanvasContext = createContext({
|
|
|
232
267
|
loading: true,
|
|
233
268
|
generation: 0,
|
|
234
269
|
viewportIntent: null,
|
|
235
|
-
viewportIntentSeq: 0
|
|
270
|
+
viewportIntentSeq: 0,
|
|
271
|
+
loadError: null
|
|
236
272
|
},
|
|
237
273
|
engine: null,
|
|
238
274
|
readOnly: false,
|
|
239
|
-
|
|
240
|
-
|
|
275
|
+
arrangement: {},
|
|
276
|
+
updateArrangement: () => {
|
|
241
277
|
}
|
|
242
278
|
});
|
|
243
279
|
function useCanvas() {
|
|
@@ -249,9 +285,116 @@ function useEngine() {
|
|
|
249
285
|
return engine;
|
|
250
286
|
}
|
|
251
287
|
|
|
288
|
+
// src/utils/arrangement.ts
|
|
289
|
+
import { resolveScopePath } from "@lace-cloud/proto";
|
|
290
|
+
function splitCanvasPath(canvasPath) {
|
|
291
|
+
const lastDot = canvasPath.lastIndexOf(".");
|
|
292
|
+
if (lastDot === -1) return { parentPath: "", localId: canvasPath };
|
|
293
|
+
return { parentPath: canvasPath.slice(0, lastDot), localId: canvasPath.slice(lastDot + 1) };
|
|
294
|
+
}
|
|
295
|
+
function scopeKeyForCanvasPath(bundle, canvasPath) {
|
|
296
|
+
const { parentPath } = splitCanvasPath(canvasPath);
|
|
297
|
+
return resolveScopePath(bundle, parentPath);
|
|
298
|
+
}
|
|
299
|
+
function cloneArrangement(arrangement) {
|
|
300
|
+
const next = {};
|
|
301
|
+
for (const [scope, entry] of Object.entries(arrangement)) {
|
|
302
|
+
next[scope] = {
|
|
303
|
+
nodes: entry.nodes ? { ...entry.nodes } : void 0,
|
|
304
|
+
groups: entry.groups ? { ...entry.groups } : void 0
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
return next;
|
|
308
|
+
}
|
|
309
|
+
function withNodePosition(bundle, arrangement, canvasPath, position) {
|
|
310
|
+
const scopeKey = scopeKeyForCanvasPath(bundle, canvasPath);
|
|
311
|
+
if (!scopeKey) return arrangement;
|
|
312
|
+
const { localId } = splitCanvasPath(canvasPath);
|
|
313
|
+
const next = cloneArrangement(arrangement);
|
|
314
|
+
const scopeEntry = next[scopeKey] ?? {};
|
|
315
|
+
next[scopeKey] = { ...scopeEntry, nodes: { ...scopeEntry.nodes, [localId]: position } };
|
|
316
|
+
return next;
|
|
317
|
+
}
|
|
318
|
+
function withNodePositions(bundle, arrangement, positions) {
|
|
319
|
+
let next = arrangement;
|
|
320
|
+
for (const [canvasPath, position] of Object.entries(positions)) {
|
|
321
|
+
next = withNodePosition(bundle, next, canvasPath, position);
|
|
322
|
+
}
|
|
323
|
+
return next;
|
|
324
|
+
}
|
|
325
|
+
function withGroupArrangement(bundle, arrangement, canvasPath, patch) {
|
|
326
|
+
const scopeKey = scopeKeyForCanvasPath(bundle, canvasPath);
|
|
327
|
+
if (!scopeKey) return arrangement;
|
|
328
|
+
const { localId } = splitCanvasPath(canvasPath);
|
|
329
|
+
const next = cloneArrangement(arrangement);
|
|
330
|
+
const scopeEntry = next[scopeKey] ?? {};
|
|
331
|
+
const existing = scopeEntry.groups?.[localId];
|
|
332
|
+
next[scopeKey] = {
|
|
333
|
+
...scopeEntry,
|
|
334
|
+
groups: {
|
|
335
|
+
...scopeEntry.groups,
|
|
336
|
+
[localId]: {
|
|
337
|
+
collapsed: patch.collapsed ?? existing?.collapsed ?? true,
|
|
338
|
+
label: patch.label ?? existing?.label
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
return next;
|
|
343
|
+
}
|
|
344
|
+
function setScopeEntry(arrangement, scopeKey, entry) {
|
|
345
|
+
const next = cloneArrangement(arrangement);
|
|
346
|
+
next[scopeKey] = entry;
|
|
347
|
+
return next;
|
|
348
|
+
}
|
|
349
|
+
function migrateUngroup(bundle, arrangement, groupCanvasPath, groupModuleKey, promoted = []) {
|
|
350
|
+
const parentScopeKey = scopeKeyForCanvasPath(bundle, groupCanvasPath);
|
|
351
|
+
const groupEntry = arrangement[groupModuleKey];
|
|
352
|
+
if (!parentScopeKey || !groupEntry) return arrangement;
|
|
353
|
+
const { localId } = splitCanvasPath(groupCanvasPath);
|
|
354
|
+
const parentEntry = arrangement[parentScopeKey] ?? {};
|
|
355
|
+
const remainingGroups = parentEntry.groups ? { ...parentEntry.groups } : void 0;
|
|
356
|
+
if (remainingGroups) delete remainingGroups[localId];
|
|
357
|
+
const renameMap = new Map(
|
|
358
|
+
promoted.filter((ref) => ref.scope === parentScopeKey && ref.sourceId).map((ref) => [ref.sourceId, ref.id])
|
|
359
|
+
);
|
|
360
|
+
const rename = (id) => renameMap.get(id) ?? id;
|
|
361
|
+
const migratedNodes = groupEntry.nodes ? Object.fromEntries(Object.entries(groupEntry.nodes).map(([id, pos]) => [rename(id), pos])) : void 0;
|
|
362
|
+
const migratedGroups = groupEntry.groups ? Object.fromEntries(Object.entries(groupEntry.groups).map(([id, g]) => [rename(id), g])) : void 0;
|
|
363
|
+
const groups = remainingGroups || migratedGroups ? { ...remainingGroups, ...migratedGroups } : void 0;
|
|
364
|
+
return setScopeEntry(arrangement, parentScopeKey, {
|
|
365
|
+
nodes: { ...parentEntry.nodes, ...migratedNodes },
|
|
366
|
+
groups
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
function gcArrangement(bundle, arrangement) {
|
|
370
|
+
const next = {};
|
|
371
|
+
let changed = false;
|
|
372
|
+
for (const [scopeKey, entry] of Object.entries(arrangement)) {
|
|
373
|
+
const mod = bundle.modules[scopeKey];
|
|
374
|
+
if (!mod) {
|
|
375
|
+
changed = true;
|
|
376
|
+
continue;
|
|
377
|
+
}
|
|
378
|
+
const liveIds = new Set((mod.modules ?? []).map((u) => u.id));
|
|
379
|
+
const nodeEntries = entry.nodes ? Object.entries(entry.nodes) : [];
|
|
380
|
+
const liveNodeEntries = nodeEntries.filter(([id]) => liveIds.has(id));
|
|
381
|
+
const groupEntries = entry.groups ? Object.entries(entry.groups) : [];
|
|
382
|
+
const liveGroupEntries = groupEntries.filter(([id]) => liveIds.has(id));
|
|
383
|
+
if (liveNodeEntries.length !== nodeEntries.length || liveGroupEntries.length !== groupEntries.length) {
|
|
384
|
+
changed = true;
|
|
385
|
+
}
|
|
386
|
+
const nodes = entry.nodes ? Object.fromEntries(liveNodeEntries) : void 0;
|
|
387
|
+
const groups = entry.groups ? Object.fromEntries(liveGroupEntries) : void 0;
|
|
388
|
+
if (nodes && Object.keys(nodes).length > 0 || groups && Object.keys(groups).length > 0) {
|
|
389
|
+
next[scopeKey] = { nodes, groups };
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return changed ? next : arrangement;
|
|
393
|
+
}
|
|
394
|
+
|
|
252
395
|
// src/components/nodes/GroupNode.tsx
|
|
253
396
|
import "./GroupNode-EY63N53G.css";
|
|
254
|
-
import { jsx as
|
|
397
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
255
398
|
var HEADER_HEIGHT = 32;
|
|
256
399
|
var ROW_HEIGHT = 22;
|
|
257
400
|
var COLLAPSED_WIDTH = 220;
|
|
@@ -271,13 +414,13 @@ var GroupHeader = ({
|
|
|
271
414
|
onEditChange,
|
|
272
415
|
onEditBlur,
|
|
273
416
|
onEditKeyDown
|
|
274
|
-
}) => /* @__PURE__ */
|
|
417
|
+
}) => /* @__PURE__ */ jsxs4(
|
|
275
418
|
"div",
|
|
276
419
|
{
|
|
277
420
|
className: `lace-group-node__header lace-group-node__header--${collapsed ? "collapsed" : "expanded"}`,
|
|
278
421
|
style: { height: HEADER_HEIGHT },
|
|
279
422
|
children: [
|
|
280
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ jsx4(
|
|
281
424
|
"button",
|
|
282
425
|
{
|
|
283
426
|
type: "button",
|
|
@@ -285,10 +428,10 @@ var GroupHeader = ({
|
|
|
285
428
|
className: "lace-group-node__collapse-btn",
|
|
286
429
|
title: collapsed ? "Expand" : "Collapse",
|
|
287
430
|
"aria-label": collapsed ? "Expand" : "Collapse",
|
|
288
|
-
children: /* @__PURE__ */
|
|
431
|
+
children: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "10", height: "10", "aria-hidden": "true", children: collapsed ? /* @__PURE__ */ jsx4("path", { d: "M8 5l8 7-8 7V5z" }) : /* @__PURE__ */ jsx4("path", { d: "M5 8l7 8 7-8H5z" }) })
|
|
289
432
|
}
|
|
290
433
|
),
|
|
291
|
-
editing ? /* @__PURE__ */
|
|
434
|
+
editing ? /* @__PURE__ */ jsx4(
|
|
292
435
|
"input",
|
|
293
436
|
{
|
|
294
437
|
ref: inputRef,
|
|
@@ -299,9 +442,9 @@ var GroupHeader = ({
|
|
|
299
442
|
className: "lace-group-node__rename-input",
|
|
300
443
|
onClick: (e) => e.stopPropagation()
|
|
301
444
|
}
|
|
302
|
-
) : /* @__PURE__ */
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
hovered && /* @__PURE__ */
|
|
445
|
+
) : /* @__PURE__ */ jsx4("span", { className: "lace-group-node__label", onDoubleClick, title: label, children: label }),
|
|
446
|
+
/* @__PURE__ */ jsx4("span", { className: "lace-group-node__count", children: collapsed ? `${memberCount} nodes` : memberCount }),
|
|
447
|
+
hovered && /* @__PURE__ */ jsx4(
|
|
305
448
|
"button",
|
|
306
449
|
{
|
|
307
450
|
type: "button",
|
|
@@ -309,7 +452,7 @@ var GroupHeader = ({
|
|
|
309
452
|
className: "lace-group-node__ungroup-btn",
|
|
310
453
|
title: "Ungroup",
|
|
311
454
|
"aria-label": "Ungroup",
|
|
312
|
-
children: /* @__PURE__ */
|
|
455
|
+
children: /* @__PURE__ */ jsx4(
|
|
313
456
|
"svg",
|
|
314
457
|
{
|
|
315
458
|
viewBox: "0 0 24 24",
|
|
@@ -319,7 +462,7 @@ var GroupHeader = ({
|
|
|
319
462
|
width: "8",
|
|
320
463
|
height: "8",
|
|
321
464
|
"aria-hidden": "true",
|
|
322
|
-
children: /* @__PURE__ */
|
|
465
|
+
children: /* @__PURE__ */ jsx4("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
323
466
|
}
|
|
324
467
|
)
|
|
325
468
|
}
|
|
@@ -329,7 +472,7 @@ var GroupHeader = ({
|
|
|
329
472
|
);
|
|
330
473
|
var AggregatedPinRow = ({ pin, top }) => {
|
|
331
474
|
const isInput = pin.side === "input";
|
|
332
|
-
return /* @__PURE__ */
|
|
475
|
+
return /* @__PURE__ */ jsxs4(
|
|
333
476
|
"div",
|
|
334
477
|
{
|
|
335
478
|
style: {
|
|
@@ -346,7 +489,7 @@ var AggregatedPinRow = ({ pin, top }) => {
|
|
|
346
489
|
},
|
|
347
490
|
title: pin.label,
|
|
348
491
|
children: [
|
|
349
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ jsx4(
|
|
350
493
|
Handle,
|
|
351
494
|
{
|
|
352
495
|
id: pin.handleId,
|
|
@@ -366,14 +509,14 @@ var AggregatedPinRow = ({ pin, top }) => {
|
|
|
366
509
|
}
|
|
367
510
|
}
|
|
368
511
|
),
|
|
369
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ jsx4("span", { className: "lace-group-node__pin-label", style: { maxWidth: COLLAPSED_WIDTH - 28 }, children: pin.label })
|
|
370
513
|
]
|
|
371
514
|
}
|
|
372
515
|
);
|
|
373
516
|
};
|
|
374
517
|
var GroupNode = ({ data }) => {
|
|
375
518
|
const engine = useEngine();
|
|
376
|
-
const { readOnly,
|
|
519
|
+
const { readOnly, arrangement, updateArrangement } = useCanvas();
|
|
377
520
|
const [editing, setEditing] = useState(false);
|
|
378
521
|
const [editValue, setEditValue] = useState(data.label);
|
|
379
522
|
const [hovered, setHovered] = useState(false);
|
|
@@ -394,17 +537,16 @@ var GroupNode = ({ data }) => {
|
|
|
394
537
|
},
|
|
395
538
|
[data.label, readOnly]
|
|
396
539
|
);
|
|
397
|
-
const commitRename = useCallback(
|
|
540
|
+
const commitRename = useCallback(() => {
|
|
398
541
|
setEditing(false);
|
|
399
542
|
const trimmed = editValue.trim();
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}
|
|
543
|
+
const bundle = engine.getCurrentBundle();
|
|
544
|
+
if (trimmed && trimmed !== data.label && bundle) {
|
|
545
|
+
updateArrangement(
|
|
546
|
+
withGroupArrangement(bundle, arrangement, data.groupId, { label: trimmed })
|
|
547
|
+
);
|
|
406
548
|
}
|
|
407
|
-
}, [editValue, data.label, data.groupId, engine]);
|
|
549
|
+
}, [editValue, data.label, data.groupId, engine, arrangement, updateArrangement]);
|
|
408
550
|
const onKeyDown = useCallback(
|
|
409
551
|
(e) => {
|
|
410
552
|
e.stopPropagation();
|
|
@@ -414,30 +556,32 @@ var GroupNode = ({ data }) => {
|
|
|
414
556
|
[commitRename]
|
|
415
557
|
);
|
|
416
558
|
const toggleCollapsed = useCallback(
|
|
417
|
-
|
|
559
|
+
(e) => {
|
|
418
560
|
e.stopPropagation();
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
await engine.updateGroup(data.groupId, { collapsed: !data.collapsed });
|
|
425
|
-
} catch (err) {
|
|
426
|
-
console.error("[GroupNode] toggle collapsed failed:", err);
|
|
427
|
-
}
|
|
561
|
+
const bundle = engine.getCurrentBundle();
|
|
562
|
+
if (!bundle) return;
|
|
563
|
+
updateArrangement(
|
|
564
|
+
withGroupArrangement(bundle, arrangement, data.groupId, { collapsed: !data.collapsed })
|
|
565
|
+
);
|
|
428
566
|
},
|
|
429
|
-
[engine, data.groupId, data.collapsed,
|
|
567
|
+
[engine, data.groupId, data.collapsed, arrangement, updateArrangement]
|
|
430
568
|
);
|
|
431
569
|
const onUngroup = useCallback(
|
|
432
570
|
async (e) => {
|
|
433
571
|
e.stopPropagation();
|
|
572
|
+
const bundle = engine.getCurrentBundle();
|
|
434
573
|
try {
|
|
435
|
-
await engine.
|
|
574
|
+
const result = await engine.ungroup(data.groupId);
|
|
575
|
+
if (result.success && bundle) {
|
|
576
|
+
updateArrangement(
|
|
577
|
+
migrateUngroup(bundle, arrangement, data.groupId, data.moduleKey, result.created)
|
|
578
|
+
);
|
|
579
|
+
}
|
|
436
580
|
} catch (err) {
|
|
437
581
|
console.error("[GroupNode] ungroup failed:", err);
|
|
438
582
|
}
|
|
439
583
|
},
|
|
440
|
-
[engine, data.groupId]
|
|
584
|
+
[engine, data.groupId, data.moduleKey, arrangement, updateArrangement]
|
|
441
585
|
);
|
|
442
586
|
const headerProps = {
|
|
443
587
|
label: data.label,
|
|
@@ -459,7 +603,7 @@ var GroupNode = ({ data }) => {
|
|
|
459
603
|
const outputPins = data.externalPins.filter((p) => p.side === "output");
|
|
460
604
|
const rowCount = Math.max(inputPins.length, outputPins.length);
|
|
461
605
|
const bodyHeight = rowCount * ROW_HEIGHT;
|
|
462
|
-
return /* @__PURE__ */
|
|
606
|
+
return /* @__PURE__ */ jsxs4(
|
|
463
607
|
"div",
|
|
464
608
|
{
|
|
465
609
|
"data-group": data.groupId,
|
|
@@ -469,16 +613,16 @@ var GroupNode = ({ data }) => {
|
|
|
469
613
|
onMouseEnter: () => setHovered(true),
|
|
470
614
|
onMouseLeave: () => setHovered(false),
|
|
471
615
|
children: [
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
rowCount > 0 && /* @__PURE__ */
|
|
474
|
-
inputPins.map((pin, i) => /* @__PURE__ */
|
|
475
|
-
outputPins.map((pin, i) => /* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ jsx4(GroupHeader, { ...headerProps }),
|
|
617
|
+
rowCount > 0 && /* @__PURE__ */ jsxs4("div", { style: { position: "relative", height: bodyHeight }, children: [
|
|
618
|
+
inputPins.map((pin, i) => /* @__PURE__ */ jsx4(AggregatedPinRow, { pin, top: i * ROW_HEIGHT }, pin.handleId)),
|
|
619
|
+
outputPins.map((pin, i) => /* @__PURE__ */ jsx4(AggregatedPinRow, { pin, top: i * ROW_HEIGHT }, pin.handleId))
|
|
476
620
|
] })
|
|
477
621
|
]
|
|
478
622
|
}
|
|
479
623
|
);
|
|
480
624
|
}
|
|
481
|
-
return /* @__PURE__ */
|
|
625
|
+
return /* @__PURE__ */ jsx4(
|
|
482
626
|
"div",
|
|
483
627
|
{
|
|
484
628
|
"data-group": data.groupId,
|
|
@@ -492,7 +636,7 @@ var GroupNode = ({ data }) => {
|
|
|
492
636
|
},
|
|
493
637
|
onMouseEnter: () => setHovered(true),
|
|
494
638
|
onMouseLeave: () => setHovered(false),
|
|
495
|
-
children: /* @__PURE__ */
|
|
639
|
+
children: /* @__PURE__ */ jsx4(GroupHeader, { ...headerProps })
|
|
496
640
|
}
|
|
497
641
|
);
|
|
498
642
|
};
|
|
@@ -570,13 +714,13 @@ function pinColor(pin) {
|
|
|
570
714
|
}
|
|
571
715
|
|
|
572
716
|
// src/components/nodes/ModuleNode.tsx
|
|
573
|
-
import { Fragment as Fragment3, jsx as
|
|
717
|
+
import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
574
718
|
var NODE_WIDTH = 200;
|
|
575
719
|
var HEADER_HEIGHT2 = 28;
|
|
576
720
|
var ROW_HEIGHT2 = 22;
|
|
577
721
|
var ICON_SIZE = 18;
|
|
578
722
|
function BrokenIcon() {
|
|
579
|
-
return /* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */ jsxs5(
|
|
580
724
|
"svg",
|
|
581
725
|
{
|
|
582
726
|
width: ICON_SIZE,
|
|
@@ -589,9 +733,9 @@ function BrokenIcon() {
|
|
|
589
733
|
strokeLinejoin: "round",
|
|
590
734
|
"aria-hidden": "true",
|
|
591
735
|
children: [
|
|
592
|
-
/* @__PURE__ */
|
|
593
|
-
/* @__PURE__ */
|
|
594
|
-
/* @__PURE__ */
|
|
736
|
+
/* @__PURE__ */ jsx5("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
737
|
+
/* @__PURE__ */ jsx5("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
|
|
738
|
+
/* @__PURE__ */ jsx5("polyline", { points: "21 15 16 10 5 21" })
|
|
595
739
|
]
|
|
596
740
|
}
|
|
597
741
|
);
|
|
@@ -609,7 +753,7 @@ var PinRow = ({ pin, side, top, isError }) => {
|
|
|
609
753
|
[isInput ? "left" : "right"]: -5,
|
|
610
754
|
top: ROW_HEIGHT2 / 2
|
|
611
755
|
};
|
|
612
|
-
return /* @__PURE__ */
|
|
756
|
+
return /* @__PURE__ */ jsxs5(
|
|
613
757
|
"div",
|
|
614
758
|
{
|
|
615
759
|
className: "lace-pin-row",
|
|
@@ -627,7 +771,7 @@ var PinRow = ({ pin, side, top, isError }) => {
|
|
|
627
771
|
},
|
|
628
772
|
title: `${pin.name}: ${pin.type}${pin.description ? ` \u2014 ${pin.description}` : ""}`,
|
|
629
773
|
children: [
|
|
630
|
-
/* @__PURE__ */
|
|
774
|
+
/* @__PURE__ */ jsx5(
|
|
631
775
|
Handle2,
|
|
632
776
|
{
|
|
633
777
|
id: `${isInput ? "in" : "out"}:${pin.name}`,
|
|
@@ -637,7 +781,7 @@ var PinRow = ({ pin, side, top, isError }) => {
|
|
|
637
781
|
style: handleStyle
|
|
638
782
|
}
|
|
639
783
|
),
|
|
640
|
-
/* @__PURE__ */
|
|
784
|
+
/* @__PURE__ */ jsx5(
|
|
641
785
|
"span",
|
|
642
786
|
{
|
|
643
787
|
className: `lace-module-node__pin-row-label lace-module-node__pin-row-label--${isError ? "error" : "default"}`,
|
|
@@ -746,7 +890,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
746
890
|
const bodyHeight = rowCount * ROW_HEIGHT2;
|
|
747
891
|
const nodeHeight = HEADER_HEIGHT2 + bodyHeight;
|
|
748
892
|
const stateClass = hasAnyError ? "lace-module-node--error" : isNew ? "lace-module-node--new" : "";
|
|
749
|
-
return /* @__PURE__ */
|
|
893
|
+
return /* @__PURE__ */ jsxs5(
|
|
750
894
|
"div",
|
|
751
895
|
{
|
|
752
896
|
className: `lace-module-node${collapsed ? " lace-module-node--collapsed" : ""}${stateClass ? ` ${stateClass}` : ""}`,
|
|
@@ -754,7 +898,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
754
898
|
onMouseEnter: () => setHovered(true),
|
|
755
899
|
onMouseLeave: () => setHovered(false),
|
|
756
900
|
children: [
|
|
757
|
-
/* @__PURE__ */
|
|
901
|
+
/* @__PURE__ */ jsxs5(
|
|
758
902
|
"div",
|
|
759
903
|
{
|
|
760
904
|
className: "lace-module-node__header",
|
|
@@ -762,7 +906,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
762
906
|
onClick: onHeaderClick,
|
|
763
907
|
title: hasAnyError ? data.error_messages?.join("\n") : data.label,
|
|
764
908
|
children: [
|
|
765
|
-
/* @__PURE__ */
|
|
909
|
+
/* @__PURE__ */ jsx5(
|
|
766
910
|
"button",
|
|
767
911
|
{
|
|
768
912
|
type: "button",
|
|
@@ -770,10 +914,10 @@ var ModuleNode = ({ id, data }) => {
|
|
|
770
914
|
className: "lace-module-node__collapse-btn",
|
|
771
915
|
title: collapsed ? "Expand" : "Collapse",
|
|
772
916
|
"aria-label": collapsed ? "Expand" : "Collapse",
|
|
773
|
-
children: /* @__PURE__ */
|
|
917
|
+
children: /* @__PURE__ */ jsx5("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "10", height: "10", "aria-hidden": "true", children: collapsed ? /* @__PURE__ */ jsx5("path", { d: "M8 5l8 7-8 7V5z" }) : /* @__PURE__ */ jsx5("path", { d: "M5 8l7 8 7-8H5z" }) })
|
|
774
918
|
}
|
|
775
919
|
),
|
|
776
|
-
showIcon ? /* @__PURE__ */
|
|
920
|
+
showIcon ? /* @__PURE__ */ jsx5(
|
|
777
921
|
"img",
|
|
778
922
|
{
|
|
779
923
|
src: data.icon_url,
|
|
@@ -782,8 +926,8 @@ var ModuleNode = ({ id, data }) => {
|
|
|
782
926
|
style: { width: ICON_SIZE, height: ICON_SIZE },
|
|
783
927
|
onError: () => setImgFailed(true)
|
|
784
928
|
}
|
|
785
|
-
) : /* @__PURE__ */
|
|
786
|
-
editing ? /* @__PURE__ */
|
|
929
|
+
) : /* @__PURE__ */ jsx5("div", { className: "lace-module-node__icon-fallback", children: /* @__PURE__ */ jsx5(BrokenIcon, {}) }),
|
|
930
|
+
editing ? /* @__PURE__ */ jsx5(
|
|
787
931
|
"input",
|
|
788
932
|
{
|
|
789
933
|
ref: inputRef,
|
|
@@ -794,7 +938,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
794
938
|
className: "lace-module-node__rename-input",
|
|
795
939
|
onClick: (e) => e.stopPropagation()
|
|
796
940
|
}
|
|
797
|
-
) : /* @__PURE__ */
|
|
941
|
+
) : /* @__PURE__ */ jsx5(
|
|
798
942
|
"span",
|
|
799
943
|
{
|
|
800
944
|
className: "lace-module-node__label",
|
|
@@ -803,7 +947,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
803
947
|
children: data.label
|
|
804
948
|
}
|
|
805
949
|
),
|
|
806
|
-
hovered && !readOnly && /* @__PURE__ */
|
|
950
|
+
hovered && !readOnly && /* @__PURE__ */ jsx5(
|
|
807
951
|
"button",
|
|
808
952
|
{
|
|
809
953
|
type: "button",
|
|
@@ -811,16 +955,16 @@ var ModuleNode = ({ id, data }) => {
|
|
|
811
955
|
className: "lace-module-node__delete-btn",
|
|
812
956
|
title: "Delete instance",
|
|
813
957
|
"aria-label": "Delete instance",
|
|
814
|
-
children: /* @__PURE__ */
|
|
958
|
+
children: /* @__PURE__ */ jsx5("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "8", height: "8", "aria-hidden": "true", children: /* @__PURE__ */ jsx5("path", { d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" }) })
|
|
815
959
|
}
|
|
816
960
|
)
|
|
817
961
|
]
|
|
818
962
|
}
|
|
819
963
|
),
|
|
820
|
-
!collapsed && /* @__PURE__ */
|
|
964
|
+
!collapsed && /* @__PURE__ */ jsxs5("div", { className: "lace-module-node__body", style: { height: bodyHeight }, children: [
|
|
821
965
|
visibleInputs.map((pin, i) => {
|
|
822
966
|
const errored = !!pin.required && !pin.wired;
|
|
823
|
-
return /* @__PURE__ */
|
|
967
|
+
return /* @__PURE__ */ jsx5(
|
|
824
968
|
PinRow,
|
|
825
969
|
{
|
|
826
970
|
pin,
|
|
@@ -831,8 +975,8 @@ var ModuleNode = ({ id, data }) => {
|
|
|
831
975
|
`in:${pin.name}`
|
|
832
976
|
);
|
|
833
977
|
}),
|
|
834
|
-
outputs.map((pin, i) => /* @__PURE__ */
|
|
835
|
-
hiddenInputCount > 0 && /* @__PURE__ */
|
|
978
|
+
outputs.map((pin, i) => /* @__PURE__ */ jsx5(PinRow, { pin, side: "output", top: i * ROW_HEIGHT2 }, `out:${pin.name}`)),
|
|
979
|
+
hiddenInputCount > 0 && /* @__PURE__ */ jsxs5(
|
|
836
980
|
"div",
|
|
837
981
|
{
|
|
838
982
|
className: "lace-module-node__hidden-count",
|
|
@@ -858,10 +1002,10 @@ var ModuleNode = ({ id, data }) => {
|
|
|
858
1002
|
}
|
|
859
1003
|
)
|
|
860
1004
|
] }),
|
|
861
|
-
collapsed && /* @__PURE__ */
|
|
1005
|
+
collapsed && /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
862
1006
|
inputs.map((pin, i) => {
|
|
863
1007
|
const color = pinColor(pin);
|
|
864
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ jsx5(
|
|
865
1009
|
Handle2,
|
|
866
1010
|
{
|
|
867
1011
|
id: `in:${pin.name}`,
|
|
@@ -884,7 +1028,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
884
1028
|
}),
|
|
885
1029
|
outputs.map((pin, i) => {
|
|
886
1030
|
const color = pinColor(pin);
|
|
887
|
-
return /* @__PURE__ */
|
|
1031
|
+
return /* @__PURE__ */ jsx5(
|
|
888
1032
|
Handle2,
|
|
889
1033
|
{
|
|
890
1034
|
id: `out:${pin.name}`,
|
|
@@ -915,7 +1059,7 @@ var ModuleNode_default = ModuleNode;
|
|
|
915
1059
|
// src/components/panels/EdgeInspectorPanel.tsx
|
|
916
1060
|
import { Panel as Panel2 } from "@lace-cloud/ui";
|
|
917
1061
|
import "./EdgeInspectorPanel-D536U5MZ.css";
|
|
918
|
-
import { jsx as
|
|
1062
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
919
1063
|
function EdgeInspectorPanel({
|
|
920
1064
|
source,
|
|
921
1065
|
target,
|
|
@@ -925,27 +1069,27 @@ function EdgeInspectorPanel({
|
|
|
925
1069
|
onClose
|
|
926
1070
|
}) {
|
|
927
1071
|
const { readOnly } = useCanvas();
|
|
928
|
-
const title = /* @__PURE__ */
|
|
929
|
-
/* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
1072
|
+
const title = /* @__PURE__ */ jsxs6("div", { children: [
|
|
1073
|
+
/* @__PURE__ */ jsx6("div", { className: "lace-edge-panel__title-eyebrow", children: "Connection" }),
|
|
1074
|
+
/* @__PURE__ */ jsxs6("div", { className: "lace-edge-panel__title", children: [
|
|
931
1075
|
source,
|
|
932
1076
|
" \u2192 ",
|
|
933
1077
|
target
|
|
934
1078
|
] })
|
|
935
1079
|
] });
|
|
936
|
-
const footer = readOnly ? void 0 : /* @__PURE__ */
|
|
937
|
-
return /* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
/* @__PURE__ */
|
|
1080
|
+
const footer = readOnly ? void 0 : /* @__PURE__ */ jsx6("button", { type: "button", className: "lace-edge-panel__delete-btn", onClick: onDelete, children: "Delete connection" });
|
|
1081
|
+
return /* @__PURE__ */ jsxs6(Panel2, { title, width: 380, footer, onClose, children: [
|
|
1082
|
+
/* @__PURE__ */ jsx6("div", { className: "lace-edge-panel__section-label", children: "Wiring" }),
|
|
1083
|
+
/* @__PURE__ */ jsxs6("div", { className: "lace-edge-panel__wiring", children: [
|
|
940
1084
|
source,
|
|
941
1085
|
".outputs.",
|
|
942
1086
|
sourceOutput,
|
|
943
|
-
/* @__PURE__ */
|
|
1087
|
+
/* @__PURE__ */ jsx6("div", { className: "lace-edge-panel__wiring-arrow", children: "\u2193" }),
|
|
944
1088
|
target,
|
|
945
1089
|
".inputs.",
|
|
946
1090
|
targetInput
|
|
947
1091
|
] }),
|
|
948
|
-
!readOnly && /* @__PURE__ */
|
|
1092
|
+
!readOnly && /* @__PURE__ */ jsx6("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." })
|
|
949
1093
|
] });
|
|
950
1094
|
}
|
|
951
1095
|
|
|
@@ -961,11 +1105,11 @@ function assertNever(value) {
|
|
|
961
1105
|
// src/components/AccordionSection.tsx
|
|
962
1106
|
import { useState as useState3 } from "react";
|
|
963
1107
|
import "./AccordionSection-RPWRZINZ.css";
|
|
964
|
-
import { jsx as
|
|
1108
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
965
1109
|
function AccordionSection({ title, defaultOpen = false, badge, children }) {
|
|
966
1110
|
const [open, setOpen] = useState3(defaultOpen);
|
|
967
|
-
return /* @__PURE__ */
|
|
968
|
-
/* @__PURE__ */
|
|
1111
|
+
return /* @__PURE__ */ jsxs7("div", { className: `lace-accordion${open ? " lace-accordion--open" : ""}`, children: [
|
|
1112
|
+
/* @__PURE__ */ jsxs7(
|
|
969
1113
|
"button",
|
|
970
1114
|
{
|
|
971
1115
|
type: "button",
|
|
@@ -973,20 +1117,20 @@ function AccordionSection({ title, defaultOpen = false, badge, children }) {
|
|
|
973
1117
|
onClick: () => setOpen((v) => !v),
|
|
974
1118
|
"aria-expanded": open,
|
|
975
1119
|
children: [
|
|
976
|
-
/* @__PURE__ */
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
badge && /* @__PURE__ */
|
|
1120
|
+
/* @__PURE__ */ jsx7("svg", { className: "lace-accordion__chevron", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx7("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6z" }) }),
|
|
1121
|
+
/* @__PURE__ */ jsx7("span", { className: "lace-accordion__title", children: title }),
|
|
1122
|
+
badge && /* @__PURE__ */ jsx7("span", { className: "lace-accordion__badge", children: badge })
|
|
979
1123
|
]
|
|
980
1124
|
}
|
|
981
1125
|
),
|
|
982
|
-
/* @__PURE__ */
|
|
1126
|
+
/* @__PURE__ */ jsx7("div", { className: "lace-accordion__body", children: /* @__PURE__ */ jsx7("div", { className: "lace-accordion__body-inner", children: /* @__PURE__ */ jsx7("div", { className: "lace-accordion__body-content", children }) }) })
|
|
983
1127
|
] });
|
|
984
1128
|
}
|
|
985
1129
|
|
|
986
1130
|
// src/components/panels/ModuleConfigPanel.tsx
|
|
987
1131
|
import "./ModuleConfigPanel-LZRL4F3Q.css";
|
|
988
1132
|
import "./panels-shared-LLLB7PR4.css";
|
|
989
|
-
import { jsx as
|
|
1133
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
990
1134
|
var MODE_ITEMS = [
|
|
991
1135
|
{ value: "literal", label: "Lit" },
|
|
992
1136
|
{ value: "variable", label: "Var" },
|
|
@@ -1154,7 +1298,7 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1154
1298
|
...m,
|
|
1155
1299
|
disabled: readOnly || m.value === "wired" || isWired
|
|
1156
1300
|
}));
|
|
1157
|
-
return /* @__PURE__ */
|
|
1301
|
+
return /* @__PURE__ */ jsx8(
|
|
1158
1302
|
ModeToggle,
|
|
1159
1303
|
{
|
|
1160
1304
|
value: currentMode,
|
|
@@ -1166,27 +1310,27 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1166
1310
|
}
|
|
1167
1311
|
function renderInputField(input) {
|
|
1168
1312
|
const currentMode = localModes[input.name] ?? input.mode;
|
|
1169
|
-
return /* @__PURE__ */
|
|
1170
|
-
/* @__PURE__ */
|
|
1313
|
+
return /* @__PURE__ */ jsxs8("div", { className: "lace-panel-field", children: [
|
|
1314
|
+
/* @__PURE__ */ jsxs8("label", { className: "lace-panel-row-label", children: [
|
|
1171
1315
|
input.name,
|
|
1172
|
-
input.required && /* @__PURE__ */
|
|
1316
|
+
input.required && /* @__PURE__ */ jsx8("span", { className: "lace-mcp__required-star", children: "*" })
|
|
1173
1317
|
] }),
|
|
1174
1318
|
renderModeSelector(input),
|
|
1175
|
-
/* @__PURE__ */
|
|
1319
|
+
/* @__PURE__ */ jsxs8("div", { className: "lace-panel-row-content", children: [
|
|
1176
1320
|
currentMode === "wired" && renderWiredEditor(input),
|
|
1177
1321
|
currentMode === "variable" && renderVariableEditor(input),
|
|
1178
1322
|
currentMode === "expression" && renderExpressionEditor(input),
|
|
1179
1323
|
currentMode === "literal" && renderLiteralEditor(input)
|
|
1180
1324
|
] }),
|
|
1181
|
-
input.description && /* @__PURE__ */
|
|
1325
|
+
input.description && /* @__PURE__ */ jsx8("div", { className: "lace-panel-field__description", children: input.description })
|
|
1182
1326
|
] }, input.name);
|
|
1183
1327
|
}
|
|
1184
1328
|
function renderWiredEditor(input) {
|
|
1185
1329
|
const label = input.wired_source ?? "Not wired";
|
|
1186
|
-
return /* @__PURE__ */
|
|
1187
|
-
/* @__PURE__ */
|
|
1188
|
-
/* @__PURE__ */
|
|
1189
|
-
!readOnly && /* @__PURE__ */
|
|
1330
|
+
return /* @__PURE__ */ jsxs8("div", { className: "lace-mcp__wired-row", children: [
|
|
1331
|
+
/* @__PURE__ */ jsx8("div", { className: "lace-mcp__wired-input", children: /* @__PURE__ */ jsx8(Input, { value: label, readOnly: true, fullWidth: true, mono: true }) }),
|
|
1332
|
+
/* @__PURE__ */ jsx8(Badge, { variant: "info", size: "md", children: "Wired" }),
|
|
1333
|
+
!readOnly && /* @__PURE__ */ jsx8(
|
|
1190
1334
|
Button,
|
|
1191
1335
|
{
|
|
1192
1336
|
variant: "danger",
|
|
@@ -1201,7 +1345,7 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1201
1345
|
}
|
|
1202
1346
|
function renderVariableEditor(input) {
|
|
1203
1347
|
const currentVar = localVariables[input.name] ?? input.variable ?? "";
|
|
1204
|
-
return /* @__PURE__ */
|
|
1348
|
+
return /* @__PURE__ */ jsx8(
|
|
1205
1349
|
Input,
|
|
1206
1350
|
{
|
|
1207
1351
|
value: currentVar,
|
|
@@ -1219,7 +1363,7 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1219
1363
|
}
|
|
1220
1364
|
function renderExpressionEditor(input) {
|
|
1221
1365
|
const currentExpr = localExpressions[input.name] ?? input.expression ?? "";
|
|
1222
|
-
return /* @__PURE__ */
|
|
1366
|
+
return /* @__PURE__ */ jsx8(
|
|
1223
1367
|
Textarea,
|
|
1224
1368
|
{
|
|
1225
1369
|
value: currentExpr,
|
|
@@ -1239,7 +1383,7 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1239
1383
|
setLocalValues((prev) => ({ ...prev, [input.name]: val }));
|
|
1240
1384
|
};
|
|
1241
1385
|
if (type === "bool") {
|
|
1242
|
-
return /* @__PURE__ */
|
|
1386
|
+
return /* @__PURE__ */ jsxs8(
|
|
1243
1387
|
"select",
|
|
1244
1388
|
{
|
|
1245
1389
|
className: "lace-mcp__select",
|
|
@@ -1247,14 +1391,14 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1247
1391
|
onChange: (e) => updateValue(e.target.value === "true"),
|
|
1248
1392
|
disabled: readOnly,
|
|
1249
1393
|
children: [
|
|
1250
|
-
/* @__PURE__ */
|
|
1251
|
-
/* @__PURE__ */
|
|
1394
|
+
/* @__PURE__ */ jsx8("option", { value: "true", children: "True" }),
|
|
1395
|
+
/* @__PURE__ */ jsx8("option", { value: "false", children: "False" })
|
|
1252
1396
|
]
|
|
1253
1397
|
}
|
|
1254
1398
|
);
|
|
1255
1399
|
}
|
|
1256
1400
|
if (type === "number") {
|
|
1257
|
-
return /* @__PURE__ */
|
|
1401
|
+
return /* @__PURE__ */ jsx8(
|
|
1258
1402
|
Input,
|
|
1259
1403
|
{
|
|
1260
1404
|
type: "number",
|
|
@@ -1267,7 +1411,7 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1267
1411
|
}
|
|
1268
1412
|
if (type.startsWith("list(") || type.startsWith("map(") || type.startsWith("set(") || type === "object" || type.startsWith("object(")) {
|
|
1269
1413
|
const jsonStr = typeof value === "string" ? value : JSON.stringify(value ?? null, null, 2);
|
|
1270
|
-
return /* @__PURE__ */
|
|
1414
|
+
return /* @__PURE__ */ jsx8(
|
|
1271
1415
|
Textarea,
|
|
1272
1416
|
{
|
|
1273
1417
|
value: jsonStr,
|
|
@@ -1285,7 +1429,7 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1285
1429
|
}
|
|
1286
1430
|
);
|
|
1287
1431
|
}
|
|
1288
|
-
return /* @__PURE__ */
|
|
1432
|
+
return /* @__PURE__ */ jsx8(
|
|
1289
1433
|
Input,
|
|
1290
1434
|
{
|
|
1291
1435
|
value: String(value ?? ""),
|
|
@@ -1302,38 +1446,38 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1302
1446
|
);
|
|
1303
1447
|
}
|
|
1304
1448
|
if (error) {
|
|
1305
|
-
return /* @__PURE__ */
|
|
1306
|
-
/* @__PURE__ */
|
|
1449
|
+
return /* @__PURE__ */ jsxs8(Panel3, { title: "Error", onClose, children: [
|
|
1450
|
+
/* @__PURE__ */ jsxs8("div", { className: "lace-mcp__error-title", children: [
|
|
1307
1451
|
'Failed to load configuration for "',
|
|
1308
1452
|
instance_id,
|
|
1309
1453
|
'":'
|
|
1310
1454
|
] }),
|
|
1311
|
-
/* @__PURE__ */
|
|
1455
|
+
/* @__PURE__ */ jsx8("div", { className: "lace-mcp__error-detail", children: error })
|
|
1312
1456
|
] });
|
|
1313
1457
|
}
|
|
1314
1458
|
if (loading || !config) {
|
|
1315
|
-
return /* @__PURE__ */
|
|
1459
|
+
return /* @__PURE__ */ jsx8(Panel3, { title: "Loading...", onClose, children: /* @__PURE__ */ jsx8("div", { className: "lace-panel-hint", children: "Loading configuration..." }) });
|
|
1316
1460
|
}
|
|
1317
1461
|
const dependsOnCount = localDependsOn.size;
|
|
1318
|
-
const title = /* @__PURE__ */
|
|
1319
|
-
/* @__PURE__ */
|
|
1320
|
-
/* @__PURE__ */
|
|
1462
|
+
const title = /* @__PURE__ */ jsxs8("div", { className: "lace-mcp__title", children: [
|
|
1463
|
+
/* @__PURE__ */ jsx8("div", { className: "lace-mcp__title-eyebrow", children: "Module" }),
|
|
1464
|
+
/* @__PURE__ */ jsx8("h3", { className: "lace-mcp__title-id", children: instance_id })
|
|
1321
1465
|
] });
|
|
1322
|
-
const footer = readOnly ? void 0 : /* @__PURE__ */
|
|
1323
|
-
return /* @__PURE__ */
|
|
1324
|
-
requiredInputs.length > 0 && /* @__PURE__ */
|
|
1325
|
-
optionalInputs.length > 0 && /* @__PURE__ */
|
|
1326
|
-
config.sibling_ids.length > 0 && /* @__PURE__ */
|
|
1466
|
+
const footer = readOnly ? void 0 : /* @__PURE__ */ jsx8(Button, { variant: "primary", fullWidth: true, onClick: handleSave, children: "Save configuration" });
|
|
1467
|
+
return /* @__PURE__ */ jsxs8(Panel3, { title, footer, scrollable: false, onClose, children: [
|
|
1468
|
+
requiredInputs.length > 0 && /* @__PURE__ */ jsx8(AccordionSection, { title: "Required Inputs", defaultOpen: true, badge: `(${requiredInputs.length})`, children: requiredInputs.map(renderInputField) }),
|
|
1469
|
+
optionalInputs.length > 0 && /* @__PURE__ */ jsx8(AccordionSection, { title: "Optional Inputs", defaultOpen: true, badge: `(${optionalInputs.length})`, children: optionalInputs.map(renderInputField) }),
|
|
1470
|
+
config.sibling_ids.length > 0 && /* @__PURE__ */ jsxs8(
|
|
1327
1471
|
AccordionSection,
|
|
1328
1472
|
{
|
|
1329
1473
|
title: "Depends On",
|
|
1330
1474
|
badge: dependsOnCount > 0 ? `(${dependsOnCount})` : void 0,
|
|
1331
1475
|
children: [
|
|
1332
|
-
/* @__PURE__ */
|
|
1476
|
+
/* @__PURE__ */ jsx8("div", { className: "lace-mcp__depends-hint", children: "Select sibling instances this module depends on." }),
|
|
1333
1477
|
config.sibling_ids.map((sibId) => {
|
|
1334
1478
|
const depKey = `module.${sibId}`;
|
|
1335
|
-
return /* @__PURE__ */
|
|
1336
|
-
/* @__PURE__ */
|
|
1479
|
+
return /* @__PURE__ */ jsxs8("label", { className: "lace-mcp__depends-item", children: [
|
|
1480
|
+
/* @__PURE__ */ jsx8(
|
|
1337
1481
|
"input",
|
|
1338
1482
|
{
|
|
1339
1483
|
type: "checkbox",
|
|
@@ -1350,30 +1494,30 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1350
1494
|
}
|
|
1351
1495
|
}
|
|
1352
1496
|
),
|
|
1353
|
-
/* @__PURE__ */
|
|
1497
|
+
/* @__PURE__ */ jsx8("span", { className: "lace-mcp__depends-label", children: depKey })
|
|
1354
1498
|
] }, sibId);
|
|
1355
1499
|
})
|
|
1356
1500
|
]
|
|
1357
1501
|
}
|
|
1358
1502
|
),
|
|
1359
|
-
(localProviders.length > 0 || !readOnly) && /* @__PURE__ */
|
|
1503
|
+
(localProviders.length > 0 || !readOnly) && /* @__PURE__ */ jsxs8(
|
|
1360
1504
|
AccordionSection,
|
|
1361
1505
|
{
|
|
1362
1506
|
title: "Providers",
|
|
1363
1507
|
badge: localProviders.length > 0 ? `(${localProviders.length})` : void 0,
|
|
1364
1508
|
children: [
|
|
1365
|
-
/* @__PURE__ */
|
|
1509
|
+
/* @__PURE__ */ jsxs8("div", { className: "lace-mcp__depends-hint", children: [
|
|
1366
1510
|
"Map each child-local provider name to the root provider reference passed down (e.g.",
|
|
1367
1511
|
" ",
|
|
1368
|
-
/* @__PURE__ */
|
|
1512
|
+
/* @__PURE__ */ jsx8("code", { children: "aws" }),
|
|
1369
1513
|
" \u2192 ",
|
|
1370
|
-
/* @__PURE__ */
|
|
1514
|
+
/* @__PURE__ */ jsx8("code", { children: "aws.west" }),
|
|
1371
1515
|
")."
|
|
1372
1516
|
] }),
|
|
1373
1517
|
localProviders.map((row, i) => (
|
|
1374
1518
|
// biome-ignore lint/suspicious/noArrayIndexKey: rows are positional and freely editable
|
|
1375
|
-
/* @__PURE__ */
|
|
1376
|
-
/* @__PURE__ */
|
|
1519
|
+
/* @__PURE__ */ jsxs8("div", { className: "lace-mcp__provider-row", children: [
|
|
1520
|
+
/* @__PURE__ */ jsx8(
|
|
1377
1521
|
Input,
|
|
1378
1522
|
{
|
|
1379
1523
|
value: row.key,
|
|
@@ -1385,8 +1529,8 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1385
1529
|
readOnly
|
|
1386
1530
|
}
|
|
1387
1531
|
),
|
|
1388
|
-
/* @__PURE__ */
|
|
1389
|
-
/* @__PURE__ */
|
|
1532
|
+
/* @__PURE__ */ jsx8("span", { className: "lace-mcp__provider-arrow", children: "=" }),
|
|
1533
|
+
/* @__PURE__ */ jsx8(
|
|
1390
1534
|
Input,
|
|
1391
1535
|
{
|
|
1392
1536
|
value: row.value,
|
|
@@ -1398,7 +1542,7 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1398
1542
|
readOnly
|
|
1399
1543
|
}
|
|
1400
1544
|
),
|
|
1401
|
-
!readOnly && /* @__PURE__ */
|
|
1545
|
+
!readOnly && /* @__PURE__ */ jsx8(
|
|
1402
1546
|
Button,
|
|
1403
1547
|
{
|
|
1404
1548
|
variant: "danger",
|
|
@@ -1411,7 +1555,7 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1411
1555
|
)
|
|
1412
1556
|
] }, i)
|
|
1413
1557
|
)),
|
|
1414
|
-
!readOnly && /* @__PURE__ */
|
|
1558
|
+
!readOnly && /* @__PURE__ */ jsx8(
|
|
1415
1559
|
Button,
|
|
1416
1560
|
{
|
|
1417
1561
|
variant: "secondary",
|
|
@@ -1423,13 +1567,13 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1423
1567
|
]
|
|
1424
1568
|
}
|
|
1425
1569
|
),
|
|
1426
|
-
config.outputs.length > 0 && /* @__PURE__ */
|
|
1427
|
-
/* @__PURE__ */
|
|
1428
|
-
/* @__PURE__ */
|
|
1429
|
-
/* @__PURE__ */
|
|
1570
|
+
config.outputs.length > 0 && /* @__PURE__ */ jsx8(AccordionSection, { title: "Outputs", badge: `(${config.outputs.length})`, children: config.outputs.map((o) => /* @__PURE__ */ jsxs8("div", { className: "lace-mcp__output-card", children: [
|
|
1571
|
+
/* @__PURE__ */ jsxs8("div", { className: "lace-mcp__output-header", children: [
|
|
1572
|
+
/* @__PURE__ */ jsx8("strong", { className: "lace-mcp__output-name", children: o.name }),
|
|
1573
|
+
/* @__PURE__ */ jsx8("span", { className: "lace-mcp__output-type", children: o.type ?? "" })
|
|
1430
1574
|
] }),
|
|
1431
|
-
o.description && /* @__PURE__ */
|
|
1432
|
-
o.sensitive && /* @__PURE__ */
|
|
1575
|
+
o.description && /* @__PURE__ */ jsx8("div", { className: "lace-mcp__output-description", children: o.description }),
|
|
1576
|
+
o.sensitive && /* @__PURE__ */ jsx8("div", { className: "lace-mcp__output-sensitive", children: "sensitive" })
|
|
1433
1577
|
] }, o.name)) })
|
|
1434
1578
|
] });
|
|
1435
1579
|
}
|
|
@@ -1438,7 +1582,7 @@ function ModuleConfigPanel({ instance_id, engine, onClose, onModified }) {
|
|
|
1438
1582
|
import { Panel as Panel4 } from "@lace-cloud/ui";
|
|
1439
1583
|
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
1440
1584
|
import "./panels-shared-LLLB7PR4.css";
|
|
1441
|
-
import { jsx as
|
|
1585
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1442
1586
|
var NODE_HOVER_EVENT = "lace:canvas:nodeHover";
|
|
1443
1587
|
var HOVER_DEBOUNCE_MS = 150;
|
|
1444
1588
|
var MODE_LABELS = {
|
|
@@ -1482,12 +1626,12 @@ function PolicySidebar({ resolution, onPreview, onClose, readOnly }) {
|
|
|
1482
1626
|
if (controller) controller.abort();
|
|
1483
1627
|
};
|
|
1484
1628
|
}, [readOnly, onPreview]);
|
|
1485
|
-
return /* @__PURE__ */
|
|
1629
|
+
return /* @__PURE__ */ jsxs9(
|
|
1486
1630
|
Panel4,
|
|
1487
1631
|
{
|
|
1488
|
-
title: /* @__PURE__ */
|
|
1632
|
+
title: /* @__PURE__ */ jsxs9("h3", { className: "lace-panel__title", children: [
|
|
1489
1633
|
"Policy",
|
|
1490
|
-
resolution?.isAuthoringTimePreview ? /* @__PURE__ */
|
|
1634
|
+
resolution?.isAuthoringTimePreview ? /* @__PURE__ */ jsx9(
|
|
1491
1635
|
"span",
|
|
1492
1636
|
{
|
|
1493
1637
|
style: {
|
|
@@ -1505,14 +1649,14 @@ function PolicySidebar({ resolution, onPreview, onClose, readOnly }) {
|
|
|
1505
1649
|
] }),
|
|
1506
1650
|
onClose,
|
|
1507
1651
|
children: [
|
|
1508
|
-
resolution ? /* @__PURE__ */
|
|
1509
|
-
counterfactual ? /* @__PURE__ */
|
|
1510
|
-
/* @__PURE__ */
|
|
1652
|
+
resolution ? /* @__PURE__ */ jsx9(ResolutionView, { resolution }) : /* @__PURE__ */ jsx9("p", { style: { padding: 12, color: "var(--lace-text-muted)" }, children: "Waiting for first evaluation\u2026" }),
|
|
1653
|
+
counterfactual ? /* @__PURE__ */ jsxs9("section", { style: { borderTop: "1px solid var(--lace-policy-section-divider)", padding: 12 }, children: [
|
|
1654
|
+
/* @__PURE__ */ jsxs9("h4", { style: { margin: "0 0 6px 0", fontSize: 12, color: "var(--lace-text-description)" }, children: [
|
|
1511
1655
|
"If ",
|
|
1512
|
-
/* @__PURE__ */
|
|
1656
|
+
/* @__PURE__ */ jsx9("code", { children: counterfactual.nodeId }),
|
|
1513
1657
|
" were removed"
|
|
1514
1658
|
] }),
|
|
1515
|
-
/* @__PURE__ */
|
|
1659
|
+
/* @__PURE__ */ jsx9(ResolutionView, { resolution: counterfactual.resolution, compact: true })
|
|
1516
1660
|
] }) : null
|
|
1517
1661
|
]
|
|
1518
1662
|
}
|
|
@@ -1522,8 +1666,8 @@ function ResolutionView({
|
|
|
1522
1666
|
resolution,
|
|
1523
1667
|
compact
|
|
1524
1668
|
}) {
|
|
1525
|
-
return /* @__PURE__ */
|
|
1526
|
-
/* @__PURE__ */
|
|
1669
|
+
return /* @__PURE__ */ jsxs9("div", { style: { padding: compact ? 0 : 12 }, children: [
|
|
1670
|
+
/* @__PURE__ */ jsxs9(
|
|
1527
1671
|
"div",
|
|
1528
1672
|
{
|
|
1529
1673
|
style: {
|
|
@@ -1537,16 +1681,16 @@ function ResolutionView({
|
|
|
1537
1681
|
]
|
|
1538
1682
|
}
|
|
1539
1683
|
),
|
|
1540
|
-
resolution.reason ? /* @__PURE__ */
|
|
1541
|
-
resolution.rulesFired.length > 0 ? /* @__PURE__ */
|
|
1542
|
-
/* @__PURE__ */
|
|
1684
|
+
resolution.reason ? /* @__PURE__ */ jsx9("p", { style: { fontSize: 12, color: "var(--lace-text-description)", margin: "0 0 8px 0" }, children: resolution.reason }) : null,
|
|
1685
|
+
resolution.rulesFired.length > 0 ? /* @__PURE__ */ jsxs9("div", { style: { fontSize: 12, color: "var(--lace-text-description)", marginBottom: 8 }, children: [
|
|
1686
|
+
/* @__PURE__ */ jsx9("span", { style: { color: "var(--lace-text-muted)" }, children: "Rules fired: " }),
|
|
1543
1687
|
resolution.rulesFired.join(", ")
|
|
1544
1688
|
] }) : null,
|
|
1545
|
-
resolution.conditionTrace.length > 0 ? /* @__PURE__ */
|
|
1689
|
+
resolution.conditionTrace.length > 0 ? /* @__PURE__ */ jsx9("ul", { style: { listStyle: "none", padding: 0, margin: 0 }, children: resolution.conditionTrace.map((trace) => /* @__PURE__ */ jsx9(ConditionTraceRow, { trace }, `${trace.policyId}-${trace.label}`)) }) : null
|
|
1546
1690
|
] });
|
|
1547
1691
|
}
|
|
1548
1692
|
function ConditionTraceRow({ trace }) {
|
|
1549
|
-
return /* @__PURE__ */
|
|
1693
|
+
return /* @__PURE__ */ jsxs9(
|
|
1550
1694
|
"li",
|
|
1551
1695
|
{
|
|
1552
1696
|
style: {
|
|
@@ -1556,22 +1700,22 @@ function ConditionTraceRow({ trace }) {
|
|
|
1556
1700
|
background: trace.fired ? "var(--lace-policy-rule-fired-bg)" : "var(--lace-policy-rule-default-bg)"
|
|
1557
1701
|
},
|
|
1558
1702
|
children: [
|
|
1559
|
-
/* @__PURE__ */
|
|
1703
|
+
/* @__PURE__ */ jsxs9("div", { style: { fontSize: 12, fontWeight: 500 }, children: [
|
|
1560
1704
|
trace.label || trace.policyId,
|
|
1561
1705
|
" ",
|
|
1562
|
-
/* @__PURE__ */
|
|
1706
|
+
/* @__PURE__ */ jsx9("span", { style: { color: "var(--lace-text-muted)", fontWeight: 400 }, children: trace.fired ? "\u2014 fired" : "\u2014 did not fire" })
|
|
1563
1707
|
] }),
|
|
1564
|
-
trace.predicates.length > 0 ? /* @__PURE__ */
|
|
1708
|
+
trace.predicates.length > 0 ? /* @__PURE__ */ jsx9("ul", { style: { listStyle: "none", padding: "4px 0 0 0", margin: 0 }, children: trace.predicates.map((p) => /* @__PURE__ */ jsx9(PredicateRow, { predicate: p }, p.predicate)) }) : null
|
|
1565
1709
|
]
|
|
1566
1710
|
}
|
|
1567
1711
|
);
|
|
1568
1712
|
}
|
|
1569
1713
|
function PredicateRow({ predicate }) {
|
|
1570
1714
|
if (predicate.cannotEvaluate) {
|
|
1571
|
-
return /* @__PURE__ */
|
|
1715
|
+
return /* @__PURE__ */ jsxs9("li", { style: { fontSize: 11, color: "var(--lace-text-muted)", fontFamily: "monospace" }, children: [
|
|
1572
1716
|
predicate.predicate,
|
|
1573
1717
|
" ",
|
|
1574
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ jsx9(
|
|
1575
1719
|
"span",
|
|
1576
1720
|
{
|
|
1577
1721
|
style: {
|
|
@@ -1585,7 +1729,7 @@ function PredicateRow({ predicate }) {
|
|
|
1585
1729
|
)
|
|
1586
1730
|
] });
|
|
1587
1731
|
}
|
|
1588
|
-
return /* @__PURE__ */
|
|
1732
|
+
return /* @__PURE__ */ jsxs9(
|
|
1589
1733
|
"li",
|
|
1590
1734
|
{
|
|
1591
1735
|
style: {
|
|
@@ -1597,7 +1741,7 @@ function PredicateRow({ predicate }) {
|
|
|
1597
1741
|
predicate.predicate,
|
|
1598
1742
|
" ",
|
|
1599
1743
|
predicate.fired ? "\u2713" : "\xB7",
|
|
1600
|
-
predicate.evaluated ? /* @__PURE__ */
|
|
1744
|
+
predicate.evaluated ? /* @__PURE__ */ jsx9(
|
|
1601
1745
|
"span",
|
|
1602
1746
|
{
|
|
1603
1747
|
style: {
|
|
@@ -1615,10 +1759,11 @@ function PredicateRow({ predicate }) {
|
|
|
1615
1759
|
}
|
|
1616
1760
|
|
|
1617
1761
|
// src/components/panels/RegistryBrowser.tsx
|
|
1762
|
+
import { resolveScopePositions } from "@lace-cloud/proto";
|
|
1618
1763
|
import { Button as Button2, Input as Input2, Panel as Panel5, Spinner } from "@lace-cloud/ui";
|
|
1619
1764
|
import { useCallback as useCallback4, useEffect as useEffect5, useMemo as useMemo3, useState as useState6 } from "react";
|
|
1620
1765
|
import "./RegistryBrowser-3G22I4EO.css";
|
|
1621
|
-
import { jsx as
|
|
1766
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1622
1767
|
function RegistryBrowser({
|
|
1623
1768
|
registryBaseUrl,
|
|
1624
1769
|
apiToken,
|
|
@@ -1626,7 +1771,7 @@ function RegistryBrowser({
|
|
|
1626
1771
|
showToast,
|
|
1627
1772
|
onClose
|
|
1628
1773
|
}) {
|
|
1629
|
-
const { readOnly } = useCanvas();
|
|
1774
|
+
const { readOnly, arrangement, updateArrangement } = useCanvas();
|
|
1630
1775
|
const [modules, setModules] = useState6([]);
|
|
1631
1776
|
const [loading, setLoading] = useState6(true);
|
|
1632
1777
|
const [error, setError] = useState6(null);
|
|
@@ -1691,6 +1836,23 @@ function RegistryBrowser({
|
|
|
1691
1836
|
if (!result.success) {
|
|
1692
1837
|
showToast(result.errors[0]?.message ?? "Failed to place module", "error");
|
|
1693
1838
|
} else {
|
|
1839
|
+
const created = result.created[0];
|
|
1840
|
+
const bundle = engine.getCurrentBundle();
|
|
1841
|
+
if (created && bundle) {
|
|
1842
|
+
const scopeEntry = arrangement[created.scope] ?? {};
|
|
1843
|
+
const existingIds = Object.keys(scopeEntry.nodes ?? {});
|
|
1844
|
+
const slot = resolveScopePositions([...existingIds, created.id], scopeEntry.nodes).get(
|
|
1845
|
+
created.id
|
|
1846
|
+
);
|
|
1847
|
+
if (slot) {
|
|
1848
|
+
updateArrangement(
|
|
1849
|
+
setScopeEntry(arrangement, created.scope, {
|
|
1850
|
+
...scopeEntry,
|
|
1851
|
+
nodes: { ...scopeEntry.nodes, [created.id]: slot }
|
|
1852
|
+
})
|
|
1853
|
+
);
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1694
1856
|
onClose();
|
|
1695
1857
|
}
|
|
1696
1858
|
} catch (err) {
|
|
@@ -1699,10 +1861,10 @@ function RegistryBrowser({
|
|
|
1699
1861
|
setPlacing(null);
|
|
1700
1862
|
}
|
|
1701
1863
|
},
|
|
1702
|
-
[engine, onClose, readOnly, showToast]
|
|
1864
|
+
[engine, arrangement, updateArrangement, onClose, readOnly, showToast]
|
|
1703
1865
|
);
|
|
1704
|
-
return /* @__PURE__ */
|
|
1705
|
-
/* @__PURE__ */
|
|
1866
|
+
return /* @__PURE__ */ jsx10(Panel5, { title: "Registry", width: 380, onClose, scrollable: true, children: /* @__PURE__ */ jsxs10("div", { className: "lace-registry-browser", children: [
|
|
1867
|
+
/* @__PURE__ */ jsx10("div", { className: "lace-registry-browser__search", children: /* @__PURE__ */ jsx10(
|
|
1706
1868
|
Input2,
|
|
1707
1869
|
{
|
|
1708
1870
|
value: search,
|
|
@@ -1711,19 +1873,19 @@ function RegistryBrowser({
|
|
|
1711
1873
|
id: "registry-search"
|
|
1712
1874
|
}
|
|
1713
1875
|
) }),
|
|
1714
|
-
loading ? /* @__PURE__ */
|
|
1715
|
-
/* @__PURE__ */
|
|
1716
|
-
/* @__PURE__ */
|
|
1717
|
-
] }) : error ? /* @__PURE__ */
|
|
1718
|
-
/* @__PURE__ */
|
|
1719
|
-
/* @__PURE__ */
|
|
1720
|
-
/* @__PURE__ */
|
|
1876
|
+
loading ? /* @__PURE__ */ jsxs10("div", { className: "lace-registry-browser__state", children: [
|
|
1877
|
+
/* @__PURE__ */ jsx10(Spinner, {}),
|
|
1878
|
+
/* @__PURE__ */ jsx10("span", { children: "Loading registry..." })
|
|
1879
|
+
] }) : error ? /* @__PURE__ */ jsx10("div", { className: "lace-registry-browser__state lace-registry-browser__state--error", children: /* @__PURE__ */ jsx10("span", { children: error }) }) : filtered.length === 0 ? /* @__PURE__ */ jsx10("div", { className: "lace-registry-browser__state lace-registry-browser__state--empty", children: modules.length === 0 ? "No modules found in the registry." : "No modules match your search." }) : /* @__PURE__ */ jsx10("ul", { className: "lace-registry-browser__list", children: filtered.map((mod) => /* @__PURE__ */ jsxs10("li", { className: "lace-registry-browser__item", children: [
|
|
1880
|
+
/* @__PURE__ */ jsxs10("div", { className: "lace-registry-browser__item-info", children: [
|
|
1881
|
+
/* @__PURE__ */ jsx10("div", { className: "lace-registry-browser__item-name", children: mod.display_name ?? mod.name }),
|
|
1882
|
+
/* @__PURE__ */ jsxs10("div", { className: "lace-registry-browser__item-author", children: [
|
|
1721
1883
|
"by ",
|
|
1722
1884
|
mod.author
|
|
1723
1885
|
] }),
|
|
1724
|
-
mod.description ? /* @__PURE__ */
|
|
1886
|
+
mod.description ? /* @__PURE__ */ jsx10("div", { className: "lace-registry-browser__item-desc", children: mod.description }) : null
|
|
1725
1887
|
] }),
|
|
1726
|
-
!readOnly ? /* @__PURE__ */
|
|
1888
|
+
!readOnly ? /* @__PURE__ */ jsx10(
|
|
1727
1889
|
Button2,
|
|
1728
1890
|
{
|
|
1729
1891
|
variant: "primary",
|
|
@@ -1805,7 +1967,7 @@ function findDuplicateIndices(items, keyFn) {
|
|
|
1805
1967
|
|
|
1806
1968
|
// src/components/SaveButton.tsx
|
|
1807
1969
|
import { Button as Button3 } from "@lace-cloud/ui";
|
|
1808
|
-
import { jsx as
|
|
1970
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1809
1971
|
var variantByStatus = {
|
|
1810
1972
|
idle: "primary",
|
|
1811
1973
|
saving: "primary",
|
|
@@ -1818,7 +1980,7 @@ var labelByStatus = {
|
|
|
1818
1980
|
error: "Save failed \u2014 try again"
|
|
1819
1981
|
};
|
|
1820
1982
|
function SaveButton({ status, label, onClick, disabled, disabledTitle }) {
|
|
1821
|
-
return /* @__PURE__ */
|
|
1983
|
+
return /* @__PURE__ */ jsx11(
|
|
1822
1984
|
Button3,
|
|
1823
1985
|
{
|
|
1824
1986
|
variant: variantByStatus[status],
|
|
@@ -1834,7 +1996,7 @@ function SaveButton({ status, label, onClick, disabled, disabledTitle }) {
|
|
|
1834
1996
|
|
|
1835
1997
|
// src/components/panels/EnvironmentsPanel.tsx
|
|
1836
1998
|
import "./panels-shared-LLLB7PR4.css";
|
|
1837
|
-
import { Fragment as Fragment4, jsx as
|
|
1999
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1838
2000
|
function toEnvRows(envs) {
|
|
1839
2001
|
if (!envs) return [];
|
|
1840
2002
|
return Object.entries(envs).map(([name, vars]) => ({
|
|
@@ -1922,10 +2084,10 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
|
|
|
1922
2084
|
await onSave(fromEnvRows(envRows));
|
|
1923
2085
|
}, [onSave, envRows, hasDuplicates])
|
|
1924
2086
|
);
|
|
1925
|
-
return /* @__PURE__ */
|
|
1926
|
-
envRows.map((env, ei) => /* @__PURE__ */
|
|
1927
|
-
/* @__PURE__ */
|
|
1928
|
-
/* @__PURE__ */
|
|
2087
|
+
return /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
2088
|
+
envRows.map((env, ei) => /* @__PURE__ */ jsxs11("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
2089
|
+
/* @__PURE__ */ jsxs11("div", { className: "lace-panel-row-actions", children: [
|
|
2090
|
+
/* @__PURE__ */ jsx12(
|
|
1929
2091
|
Input3,
|
|
1930
2092
|
{
|
|
1931
2093
|
value: env.name,
|
|
@@ -1936,7 +2098,7 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
|
|
|
1936
2098
|
readOnly
|
|
1937
2099
|
}
|
|
1938
2100
|
),
|
|
1939
|
-
!readOnly && /* @__PURE__ */
|
|
2101
|
+
!readOnly && /* @__PURE__ */ jsx12(
|
|
1940
2102
|
"button",
|
|
1941
2103
|
{
|
|
1942
2104
|
type: "button",
|
|
@@ -1947,10 +2109,10 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
|
|
|
1947
2109
|
}
|
|
1948
2110
|
)
|
|
1949
2111
|
] }),
|
|
1950
|
-
envNameDupes.has(ei) && /* @__PURE__ */
|
|
1951
|
-
/* @__PURE__ */
|
|
1952
|
-
env.vars.map((v, vi) => /* @__PURE__ */
|
|
1953
|
-
/* @__PURE__ */
|
|
2112
|
+
envNameDupes.has(ei) && /* @__PURE__ */ jsx12("div", { className: "lace-panel-row-error", children: "Duplicate environment name" }),
|
|
2113
|
+
/* @__PURE__ */ jsx12("div", { className: "lace-panel-row-sublabel", children: "Variable overrides" }),
|
|
2114
|
+
env.vars.map((v, vi) => /* @__PURE__ */ jsxs11("div", { className: "lace-panel-row-actions", children: [
|
|
2115
|
+
/* @__PURE__ */ jsx12(
|
|
1954
2116
|
Input3,
|
|
1955
2117
|
{
|
|
1956
2118
|
value: v.key,
|
|
@@ -1962,7 +2124,7 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
|
|
|
1962
2124
|
readOnly
|
|
1963
2125
|
}
|
|
1964
2126
|
),
|
|
1965
|
-
/* @__PURE__ */
|
|
2127
|
+
/* @__PURE__ */ jsx12(
|
|
1966
2128
|
Input3,
|
|
1967
2129
|
{
|
|
1968
2130
|
value: v.value,
|
|
@@ -1972,7 +2134,7 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
|
|
|
1972
2134
|
readOnly
|
|
1973
2135
|
}
|
|
1974
2136
|
),
|
|
1975
|
-
!readOnly && /* @__PURE__ */
|
|
2137
|
+
!readOnly && /* @__PURE__ */ jsx12(
|
|
1976
2138
|
"button",
|
|
1977
2139
|
{
|
|
1978
2140
|
type: "button",
|
|
@@ -1983,7 +2145,7 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
|
|
|
1983
2145
|
}
|
|
1984
2146
|
)
|
|
1985
2147
|
] }, v.id)),
|
|
1986
|
-
!readOnly && /* @__PURE__ */
|
|
2148
|
+
!readOnly && /* @__PURE__ */ jsx12(
|
|
1987
2149
|
"button",
|
|
1988
2150
|
{
|
|
1989
2151
|
type: "button",
|
|
@@ -1993,9 +2155,9 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
|
|
|
1993
2155
|
}
|
|
1994
2156
|
)
|
|
1995
2157
|
] }, env.id)),
|
|
1996
|
-
!readOnly && /* @__PURE__ */
|
|
1997
|
-
/* @__PURE__ */
|
|
1998
|
-
/* @__PURE__ */
|
|
2158
|
+
!readOnly && /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
2159
|
+
/* @__PURE__ */ jsx12("button", { type: "button", onClick: addEnv, className: "lace-panel-add-btn", children: "+ Add environment" }),
|
|
2160
|
+
/* @__PURE__ */ jsx12(
|
|
1999
2161
|
SaveButton,
|
|
2000
2162
|
{
|
|
2001
2163
|
status: saveStatus,
|
|
@@ -2005,19 +2167,19 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
|
|
|
2005
2167
|
disabledTitle: "Fix duplicate names before saving"
|
|
2006
2168
|
}
|
|
2007
2169
|
),
|
|
2008
|
-
hasDuplicates && /* @__PURE__ */
|
|
2170
|
+
hasDuplicates && /* @__PURE__ */ jsx12("div", { className: "lace-panel-row-error", children: "Fix duplicate environment or variable names before saving." })
|
|
2009
2171
|
] })
|
|
2010
2172
|
] });
|
|
2011
2173
|
}
|
|
2012
2174
|
function EnvironmentsPanel({ environments, onSave, onClose }) {
|
|
2013
|
-
return /* @__PURE__ */
|
|
2175
|
+
return /* @__PURE__ */ jsx12(Panel6, { title: "Environments", onClose, children: /* @__PURE__ */ jsx12(EnvironmentsContent, { environments, onSave }) });
|
|
2014
2176
|
}
|
|
2015
2177
|
|
|
2016
2178
|
// src/components/panels/LocalsPanel.tsx
|
|
2017
2179
|
import { Input as Input4, ModeToggle as ModeToggle2, Panel as Panel7, Textarea as Textarea2 } from "@lace-cloud/ui";
|
|
2018
2180
|
import { useCallback as useCallback7, useState as useState9 } from "react";
|
|
2019
2181
|
import "./panels-shared-LLLB7PR4.css";
|
|
2020
|
-
import { Fragment as Fragment5, jsx as
|
|
2182
|
+
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2021
2183
|
function toRows(locals) {
|
|
2022
2184
|
if (!locals) return [];
|
|
2023
2185
|
return locals.map((l) => ({
|
|
@@ -2070,10 +2232,10 @@ function LocalsContent({ locals, readOnly = false, onSave }) {
|
|
|
2070
2232
|
await onSave(fromRows(rows));
|
|
2071
2233
|
}, [onSave, rows, hasErrors])
|
|
2072
2234
|
);
|
|
2073
|
-
return /* @__PURE__ */
|
|
2074
|
-
rows.map((row, i) => /* @__PURE__ */
|
|
2075
|
-
/* @__PURE__ */
|
|
2076
|
-
/* @__PURE__ */
|
|
2235
|
+
return /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
2236
|
+
rows.map((row, i) => /* @__PURE__ */ jsxs12("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
2237
|
+
/* @__PURE__ */ jsxs12("div", { className: "lace-panel-row-actions", children: [
|
|
2238
|
+
/* @__PURE__ */ jsx13(
|
|
2077
2239
|
Input4,
|
|
2078
2240
|
{
|
|
2079
2241
|
value: row.name,
|
|
@@ -2085,7 +2247,7 @@ function LocalsContent({ locals, readOnly = false, onSave }) {
|
|
|
2085
2247
|
readOnly
|
|
2086
2248
|
}
|
|
2087
2249
|
),
|
|
2088
|
-
!readOnly && /* @__PURE__ */
|
|
2250
|
+
!readOnly && /* @__PURE__ */ jsx13(
|
|
2089
2251
|
"button",
|
|
2090
2252
|
{
|
|
2091
2253
|
type: "button",
|
|
@@ -2096,8 +2258,8 @@ function LocalsContent({ locals, readOnly = false, onSave }) {
|
|
|
2096
2258
|
}
|
|
2097
2259
|
)
|
|
2098
2260
|
] }),
|
|
2099
|
-
nameDupes.has(i) && /* @__PURE__ */
|
|
2100
|
-
/* @__PURE__ */
|
|
2261
|
+
nameDupes.has(i) && /* @__PURE__ */ jsx13("div", { className: "lace-panel-row-error", children: "Duplicate local name" }),
|
|
2262
|
+
/* @__PURE__ */ jsx13("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx13(
|
|
2101
2263
|
ModeToggle2,
|
|
2102
2264
|
{
|
|
2103
2265
|
value: row.mode,
|
|
@@ -2106,7 +2268,7 @@ function LocalsContent({ locals, readOnly = false, onSave }) {
|
|
|
2106
2268
|
"aria-label": "Local binding mode"
|
|
2107
2269
|
}
|
|
2108
2270
|
) }),
|
|
2109
|
-
/* @__PURE__ */
|
|
2271
|
+
/* @__PURE__ */ jsx13("div", { className: "lace-panel-row-content", children: row.mode === "literal" ? /* @__PURE__ */ jsx13(
|
|
2110
2272
|
Textarea2,
|
|
2111
2273
|
{
|
|
2112
2274
|
value: row.litValue,
|
|
@@ -2117,7 +2279,7 @@ function LocalsContent({ locals, readOnly = false, onSave }) {
|
|
|
2117
2279
|
mono: true,
|
|
2118
2280
|
readOnly
|
|
2119
2281
|
}
|
|
2120
|
-
) : /* @__PURE__ */
|
|
2282
|
+
) : /* @__PURE__ */ jsx13(
|
|
2121
2283
|
Textarea2,
|
|
2122
2284
|
{
|
|
2123
2285
|
value: row.exprValue,
|
|
@@ -2130,9 +2292,9 @@ function LocalsContent({ locals, readOnly = false, onSave }) {
|
|
|
2130
2292
|
}
|
|
2131
2293
|
) })
|
|
2132
2294
|
] }, row.id)),
|
|
2133
|
-
!readOnly && /* @__PURE__ */
|
|
2134
|
-
/* @__PURE__ */
|
|
2135
|
-
/* @__PURE__ */
|
|
2295
|
+
!readOnly && /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
2296
|
+
/* @__PURE__ */ jsx13("button", { type: "button", onClick: addLocal, className: "lace-panel-add-btn", children: "+ Add local" }),
|
|
2297
|
+
/* @__PURE__ */ jsx13(
|
|
2136
2298
|
SaveButton,
|
|
2137
2299
|
{
|
|
2138
2300
|
status: saveStatus,
|
|
@@ -2146,14 +2308,14 @@ function LocalsContent({ locals, readOnly = false, onSave }) {
|
|
|
2146
2308
|
] });
|
|
2147
2309
|
}
|
|
2148
2310
|
function LocalsPanel({ locals, onSave, onClose }) {
|
|
2149
|
-
return /* @__PURE__ */
|
|
2311
|
+
return /* @__PURE__ */ jsx13(Panel7, { title: "Locals", onClose, children: /* @__PURE__ */ jsx13(LocalsContent, { locals, onSave }) });
|
|
2150
2312
|
}
|
|
2151
2313
|
|
|
2152
2314
|
// src/components/panels/ModuleInterfacePanel.tsx
|
|
2153
2315
|
import { Button as Button4, Input as Input5, Panel as Panel8, Textarea as Textarea3 } from "@lace-cloud/ui";
|
|
2154
2316
|
import { useCallback as useCallback8, useMemo as useMemo4, useState as useState10 } from "react";
|
|
2155
2317
|
import "./panels-shared-LLLB7PR4.css";
|
|
2156
|
-
import { Fragment as Fragment6, jsx as
|
|
2318
|
+
import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2157
2319
|
function variablesToRows(variables) {
|
|
2158
2320
|
return variables.map((v) => ({
|
|
2159
2321
|
id: crypto.randomUUID(),
|
|
@@ -2356,17 +2518,17 @@ function ModuleInterfaceContent({
|
|
|
2356
2518
|
await onSaveExports(exportDefs, outputDefs);
|
|
2357
2519
|
}, [variables, outputs, hasErrors, onSaveVariables, onSaveExports])
|
|
2358
2520
|
);
|
|
2359
|
-
return /* @__PURE__ */
|
|
2360
|
-
/* @__PURE__ */
|
|
2361
|
-
/* @__PURE__ */
|
|
2362
|
-
variables.length === 0 ? /* @__PURE__ */
|
|
2521
|
+
return /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
2522
|
+
/* @__PURE__ */ jsx14("div", { className: "lace-panel-hint", children: "The composition's public surface \u2014 what the registry sees when this module is published." }),
|
|
2523
|
+
/* @__PURE__ */ jsx14("h4", { className: "lace-panel-section-title", children: "Inputs" }),
|
|
2524
|
+
variables.length === 0 ? /* @__PURE__ */ jsxs13("div", { className: "lace-panel-hint", children: [
|
|
2363
2525
|
"No variables yet. They'll auto-derive on the next Generate from any ",
|
|
2364
|
-
/* @__PURE__ */
|
|
2526
|
+
/* @__PURE__ */ jsx14("code", { children: "var.xxx" }),
|
|
2365
2527
|
" ",
|
|
2366
2528
|
"references in child input bindings."
|
|
2367
|
-
] }) : variables.map((v, i) => /* @__PURE__ */
|
|
2368
|
-
/* @__PURE__ */
|
|
2369
|
-
/* @__PURE__ */
|
|
2529
|
+
] }) : variables.map((v, i) => /* @__PURE__ */ jsxs13("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
2530
|
+
/* @__PURE__ */ jsx14("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx14(Input5, { value: v.name, placeholder: "Variable name", fullWidth: true, mono: true, readOnly: true }) }),
|
|
2531
|
+
/* @__PURE__ */ jsx14("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx14(
|
|
2370
2532
|
Input5,
|
|
2371
2533
|
{
|
|
2372
2534
|
value: v.type,
|
|
@@ -2377,7 +2539,7 @@ function ModuleInterfaceContent({
|
|
|
2377
2539
|
readOnly
|
|
2378
2540
|
}
|
|
2379
2541
|
) }),
|
|
2380
|
-
/* @__PURE__ */
|
|
2542
|
+
/* @__PURE__ */ jsx14("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx14(
|
|
2381
2543
|
Textarea3,
|
|
2382
2544
|
{
|
|
2383
2545
|
value: v.description,
|
|
@@ -2388,9 +2550,9 @@ function ModuleInterfaceContent({
|
|
|
2388
2550
|
readOnly
|
|
2389
2551
|
}
|
|
2390
2552
|
) }),
|
|
2391
|
-
/* @__PURE__ */
|
|
2392
|
-
/* @__PURE__ */
|
|
2393
|
-
/* @__PURE__ */
|
|
2553
|
+
/* @__PURE__ */ jsxs13("div", { className: "lace-panel-row-actions", children: [
|
|
2554
|
+
/* @__PURE__ */ jsxs13("label", { className: "lace-panel-checkbox-row", children: [
|
|
2555
|
+
/* @__PURE__ */ jsx14(
|
|
2394
2556
|
"input",
|
|
2395
2557
|
{
|
|
2396
2558
|
type: "checkbox",
|
|
@@ -2399,10 +2561,10 @@ function ModuleInterfaceContent({
|
|
|
2399
2561
|
disabled: readOnly
|
|
2400
2562
|
}
|
|
2401
2563
|
),
|
|
2402
|
-
/* @__PURE__ */
|
|
2564
|
+
/* @__PURE__ */ jsx14("span", { children: "Required" })
|
|
2403
2565
|
] }),
|
|
2404
|
-
/* @__PURE__ */
|
|
2405
|
-
/* @__PURE__ */
|
|
2566
|
+
/* @__PURE__ */ jsxs13("label", { className: "lace-panel-checkbox-row", children: [
|
|
2567
|
+
/* @__PURE__ */ jsx14(
|
|
2406
2568
|
"input",
|
|
2407
2569
|
{
|
|
2408
2570
|
type: "checkbox",
|
|
@@ -2411,10 +2573,10 @@ function ModuleInterfaceContent({
|
|
|
2411
2573
|
disabled: readOnly
|
|
2412
2574
|
}
|
|
2413
2575
|
),
|
|
2414
|
-
/* @__PURE__ */
|
|
2576
|
+
/* @__PURE__ */ jsx14("span", { children: "Ephemeral" })
|
|
2415
2577
|
] }),
|
|
2416
|
-
/* @__PURE__ */
|
|
2417
|
-
/* @__PURE__ */
|
|
2578
|
+
/* @__PURE__ */ jsxs13("label", { className: "lace-panel-checkbox-row", children: [
|
|
2579
|
+
/* @__PURE__ */ jsx14(
|
|
2418
2580
|
"input",
|
|
2419
2581
|
{
|
|
2420
2582
|
type: "checkbox",
|
|
@@ -2423,10 +2585,10 @@ function ModuleInterfaceContent({
|
|
|
2423
2585
|
disabled: readOnly
|
|
2424
2586
|
}
|
|
2425
2587
|
),
|
|
2426
|
-
/* @__PURE__ */
|
|
2588
|
+
/* @__PURE__ */ jsx14("span", { children: "Sensitive" })
|
|
2427
2589
|
] }),
|
|
2428
|
-
/* @__PURE__ */
|
|
2429
|
-
/* @__PURE__ */
|
|
2590
|
+
/* @__PURE__ */ jsxs13("label", { className: "lace-panel-checkbox-row", children: [
|
|
2591
|
+
/* @__PURE__ */ jsx14(
|
|
2430
2592
|
"input",
|
|
2431
2593
|
{
|
|
2432
2594
|
type: "checkbox",
|
|
@@ -2435,13 +2597,13 @@ function ModuleInterfaceContent({
|
|
|
2435
2597
|
disabled: readOnly
|
|
2436
2598
|
}
|
|
2437
2599
|
),
|
|
2438
|
-
/* @__PURE__ */
|
|
2600
|
+
/* @__PURE__ */ jsx14("span", { children: "Nullable" })
|
|
2439
2601
|
] })
|
|
2440
2602
|
] }),
|
|
2441
|
-
(v.validation.length > 0 || !readOnly) && /* @__PURE__ */
|
|
2442
|
-
/* @__PURE__ */
|
|
2443
|
-
v.validation.map((block, j) => /* @__PURE__ */
|
|
2444
|
-
/* @__PURE__ */
|
|
2603
|
+
(v.validation.length > 0 || !readOnly) && /* @__PURE__ */ jsxs13("div", { className: "lace-panel-row-content", children: [
|
|
2604
|
+
/* @__PURE__ */ jsx14("div", { className: "lace-panel-subsection-label", children: "Validation" }),
|
|
2605
|
+
v.validation.map((block, j) => /* @__PURE__ */ jsxs13("div", { className: "lace-panel-validation-block", children: [
|
|
2606
|
+
/* @__PURE__ */ jsx14(
|
|
2445
2607
|
Input5,
|
|
2446
2608
|
{
|
|
2447
2609
|
value: block.condition,
|
|
@@ -2453,7 +2615,7 @@ function ModuleInterfaceContent({
|
|
|
2453
2615
|
readOnly
|
|
2454
2616
|
}
|
|
2455
2617
|
),
|
|
2456
|
-
/* @__PURE__ */
|
|
2618
|
+
/* @__PURE__ */ jsx14(
|
|
2457
2619
|
Input5,
|
|
2458
2620
|
{
|
|
2459
2621
|
value: block.error_message,
|
|
@@ -2464,7 +2626,7 @@ function ModuleInterfaceContent({
|
|
|
2464
2626
|
readOnly
|
|
2465
2627
|
}
|
|
2466
2628
|
),
|
|
2467
|
-
!readOnly && /* @__PURE__ */
|
|
2629
|
+
!readOnly && /* @__PURE__ */ jsx14(
|
|
2468
2630
|
Button4,
|
|
2469
2631
|
{
|
|
2470
2632
|
variant: "danger",
|
|
@@ -2476,13 +2638,13 @@ function ModuleInterfaceContent({
|
|
|
2476
2638
|
}
|
|
2477
2639
|
)
|
|
2478
2640
|
] }, block.id)),
|
|
2479
|
-
!readOnly && /* @__PURE__ */
|
|
2641
|
+
!readOnly && /* @__PURE__ */ jsx14(Button4, { variant: "secondary", size: "sm", onClick: () => addValidation(i), children: "+ Add validation rule" })
|
|
2480
2642
|
] })
|
|
2481
2643
|
] }, v.id)),
|
|
2482
|
-
/* @__PURE__ */
|
|
2483
|
-
outputs.length === 0 ? /* @__PURE__ */
|
|
2484
|
-
/* @__PURE__ */
|
|
2485
|
-
/* @__PURE__ */
|
|
2644
|
+
/* @__PURE__ */ jsx14("h4", { className: "lace-panel-section-title", children: "Outputs" }),
|
|
2645
|
+
outputs.length === 0 ? /* @__PURE__ */ jsx14("div", { className: "lace-panel-hint", children: "No child outputs available yet. Drop a module onto the canvas to see its outputs here." }) : outputs.map((o, i) => /* @__PURE__ */ jsxs13("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
2646
|
+
/* @__PURE__ */ jsx14("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsxs13("label", { className: "lace-panel-checkbox-row", children: [
|
|
2647
|
+
/* @__PURE__ */ jsx14(
|
|
2486
2648
|
"input",
|
|
2487
2649
|
{
|
|
2488
2650
|
type: "checkbox",
|
|
@@ -2491,13 +2653,13 @@ function ModuleInterfaceContent({
|
|
|
2491
2653
|
disabled: readOnly
|
|
2492
2654
|
}
|
|
2493
2655
|
),
|
|
2494
|
-
/* @__PURE__ */
|
|
2656
|
+
/* @__PURE__ */ jsxs13("span", { className: "lace-panel-checkbox-row__source", children: [
|
|
2495
2657
|
o.source_instance,
|
|
2496
2658
|
".",
|
|
2497
2659
|
o.source_output
|
|
2498
2660
|
] })
|
|
2499
2661
|
] }) }),
|
|
2500
|
-
o.exposed ? /* @__PURE__ */
|
|
2662
|
+
o.exposed ? /* @__PURE__ */ jsx14("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx14(
|
|
2501
2663
|
Input5,
|
|
2502
2664
|
{
|
|
2503
2665
|
value: o.exposed_name,
|
|
@@ -2509,10 +2671,10 @@ function ModuleInterfaceContent({
|
|
|
2509
2671
|
error: exposedNameCollisions.has(i)
|
|
2510
2672
|
}
|
|
2511
2673
|
) }) : null,
|
|
2512
|
-
o.exposed && (o.depends_on.length > 0 || !readOnly && siblingModuleKeys.length > 0) ? /* @__PURE__ */
|
|
2513
|
-
/* @__PURE__ */
|
|
2514
|
-
readOnly ? o.depends_on.map((depKey) => /* @__PURE__ */
|
|
2515
|
-
/* @__PURE__ */
|
|
2674
|
+
o.exposed && (o.depends_on.length > 0 || !readOnly && siblingModuleKeys.length > 0) ? /* @__PURE__ */ jsxs13("div", { className: "lace-panel-row-content", children: [
|
|
2675
|
+
/* @__PURE__ */ jsx14("div", { className: "lace-panel-subsection-label", children: "Depends on" }),
|
|
2676
|
+
readOnly ? o.depends_on.map((depKey) => /* @__PURE__ */ jsx14("div", { className: "lace-panel-depends-item", children: depKey }, depKey)) : siblingModuleKeys.map((depKey) => /* @__PURE__ */ jsxs13("label", { className: "lace-panel-checkbox-row", children: [
|
|
2677
|
+
/* @__PURE__ */ jsx14(
|
|
2516
2678
|
"input",
|
|
2517
2679
|
{
|
|
2518
2680
|
type: "checkbox",
|
|
@@ -2520,12 +2682,12 @@ function ModuleInterfaceContent({
|
|
|
2520
2682
|
onChange: () => toggleDependsOn(i, depKey)
|
|
2521
2683
|
}
|
|
2522
2684
|
),
|
|
2523
|
-
/* @__PURE__ */
|
|
2685
|
+
/* @__PURE__ */ jsx14("span", { className: "lace-panel-checkbox-row__source", children: depKey })
|
|
2524
2686
|
] }, depKey))
|
|
2525
2687
|
] }) : null,
|
|
2526
|
-
exposedNameCollisions.has(i) ? /* @__PURE__ */
|
|
2688
|
+
exposedNameCollisions.has(i) ? /* @__PURE__ */ jsx14("div", { className: "lace-panel-row-error", children: "Exposed name must be unique and non-empty." }) : null
|
|
2527
2689
|
] }, o.id)),
|
|
2528
|
-
!readOnly && /* @__PURE__ */
|
|
2690
|
+
!readOnly && /* @__PURE__ */ jsx14(
|
|
2529
2691
|
SaveButton,
|
|
2530
2692
|
{
|
|
2531
2693
|
status: saveStatus,
|
|
@@ -2545,7 +2707,7 @@ function ModuleInterfacePanel({
|
|
|
2545
2707
|
onSaveExports,
|
|
2546
2708
|
onClose
|
|
2547
2709
|
}) {
|
|
2548
|
-
return /* @__PURE__ */
|
|
2710
|
+
return /* @__PURE__ */ jsx14(Panel8, { title: "Module Interface", onClose, children: /* @__PURE__ */ jsx14(
|
|
2549
2711
|
ModuleInterfaceContent,
|
|
2550
2712
|
{
|
|
2551
2713
|
settings,
|
|
@@ -2561,7 +2723,7 @@ function ModuleInterfacePanel({
|
|
|
2561
2723
|
import { Input as Input6, Panel as Panel9, Textarea as Textarea4 } from "@lace-cloud/ui";
|
|
2562
2724
|
import { useCallback as useCallback9, useEffect as useEffect7, useState as useState11 } from "react";
|
|
2563
2725
|
import "./panels-shared-LLLB7PR4.css";
|
|
2564
|
-
import { Fragment as Fragment7, jsx as
|
|
2726
|
+
import { Fragment as Fragment7, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2565
2727
|
var ID_PATTERN = /^[a-z0-9_-]+\/[a-z0-9_-]+\/[a-z0-9_-]+$/;
|
|
2566
2728
|
var NAME_PATTERN = /^[a-z][a-z0-9_-]*$/;
|
|
2567
2729
|
var SEMVER_PATTERN = /^\d+\.\d+\.\d+(?:-[A-Za-z0-9.-]+)?(?:\+[A-Za-z0-9.-]+)?$/;
|
|
@@ -2649,20 +2811,20 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
|
|
|
2649
2811
|
}, [engine, meta, authors, categoriesInput, hasErrors, onSaved])
|
|
2650
2812
|
);
|
|
2651
2813
|
if (loading) {
|
|
2652
|
-
return /* @__PURE__ */
|
|
2814
|
+
return /* @__PURE__ */ jsx15("div", { className: "lace-panel-hint", children: "Loading module metadata\u2026" });
|
|
2653
2815
|
}
|
|
2654
|
-
return /* @__PURE__ */
|
|
2655
|
-
/* @__PURE__ */
|
|
2816
|
+
return /* @__PURE__ */ jsxs14(Fragment7, { children: [
|
|
2817
|
+
/* @__PURE__ */ jsxs14("div", { className: "lace-panel-hint", children: [
|
|
2656
2818
|
"Saved as ",
|
|
2657
|
-
/* @__PURE__ */
|
|
2819
|
+
/* @__PURE__ */ jsx15("code", { children: "module.yaml" }),
|
|
2658
2820
|
" at the composition's root, alongside the generated Terraform. Once filled in, the directory is publish-ready via",
|
|
2659
|
-
/* @__PURE__ */
|
|
2821
|
+
/* @__PURE__ */ jsx15("code", { children: " lace registry register --axis module" }),
|
|
2660
2822
|
"."
|
|
2661
2823
|
] }),
|
|
2662
|
-
/* @__PURE__ */
|
|
2663
|
-
/* @__PURE__ */
|
|
2664
|
-
/* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2824
|
+
/* @__PURE__ */ jsx15("h4", { className: "lace-panel-section-title", children: "Identity" }),
|
|
2825
|
+
/* @__PURE__ */ jsxs14("div", { className: "lace-panel-field", children: [
|
|
2826
|
+
/* @__PURE__ */ jsx15("label", { className: "lace-panel-row-label", htmlFor: "module-id-input", children: "ID" }),
|
|
2827
|
+
/* @__PURE__ */ jsx15(
|
|
2666
2828
|
Input6,
|
|
2667
2829
|
{
|
|
2668
2830
|
id: "module-id-input",
|
|
@@ -2675,15 +2837,15 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
|
|
|
2675
2837
|
error: Boolean(idError)
|
|
2676
2838
|
}
|
|
2677
2839
|
),
|
|
2678
|
-
idError ? /* @__PURE__ */
|
|
2840
|
+
idError ? /* @__PURE__ */ jsxs14("div", { className: "lace-panel-row-error", children: [
|
|
2679
2841
|
"Expected ",
|
|
2680
|
-
/* @__PURE__ */
|
|
2842
|
+
/* @__PURE__ */ jsx15("code", { children: "<system>/<service>/<name>" }),
|
|
2681
2843
|
" (lowercase, hyphens or underscores)."
|
|
2682
2844
|
] }) : null
|
|
2683
2845
|
] }),
|
|
2684
|
-
/* @__PURE__ */
|
|
2685
|
-
/* @__PURE__ */
|
|
2686
|
-
/* @__PURE__ */
|
|
2846
|
+
/* @__PURE__ */ jsxs14("div", { className: "lace-panel-field", children: [
|
|
2847
|
+
/* @__PURE__ */ jsx15("label", { className: "lace-panel-row-label", htmlFor: "module-name-input", children: "Name" }),
|
|
2848
|
+
/* @__PURE__ */ jsx15(
|
|
2687
2849
|
Input6,
|
|
2688
2850
|
{
|
|
2689
2851
|
id: "module-name-input",
|
|
@@ -2696,11 +2858,11 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
|
|
|
2696
2858
|
error: Boolean(nameError)
|
|
2697
2859
|
}
|
|
2698
2860
|
),
|
|
2699
|
-
nameError ? /* @__PURE__ */
|
|
2861
|
+
nameError ? /* @__PURE__ */ jsx15("div", { className: "lace-panel-row-error", children: "Expected kebab-case (lowercase letters, digits, hyphens or underscores; must start with a letter)." }) : null
|
|
2700
2862
|
] }),
|
|
2701
|
-
/* @__PURE__ */
|
|
2702
|
-
/* @__PURE__ */
|
|
2703
|
-
/* @__PURE__ */
|
|
2863
|
+
/* @__PURE__ */ jsxs14("div", { className: "lace-panel-field", children: [
|
|
2864
|
+
/* @__PURE__ */ jsx15("label", { className: "lace-panel-row-label", htmlFor: "module-system-input", children: "System" }),
|
|
2865
|
+
/* @__PURE__ */ jsx15(
|
|
2704
2866
|
Input6,
|
|
2705
2867
|
{
|
|
2706
2868
|
id: "module-system-input",
|
|
@@ -2713,9 +2875,9 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
|
|
|
2713
2875
|
}
|
|
2714
2876
|
)
|
|
2715
2877
|
] }),
|
|
2716
|
-
/* @__PURE__ */
|
|
2717
|
-
/* @__PURE__ */
|
|
2718
|
-
/* @__PURE__ */
|
|
2878
|
+
/* @__PURE__ */ jsxs14("div", { className: "lace-panel-field", children: [
|
|
2879
|
+
/* @__PURE__ */ jsx15("label", { className: "lace-panel-row-label", htmlFor: "module-version-input", children: "Version" }),
|
|
2880
|
+
/* @__PURE__ */ jsx15(
|
|
2719
2881
|
Input6,
|
|
2720
2882
|
{
|
|
2721
2883
|
id: "module-version-input",
|
|
@@ -2728,10 +2890,10 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
|
|
|
2728
2890
|
error: Boolean(versionError)
|
|
2729
2891
|
}
|
|
2730
2892
|
),
|
|
2731
|
-
versionError ? /* @__PURE__ */
|
|
2893
|
+
versionError ? /* @__PURE__ */ jsx15("div", { className: "lace-panel-row-error", children: "Expected semver (e.g. 1.0.0)." }) : null
|
|
2732
2894
|
] }),
|
|
2733
|
-
/* @__PURE__ */
|
|
2734
|
-
/* @__PURE__ */
|
|
2895
|
+
/* @__PURE__ */ jsx15("h4", { className: "lace-panel-section-title", children: "Description" }),
|
|
2896
|
+
/* @__PURE__ */ jsx15("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx15(
|
|
2735
2897
|
Textarea4,
|
|
2736
2898
|
{
|
|
2737
2899
|
value: meta.description ?? "",
|
|
@@ -2742,8 +2904,8 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
|
|
|
2742
2904
|
readOnly
|
|
2743
2905
|
}
|
|
2744
2906
|
) }),
|
|
2745
|
-
/* @__PURE__ */
|
|
2746
|
-
/* @__PURE__ */
|
|
2907
|
+
/* @__PURE__ */ jsx15("h4", { className: "lace-panel-section-title", children: "Categories" }),
|
|
2908
|
+
/* @__PURE__ */ jsx15("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx15(
|
|
2747
2909
|
Input6,
|
|
2748
2910
|
{
|
|
2749
2911
|
value: categoriesInput,
|
|
@@ -2753,10 +2915,10 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
|
|
|
2753
2915
|
readOnly
|
|
2754
2916
|
}
|
|
2755
2917
|
) }),
|
|
2756
|
-
/* @__PURE__ */
|
|
2757
|
-
authors.map((a, i) => /* @__PURE__ */
|
|
2758
|
-
/* @__PURE__ */
|
|
2759
|
-
/* @__PURE__ */
|
|
2918
|
+
/* @__PURE__ */ jsx15("h4", { className: "lace-panel-section-title", children: "Authors" }),
|
|
2919
|
+
authors.map((a, i) => /* @__PURE__ */ jsxs14("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
2920
|
+
/* @__PURE__ */ jsxs14("div", { className: "lace-panel-row-actions", children: [
|
|
2921
|
+
/* @__PURE__ */ jsx15(
|
|
2760
2922
|
Input6,
|
|
2761
2923
|
{
|
|
2762
2924
|
value: a.name,
|
|
@@ -2766,7 +2928,7 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
|
|
|
2766
2928
|
readOnly
|
|
2767
2929
|
}
|
|
2768
2930
|
),
|
|
2769
|
-
!readOnly && /* @__PURE__ */
|
|
2931
|
+
!readOnly && /* @__PURE__ */ jsx15(
|
|
2770
2932
|
"button",
|
|
2771
2933
|
{
|
|
2772
2934
|
type: "button",
|
|
@@ -2777,7 +2939,7 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
|
|
|
2777
2939
|
}
|
|
2778
2940
|
)
|
|
2779
2941
|
] }),
|
|
2780
|
-
/* @__PURE__ */
|
|
2942
|
+
/* @__PURE__ */ jsx15("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx15(
|
|
2781
2943
|
Input6,
|
|
2782
2944
|
{
|
|
2783
2945
|
value: a.email,
|
|
@@ -2788,9 +2950,9 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
|
|
|
2788
2950
|
}
|
|
2789
2951
|
) })
|
|
2790
2952
|
] }, a.id)),
|
|
2791
|
-
!readOnly && /* @__PURE__ */
|
|
2792
|
-
/* @__PURE__ */
|
|
2793
|
-
/* @__PURE__ */
|
|
2953
|
+
!readOnly && /* @__PURE__ */ jsx15("button", { type: "button", onClick: addAuthor, className: "lace-panel-add-btn", children: "+ Add author" }),
|
|
2954
|
+
/* @__PURE__ */ jsx15("h4", { className: "lace-panel-section-title", children: "Example" }),
|
|
2955
|
+
/* @__PURE__ */ jsx15("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx15(
|
|
2794
2956
|
Textarea4,
|
|
2795
2957
|
{
|
|
2796
2958
|
value: meta.example ?? "",
|
|
@@ -2802,7 +2964,7 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
|
|
|
2802
2964
|
readOnly
|
|
2803
2965
|
}
|
|
2804
2966
|
) }),
|
|
2805
|
-
!readOnly && /* @__PURE__ */
|
|
2967
|
+
!readOnly && /* @__PURE__ */ jsx15(
|
|
2806
2968
|
SaveButton,
|
|
2807
2969
|
{
|
|
2808
2970
|
status: saveStatus,
|
|
@@ -2822,7 +2984,7 @@ import "./panels-shared-LLLB7PR4.css";
|
|
|
2822
2984
|
import { Input as Input7, Panel as Panel10 } from "@lace-cloud/ui";
|
|
2823
2985
|
import { useCallback as useCallback10, useState as useState12 } from "react";
|
|
2824
2986
|
import "./panels-shared-LLLB7PR4.css";
|
|
2825
|
-
import { Fragment as Fragment8, jsx as
|
|
2987
|
+
import { Fragment as Fragment8, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2826
2988
|
function toRows2(providers) {
|
|
2827
2989
|
if (!providers || providers.length === 0) return [];
|
|
2828
2990
|
return providers.map((p) => ({
|
|
@@ -2915,10 +3077,10 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
|
|
|
2915
3077
|
await onSave(fromRows2(rows));
|
|
2916
3078
|
}, [onSave, rows])
|
|
2917
3079
|
);
|
|
2918
|
-
return /* @__PURE__ */
|
|
2919
|
-
rows.map((row, pi) => /* @__PURE__ */
|
|
2920
|
-
/* @__PURE__ */
|
|
2921
|
-
/* @__PURE__ */
|
|
3080
|
+
return /* @__PURE__ */ jsxs15(Fragment8, { children: [
|
|
3081
|
+
rows.map((row, pi) => /* @__PURE__ */ jsxs15("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
3082
|
+
/* @__PURE__ */ jsxs15("div", { className: "lace-panel-row-actions", children: [
|
|
3083
|
+
/* @__PURE__ */ jsx16(
|
|
2922
3084
|
Input7,
|
|
2923
3085
|
{
|
|
2924
3086
|
value: row.name,
|
|
@@ -2928,7 +3090,7 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
|
|
|
2928
3090
|
readOnly
|
|
2929
3091
|
}
|
|
2930
3092
|
),
|
|
2931
|
-
/* @__PURE__ */
|
|
3093
|
+
/* @__PURE__ */ jsx16(
|
|
2932
3094
|
Input7,
|
|
2933
3095
|
{
|
|
2934
3096
|
value: row.alias,
|
|
@@ -2938,7 +3100,7 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
|
|
|
2938
3100
|
readOnly
|
|
2939
3101
|
}
|
|
2940
3102
|
),
|
|
2941
|
-
!readOnly && /* @__PURE__ */
|
|
3103
|
+
!readOnly && /* @__PURE__ */ jsx16(
|
|
2942
3104
|
"button",
|
|
2943
3105
|
{
|
|
2944
3106
|
type: "button",
|
|
@@ -2949,9 +3111,9 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
|
|
|
2949
3111
|
}
|
|
2950
3112
|
)
|
|
2951
3113
|
] }),
|
|
2952
|
-
/* @__PURE__ */
|
|
2953
|
-
row.configEntries.map((entry, ei) => /* @__PURE__ */
|
|
2954
|
-
/* @__PURE__ */
|
|
3114
|
+
/* @__PURE__ */ jsx16("div", { className: "lace-panel-row-sublabel", children: "Config" }),
|
|
3115
|
+
row.configEntries.map((entry, ei) => /* @__PURE__ */ jsxs15("div", { className: "lace-panel-row-actions", children: [
|
|
3116
|
+
/* @__PURE__ */ jsx16(
|
|
2955
3117
|
Input7,
|
|
2956
3118
|
{
|
|
2957
3119
|
value: entry.key,
|
|
@@ -2961,7 +3123,7 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
|
|
|
2961
3123
|
readOnly
|
|
2962
3124
|
}
|
|
2963
3125
|
),
|
|
2964
|
-
/* @__PURE__ */
|
|
3126
|
+
/* @__PURE__ */ jsx16(
|
|
2965
3127
|
Input7,
|
|
2966
3128
|
{
|
|
2967
3129
|
value: entry.value,
|
|
@@ -2971,7 +3133,7 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
|
|
|
2971
3133
|
readOnly
|
|
2972
3134
|
}
|
|
2973
3135
|
),
|
|
2974
|
-
!readOnly && /* @__PURE__ */
|
|
3136
|
+
!readOnly && /* @__PURE__ */ jsx16(
|
|
2975
3137
|
"button",
|
|
2976
3138
|
{
|
|
2977
3139
|
type: "button",
|
|
@@ -2982,7 +3144,7 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
|
|
|
2982
3144
|
}
|
|
2983
3145
|
)
|
|
2984
3146
|
] }, entry.id)),
|
|
2985
|
-
!readOnly && /* @__PURE__ */
|
|
3147
|
+
!readOnly && /* @__PURE__ */ jsx16(
|
|
2986
3148
|
"button",
|
|
2987
3149
|
{
|
|
2988
3150
|
type: "button",
|
|
@@ -2991,9 +3153,9 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
|
|
|
2991
3153
|
children: "+ Add config key"
|
|
2992
3154
|
}
|
|
2993
3155
|
),
|
|
2994
|
-
row.blocks.length > 0 ? /* @__PURE__ */
|
|
2995
|
-
/* @__PURE__ */
|
|
2996
|
-
row.blocks.map((block, bi) => /* @__PURE__ */
|
|
3156
|
+
row.blocks.length > 0 ? /* @__PURE__ */ jsxs15(Fragment8, { children: [
|
|
3157
|
+
/* @__PURE__ */ jsx16("div", { className: "lace-panel-row-sublabel", children: "Nested blocks (read-only)" }),
|
|
3158
|
+
row.blocks.map((block, bi) => /* @__PURE__ */ jsx16(
|
|
2997
3159
|
"div",
|
|
2998
3160
|
{
|
|
2999
3161
|
className: "lace-panel-depends-item",
|
|
@@ -3003,21 +3165,21 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
|
|
|
3003
3165
|
))
|
|
3004
3166
|
] }) : null
|
|
3005
3167
|
] }, row.id)),
|
|
3006
|
-
!readOnly && /* @__PURE__ */
|
|
3007
|
-
/* @__PURE__ */
|
|
3008
|
-
/* @__PURE__ */
|
|
3168
|
+
!readOnly && /* @__PURE__ */ jsxs15(Fragment8, { children: [
|
|
3169
|
+
/* @__PURE__ */ jsx16("button", { type: "button", onClick: addProvider, className: "lace-panel-add-btn", children: "+ Add provider" }),
|
|
3170
|
+
/* @__PURE__ */ jsx16(SaveButton, { status: saveStatus, label: "Save providers", onClick: handleSave })
|
|
3009
3171
|
] })
|
|
3010
3172
|
] });
|
|
3011
3173
|
}
|
|
3012
3174
|
function ProvidersPanel({ providers, readOnly = false, onSave, onClose }) {
|
|
3013
|
-
return /* @__PURE__ */
|
|
3175
|
+
return /* @__PURE__ */ jsx16(Panel10, { title: "Providers", onClose, children: /* @__PURE__ */ jsx16(ProvidersContent, { providers, readOnly, onSave }) });
|
|
3014
3176
|
}
|
|
3015
3177
|
|
|
3016
3178
|
// src/components/panels/TerraformConfigPanel.tsx
|
|
3017
3179
|
import { Input as Input8, Panel as Panel11 } from "@lace-cloud/ui";
|
|
3018
3180
|
import { useCallback as useCallback11, useState as useState13 } from "react";
|
|
3019
3181
|
import "./panels-shared-LLLB7PR4.css";
|
|
3020
|
-
import { Fragment as Fragment9, jsx as
|
|
3182
|
+
import { Fragment as Fragment9, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3021
3183
|
function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
|
|
3022
3184
|
const [requiredVersion, setRequiredVersion] = useState13(terraform?.required_version ?? "");
|
|
3023
3185
|
const [providers, setProviders] = useState13(() => {
|
|
@@ -3059,9 +3221,9 @@ function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
|
|
|
3059
3221
|
await onSave(block);
|
|
3060
3222
|
}, [onSave, requiredVersion, providers])
|
|
3061
3223
|
);
|
|
3062
|
-
return /* @__PURE__ */
|
|
3063
|
-
/* @__PURE__ */
|
|
3064
|
-
/* @__PURE__ */
|
|
3224
|
+
return /* @__PURE__ */ jsxs16(Fragment9, { children: [
|
|
3225
|
+
/* @__PURE__ */ jsx17("h4", { className: "lace-panel-section-title", children: "Required Version" }),
|
|
3226
|
+
/* @__PURE__ */ jsx17("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx17(
|
|
3065
3227
|
Input8,
|
|
3066
3228
|
{
|
|
3067
3229
|
value: requiredVersion,
|
|
@@ -3071,10 +3233,10 @@ function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
|
|
|
3071
3233
|
readOnly
|
|
3072
3234
|
}
|
|
3073
3235
|
) }),
|
|
3074
|
-
/* @__PURE__ */
|
|
3075
|
-
providers.map((p, i) => /* @__PURE__ */
|
|
3076
|
-
/* @__PURE__ */
|
|
3077
|
-
/* @__PURE__ */
|
|
3236
|
+
/* @__PURE__ */ jsx17("h4", { className: "lace-panel-section-title", children: "Required Providers" }),
|
|
3237
|
+
providers.map((p, i) => /* @__PURE__ */ jsxs16("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
3238
|
+
/* @__PURE__ */ jsxs16("div", { className: "lace-panel-row-actions", children: [
|
|
3239
|
+
/* @__PURE__ */ jsx17(
|
|
3078
3240
|
Input8,
|
|
3079
3241
|
{
|
|
3080
3242
|
value: p.name,
|
|
@@ -3084,7 +3246,7 @@ function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
|
|
|
3084
3246
|
readOnly
|
|
3085
3247
|
}
|
|
3086
3248
|
),
|
|
3087
|
-
!readOnly && /* @__PURE__ */
|
|
3249
|
+
!readOnly && /* @__PURE__ */ jsx17(
|
|
3088
3250
|
"button",
|
|
3089
3251
|
{
|
|
3090
3252
|
type: "button",
|
|
@@ -3094,7 +3256,7 @@ function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
|
|
|
3094
3256
|
}
|
|
3095
3257
|
)
|
|
3096
3258
|
] }),
|
|
3097
|
-
/* @__PURE__ */
|
|
3259
|
+
/* @__PURE__ */ jsx17("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx17(
|
|
3098
3260
|
Input8,
|
|
3099
3261
|
{
|
|
3100
3262
|
value: p.source,
|
|
@@ -3104,7 +3266,7 @@ function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
|
|
|
3104
3266
|
readOnly
|
|
3105
3267
|
}
|
|
3106
3268
|
) }),
|
|
3107
|
-
/* @__PURE__ */
|
|
3269
|
+
/* @__PURE__ */ jsx17("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx17(
|
|
3108
3270
|
Input8,
|
|
3109
3271
|
{
|
|
3110
3272
|
value: p.version,
|
|
@@ -3114,7 +3276,7 @@ function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
|
|
|
3114
3276
|
readOnly
|
|
3115
3277
|
}
|
|
3116
3278
|
) }),
|
|
3117
|
-
p.configuration_aliases.length > 0 && /* @__PURE__ */
|
|
3279
|
+
p.configuration_aliases.length > 0 && /* @__PURE__ */ jsx17("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx17(
|
|
3118
3280
|
Input8,
|
|
3119
3281
|
{
|
|
3120
3282
|
value: p.configuration_aliases.join(", "),
|
|
@@ -3125,18 +3287,18 @@ function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
|
|
|
3125
3287
|
}
|
|
3126
3288
|
) })
|
|
3127
3289
|
] }, p.id)),
|
|
3128
|
-
!readOnly && /* @__PURE__ */
|
|
3129
|
-
/* @__PURE__ */
|
|
3130
|
-
/* @__PURE__ */
|
|
3131
|
-
!readOnly && /* @__PURE__ */
|
|
3290
|
+
!readOnly && /* @__PURE__ */ jsx17("button", { type: "button", onClick: addProvider, className: "lace-panel-add-btn", children: "+ Add provider" }),
|
|
3291
|
+
/* @__PURE__ */ jsx17("h4", { className: "lace-panel-section-title", children: "Backend" }),
|
|
3292
|
+
/* @__PURE__ */ jsx17("div", { className: "lace-panel-hint", children: "Terraform state is managed by Lace Cloud. The HTTP backend is configured automatically during generation." }),
|
|
3293
|
+
!readOnly && /* @__PURE__ */ jsx17(SaveButton, { status: saveStatus, label: "Save configuration", onClick: handleSave })
|
|
3132
3294
|
] });
|
|
3133
3295
|
}
|
|
3134
3296
|
function TerraformConfigPanel({ terraform, onSave, onClose }) {
|
|
3135
|
-
return /* @__PURE__ */
|
|
3297
|
+
return /* @__PURE__ */ jsx17(Panel11, { title: "Terraform Configuration", onClose, children: /* @__PURE__ */ jsx17(TerraformConfigContent, { terraform, onSave }) });
|
|
3136
3298
|
}
|
|
3137
3299
|
|
|
3138
3300
|
// src/components/panels/UnifiedSettingsPanel.tsx
|
|
3139
|
-
import { jsx as
|
|
3301
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3140
3302
|
function UnifiedSettingsPanel({ engine, onClose, onSaved }) {
|
|
3141
3303
|
const { state, readOnly } = useCanvas();
|
|
3142
3304
|
const [settings, setSettings] = useState14(null);
|
|
@@ -3154,11 +3316,11 @@ function UnifiedSettingsPanel({ engine, onClose, onSaved }) {
|
|
|
3154
3316
|
};
|
|
3155
3317
|
}, [engine]);
|
|
3156
3318
|
if (loading || !settings) {
|
|
3157
|
-
return /* @__PURE__ */
|
|
3319
|
+
return /* @__PURE__ */ jsx18(Panel12, { title: "Settings", scrollable: false, onClose, children: /* @__PURE__ */ jsx18("div", { className: "lace-panel-hint", children: "Loading settings..." }) });
|
|
3158
3320
|
}
|
|
3159
|
-
return /* @__PURE__ */
|
|
3160
|
-
/* @__PURE__ */
|
|
3161
|
-
/* @__PURE__ */
|
|
3321
|
+
return /* @__PURE__ */ jsxs17(Panel12, { title: "Settings", scrollable: false, onClose, children: [
|
|
3322
|
+
/* @__PURE__ */ jsx18(AccordionSection, { title: "Module", defaultOpen: true, children: /* @__PURE__ */ jsx18(ModuleMetadataContent, { engine, readOnly, onSaved }) }),
|
|
3323
|
+
/* @__PURE__ */ jsx18(AccordionSection, { title: "Interface", children: /* @__PURE__ */ jsx18(
|
|
3162
3324
|
ModuleInterfaceContent,
|
|
3163
3325
|
{
|
|
3164
3326
|
settings,
|
|
@@ -3174,7 +3336,7 @@ function UnifiedSettingsPanel({ engine, onClose, onSaved }) {
|
|
|
3174
3336
|
}
|
|
3175
3337
|
}
|
|
3176
3338
|
) }),
|
|
3177
|
-
/* @__PURE__ */
|
|
3339
|
+
/* @__PURE__ */ jsx18(AccordionSection, { title: "Terraform Config", children: /* @__PURE__ */ jsx18(
|
|
3178
3340
|
TerraformConfigContent,
|
|
3179
3341
|
{
|
|
3180
3342
|
terraform: settings.terraform,
|
|
@@ -3193,7 +3355,7 @@ function UnifiedSettingsPanel({ engine, onClose, onSaved }) {
|
|
|
3193
3355
|
}
|
|
3194
3356
|
}
|
|
3195
3357
|
) }),
|
|
3196
|
-
/* @__PURE__ */
|
|
3358
|
+
/* @__PURE__ */ jsx18(AccordionSection, { title: "Providers", children: /* @__PURE__ */ jsx18(
|
|
3197
3359
|
ProvidersContent,
|
|
3198
3360
|
{
|
|
3199
3361
|
providers: settings.providers,
|
|
@@ -3211,7 +3373,7 @@ function UnifiedSettingsPanel({ engine, onClose, onSaved }) {
|
|
|
3211
3373
|
}
|
|
3212
3374
|
}
|
|
3213
3375
|
) }),
|
|
3214
|
-
/* @__PURE__ */
|
|
3376
|
+
/* @__PURE__ */ jsx18(AccordionSection, { title: "Locals", children: /* @__PURE__ */ jsx18(
|
|
3215
3377
|
LocalsContent,
|
|
3216
3378
|
{
|
|
3217
3379
|
locals: settings.locals,
|
|
@@ -3234,7 +3396,7 @@ function UnifiedSettingsPanel({ engine, onClose, onSaved }) {
|
|
|
3234
3396
|
}
|
|
3235
3397
|
}
|
|
3236
3398
|
) }),
|
|
3237
|
-
/* @__PURE__ */
|
|
3399
|
+
/* @__PURE__ */ jsx18(AccordionSection, { title: "Environments", children: /* @__PURE__ */ jsx18(
|
|
3238
3400
|
EnvironmentsContent,
|
|
3239
3401
|
{
|
|
3240
3402
|
environments: settings.environments,
|
|
@@ -3250,7 +3412,7 @@ function UnifiedSettingsPanel({ engine, onClose, onSaved }) {
|
|
|
3250
3412
|
|
|
3251
3413
|
// src/components/SlidePanel.tsx
|
|
3252
3414
|
import { useEffect as useEffect9, useRef as useRef4, useState as useState15 } from "react";
|
|
3253
|
-
import { jsx as
|
|
3415
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
3254
3416
|
function SlidePanel({ open, zIndex = 20, children }) {
|
|
3255
3417
|
const [mounted, setMounted] = useState15(open);
|
|
3256
3418
|
const [visible, setVisible] = useState15(false);
|
|
@@ -3267,7 +3429,7 @@ function SlidePanel({ open, zIndex = 20, children }) {
|
|
|
3267
3429
|
return () => clearTimeout(timeoutRef.current);
|
|
3268
3430
|
}, [open]);
|
|
3269
3431
|
if (!mounted) return null;
|
|
3270
|
-
return /* @__PURE__ */
|
|
3432
|
+
return /* @__PURE__ */ jsx19(
|
|
3271
3433
|
"div",
|
|
3272
3434
|
{
|
|
3273
3435
|
className: "slide-panel",
|
|
@@ -3280,7 +3442,7 @@ function SlidePanel({ open, zIndex = 20, children }) {
|
|
|
3280
3442
|
// src/components/ValidationErrorBanner.tsx
|
|
3281
3443
|
import { useState as useState16 } from "react";
|
|
3282
3444
|
import "./ValidationErrorBanner-G6TBGMK7.css";
|
|
3283
|
-
import { Fragment as Fragment10, jsx as
|
|
3445
|
+
import { Fragment as Fragment10, jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3284
3446
|
function ValidationErrorDialog({
|
|
3285
3447
|
diagnostics,
|
|
3286
3448
|
nodeIds,
|
|
@@ -3288,7 +3450,7 @@ function ValidationErrorDialog({
|
|
|
3288
3450
|
onOpenFile,
|
|
3289
3451
|
onClose
|
|
3290
3452
|
}) {
|
|
3291
|
-
return /* @__PURE__ */
|
|
3453
|
+
return /* @__PURE__ */ jsx20(
|
|
3292
3454
|
"div",
|
|
3293
3455
|
{
|
|
3294
3456
|
className: "lace-error-dialog-backdrop",
|
|
@@ -3297,7 +3459,7 @@ function ValidationErrorDialog({
|
|
|
3297
3459
|
if (e.key === "Escape") onClose();
|
|
3298
3460
|
},
|
|
3299
3461
|
role: "presentation",
|
|
3300
|
-
children: /* @__PURE__ */
|
|
3462
|
+
children: /* @__PURE__ */ jsxs18(
|
|
3301
3463
|
"div",
|
|
3302
3464
|
{
|
|
3303
3465
|
className: "lace-error-dialog",
|
|
@@ -3307,13 +3469,13 @@ function ValidationErrorDialog({
|
|
|
3307
3469
|
onClick: (e) => e.stopPropagation(),
|
|
3308
3470
|
onKeyDown: (e) => e.stopPropagation(),
|
|
3309
3471
|
children: [
|
|
3310
|
-
/* @__PURE__ */
|
|
3311
|
-
/* @__PURE__ */
|
|
3472
|
+
/* @__PURE__ */ jsxs18("header", { className: "lace-error-dialog__header", children: [
|
|
3473
|
+
/* @__PURE__ */ jsxs18("h2", { id: "lace-error-dialog-title", className: "lace-error-dialog__title", children: [
|
|
3312
3474
|
"Terraform Validation Errors (",
|
|
3313
3475
|
diagnostics.length,
|
|
3314
3476
|
")"
|
|
3315
3477
|
] }),
|
|
3316
|
-
/* @__PURE__ */
|
|
3478
|
+
/* @__PURE__ */ jsx20(
|
|
3317
3479
|
"button",
|
|
3318
3480
|
{
|
|
3319
3481
|
type: "button",
|
|
@@ -3325,7 +3487,7 @@ function ValidationErrorDialog({
|
|
|
3325
3487
|
}
|
|
3326
3488
|
)
|
|
3327
3489
|
] }),
|
|
3328
|
-
/* @__PURE__ */
|
|
3490
|
+
/* @__PURE__ */ jsx20("div", { className: "lace-error-dialog__list", children: diagnostics.map((d, i) => {
|
|
3329
3491
|
const nodeId = extractNodeId(d, nodeIds);
|
|
3330
3492
|
const hasFileLink = !!d.file;
|
|
3331
3493
|
return (
|
|
@@ -3333,9 +3495,9 @@ function ValidationErrorDialog({
|
|
|
3333
3495
|
// no reordering, no editing, no per-row state. Index keys
|
|
3334
3496
|
// are stable for the lifetime of this render.
|
|
3335
3497
|
// biome-ignore lint/suspicious/noArrayIndexKey: immutable diagnostic snapshot, no row state
|
|
3336
|
-
/* @__PURE__ */
|
|
3337
|
-
/* @__PURE__ */
|
|
3338
|
-
hasFileLink && /* @__PURE__ */
|
|
3498
|
+
/* @__PURE__ */ jsxs18("div", { className: "lace-error-dialog__item", children: [
|
|
3499
|
+
/* @__PURE__ */ jsx20("div", { className: "lace-error-dialog__item-message", children: d.message }),
|
|
3500
|
+
hasFileLink && /* @__PURE__ */ jsxs18(
|
|
3339
3501
|
"button",
|
|
3340
3502
|
{
|
|
3341
3503
|
type: "button",
|
|
@@ -3349,7 +3511,7 @@ function ValidationErrorDialog({
|
|
|
3349
3511
|
]
|
|
3350
3512
|
}
|
|
3351
3513
|
),
|
|
3352
|
-
nodeId && /* @__PURE__ */
|
|
3514
|
+
nodeId && /* @__PURE__ */ jsx20(
|
|
3353
3515
|
"button",
|
|
3354
3516
|
{
|
|
3355
3517
|
type: "button",
|
|
@@ -3376,9 +3538,9 @@ function ValidationErrorBanner({
|
|
|
3376
3538
|
}) {
|
|
3377
3539
|
const [dialogOpen, setDialogOpen] = useState16(false);
|
|
3378
3540
|
if (diagnostics.length === 0) return null;
|
|
3379
|
-
return /* @__PURE__ */
|
|
3380
|
-
/* @__PURE__ */
|
|
3381
|
-
/* @__PURE__ */
|
|
3541
|
+
return /* @__PURE__ */ jsxs18(Fragment10, { children: [
|
|
3542
|
+
/* @__PURE__ */ jsxs18("div", { className: "lace-error-banner", role: "status", children: [
|
|
3543
|
+
/* @__PURE__ */ jsx20(
|
|
3382
3544
|
"svg",
|
|
3383
3545
|
{
|
|
3384
3546
|
className: "lace-error-banner__icon",
|
|
@@ -3387,11 +3549,11 @@ function ValidationErrorBanner({
|
|
|
3387
3549
|
viewBox: "0 0 16 16",
|
|
3388
3550
|
fill: "currentColor",
|
|
3389
3551
|
"aria-hidden": "true",
|
|
3390
|
-
children: /* @__PURE__ */
|
|
3552
|
+
children: /* @__PURE__ */ jsx20("path", { d: "M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zm0 3.5c.28 0 .5.22.5.5v3a.5.5 0 0 1-1 0V5c0-.28.22-.5.5-.5zm0 6a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5z" })
|
|
3391
3553
|
}
|
|
3392
3554
|
),
|
|
3393
|
-
/* @__PURE__ */
|
|
3394
|
-
/* @__PURE__ */
|
|
3555
|
+
/* @__PURE__ */ jsx20("span", { className: "lace-error-banner__message", children: "Terraform validation failed" }),
|
|
3556
|
+
/* @__PURE__ */ jsx20(
|
|
3395
3557
|
"button",
|
|
3396
3558
|
{
|
|
3397
3559
|
type: "button",
|
|
@@ -3400,7 +3562,7 @@ function ValidationErrorBanner({
|
|
|
3400
3562
|
children: "View details"
|
|
3401
3563
|
}
|
|
3402
3564
|
),
|
|
3403
|
-
/* @__PURE__ */
|
|
3565
|
+
/* @__PURE__ */ jsx20(
|
|
3404
3566
|
"button",
|
|
3405
3567
|
{
|
|
3406
3568
|
type: "button",
|
|
@@ -3412,7 +3574,7 @@ function ValidationErrorBanner({
|
|
|
3412
3574
|
}
|
|
3413
3575
|
)
|
|
3414
3576
|
] }),
|
|
3415
|
-
dialogOpen && /* @__PURE__ */
|
|
3577
|
+
dialogOpen && /* @__PURE__ */ jsx20(
|
|
3416
3578
|
ValidationErrorDialog,
|
|
3417
3579
|
{
|
|
3418
3580
|
diagnostics,
|
|
@@ -3444,8 +3606,47 @@ function extractNodeId(d, nodeIds) {
|
|
|
3444
3606
|
}
|
|
3445
3607
|
|
|
3446
3608
|
// src/hooks/useClipboard.ts
|
|
3609
|
+
import { resolveScopePositions as resolveScopePositions2 } from "@lace-cloud/proto";
|
|
3447
3610
|
import { useCallback as useCallback12, useEffect as useEffect10, useRef as useRef5 } from "react";
|
|
3448
|
-
function
|
|
3611
|
+
function placeCreatedClones(arrangement, sourceIds, created) {
|
|
3612
|
+
const parentPath = sourceIds.length > 0 ? splitCanvasPath(sourceIds[0]).parentPath : "";
|
|
3613
|
+
const byScope = /* @__PURE__ */ new Map();
|
|
3614
|
+
for (const ref of created) {
|
|
3615
|
+
if (!ref.sourceId) continue;
|
|
3616
|
+
const list = byScope.get(ref.scope) ?? [];
|
|
3617
|
+
list.push(ref);
|
|
3618
|
+
byScope.set(ref.scope, list);
|
|
3619
|
+
}
|
|
3620
|
+
let next = arrangement;
|
|
3621
|
+
const clonePaths = [];
|
|
3622
|
+
for (const [scopeKey, refs] of byScope) {
|
|
3623
|
+
const scopeEntry = next[scopeKey] ?? {};
|
|
3624
|
+
const sourcePositions = /* @__PURE__ */ new Map();
|
|
3625
|
+
for (const ref of refs) {
|
|
3626
|
+
const pos = scopeEntry.nodes?.[ref.sourceId];
|
|
3627
|
+
if (pos) sourcePositions.set(ref.sourceId, pos);
|
|
3628
|
+
}
|
|
3629
|
+
const xs = [...sourcePositions.values()].map((p) => p.x);
|
|
3630
|
+
const ys = [...sourcePositions.values()].map((p) => p.y);
|
|
3631
|
+
const minX = xs.length > 0 ? Math.min(...xs) : 0;
|
|
3632
|
+
const minY = ys.length > 0 ? Math.min(...ys) : 0;
|
|
3633
|
+
const existingIds = Object.keys(scopeEntry.nodes ?? {});
|
|
3634
|
+
const anchorMap = resolveScopePositions2([...existingIds, "__paste_anchor__"], scopeEntry.nodes);
|
|
3635
|
+
const anchor = anchorMap.get("__paste_anchor__") ?? { x: 0, y: 0 };
|
|
3636
|
+
const newNodes = {};
|
|
3637
|
+
for (const ref of refs) {
|
|
3638
|
+
const src = sourcePositions.get(ref.sourceId) ?? { x: minX, y: minY };
|
|
3639
|
+
newNodes[ref.id] = { x: anchor.x + (src.x - minX), y: anchor.y + (src.y - minY) };
|
|
3640
|
+
clonePaths.push(parentPath ? `${parentPath}.${ref.id}` : ref.id);
|
|
3641
|
+
}
|
|
3642
|
+
next = setScopeEntry(next, scopeKey, {
|
|
3643
|
+
...scopeEntry,
|
|
3644
|
+
nodes: { ...scopeEntry.nodes, ...newNodes }
|
|
3645
|
+
});
|
|
3646
|
+
}
|
|
3647
|
+
return { arrangement: next, clonePaths };
|
|
3648
|
+
}
|
|
3649
|
+
function useClipboard(engine, arrangement, updateArrangement, showToast, getSelectedIds, selectNodes, getContextMenuNodeId, dismissContextMenu, readOnly) {
|
|
3449
3650
|
const clipboardRef = useRef5([]);
|
|
3450
3651
|
const isCutRef = useRef5(false);
|
|
3451
3652
|
const onCopy = useCallback12(() => {
|
|
@@ -3484,18 +3685,20 @@ function useClipboard(engine, view, showToast, getSelectedIds, selectNodes, getC
|
|
|
3484
3685
|
}
|
|
3485
3686
|
const ids = clipboardRef.current;
|
|
3486
3687
|
try {
|
|
3487
|
-
const prevIds = new Set((view?.nodes ?? []).map((n) => n.id));
|
|
3488
3688
|
const result = await engine.copyInstances(ids);
|
|
3489
3689
|
if (!result.success) {
|
|
3490
3690
|
showToast(result.errors[0]?.message ?? "Paste failed", "error");
|
|
3491
3691
|
return;
|
|
3492
3692
|
}
|
|
3493
|
-
const
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3693
|
+
const created = result.created.filter((c) => c.sourceId);
|
|
3694
|
+
if (created.length === 0) {
|
|
3695
|
+
if (!isCutRef.current) {
|
|
3696
|
+
showToast("Paste produced no new nodes \u2014 nothing pasted", "error");
|
|
3697
|
+
}
|
|
3698
|
+
} else {
|
|
3699
|
+
const { arrangement: next, clonePaths } = placeCreatedClones(arrangement, ids, created);
|
|
3700
|
+
updateArrangement(next);
|
|
3701
|
+
selectNodes(clonePaths);
|
|
3499
3702
|
}
|
|
3500
3703
|
if (isCutRef.current) {
|
|
3501
3704
|
for (const id of ids) {
|
|
@@ -3512,7 +3715,7 @@ function useClipboard(engine, view, showToast, getSelectedIds, selectNodes, getC
|
|
|
3512
3715
|
console.error("[Canvas] paste failed:", err);
|
|
3513
3716
|
showToast("Paste failed \u2014 try again", "error");
|
|
3514
3717
|
}
|
|
3515
|
-
}, [engine,
|
|
3718
|
+
}, [engine, arrangement, updateArrangement, showToast, selectNodes, dismissContextMenu]);
|
|
3516
3719
|
useEffect10(() => {
|
|
3517
3720
|
if (readOnly) return;
|
|
3518
3721
|
window.__canvasCopy = onCopy;
|
|
@@ -3616,6 +3819,7 @@ function useGenerationStatus(showToast) {
|
|
|
3616
3819
|
}
|
|
3617
3820
|
case "stateUpdated":
|
|
3618
3821
|
case "policyResolution":
|
|
3822
|
+
case "loadError":
|
|
3619
3823
|
return;
|
|
3620
3824
|
default:
|
|
3621
3825
|
assertNever(event);
|
|
@@ -3764,6 +3968,7 @@ function useGroupLogic(nodes, edges, groups, newNodeIds, erroredNodeIds) {
|
|
|
3764
3968
|
hidden: hiddenByAncestor,
|
|
3765
3969
|
data: {
|
|
3766
3970
|
groupId: group.id,
|
|
3971
|
+
moduleKey: group.module_key ?? "",
|
|
3767
3972
|
label: group.label,
|
|
3768
3973
|
memberCount: memberNodes.length,
|
|
3769
3974
|
collapsed: true,
|
|
@@ -3795,6 +4000,7 @@ function useGroupLogic(nodes, edges, groups, newNodeIds, erroredNodeIds) {
|
|
|
3795
4000
|
},
|
|
3796
4001
|
data: {
|
|
3797
4002
|
groupId: group.id,
|
|
4003
|
+
moduleKey: group.module_key ?? "",
|
|
3798
4004
|
label: group.label,
|
|
3799
4005
|
memberCount: memberNodes.length,
|
|
3800
4006
|
collapsed: false,
|
|
@@ -4078,17 +4284,8 @@ function parseHandleId(handleId, prefix) {
|
|
|
4078
4284
|
return name.length > 0 ? name : null;
|
|
4079
4285
|
}
|
|
4080
4286
|
|
|
4081
|
-
// src/utils/view-state.ts
|
|
4082
|
-
function applyLocalGroupCollapseOverrides(view, overrides, readOnly) {
|
|
4083
|
-
if (!readOnly || Object.keys(overrides).length === 0) return view;
|
|
4084
|
-
return {
|
|
4085
|
-
...view,
|
|
4086
|
-
groups: view.groups.map((g) => g.id in overrides ? { ...g, collapsed: overrides[g.id] } : g)
|
|
4087
|
-
};
|
|
4088
|
-
}
|
|
4089
|
-
|
|
4090
4287
|
// src/Canvas.tsx
|
|
4091
|
-
import { jsx as
|
|
4288
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4092
4289
|
var nodeTypes = {
|
|
4093
4290
|
moduleNode: ModuleNode_default,
|
|
4094
4291
|
groupNode: GroupNode_default
|
|
@@ -4242,7 +4439,7 @@ function CompositeEditor({
|
|
|
4242
4439
|
},
|
|
4243
4440
|
animated: false
|
|
4244
4441
|
};
|
|
4245
|
-
return /* @__PURE__ */
|
|
4442
|
+
return /* @__PURE__ */ jsxs19(
|
|
4246
4443
|
ReactFlow,
|
|
4247
4444
|
{
|
|
4248
4445
|
nodes: rfNodes,
|
|
@@ -4313,7 +4510,7 @@ function CompositeEditor({
|
|
|
4313
4510
|
proOptions: { hideAttribution: true },
|
|
4314
4511
|
style: { background: "var(--lace-color-bg-canvas)" },
|
|
4315
4512
|
children: [
|
|
4316
|
-
showMiniMap ? /* @__PURE__ */
|
|
4513
|
+
showMiniMap ? /* @__PURE__ */ jsx21(
|
|
4317
4514
|
MiniMap,
|
|
4318
4515
|
{
|
|
4319
4516
|
position: "bottom-left",
|
|
@@ -4328,7 +4525,7 @@ function CompositeEditor({
|
|
|
4328
4525
|
nodeColor: "var(--lace-color-accent)"
|
|
4329
4526
|
}
|
|
4330
4527
|
) : null,
|
|
4331
|
-
/* @__PURE__ */
|
|
4528
|
+
/* @__PURE__ */ jsx21(
|
|
4332
4529
|
Controls,
|
|
4333
4530
|
{
|
|
4334
4531
|
position: "bottom-right",
|
|
@@ -4337,7 +4534,7 @@ function CompositeEditor({
|
|
|
4337
4534
|
style: { bottom: 20, right: 20 }
|
|
4338
4535
|
}
|
|
4339
4536
|
),
|
|
4340
|
-
/* @__PURE__ */
|
|
4537
|
+
/* @__PURE__ */ jsx21(
|
|
4341
4538
|
ActionBar,
|
|
4342
4539
|
{
|
|
4343
4540
|
readOnly,
|
|
@@ -4354,17 +4551,17 @@ function CompositeEditor({
|
|
|
4354
4551
|
onToggleMiniMap
|
|
4355
4552
|
}
|
|
4356
4553
|
),
|
|
4357
|
-
/* @__PURE__ */
|
|
4358
|
-
/* @__PURE__ */
|
|
4359
|
-
/* @__PURE__ */
|
|
4554
|
+
/* @__PURE__ */ jsxs19("svg", { children: [
|
|
4555
|
+
/* @__PURE__ */ jsx21("defs", { children: /* @__PURE__ */ jsx21("pattern", { id: "grid", width: "20", height: "20", patternUnits: "userSpaceOnUse", children: /* @__PURE__ */ jsx21("circle", { cx: "1", cy: "1", r: "0.5", fill: gridColor }) }) }),
|
|
4556
|
+
/* @__PURE__ */ jsx21("rect", { width: "100%", height: "100%", fill: "url(#grid)" })
|
|
4360
4557
|
] }),
|
|
4361
|
-
nodesInitialized ? /* @__PURE__ */
|
|
4558
|
+
nodesInitialized ? /* @__PURE__ */ jsx21("div", { hidden: true, "data-rendered": "" }) : null
|
|
4362
4559
|
]
|
|
4363
4560
|
}
|
|
4364
4561
|
);
|
|
4365
4562
|
}
|
|
4366
4563
|
function Canvas({ height, registryBaseUrl, apiToken }) {
|
|
4367
|
-
const { state, readOnly,
|
|
4564
|
+
const { state, readOnly, arrangement, updateArrangement } = useCanvas();
|
|
4368
4565
|
const engine = useEngine();
|
|
4369
4566
|
const viewRef = useRef8(state.view);
|
|
4370
4567
|
viewRef.current = state.view;
|
|
@@ -4402,7 +4599,8 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
|
|
|
4402
4599
|
}, []);
|
|
4403
4600
|
const { onCopy, onCut, onPaste } = useClipboard(
|
|
4404
4601
|
engine,
|
|
4405
|
-
|
|
4602
|
+
arrangement,
|
|
4603
|
+
updateArrangement,
|
|
4406
4604
|
showToast,
|
|
4407
4605
|
useCallback20(() => getSelectedIdsRef.current?.() ?? [], []),
|
|
4408
4606
|
useCallback20((ids) => selectNodesRef.current?.(ids), []),
|
|
@@ -4439,11 +4637,12 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
|
|
|
4439
4637
|
};
|
|
4440
4638
|
}, [onUndo, readOnly]);
|
|
4441
4639
|
const onDragStop = useCallback20(
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4640
|
+
(positions) => {
|
|
4641
|
+
const bundle = engine.getCurrentBundle();
|
|
4642
|
+
if (!bundle) return;
|
|
4643
|
+
updateArrangement(withNodePositions(bundle, arrangement, positions));
|
|
4445
4644
|
},
|
|
4446
|
-
[engine,
|
|
4645
|
+
[engine, arrangement, updateArrangement]
|
|
4447
4646
|
);
|
|
4448
4647
|
const onConnect = useCallback20(
|
|
4449
4648
|
async (conn) => {
|
|
@@ -4505,20 +4704,91 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
|
|
|
4505
4704
|
},
|
|
4506
4705
|
[engine, showToast]
|
|
4507
4706
|
);
|
|
4707
|
+
const onGroupSelected = useCallback20(async () => {
|
|
4708
|
+
const ids = getSelectedIdsRef.current?.() ?? [];
|
|
4709
|
+
const bundle = engine.getCurrentBundle();
|
|
4710
|
+
if (ids.length < 2 || !bundle) return;
|
|
4711
|
+
try {
|
|
4712
|
+
const label = `Group ${ids.length}`;
|
|
4713
|
+
const result = await engine.createGroup(ids);
|
|
4714
|
+
if (!result.success) {
|
|
4715
|
+
showToast(result.errors[0]?.message ?? "Failed to create group", "error");
|
|
4716
|
+
return;
|
|
4717
|
+
}
|
|
4718
|
+
const created = result.created[0];
|
|
4719
|
+
if (created?.moduleKey) {
|
|
4720
|
+
const migratedNodes = {};
|
|
4721
|
+
const memberPositions = [];
|
|
4722
|
+
for (const id of ids) {
|
|
4723
|
+
const scopeKey = scopeKeyForCanvasPath(bundle, id);
|
|
4724
|
+
const { localId } = splitCanvasPath(id);
|
|
4725
|
+
const position = scopeKey ? arrangement[scopeKey]?.nodes?.[localId] : void 0;
|
|
4726
|
+
if (position) {
|
|
4727
|
+
migratedNodes[localId] = position;
|
|
4728
|
+
memberPositions.push(position);
|
|
4729
|
+
}
|
|
4730
|
+
}
|
|
4731
|
+
let next = setScopeEntry(arrangement, created.moduleKey, { nodes: migratedNodes });
|
|
4732
|
+
const parentEntry = next[created.scope] ?? {};
|
|
4733
|
+
next = setScopeEntry(next, created.scope, {
|
|
4734
|
+
...parentEntry,
|
|
4735
|
+
groups: { ...parentEntry.groups, [created.id]: { label, collapsed: true } }
|
|
4736
|
+
});
|
|
4737
|
+
if (memberPositions.length > 0) {
|
|
4738
|
+
const centroid = {
|
|
4739
|
+
x: memberPositions.reduce((sum, p) => sum + p.x, 0) / memberPositions.length,
|
|
4740
|
+
y: memberPositions.reduce((sum, p) => sum + p.y, 0) / memberPositions.length
|
|
4741
|
+
};
|
|
4742
|
+
const parentEntryWithGroup = next[created.scope] ?? {};
|
|
4743
|
+
next = setScopeEntry(next, created.scope, {
|
|
4744
|
+
...parentEntryWithGroup,
|
|
4745
|
+
nodes: { ...parentEntryWithGroup.nodes, [created.id]: centroid }
|
|
4746
|
+
});
|
|
4747
|
+
}
|
|
4748
|
+
updateArrangement(next);
|
|
4749
|
+
}
|
|
4750
|
+
dismissContextMenu();
|
|
4751
|
+
} catch (err) {
|
|
4752
|
+
showToast(`Failed to create group: ${err.message}`, "error");
|
|
4753
|
+
}
|
|
4754
|
+
}, [engine, arrangement, updateArrangement, dismissContextMenu, showToast]);
|
|
4755
|
+
const performUngroup = useCallback20(
|
|
4756
|
+
async (groupId) => {
|
|
4757
|
+
const bundle = engine.getCurrentBundle();
|
|
4758
|
+
const group = state.view?.groups.find((g) => g.id === groupId);
|
|
4759
|
+
try {
|
|
4760
|
+
const result = await engine.ungroup(groupId);
|
|
4761
|
+
if (!result.success) {
|
|
4762
|
+
showToast(result.errors[0]?.message ?? "Failed to ungroup", "error");
|
|
4763
|
+
return;
|
|
4764
|
+
}
|
|
4765
|
+
if (bundle && group?.module_key) {
|
|
4766
|
+
updateArrangement(
|
|
4767
|
+
migrateUngroup(bundle, arrangement, groupId, group.module_key, result.created)
|
|
4768
|
+
);
|
|
4769
|
+
}
|
|
4770
|
+
dismissContextMenu();
|
|
4771
|
+
} catch (err) {
|
|
4772
|
+
showToast(`Failed to ungroup: ${err.message}`, "error");
|
|
4773
|
+
}
|
|
4774
|
+
},
|
|
4775
|
+
[engine, arrangement, updateArrangement, state.view, dismissContextMenu, showToast]
|
|
4776
|
+
);
|
|
4508
4777
|
const onNodesDelete = useCallback20(
|
|
4509
4778
|
async (nodes) => {
|
|
4510
4779
|
if (!engine) return;
|
|
4511
4780
|
for (const node of nodes) {
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4781
|
+
if (node.type === "groupNode") {
|
|
4782
|
+
await performUngroup(node.id);
|
|
4783
|
+
continue;
|
|
4784
|
+
}
|
|
4785
|
+
const result = await engine.deleteInstance(node.id);
|
|
4516
4786
|
if (!result.success) {
|
|
4517
4787
|
showToast(result.errors[0]?.message ?? "Delete failed", "error");
|
|
4518
4788
|
}
|
|
4519
4789
|
}
|
|
4520
4790
|
},
|
|
4521
|
-
[engine, showToast]
|
|
4791
|
+
[engine, performUngroup, showToast]
|
|
4522
4792
|
);
|
|
4523
4793
|
const onClearGraph = useCallback20(async () => {
|
|
4524
4794
|
if (!engine || !state.view) return;
|
|
@@ -4537,39 +4807,11 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
|
|
|
4537
4807
|
const onOpenPolicy = useCallback20(() => {
|
|
4538
4808
|
setPolicyOpen(true);
|
|
4539
4809
|
}, []);
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
try {
|
|
4544
|
-
const label = `Group ${ids.length}`;
|
|
4545
|
-
const result = await engine.createGroup(label, ids);
|
|
4546
|
-
if (!result.success) {
|
|
4547
|
-
showToast(result.errors[0]?.message ?? "Failed to create group", "error");
|
|
4548
|
-
return;
|
|
4549
|
-
}
|
|
4550
|
-
dismissContextMenu();
|
|
4551
|
-
} catch (err) {
|
|
4552
|
-
showToast(`Failed to create group: ${err.message}`, "error");
|
|
4553
|
-
}
|
|
4554
|
-
}, [engine, dismissContextMenu, showToast]);
|
|
4555
|
-
const onUngroup = useCallback20(
|
|
4556
|
-
async (groupId) => {
|
|
4557
|
-
if (!engine) return;
|
|
4558
|
-
try {
|
|
4559
|
-
const result = await engine.deleteGroup(groupId);
|
|
4560
|
-
if (!result.success) {
|
|
4561
|
-
showToast(result.errors[0]?.message ?? "Failed to ungroup", "error");
|
|
4562
|
-
return;
|
|
4563
|
-
}
|
|
4564
|
-
dismissContextMenu();
|
|
4565
|
-
} catch (err) {
|
|
4566
|
-
showToast(`Failed to ungroup: ${err.message}`, "error");
|
|
4567
|
-
}
|
|
4568
|
-
},
|
|
4569
|
-
[engine, dismissContextMenu, showToast]
|
|
4570
|
-
);
|
|
4810
|
+
if (state.loadError) {
|
|
4811
|
+
return /* @__PURE__ */ jsx21(ErrorState, { message: state.loadError });
|
|
4812
|
+
}
|
|
4571
4813
|
if (state.loading || !state.view) {
|
|
4572
|
-
return /* @__PURE__ */
|
|
4814
|
+
return /* @__PURE__ */ jsx21(
|
|
4573
4815
|
"div",
|
|
4574
4816
|
{
|
|
4575
4817
|
style: {
|
|
@@ -4584,14 +4826,10 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
|
|
|
4584
4826
|
}
|
|
4585
4827
|
);
|
|
4586
4828
|
}
|
|
4587
|
-
const view =
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
);
|
|
4592
|
-
return /* @__PURE__ */ jsxs18("div", { style: { position: "relative", display: "flex", flexDirection: "column", height }, children: [
|
|
4593
|
-
/* @__PURE__ */ jsx20(Toast, { toast }),
|
|
4594
|
-
/* @__PURE__ */ jsx20(
|
|
4829
|
+
const view = state.view;
|
|
4830
|
+
return /* @__PURE__ */ jsxs19("div", { style: { position: "relative", display: "flex", flexDirection: "column", height }, children: [
|
|
4831
|
+
/* @__PURE__ */ jsx21(Toast, { toast }),
|
|
4832
|
+
/* @__PURE__ */ jsx21(
|
|
4595
4833
|
ContextMenu,
|
|
4596
4834
|
{
|
|
4597
4835
|
contextMenu,
|
|
@@ -4599,11 +4837,11 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
|
|
|
4599
4837
|
onCut,
|
|
4600
4838
|
onPaste,
|
|
4601
4839
|
onGroupSelected,
|
|
4602
|
-
onUngroup,
|
|
4840
|
+
onUngroup: performUngroup,
|
|
4603
4841
|
onDismiss: dismissContextMenu
|
|
4604
4842
|
}
|
|
4605
4843
|
),
|
|
4606
|
-
!errorBannerDismissed && validationErrors.length > 0 && !toast && /* @__PURE__ */
|
|
4844
|
+
!errorBannerDismissed && validationErrors.length > 0 && !toast && /* @__PURE__ */ jsx21(
|
|
4607
4845
|
ValidationErrorBanner,
|
|
4608
4846
|
{
|
|
4609
4847
|
diagnostics: validationErrors,
|
|
@@ -4615,8 +4853,8 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
|
|
|
4615
4853
|
onDismiss: dismissErrorBanner
|
|
4616
4854
|
}
|
|
4617
4855
|
),
|
|
4618
|
-
/* @__PURE__ */
|
|
4619
|
-
/* @__PURE__ */
|
|
4856
|
+
/* @__PURE__ */ jsxs19("div", { style: { position: "relative", flex: "1 1 auto", minHeight: 0 }, children: [
|
|
4857
|
+
/* @__PURE__ */ jsx21(
|
|
4620
4858
|
CompositeEditor,
|
|
4621
4859
|
{
|
|
4622
4860
|
view,
|
|
@@ -4647,7 +4885,7 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
|
|
|
4647
4885
|
viewportIntentSeq: state.viewportIntentSeq
|
|
4648
4886
|
}
|
|
4649
4887
|
),
|
|
4650
|
-
/* @__PURE__ */
|
|
4888
|
+
/* @__PURE__ */ jsx21(SlidePanel, { open: !!configTarget, children: configTarget && /* @__PURE__ */ jsx21(
|
|
4651
4889
|
ModuleConfigPanel,
|
|
4652
4890
|
{
|
|
4653
4891
|
instance_id: configTarget,
|
|
@@ -4656,7 +4894,7 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
|
|
|
4656
4894
|
onModified: clearNew
|
|
4657
4895
|
}
|
|
4658
4896
|
) }),
|
|
4659
|
-
/* @__PURE__ */
|
|
4897
|
+
/* @__PURE__ */ jsx21(SlidePanel, { open: !!selectedEdge, zIndex: 40, children: selectedEdge && /* @__PURE__ */ jsx21(
|
|
4660
4898
|
EdgeInspectorPanel,
|
|
4661
4899
|
{
|
|
4662
4900
|
source: selectedEdge.source,
|
|
@@ -4667,7 +4905,7 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
|
|
|
4667
4905
|
onClose: clearSelectedEdge
|
|
4668
4906
|
}
|
|
4669
4907
|
) }),
|
|
4670
|
-
/* @__PURE__ */
|
|
4908
|
+
/* @__PURE__ */ jsx21(SlidePanel, { open: settingsOpen, children: settingsOpen && /* @__PURE__ */ jsx21(
|
|
4671
4909
|
UnifiedSettingsPanel,
|
|
4672
4910
|
{
|
|
4673
4911
|
engine,
|
|
@@ -4675,7 +4913,7 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
|
|
|
4675
4913
|
onSaved: () => showToast("Settings saved", "success")
|
|
4676
4914
|
}
|
|
4677
4915
|
) }),
|
|
4678
|
-
!readOnly && /* @__PURE__ */
|
|
4916
|
+
!readOnly && /* @__PURE__ */ jsx21(SlidePanel, { open: policyOpen, children: policyOpen && /* @__PURE__ */ jsx21(
|
|
4679
4917
|
PolicySidebar,
|
|
4680
4918
|
{
|
|
4681
4919
|
resolution: policyResolution,
|
|
@@ -4683,7 +4921,7 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
|
|
|
4683
4921
|
onClose: () => setPolicyOpen(false)
|
|
4684
4922
|
}
|
|
4685
4923
|
) }),
|
|
4686
|
-
canBrowseRegistry && /* @__PURE__ */
|
|
4924
|
+
canBrowseRegistry && /* @__PURE__ */ jsx21(SlidePanel, { open: registryOpen, children: registryOpen && /* @__PURE__ */ jsx21(
|
|
4687
4925
|
RegistryBrowser,
|
|
4688
4926
|
{
|
|
4689
4927
|
engine,
|
|
@@ -4697,41 +4935,6 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
|
|
|
4697
4935
|
] });
|
|
4698
4936
|
}
|
|
4699
4937
|
|
|
4700
|
-
// src/components/ErrorBoundary.tsx
|
|
4701
|
-
import React from "react";
|
|
4702
|
-
import "./ErrorBoundary-IXSIVZFH.css";
|
|
4703
|
-
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4704
|
-
function ErrorState({ message }) {
|
|
4705
|
-
return /* @__PURE__ */ jsxs19("div", { className: "lace-error-state", role: "alert", children: [
|
|
4706
|
-
/* @__PURE__ */ jsx21("h3", { className: "lace-error-state__title", children: "Something went wrong" }),
|
|
4707
|
-
/* @__PURE__ */ jsx21("pre", { className: "lace-error-state__message", children: message }),
|
|
4708
|
-
/* @__PURE__ */ jsx21(
|
|
4709
|
-
"button",
|
|
4710
|
-
{
|
|
4711
|
-
type: "button",
|
|
4712
|
-
className: "lace-error-state__reload",
|
|
4713
|
-
onClick: () => window.location.reload(),
|
|
4714
|
-
children: "Reload"
|
|
4715
|
-
}
|
|
4716
|
-
)
|
|
4717
|
-
] });
|
|
4718
|
-
}
|
|
4719
|
-
var ErrorBoundary = class extends React.Component {
|
|
4720
|
-
constructor() {
|
|
4721
|
-
super(...arguments);
|
|
4722
|
-
this.state = { error: null };
|
|
4723
|
-
}
|
|
4724
|
-
static getDerivedStateFromError(error) {
|
|
4725
|
-
return { error };
|
|
4726
|
-
}
|
|
4727
|
-
render() {
|
|
4728
|
-
if (this.state.error) {
|
|
4729
|
-
return /* @__PURE__ */ jsx21(ErrorState, { message: this.state.error.message });
|
|
4730
|
-
}
|
|
4731
|
-
return this.props.children;
|
|
4732
|
-
}
|
|
4733
|
-
};
|
|
4734
|
-
|
|
4735
4938
|
// src/hooks/useWindowEvent.ts
|
|
4736
4939
|
import { useEffect as useEffect16, useRef as useRef9 } from "react";
|
|
4737
4940
|
function useWindowEvent(eventName, handler, options) {
|
|
@@ -4757,19 +4960,30 @@ function App({
|
|
|
4757
4960
|
height = "100vh",
|
|
4758
4961
|
readOnly = false,
|
|
4759
4962
|
registryBaseUrl,
|
|
4760
|
-
apiToken
|
|
4963
|
+
apiToken,
|
|
4964
|
+
arrangement: initialArrangement,
|
|
4965
|
+
onArrangementChange
|
|
4761
4966
|
}) {
|
|
4762
4967
|
const [state, setState] = useState24({
|
|
4763
4968
|
view: null,
|
|
4764
4969
|
loading: true,
|
|
4765
4970
|
generation: 0,
|
|
4766
4971
|
viewportIntent: null,
|
|
4767
|
-
viewportIntentSeq: 0
|
|
4972
|
+
viewportIntentSeq: 0,
|
|
4973
|
+
loadError: null
|
|
4768
4974
|
});
|
|
4769
|
-
const [
|
|
4770
|
-
const
|
|
4771
|
-
|
|
4772
|
-
|
|
4975
|
+
const [arrangement, setArrangementState] = useState24(initialArrangement ?? {});
|
|
4976
|
+
const updateArrangement = useCallback21(
|
|
4977
|
+
(next) => {
|
|
4978
|
+
setArrangementState(next);
|
|
4979
|
+
engine.setArrangement(next);
|
|
4980
|
+
onArrangementChange?.(next);
|
|
4981
|
+
},
|
|
4982
|
+
[engine, onArrangementChange]
|
|
4983
|
+
);
|
|
4984
|
+
useEffect17(() => {
|
|
4985
|
+
engine.setArrangement(arrangement);
|
|
4986
|
+
}, [engine]);
|
|
4773
4987
|
const refitOnNextStateRef = useRef10(true);
|
|
4774
4988
|
useEffect17(() => {
|
|
4775
4989
|
refitOnNextStateRef.current = true;
|
|
@@ -4783,11 +4997,23 @@ function App({
|
|
|
4783
4997
|
loading: false,
|
|
4784
4998
|
generation: prev.generation + 1,
|
|
4785
4999
|
viewportIntent,
|
|
4786
|
-
viewportIntentSeq: prev.viewportIntentSeq + (viewportIntent ? 1 : 0)
|
|
5000
|
+
viewportIntentSeq: prev.viewportIntentSeq + (viewportIntent ? 1 : 0),
|
|
5001
|
+
loadError: null
|
|
4787
5002
|
}));
|
|
5003
|
+
const bundle = engine.getCurrentBundle();
|
|
5004
|
+
if (bundle) {
|
|
5005
|
+
setArrangementState((prev) => {
|
|
5006
|
+
const gced = gcArrangement(bundle, prev);
|
|
5007
|
+
if (gced === prev) return prev;
|
|
5008
|
+
onArrangementChange?.(gced);
|
|
5009
|
+
return gced;
|
|
5010
|
+
});
|
|
5011
|
+
}
|
|
5012
|
+
} else if (event.type === "loadError") {
|
|
5013
|
+
setState((prev) => ({ ...prev, loading: false, loadError: event.message }));
|
|
4788
5014
|
}
|
|
4789
5015
|
});
|
|
4790
|
-
}, [engine]);
|
|
5016
|
+
}, [engine, onArrangementChange]);
|
|
4791
5017
|
const isDirty = state.view?.is_dirty;
|
|
4792
5018
|
useEffect17(() => {
|
|
4793
5019
|
if (isDirty === void 0) return;
|
|
@@ -4812,8 +5038,8 @@ function App({
|
|
|
4812
5038
|
state,
|
|
4813
5039
|
engine,
|
|
4814
5040
|
readOnly,
|
|
4815
|
-
|
|
4816
|
-
|
|
5041
|
+
arrangement,
|
|
5042
|
+
updateArrangement
|
|
4817
5043
|
},
|
|
4818
5044
|
children: /* @__PURE__ */ jsx22(ReactFlowProvider, { children: /* @__PURE__ */ jsx22(Canvas, { height, registryBaseUrl, apiToken }) })
|
|
4819
5045
|
}
|
|
@@ -7927,7 +8153,7 @@ var TerraformBlock_RequiredProvidersEntry = {
|
|
|
7927
8153
|
}
|
|
7928
8154
|
};
|
|
7929
8155
|
function createBaseProviderRequirement() {
|
|
7930
|
-
return { source: "", version: "" };
|
|
8156
|
+
return { source: "", version: "", configuration_aliases: [] };
|
|
7931
8157
|
}
|
|
7932
8158
|
var ProviderRequirement = {
|
|
7933
8159
|
encode(message, writer = new BinaryWriter3()) {
|
|
@@ -7937,6 +8163,9 @@ var ProviderRequirement = {
|
|
|
7937
8163
|
if (message.version !== "") {
|
|
7938
8164
|
writer.uint32(18).string(message.version);
|
|
7939
8165
|
}
|
|
8166
|
+
for (const v of message.configuration_aliases) {
|
|
8167
|
+
writer.uint32(26).string(v);
|
|
8168
|
+
}
|
|
7940
8169
|
return writer;
|
|
7941
8170
|
},
|
|
7942
8171
|
decode(input, length) {
|
|
@@ -7960,6 +8189,13 @@ var ProviderRequirement = {
|
|
|
7960
8189
|
message.version = reader.string();
|
|
7961
8190
|
continue;
|
|
7962
8191
|
}
|
|
8192
|
+
case 3: {
|
|
8193
|
+
if (tag !== 26) {
|
|
8194
|
+
break;
|
|
8195
|
+
}
|
|
8196
|
+
message.configuration_aliases.push(reader.string());
|
|
8197
|
+
continue;
|
|
8198
|
+
}
|
|
7963
8199
|
}
|
|
7964
8200
|
if ((tag & 7) === 4 || tag === 0) {
|
|
7965
8201
|
break;
|
|
@@ -7971,7 +8207,8 @@ var ProviderRequirement = {
|
|
|
7971
8207
|
fromJSON(object) {
|
|
7972
8208
|
return {
|
|
7973
8209
|
source: isSet2(object.source) ? globalThis.String(object.source) : "",
|
|
7974
|
-
version: isSet2(object.version) ? globalThis.String(object.version) : ""
|
|
8210
|
+
version: isSet2(object.version) ? globalThis.String(object.version) : "",
|
|
8211
|
+
configuration_aliases: globalThis.Array.isArray(object?.configurationAliases) ? object.configurationAliases.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.configuration_aliases) ? object.configuration_aliases.map((e) => globalThis.String(e)) : []
|
|
7975
8212
|
};
|
|
7976
8213
|
},
|
|
7977
8214
|
toJSON(message) {
|
|
@@ -7982,6 +8219,9 @@ var ProviderRequirement = {
|
|
|
7982
8219
|
if (message.version !== "") {
|
|
7983
8220
|
obj.version = message.version;
|
|
7984
8221
|
}
|
|
8222
|
+
if (message.configuration_aliases?.length) {
|
|
8223
|
+
obj.configurationAliases = message.configuration_aliases;
|
|
8224
|
+
}
|
|
7985
8225
|
return obj;
|
|
7986
8226
|
},
|
|
7987
8227
|
create(base) {
|
|
@@ -7991,6 +8231,7 @@ var ProviderRequirement = {
|
|
|
7991
8231
|
const message = createBaseProviderRequirement();
|
|
7992
8232
|
message.source = object.source ?? "";
|
|
7993
8233
|
message.version = object.version ?? "";
|
|
8234
|
+
message.configuration_aliases = object.configuration_aliases?.map((e) => e) || [];
|
|
7994
8235
|
return message;
|
|
7995
8236
|
}
|
|
7996
8237
|
};
|
|
@@ -8344,617 +8585,6 @@ var ProviderConfig_ConfigEntry = {
|
|
|
8344
8585
|
return message;
|
|
8345
8586
|
}
|
|
8346
8587
|
};
|
|
8347
|
-
function createBaseGraphLayout() {
|
|
8348
|
-
return { nodes: {}, groups: {} };
|
|
8349
|
-
}
|
|
8350
|
-
var GraphLayout = {
|
|
8351
|
-
encode(message, writer = new BinaryWriter3()) {
|
|
8352
|
-
globalThis.Object.entries(message.nodes).forEach(([key, value]) => {
|
|
8353
|
-
GraphLayout_NodesEntry.encode({ key, value }, writer.uint32(10).fork()).join();
|
|
8354
|
-
});
|
|
8355
|
-
globalThis.Object.entries(message.groups).forEach(([key, value]) => {
|
|
8356
|
-
GraphLayout_GroupsEntry.encode({ key, value }, writer.uint32(18).fork()).join();
|
|
8357
|
-
});
|
|
8358
|
-
return writer;
|
|
8359
|
-
},
|
|
8360
|
-
decode(input, length) {
|
|
8361
|
-
const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
|
|
8362
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8363
|
-
const message = createBaseGraphLayout();
|
|
8364
|
-
while (reader.pos < end) {
|
|
8365
|
-
const tag = reader.uint32();
|
|
8366
|
-
switch (tag >>> 3) {
|
|
8367
|
-
case 1: {
|
|
8368
|
-
if (tag !== 10) {
|
|
8369
|
-
break;
|
|
8370
|
-
}
|
|
8371
|
-
const entry1 = GraphLayout_NodesEntry.decode(reader, reader.uint32());
|
|
8372
|
-
if (entry1.value !== void 0) {
|
|
8373
|
-
message.nodes[entry1.key] = entry1.value;
|
|
8374
|
-
}
|
|
8375
|
-
continue;
|
|
8376
|
-
}
|
|
8377
|
-
case 2: {
|
|
8378
|
-
if (tag !== 18) {
|
|
8379
|
-
break;
|
|
8380
|
-
}
|
|
8381
|
-
const entry2 = GraphLayout_GroupsEntry.decode(reader, reader.uint32());
|
|
8382
|
-
if (entry2.value !== void 0) {
|
|
8383
|
-
message.groups[entry2.key] = entry2.value;
|
|
8384
|
-
}
|
|
8385
|
-
continue;
|
|
8386
|
-
}
|
|
8387
|
-
}
|
|
8388
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
8389
|
-
break;
|
|
8390
|
-
}
|
|
8391
|
-
reader.skip(tag & 7);
|
|
8392
|
-
}
|
|
8393
|
-
return message;
|
|
8394
|
-
},
|
|
8395
|
-
fromJSON(object) {
|
|
8396
|
-
return {
|
|
8397
|
-
nodes: isObject2(object.nodes) ? globalThis.Object.entries(object.nodes).reduce(
|
|
8398
|
-
(acc, [key, value]) => {
|
|
8399
|
-
acc[key] = NodeLayout.fromJSON(value);
|
|
8400
|
-
return acc;
|
|
8401
|
-
},
|
|
8402
|
-
{}
|
|
8403
|
-
) : {},
|
|
8404
|
-
groups: isObject2(object.groups) ? globalThis.Object.entries(object.groups).reduce(
|
|
8405
|
-
(acc, [key, value]) => {
|
|
8406
|
-
acc[key] = NodeGroup.fromJSON(value);
|
|
8407
|
-
return acc;
|
|
8408
|
-
},
|
|
8409
|
-
{}
|
|
8410
|
-
) : {}
|
|
8411
|
-
};
|
|
8412
|
-
},
|
|
8413
|
-
toJSON(message) {
|
|
8414
|
-
const obj = {};
|
|
8415
|
-
if (message.nodes) {
|
|
8416
|
-
const entries = globalThis.Object.entries(message.nodes);
|
|
8417
|
-
if (entries.length > 0) {
|
|
8418
|
-
obj.nodes = {};
|
|
8419
|
-
entries.forEach(([k, v]) => {
|
|
8420
|
-
obj.nodes[k] = NodeLayout.toJSON(v);
|
|
8421
|
-
});
|
|
8422
|
-
}
|
|
8423
|
-
}
|
|
8424
|
-
if (message.groups) {
|
|
8425
|
-
const entries = globalThis.Object.entries(message.groups);
|
|
8426
|
-
if (entries.length > 0) {
|
|
8427
|
-
obj.groups = {};
|
|
8428
|
-
entries.forEach(([k, v]) => {
|
|
8429
|
-
obj.groups[k] = NodeGroup.toJSON(v);
|
|
8430
|
-
});
|
|
8431
|
-
}
|
|
8432
|
-
}
|
|
8433
|
-
return obj;
|
|
8434
|
-
},
|
|
8435
|
-
create(base) {
|
|
8436
|
-
return GraphLayout.fromPartial(base ?? {});
|
|
8437
|
-
},
|
|
8438
|
-
fromPartial(object) {
|
|
8439
|
-
const message = createBaseGraphLayout();
|
|
8440
|
-
message.nodes = globalThis.Object.entries(object.nodes ?? {}).reduce(
|
|
8441
|
-
(acc, [key, value]) => {
|
|
8442
|
-
if (value !== void 0) {
|
|
8443
|
-
acc[key] = NodeLayout.fromPartial(value);
|
|
8444
|
-
}
|
|
8445
|
-
return acc;
|
|
8446
|
-
},
|
|
8447
|
-
{}
|
|
8448
|
-
);
|
|
8449
|
-
message.groups = globalThis.Object.entries(object.groups ?? {}).reduce(
|
|
8450
|
-
(acc, [key, value]) => {
|
|
8451
|
-
if (value !== void 0) {
|
|
8452
|
-
acc[key] = NodeGroup.fromPartial(value);
|
|
8453
|
-
}
|
|
8454
|
-
return acc;
|
|
8455
|
-
},
|
|
8456
|
-
{}
|
|
8457
|
-
);
|
|
8458
|
-
return message;
|
|
8459
|
-
}
|
|
8460
|
-
};
|
|
8461
|
-
function createBaseGraphLayout_NodesEntry() {
|
|
8462
|
-
return { key: "", value: void 0 };
|
|
8463
|
-
}
|
|
8464
|
-
var GraphLayout_NodesEntry = {
|
|
8465
|
-
encode(message, writer = new BinaryWriter3()) {
|
|
8466
|
-
if (message.key !== "") {
|
|
8467
|
-
writer.uint32(10).string(message.key);
|
|
8468
|
-
}
|
|
8469
|
-
if (message.value !== void 0) {
|
|
8470
|
-
NodeLayout.encode(message.value, writer.uint32(18).fork()).join();
|
|
8471
|
-
}
|
|
8472
|
-
return writer;
|
|
8473
|
-
},
|
|
8474
|
-
decode(input, length) {
|
|
8475
|
-
const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
|
|
8476
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8477
|
-
const message = createBaseGraphLayout_NodesEntry();
|
|
8478
|
-
while (reader.pos < end) {
|
|
8479
|
-
const tag = reader.uint32();
|
|
8480
|
-
switch (tag >>> 3) {
|
|
8481
|
-
case 1: {
|
|
8482
|
-
if (tag !== 10) {
|
|
8483
|
-
break;
|
|
8484
|
-
}
|
|
8485
|
-
message.key = reader.string();
|
|
8486
|
-
continue;
|
|
8487
|
-
}
|
|
8488
|
-
case 2: {
|
|
8489
|
-
if (tag !== 18) {
|
|
8490
|
-
break;
|
|
8491
|
-
}
|
|
8492
|
-
message.value = NodeLayout.decode(reader, reader.uint32());
|
|
8493
|
-
continue;
|
|
8494
|
-
}
|
|
8495
|
-
}
|
|
8496
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
8497
|
-
break;
|
|
8498
|
-
}
|
|
8499
|
-
reader.skip(tag & 7);
|
|
8500
|
-
}
|
|
8501
|
-
return message;
|
|
8502
|
-
},
|
|
8503
|
-
fromJSON(object) {
|
|
8504
|
-
return {
|
|
8505
|
-
key: isSet2(object.key) ? globalThis.String(object.key) : "",
|
|
8506
|
-
value: isSet2(object.value) ? NodeLayout.fromJSON(object.value) : void 0
|
|
8507
|
-
};
|
|
8508
|
-
},
|
|
8509
|
-
toJSON(message) {
|
|
8510
|
-
const obj = {};
|
|
8511
|
-
if (message.key !== "") {
|
|
8512
|
-
obj.key = message.key;
|
|
8513
|
-
}
|
|
8514
|
-
if (message.value !== void 0) {
|
|
8515
|
-
obj.value = NodeLayout.toJSON(message.value);
|
|
8516
|
-
}
|
|
8517
|
-
return obj;
|
|
8518
|
-
},
|
|
8519
|
-
create(base) {
|
|
8520
|
-
return GraphLayout_NodesEntry.fromPartial(base ?? {});
|
|
8521
|
-
},
|
|
8522
|
-
fromPartial(object) {
|
|
8523
|
-
const message = createBaseGraphLayout_NodesEntry();
|
|
8524
|
-
message.key = object.key ?? "";
|
|
8525
|
-
message.value = object.value !== void 0 && object.value !== null ? NodeLayout.fromPartial(object.value) : void 0;
|
|
8526
|
-
return message;
|
|
8527
|
-
}
|
|
8528
|
-
};
|
|
8529
|
-
function createBaseGraphLayout_GroupsEntry() {
|
|
8530
|
-
return { key: "", value: void 0 };
|
|
8531
|
-
}
|
|
8532
|
-
var GraphLayout_GroupsEntry = {
|
|
8533
|
-
encode(message, writer = new BinaryWriter3()) {
|
|
8534
|
-
if (message.key !== "") {
|
|
8535
|
-
writer.uint32(10).string(message.key);
|
|
8536
|
-
}
|
|
8537
|
-
if (message.value !== void 0) {
|
|
8538
|
-
NodeGroup.encode(message.value, writer.uint32(18).fork()).join();
|
|
8539
|
-
}
|
|
8540
|
-
return writer;
|
|
8541
|
-
},
|
|
8542
|
-
decode(input, length) {
|
|
8543
|
-
const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
|
|
8544
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8545
|
-
const message = createBaseGraphLayout_GroupsEntry();
|
|
8546
|
-
while (reader.pos < end) {
|
|
8547
|
-
const tag = reader.uint32();
|
|
8548
|
-
switch (tag >>> 3) {
|
|
8549
|
-
case 1: {
|
|
8550
|
-
if (tag !== 10) {
|
|
8551
|
-
break;
|
|
8552
|
-
}
|
|
8553
|
-
message.key = reader.string();
|
|
8554
|
-
continue;
|
|
8555
|
-
}
|
|
8556
|
-
case 2: {
|
|
8557
|
-
if (tag !== 18) {
|
|
8558
|
-
break;
|
|
8559
|
-
}
|
|
8560
|
-
message.value = NodeGroup.decode(reader, reader.uint32());
|
|
8561
|
-
continue;
|
|
8562
|
-
}
|
|
8563
|
-
}
|
|
8564
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
8565
|
-
break;
|
|
8566
|
-
}
|
|
8567
|
-
reader.skip(tag & 7);
|
|
8568
|
-
}
|
|
8569
|
-
return message;
|
|
8570
|
-
},
|
|
8571
|
-
fromJSON(object) {
|
|
8572
|
-
return {
|
|
8573
|
-
key: isSet2(object.key) ? globalThis.String(object.key) : "",
|
|
8574
|
-
value: isSet2(object.value) ? NodeGroup.fromJSON(object.value) : void 0
|
|
8575
|
-
};
|
|
8576
|
-
},
|
|
8577
|
-
toJSON(message) {
|
|
8578
|
-
const obj = {};
|
|
8579
|
-
if (message.key !== "") {
|
|
8580
|
-
obj.key = message.key;
|
|
8581
|
-
}
|
|
8582
|
-
if (message.value !== void 0) {
|
|
8583
|
-
obj.value = NodeGroup.toJSON(message.value);
|
|
8584
|
-
}
|
|
8585
|
-
return obj;
|
|
8586
|
-
},
|
|
8587
|
-
create(base) {
|
|
8588
|
-
return GraphLayout_GroupsEntry.fromPartial(base ?? {});
|
|
8589
|
-
},
|
|
8590
|
-
fromPartial(object) {
|
|
8591
|
-
const message = createBaseGraphLayout_GroupsEntry();
|
|
8592
|
-
message.key = object.key ?? "";
|
|
8593
|
-
message.value = object.value !== void 0 && object.value !== null ? NodeGroup.fromPartial(object.value) : void 0;
|
|
8594
|
-
return message;
|
|
8595
|
-
}
|
|
8596
|
-
};
|
|
8597
|
-
function createBaseNodeGroup() {
|
|
8598
|
-
return { id: "", label: "", node_ids: [], collapsed: false };
|
|
8599
|
-
}
|
|
8600
|
-
var NodeGroup = {
|
|
8601
|
-
encode(message, writer = new BinaryWriter3()) {
|
|
8602
|
-
if (message.id !== "") {
|
|
8603
|
-
writer.uint32(10).string(message.id);
|
|
8604
|
-
}
|
|
8605
|
-
if (message.label !== "") {
|
|
8606
|
-
writer.uint32(18).string(message.label);
|
|
8607
|
-
}
|
|
8608
|
-
for (const v of message.node_ids) {
|
|
8609
|
-
writer.uint32(26).string(v);
|
|
8610
|
-
}
|
|
8611
|
-
if (message.collapsed !== false) {
|
|
8612
|
-
writer.uint32(32).bool(message.collapsed);
|
|
8613
|
-
}
|
|
8614
|
-
return writer;
|
|
8615
|
-
},
|
|
8616
|
-
decode(input, length) {
|
|
8617
|
-
const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
|
|
8618
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8619
|
-
const message = createBaseNodeGroup();
|
|
8620
|
-
while (reader.pos < end) {
|
|
8621
|
-
const tag = reader.uint32();
|
|
8622
|
-
switch (tag >>> 3) {
|
|
8623
|
-
case 1: {
|
|
8624
|
-
if (tag !== 10) {
|
|
8625
|
-
break;
|
|
8626
|
-
}
|
|
8627
|
-
message.id = reader.string();
|
|
8628
|
-
continue;
|
|
8629
|
-
}
|
|
8630
|
-
case 2: {
|
|
8631
|
-
if (tag !== 18) {
|
|
8632
|
-
break;
|
|
8633
|
-
}
|
|
8634
|
-
message.label = reader.string();
|
|
8635
|
-
continue;
|
|
8636
|
-
}
|
|
8637
|
-
case 3: {
|
|
8638
|
-
if (tag !== 26) {
|
|
8639
|
-
break;
|
|
8640
|
-
}
|
|
8641
|
-
message.node_ids.push(reader.string());
|
|
8642
|
-
continue;
|
|
8643
|
-
}
|
|
8644
|
-
case 4: {
|
|
8645
|
-
if (tag !== 32) {
|
|
8646
|
-
break;
|
|
8647
|
-
}
|
|
8648
|
-
message.collapsed = reader.bool();
|
|
8649
|
-
continue;
|
|
8650
|
-
}
|
|
8651
|
-
}
|
|
8652
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
8653
|
-
break;
|
|
8654
|
-
}
|
|
8655
|
-
reader.skip(tag & 7);
|
|
8656
|
-
}
|
|
8657
|
-
return message;
|
|
8658
|
-
},
|
|
8659
|
-
fromJSON(object) {
|
|
8660
|
-
return {
|
|
8661
|
-
id: isSet2(object.id) ? globalThis.String(object.id) : "",
|
|
8662
|
-
label: isSet2(object.label) ? globalThis.String(object.label) : "",
|
|
8663
|
-
node_ids: globalThis.Array.isArray(object?.nodeIds) ? object.nodeIds.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.node_ids) ? object.node_ids.map((e) => globalThis.String(e)) : [],
|
|
8664
|
-
collapsed: isSet2(object.collapsed) ? globalThis.Boolean(object.collapsed) : false
|
|
8665
|
-
};
|
|
8666
|
-
},
|
|
8667
|
-
toJSON(message) {
|
|
8668
|
-
const obj = {};
|
|
8669
|
-
if (message.id !== "") {
|
|
8670
|
-
obj.id = message.id;
|
|
8671
|
-
}
|
|
8672
|
-
if (message.label !== "") {
|
|
8673
|
-
obj.label = message.label;
|
|
8674
|
-
}
|
|
8675
|
-
if (message.node_ids?.length) {
|
|
8676
|
-
obj.nodeIds = message.node_ids;
|
|
8677
|
-
}
|
|
8678
|
-
if (message.collapsed !== false) {
|
|
8679
|
-
obj.collapsed = message.collapsed;
|
|
8680
|
-
}
|
|
8681
|
-
return obj;
|
|
8682
|
-
},
|
|
8683
|
-
create(base) {
|
|
8684
|
-
return NodeGroup.fromPartial(base ?? {});
|
|
8685
|
-
},
|
|
8686
|
-
fromPartial(object) {
|
|
8687
|
-
const message = createBaseNodeGroup();
|
|
8688
|
-
message.id = object.id ?? "";
|
|
8689
|
-
message.label = object.label ?? "";
|
|
8690
|
-
message.node_ids = object.node_ids?.map((e) => e) || [];
|
|
8691
|
-
message.collapsed = object.collapsed ?? false;
|
|
8692
|
-
return message;
|
|
8693
|
-
}
|
|
8694
|
-
};
|
|
8695
|
-
function createBaseNodeLayout() {
|
|
8696
|
-
return { position: void 0 };
|
|
8697
|
-
}
|
|
8698
|
-
var NodeLayout = {
|
|
8699
|
-
encode(message, writer = new BinaryWriter3()) {
|
|
8700
|
-
if (message.position !== void 0) {
|
|
8701
|
-
Position3.encode(message.position, writer.uint32(10).fork()).join();
|
|
8702
|
-
}
|
|
8703
|
-
return writer;
|
|
8704
|
-
},
|
|
8705
|
-
decode(input, length) {
|
|
8706
|
-
const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
|
|
8707
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8708
|
-
const message = createBaseNodeLayout();
|
|
8709
|
-
while (reader.pos < end) {
|
|
8710
|
-
const tag = reader.uint32();
|
|
8711
|
-
switch (tag >>> 3) {
|
|
8712
|
-
case 1: {
|
|
8713
|
-
if (tag !== 10) {
|
|
8714
|
-
break;
|
|
8715
|
-
}
|
|
8716
|
-
message.position = Position3.decode(reader, reader.uint32());
|
|
8717
|
-
continue;
|
|
8718
|
-
}
|
|
8719
|
-
}
|
|
8720
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
8721
|
-
break;
|
|
8722
|
-
}
|
|
8723
|
-
reader.skip(tag & 7);
|
|
8724
|
-
}
|
|
8725
|
-
return message;
|
|
8726
|
-
},
|
|
8727
|
-
fromJSON(object) {
|
|
8728
|
-
return { position: isSet2(object.position) ? Position3.fromJSON(object.position) : void 0 };
|
|
8729
|
-
},
|
|
8730
|
-
toJSON(message) {
|
|
8731
|
-
const obj = {};
|
|
8732
|
-
if (message.position !== void 0) {
|
|
8733
|
-
obj.position = Position3.toJSON(message.position);
|
|
8734
|
-
}
|
|
8735
|
-
return obj;
|
|
8736
|
-
},
|
|
8737
|
-
create(base) {
|
|
8738
|
-
return NodeLayout.fromPartial(base ?? {});
|
|
8739
|
-
},
|
|
8740
|
-
fromPartial(object) {
|
|
8741
|
-
const message = createBaseNodeLayout();
|
|
8742
|
-
message.position = object.position !== void 0 && object.position !== null ? Position3.fromPartial(object.position) : void 0;
|
|
8743
|
-
return message;
|
|
8744
|
-
}
|
|
8745
|
-
};
|
|
8746
|
-
function createBasePosition() {
|
|
8747
|
-
return { x: 0, y: 0 };
|
|
8748
|
-
}
|
|
8749
|
-
var Position3 = {
|
|
8750
|
-
encode(message, writer = new BinaryWriter3()) {
|
|
8751
|
-
if (message.x !== 0) {
|
|
8752
|
-
writer.uint32(9).double(message.x);
|
|
8753
|
-
}
|
|
8754
|
-
if (message.y !== 0) {
|
|
8755
|
-
writer.uint32(17).double(message.y);
|
|
8756
|
-
}
|
|
8757
|
-
return writer;
|
|
8758
|
-
},
|
|
8759
|
-
decode(input, length) {
|
|
8760
|
-
const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
|
|
8761
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8762
|
-
const message = createBasePosition();
|
|
8763
|
-
while (reader.pos < end) {
|
|
8764
|
-
const tag = reader.uint32();
|
|
8765
|
-
switch (tag >>> 3) {
|
|
8766
|
-
case 1: {
|
|
8767
|
-
if (tag !== 9) {
|
|
8768
|
-
break;
|
|
8769
|
-
}
|
|
8770
|
-
message.x = reader.double();
|
|
8771
|
-
continue;
|
|
8772
|
-
}
|
|
8773
|
-
case 2: {
|
|
8774
|
-
if (tag !== 17) {
|
|
8775
|
-
break;
|
|
8776
|
-
}
|
|
8777
|
-
message.y = reader.double();
|
|
8778
|
-
continue;
|
|
8779
|
-
}
|
|
8780
|
-
}
|
|
8781
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
8782
|
-
break;
|
|
8783
|
-
}
|
|
8784
|
-
reader.skip(tag & 7);
|
|
8785
|
-
}
|
|
8786
|
-
return message;
|
|
8787
|
-
},
|
|
8788
|
-
fromJSON(object) {
|
|
8789
|
-
return {
|
|
8790
|
-
x: isSet2(object.x) ? globalThis.Number(object.x) : 0,
|
|
8791
|
-
y: isSet2(object.y) ? globalThis.Number(object.y) : 0
|
|
8792
|
-
};
|
|
8793
|
-
},
|
|
8794
|
-
toJSON(message) {
|
|
8795
|
-
const obj = {};
|
|
8796
|
-
if (message.x !== 0) {
|
|
8797
|
-
obj.x = message.x;
|
|
8798
|
-
}
|
|
8799
|
-
if (message.y !== 0) {
|
|
8800
|
-
obj.y = message.y;
|
|
8801
|
-
}
|
|
8802
|
-
return obj;
|
|
8803
|
-
},
|
|
8804
|
-
create(base) {
|
|
8805
|
-
return Position3.fromPartial(base ?? {});
|
|
8806
|
-
},
|
|
8807
|
-
fromPartial(object) {
|
|
8808
|
-
const message = createBasePosition();
|
|
8809
|
-
message.x = object.x ?? 0;
|
|
8810
|
-
message.y = object.y ?? 0;
|
|
8811
|
-
return message;
|
|
8812
|
-
}
|
|
8813
|
-
};
|
|
8814
|
-
function createBaseLayoutsMap() {
|
|
8815
|
-
return { layouts: {} };
|
|
8816
|
-
}
|
|
8817
|
-
var LayoutsMap = {
|
|
8818
|
-
encode(message, writer = new BinaryWriter3()) {
|
|
8819
|
-
globalThis.Object.entries(message.layouts).forEach(([key, value]) => {
|
|
8820
|
-
LayoutsMap_LayoutsEntry.encode({ key, value }, writer.uint32(10).fork()).join();
|
|
8821
|
-
});
|
|
8822
|
-
return writer;
|
|
8823
|
-
},
|
|
8824
|
-
decode(input, length) {
|
|
8825
|
-
const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
|
|
8826
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8827
|
-
const message = createBaseLayoutsMap();
|
|
8828
|
-
while (reader.pos < end) {
|
|
8829
|
-
const tag = reader.uint32();
|
|
8830
|
-
switch (tag >>> 3) {
|
|
8831
|
-
case 1: {
|
|
8832
|
-
if (tag !== 10) {
|
|
8833
|
-
break;
|
|
8834
|
-
}
|
|
8835
|
-
const entry1 = LayoutsMap_LayoutsEntry.decode(reader, reader.uint32());
|
|
8836
|
-
if (entry1.value !== void 0) {
|
|
8837
|
-
message.layouts[entry1.key] = entry1.value;
|
|
8838
|
-
}
|
|
8839
|
-
continue;
|
|
8840
|
-
}
|
|
8841
|
-
}
|
|
8842
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
8843
|
-
break;
|
|
8844
|
-
}
|
|
8845
|
-
reader.skip(tag & 7);
|
|
8846
|
-
}
|
|
8847
|
-
return message;
|
|
8848
|
-
},
|
|
8849
|
-
fromJSON(object) {
|
|
8850
|
-
return {
|
|
8851
|
-
layouts: isObject2(object.layouts) ? globalThis.Object.entries(object.layouts).reduce(
|
|
8852
|
-
(acc, [key, value]) => {
|
|
8853
|
-
acc[key] = GraphLayout.fromJSON(value);
|
|
8854
|
-
return acc;
|
|
8855
|
-
},
|
|
8856
|
-
{}
|
|
8857
|
-
) : {}
|
|
8858
|
-
};
|
|
8859
|
-
},
|
|
8860
|
-
toJSON(message) {
|
|
8861
|
-
const obj = {};
|
|
8862
|
-
if (message.layouts) {
|
|
8863
|
-
const entries = globalThis.Object.entries(message.layouts);
|
|
8864
|
-
if (entries.length > 0) {
|
|
8865
|
-
obj.layouts = {};
|
|
8866
|
-
entries.forEach(([k, v]) => {
|
|
8867
|
-
obj.layouts[k] = GraphLayout.toJSON(v);
|
|
8868
|
-
});
|
|
8869
|
-
}
|
|
8870
|
-
}
|
|
8871
|
-
return obj;
|
|
8872
|
-
},
|
|
8873
|
-
create(base) {
|
|
8874
|
-
return LayoutsMap.fromPartial(base ?? {});
|
|
8875
|
-
},
|
|
8876
|
-
fromPartial(object) {
|
|
8877
|
-
const message = createBaseLayoutsMap();
|
|
8878
|
-
message.layouts = globalThis.Object.entries(object.layouts ?? {}).reduce(
|
|
8879
|
-
(acc, [key, value]) => {
|
|
8880
|
-
if (value !== void 0) {
|
|
8881
|
-
acc[key] = GraphLayout.fromPartial(value);
|
|
8882
|
-
}
|
|
8883
|
-
return acc;
|
|
8884
|
-
},
|
|
8885
|
-
{}
|
|
8886
|
-
);
|
|
8887
|
-
return message;
|
|
8888
|
-
}
|
|
8889
|
-
};
|
|
8890
|
-
function createBaseLayoutsMap_LayoutsEntry() {
|
|
8891
|
-
return { key: "", value: void 0 };
|
|
8892
|
-
}
|
|
8893
|
-
var LayoutsMap_LayoutsEntry = {
|
|
8894
|
-
encode(message, writer = new BinaryWriter3()) {
|
|
8895
|
-
if (message.key !== "") {
|
|
8896
|
-
writer.uint32(10).string(message.key);
|
|
8897
|
-
}
|
|
8898
|
-
if (message.value !== void 0) {
|
|
8899
|
-
GraphLayout.encode(message.value, writer.uint32(18).fork()).join();
|
|
8900
|
-
}
|
|
8901
|
-
return writer;
|
|
8902
|
-
},
|
|
8903
|
-
decode(input, length) {
|
|
8904
|
-
const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
|
|
8905
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8906
|
-
const message = createBaseLayoutsMap_LayoutsEntry();
|
|
8907
|
-
while (reader.pos < end) {
|
|
8908
|
-
const tag = reader.uint32();
|
|
8909
|
-
switch (tag >>> 3) {
|
|
8910
|
-
case 1: {
|
|
8911
|
-
if (tag !== 10) {
|
|
8912
|
-
break;
|
|
8913
|
-
}
|
|
8914
|
-
message.key = reader.string();
|
|
8915
|
-
continue;
|
|
8916
|
-
}
|
|
8917
|
-
case 2: {
|
|
8918
|
-
if (tag !== 18) {
|
|
8919
|
-
break;
|
|
8920
|
-
}
|
|
8921
|
-
message.value = GraphLayout.decode(reader, reader.uint32());
|
|
8922
|
-
continue;
|
|
8923
|
-
}
|
|
8924
|
-
}
|
|
8925
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
8926
|
-
break;
|
|
8927
|
-
}
|
|
8928
|
-
reader.skip(tag & 7);
|
|
8929
|
-
}
|
|
8930
|
-
return message;
|
|
8931
|
-
},
|
|
8932
|
-
fromJSON(object) {
|
|
8933
|
-
return {
|
|
8934
|
-
key: isSet2(object.key) ? globalThis.String(object.key) : "",
|
|
8935
|
-
value: isSet2(object.value) ? GraphLayout.fromJSON(object.value) : void 0
|
|
8936
|
-
};
|
|
8937
|
-
},
|
|
8938
|
-
toJSON(message) {
|
|
8939
|
-
const obj = {};
|
|
8940
|
-
if (message.key !== "") {
|
|
8941
|
-
obj.key = message.key;
|
|
8942
|
-
}
|
|
8943
|
-
if (message.value !== void 0) {
|
|
8944
|
-
obj.value = GraphLayout.toJSON(message.value);
|
|
8945
|
-
}
|
|
8946
|
-
return obj;
|
|
8947
|
-
},
|
|
8948
|
-
create(base) {
|
|
8949
|
-
return LayoutsMap_LayoutsEntry.fromPartial(base ?? {});
|
|
8950
|
-
},
|
|
8951
|
-
fromPartial(object) {
|
|
8952
|
-
const message = createBaseLayoutsMap_LayoutsEntry();
|
|
8953
|
-
message.key = object.key ?? "";
|
|
8954
|
-
message.value = object.value !== void 0 && object.value !== null ? GraphLayout.fromPartial(object.value) : void 0;
|
|
8955
|
-
return message;
|
|
8956
|
-
}
|
|
8957
|
-
};
|
|
8958
8588
|
function createBasePolicyResolution() {
|
|
8959
8589
|
return {
|
|
8960
8590
|
mode: "",
|
|
@@ -11497,343 +11127,33 @@ var CopyInstancesAction = {
|
|
|
11497
11127
|
return obj;
|
|
11498
11128
|
},
|
|
11499
11129
|
create(base) {
|
|
11500
|
-
return CopyInstancesAction.fromPartial(base ?? {});
|
|
11501
|
-
},
|
|
11502
|
-
fromPartial(object) {
|
|
11503
|
-
const message = createBaseCopyInstancesAction();
|
|
11504
|
-
message.instance_ids = object.instance_ids?.map((e) => e) || [];
|
|
11505
|
-
return message;
|
|
11506
|
-
}
|
|
11507
|
-
};
|
|
11508
|
-
function createBaseSyncLayoutAction() {
|
|
11509
|
-
return { positions: {} };
|
|
11510
|
-
}
|
|
11511
|
-
var SyncLayoutAction = {
|
|
11512
|
-
encode(message, writer = new BinaryWriter4()) {
|
|
11513
|
-
globalThis.Object.entries(message.positions).forEach(([key, value]) => {
|
|
11514
|
-
SyncLayoutAction_PositionsEntry.encode({ key, value }, writer.uint32(10).fork()).join();
|
|
11515
|
-
});
|
|
11516
|
-
return writer;
|
|
11517
|
-
},
|
|
11518
|
-
decode(input, length) {
|
|
11519
|
-
const reader = input instanceof BinaryReader4 ? input : new BinaryReader4(input);
|
|
11520
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
11521
|
-
const message = createBaseSyncLayoutAction();
|
|
11522
|
-
while (reader.pos < end) {
|
|
11523
|
-
const tag = reader.uint32();
|
|
11524
|
-
switch (tag >>> 3) {
|
|
11525
|
-
case 1: {
|
|
11526
|
-
if (tag !== 10) {
|
|
11527
|
-
break;
|
|
11528
|
-
}
|
|
11529
|
-
const entry1 = SyncLayoutAction_PositionsEntry.decode(reader, reader.uint32());
|
|
11530
|
-
if (entry1.value !== void 0) {
|
|
11531
|
-
message.positions[entry1.key] = entry1.value;
|
|
11532
|
-
}
|
|
11533
|
-
continue;
|
|
11534
|
-
}
|
|
11535
|
-
}
|
|
11536
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
11537
|
-
break;
|
|
11538
|
-
}
|
|
11539
|
-
reader.skip(tag & 7);
|
|
11540
|
-
}
|
|
11541
|
-
return message;
|
|
11542
|
-
},
|
|
11543
|
-
fromJSON(object) {
|
|
11544
|
-
return {
|
|
11545
|
-
positions: isObject3(object.positions) ? globalThis.Object.entries(object.positions).reduce(
|
|
11546
|
-
(acc, [key, value]) => {
|
|
11547
|
-
acc[key] = Position4.fromJSON(value);
|
|
11548
|
-
return acc;
|
|
11549
|
-
},
|
|
11550
|
-
{}
|
|
11551
|
-
) : {}
|
|
11552
|
-
};
|
|
11553
|
-
},
|
|
11554
|
-
toJSON(message) {
|
|
11555
|
-
const obj = {};
|
|
11556
|
-
if (message.positions) {
|
|
11557
|
-
const entries = globalThis.Object.entries(message.positions);
|
|
11558
|
-
if (entries.length > 0) {
|
|
11559
|
-
obj.positions = {};
|
|
11560
|
-
entries.forEach(([k, v]) => {
|
|
11561
|
-
obj.positions[k] = Position4.toJSON(v);
|
|
11562
|
-
});
|
|
11563
|
-
}
|
|
11564
|
-
}
|
|
11565
|
-
return obj;
|
|
11566
|
-
},
|
|
11567
|
-
create(base) {
|
|
11568
|
-
return SyncLayoutAction.fromPartial(base ?? {});
|
|
11569
|
-
},
|
|
11570
|
-
fromPartial(object) {
|
|
11571
|
-
const message = createBaseSyncLayoutAction();
|
|
11572
|
-
message.positions = globalThis.Object.entries(object.positions ?? {}).reduce(
|
|
11573
|
-
(acc, [key, value]) => {
|
|
11574
|
-
if (value !== void 0) {
|
|
11575
|
-
acc[key] = Position4.fromPartial(value);
|
|
11576
|
-
}
|
|
11577
|
-
return acc;
|
|
11578
|
-
},
|
|
11579
|
-
{}
|
|
11580
|
-
);
|
|
11581
|
-
return message;
|
|
11582
|
-
}
|
|
11583
|
-
};
|
|
11584
|
-
function createBaseSyncLayoutAction_PositionsEntry() {
|
|
11585
|
-
return { key: "", value: void 0 };
|
|
11586
|
-
}
|
|
11587
|
-
var SyncLayoutAction_PositionsEntry = {
|
|
11588
|
-
encode(message, writer = new BinaryWriter4()) {
|
|
11589
|
-
if (message.key !== "") {
|
|
11590
|
-
writer.uint32(10).string(message.key);
|
|
11591
|
-
}
|
|
11592
|
-
if (message.value !== void 0) {
|
|
11593
|
-
Position4.encode(message.value, writer.uint32(18).fork()).join();
|
|
11594
|
-
}
|
|
11595
|
-
return writer;
|
|
11596
|
-
},
|
|
11597
|
-
decode(input, length) {
|
|
11598
|
-
const reader = input instanceof BinaryReader4 ? input : new BinaryReader4(input);
|
|
11599
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
11600
|
-
const message = createBaseSyncLayoutAction_PositionsEntry();
|
|
11601
|
-
while (reader.pos < end) {
|
|
11602
|
-
const tag = reader.uint32();
|
|
11603
|
-
switch (tag >>> 3) {
|
|
11604
|
-
case 1: {
|
|
11605
|
-
if (tag !== 10) {
|
|
11606
|
-
break;
|
|
11607
|
-
}
|
|
11608
|
-
message.key = reader.string();
|
|
11609
|
-
continue;
|
|
11610
|
-
}
|
|
11611
|
-
case 2: {
|
|
11612
|
-
if (tag !== 18) {
|
|
11613
|
-
break;
|
|
11614
|
-
}
|
|
11615
|
-
message.value = Position4.decode(reader, reader.uint32());
|
|
11616
|
-
continue;
|
|
11617
|
-
}
|
|
11618
|
-
}
|
|
11619
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
11620
|
-
break;
|
|
11621
|
-
}
|
|
11622
|
-
reader.skip(tag & 7);
|
|
11623
|
-
}
|
|
11624
|
-
return message;
|
|
11625
|
-
},
|
|
11626
|
-
fromJSON(object) {
|
|
11627
|
-
return {
|
|
11628
|
-
key: isSet3(object.key) ? globalThis.String(object.key) : "",
|
|
11629
|
-
value: isSet3(object.value) ? Position4.fromJSON(object.value) : void 0
|
|
11630
|
-
};
|
|
11631
|
-
},
|
|
11632
|
-
toJSON(message) {
|
|
11633
|
-
const obj = {};
|
|
11634
|
-
if (message.key !== "") {
|
|
11635
|
-
obj.key = message.key;
|
|
11636
|
-
}
|
|
11637
|
-
if (message.value !== void 0) {
|
|
11638
|
-
obj.value = Position4.toJSON(message.value);
|
|
11639
|
-
}
|
|
11640
|
-
return obj;
|
|
11641
|
-
},
|
|
11642
|
-
create(base) {
|
|
11643
|
-
return SyncLayoutAction_PositionsEntry.fromPartial(base ?? {});
|
|
11644
|
-
},
|
|
11645
|
-
fromPartial(object) {
|
|
11646
|
-
const message = createBaseSyncLayoutAction_PositionsEntry();
|
|
11647
|
-
message.key = object.key ?? "";
|
|
11648
|
-
message.value = object.value !== void 0 && object.value !== null ? Position4.fromPartial(object.value) : void 0;
|
|
11649
|
-
return message;
|
|
11650
|
-
}
|
|
11651
|
-
};
|
|
11652
|
-
function createBaseCreateGroupAction() {
|
|
11653
|
-
return { label: "", node_ids: [] };
|
|
11654
|
-
}
|
|
11655
|
-
var CreateGroupAction = {
|
|
11656
|
-
encode(message, writer = new BinaryWriter4()) {
|
|
11657
|
-
if (message.label !== "") {
|
|
11658
|
-
writer.uint32(10).string(message.label);
|
|
11659
|
-
}
|
|
11660
|
-
for (const v of message.node_ids) {
|
|
11661
|
-
writer.uint32(18).string(v);
|
|
11662
|
-
}
|
|
11663
|
-
return writer;
|
|
11664
|
-
},
|
|
11665
|
-
decode(input, length) {
|
|
11666
|
-
const reader = input instanceof BinaryReader4 ? input : new BinaryReader4(input);
|
|
11667
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
11668
|
-
const message = createBaseCreateGroupAction();
|
|
11669
|
-
while (reader.pos < end) {
|
|
11670
|
-
const tag = reader.uint32();
|
|
11671
|
-
switch (tag >>> 3) {
|
|
11672
|
-
case 1: {
|
|
11673
|
-
if (tag !== 10) {
|
|
11674
|
-
break;
|
|
11675
|
-
}
|
|
11676
|
-
message.label = reader.string();
|
|
11677
|
-
continue;
|
|
11678
|
-
}
|
|
11679
|
-
case 2: {
|
|
11680
|
-
if (tag !== 18) {
|
|
11681
|
-
break;
|
|
11682
|
-
}
|
|
11683
|
-
message.node_ids.push(reader.string());
|
|
11684
|
-
continue;
|
|
11685
|
-
}
|
|
11686
|
-
}
|
|
11687
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
11688
|
-
break;
|
|
11689
|
-
}
|
|
11690
|
-
reader.skip(tag & 7);
|
|
11691
|
-
}
|
|
11692
|
-
return message;
|
|
11693
|
-
},
|
|
11694
|
-
fromJSON(object) {
|
|
11695
|
-
return {
|
|
11696
|
-
label: isSet3(object.label) ? globalThis.String(object.label) : "",
|
|
11697
|
-
node_ids: globalThis.Array.isArray(object?.nodeIds) ? object.nodeIds.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.node_ids) ? object.node_ids.map((e) => globalThis.String(e)) : []
|
|
11698
|
-
};
|
|
11699
|
-
},
|
|
11700
|
-
toJSON(message) {
|
|
11701
|
-
const obj = {};
|
|
11702
|
-
if (message.label !== "") {
|
|
11703
|
-
obj.label = message.label;
|
|
11704
|
-
}
|
|
11705
|
-
if (message.node_ids?.length) {
|
|
11706
|
-
obj.nodeIds = message.node_ids;
|
|
11707
|
-
}
|
|
11708
|
-
return obj;
|
|
11709
|
-
},
|
|
11710
|
-
create(base) {
|
|
11711
|
-
return CreateGroupAction.fromPartial(base ?? {});
|
|
11712
|
-
},
|
|
11713
|
-
fromPartial(object) {
|
|
11714
|
-
const message = createBaseCreateGroupAction();
|
|
11715
|
-
message.label = object.label ?? "";
|
|
11716
|
-
message.node_ids = object.node_ids?.map((e) => e) || [];
|
|
11717
|
-
return message;
|
|
11718
|
-
}
|
|
11719
|
-
};
|
|
11720
|
-
function createBaseUpdateGroupAction() {
|
|
11721
|
-
return { group_id: "", label: void 0, collapsed: void 0, node_ids: void 0 };
|
|
11722
|
-
}
|
|
11723
|
-
var UpdateGroupAction = {
|
|
11724
|
-
encode(message, writer = new BinaryWriter4()) {
|
|
11725
|
-
if (message.group_id !== "") {
|
|
11726
|
-
writer.uint32(10).string(message.group_id);
|
|
11727
|
-
}
|
|
11728
|
-
if (message.label !== void 0) {
|
|
11729
|
-
writer.uint32(18).string(message.label);
|
|
11730
|
-
}
|
|
11731
|
-
if (message.collapsed !== void 0) {
|
|
11732
|
-
writer.uint32(24).bool(message.collapsed);
|
|
11733
|
-
}
|
|
11734
|
-
if (message.node_ids !== void 0) {
|
|
11735
|
-
UpdateGroupNodeIds.encode(message.node_ids, writer.uint32(34).fork()).join();
|
|
11736
|
-
}
|
|
11737
|
-
return writer;
|
|
11738
|
-
},
|
|
11739
|
-
decode(input, length) {
|
|
11740
|
-
const reader = input instanceof BinaryReader4 ? input : new BinaryReader4(input);
|
|
11741
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
11742
|
-
const message = createBaseUpdateGroupAction();
|
|
11743
|
-
while (reader.pos < end) {
|
|
11744
|
-
const tag = reader.uint32();
|
|
11745
|
-
switch (tag >>> 3) {
|
|
11746
|
-
case 1: {
|
|
11747
|
-
if (tag !== 10) {
|
|
11748
|
-
break;
|
|
11749
|
-
}
|
|
11750
|
-
message.group_id = reader.string();
|
|
11751
|
-
continue;
|
|
11752
|
-
}
|
|
11753
|
-
case 2: {
|
|
11754
|
-
if (tag !== 18) {
|
|
11755
|
-
break;
|
|
11756
|
-
}
|
|
11757
|
-
message.label = reader.string();
|
|
11758
|
-
continue;
|
|
11759
|
-
}
|
|
11760
|
-
case 3: {
|
|
11761
|
-
if (tag !== 24) {
|
|
11762
|
-
break;
|
|
11763
|
-
}
|
|
11764
|
-
message.collapsed = reader.bool();
|
|
11765
|
-
continue;
|
|
11766
|
-
}
|
|
11767
|
-
case 4: {
|
|
11768
|
-
if (tag !== 34) {
|
|
11769
|
-
break;
|
|
11770
|
-
}
|
|
11771
|
-
message.node_ids = UpdateGroupNodeIds.decode(reader, reader.uint32());
|
|
11772
|
-
continue;
|
|
11773
|
-
}
|
|
11774
|
-
}
|
|
11775
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
11776
|
-
break;
|
|
11777
|
-
}
|
|
11778
|
-
reader.skip(tag & 7);
|
|
11779
|
-
}
|
|
11780
|
-
return message;
|
|
11781
|
-
},
|
|
11782
|
-
fromJSON(object) {
|
|
11783
|
-
return {
|
|
11784
|
-
group_id: isSet3(object.groupId) ? globalThis.String(object.groupId) : isSet3(object.group_id) ? globalThis.String(object.group_id) : "",
|
|
11785
|
-
label: isSet3(object.label) ? globalThis.String(object.label) : void 0,
|
|
11786
|
-
collapsed: isSet3(object.collapsed) ? globalThis.Boolean(object.collapsed) : void 0,
|
|
11787
|
-
node_ids: isSet3(object.nodeIds) ? UpdateGroupNodeIds.fromJSON(object.nodeIds) : isSet3(object.node_ids) ? UpdateGroupNodeIds.fromJSON(object.node_ids) : void 0
|
|
11788
|
-
};
|
|
11789
|
-
},
|
|
11790
|
-
toJSON(message) {
|
|
11791
|
-
const obj = {};
|
|
11792
|
-
if (message.group_id !== "") {
|
|
11793
|
-
obj.groupId = message.group_id;
|
|
11794
|
-
}
|
|
11795
|
-
if (message.label !== void 0) {
|
|
11796
|
-
obj.label = message.label;
|
|
11797
|
-
}
|
|
11798
|
-
if (message.collapsed !== void 0) {
|
|
11799
|
-
obj.collapsed = message.collapsed;
|
|
11800
|
-
}
|
|
11801
|
-
if (message.node_ids !== void 0) {
|
|
11802
|
-
obj.nodeIds = UpdateGroupNodeIds.toJSON(message.node_ids);
|
|
11803
|
-
}
|
|
11804
|
-
return obj;
|
|
11805
|
-
},
|
|
11806
|
-
create(base) {
|
|
11807
|
-
return UpdateGroupAction.fromPartial(base ?? {});
|
|
11130
|
+
return CopyInstancesAction.fromPartial(base ?? {});
|
|
11808
11131
|
},
|
|
11809
11132
|
fromPartial(object) {
|
|
11810
|
-
const message =
|
|
11811
|
-
message.
|
|
11812
|
-
message.label = object.label ?? void 0;
|
|
11813
|
-
message.collapsed = object.collapsed ?? void 0;
|
|
11814
|
-
message.node_ids = object.node_ids !== void 0 && object.node_ids !== null ? UpdateGroupNodeIds.fromPartial(object.node_ids) : void 0;
|
|
11133
|
+
const message = createBaseCopyInstancesAction();
|
|
11134
|
+
message.instance_ids = object.instance_ids?.map((e) => e) || [];
|
|
11815
11135
|
return message;
|
|
11816
11136
|
}
|
|
11817
11137
|
};
|
|
11818
|
-
function
|
|
11138
|
+
function createBaseCreateGroupAction() {
|
|
11819
11139
|
return { node_ids: [] };
|
|
11820
11140
|
}
|
|
11821
|
-
var
|
|
11141
|
+
var CreateGroupAction = {
|
|
11822
11142
|
encode(message, writer = new BinaryWriter4()) {
|
|
11823
11143
|
for (const v of message.node_ids) {
|
|
11824
|
-
writer.uint32(
|
|
11144
|
+
writer.uint32(18).string(v);
|
|
11825
11145
|
}
|
|
11826
11146
|
return writer;
|
|
11827
11147
|
},
|
|
11828
11148
|
decode(input, length) {
|
|
11829
11149
|
const reader = input instanceof BinaryReader4 ? input : new BinaryReader4(input);
|
|
11830
11150
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
11831
|
-
const message =
|
|
11151
|
+
const message = createBaseCreateGroupAction();
|
|
11832
11152
|
while (reader.pos < end) {
|
|
11833
11153
|
const tag = reader.uint32();
|
|
11834
11154
|
switch (tag >>> 3) {
|
|
11835
|
-
case
|
|
11836
|
-
if (tag !==
|
|
11155
|
+
case 2: {
|
|
11156
|
+
if (tag !== 18) {
|
|
11837
11157
|
break;
|
|
11838
11158
|
}
|
|
11839
11159
|
message.node_ids.push(reader.string());
|
|
@@ -11860,18 +11180,18 @@ var UpdateGroupNodeIds = {
|
|
|
11860
11180
|
return obj;
|
|
11861
11181
|
},
|
|
11862
11182
|
create(base) {
|
|
11863
|
-
return
|
|
11183
|
+
return CreateGroupAction.fromPartial(base ?? {});
|
|
11864
11184
|
},
|
|
11865
11185
|
fromPartial(object) {
|
|
11866
|
-
const message =
|
|
11186
|
+
const message = createBaseCreateGroupAction();
|
|
11867
11187
|
message.node_ids = object.node_ids?.map((e) => e) || [];
|
|
11868
11188
|
return message;
|
|
11869
11189
|
}
|
|
11870
11190
|
};
|
|
11871
|
-
function
|
|
11191
|
+
function createBaseUngroupAction() {
|
|
11872
11192
|
return { group_id: "" };
|
|
11873
11193
|
}
|
|
11874
|
-
var
|
|
11194
|
+
var UngroupAction = {
|
|
11875
11195
|
encode(message, writer = new BinaryWriter4()) {
|
|
11876
11196
|
if (message.group_id !== "") {
|
|
11877
11197
|
writer.uint32(10).string(message.group_id);
|
|
@@ -11881,7 +11201,7 @@ var DeleteGroupAction = {
|
|
|
11881
11201
|
decode(input, length) {
|
|
11882
11202
|
const reader = input instanceof BinaryReader4 ? input : new BinaryReader4(input);
|
|
11883
11203
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
11884
|
-
const message =
|
|
11204
|
+
const message = createBaseUngroupAction();
|
|
11885
11205
|
while (reader.pos < end) {
|
|
11886
11206
|
const tag = reader.uint32();
|
|
11887
11207
|
switch (tag >>> 3) {
|
|
@@ -11913,10 +11233,10 @@ var DeleteGroupAction = {
|
|
|
11913
11233
|
return obj;
|
|
11914
11234
|
},
|
|
11915
11235
|
create(base) {
|
|
11916
|
-
return
|
|
11236
|
+
return UngroupAction.fromPartial(base ?? {});
|
|
11917
11237
|
},
|
|
11918
11238
|
fromPartial(object) {
|
|
11919
|
-
const message =
|
|
11239
|
+
const message = createBaseUngroupAction();
|
|
11920
11240
|
message.group_id = object.group_id ?? "";
|
|
11921
11241
|
return message;
|
|
11922
11242
|
}
|
|
@@ -12989,7 +12309,7 @@ var RedoAction = {
|
|
|
12989
12309
|
}
|
|
12990
12310
|
};
|
|
12991
12311
|
function createBasePlaceModuleAction() {
|
|
12992
|
-
return { name: "", system: "", version: "", organization: ""
|
|
12312
|
+
return { name: "", system: "", version: "", organization: "" };
|
|
12993
12313
|
}
|
|
12994
12314
|
var PlaceModuleAction = {
|
|
12995
12315
|
encode(message, writer = new BinaryWriter4()) {
|
|
@@ -13005,9 +12325,6 @@ var PlaceModuleAction = {
|
|
|
13005
12325
|
if (message.organization !== "") {
|
|
13006
12326
|
writer.uint32(34).string(message.organization);
|
|
13007
12327
|
}
|
|
13008
|
-
if (message.position !== void 0) {
|
|
13009
|
-
Position4.encode(message.position, writer.uint32(42).fork()).join();
|
|
13010
|
-
}
|
|
13011
12328
|
return writer;
|
|
13012
12329
|
},
|
|
13013
12330
|
decode(input, length) {
|
|
@@ -13045,13 +12362,6 @@ var PlaceModuleAction = {
|
|
|
13045
12362
|
message.organization = reader.string();
|
|
13046
12363
|
continue;
|
|
13047
12364
|
}
|
|
13048
|
-
case 5: {
|
|
13049
|
-
if (tag !== 42) {
|
|
13050
|
-
break;
|
|
13051
|
-
}
|
|
13052
|
-
message.position = Position4.decode(reader, reader.uint32());
|
|
13053
|
-
continue;
|
|
13054
|
-
}
|
|
13055
12365
|
}
|
|
13056
12366
|
if ((tag & 7) === 4 || tag === 0) {
|
|
13057
12367
|
break;
|
|
@@ -13065,8 +12375,7 @@ var PlaceModuleAction = {
|
|
|
13065
12375
|
name: isSet3(object.name) ? globalThis.String(object.name) : "",
|
|
13066
12376
|
system: isSet3(object.system) ? globalThis.String(object.system) : "",
|
|
13067
12377
|
version: isSet3(object.version) ? globalThis.String(object.version) : "",
|
|
13068
|
-
organization: isSet3(object.organization) ? globalThis.String(object.organization) : ""
|
|
13069
|
-
position: isSet3(object.position) ? Position4.fromJSON(object.position) : void 0
|
|
12378
|
+
organization: isSet3(object.organization) ? globalThis.String(object.organization) : ""
|
|
13070
12379
|
};
|
|
13071
12380
|
},
|
|
13072
12381
|
toJSON(message) {
|
|
@@ -13083,9 +12392,6 @@ var PlaceModuleAction = {
|
|
|
13083
12392
|
if (message.organization !== "") {
|
|
13084
12393
|
obj.organization = message.organization;
|
|
13085
12394
|
}
|
|
13086
|
-
if (message.position !== void 0) {
|
|
13087
|
-
obj.position = Position4.toJSON(message.position);
|
|
13088
|
-
}
|
|
13089
12395
|
return obj;
|
|
13090
12396
|
},
|
|
13091
12397
|
create(base) {
|
|
@@ -13097,7 +12403,6 @@ var PlaceModuleAction = {
|
|
|
13097
12403
|
message.system = object.system ?? "";
|
|
13098
12404
|
message.version = object.version ?? "";
|
|
13099
12405
|
message.organization = object.organization ?? "";
|
|
13100
|
-
message.position = object.position !== void 0 && object.position !== null ? Position4.fromPartial(object.position) : void 0;
|
|
13101
12406
|
return message;
|
|
13102
12407
|
}
|
|
13103
12408
|
};
|
|
@@ -13111,10 +12416,7 @@ function createBaseAction() {
|
|
|
13111
12416
|
rename_instance: void 0,
|
|
13112
12417
|
delete_instance: void 0,
|
|
13113
12418
|
copy_instances: void 0,
|
|
13114
|
-
sync_layout: void 0,
|
|
13115
12419
|
create_group: void 0,
|
|
13116
|
-
update_group: void 0,
|
|
13117
|
-
delete_group: void 0,
|
|
13118
12420
|
set_variables: void 0,
|
|
13119
12421
|
set_exports: void 0,
|
|
13120
12422
|
set_terraform: void 0,
|
|
@@ -13125,7 +12427,8 @@ function createBaseAction() {
|
|
|
13125
12427
|
undo: void 0,
|
|
13126
12428
|
redo: void 0,
|
|
13127
12429
|
place_module: void 0,
|
|
13128
|
-
set_use_providers: void 0
|
|
12430
|
+
set_use_providers: void 0,
|
|
12431
|
+
ungroup: void 0
|
|
13129
12432
|
};
|
|
13130
12433
|
}
|
|
13131
12434
|
var Action = {
|
|
@@ -13154,18 +12457,9 @@ var Action = {
|
|
|
13154
12457
|
if (message.copy_instances !== void 0) {
|
|
13155
12458
|
CopyInstancesAction.encode(message.copy_instances, writer.uint32(66).fork()).join();
|
|
13156
12459
|
}
|
|
13157
|
-
if (message.sync_layout !== void 0) {
|
|
13158
|
-
SyncLayoutAction.encode(message.sync_layout, writer.uint32(74).fork()).join();
|
|
13159
|
-
}
|
|
13160
12460
|
if (message.create_group !== void 0) {
|
|
13161
12461
|
CreateGroupAction.encode(message.create_group, writer.uint32(82).fork()).join();
|
|
13162
12462
|
}
|
|
13163
|
-
if (message.update_group !== void 0) {
|
|
13164
|
-
UpdateGroupAction.encode(message.update_group, writer.uint32(90).fork()).join();
|
|
13165
|
-
}
|
|
13166
|
-
if (message.delete_group !== void 0) {
|
|
13167
|
-
DeleteGroupAction.encode(message.delete_group, writer.uint32(98).fork()).join();
|
|
13168
|
-
}
|
|
13169
12463
|
if (message.set_variables !== void 0) {
|
|
13170
12464
|
SetVariablesAction.encode(message.set_variables, writer.uint32(106).fork()).join();
|
|
13171
12465
|
}
|
|
@@ -13199,6 +12493,9 @@ var Action = {
|
|
|
13199
12493
|
if (message.set_use_providers !== void 0) {
|
|
13200
12494
|
SetUseProvidersAction.encode(message.set_use_providers, writer.uint32(186).fork()).join();
|
|
13201
12495
|
}
|
|
12496
|
+
if (message.ungroup !== void 0) {
|
|
12497
|
+
UngroupAction.encode(message.ungroup, writer.uint32(194).fork()).join();
|
|
12498
|
+
}
|
|
13202
12499
|
return writer;
|
|
13203
12500
|
},
|
|
13204
12501
|
decode(input, length) {
|
|
@@ -13264,13 +12561,6 @@ var Action = {
|
|
|
13264
12561
|
message.copy_instances = CopyInstancesAction.decode(reader, reader.uint32());
|
|
13265
12562
|
continue;
|
|
13266
12563
|
}
|
|
13267
|
-
case 9: {
|
|
13268
|
-
if (tag !== 74) {
|
|
13269
|
-
break;
|
|
13270
|
-
}
|
|
13271
|
-
message.sync_layout = SyncLayoutAction.decode(reader, reader.uint32());
|
|
13272
|
-
continue;
|
|
13273
|
-
}
|
|
13274
12564
|
case 10: {
|
|
13275
12565
|
if (tag !== 82) {
|
|
13276
12566
|
break;
|
|
@@ -13278,20 +12568,6 @@ var Action = {
|
|
|
13278
12568
|
message.create_group = CreateGroupAction.decode(reader, reader.uint32());
|
|
13279
12569
|
continue;
|
|
13280
12570
|
}
|
|
13281
|
-
case 11: {
|
|
13282
|
-
if (tag !== 90) {
|
|
13283
|
-
break;
|
|
13284
|
-
}
|
|
13285
|
-
message.update_group = UpdateGroupAction.decode(reader, reader.uint32());
|
|
13286
|
-
continue;
|
|
13287
|
-
}
|
|
13288
|
-
case 12: {
|
|
13289
|
-
if (tag !== 98) {
|
|
13290
|
-
break;
|
|
13291
|
-
}
|
|
13292
|
-
message.delete_group = DeleteGroupAction.decode(reader, reader.uint32());
|
|
13293
|
-
continue;
|
|
13294
|
-
}
|
|
13295
12571
|
case 13: {
|
|
13296
12572
|
if (tag !== 106) {
|
|
13297
12573
|
break;
|
|
@@ -13369,6 +12645,13 @@ var Action = {
|
|
|
13369
12645
|
message.set_use_providers = SetUseProvidersAction.decode(reader, reader.uint32());
|
|
13370
12646
|
continue;
|
|
13371
12647
|
}
|
|
12648
|
+
case 24: {
|
|
12649
|
+
if (tag !== 194) {
|
|
12650
|
+
break;
|
|
12651
|
+
}
|
|
12652
|
+
message.ungroup = UngroupAction.decode(reader, reader.uint32());
|
|
12653
|
+
continue;
|
|
12654
|
+
}
|
|
13372
12655
|
}
|
|
13373
12656
|
if ((tag & 7) === 4 || tag === 0) {
|
|
13374
12657
|
break;
|
|
@@ -13387,10 +12670,7 @@ var Action = {
|
|
|
13387
12670
|
rename_instance: isSet3(object.renameInstance) ? RenameInstanceAction.fromJSON(object.renameInstance) : isSet3(object.rename_instance) ? RenameInstanceAction.fromJSON(object.rename_instance) : void 0,
|
|
13388
12671
|
delete_instance: isSet3(object.deleteInstance) ? DeleteInstanceAction.fromJSON(object.deleteInstance) : isSet3(object.delete_instance) ? DeleteInstanceAction.fromJSON(object.delete_instance) : void 0,
|
|
13389
12672
|
copy_instances: isSet3(object.copyInstances) ? CopyInstancesAction.fromJSON(object.copyInstances) : isSet3(object.copy_instances) ? CopyInstancesAction.fromJSON(object.copy_instances) : void 0,
|
|
13390
|
-
sync_layout: isSet3(object.syncLayout) ? SyncLayoutAction.fromJSON(object.syncLayout) : isSet3(object.sync_layout) ? SyncLayoutAction.fromJSON(object.sync_layout) : void 0,
|
|
13391
12673
|
create_group: isSet3(object.createGroup) ? CreateGroupAction.fromJSON(object.createGroup) : isSet3(object.create_group) ? CreateGroupAction.fromJSON(object.create_group) : void 0,
|
|
13392
|
-
update_group: isSet3(object.updateGroup) ? UpdateGroupAction.fromJSON(object.updateGroup) : isSet3(object.update_group) ? UpdateGroupAction.fromJSON(object.update_group) : void 0,
|
|
13393
|
-
delete_group: isSet3(object.deleteGroup) ? DeleteGroupAction.fromJSON(object.deleteGroup) : isSet3(object.delete_group) ? DeleteGroupAction.fromJSON(object.delete_group) : void 0,
|
|
13394
12674
|
set_variables: isSet3(object.setVariables) ? SetVariablesAction.fromJSON(object.setVariables) : isSet3(object.set_variables) ? SetVariablesAction.fromJSON(object.set_variables) : void 0,
|
|
13395
12675
|
set_exports: isSet3(object.setExports) ? SetExportsAction.fromJSON(object.setExports) : isSet3(object.set_exports) ? SetExportsAction.fromJSON(object.set_exports) : void 0,
|
|
13396
12676
|
set_terraform: isSet3(object.setTerraform) ? SetTerraformAction.fromJSON(object.setTerraform) : isSet3(object.set_terraform) ? SetTerraformAction.fromJSON(object.set_terraform) : void 0,
|
|
@@ -13401,7 +12681,8 @@ var Action = {
|
|
|
13401
12681
|
undo: isSet3(object.undo) ? UndoAction.fromJSON(object.undo) : void 0,
|
|
13402
12682
|
redo: isSet3(object.redo) ? RedoAction.fromJSON(object.redo) : void 0,
|
|
13403
12683
|
place_module: isSet3(object.placeModule) ? PlaceModuleAction.fromJSON(object.placeModule) : isSet3(object.place_module) ? PlaceModuleAction.fromJSON(object.place_module) : void 0,
|
|
13404
|
-
set_use_providers: isSet3(object.setUseProviders) ? SetUseProvidersAction.fromJSON(object.setUseProviders) : isSet3(object.set_use_providers) ? SetUseProvidersAction.fromJSON(object.set_use_providers) : void 0
|
|
12684
|
+
set_use_providers: isSet3(object.setUseProviders) ? SetUseProvidersAction.fromJSON(object.setUseProviders) : isSet3(object.set_use_providers) ? SetUseProvidersAction.fromJSON(object.set_use_providers) : void 0,
|
|
12685
|
+
ungroup: isSet3(object.ungroup) ? UngroupAction.fromJSON(object.ungroup) : void 0
|
|
13405
12686
|
};
|
|
13406
12687
|
},
|
|
13407
12688
|
toJSON(message) {
|
|
@@ -13430,18 +12711,9 @@ var Action = {
|
|
|
13430
12711
|
if (message.copy_instances !== void 0) {
|
|
13431
12712
|
obj.copyInstances = CopyInstancesAction.toJSON(message.copy_instances);
|
|
13432
12713
|
}
|
|
13433
|
-
if (message.sync_layout !== void 0) {
|
|
13434
|
-
obj.syncLayout = SyncLayoutAction.toJSON(message.sync_layout);
|
|
13435
|
-
}
|
|
13436
12714
|
if (message.create_group !== void 0) {
|
|
13437
12715
|
obj.createGroup = CreateGroupAction.toJSON(message.create_group);
|
|
13438
12716
|
}
|
|
13439
|
-
if (message.update_group !== void 0) {
|
|
13440
|
-
obj.updateGroup = UpdateGroupAction.toJSON(message.update_group);
|
|
13441
|
-
}
|
|
13442
|
-
if (message.delete_group !== void 0) {
|
|
13443
|
-
obj.deleteGroup = DeleteGroupAction.toJSON(message.delete_group);
|
|
13444
|
-
}
|
|
13445
12717
|
if (message.set_variables !== void 0) {
|
|
13446
12718
|
obj.setVariables = SetVariablesAction.toJSON(message.set_variables);
|
|
13447
12719
|
}
|
|
@@ -13475,6 +12747,9 @@ var Action = {
|
|
|
13475
12747
|
if (message.set_use_providers !== void 0) {
|
|
13476
12748
|
obj.setUseProviders = SetUseProvidersAction.toJSON(message.set_use_providers);
|
|
13477
12749
|
}
|
|
12750
|
+
if (message.ungroup !== void 0) {
|
|
12751
|
+
obj.ungroup = UngroupAction.toJSON(message.ungroup);
|
|
12752
|
+
}
|
|
13478
12753
|
return obj;
|
|
13479
12754
|
},
|
|
13480
12755
|
create(base) {
|
|
@@ -13490,10 +12765,7 @@ var Action = {
|
|
|
13490
12765
|
message.rename_instance = object.rename_instance !== void 0 && object.rename_instance !== null ? RenameInstanceAction.fromPartial(object.rename_instance) : void 0;
|
|
13491
12766
|
message.delete_instance = object.delete_instance !== void 0 && object.delete_instance !== null ? DeleteInstanceAction.fromPartial(object.delete_instance) : void 0;
|
|
13492
12767
|
message.copy_instances = object.copy_instances !== void 0 && object.copy_instances !== null ? CopyInstancesAction.fromPartial(object.copy_instances) : void 0;
|
|
13493
|
-
message.sync_layout = object.sync_layout !== void 0 && object.sync_layout !== null ? SyncLayoutAction.fromPartial(object.sync_layout) : void 0;
|
|
13494
12768
|
message.create_group = object.create_group !== void 0 && object.create_group !== null ? CreateGroupAction.fromPartial(object.create_group) : void 0;
|
|
13495
|
-
message.update_group = object.update_group !== void 0 && object.update_group !== null ? UpdateGroupAction.fromPartial(object.update_group) : void 0;
|
|
13496
|
-
message.delete_group = object.delete_group !== void 0 && object.delete_group !== null ? DeleteGroupAction.fromPartial(object.delete_group) : void 0;
|
|
13497
12769
|
message.set_variables = object.set_variables !== void 0 && object.set_variables !== null ? SetVariablesAction.fromPartial(object.set_variables) : void 0;
|
|
13498
12770
|
message.set_exports = object.set_exports !== void 0 && object.set_exports !== null ? SetExportsAction.fromPartial(object.set_exports) : void 0;
|
|
13499
12771
|
message.set_terraform = object.set_terraform !== void 0 && object.set_terraform !== null ? SetTerraformAction.fromPartial(object.set_terraform) : void 0;
|
|
@@ -13505,6 +12777,7 @@ var Action = {
|
|
|
13505
12777
|
message.redo = object.redo !== void 0 && object.redo !== null ? RedoAction.fromPartial(object.redo) : void 0;
|
|
13506
12778
|
message.place_module = object.place_module !== void 0 && object.place_module !== null ? PlaceModuleAction.fromPartial(object.place_module) : void 0;
|
|
13507
12779
|
message.set_use_providers = object.set_use_providers !== void 0 && object.set_use_providers !== null ? SetUseProvidersAction.fromPartial(object.set_use_providers) : void 0;
|
|
12780
|
+
message.ungroup = object.ungroup !== void 0 && object.ungroup !== null ? UngroupAction.fromPartial(object.ungroup) : void 0;
|
|
13508
12781
|
return message;
|
|
13509
12782
|
}
|
|
13510
12783
|
};
|
|
@@ -14579,16 +13852,13 @@ var BundleStateEvent = {
|
|
|
14579
13852
|
}
|
|
14580
13853
|
};
|
|
14581
13854
|
function createBaseBundleState() {
|
|
14582
|
-
return { bundle: void 0,
|
|
13855
|
+
return { bundle: void 0, can_undo: false, can_redo: false, is_dirty: false };
|
|
14583
13856
|
}
|
|
14584
13857
|
var BundleState = {
|
|
14585
13858
|
encode(message, writer = new BinaryWriter4()) {
|
|
14586
13859
|
if (message.bundle !== void 0) {
|
|
14587
13860
|
Bundle.encode(message.bundle, writer.uint32(10).fork()).join();
|
|
14588
13861
|
}
|
|
14589
|
-
globalThis.Object.entries(message.layouts).forEach(([key, value]) => {
|
|
14590
|
-
BundleState_LayoutsEntry.encode({ key, value }, writer.uint32(18).fork()).join();
|
|
14591
|
-
});
|
|
14592
13862
|
if (message.can_undo !== false) {
|
|
14593
13863
|
writer.uint32(24).bool(message.can_undo);
|
|
14594
13864
|
}
|
|
@@ -14614,16 +13884,6 @@ var BundleState = {
|
|
|
14614
13884
|
message.bundle = Bundle.decode(reader, reader.uint32());
|
|
14615
13885
|
continue;
|
|
14616
13886
|
}
|
|
14617
|
-
case 2: {
|
|
14618
|
-
if (tag !== 18) {
|
|
14619
|
-
break;
|
|
14620
|
-
}
|
|
14621
|
-
const entry2 = BundleState_LayoutsEntry.decode(reader, reader.uint32());
|
|
14622
|
-
if (entry2.value !== void 0) {
|
|
14623
|
-
message.layouts[entry2.key] = entry2.value;
|
|
14624
|
-
}
|
|
14625
|
-
continue;
|
|
14626
|
-
}
|
|
14627
13887
|
case 3: {
|
|
14628
13888
|
if (tag !== 24) {
|
|
14629
13889
|
break;
|
|
@@ -14656,13 +13916,6 @@ var BundleState = {
|
|
|
14656
13916
|
fromJSON(object) {
|
|
14657
13917
|
return {
|
|
14658
13918
|
bundle: isSet3(object.bundle) ? Bundle.fromJSON(object.bundle) : void 0,
|
|
14659
|
-
layouts: isObject3(object.layouts) ? globalThis.Object.entries(object.layouts).reduce(
|
|
14660
|
-
(acc, [key, value]) => {
|
|
14661
|
-
acc[key] = GraphLayout.fromJSON(value);
|
|
14662
|
-
return acc;
|
|
14663
|
-
},
|
|
14664
|
-
{}
|
|
14665
|
-
) : {},
|
|
14666
13919
|
can_undo: isSet3(object.canUndo) ? globalThis.Boolean(object.canUndo) : isSet3(object.can_undo) ? globalThis.Boolean(object.can_undo) : false,
|
|
14667
13920
|
can_redo: isSet3(object.canRedo) ? globalThis.Boolean(object.canRedo) : isSet3(object.can_redo) ? globalThis.Boolean(object.can_redo) : false,
|
|
14668
13921
|
is_dirty: isSet3(object.isDirty) ? globalThis.Boolean(object.isDirty) : isSet3(object.is_dirty) ? globalThis.Boolean(object.is_dirty) : false
|
|
@@ -14673,15 +13926,6 @@ var BundleState = {
|
|
|
14673
13926
|
if (message.bundle !== void 0) {
|
|
14674
13927
|
obj.bundle = Bundle.toJSON(message.bundle);
|
|
14675
13928
|
}
|
|
14676
|
-
if (message.layouts) {
|
|
14677
|
-
const entries = globalThis.Object.entries(message.layouts);
|
|
14678
|
-
if (entries.length > 0) {
|
|
14679
|
-
obj.layouts = {};
|
|
14680
|
-
entries.forEach(([k, v]) => {
|
|
14681
|
-
obj.layouts[k] = GraphLayout.toJSON(v);
|
|
14682
|
-
});
|
|
14683
|
-
}
|
|
14684
|
-
}
|
|
14685
13929
|
if (message.can_undo !== false) {
|
|
14686
13930
|
obj.canUndo = message.can_undo;
|
|
14687
13931
|
}
|
|
@@ -14699,53 +13943,54 @@ var BundleState = {
|
|
|
14699
13943
|
fromPartial(object) {
|
|
14700
13944
|
const message = createBaseBundleState();
|
|
14701
13945
|
message.bundle = object.bundle !== void 0 && object.bundle !== null ? Bundle.fromPartial(object.bundle) : void 0;
|
|
14702
|
-
message.layouts = globalThis.Object.entries(object.layouts ?? {}).reduce(
|
|
14703
|
-
(acc, [key, value]) => {
|
|
14704
|
-
if (value !== void 0) {
|
|
14705
|
-
acc[key] = GraphLayout.fromPartial(value);
|
|
14706
|
-
}
|
|
14707
|
-
return acc;
|
|
14708
|
-
},
|
|
14709
|
-
{}
|
|
14710
|
-
);
|
|
14711
13946
|
message.can_undo = object.can_undo ?? false;
|
|
14712
13947
|
message.can_redo = object.can_redo ?? false;
|
|
14713
13948
|
message.is_dirty = object.is_dirty ?? false;
|
|
14714
13949
|
return message;
|
|
14715
13950
|
}
|
|
14716
13951
|
};
|
|
14717
|
-
function
|
|
14718
|
-
return {
|
|
13952
|
+
function createBaseBundleApplyResult() {
|
|
13953
|
+
return { success: false, errors: [], created: [] };
|
|
14719
13954
|
}
|
|
14720
|
-
var
|
|
13955
|
+
var BundleApplyResult = {
|
|
14721
13956
|
encode(message, writer = new BinaryWriter4()) {
|
|
14722
|
-
if (message.
|
|
14723
|
-
writer.uint32(
|
|
13957
|
+
if (message.success !== false) {
|
|
13958
|
+
writer.uint32(8).bool(message.success);
|
|
14724
13959
|
}
|
|
14725
|
-
|
|
14726
|
-
|
|
13960
|
+
for (const v of message.errors) {
|
|
13961
|
+
GraphError.encode(v, writer.uint32(18).fork()).join();
|
|
13962
|
+
}
|
|
13963
|
+
for (const v of message.created) {
|
|
13964
|
+
CreatedRef.encode(v, writer.uint32(26).fork()).join();
|
|
14727
13965
|
}
|
|
14728
13966
|
return writer;
|
|
14729
13967
|
},
|
|
14730
13968
|
decode(input, length) {
|
|
14731
13969
|
const reader = input instanceof BinaryReader4 ? input : new BinaryReader4(input);
|
|
14732
13970
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
14733
|
-
const message =
|
|
13971
|
+
const message = createBaseBundleApplyResult();
|
|
14734
13972
|
while (reader.pos < end) {
|
|
14735
13973
|
const tag = reader.uint32();
|
|
14736
13974
|
switch (tag >>> 3) {
|
|
14737
13975
|
case 1: {
|
|
14738
|
-
if (tag !==
|
|
13976
|
+
if (tag !== 8) {
|
|
14739
13977
|
break;
|
|
14740
13978
|
}
|
|
14741
|
-
message.
|
|
13979
|
+
message.success = reader.bool();
|
|
14742
13980
|
continue;
|
|
14743
13981
|
}
|
|
14744
13982
|
case 2: {
|
|
14745
13983
|
if (tag !== 18) {
|
|
14746
13984
|
break;
|
|
14747
13985
|
}
|
|
14748
|
-
message.
|
|
13986
|
+
message.errors.push(GraphError.decode(reader, reader.uint32()));
|
|
13987
|
+
continue;
|
|
13988
|
+
}
|
|
13989
|
+
case 3: {
|
|
13990
|
+
if (tag !== 26) {
|
|
13991
|
+
break;
|
|
13992
|
+
}
|
|
13993
|
+
message.created.push(CreatedRef.decode(reader, reader.uint32()));
|
|
14749
13994
|
continue;
|
|
14750
13995
|
}
|
|
14751
13996
|
}
|
|
@@ -14758,62 +14003,87 @@ var BundleState_LayoutsEntry = {
|
|
|
14758
14003
|
},
|
|
14759
14004
|
fromJSON(object) {
|
|
14760
14005
|
return {
|
|
14761
|
-
|
|
14762
|
-
|
|
14006
|
+
success: isSet3(object.success) ? globalThis.Boolean(object.success) : false,
|
|
14007
|
+
errors: globalThis.Array.isArray(object?.errors) ? object.errors.map((e) => GraphError.fromJSON(e)) : [],
|
|
14008
|
+
created: globalThis.Array.isArray(object?.created) ? object.created.map((e) => CreatedRef.fromJSON(e)) : []
|
|
14763
14009
|
};
|
|
14764
14010
|
},
|
|
14765
14011
|
toJSON(message) {
|
|
14766
14012
|
const obj = {};
|
|
14767
|
-
if (message.
|
|
14768
|
-
obj.
|
|
14013
|
+
if (message.success !== false) {
|
|
14014
|
+
obj.success = message.success;
|
|
14769
14015
|
}
|
|
14770
|
-
if (message.
|
|
14771
|
-
obj.
|
|
14016
|
+
if (message.errors?.length) {
|
|
14017
|
+
obj.errors = message.errors.map((e) => GraphError.toJSON(e));
|
|
14018
|
+
}
|
|
14019
|
+
if (message.created?.length) {
|
|
14020
|
+
obj.created = message.created.map((e) => CreatedRef.toJSON(e));
|
|
14772
14021
|
}
|
|
14773
14022
|
return obj;
|
|
14774
14023
|
},
|
|
14775
14024
|
create(base) {
|
|
14776
|
-
return
|
|
14025
|
+
return BundleApplyResult.fromPartial(base ?? {});
|
|
14777
14026
|
},
|
|
14778
14027
|
fromPartial(object) {
|
|
14779
|
-
const message =
|
|
14780
|
-
message.
|
|
14781
|
-
message.
|
|
14028
|
+
const message = createBaseBundleApplyResult();
|
|
14029
|
+
message.success = object.success ?? false;
|
|
14030
|
+
message.errors = object.errors?.map((e) => GraphError.fromPartial(e)) || [];
|
|
14031
|
+
message.created = object.created?.map((e) => CreatedRef.fromPartial(e)) || [];
|
|
14782
14032
|
return message;
|
|
14783
14033
|
}
|
|
14784
14034
|
};
|
|
14785
|
-
function
|
|
14786
|
-
return {
|
|
14035
|
+
function createBaseCreatedRef() {
|
|
14036
|
+
return { scope: "", id: "", module_key: "", source_id: "" };
|
|
14787
14037
|
}
|
|
14788
|
-
var
|
|
14038
|
+
var CreatedRef = {
|
|
14789
14039
|
encode(message, writer = new BinaryWriter4()) {
|
|
14790
|
-
if (message.
|
|
14791
|
-
writer.uint32(
|
|
14040
|
+
if (message.scope !== "") {
|
|
14041
|
+
writer.uint32(10).string(message.scope);
|
|
14792
14042
|
}
|
|
14793
|
-
|
|
14794
|
-
|
|
14043
|
+
if (message.id !== "") {
|
|
14044
|
+
writer.uint32(18).string(message.id);
|
|
14045
|
+
}
|
|
14046
|
+
if (message.module_key !== "") {
|
|
14047
|
+
writer.uint32(26).string(message.module_key);
|
|
14048
|
+
}
|
|
14049
|
+
if (message.source_id !== "") {
|
|
14050
|
+
writer.uint32(34).string(message.source_id);
|
|
14795
14051
|
}
|
|
14796
14052
|
return writer;
|
|
14797
14053
|
},
|
|
14798
14054
|
decode(input, length) {
|
|
14799
14055
|
const reader = input instanceof BinaryReader4 ? input : new BinaryReader4(input);
|
|
14800
14056
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
14801
|
-
const message =
|
|
14057
|
+
const message = createBaseCreatedRef();
|
|
14802
14058
|
while (reader.pos < end) {
|
|
14803
14059
|
const tag = reader.uint32();
|
|
14804
14060
|
switch (tag >>> 3) {
|
|
14805
14061
|
case 1: {
|
|
14806
|
-
if (tag !==
|
|
14062
|
+
if (tag !== 10) {
|
|
14807
14063
|
break;
|
|
14808
14064
|
}
|
|
14809
|
-
message.
|
|
14065
|
+
message.scope = reader.string();
|
|
14810
14066
|
continue;
|
|
14811
14067
|
}
|
|
14812
14068
|
case 2: {
|
|
14813
14069
|
if (tag !== 18) {
|
|
14814
14070
|
break;
|
|
14815
14071
|
}
|
|
14816
|
-
message.
|
|
14072
|
+
message.id = reader.string();
|
|
14073
|
+
continue;
|
|
14074
|
+
}
|
|
14075
|
+
case 3: {
|
|
14076
|
+
if (tag !== 26) {
|
|
14077
|
+
break;
|
|
14078
|
+
}
|
|
14079
|
+
message.module_key = reader.string();
|
|
14080
|
+
continue;
|
|
14081
|
+
}
|
|
14082
|
+
case 4: {
|
|
14083
|
+
if (tag !== 34) {
|
|
14084
|
+
break;
|
|
14085
|
+
}
|
|
14086
|
+
message.source_id = reader.string();
|
|
14817
14087
|
continue;
|
|
14818
14088
|
}
|
|
14819
14089
|
}
|
|
@@ -14826,27 +14096,37 @@ var BundleApplyResult = {
|
|
|
14826
14096
|
},
|
|
14827
14097
|
fromJSON(object) {
|
|
14828
14098
|
return {
|
|
14829
|
-
|
|
14830
|
-
|
|
14099
|
+
scope: isSet3(object.scope) ? globalThis.String(object.scope) : "",
|
|
14100
|
+
id: isSet3(object.id) ? globalThis.String(object.id) : "",
|
|
14101
|
+
module_key: isSet3(object.moduleKey) ? globalThis.String(object.moduleKey) : isSet3(object.module_key) ? globalThis.String(object.module_key) : "",
|
|
14102
|
+
source_id: isSet3(object.sourceId) ? globalThis.String(object.sourceId) : isSet3(object.source_id) ? globalThis.String(object.source_id) : ""
|
|
14831
14103
|
};
|
|
14832
14104
|
},
|
|
14833
14105
|
toJSON(message) {
|
|
14834
14106
|
const obj = {};
|
|
14835
|
-
if (message.
|
|
14836
|
-
obj.
|
|
14107
|
+
if (message.scope !== "") {
|
|
14108
|
+
obj.scope = message.scope;
|
|
14837
14109
|
}
|
|
14838
|
-
if (message.
|
|
14839
|
-
obj.
|
|
14110
|
+
if (message.id !== "") {
|
|
14111
|
+
obj.id = message.id;
|
|
14112
|
+
}
|
|
14113
|
+
if (message.module_key !== "") {
|
|
14114
|
+
obj.moduleKey = message.module_key;
|
|
14115
|
+
}
|
|
14116
|
+
if (message.source_id !== "") {
|
|
14117
|
+
obj.sourceId = message.source_id;
|
|
14840
14118
|
}
|
|
14841
14119
|
return obj;
|
|
14842
14120
|
},
|
|
14843
14121
|
create(base) {
|
|
14844
|
-
return
|
|
14122
|
+
return CreatedRef.fromPartial(base ?? {});
|
|
14845
14123
|
},
|
|
14846
14124
|
fromPartial(object) {
|
|
14847
|
-
const message =
|
|
14848
|
-
message.
|
|
14849
|
-
message.
|
|
14125
|
+
const message = createBaseCreatedRef();
|
|
14126
|
+
message.scope = object.scope ?? "";
|
|
14127
|
+
message.id = object.id ?? "";
|
|
14128
|
+
message.module_key = object.module_key ?? "";
|
|
14129
|
+
message.source_id = object.source_id ?? "";
|
|
14850
14130
|
return message;
|
|
14851
14131
|
}
|
|
14852
14132
|
};
|
|
@@ -16725,74 +16005,6 @@ var RenderError = {
|
|
|
16725
16005
|
return message;
|
|
16726
16006
|
}
|
|
16727
16007
|
};
|
|
16728
|
-
function createBasePosition2() {
|
|
16729
|
-
return { x: 0, y: 0 };
|
|
16730
|
-
}
|
|
16731
|
-
var Position4 = {
|
|
16732
|
-
encode(message, writer = new BinaryWriter4()) {
|
|
16733
|
-
if (message.x !== 0) {
|
|
16734
|
-
writer.uint32(9).double(message.x);
|
|
16735
|
-
}
|
|
16736
|
-
if (message.y !== 0) {
|
|
16737
|
-
writer.uint32(17).double(message.y);
|
|
16738
|
-
}
|
|
16739
|
-
return writer;
|
|
16740
|
-
},
|
|
16741
|
-
decode(input, length) {
|
|
16742
|
-
const reader = input instanceof BinaryReader4 ? input : new BinaryReader4(input);
|
|
16743
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
16744
|
-
const message = createBasePosition2();
|
|
16745
|
-
while (reader.pos < end) {
|
|
16746
|
-
const tag = reader.uint32();
|
|
16747
|
-
switch (tag >>> 3) {
|
|
16748
|
-
case 1: {
|
|
16749
|
-
if (tag !== 9) {
|
|
16750
|
-
break;
|
|
16751
|
-
}
|
|
16752
|
-
message.x = reader.double();
|
|
16753
|
-
continue;
|
|
16754
|
-
}
|
|
16755
|
-
case 2: {
|
|
16756
|
-
if (tag !== 17) {
|
|
16757
|
-
break;
|
|
16758
|
-
}
|
|
16759
|
-
message.y = reader.double();
|
|
16760
|
-
continue;
|
|
16761
|
-
}
|
|
16762
|
-
}
|
|
16763
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
16764
|
-
break;
|
|
16765
|
-
}
|
|
16766
|
-
reader.skip(tag & 7);
|
|
16767
|
-
}
|
|
16768
|
-
return message;
|
|
16769
|
-
},
|
|
16770
|
-
fromJSON(object) {
|
|
16771
|
-
return {
|
|
16772
|
-
x: isSet3(object.x) ? globalThis.Number(object.x) : 0,
|
|
16773
|
-
y: isSet3(object.y) ? globalThis.Number(object.y) : 0
|
|
16774
|
-
};
|
|
16775
|
-
},
|
|
16776
|
-
toJSON(message) {
|
|
16777
|
-
const obj = {};
|
|
16778
|
-
if (message.x !== 0) {
|
|
16779
|
-
obj.x = message.x;
|
|
16780
|
-
}
|
|
16781
|
-
if (message.y !== 0) {
|
|
16782
|
-
obj.y = message.y;
|
|
16783
|
-
}
|
|
16784
|
-
return obj;
|
|
16785
|
-
},
|
|
16786
|
-
create(base) {
|
|
16787
|
-
return Position4.fromPartial(base ?? {});
|
|
16788
|
-
},
|
|
16789
|
-
fromPartial(object) {
|
|
16790
|
-
const message = createBasePosition2();
|
|
16791
|
-
message.x = object.x ?? 0;
|
|
16792
|
-
message.y = object.y ?? 0;
|
|
16793
|
-
return message;
|
|
16794
|
-
}
|
|
16795
|
-
};
|
|
16796
16008
|
function createBaseInputDef2() {
|
|
16797
16009
|
return {
|
|
16798
16010
|
name: "",
|
|
@@ -17178,7 +16390,7 @@ var ConnectWebEngine = class {
|
|
|
17178
16390
|
this.subscribeAbort = null;
|
|
17179
16391
|
this.listeners = /* @__PURE__ */ new Set();
|
|
17180
16392
|
this.currentBundle = null;
|
|
17181
|
-
this.
|
|
16393
|
+
this.currentArrangement = {};
|
|
17182
16394
|
this.currentCanUndo = false;
|
|
17183
16395
|
this.currentCanRedo = false;
|
|
17184
16396
|
this.currentIsDirty = false;
|
|
@@ -17204,6 +16416,18 @@ var ConnectWebEngine = class {
|
|
|
17204
16416
|
getCurrentView() {
|
|
17205
16417
|
return this.currentView;
|
|
17206
16418
|
}
|
|
16419
|
+
getCurrentBundle() {
|
|
16420
|
+
return this.currentBundle;
|
|
16421
|
+
}
|
|
16422
|
+
/**
|
|
16423
|
+
* Replace the consumer-owned arrangement and re-project immediately —
|
|
16424
|
+
* a local view refresh, not a mutation, so it never carries a viewport
|
|
16425
|
+
* intent.
|
|
16426
|
+
*/
|
|
16427
|
+
setArrangement(arrangement) {
|
|
16428
|
+
this.currentArrangement = arrangement;
|
|
16429
|
+
this.reproject();
|
|
16430
|
+
}
|
|
17207
16431
|
requireSessionId() {
|
|
17208
16432
|
if (!this._sessionId) throw new Error("No active session \u2014 call sessionOpen first");
|
|
17209
16433
|
return this._sessionId;
|
|
@@ -17237,7 +16461,6 @@ var ConnectWebEngine = class {
|
|
|
17237
16461
|
adoptState(state) {
|
|
17238
16462
|
if (!state.bundle) return;
|
|
17239
16463
|
this.currentBundle = state.bundle;
|
|
17240
|
-
this.currentLayouts = state.layouts ?? {};
|
|
17241
16464
|
this.currentCanUndo = state.can_undo;
|
|
17242
16465
|
this.currentCanRedo = state.can_redo;
|
|
17243
16466
|
this.currentIsDirty = state.is_dirty;
|
|
@@ -17247,7 +16470,7 @@ var ConnectWebEngine = class {
|
|
|
17247
16470
|
reproject() {
|
|
17248
16471
|
if (!this.currentBundle) return;
|
|
17249
16472
|
const { id: moduleName } = parseModuleKey(this.currentBundle.entry);
|
|
17250
|
-
const view = projectCanvasView(this.currentBundle, this.
|
|
16473
|
+
const view = projectCanvasView(this.currentBundle, this.currentArrangement, {
|
|
17251
16474
|
moduleName,
|
|
17252
16475
|
canUndo: this.currentCanUndo,
|
|
17253
16476
|
canRedo: this.currentCanRedo,
|
|
@@ -17367,7 +16590,7 @@ var ConnectWebEngine = class {
|
|
|
17367
16590
|
this._sessionId = null;
|
|
17368
16591
|
this.stopSubscribe();
|
|
17369
16592
|
this.currentBundle = null;
|
|
17370
|
-
this.
|
|
16593
|
+
this.currentArrangement = {};
|
|
17371
16594
|
this.currentView = null;
|
|
17372
16595
|
return { status: res.status };
|
|
17373
16596
|
}
|
|
@@ -17414,7 +16637,7 @@ var ConnectWebEngine = class {
|
|
|
17414
16637
|
if (res.success) {
|
|
17415
16638
|
await stateUpdated;
|
|
17416
16639
|
}
|
|
17417
|
-
return { success: res.success, errors };
|
|
16640
|
+
return { success: res.success, errors, created: res.created.map(convertCreatedRef) };
|
|
17418
16641
|
}
|
|
17419
16642
|
connect(source, target, sourceOutput, targetInput) {
|
|
17420
16643
|
return this.applyAction({
|
|
@@ -17462,9 +16685,6 @@ var ConnectWebEngine = class {
|
|
|
17462
16685
|
copyInstances(instanceIds) {
|
|
17463
16686
|
return this.applyAction({ copy_instances: { instance_ids: instanceIds } });
|
|
17464
16687
|
}
|
|
17465
|
-
syncLayout(positions) {
|
|
17466
|
-
return this.applyAction({ sync_layout: { positions } });
|
|
17467
|
-
}
|
|
17468
16688
|
setVariables(variables) {
|
|
17469
16689
|
return this.applyAction({
|
|
17470
16690
|
set_variables: {
|
|
@@ -17561,21 +16781,11 @@ var ConnectWebEngine = class {
|
|
|
17561
16781
|
return this.applyAction({ redo: {} });
|
|
17562
16782
|
}
|
|
17563
16783
|
// ── Groups ──
|
|
17564
|
-
createGroup(
|
|
17565
|
-
return this.applyAction({ create_group: {
|
|
16784
|
+
createGroup(nodeIds) {
|
|
16785
|
+
return this.applyAction({ create_group: { node_ids: nodeIds } });
|
|
17566
16786
|
}
|
|
17567
|
-
|
|
17568
|
-
return this.applyAction({
|
|
17569
|
-
update_group: {
|
|
17570
|
-
group_id: groupId,
|
|
17571
|
-
label: updates.label,
|
|
17572
|
-
collapsed: updates.collapsed,
|
|
17573
|
-
node_ids: updates.node_ids ? { node_ids: updates.node_ids } : void 0
|
|
17574
|
-
}
|
|
17575
|
-
});
|
|
17576
|
-
}
|
|
17577
|
-
deleteGroup(groupId) {
|
|
17578
|
-
return this.applyAction({ delete_group: { group_id: groupId } });
|
|
16787
|
+
ungroup(groupId) {
|
|
16788
|
+
return this.applyAction({ ungroup: { group_id: groupId } });
|
|
17579
16789
|
}
|
|
17580
16790
|
// ── Queries ──
|
|
17581
16791
|
async queryNodeConfig(instanceId) {
|
|
@@ -17667,8 +16877,7 @@ var ConnectWebEngine = class {
|
|
|
17667
16877
|
name: params.name,
|
|
17668
16878
|
system: params.system,
|
|
17669
16879
|
version: params.version,
|
|
17670
|
-
organization: params.organization ?? ""
|
|
17671
|
-
position: params.position
|
|
16880
|
+
organization: params.organization ?? ""
|
|
17672
16881
|
}
|
|
17673
16882
|
});
|
|
17674
16883
|
}
|
|
@@ -17823,6 +17032,9 @@ function convertGraphError(e) {
|
|
|
17823
17032
|
message: e.message
|
|
17824
17033
|
};
|
|
17825
17034
|
}
|
|
17035
|
+
function convertCreatedRef(r) {
|
|
17036
|
+
return { scope: r.scope, id: r.id, moduleKey: r.module_key, sourceId: r.source_id };
|
|
17037
|
+
}
|
|
17826
17038
|
function protoModuleMetadataToCanvas(p) {
|
|
17827
17039
|
return {
|
|
17828
17040
|
id: p.id,
|
|
@@ -17934,7 +17146,7 @@ var PostMessageEngine = class {
|
|
|
17934
17146
|
this.pending = /* @__PURE__ */ new Map();
|
|
17935
17147
|
this.listeners = /* @__PURE__ */ new Set();
|
|
17936
17148
|
this.currentBundle = null;
|
|
17937
|
-
this.
|
|
17149
|
+
this.currentArrangement = {};
|
|
17938
17150
|
this.currentCanUndo = false;
|
|
17939
17151
|
this.currentCanRedo = false;
|
|
17940
17152
|
this.currentIsDirty = false;
|
|
@@ -17996,18 +17208,43 @@ var PostMessageEngine = class {
|
|
|
17996
17208
|
getCurrentView() {
|
|
17997
17209
|
return this.currentView;
|
|
17998
17210
|
}
|
|
17211
|
+
getCurrentBundle() {
|
|
17212
|
+
return this.currentBundle;
|
|
17213
|
+
}
|
|
17214
|
+
/**
|
|
17215
|
+
* Replace the consumer-owned arrangement and re-project immediately —
|
|
17216
|
+
* this is a local view refresh, not a mutation, so it never waits on a
|
|
17217
|
+
* round-trip and never carries a viewport intent (the consumer's camera
|
|
17218
|
+
* position is unaffected by a drag/collapse/rename it already applied
|
|
17219
|
+
* optimistically).
|
|
17220
|
+
*/
|
|
17221
|
+
setArrangement(arrangement) {
|
|
17222
|
+
this.currentArrangement = arrangement;
|
|
17223
|
+
this.reproject();
|
|
17224
|
+
}
|
|
17999
17225
|
emit(event) {
|
|
18000
17226
|
for (const listener of this.listeners) listener(event);
|
|
18001
17227
|
}
|
|
17228
|
+
reproject() {
|
|
17229
|
+
if (!this.currentBundle) return;
|
|
17230
|
+
const { id: moduleName } = parseModuleKey2(this.currentBundle.entry);
|
|
17231
|
+
const view = projectCanvasView2(this.currentBundle, this.currentArrangement, {
|
|
17232
|
+
moduleName,
|
|
17233
|
+
canUndo: this.currentCanUndo,
|
|
17234
|
+
canRedo: this.currentCanRedo,
|
|
17235
|
+
isDirty: this.currentIsDirty
|
|
17236
|
+
});
|
|
17237
|
+
this.currentView = view;
|
|
17238
|
+
this.emit({ type: "stateUpdated", view });
|
|
17239
|
+
}
|
|
18002
17240
|
adoptState(state, viewportIntent) {
|
|
18003
17241
|
if (!state.bundle) return;
|
|
18004
17242
|
this.currentBundle = state.bundle;
|
|
18005
|
-
this.currentLayouts = state.layouts ?? {};
|
|
18006
17243
|
this.currentCanUndo = state.can_undo;
|
|
18007
17244
|
this.currentCanRedo = state.can_redo;
|
|
18008
17245
|
this.currentIsDirty = state.is_dirty;
|
|
18009
17246
|
const { id: moduleName } = parseModuleKey2(this.currentBundle.entry);
|
|
18010
|
-
const view = projectCanvasView2(this.currentBundle, this.
|
|
17247
|
+
const view = projectCanvasView2(this.currentBundle, this.currentArrangement, {
|
|
18011
17248
|
moduleName,
|
|
18012
17249
|
canUndo: this.currentCanUndo,
|
|
18013
17250
|
canRedo: this.currentCanRedo,
|
|
@@ -18067,13 +17304,15 @@ var PostMessageEngine = class {
|
|
|
18067
17304
|
// `loadState` message the host emits after subscribing to the CLI.
|
|
18068
17305
|
async applyAction(action) {
|
|
18069
17306
|
const stateUpdated = this.nextStateUpdate();
|
|
18070
|
-
const res = await this.call("action/apply", {
|
|
18071
|
-
action
|
|
18072
|
-
});
|
|
17307
|
+
const res = await this.call("action/apply", { action });
|
|
18073
17308
|
if (res.success) {
|
|
18074
17309
|
await stateUpdated;
|
|
18075
17310
|
}
|
|
18076
|
-
return {
|
|
17311
|
+
return {
|
|
17312
|
+
success: res.success,
|
|
17313
|
+
errors: res.errors,
|
|
17314
|
+
created: (res.created ?? []).map(convertCreatedRef2)
|
|
17315
|
+
};
|
|
18077
17316
|
}
|
|
18078
17317
|
// ── Session ──
|
|
18079
17318
|
async sessionOpen(filePath, workspaceName) {
|
|
@@ -18142,9 +17381,6 @@ var PostMessageEngine = class {
|
|
|
18142
17381
|
copyInstances(instanceIds) {
|
|
18143
17382
|
return this.applyAction({ copy_instances: { instance_ids: instanceIds } });
|
|
18144
17383
|
}
|
|
18145
|
-
syncLayout(positions) {
|
|
18146
|
-
return this.applyAction({ sync_layout: { positions } });
|
|
18147
|
-
}
|
|
18148
17384
|
setVariables(variables) {
|
|
18149
17385
|
return this.applyAction({
|
|
18150
17386
|
set_variables: {
|
|
@@ -18246,27 +17482,16 @@ var PostMessageEngine = class {
|
|
|
18246
17482
|
name: params.name,
|
|
18247
17483
|
system: params.system,
|
|
18248
17484
|
version: params.version,
|
|
18249
|
-
organization: params.organization ?? ""
|
|
18250
|
-
position: params.position
|
|
17485
|
+
organization: params.organization ?? ""
|
|
18251
17486
|
}
|
|
18252
17487
|
});
|
|
18253
17488
|
}
|
|
18254
17489
|
// ── Groups ──
|
|
18255
|
-
createGroup(
|
|
18256
|
-
return this.applyAction({ create_group: {
|
|
18257
|
-
}
|
|
18258
|
-
updateGroup(groupId, updates) {
|
|
18259
|
-
return this.applyAction({
|
|
18260
|
-
update_group: {
|
|
18261
|
-
group_id: groupId,
|
|
18262
|
-
label: updates.label,
|
|
18263
|
-
collapsed: updates.collapsed,
|
|
18264
|
-
node_ids: updates.node_ids ? { node_ids: updates.node_ids } : void 0
|
|
18265
|
-
}
|
|
18266
|
-
});
|
|
17490
|
+
createGroup(nodeIds) {
|
|
17491
|
+
return this.applyAction({ create_group: { node_ids: nodeIds } });
|
|
18267
17492
|
}
|
|
18268
|
-
|
|
18269
|
-
return this.applyAction({
|
|
17493
|
+
ungroup(groupId) {
|
|
17494
|
+
return this.applyAction({ ungroup: { group_id: groupId } });
|
|
18270
17495
|
}
|
|
18271
17496
|
// ── Queries ──
|
|
18272
17497
|
queryNodeConfig(instanceId) {
|
|
@@ -18329,6 +17554,9 @@ var PostMessageEngine = class {
|
|
|
18329
17554
|
});
|
|
18330
17555
|
}
|
|
18331
17556
|
};
|
|
17557
|
+
function convertCreatedRef2(r) {
|
|
17558
|
+
return { scope: r.scope, id: r.id, moduleKey: r.module_key, sourceId: r.source_id };
|
|
17559
|
+
}
|
|
18332
17560
|
function convertPolicyResolution2(p) {
|
|
18333
17561
|
return {
|
|
18334
17562
|
mode: p.mode,
|
|
@@ -18374,7 +17602,8 @@ import { parseModuleKey as parseModuleKey3, projectCanvasView as projectCanvasVi
|
|
|
18374
17602
|
var READ_ONLY_ERROR_MESSAGE = "SnapshotCanvasEngine is read-only";
|
|
18375
17603
|
var READ_ONLY_RESULT = {
|
|
18376
17604
|
success: false,
|
|
18377
|
-
errors: [{ moduleKey: "", instanceId: "", inputName: "", message: READ_ONLY_ERROR_MESSAGE }]
|
|
17605
|
+
errors: [{ moduleKey: "", instanceId: "", inputName: "", message: READ_ONLY_ERROR_MESSAGE }],
|
|
17606
|
+
created: []
|
|
18378
17607
|
};
|
|
18379
17608
|
var EMPTY_NODE_CONFIG = {
|
|
18380
17609
|
instance_id: "",
|
|
@@ -18404,16 +17633,20 @@ var SnapshotCanvasEngine = class {
|
|
|
18404
17633
|
constructor(input) {
|
|
18405
17634
|
this.loadPromise = null;
|
|
18406
17635
|
this.view = null;
|
|
17636
|
+
this.bundle = null;
|
|
17637
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
18407
17638
|
this.input = input;
|
|
18408
17639
|
const injected = "bundleUrl" in input ? input.fetch : void 0;
|
|
18409
17640
|
this.fetchImpl = injected ?? globalThis.fetch.bind(globalThis);
|
|
17641
|
+
this.meta = input.meta ?? {};
|
|
18410
17642
|
if ("bundle" in input) {
|
|
18411
|
-
this.
|
|
17643
|
+
this.bundle = input.bundle;
|
|
17644
|
+
this.view = this.projectInput(input.bundle, input.arrangement, this.meta);
|
|
18412
17645
|
}
|
|
18413
17646
|
}
|
|
18414
|
-
projectInput(bundle,
|
|
17647
|
+
projectInput(bundle, arrangement, meta) {
|
|
18415
17648
|
const { id: moduleName } = parseModuleKey3(bundle.entry);
|
|
18416
|
-
return projectCanvasView3(bundle,
|
|
17649
|
+
return projectCanvasView3(bundle, arrangement, {
|
|
18417
17650
|
moduleName: meta.moduleName ?? moduleName,
|
|
18418
17651
|
canUndo: meta.canUndo ?? false,
|
|
18419
17652
|
canRedo: meta.canRedo ?? false,
|
|
@@ -18425,16 +17658,13 @@ var SnapshotCanvasEngine = class {
|
|
|
18425
17658
|
if (!this.loadPromise) {
|
|
18426
17659
|
const input = this.input;
|
|
18427
17660
|
if (!("bundleUrl" in input)) {
|
|
18428
|
-
throw new Error("SnapshotCanvasEngine: no view and no
|
|
17661
|
+
throw new Error("SnapshotCanvasEngine: no view and no URL to fetch");
|
|
18429
17662
|
}
|
|
18430
17663
|
this.loadPromise = (async () => {
|
|
18431
|
-
const
|
|
18432
|
-
this.fetchBytes(input.bundleUrl, "bundle", input.headers),
|
|
18433
|
-
this.fetchBytes(input.layoutsUrl, "layouts", input.headers)
|
|
18434
|
-
]);
|
|
17664
|
+
const bundleBytes = await this.fetchBytes(input.bundleUrl, "bundle", input.headers);
|
|
18435
17665
|
const bundle = Bundle.decode(bundleBytes);
|
|
18436
|
-
|
|
18437
|
-
const view = this.projectInput(bundle,
|
|
17666
|
+
this.bundle = bundle;
|
|
17667
|
+
const view = this.projectInput(bundle, input.arrangement, this.meta);
|
|
18438
17668
|
this.view = view;
|
|
18439
17669
|
return view;
|
|
18440
17670
|
})();
|
|
@@ -18458,6 +17688,20 @@ var SnapshotCanvasEngine = class {
|
|
|
18458
17688
|
getCurrentView() {
|
|
18459
17689
|
return this.view;
|
|
18460
17690
|
}
|
|
17691
|
+
getCurrentBundle() {
|
|
17692
|
+
return this.bundle;
|
|
17693
|
+
}
|
|
17694
|
+
// Re-projecting from a new arrangement is a pure local recompute, not an
|
|
17695
|
+
// IR mutation — a read-only mount (portal's control-plane dashboard)
|
|
17696
|
+
// still lets users expand/collapse groups and drag nodes as view-only
|
|
17697
|
+
// operations, and this is the single projection site those operations
|
|
17698
|
+
// route through, same as the mutating engines.
|
|
17699
|
+
setArrangement(arrangement) {
|
|
17700
|
+
if (!this.bundle) return;
|
|
17701
|
+
const view = this.projectInput(this.bundle, arrangement, this.meta);
|
|
17702
|
+
this.view = view;
|
|
17703
|
+
for (const listener of this.listeners) listener({ type: "stateUpdated", view });
|
|
17704
|
+
}
|
|
18461
17705
|
// ── Session ──────────────────────────────────────────────────────────
|
|
18462
17706
|
async sessionOpen() {
|
|
18463
17707
|
return this.loadView();
|
|
@@ -18503,9 +17747,6 @@ var SnapshotCanvasEngine = class {
|
|
|
18503
17747
|
async copyInstances(_instanceIds) {
|
|
18504
17748
|
return READ_ONLY_RESULT;
|
|
18505
17749
|
}
|
|
18506
|
-
async syncLayout(_positions) {
|
|
18507
|
-
return READ_ONLY_RESULT;
|
|
18508
|
-
}
|
|
18509
17750
|
async setVariables(_variables) {
|
|
18510
17751
|
return READ_ONLY_RESULT;
|
|
18511
17752
|
}
|
|
@@ -18539,13 +17780,10 @@ var SnapshotCanvasEngine = class {
|
|
|
18539
17780
|
async placeModule(_params) {
|
|
18540
17781
|
return READ_ONLY_RESULT;
|
|
18541
17782
|
}
|
|
18542
|
-
async createGroup(
|
|
18543
|
-
return READ_ONLY_RESULT;
|
|
18544
|
-
}
|
|
18545
|
-
async updateGroup(_groupId, _updates) {
|
|
17783
|
+
async createGroup(_nodeIds) {
|
|
18546
17784
|
return READ_ONLY_RESULT;
|
|
18547
17785
|
}
|
|
18548
|
-
async
|
|
17786
|
+
async ungroup(_groupId) {
|
|
18549
17787
|
return READ_ONLY_RESULT;
|
|
18550
17788
|
}
|
|
18551
17789
|
// ── Queries (best-effort / empty) ────────────────────────────────────
|
|
@@ -18596,6 +17834,7 @@ var SnapshotCanvasEngine = class {
|
|
|
18596
17834
|
// ── Events ───────────────────────────────────────────────────────────
|
|
18597
17835
|
onEvent(listener) {
|
|
18598
17836
|
let cancelled = false;
|
|
17837
|
+
this.listeners.add(listener);
|
|
18599
17838
|
const deliver = (view) => {
|
|
18600
17839
|
if (cancelled) return;
|
|
18601
17840
|
const event = { type: "stateUpdated", view };
|
|
@@ -18605,11 +17844,17 @@ var SnapshotCanvasEngine = class {
|
|
|
18605
17844
|
const view = this.view;
|
|
18606
17845
|
queueMicrotask(() => deliver(view));
|
|
18607
17846
|
} else {
|
|
18608
|
-
void this.loadView().then(deliver).catch(() => {
|
|
17847
|
+
void this.loadView().then(deliver).catch((err) => {
|
|
17848
|
+
if (cancelled) return;
|
|
17849
|
+
listener({
|
|
17850
|
+
type: "loadError",
|
|
17851
|
+
message: err instanceof Error ? err.message : String(err)
|
|
17852
|
+
});
|
|
18609
17853
|
});
|
|
18610
17854
|
}
|
|
18611
17855
|
return () => {
|
|
18612
17856
|
cancelled = true;
|
|
17857
|
+
this.listeners.delete(listener);
|
|
18613
17858
|
};
|
|
18614
17859
|
}
|
|
18615
17860
|
};
|