@2112-lab/central-plant 0.3.28 → 0.3.29

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.
@@ -139,7 +139,7 @@ var ComponentTooltipManager = /*#__PURE__*/function (_BaseDisposable) {
139
139
  var currentVal = (_ref = storedVal !== null && storedVal !== void 0 ? storedVal : binaryState.defaultValue) !== null && _ref !== void 0 ? _ref : false;
140
140
  var newVal = !Boolean(currentVal);
141
141
  this._stateAdapter.setState(scopedAttachmentId, dpId, newVal);
142
- (_this$sceneViewer = this.sceneViewer) === null || _this$sceneViewer === void 0 || (_this$sceneViewer = _this$sceneViewer.managers) === null || _this$sceneViewer === void 0 || (_this$sceneViewer = _this$sceneViewer.ioAnimationManager) === null || _this$sceneViewer === void 0 || _this$sceneViewer.triggerState(attachmentId, dpId, newVal, parentUuid);
142
+ (_this$sceneViewer = this.sceneViewer) === null || _this$sceneViewer === void 0 || (_this$sceneViewer = _this$sceneViewer.managers) === null || _this$sceneViewer === void 0 || (_this$sceneViewer = _this$sceneViewer.ioBehaviorManager) === null || _this$sceneViewer === void 0 || _this$sceneViewer.triggerState(attachmentId, dpId, newVal, parentUuid);
143
143
  console.log("\uD83D\uDD04 [IODevice] Toggled ".concat(scopedAttachmentId, ".").concat(dpId, ": ").concat(currentVal, " \u2192 ").concat(newVal));
144
144
  }
145
145
 
@@ -172,8 +172,8 @@ var ComponentTooltipManager = /*#__PURE__*/function (_BaseDisposable) {
172
172
  obj = obj.parent;
173
173
  }
174
174
  var scopedAttachmentId = this._getScopedAttachmentKey(attachmentId, parentUuid);
175
- var ioAnimMgr = (_this$sceneViewer2 = this.sceneViewer) === null || _this$sceneViewer2 === void 0 || (_this$sceneViewer2 = _this$sceneViewer2.managers) === null || _this$sceneViewer2 === void 0 ? void 0 : _this$sceneViewer2.ioAnimationManager;
176
- var dataPoints = ((ioAnimMgr === null || ioAnimMgr === void 0 ? void 0 : ioAnimMgr.getAnimationDataPoints(parentUuid, attachmentId)) || []).concat((ud === null || ud === void 0 ? void 0 : ud.dataPoints) || [])
175
+ var ioBehavMgr = (_this$sceneViewer2 = this.sceneViewer) === null || _this$sceneViewer2 === void 0 || (_this$sceneViewer2 = _this$sceneViewer2.managers) === null || _this$sceneViewer2 === void 0 ? void 0 : _this$sceneViewer2.ioBehaviorManager;
176
+ var dataPoints = ((ioBehavMgr === null || ioBehavMgr === void 0 ? void 0 : ioBehavMgr.getAnimationDataPoints(parentUuid, attachmentId)) || []).concat((ud === null || ud === void 0 ? void 0 : ud.dataPoints) || [])
177
177
  // deduplicate by id
