@2112-lab/central-plant 0.3.27 → 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.
- package/dist/bundle/index.js +82 -911
- package/dist/cjs/src/core/centralPlant.js +8 -115
- package/dist/cjs/src/core/centralPlantInternals.js +13 -24
- package/dist/cjs/src/core/sceneViewer.js +4 -4
- package/dist/cjs/src/index.js +2 -4
- package/dist/cjs/src/managers/behaviors/IoBehaviorManager.js +571 -0
- package/dist/cjs/src/managers/scene/componentTooltipManager.js +17 -24
- package/dist/cjs/src/managers/scene/modelManager.js +8 -8
- package/dist/cjs/src/managers/scene/sceneExportManager.js +3 -29
- package/dist/cjs/src/managers/scene/sceneOperationsManager.js +12 -289
- package/dist/esm/src/core/centralPlant.js +8 -115
- package/dist/esm/src/core/centralPlantInternals.js +13 -24
- package/dist/esm/src/core/sceneViewer.js +4 -4
- package/dist/esm/src/index.js +1 -2
- package/dist/esm/src/managers/behaviors/IoBehaviorManager.js +547 -0
- package/dist/esm/src/managers/scene/componentTooltipManager.js +17 -24
- package/dist/esm/src/managers/scene/modelManager.js +8 -8
- package/dist/esm/src/managers/scene/sceneExportManager.js +4 -30
- package/dist/esm/src/managers/scene/sceneOperationsManager.js +12 -289
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
31
31
|
* Initialize the CentralPlant manager
|
|
32
32
|
*
|
|
33
33
|
* @constructor
|
|
34
|
-
* @version 0.3.
|
|
34
|
+
* @version 0.3.29
|
|
35
35
|
* @updated 2025-10-22
|
|
36
36
|
*
|
|
37
37
|
* @description Creates a new CentralPlant instance and initializes internal managers and utilities.
|
|
@@ -1065,107 +1065,6 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1065
1065
|
};
|
|
1066
1066
|
}
|
|
1067
1067
|
|
|
1068
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
1069
|
-
// BEHAVIORS API
|
|
1070
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
1071
|
-
|
|
1072
|
-
/**
|
|
1073
|
-
* Get all behavior definitions currently stored in the BehaviorManager.
|
|
1074
|
-
* @returns {Array<Object>} Array of behavior definition objects, or empty array.
|
|
1075
|
-
* @example
|
|
1076
|
-
* const behaviors = centralPlant.getBehaviors()
|
|
1077
|
-
* behaviors.forEach(b => console.log(b.id, b.input, b.output))
|
|
1078
|
-
*/
|
|
1079
|
-
}, {
|
|
1080
|
-
key: "getBehaviors",
|
|
1081
|
-
value: function getBehaviors() {
|
|
1082
|
-
var _this$sceneViewer4;
|
|
1083
|
-
var bm = (_this$sceneViewer4 = this.sceneViewer) === null || _this$sceneViewer4 === void 0 || (_this$sceneViewer4 = _this$sceneViewer4.managers) === null || _this$sceneViewer4 === void 0 ? void 0 : _this$sceneViewer4.behaviorManager;
|
|
1084
|
-
if (!bm) {
|
|
1085
|
-
console.warn('⚠️ getBehaviors(): BehaviorManager not available');
|
|
1086
|
-
return [];
|
|
1087
|
-
}
|
|
1088
|
-
return bm.getBehaviors();
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
/**
|
|
1092
|
-
* Add a behavior definition at runtime.
|
|
1093
|
-
* @param {Object} behaviorDef - Full behavior definition object (must have unique `id`)
|
|
1094
|
-
* @returns {boolean} True if added successfully, false otherwise
|
|
1095
|
-
* @example
|
|
1096
|
-
* centralPlant.addBehavior({
|
|
1097
|
-
* id: 'my-behavior',
|
|
1098
|
-
* input: { attachment: 'device-01', dataPoint: 'boolean-status-01' },
|
|
1099
|
-
* output: { attachment: 'light-01', child: 'indicator-mesh-01' },
|
|
1100
|
-
* conditions: [{ when: 'dataPoint.value === true', actions: [{ set: 'material.emissiveIntensity', value: 1.0 }] }]
|
|
1101
|
-
* })
|
|
1102
|
-
*/
|
|
1103
|
-
}, {
|
|
1104
|
-
key: "addBehavior",
|
|
1105
|
-
value: function addBehavior(behaviorDef) {
|
|
1106
|
-
var _this$sceneViewer5, _this$sceneViewer6;
|
|
1107
|
-
var bm = (_this$sceneViewer5 = this.sceneViewer) === null || _this$sceneViewer5 === void 0 || (_this$sceneViewer5 = _this$sceneViewer5.managers) === null || _this$sceneViewer5 === void 0 ? void 0 : _this$sceneViewer5.behaviorManager;
|
|
1108
|
-
if (!bm) {
|
|
1109
|
-
console.warn('⚠️ addBehavior(): BehaviorManager not available');
|
|
1110
|
-
return false;
|
|
1111
|
-
}
|
|
1112
|
-
// Also persist into currentSceneData so export includes it
|
|
1113
|
-
if ((_this$sceneViewer6 = this.sceneViewer) !== null && _this$sceneViewer6 !== void 0 && _this$sceneViewer6.currentSceneData) {
|
|
1114
|
-
if (!Array.isArray(this.sceneViewer.currentSceneData.behaviors)) {
|
|
1115
|
-
this.sceneViewer.currentSceneData.behaviors = [];
|
|
1116
|
-
}
|
|
1117
|
-
this.sceneViewer.currentSceneData.behaviors.push(behaviorDef);
|
|
1118
|
-
}
|
|
1119
|
-
return bm.addBehavior(behaviorDef);
|
|
1120
|
-
}
|
|
1121
|
-
|
|
1122
|
-
/**
|
|
1123
|
-
* Remove a behavior definition by id.
|
|
1124
|
-
* @param {string} behaviorId
|
|
1125
|
-
* @returns {boolean} True if removed, false if not found
|
|
1126
|
-
* @example
|
|
1127
|
-
* centralPlant.removeBehavior('my-behavior')
|
|
1128
|
-
*/
|
|
1129
|
-
}, {
|
|
1130
|
-
key: "removeBehavior",
|
|
1131
|
-
value: function removeBehavior(behaviorId) {
|
|
1132
|
-
var _this$sceneViewer7, _this$sceneViewer8;
|
|
1133
|
-
var bm = (_this$sceneViewer7 = this.sceneViewer) === null || _this$sceneViewer7 === void 0 || (_this$sceneViewer7 = _this$sceneViewer7.managers) === null || _this$sceneViewer7 === void 0 ? void 0 : _this$sceneViewer7.behaviorManager;
|
|
1134
|
-
if (!bm) {
|
|
1135
|
-
console.warn('⚠️ removeBehavior(): BehaviorManager not available');
|
|
1136
|
-
return false;
|
|
1137
|
-
}
|
|
1138
|
-
// Also remove from currentSceneData
|
|
1139
|
-
if ((_this$sceneViewer8 = this.sceneViewer) !== null && _this$sceneViewer8 !== void 0 && (_this$sceneViewer8 = _this$sceneViewer8.currentSceneData) !== null && _this$sceneViewer8 !== void 0 && _this$sceneViewer8.behaviors) {
|
|
1140
|
-
var idx = this.sceneViewer.currentSceneData.behaviors.findIndex(function (b) {
|
|
1141
|
-
return b.id === behaviorId;
|
|
1142
|
-
});
|
|
1143
|
-
if (idx !== -1) this.sceneViewer.currentSceneData.behaviors.splice(idx, 1);
|
|
1144
|
-
}
|
|
1145
|
-
return bm.removeBehavior(behaviorId);
|
|
1146
|
-
}
|
|
1147
|
-
|
|
1148
|
-
/**
|
|
1149
|
-
* Simulate an IO device state value arriving and trigger any matching behaviors.
|
|
1150
|
-
* Useful for live testing in the UI or for integration with real data feeds.
|
|
1151
|
-
* @param {string} attachmentId - The attachment id of the input io-device
|
|
1152
|
-
* @param {string} stateId - The state id on that device
|
|
1153
|
-
* @param {*} value - The new state value
|
|
1154
|
-
* @example
|
|
1155
|
-
* centralPlant.triggerState('pump-push-button-01', 'power', true)
|
|
1156
|
-
*/
|
|
1157
|
-
}, {
|
|
1158
|
-
key: "triggerState",
|
|
1159
|
-
value: function triggerState(attachmentId, stateId, value, parentUuid) {
|
|
1160
|
-
var _this$sceneViewer9;
|
|
1161
|
-
var bm = (_this$sceneViewer9 = this.sceneViewer) === null || _this$sceneViewer9 === void 0 || (_this$sceneViewer9 = _this$sceneViewer9.managers) === null || _this$sceneViewer9 === void 0 ? void 0 : _this$sceneViewer9.behaviorManager;
|
|
1162
|
-
if (!bm) {
|
|
1163
|
-
console.warn('⚠️ triggerState(): BehaviorManager not available');
|
|
1164
|
-
return;
|
|
1165
|
-
}
|
|
1166
|
-
bm.triggerState(attachmentId, stateId, value, parentUuid);
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
1068
|
/**
|
|
1170
1069
|
* Set the state of an I/O device instance in the Three.js scene.
|
|
1171
1070
|
*
|
|
@@ -1198,15 +1097,9 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1198
1097
|
}, {
|
|
1199
1098
|
key: "setIoDeviceState",
|
|
1200
1099
|
value: function setIoDeviceState(attachmentId, stateId, value, parentUuid) {
|
|
1201
|
-
var _this$
|
|
1202
|
-
var bm = (_this$sceneViewer0 = this.sceneViewer) === null || _this$sceneViewer0 === void 0 || (_this$sceneViewer0 = _this$sceneViewer0.managers) === null || _this$sceneViewer0 === void 0 ? void 0 : _this$sceneViewer0.behaviorManager;
|
|
1203
|
-
if (!bm) {
|
|
1204
|
-
console.warn('⚠️ setIoDeviceState(): BehaviorManager not available');
|
|
1205
|
-
return false;
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1100
|
+
var _this$sceneViewer4, _this$sceneViewer5, _this$sceneViewer6;
|
|
1208
1101
|
// 1. Persist via state adapter if one has been configured
|
|
1209
|
-
var stateAdapter = (_this$
|
|
1102
|
+
var stateAdapter = (_this$sceneViewer4 = this.sceneViewer) === null || _this$sceneViewer4 === void 0 || (_this$sceneViewer4 = _this$sceneViewer4.managers) === null || _this$sceneViewer4 === void 0 || (_this$sceneViewer4 = _this$sceneViewer4.componentTooltipManager) === null || _this$sceneViewer4 === void 0 ? void 0 : _this$sceneViewer4._stateAdapter;
|
|
1210
1103
|
if (stateAdapter !== null && stateAdapter !== void 0 && stateAdapter.setState) {
|
|
1211
1104
|
var scopedKey = parentUuid ? "".concat(parentUuid, "::").concat(attachmentId) : attachmentId;
|
|
1212
1105
|
try {
|
|
@@ -1216,11 +1109,11 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1216
1109
|
}
|
|
1217
1110
|
}
|
|
1218
1111
|
|
|
1219
|
-
// 2. Apply
|
|
1220
|
-
|
|
1112
|
+
// 2. Apply io-behavior changes
|
|
1113
|
+
(_this$sceneViewer5 = this.sceneViewer) === null || _this$sceneViewer5 === void 0 || (_this$sceneViewer5 = _this$sceneViewer5.managers) === null || _this$sceneViewer5 === void 0 || (_this$sceneViewer5 = _this$sceneViewer5.ioBehaviorManager) === null || _this$sceneViewer5 === void 0 || _this$sceneViewer5.triggerState(attachmentId, stateId, value, parentUuid);
|
|
1221
1114
|
|
|
1222
1115
|
// 3. Emit event for host apps that don't use the state adapter (e.g. cp3d-viewer)
|
|
1223
|
-
(_this$
|
|
1116
|
+
(_this$sceneViewer6 = this.sceneViewer) === null || _this$sceneViewer6 === void 0 || _this$sceneViewer6.emit('io-device-state-changed', {
|
|
1224
1117
|
attachmentId: attachmentId,
|
|
1225
1118
|
stateId: stateId,
|
|
1226
1119
|
value: value,
|
|
@@ -1242,8 +1135,8 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1242
1135
|
}, {
|
|
1243
1136
|
key: "getSceneAttachments",
|
|
1244
1137
|
value: function getSceneAttachments() {
|
|
1245
|
-
var _this$
|
|
1246
|
-
var scene = (_this$
|
|
1138
|
+
var _this$sceneViewer7;
|
|
1139
|
+
var scene = (_this$sceneViewer7 = this.sceneViewer) === null || _this$sceneViewer7 === void 0 ? void 0 : _this$sceneViewer7.scene;
|
|
1247
1140
|
if (!scene) return [];
|
|
1248
1141
|
var results = [];
|
|
1249
1142
|
scene.traverse(function (obj) {
|
|
@@ -15,7 +15,6 @@ import { EnvironmentManager } from '../managers/environment/environmentManager.j
|
|
|
15
15
|
import { KeyboardControlsManager } from '../managers/controls/keyboardControlsManager.js';
|
|
16
16
|
import { PathfindingManager } from '../managers/pathfinding/pathfindingManager.js';
|
|
17
17
|
import { PathFlowManager } from '../managers/pathfinding/PathFlowManager.js';
|
|
18
|
-
import { BehaviorManager } from '../managers/behaviors/BehaviorManager.js';
|
|
19
18
|
import { SceneOperationsManager } from '../managers/scene/sceneOperationsManager.js';
|
|
20
19
|
import { AnimationManager } from '../managers/scene/animationManager.js';
|
|
21
20
|
import { CameraControlsManager } from '../managers/controls/cameraControlsManager.js';
|
|
@@ -23,7 +22,7 @@ import { ComponentDragManager } from '../managers/controls/componentDragManager.
|
|
|
23
22
|
import { SceneTooltipsManager } from '../managers/scene/sceneTooltipsManager.js';
|
|
24
23
|
import { ComponentTooltipManager } from '../managers/scene/componentTooltipManager.js';
|
|
25
24
|
import { Viewport2DManager } from '../managers/scene/viewport2DManager.js';
|
|
26
|
-
import {
|
|
25
|
+
import { IoBehaviorManager } from '../managers/behaviors/IoBehaviorManager.js';
|
|
27
26
|
import { IoOutlineManager } from '../managers/behaviors/IoOutlineManager.js';
|
|
28
27
|
import { generateUuidFromName, getHardcodedUuid, findObjectByHardcodedUuid, generateUniqueComponentId } from '../utils/nameUtils.js';
|
|
29
28
|
import { attachIODevicesToComponent } from '../utils/ioDeviceUtils.js';
|
|
@@ -145,13 +144,12 @@ var CentralPlantInternals = /*#__PURE__*/function () {
|
|
|
145
144
|
this.centralPlant.managers.keyboardControlsManager = new KeyboardControlsManager(this.centralPlant.sceneViewer);
|
|
146
145
|
this.centralPlant.managers.pathfindingManager = new PathfindingManager(this.centralPlant.sceneViewer);
|
|
147
146
|
this.centralPlant.managers.pathFlowManager = new PathFlowManager(this.centralPlant.sceneViewer);
|
|
148
|
-
this.centralPlant.managers.behaviorManager = new BehaviorManager(this.centralPlant.sceneViewer);
|
|
149
147
|
this.centralPlant.managers.sceneOperationsManager = new SceneOperationsManager(this.centralPlant.sceneViewer);
|
|
150
148
|
this.centralPlant.managers.animationManager = new AnimationManager(this.centralPlant.sceneViewer);
|
|
151
149
|
this.centralPlant.managers.cameraControlsManager = new CameraControlsManager(this.centralPlant.sceneViewer);
|
|
152
150
|
this.centralPlant.managers.componentDragManager = new ComponentDragManager(this.centralPlant.sceneViewer);
|
|
153
151
|
this.centralPlant.managers.viewport2DManager = new Viewport2DManager(this.centralPlant.sceneViewer);
|
|
154
|
-
this.centralPlant.managers.
|
|
152
|
+
this.centralPlant.managers.ioBehaviorManager = new IoBehaviorManager(this.centralPlant.sceneViewer);
|
|
155
153
|
this.centralPlant.managers.ioOutlineManager = new IoOutlineManager(this.centralPlant.sceneViewer);
|
|
156
154
|
|
|
157
155
|
// All managers are now stored in the managers collection and will be attached via attachToComponent()
|
|
@@ -923,7 +921,7 @@ var CentralPlantInternals = /*#__PURE__*/function () {
|
|
|
923
921
|
return false;
|
|
924
922
|
}
|
|
925
923
|
try {
|
|
926
|
-
var _componentData$childr, _componentData$childr2, _this$centralPlant$sc7, _componentData$childr3
|
|
924
|
+
var _componentData$childr, _componentData$childr2, _this$centralPlant$sc7, _componentData$childr3;
|
|
927
925
|
// Generate a unique component ID if not provided
|
|
928
926
|
var componentId = options.customId || this.generateUniqueComponentId(libraryId);
|
|
929
927
|
|
|
@@ -1130,23 +1128,23 @@ var CentralPlantInternals = /*#__PURE__*/function () {
|
|
|
1130
1128
|
var _this$centralPlant$sc8;
|
|
1131
1129
|
attachIODevicesToComponent(componentModel, componentData, modelPreloader, componentId);
|
|
1132
1130
|
|
|
1133
|
-
// Register
|
|
1134
|
-
var
|
|
1135
|
-
if (
|
|
1131
|
+
// Register behavior configs so IoBehaviorManager can respond to state changes
|
|
1132
|
+
var ioBehavMgr = (_this$centralPlant$sc8 = this.centralPlant.sceneViewer) === null || _this$centralPlant$sc8 === void 0 || (_this$centralPlant$sc8 = _this$centralPlant$sc8.managers) === null || _this$centralPlant$sc8 === void 0 ? void 0 : _this$centralPlant$sc8.ioBehaviorManager;
|
|
1133
|
+
if (ioBehavMgr) {
|
|
1136
1134
|
var _loop = function _loop() {
|
|
1137
1135
|
var _modelPreloader$compo;
|
|
1138
1136
|
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
1139
1137
|
attachmentId = _Object$entries$_i[0],
|
|
1140
1138
|
attachment = _Object$entries$_i[1];
|
|
1141
1139
|
var deviceData = (_modelPreloader$compo = modelPreloader.componentDictionary) === null || _modelPreloader$compo === void 0 ? void 0 : _modelPreloader$compo[attachment.deviceId];
|
|
1142
|
-
if (!(deviceData !== null && deviceData !== void 0 && deviceData.
|
|
1140
|
+
if (!(deviceData !== null && deviceData !== void 0 && deviceData.behaviorConfig)) return 1; // continue
|
|
1143
1141
|
var deviceRoot = null;
|
|
1144
1142
|
componentModel.traverse(function (obj) {
|
|
1145
1143
|
var _obj$userData2;
|
|
1146
1144
|
if (!deviceRoot && ((_obj$userData2 = obj.userData) === null || _obj$userData2 === void 0 ? void 0 : _obj$userData2.attachmentId) === attachmentId) deviceRoot = obj;
|
|
1147
1145
|
});
|
|
1148
1146
|
if (deviceRoot) {
|
|
1149
|
-
|
|
1147
|
+
ioBehavMgr.loadBehaviors(attachmentId, deviceData.behaviorConfig, deviceRoot, componentId);
|
|
1150
1148
|
}
|
|
1151
1149
|
};
|
|
1152
1150
|
for (var _i = 0, _Object$entries = Object.entries(componentData.attachedDevices); _i < _Object$entries.length; _i++) {
|
|
@@ -1155,15 +1153,6 @@ var CentralPlantInternals = /*#__PURE__*/function () {
|
|
|
1155
1153
|
}
|
|
1156
1154
|
}
|
|
1157
1155
|
|
|
1158
|
-
// Register default behaviors for smart components so the BehaviorManager
|
|
1159
|
-
// responds to tooltip-driven state changes immediately after drop.
|
|
1160
|
-
// (The scene-load path uses _processBehaviors instead, which runs on loadSceneData.)
|
|
1161
|
-
if ((_componentData$defaul = componentData.defaultBehaviors) !== null && _componentData$defaul !== void 0 && _componentData$defaul.length) {
|
|
1162
|
-
var _this$centralPlant$sc9, _som$registerBehavior;
|
|
1163
|
-
var som = (_this$centralPlant$sc9 = this.centralPlant.sceneViewer) === null || _this$centralPlant$sc9 === void 0 ? void 0 : _this$centralPlant$sc9.sceneOperationsManager;
|
|
1164
|
-
som === null || som === void 0 || (_som$registerBehavior = som.registerBehaviorsForComponentInstance) === null || _som$registerBehavior === void 0 || _som$registerBehavior.call(som, componentData, componentId);
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
1156
|
// Notify the component manager about the new component
|
|
1168
1157
|
if (componentManager.registerComponent) {
|
|
1169
1158
|
componentManager.registerComponent(componentModel);
|
|
@@ -1236,18 +1225,18 @@ var CentralPlantInternals = /*#__PURE__*/function () {
|
|
|
1236
1225
|
}, {
|
|
1237
1226
|
key: "deleteComponent",
|
|
1238
1227
|
value: function deleteComponent(componentId) {
|
|
1239
|
-
var _this$centralPlant$
|
|
1228
|
+
var _this$centralPlant$sc9;
|
|
1240
1229
|
// Check if component manager is available
|
|
1241
|
-
var componentManager = (_this$centralPlant$
|
|
1230
|
+
var componentManager = (_this$centralPlant$sc9 = this.centralPlant.sceneViewer) === null || _this$centralPlant$sc9 === void 0 ? void 0 : _this$centralPlant$sc9.componentManager;
|
|
1242
1231
|
if (!componentManager) {
|
|
1243
1232
|
console.error('❌ deleteComponent(): Component manager not available');
|
|
1244
1233
|
return false;
|
|
1245
1234
|
}
|
|
1246
1235
|
try {
|
|
1247
|
-
var _this$centralPlant$
|
|
1236
|
+
var _this$centralPlant$sc0, _this$centralPlant$sc1, _sceneData$scene2, _sceneData$scene3;
|
|
1248
1237
|
console.log("\uD83D\uDDD1\uFE0F deleteComponent(): Deleting component ".concat(componentId));
|
|
1249
|
-
var threeScene = (_this$centralPlant$
|
|
1250
|
-
var sceneData = (_this$centralPlant$
|
|
1238
|
+
var threeScene = (_this$centralPlant$sc0 = this.centralPlant.sceneViewer) === null || _this$centralPlant$sc0 === void 0 ? void 0 : _this$centralPlant$sc0.scene;
|
|
1239
|
+
var sceneData = (_this$centralPlant$sc1 = this.centralPlant.sceneViewer) === null || _this$centralPlant$sc1 === void 0 ? void 0 : _this$centralPlant$sc1.currentSceneData;
|
|
1251
1240
|
|
|
1252
1241
|
// Step 1: Resolve the actual Three.js UUID from componentId.
|
|
1253
1242
|
// The UI emits object.name (e.g. "Pump (PUMP-1)") as the selection ID, but
|
|
@@ -98,7 +98,7 @@ var sceneViewer = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
98
98
|
this.centralPlant.attachToComponent();
|
|
99
99
|
|
|
100
100
|
// Sync our managers tracking object after attachment
|
|
101
|
-
managerKeys = ['threeJSResourceManager', 'performanceMonitorManager', 'settingsManager', 'sceneExportManager', 'componentManager', 'sceneInitializationManager', 'environmentManager', 'keyboardControlsManager', 'pathfindingManager', 'pathFlowManager', '
|
|
101
|
+
managerKeys = ['threeJSResourceManager', 'performanceMonitorManager', 'settingsManager', 'sceneExportManager', 'componentManager', 'sceneInitializationManager', 'environmentManager', 'keyboardControlsManager', 'pathfindingManager', 'pathFlowManager', 'ioBehaviorManager', 'ioOutlineManager', 'sceneOperationsManager', 'animationManager', 'cameraControlsManager', 'componentDragManager', 'tooltipsManager', 'componentTooltipManager']; // Populate our managers tracking object
|
|
102
102
|
managerKeys.forEach(function (key) {
|
|
103
103
|
if (_this2[key]) {
|
|
104
104
|
_this2.managers[key] = _this2[key];
|
|
@@ -430,10 +430,10 @@ var sceneViewer = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
430
430
|
},
|
|
431
431
|
onIODeviceDrag: function onIODeviceDrag(ioDeviceObject, signedDelta, isStart) {
|
|
432
432
|
if (isStart) {
|
|
433
|
-
var _ioDeviceObject$userD, _this4$managers$
|
|
433
|
+
var _ioDeviceObject$userD, _this4$managers$ioBeh, _this4$managers, _this4$managers2;
|
|
434
434
|
// Resolve parentUuid by walking up to the host component.
|
|
435
435
|
// Use userData.originalUuid (the custom componentId) because that
|
|
436
|
-
// is what
|
|
436
|
+
// is what IoBehaviorManager uses as the map key — NOT obj.uuid.
|
|
437
437
|
var parentUuid = null;
|
|
438
438
|
var obj = ioDeviceObject.parent;
|
|
439
439
|
while (obj) {
|
|
@@ -449,7 +449,7 @@ var sceneViewer = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
449
449
|
// silhouette is isolated and the outline ring is visible around
|
|
450
450
|
// them specifically (not swallowed by the larger device body).
|
|
451
451
|
// Fall back to the whole device group when none are registered.
|
|
452
|
-
var animatedMeshes = attachmentId && parentUuid ? (_this4$managers$
|
|
452
|
+
var animatedMeshes = attachmentId && parentUuid ? (_this4$managers$ioBeh = (_this4$managers = _this4.managers) === null || _this4$managers === void 0 || (_this4$managers = _this4$managers.ioBehaviorManager) === null || _this4$managers === void 0 ? void 0 : _this4$managers.getAnimatedMeshes(parentUuid, attachmentId)) !== null && _this4$managers$ioBeh !== void 0 ? _this4$managers$ioBeh : [] : [];
|
|
453
453
|
var targets = animatedMeshes.length > 0 ? animatedMeshes : [ioDeviceObject];
|
|
454
454
|
(_this4$managers2 = _this4.managers) === null || _this4$managers2 === void 0 || (_this4$managers2 = _this4$managers2.ioOutlineManager) === null || _this4$managers2 === void 0 || _this4$managers2.setTargets(targets);
|
|
455
455
|
}
|
package/dist/esm/src/index.js
CHANGED
|
@@ -9,8 +9,7 @@ export { SceneExportManager } from './managers/scene/sceneExportManager.js';
|
|
|
9
9
|
export { SceneTooltipsManager } from './managers/scene/sceneTooltipsManager.js';
|
|
10
10
|
export { ComponentTooltipManager } from './managers/scene/componentTooltipManager.js';
|
|
11
11
|
export { SceneHierarchyManager } from './managers/scene/sceneHierarchyManager.js';
|
|
12
|
-
export {
|
|
13
|
-
export { IoAnimationManager } from './managers/behaviors/IoAnimationManager.js';
|
|
12
|
+
export { IoBehaviorManager } from './managers/behaviors/IoBehaviorManager.js';
|
|
14
13
|
export { ComponentManager } from './managers/components/componentManager.js';
|
|
15
14
|
export { AnimationManager } from './managers/scene/animationManager.js';
|
|
16
15
|
export { PathfindingManager } from './managers/pathfinding/pathfindingManager.js';
|