@2112-lab/central-plant 0.3.44 → 0.3.46

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.
@@ -21,6 +21,7 @@ var keyboardControlsManager = require('../managers/controls/keyboardControlsMana
21
21
  var pathfindingManager = require('../managers/pathfinding/pathfindingManager.js');
22
22
  var PathFlowManager = require('../managers/pathfinding/PathFlowManager.js');
23
23
  var sceneOperationsManager = require('../managers/scene/sceneOperationsManager.js');
24
+ var collisionManager = require('../managers/scene/collisionManager.js');
24
25
  var animationManager = require('../managers/scene/animationManager.js');
25
26
  var cameraControlsManager = require('../managers/controls/cameraControlsManager.js');
26
27
  var componentDragManager = require('../managers/controls/componentDragManager.js');
@@ -169,6 +170,7 @@ var CentralPlantInternals = /*#__PURE__*/function () {
169
170
  this.centralPlant.managers.keyboardControlsManager = new keyboardControlsManager.KeyboardControlsManager(this.centralPlant.sceneViewer);
170
171
  this.centralPlant.managers.pathfindingManager = new pathfindingManager.PathfindingManager(this.centralPlant.sceneViewer);
171
172
  this.centralPlant.managers.pathFlowManager = new PathFlowManager.PathFlowManager(this.centralPlant.sceneViewer);
173
+ this.centralPlant.managers.collisionManager = new collisionManager.CollisionManager(this.centralPlant.sceneViewer);
172
174
  this.centralPlant.managers.sceneOperationsManager = new sceneOperationsManager.SceneOperationsManager(this.centralPlant.sceneViewer);
173
175
  this.centralPlant.managers.animationManager = new animationManager.AnimationManager(this.centralPlant.sceneViewer);
174
176
  this.centralPlant.managers.cameraControlsManager = new cameraControlsManager.CameraControlsManager(this.centralPlant.sceneViewer);
@@ -92,7 +92,6 @@ exports.refreshSceneIntraBehaviors = behaviorSceneUtils.refreshSceneIntraBehavio
92
92
  exports.reregisterSceneBehaviors = behaviorSceneUtils.reregisterSceneBehaviors;
93
93
  exports.scanSceneIoEndpoints = behaviorSceneUtils.scanSceneIoEndpoints;
94
94
  exports.collectSceneLibraryIds = demoSceneUtils.collectSceneLibraryIds;
95
- exports.embedComponentDefinitions = demoSceneUtils.embedComponentDefinitions;
96
95
  exports.getComponentDictionary = demoSceneUtils.getComponentDictionary;
97
96
  exports.applyModelRootTranslation = animationTransformUtils.applyModelRootTranslation;
98
97
  exports.applyModelRootTranslationFromWorldBase = animationTransformUtils.applyModelRootTranslationFromWorldBase;
@@ -52,6 +52,13 @@ var IoBehaviorManager = /*#__PURE__*/function (_BaseDisposable) {
52
52
  /** @type {Map<string, Object[]>} cache key → data point definitions */
53
53
  _this._dataPointsCache = new Map();
54
54
 
55
+ // Listen for object transformations to invalidate world-pose caches
56
+ if (_this.sceneViewer && typeof _this.sceneViewer.on === 'function') {
57
+ _this.sceneViewer.on('objectTransformed', function () {
58
+ return _this.invalidateCaches();
59
+ });
60
+ }
61
+
55
62
  /**
56
63
  * Injected by the host application to read and write I/O device state.
57
64
  * Set via configure(). Shape:
@@ -113,6 +120,13 @@ var IoBehaviorManager = /*#__PURE__*/function (_BaseDisposable) {
113
120
  console.warn("[IoBehaviorManager] Could not find mesh for animation \"".concat(anim.name || anim.stateVariable, "\" (uuid: ").concat(anim.meshUuid, ", name: \"").concat(anim.meshName, "\")"));
114
121
  continue;
115
122
  }
123
+
124
+ // Ensure world matrix is fresh before capturing rest world pose
125
+ if (typeof mesh.updateWorldMatrix === 'function') {
126
+ mesh.updateWorldMatrix(true, false);
127
+ } else {
128
+ mesh.updateMatrixWorld(true);
129
+ }
116
130
  var worldPos = new THREE__namespace.Vector3();
117
131
  mesh.getWorldPosition(worldPos);
118
132
  var worldQuat = new THREE__namespace.Quaternion();
@@ -703,6 +717,40 @@ var IoBehaviorManager = /*#__PURE__*/function (_BaseDisposable) {
703
717
  this._attachmentParentMap.clear();
704
718
  this._dataPointsCache.clear();
705
719
  }
720
+
721
+ /**
722
+ * Invalidate world-space pose caches for all registered entries.
723
+ * Call this when components are moved or rotated to ensure behaviors
724
+ * recalculate their world-space rest pose.
725
+ */
726
+ }, {
727
+ key: "invalidateCaches",
728
+ value: function invalidateCaches() {
729
+ var _iterator9 = _rollupPluginBabelHelpers.createForOfIteratorHelper(this._entries.values()),
730
+ _step9;
731
+ try {
732
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
733
+ var entryList = _step9.value;
734
+ var _iterator0 = _rollupPluginBabelHelpers.createForOfIteratorHelper(entryList),
735
+ _step0;
736
+ try {
737
+ for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
738
+ var entry = _step0.value;
739
+ delete entry._restWorldCache;
740
+ }
741
+ } catch (err) {
742
+ _iterator0.e(err);
743
+ } finally {
744
+ _iterator0.f();
745
+ }
746
+ }
747
+ } catch (err) {
748
+ _iterator9.e(err);
749
+ } finally {
750
+ _iterator9.f();
751
+ }
752
+ this._dataPointsCache.clear();
753
+ }
706
754
  }, {
707
755
  key: "dispose",
708
756
  value: function dispose() {
@@ -781,11 +829,11 @@ var IoBehaviorManager = /*#__PURE__*/function (_BaseDisposable) {
781
829
  var mapping = this._resolveMapping(anim, value);
782
830
  if (!mapping) return;
783
831
  var types = anim.transformTypes || [];
784
- var _iterator9 = _rollupPluginBabelHelpers.createForOfIteratorHelper(types),
785
- _step9;
832
+ var _iterator1 = _rollupPluginBabelHelpers.createForOfIteratorHelper(types),
833
+ _step1;
786
834
  try {
787
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
788
- var type = _step9.value;
835
+ for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
836
+ var type = _step1.value;
789
837
  if (type === 'translation') {
790
838
  this._applyTranslation(entry, mapping.transform);
791
839
  } else if (type === 'rotation') {
@@ -795,9 +843,9 @@ var IoBehaviorManager = /*#__PURE__*/function (_BaseDisposable) {
795
843
  }
796
844
  }
797
845
  } catch (err) {
798
- _iterator9.e(err);
846
+ _iterator1.e(err);
799
847
  } finally {
800
- _iterator9.f();
848
+ _iterator1.f();
801
849
  }
802
850
  }
803
851
 
@@ -957,7 +1005,14 @@ var IoBehaviorManager = /*#__PURE__*/function (_BaseDisposable) {
957
1005
  var savedQuat = mesh.quaternion.clone();
958
1006
  mesh.position.copy(origPos);
959
1007
  mesh.rotation.copy(origRot);
960
- mesh.updateMatrixWorld(true);
1008
+
1009
+ // Ensure all ancestors are updated so getWorldPosition is accurate
1010
+ // even if a parent component was recently moved.
1011
+ if (typeof mesh.updateWorldMatrix === 'function') {
1012
+ mesh.updateWorldMatrix(true, false);
1013
+ } else {
1014
+ mesh.updateMatrixWorld(true);
1015
+ }
961
1016
  var origWorldPos = new THREE__namespace.Vector3();
962
1017
  mesh.getWorldPosition(origWorldPos);
963
1018
  var origWorldQuat = new THREE__namespace.Quaternion();
@@ -667,6 +667,7 @@ var ComponentDragManager = /*#__PURE__*/function (_BaseDisposable) {
667
667
  // Find intersection with ground plane
668
668
  var intersection = this.raycaster.ray.intersectPlane(this.dropPlane, this.dropIntersection);
669
669
  if (intersection) {
670
+ var _this$sceneViewer$col;
670
671
  // Apply 0.5 unit transform snapping to intersection point
671
672
  var snappedPosition = this._applyTransformSnap(intersection);
672
673
  this.dragData.previewObject.position.copy(snappedPosition);
@@ -674,7 +675,7 @@ var ComponentDragManager = /*#__PURE__*/function (_BaseDisposable) {
674
675
 
675
676
  // Check for overlap and update color accordingly
676
677
  var wasOverlapping = this.dragData.isOverlapping;
677
- this.dragData.isOverlapping = this._checkBoundingBoxOverlap();
678
+ this.dragData.isOverlapping = !!((_this$sceneViewer$col = this.sceneViewer.collisionManager) !== null && _this$sceneViewer$col !== void 0 && _this$sceneViewer$col.checkCollision(this.dragData.previewObject));
678
679
 
679
680
  // Update color if overlap state changed
680
681
  if (wasOverlapping !== this.dragData.isOverlapping) {
@@ -0,0 +1,143 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
6
+ var THREE = require('three');
7
+
8
+ function _interopNamespace(e) {
9
+ if (e && e.__esModule) return e;
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n["default"] = e;
23
+ return Object.freeze(n);
24
+ }
25
+
26
+ var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
27
+
28
+ var CollisionManager = /*#__PURE__*/function () {
29
+ /**
30
+ * @param {Object} sceneViewer - The scene viewer instance
31
+ */
32
+ function CollisionManager(sceneViewer) {
33
+ _rollupPluginBabelHelpers.classCallCheck(this, CollisionManager);
34
+ this.sceneViewer = sceneViewer;
35
+ }
36
+
37
+ /**
38
+ * Check if a given object overlaps with any other relevant objects in the scene.
39
+ * @param {THREE.Object3D} object - The object to check for collisions
40
+ * @param {Array<string>} excludeTypes - Object types to exclude from checking (e.g. ['ground'])
41
+ * @returns {Object|null} Collision info {object, objectType} if collision detected, null otherwise
42
+ */
43
+ return _rollupPluginBabelHelpers.createClass(CollisionManager, [{
44
+ key: "checkCollision",
45
+ value: function checkCollision(object) {
46
+ var _this$sceneViewer,
47
+ _this = this;
48
+ var excludeTypes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['isBaseGround', 'isBaseGrid', 'isBrickWall'];
49
+ if (!((_this$sceneViewer = this.sceneViewer) !== null && _this$sceneViewer !== void 0 && _this$sceneViewer.scene) || !object) return null;
50
+
51
+ // Compute high-quality bounding box for the object being checked
52
+ // We use setFromObject here because the target object just moved
53
+ var objectBBox = new THREE__namespace.Box3().setFromObject(object);
54
+
55
+ // Narrow down potential colliders
56
+ var collisionDetected = null;
57
+
58
+ // Optimization: Only check the root-level CP objects to avoid O(N^2) complexity with meshes
59
+ this.sceneViewer.scene.traverse(function (child) {
60
+ var _child$userData, _child$userData2, _child$userData3, _child$userData4, _child$userData5;
61
+ if (collisionDetected) return; // Short circuit
62
+
63
+ // Skip the object itself and its descendants
64
+ if (child === object || _this._isDescendantOf(object, child)) return;
65
+
66
+ // Filter by CP object types at the root level (skip internal meshes during traverse)
67
+ var isCPRootObject = ((_child$userData = child.userData) === null || _child$userData === void 0 ? void 0 : _child$userData.objectType) === 'component' || ((_child$userData2 = child.userData) === null || _child$userData2 === void 0 ? void 0 : _child$userData2.objectType) === 'segment' || ((_child$userData3 = child.userData) === null || _child$userData3 === void 0 ? void 0 : _child$userData3.objectType) === 'gateway' || ((_child$userData4 = child.userData) === null || _child$userData4 === void 0 ? void 0 : _child$userData4.objectType) === 'connector' || ((_child$userData5 = child.userData) === null || _child$userData5 === void 0 ? void 0 : _child$userData5.ioConfig); // IO Device
68
+
69
+ if (isCPRootObject && !_this._shouldExclude(child, excludeTypes)) {
70
+ // Use cached worldBoundingBox if available, otherwise compute it (and cache it)
71
+ var childBBox;
72
+ if (child.userData.worldBoundingBox && !child.userData.isMoving) {
73
+ var _min$x, _min$y, _min$z, _max$x, _max$y, _max$z;
74
+ // Use stored worldBoundingBox (handles array or Box3 format)
75
+ var min = child.userData.worldBoundingBox.min;
76
+ var max = child.userData.worldBoundingBox.max;
77
+ childBBox = new THREE__namespace.Box3(new THREE__namespace.Vector3((_min$x = min.x) !== null && _min$x !== void 0 ? _min$x : min[0], (_min$y = min.y) !== null && _min$y !== void 0 ? _min$y : min[1], (_min$z = min.z) !== null && _min$z !== void 0 ? _min$z : min[2]), new THREE__namespace.Vector3((_max$x = max.x) !== null && _max$x !== void 0 ? _max$x : max[0], (_max$y = max.y) !== null && _max$y !== void 0 ? _max$y : max[1], (_max$z = max.z) !== null && _max$z !== void 0 ? _max$z : max[2]));
78
+ } else {
79
+ // Fallback to high-quality computation for moving objects or first-time checks
80
+ childBBox = new THREE__namespace.Box3().setFromObject(child);
81
+
82
+ // Cache the result for next time (non-moving objects)
83
+ if (!child.userData.isMoving) {
84
+ child.userData.worldBoundingBox = {
85
+ min: [childBBox.min.x, childBBox.min.y, childBBox.min.z],
86
+ max: [childBBox.max.x, childBBox.max.y, childBBox.max.z]
87
+ };
88
+ }
89
+ }
90
+ if (objectBBox.intersectsBox(childBBox)) {
91
+ collisionDetected = {
92
+ object: child,
93
+ objectType: child.userData.objectType,
94
+ uuid: child.uuid,
95
+ name: child.name || child.userData.libraryId || child.uuid
96
+ };
97
+ }
98
+ }
99
+ });
100
+ return collisionDetected;
101
+ }
102
+
103
+ /**
104
+ * Helper to check if a node is a descendant of a specific parent
105
+ * @private
106
+ */
107
+ }, {
108
+ key: "_isDescendantOf",
109
+ value: function _isDescendantOf(parent, child) {
110
+ var node = child.parent;
111
+ while (node !== null) {
112
+ if (node === parent) return true;
113
+ node = node.parent;
114
+ }
115
+ return false;
116
+ }
117
+
118
+ /**
119
+ * Helper to determine if an object should be excluded from collision checking
120
+ * @private
121
+ */
122
+ }, {
123
+ key: "_shouldExclude",
124
+ value: function _shouldExclude(object, excludeTypes) {
125
+ if (object.userData.isPreview) return true;
126
+ var _iterator = _rollupPluginBabelHelpers.createForOfIteratorHelper(excludeTypes),
127
+ _step;
128
+ try {
129
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
130
+ var type = _step.value;
131
+ if (object.userData[type]) return true;
132
+ }
133
+ } catch (err) {
134
+ _iterator.e(err);
135
+ } finally {
136
+ _iterator.f();
137
+ }
138
+ return false;
139
+ }
140
+ }]);
141
+ }();
142
+
143
+ exports.CollisionManager = CollisionManager;
@@ -167,6 +167,8 @@ var SceneExportManager = /*#__PURE__*/function () {
167
167
  // Internal tracking - not needed in export
168
168
  'initialPosition',
169
169
  // Internal tracking - not needed in export
170
+ 'attachedDevices',
171
+ // Stored in smart component dictionary, not scene JSON
170
172
  // Exclude internal segment tracking properties
171
173
  'segmentId',
172
174
  // Internal tracking
@@ -1333,55 +1333,20 @@ var SceneOperationsManager = /*#__PURE__*/function () {
1333
1333
  y: componentModel.scale.y,
1334
1334
  z: componentModel.scale.z
1335
1335
  },
1336
- userData: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, componentModel.userData), {}, {
1336
+ userData: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, function () {
1337
+ var ud = _rollupPluginBabelHelpers.objectSpread2({}, componentModel.userData);
1338
+ delete ud.attachedDevices; // Instance data belongs in dictionary, not scene JSON
1339
+ delete ud.isDeclared; // Runtime flag
1340
+ delete ud.originalUuid; // Runtime tracking
1341
+ return ud;
1342
+ }()), {}, {
1337
1343
  worldBoundingBox: {
1338
1344
  min: boundingBox.min.toArray(),
1339
1345
  max: boundingBox.max.toArray()
1340
1346
  }
1341
- }),
1342
- children: []
1347
+ })
1343
1348
  };
1344
1349
 
1345
- // Process children (connectors, etc.) if they exist
1346
- if (componentModel.children && componentModel.children.length > 0) {
1347
- componentModel.children.forEach(function (child) {
1348
- var _child$userData0, _child$userData1;
1349
- var childType = ((_child$userData0 = child.userData) === null || _child$userData0 === void 0 ? void 0 : _child$userData0.objectType) || ((_child$userData1 = child.userData) === null || _child$userData1 === void 0 ? void 0 : _child$userData1.objectType);
1350
- if (childType === 'connector') {
1351
- var _child$geometry;
1352
- var childBoundingBox = new THREE__namespace.Box3().setFromObject(child);
1353
- var childSceneData = {
1354
- uuid: child.uuid,
1355
- name: child.name,
1356
- type: child.type,
1357
- position: {
1358
- x: child.position.x,
1359
- y: child.position.y,
1360
- z: child.position.z
1361
- },
1362
- rotation: {
1363
- x: THREE__namespace.MathUtils.radToDeg(child.rotation.x),
1364
- y: THREE__namespace.MathUtils.radToDeg(child.rotation.y),
1365
- z: THREE__namespace.MathUtils.radToDeg(child.rotation.z)
1366
- },
1367
- scale: {
1368
- x: child.scale.x,
1369
- y: child.scale.y,
1370
- z: child.scale.z
1371
- },
1372
- userData: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, child.userData), {}, {
1373
- worldBoundingBox: {
1374
- min: childBoundingBox.min.toArray(),
1375
- max: childBoundingBox.max.toArray()
1376
- }
1377
- }),
1378
- geometry: ((_child$geometry = child.geometry) === null || _child$geometry === void 0 ? void 0 : _child$geometry.uuid) || 'CONNECTOR-GEO'
1379
- };
1380
- componentSceneData.children.push(childSceneData);
1381
- }
1382
- });
1383
- }
1384
-
1385
1350
  // Add the component to the scene data