178
178
  .filter(function (dp, i, arr) {
179
179
  return arr.findIndex(function (d) {
@@ -302,7 +302,7 @@ var ComponentTooltipManager = /*#__PURE__*/function (_BaseDisposable) {
302
302
  dp = _ref2.dp;
303
303
  var dpId = dp.id;
304
304
  (_this$_stateAdapter = this._stateAdapter) === null || _this$_stateAdapter === void 0 || _this$_stateAdapter.setState(scopedAttachmentId, dpId, newVal);
305
- (_this$sceneViewer3 = this.sceneViewer) === null || _this$sceneViewer3 === void 0 || (_this$sceneViewer3 = _this$sceneViewer3.managers) === null || _this$sceneViewer3 === void 0 || (_this$sceneViewer3 = _this$sceneViewer3.ioAnimationManager) === null || _this$sceneViewer3 === void 0 || _this$sceneViewer3.triggerState(attachmentId, dpId, newVal, parentUuid);
305
+ (_this$sceneViewer3 = this.sceneViewer) === null || _this$sceneViewer3 === void 0 || (_this$sceneViewer3 = _this$sceneViewer3.managers) === null || _this$sceneViewer3 === void 0 || (_this$sceneViewer3 = _this$sceneViewer3.ioBehaviorManager) === null || _this$sceneViewer3 === void 0 || _this$sceneViewer3.triggerState(attachmentId, dpId, newVal, parentUuid);
306
306
  }
307
307
 
308
308
  /**
@@ -427,11 +427,11 @@ var ComponentTooltipManager = /*#__PURE__*/function (_BaseDisposable) {
427
427
  var _this3$sceneViewer$ma, _this3$sceneViewer;
428
428
  var attachmentId = child.userData.attachmentId || '';
429
429
 
430
- // Use only data points from the animate window (animationConfig).
430
+ // Use only data points from the animate window (behaviorConfig).
431
431
  // The static ioConfig.states[] snapshot on userData is intentionally ignored.
432
- var dataPoints = (_this3$sceneViewer$ma = (_this3$sceneViewer = _this3.sceneViewer) === null || _this3$sceneViewer === void 0 || (_this3$sceneViewer = _this3$sceneViewer.managers) === null || _this3$sceneViewer === void 0 || (_this3$sceneViewer = _this3$sceneViewer.ioAnimationManager) === null || _this3$sceneViewer === void 0 ? void 0 : _this3$sceneViewer.getAnimationDataPoints(parentUuid, attachmentId)) !== null && _this3$sceneViewer$ma !== void 0 ? _this3$sceneViewer$ma : [];
432
+ var dataPoints = (_this3$sceneViewer$ma = (_this3$sceneViewer = _this3.sceneViewer) === null || _this3$sceneViewer === void 0 || (_this3$sceneViewer = _this3$sceneViewer.managers) === null || _this3$sceneViewer === void 0 || (_this3$sceneViewer = _this3$sceneViewer.ioBehaviorManager) === null || _this3$sceneViewer === void 0 ? void 0 : _this3$sceneViewer.getAnimationDataPoints(parentUuid, attachmentId)) !== null && _this3$sceneViewer$ma !== void 0 ? _this3$sceneViewer$ma : [];
433
433
 
434
- // When data points come from animationConfig they already carry direction:'input'.
434
+ // When data points come from behaviorConfig they already carry direction:'input'.
435
435
  // Pass null so _buildDataPointRow uses the per-dp direction instead of the
436
436
  // device-level ioDirection (which may be 'output' and would hide controls).
437
437
  var deviceDirection = dataPoints.length > 0 ? null : child.userData.ioDirection || 'output';
@@ -670,7 +670,7 @@ var ComponentTooltipManager = /*#__PURE__*/function (_BaseDisposable) {
670
670
  var _this5$_stateAdapter, _this5$selectedObject, _this5$sceneViewer;
671
671
  (_this5$_stateAdapter = _this5._stateAdapter) === null || _this5$_stateAdapter === void 0 || _this5$_stateAdapter.setState(scopedAttachmentId, dpId, newVal);
672
672
  var parentUuid = ((_this5$selectedObject = _this5.selectedObject) === null || _this5$selectedObject === void 0 ? void 0 : _this5$selectedObject.uuid) || null;
673
- (_this5$sceneViewer = _this5.sceneViewer) === null || _this5$sceneViewer === void 0 || (_this5$sceneViewer = _this5$sceneViewer.managers) === null || _this5$sceneViewer === void 0 || (_this5$sceneViewer = _this5$sceneViewer.ioAnimationManager) === null || _this5$sceneViewer === void 0 || _this5$sceneViewer.triggerState(originalAttachmentId || scopedAttachmentId, dpId, newVal, parentUuid);
673
+ (_this5$sceneViewer = _this5.sceneViewer) === null || _this5$sceneViewer === void 0 || (_this5$sceneViewer = _this5$sceneViewer.managers) === null || _this5$sceneViewer === void 0 || (_this5$sceneViewer = _this5$sceneViewer.ioBehaviorManager) === null || _this5$sceneViewer === void 0 || _this5$sceneViewer.triggerState(originalAttachmentId || scopedAttachmentId, dpId, newVal, parentUuid);
674
674
  });
675
675
  row.appendChild(ctrl);
676
676
  this._stateElements.set(key, {
@@ -53,7 +53,7 @@ var ModelManager = /*#__PURE__*/function () {
53
53
  key: "loadLibraryModel",
54
54
  value: function () {
55
55
  var _loadLibraryModel = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(targetMesh, jsonEntry, componentData) {
56
- var component, _jsonEntry$userData, _jsonEntry$userData2, _jsonEntry$userData3, originalProps, connectorChildren, gltfScene, libraryModel, _this$sceneViewer, ioAnimMgr, _loop, _i, _Object$entries, warmFn, _jsonEntry$userData4, _t;
56
+ var component, _jsonEntry$userData, _jsonEntry$userData2, _jsonEntry$userData3, originalProps, connectorChildren, gltfScene, libraryModel, _this$sceneViewer, ioBehavMgr, _loop, _i, _Object$entries, warmFn, _jsonEntry$userData4, _t;
57
57
  return _regenerator().w(function (_context2) {
58
58
  while (1) switch (_context2.n) {
59
59
  case 0:
@@ -96,22 +96,22 @@ var ModelManager = /*#__PURE__*/function () {
96
96
  _context2.n = 4;
97
97
  return attachIODevicesToComponent(libraryModel, componentData, modelPreloader, originalProps.uuid);
98
98
  case 4:
99
- // Register animation configs for each attached device
100
- ioAnimMgr = (_this$sceneViewer = this.sceneViewer) === null || _this$sceneViewer === void 0 || (_this$sceneViewer = _this$sceneViewer.managers) === null || _this$sceneViewer === void 0 ? void 0 : _this$sceneViewer.ioAnimationManager;
101
- if (!ioAnimMgr) {
99
+ // Register behavior configs for each attached device
100
+ ioBehavMgr = (_this$sceneViewer = this.sceneViewer) === null || _this$sceneViewer === void 0 || (_this$sceneViewer = _this$sceneViewer.managers) === null || _this$sceneViewer === void 0 ? void 0 : _this$sceneViewer.ioBehaviorManager;
101
+ if (!ioBehavMgr) {
102
102
  _context2.n = 8;
103
103
  break;
104
104
  }
105
105
  _loop = /*#__PURE__*/_regenerator().m(function _loop() {
106
- var _modelPreloader$compo, _deviceData$animation;
106
+ var _modelPreloader$compo, _deviceData$behaviorC;
107
107
  var _Object$entries$_i, attachmentId, attachment, deviceData, deviceRoot;
108
108
  return _regenerator().w(function (_context) {
109
109
  while (1) switch (_context.n) {
110
110
  case 0:
111
111
  _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), attachmentId = _Object$entries$_i[0], attachment = _Object$entries$_i[1];
112
112
  deviceData = (_modelPreloader$compo = modelPreloader.componentDictionary) === null || _modelPreloader$compo === void 0 ? void 0 : _modelPreloader$compo[attachment.deviceId];
113
- console.log("[ModelManager] attachment \"".concat(attachmentId, "\" \u2192 deviceId \"").concat(attachment.deviceId, "\" \u2192 animationConfig:"), (_deviceData$animation = deviceData === null || deviceData === void 0 ? void 0 : deviceData.animationConfig) !== null && _deviceData$animation !== void 0 ? _deviceData$animation : 'NONE');
114
- if (deviceData !== null && deviceData !== void 0 && deviceData.animationConfig) {
113
+ console.log("[ModelManager] attachment \"".concat(attachmentId, "\" \u2192 deviceId \"").concat(attachment.deviceId, "\" \u2192 behaviorConfig:"), (_deviceData$behaviorC = deviceData === null || deviceData === void 0 ? void 0 : deviceData.behaviorConfig) !== null && _deviceData$behaviorC !== void 0 ? _deviceData$behaviorC : 'NONE');
114
+ if (deviceData !== null && deviceData !== void 0 && deviceData.behaviorConfig) {
115
115
  _context.n = 1;
116
116
  break;
117
117
  }
@@ -123,7 +123,7 @@ var ModelManager = /*#__PURE__*/function () {
123
123
  if (!deviceRoot && ((_obj$userData = obj.userData) === null || _obj$userData === void 0 ? void 0 : _obj$userData.attachmentId) === attachmentId) deviceRoot = obj;
124
124
  });
125
125
  if (deviceRoot) {
126
- ioAnimMgr.loadAnimations(attachmentId, deviceData.animationConfig, deviceRoot, originalProps.uuid);
126
+ ioBehavMgr.loadBehaviors(attachmentId, deviceData.behaviorConfig, deviceRoot, originalProps.uuid);
127
127
  }
128
128
  case 2:
129
129
  return _context.a(2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2112-lab/central-plant",
3
- "version": "0.3.28",
3
+ "version": "0.3.29",
4
4
  "description": "Utility modules for the Central Plant Application",
5
5
  "main": "dist/bundle/index.js",
6
6
  "module": "dist/esm/src/index.js",