@lace-cloud/proto 0.33.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +27 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.mjs +26 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -33,6 +33,7 @@ __export(index_exports, {
|
|
|
33
33
|
GROUP_HEADER_HEIGHT: () => GROUP_HEADER_HEIGHT,
|
|
34
34
|
GROUP_PADDING: () => GROUP_PADDING,
|
|
35
35
|
HOST_ONLY_METHODS: () => HOST_ONLY_METHODS,
|
|
36
|
+
META_ARGUMENTS: () => META_ARGUMENTS,
|
|
36
37
|
NODE_HEADER_HEIGHT: () => NODE_HEADER_HEIGHT,
|
|
37
38
|
NODE_ROW_HEIGHT: () => NODE_ROW_HEIGHT,
|
|
38
39
|
NODE_WIDTH: () => NODE_WIDTH,
|
|
@@ -3381,6 +3382,9 @@ function isSet2(value) {
|
|
|
3381
3382
|
return value !== null && value !== void 0;
|
|
3382
3383
|
}
|
|
3383
3384
|
|
|
3385
|
+
// src/render.ts
|
|
3386
|
+
var META_ARGUMENTS = ["count", "for_each"];
|
|
3387
|
+
|
|
3384
3388
|
// src/projection/derive-edges.ts
|
|
3385
3389
|
function emitEdgesFromBinding(binding, targetId, toInput, useIds, seen, edges) {
|
|
3386
3390
|
if (binding.out?.module && binding.out.name) {
|
|
@@ -3415,11 +3419,9 @@ function deriveEdges(uses) {
|
|
|
3415
3419
|
for (const [inputName, binding] of Object.entries(inputs)) {
|
|
3416
3420
|
emitEdgesFromBinding(binding, target.id, inputName, useIds, seen, edges);
|
|
3417
3421
|
}
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
if (target.for_each) {
|
|
3422
|
-
emitEdgesFromBinding(target.for_each, target.id, "for_each", useIds, seen, edges);
|
|
3422
|
+
for (const meta of META_ARGUMENTS) {
|
|
3423
|
+
const binding = target[meta];
|
|
3424
|
+
if (binding) emitEdgesFromBinding(binding, target.id, meta, useIds, seen, edges);
|
|
3423
3425
|
}
|
|
3424
3426
|
}
|
|
3425
3427
|
return edges;
|
|
@@ -3435,6 +3437,12 @@ function indexWires(edges) {
|
|
|
3435
3437
|
}
|
|
3436
3438
|
return { inputs, outputs };
|
|
3437
3439
|
}
|
|
3440
|
+
function callWires(wiredIn, wiredOut) {
|
|
3441
|
+
return {
|
|
3442
|
+
call_wired: wiredOut.has(""),
|
|
3443
|
+
meta_wired: META_ARGUMENTS.filter((meta) => wiredIn.has(meta))
|
|
3444
|
+
};
|
|
3445
|
+
}
|
|
3438
3446
|
|
|
3439
3447
|
// src/projection/resolve-schema.ts
|
|
3440
3448
|
function resolveSchema(bundle, use, readOutputs) {
|
|
@@ -3871,7 +3879,7 @@ function groupPinY(row) {
|
|
|
3871
3879
|
return GROUP_HEADER_HEIGHT + (row + 0.5) * NODE_ROW_HEIGHT;
|
|
3872
3880
|
}
|
|
3873
3881
|
function groupInputPinY(group, name) {
|
|
3874
|
-
const row =
|
|
3882
|
+
const row = (group.inputs ?? []).findIndex((pin) => pin.name === name);
|
|
3875
3883
|
return row < 0 ? GROUP_HEADER_HEIGHT / 2 : groupPinY(row);
|
|
3876
3884
|
}
|
|
3877
3885
|
function groupFootprint(group, box) {
|
|
@@ -4115,7 +4123,7 @@ function columnByDepth(ids, edges) {
|
|
|
4115
4123
|
}
|
|
4116
4124
|
|
|
4117
4125
|
// src/projection/project-group.ts
|
|
4118
|
-
function projectGroup(use, target, fullId, parentArrangement) {
|
|
4126
|
+
function projectGroup(use, target, fullId, parentArrangement, wiredIn, wiredOut) {
|
|
4119
4127
|
const childIds = (target.modules ?? []).map((u) => joinPath(fullId, u.id));
|
|
4120
4128
|
const parentGroup = parentArrangement?.groups?.[use.id];
|
|
4121
4129
|
const collapsed = parentGroup ? parentGroup.collapsed : true;
|
|
@@ -4125,7 +4133,8 @@ function projectGroup(use, target, fullId, parentArrangement) {
|
|
|
4125
4133
|
node_ids: childIds,
|
|
4126
4134
|
collapsed,
|
|
4127
4135
|
module_key: use.module,
|
|
4128
|
-
...groupPins(target)
|
|
4136
|
+
...groupPins(target),
|
|
4137
|
+
...callWires(wiredIn, wiredOut)
|
|
4129
4138
|
};
|
|
4130
4139
|
}
|
|
4131
4140
|
function groupPins(target) {
|
|
@@ -4167,7 +4176,7 @@ function projectNode(bundle, use, fullId, wiredIn, wiredOut) {
|
|
|
4167
4176
|
description: out.description,
|
|
4168
4177
|
sensitive: out.sensitive
|
|
4169
4178
|
})),
|
|
4170
|
-
|
|
4179
|
+
...callWires(wiredIn, wiredOut)
|
|
4171
4180
|
};
|
|
4172
4181
|
}
|
|
4173
4182
|
|
|
@@ -4184,7 +4193,14 @@ function projectScope(bundle, mod, use, path, arrangement, children) {
|
|
|
4184
4193
|
for (const child of uses) {
|
|
4185
4194
|
const fullId = joinPath(path, child.id);
|
|
4186
4195
|
if (isGroupUse(bundle, child)) {
|
|
4187
|
-
const group = projectGroup(
|
|
4196
|
+
const group = projectGroup(
|
|
4197
|
+
child,
|
|
4198
|
+
bundle.modules[child.module],
|
|
4199
|
+
fullId,
|
|
4200
|
+
scopeArrangement,
|
|
4201
|
+
wiredIn.get(child.id) ?? /* @__PURE__ */ new Set(),
|
|
4202
|
+
wiredOut.get(child.id) ?? /* @__PURE__ */ new Set()
|
|
4203
|
+
);
|
|
4188
4204
|
const content = children.get(fullId);
|
|
4189
4205
|
if (!content) throw new Error(`projectScope: no layout for group "${fullId}"`);
|
|
4190
4206
|
groups.push(group);
|
|
@@ -5151,6 +5167,7 @@ function checkEngineProtocol(engineVersion, engineProtocol) {
|
|
|
5151
5167
|
GROUP_HEADER_HEIGHT,
|
|
5152
5168
|
GROUP_PADDING,
|
|
5153
5169
|
HOST_ONLY_METHODS,
|
|
5170
|
+
META_ARGUMENTS,
|
|
5154
5171
|
NODE_HEADER_HEIGHT,
|
|
5155
5172
|
NODE_ROW_HEIGHT,
|
|
5156
5173
|
NODE_WIDTH,
|