@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.
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valerypopoff/rivet2-core",
3
- "version": "2.31.0",
3
+ "version": "2.32.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/cjs/bundle.cjs",
6
6
  "module": "dist/esm/index.js",