1386
1351
  if (!currentSceneData.scene.children) {
1387
1352
  currentSceneData.scene.children = [];
@@ -1390,7 +1355,6 @@ var SceneOperationsManager = /*#__PURE__*/function () {
1390
1355
  console.log('✅ addComponentToSceneData: Component added to scene data successfully', {
1391
1356
  componentId: componentModel.uuid,
1392
1357
  libraryId: (_componentModel$userD = componentModel.userData) === null || _componentModel$userD === void 0 ? void 0 : _componentModel$userD.libraryId,
1393
- childrenCount: componentSceneData.children.length,
1394
1358
  totalSceneChildren: currentSceneData.scene.children.length
1395
1359
  });
1396
1360
  return true;
@@ -1431,8 +1395,8 @@ var SceneOperationsManager = /*#__PURE__*/function () {
1431
1395
  if (segment.children && segment.children.length > 0) {
1432
1396
  var childrenToRemove = _rollupPluginBabelHelpers.toConsumableArray(segment.children);
1433
1397
  childrenToRemove.forEach(function (child) {
1434
- var _child$userData10;
1435
- if ((_child$userData10 = child.userData) !== null && _child$userData10 !== void 0 && _child$userData10.isPipeElbow) {
1398
+ var _child$userData0;
1399
+ if ((_child$userData0 = child.userData) !== null && _child$userData0 !== void 0 && _child$userData0.isPipeElbow) {
1436
1400
  console.log("\uD83D\uDDD1\uFE0F Removing elbow child from segment before manualization: ".concat(child.uuid));
1437
1401
  segment.remove(child);
1438
1402
  if (child.geometry) child.geometry.dispose();
@@ -56,7 +56,14 @@ function modelOffsetToWorldDelta(modelRoot, offset, customQuat) {
56
56
  function applyModelRootTranslation(mesh, modelRoot, origLocalPos, modelOffset, customQuat) {
57
57
  if (!mesh || !modelRoot || !origLocalPos) return;
58
58
  mesh.position.copy(origLocalPos);
59
- mesh.updateMatrixWorld(true);
59
+
60
+ // Ensure all ancestors are updated so getWorldPosition is accurate
61
+ // even if a parent component was recently moved.
62
+ if (typeof mesh.updateWorldMatrix === 'function') {
63
+ mesh.updateWorldMatrix(true, false);
64
+ } else {
65
+ mesh.updateMatrixWorld(true);
66
+ }
60
67
  var origWorldPos = new THREE__namespace.Vector3();
61
68
  mesh.getWorldPosition(origWorldPos);
62
69
  var newWorldPos = origWorldPos.add(modelOffsetToWorldDelta(modelRoot, modelOffset, customQuat));
@@ -2,22 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
6
-
7
- var _excluded = ["componentDefinitions"];
8
5
  /**
9
- * Helpers for portable demo scene JSON (embedded component definitions).
6
+ * Helpers for portable demo scene JSON.
10
7
  */
11
8
 
12
- function cloneDefinition(def) {
13
- if (!def || _rollupPluginBabelHelpers["typeof"](def) !== 'object') return null;
14
- try {
15
- return JSON.parse(JSON.stringify(def));
16
- } catch (_unused) {
17
- return _rollupPluginBabelHelpers.objectSpread2({}, def);
18
- }
19
- }
20
-
21
9
  /**
22
10
  * Collect unique library IDs referenced by scene nodes.
23
11
  * @param {Object} sceneData
@@ -39,43 +27,6 @@ function collectSceneLibraryIds(sceneData) {
39
27
  return Array.from(ids);
40
28
  }
41
29
 
42
- /**
43
- * Embed component/device definitions required by a scene into the JSON payload.
44
- * @param {Object} sceneData
45
- * @param {Record<string, Object>} componentDictionary
46
- * @returns {Object}
47
- */
48
- function embedComponentDefinitions(sceneData) {
49
- var componentDictionary = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
50
- if (!sceneData || _rollupPluginBabelHelpers["typeof"](sceneData) !== 'object') return sceneData;
51
- var libraryIds = collectSceneLibraryIds(sceneData);
52
- var componentDefinitions = {};
53
- var deviceIds = new Set();
54
- libraryIds.forEach(function (libraryId) {
55
- var def = componentDictionary[libraryId];
56
- if (!def) return;
57
- componentDefinitions[libraryId] = cloneDefinition(def);
58
- var attachedDevices = def.attachedDevices;
59
- if (!attachedDevices || _rollupPluginBabelHelpers["typeof"](attachedDevices) !== 'object') return;
60
- Object.values(attachedDevices).forEach(function (att) {
61
- if (att !== null && att !== void 0 && att.deviceId) deviceIds.add(att.deviceId);
62
- });
63
- });
64
- deviceIds.forEach(function (deviceId) {
65
- if (componentDefinitions[deviceId]) return;
66
- var deviceDef = componentDictionary[deviceId];
67
- if (deviceDef) componentDefinitions[deviceId] = cloneDefinition(deviceDef);
68
- });
69
- if (!Object.keys(componentDefinitions).length) {
70
- sceneData.componentDefinitions;
71
- var rest = _rollupPluginBabelHelpers.objectWithoutProperties(sceneData, _excluded);
72
- return rest;
73
- }
74
- return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, sceneData), {}, {
75
- componentDefinitions: componentDefinitions
76
- });
77
- }
78
-
79
30
  /**
80
31
  * Resolve the live component dictionary from a CentralPlant instance.
81
32
  * @param {Object} centralPlant
@@ -87,5 +38,4 @@ function getComponentDictionary(centralPlant) {
87
38
  }
88
39
 
89
40
  exports.collectSceneLibraryIds = collectSceneLibraryIds;
90
- exports.embedComponentDefinitions = embedComponentDefinitions;
91
41
  exports.getComponentDictionary = getComponentDictionary;