@valerypopoff/rivet2-core 2.31.0 → 2.32.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/cjs/bundle.cjs +14 -8
- package/dist/cjs/bundle.cjs.map +2 -2
- package/dist/cjs/serialization.cjs +3 -1
- package/dist/cjs/serialization.cjs.map +2 -2
- package/dist/esm/model/NodePrefabResolver.js +13 -7
- package/dist/esm/utils/serialization/serialization_v4.js +4 -0
- package/dist/types/model/NodeBase.d.ts +2 -0
- package/package.json +1 -1
|
@@ -31,16 +31,22 @@ export function resolveNodePrefabInstance(project, node) {
|
|
|
31
31
|
title: `Missing library node (${prefabId})`,
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
+
const visualData = {
|
|
35
|
+
...structuredClone(sourceNode.visualData),
|
|
36
|
+
x: node.visualData.x,
|
|
37
|
+
y: node.visualData.y,
|
|
38
|
+
width: node.visualData.width ?? sourceNode.visualData.width,
|
|
39
|
+
zIndex: node.visualData.zIndex,
|
|
40
|
+
};
|
|
41
|
+
// Channel positions belong to each instance's wiring, not the library source.
|
|
42
|
+
if (Array.isArray(node.visualData.dataBusChannelOrder))
|
|
43
|
+
visualData.dataBusChannelOrder = [...node.visualData.dataBusChannelOrder];
|
|
44
|
+
else
|
|
45
|
+
delete visualData.dataBusChannelOrder;
|
|
34
46
|
return {
|
|
35
47
|
...structuredClone(sourceNode),
|
|
36
48
|
id: node.id,
|
|
37
|
-
visualData
|
|
38
|
-
...structuredClone(sourceNode.visualData),
|
|
39
|
-
x: node.visualData.x,
|
|
40
|
-
y: node.visualData.y,
|
|
41
|
-
width: node.visualData.width ?? sourceNode.visualData.width,
|
|
42
|
-
zIndex: node.visualData.zIndex,
|
|
43
|
-
},
|
|
49
|
+
visualData,
|
|
44
50
|
};
|
|
45
51
|
}
|
|
46
52
|
/**
|
|
@@ -148,6 +148,7 @@ function toSerializedNode(node, allNodes, allConnections) {
|
|
|
148
148
|
return {
|
|
149
149
|
description: node.description?.trim() ? node.description : undefined,
|
|
150
150
|
visualData: packVisualDataV4(node),
|
|
151
|
+
dataBusChannelOrder: node.visualData.dataBusChannelOrder,
|
|
151
152
|
isSplitRun: node.isSplitRun ? true : undefined,
|
|
152
153
|
splitRunMax: node.isSplitRun ? node.splitRunMax : undefined,
|
|
153
154
|
splitRunConcurrency: node.isSplitRun ? node.splitRunConcurrency : undefined,
|
|
@@ -185,6 +186,9 @@ function fromSerializedNode(serializedNode, serializedNodeInfo) {
|
|
|
185
186
|
width,
|
|
186
187
|
zIndex,
|
|
187
188
|
color,
|
|
189
|
+
...(Array.isArray(serializedNode.dataBusChannelOrder)
|
|
190
|
+
? { dataBusChannelOrder: serializedNode.dataBusChannelOrder }
|
|
191
|
+
: {}),
|
|
188
192
|
},
|
|
189
193
|
data: serializedNode.data ?? {},
|
|
190
194
|
variants: serializedNode.variants ?? [],
|
|
@@ -27,6 +27,8 @@ export interface NodeBase {
|
|
|
27
27
|
/** The y-coordinate of the node's position. */
|
|
28
28
|
y: number;
|
|
29
29
|
width?: number;
|
|
30
|
+
/** Presentation order of Data Bus channels; port identities and execution are unchanged. */
|
|
31
|
+
dataBusChannelOrder?: number[];
|
|
30
32
|
/** The accent color of the node in the UI. */
|
|
31
33
|
color?: {
|
|
32
34
|
border: string;
|