@2112-lab/central-plant 0.3.19 → 0.3.22
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 +547 -99
- package/dist/cjs/src/core/centralPlant.js +1 -1
- package/dist/cjs/src/core/centralPlantInternals.js +2 -0
- package/dist/cjs/src/core/sceneViewer.js +1 -1
- package/dist/cjs/src/index.js +2 -0
- package/dist/cjs/src/managers/behaviors/IoAnimationManager.js +422 -0
- package/dist/cjs/src/managers/scene/componentTooltipManager.js +9 -7
- package/dist/cjs/src/managers/scene/modelManager.js +141 -90
- package/dist/esm/src/core/centralPlant.js +1 -1
- package/dist/esm/src/core/centralPlantInternals.js +2 -0
- package/dist/esm/src/core/sceneViewer.js +1 -1
- package/dist/esm/src/index.js +1 -0
- package/dist/esm/src/managers/behaviors/IoAnimationManager.js +398 -0
- package/dist/esm/src/managers/scene/componentTooltipManager.js +9 -7
- package/dist/esm/src/managers/scene/modelManager.js +142 -91
- package/package.json +2 -2
|
@@ -77,12 +77,12 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
77
77
|
key: "loadLibraryModel",
|
|
78
78
|
value: function () {
|
|
79
79
|
var _loadLibraryModel = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee(targetMesh, jsonEntry, componentData) {
|
|
80
|
-
var component, _jsonEntry$userData, _jsonEntry$userData2, _jsonEntry$userData3, originalProps, connectorChildren, gltfScene, libraryModel, _jsonEntry$userData4, _t;
|
|
81
|
-
return _rollupPluginBabelHelpers.regenerator().w(function (
|
|
82
|
-
while (1) switch (
|
|
80
|
+
var component, _jsonEntry$userData, _jsonEntry$userData2, _jsonEntry$userData3, originalProps, connectorChildren, gltfScene, libraryModel, _this$sceneViewer, ioAnimMgr, _loop, _i, _Object$entries, _jsonEntry$userData4, _t;
|
|
81
|
+
return _rollupPluginBabelHelpers.regenerator().w(function (_context2) {
|
|
82
|
+
while (1) switch (_context2.n) {
|
|
83
83
|
case 0:
|
|
84
84
|
component = this.sceneViewer;
|
|
85
|
-
|
|
85
|
+
_context2.p = 1;
|
|
86
86
|
console.log("Loading library GLB model for ".concat((_jsonEntry$userData = jsonEntry.userData) === null || _jsonEntry$userData === void 0 ? void 0 : _jsonEntry$userData.libraryId, "..."));
|
|
87
87
|
|
|
88
88
|
// Store original mesh properties before async operation
|
|
@@ -95,16 +95,16 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
95
95
|
uuid: targetMesh.uuid
|
|
96
96
|
}; // Preserve connector children (pass parent UUID for proper connector UUID generation)
|
|
97
97
|
connectorChildren = this._preserveConnectorChildren(targetMesh, originalProps.uuid); // Get model from cache or load directly
|
|
98
|
-
|
|
98
|
+
_context2.n = 2;
|
|
99
99
|
return this._getLibraryModel(componentData.modelKey, (_jsonEntry$userData2 = jsonEntry.userData) === null || _jsonEntry$userData2 === void 0 ? void 0 : _jsonEntry$userData2.libraryId);
|
|
100
100
|
case 2:
|
|
101
|
-
gltfScene =
|
|
101
|
+
gltfScene = _context2.v;
|
|
102
102
|
if (gltfScene) {
|
|
103
|
-
|
|
103
|
+
_context2.n = 3;
|
|
104
104
|
break;
|
|
105
105
|
}
|
|
106
106
|
console.warn("\u26A0\uFE0F Could not load model ".concat(componentData.modelKey, ", keeping original mesh"));
|
|
107
|
-
return
|
|
107
|
+
return _context2.a(2, targetMesh);
|
|
108
108
|
case 3:
|
|
109
109
|
// Configure the loaded model
|
|
110
110
|
libraryModel = this._configureLibraryModel(gltfScene, jsonEntry, componentData, originalProps); // Add preserved connectors
|
|
@@ -114,23 +114,74 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
114
114
|
|
|
115
115
|
// Attach IO devices for smart components (import flow)
|
|
116
116
|
if (!(componentData.isSmart && componentData.attachedDevices)) {
|
|
117
|
-
|
|
117
|
+
_context2.n = 8;
|
|
118
118
|
break;
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
_context2.n = 4;
|
|
121
121
|
return ioDeviceUtils.attachIODevicesToComponent(libraryModel, componentData, modelPreloader["default"], originalProps.uuid);
|
|
122
122
|
case 4:
|
|
123
|
+
// Register animation configs for each attached device
|
|
124
|
+
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;
|
|
125
|
+
if (!ioAnimMgr) {
|
|
126
|
+
_context2.n = 8;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
_loop = /*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _loop() {
|
|
130
|
+
var _modelPreloader$compo;
|
|
131
|
+
var _Object$entries$_i, attachmentId, attachment, deviceData, deviceRoot;
|
|
132
|
+
return _rollupPluginBabelHelpers.regenerator().w(function (_context) {
|
|
133
|
+
while (1) switch (_context.n) {
|
|
134
|
+
case 0:
|
|
135
|
+
_Object$entries$_i = _rollupPluginBabelHelpers.slicedToArray(_Object$entries[_i], 2), attachmentId = _Object$entries$_i[0], attachment = _Object$entries$_i[1];
|
|
136
|
+
deviceData = (_modelPreloader$compo = modelPreloader["default"].componentDictionary) === null || _modelPreloader$compo === void 0 ? void 0 : _modelPreloader$compo[attachment.deviceId];
|
|
137
|
+
if (deviceData !== null && deviceData !== void 0 && deviceData.animationConfig) {
|
|
138
|
+
_context.n = 1;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
return _context.a(2, 1);
|
|
142
|
+
case 1:
|
|
143
|
+
deviceRoot = null;
|
|
144
|
+
libraryModel.traverse(function (obj) {
|
|
145
|
+
var _obj$userData;
|
|
146
|
+
if (!deviceRoot && ((_obj$userData = obj.userData) === null || _obj$userData === void 0 ? void 0 : _obj$userData.attachmentId) === attachmentId) deviceRoot = obj;
|
|
147
|
+
});
|
|
148
|
+
if (deviceRoot) {
|
|
149
|
+
ioAnimMgr.loadAnimations(attachmentId, deviceData.animationConfig, deviceRoot, originalProps.uuid);
|
|
150
|
+
}
|
|
151
|
+
case 2:
|
|
152
|
+
return _context.a(2);
|
|
153
|
+
}
|
|
154
|
+
}, _loop);
|
|
155
|
+
});
|
|
156
|
+
_i = 0, _Object$entries = Object.entries(componentData.attachedDevices);
|
|
157
|
+
case 5:
|
|
158
|
+
if (!(_i < _Object$entries.length)) {
|
|
159
|
+
_context2.n = 8;
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
return _context2.d(_rollupPluginBabelHelpers.regeneratorValues(_loop()), 6);
|
|
163
|
+
case 6:
|
|
164
|
+
if (!_context2.v) {
|
|
165
|
+
_context2.n = 7;
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
return _context2.a(3, 7);
|
|
169
|
+
case 7:
|
|
170
|
+
_i++;
|
|
171
|
+
_context2.n = 5;
|
|
172
|
+
break;
|
|
173
|
+
case 8:
|
|
123
174
|
// Replace mesh in scene
|
|
124
175
|
this._replaceMeshInScene(targetMesh, libraryModel, originalProps.parent, component);
|
|
125
176
|
console.log("\uD83C\uDF89 ".concat((_jsonEntry$userData3 = jsonEntry.userData) === null || _jsonEntry$userData3 === void 0 ? void 0 : _jsonEntry$userData3.libraryId, " GLB model successfully rendered in scene"));
|
|
126
|
-
return
|
|
127
|
-
case
|
|
128
|
-
|
|
129
|
-
_t =
|
|
177
|
+
return _context2.a(2, libraryModel);
|
|
178
|
+
case 9:
|
|
179
|
+
_context2.p = 9;
|
|
180
|
+
_t = _context2.v;
|
|
130
181
|
console.error("\u274C Error loading ".concat((_jsonEntry$userData4 = jsonEntry.userData) === null || _jsonEntry$userData4 === void 0 ? void 0 : _jsonEntry$userData4.libraryId, " GLB model:"), _t);
|
|
131
|
-
return
|
|
182
|
+
return _context2.a(2, targetMesh);
|
|
132
183
|
}
|
|
133
|
-
}, _callee, this, [[1,
|
|
184
|
+
}, _callee, this, [[1, 9]]);
|
|
134
185
|
}));
|
|
135
186
|
function loadLibraryModel(_x, _x2, _x3) {
|
|
136
187
|
return _loadLibraryModel.apply(this, arguments);
|
|
@@ -209,84 +260,84 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
209
260
|
var _getLibraryModel2 = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee2(modelKey, libraryId) {
|
|
210
261
|
var _this2 = this;
|
|
211
262
|
var gltfScene, preloaderStatus, modelPath, gltf, _t2, _t3, _t4;
|
|
212
|
-
return _rollupPluginBabelHelpers.regenerator().w(function (
|
|
213
|
-
while (1) switch (
|
|
263
|
+
return _rollupPluginBabelHelpers.regenerator().w(function (_context3) {
|
|
264
|
+
while (1) switch (_context3.n) {
|
|
214
265
|
case 0:
|
|
215
266
|
// Try cache first
|
|
216
267
|
gltfScene = modelPreloader["default"].getCachedModelWithDimensions(modelKey, libraryId);
|
|
217
268
|
if (!gltfScene) {
|
|
218
|
-
|
|
269
|
+
_context3.n = 1;
|
|
219
270
|
break;
|
|
220
271
|
}
|
|
221
272
|
console.log("\uD83C\uDFAF GLB cache HIT: ".concat(modelKey));
|
|
222
|
-
return
|
|
273
|
+
return _context3.a(2, gltfScene);
|
|
223
274
|
case 1:
|
|
224
275
|
// Check if preloading is in progress
|
|
225
276
|
preloaderStatus = modelPreloader["default"].getStatus();
|
|
226
277
|
if (!preloaderStatus.isPreloading) {
|
|
227
|
-
|
|
278
|
+
_context3.n = 6;
|
|
228
279
|
break;
|
|
229
280
|
}
|
|
230
281
|
console.log("\u23F3 Waiting for preloader: ".concat(modelKey));
|
|
231
|
-
|
|
232
|
-
|
|
282
|
+
_context3.p = 2;
|
|
283
|
+
_context3.n = 3;
|
|
233
284
|
return modelPreloader["default"].preloadingPromise;
|
|
234
285
|
case 3:
|
|
235
286
|
gltfScene = modelPreloader["default"].getCachedModelWithDimensions(modelKey, libraryId);
|
|
236
287
|
if (!gltfScene) {
|
|
237
|
-
|
|
288
|
+
_context3.n = 4;
|
|
238
289
|
break;
|
|
239
290
|
}
|
|
240
291
|
console.log("\uD83C\uDFAF GLB cache HIT (after preload): ".concat(modelKey));
|
|
241
|
-
return
|
|
292
|
+
return _context3.a(2, gltfScene);
|
|
242
293
|
case 4:
|
|
243
|
-
|
|
294
|
+
_context3.n = 6;
|
|
244
295
|
break;
|
|
245
296
|
case 5:
|
|
246
|
-
|
|
247
|
-
_t2 =
|
|
297
|
+
_context3.p = 5;
|
|
298
|
+
_t2 = _context3.v;
|
|
248
299
|
console.warn("\u26A0\uFE0F Preloading failed:", _t2);
|
|
249
300
|
case 6:
|
|
250
|
-
|
|
301
|
+
_context3.p = 6;
|
|
251
302
|
if (!modelPreloader["default"].urlResolver) {
|
|
252
|
-
|
|
303
|
+
_context3.n = 11;
|
|
253
304
|
break;
|
|
254
305
|
}
|
|
255
|
-
|
|
256
|
-
|
|
306
|
+
_context3.p = 7;
|
|
307
|
+
_context3.n = 8;
|
|
257
308
|
return modelPreloader["default"].urlResolver(modelKey);
|
|
258
309
|
case 8:
|
|
259
|
-
modelPath =
|
|
310
|
+
modelPath = _context3.v;
|
|
260
311
|
console.log("\uD83D\uDD17 Resolved URL for ".concat(modelKey));
|
|
261
|
-
|
|
312
|
+
_context3.n = 10;
|
|
262
313
|
break;
|
|
263
314
|
case 9:
|
|
264
|
-
|
|
265
|
-
_t3 =
|
|
315
|
+
_context3.p = 9;
|
|
316
|
+
_t3 = _context3.v;
|
|
266
317
|
console.warn("\u26A0\uFE0F URL resolver failed for ".concat(modelKey, ", falling back to local path:"), _t3);
|
|
267
318
|
modelPath = "".concat(modelPreloader["default"].modelsBasePath).concat(modelKey);
|
|
268
319
|
case 10:
|
|
269
|
-
|
|
320
|
+
_context3.n = 12;
|
|
270
321
|
break;
|
|
271
322
|
case 11:
|
|
272
323
|
modelPath = "".concat(modelPreloader["default"].modelsBasePath).concat(modelKey);
|
|
273
324
|
case 12:
|
|
274
325
|
console.log("\uD83D\uDCC2 Fallback loading from: ".concat(modelPath));
|
|
275
|
-
|
|
326
|
+
_context3.n = 13;
|
|
276
327
|
return new Promise(function (resolve, reject) {
|
|
277
328
|
_this2.sceneViewer.gltfLoader.load(modelPath, resolve, undefined, reject);
|
|
278
329
|
});
|
|
279
330
|
case 13:
|
|
280
|
-
gltf =
|
|
331
|
+
gltf = _context3.v;
|
|
281
332
|
if (libraryId) {
|
|
282
333
|
modelPreloader["default"].cacheModel(modelKey, gltf.scene.clone(), libraryId);
|
|
283
334
|
}
|
|
284
|
-
return
|
|
335
|
+
return _context3.a(2, gltf.scene);
|
|
285
336
|
case 14:
|
|
286
|
-
|
|
287
|
-
_t4 =
|
|
337
|
+
_context3.p = 14;
|
|
338
|
+
_t4 = _context3.v;
|
|
288
339
|
console.error("Failed to load model ".concat(modelKey, ":"), _t4);
|
|
289
|
-
return
|
|
340
|
+
return _context3.a(2, null);
|
|
290
341
|
}
|
|
291
342
|
}, _callee2, null, [[7, 9], [6, 14], [2, 5]]);
|
|
292
343
|
}));
|
|
@@ -393,8 +444,8 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
393
444
|
value: (function () {
|
|
394
445
|
var _verifyModelPreloaderCache = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee3() {
|
|
395
446
|
var preloaderStatus, _t5;
|
|
396
|
-
return _rollupPluginBabelHelpers.regenerator().w(function (
|
|
397
|
-
while (1) switch (
|
|
447
|
+
return _rollupPluginBabelHelpers.regenerator().w(function (_context4) {
|
|
448
|
+
while (1) switch (_context4.n) {
|
|
398
449
|
case 0:
|
|
399
450
|
console.log('🔍 Verifying model preloader cache state...');
|
|
400
451
|
preloaderStatus = modelPreloader["default"].getStatus();
|
|
@@ -402,23 +453,23 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
402
453
|
|
|
403
454
|
// If preloading is still in progress, wait for completion
|
|
404
455
|
if (!preloaderStatus.isPreloading) {
|
|
405
|
-
|
|
456
|
+
_context4.n = 4;
|
|
406
457
|
break;
|
|
407
458
|
}
|
|
408
459
|
console.log('⏳ Waiting for model preloading to complete...');
|
|
409
|
-
|
|
410
|
-
|
|
460
|
+
_context4.p = 1;
|
|
461
|
+
_context4.n = 2;
|
|
411
462
|
return modelPreloader["default"].preloadingPromise;
|
|
412
463
|
case 2:
|
|
413
464
|
console.log('✅ Model preloading completed');
|
|
414
|
-
|
|
465
|
+
_context4.n = 4;
|
|
415
466
|
break;
|
|
416
467
|
case 3:
|
|
417
|
-
|
|
418
|
-
_t5 =
|
|
468
|
+
_context4.p = 3;
|
|
469
|
+
_t5 = _context4.v;
|
|
419
470
|
console.warn('⚠️ Model preloading failed, some models may load directly:', _t5);
|
|
420
471
|
case 4:
|
|
421
|
-
return
|
|
472
|
+
return _context4.a(2, preloaderStatus);
|
|
422
473
|
}
|
|
423
474
|
}, _callee3, null, [[1, 3]]);
|
|
424
475
|
}));
|
|
@@ -436,11 +487,11 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
436
487
|
value: (function () {
|
|
437
488
|
var _preloadMissingModels = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee4(data, componentDictionary) {
|
|
438
489
|
var _data$scene, _data$scene2, requiredModels, preloaderStatus, cachedModels, missingModels, basePath, modelUrls, _iterator, _step, modelKey, _t6, _t7;
|
|
439
|
-
return _rollupPluginBabelHelpers.regenerator().w(function (
|
|
440
|
-
while (1) switch (
|
|
490
|
+
return _rollupPluginBabelHelpers.regenerator().w(function (_context5) {
|
|
491
|
+
while (1) switch (_context5.n) {
|
|
441
492
|
case 0:
|
|
442
493
|
if (!(!data || !data.scene || !Array.isArray(data.scene.children))) {
|
|
443
|
-
|
|
494
|
+
_context5.n = 1;
|
|
444
495
|
break;
|
|
445
496
|
}
|
|
446
497
|
console.warn('⚠️ Invalid scene data structure in preloadMissingModels:', {
|
|
@@ -449,7 +500,7 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
449
500
|
hasChildren: !!(data !== null && data !== void 0 && (_data$scene = data.scene) !== null && _data$scene !== void 0 && _data$scene.children),
|
|
450
501
|
childrenType: data !== null && data !== void 0 && (_data$scene2 = data.scene) !== null && _data$scene2 !== void 0 && _data$scene2.children ? _rollupPluginBabelHelpers["typeof"](data.scene.children) : 'undefined'
|
|
451
502
|
});
|
|
452
|
-
return
|
|
503
|
+
return _context5.a(2);
|
|
453
504
|
case 1:
|
|
454
505
|
requiredModels = new Set();
|
|
455
506
|
console.log("\uD83D\uDD0D Checking ".concat(data.scene.children.length, " scene objects for required models..."));
|
|
@@ -471,10 +522,10 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
471
522
|
}
|
|
472
523
|
});
|
|
473
524
|
console.log('🔍 Required models for this scene (Set):', Array.from(requiredModels));
|
|
474
|
-
|
|
525
|
+
_context5.n = 2;
|
|
475
526
|
return this.verifyModelPreloaderCache();
|
|
476
527
|
case 2:
|
|
477
|
-
preloaderStatus =
|
|
528
|
+
preloaderStatus = _context5.v;
|
|
478
529
|
cachedModels = preloaderStatus.cachedModels;
|
|
479
530
|
console.log('ModelPreloader cached models:', cachedModels);
|
|
480
531
|
|
|
@@ -505,7 +556,7 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
505
556
|
});
|
|
506
557
|
}
|
|
507
558
|
if (!(missingModels.length > 0)) {
|
|
508
|
-
|
|
559
|
+
_context5.n = 12;
|
|
509
560
|
break;
|
|
510
561
|
}
|
|
511
562
|
console.warn('⚠️ Some required models are not cached:', missingModels);
|
|
@@ -513,41 +564,41 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
513
564
|
|
|
514
565
|
// Preload missing models (Main in-memory preloader)
|
|
515
566
|
_iterator = _rollupPluginBabelHelpers.createForOfIteratorHelper(missingModels);
|
|
516
|
-
|
|
567
|
+
_context5.p = 3;
|
|
517
568
|
_iterator.s();
|
|
518
569
|
case 4:
|
|
519
570
|
if ((_step = _iterator.n()).done) {
|
|
520
|
-
|
|
571
|
+
_context5.n = 9;
|
|
521
572
|
break;
|
|
522
573
|
}
|
|
523
574
|
modelKey = _step.value;
|
|
524
|
-
|
|
525
|
-
|
|
575
|
+
_context5.p = 5;
|
|
576
|
+
_context5.n = 6;
|
|
526
577
|
return modelPreloader["default"].preloadSingleModel(modelKey);
|
|
527
578
|
case 6:
|
|
528
579
|
console.log("\u2705 Successfully preloaded missing model: ".concat(modelKey));
|
|
529
|
-
|
|
580
|
+
_context5.n = 8;
|
|
530
581
|
break;
|
|
531
582
|
case 7:
|
|
532
|
-
|
|
533
|
-
_t6 =
|
|
583
|
+
_context5.p = 7;
|
|
584
|
+
_t6 = _context5.v;
|
|
534
585
|
console.warn("\u274C Failed to preload missing model ".concat(modelKey, ":"), _t6);
|
|
535
586
|
case 8:
|
|
536
|
-
|
|
587
|
+
_context5.n = 4;
|
|
537
588
|
break;
|
|
538
589
|
case 9:
|
|
539
|
-
|
|
590
|
+
_context5.n = 11;
|
|
540
591
|
break;
|
|
541
592
|
case 10:
|
|
542
|
-
|
|
543
|
-
_t7 =
|
|
593
|
+
_context5.p = 10;
|
|
594
|
+
_t7 = _context5.v;
|
|
544
595
|
_iterator.e(_t7);
|
|
545
596
|
case 11:
|
|
546
|
-
|
|
597
|
+
_context5.p = 11;
|
|
547
598
|
_iterator.f();
|
|
548
|
-
return
|
|
599
|
+
return _context5.f(11);
|
|
549
600
|
case 12:
|
|
550
|
-
return
|
|
601
|
+
return _context5.a(2);
|
|
551
602
|
}
|
|
552
603
|
}, _callee4, this, [[5, 7], [3, 10, 11, 12]]);
|
|
553
604
|
}));
|
|
@@ -566,14 +617,14 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
566
617
|
var _replaceWithGLBModels = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee5(libraryObjectsToReplace) {
|
|
567
618
|
var _this3 = this;
|
|
568
619
|
var startTime, glbLoadingPromises;
|
|
569
|
-
return _rollupPluginBabelHelpers.regenerator().w(function (
|
|
570
|
-
while (1) switch (
|
|
620
|
+
return _rollupPluginBabelHelpers.regenerator().w(function (_context6) {
|
|
621
|
+
while (1) switch (_context6.n) {
|
|
571
622
|
case 0:
|
|
572
623
|
if (!(libraryObjectsToReplace.length === 0)) {
|
|
573
|
-
|
|
624
|
+
_context6.n = 1;
|
|
574
625
|
break;
|
|
575
626
|
}
|
|
576
|
-
return
|
|
627
|
+
return _context6.a(2);
|
|
577
628
|
case 1:
|
|
578
629
|
startTime = performance.now();
|
|
579
630
|
console.log("\uD83D\uDD04 Replacing ".concat(libraryObjectsToReplace.length, " objects with GLB models..."));
|
|
@@ -593,7 +644,7 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
593
644
|
return basicObject;
|
|
594
645
|
});
|
|
595
646
|
});
|
|
596
|
-
|
|
647
|
+
_context6.n = 2;
|
|
597
648
|
return Promise.all(glbLoadingPromises);
|
|
598
649
|
case 2:
|
|
599
650
|
console.log("\u23F1\uFE0F All GLB models loaded in ".concat((performance.now() - startTime).toFixed(0), "ms"));
|
|
@@ -636,7 +687,7 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
636
687
|
}));
|
|
637
688
|
}
|
|
638
689
|
case 3:
|
|
639
|
-
return
|
|
690
|
+
return _context6.a(2);
|
|
640
691
|
}
|
|
641
692
|
}, _callee5);
|
|
642
693
|
}));
|
|
@@ -671,26 +722,26 @@ var ModelManager = /*#__PURE__*/function () {
|
|
|
671
722
|
value: (function () {
|
|
672
723
|
var _loadComponentDictionary = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee6() {
|
|
673
724
|
var response, dict, _t8;
|
|
674
|
-
return _rollupPluginBabelHelpers.regenerator().w(function (
|
|
675
|
-
while (1) switch (
|
|
725
|
+
return _rollupPluginBabelHelpers.regenerator().w(function (_context7) {
|
|
726
|
+
while (1) switch (_context7.n) {
|
|
676
727
|
case 0:
|
|
677
|
-
|
|
728
|
+
_context7.p = 0;
|
|
678
729
|
console.log('🔄 ModelManager loading component dictionary...');
|
|
679
|
-
|
|
730
|
+
_context7.n = 1;
|
|
680
731
|
return fetch('/library/component-dictionary.json');
|
|
681
732
|
case 1:
|
|
682
|
-
response =
|
|
683
|
-
|
|
733
|
+
response = _context7.v;
|
|
734
|
+
_context7.n = 2;
|
|
684
735
|
return response.json();
|
|
685
736
|
case 2:
|
|
686
|
-
dict =
|
|
737
|
+
dict = _context7.v;
|
|
687
738
|
console.log('✅ ModelManager loaded dictionary:', Object.keys(dict).length, 'entries');
|
|
688
|
-
return
|
|
739
|
+
return _context7.a(2, dict);
|
|
689
740
|
case 3:
|
|
690
|
-
|
|
691
|
-
_t8 =
|
|
741
|
+
_context7.p = 3;
|
|
742
|
+
_t8 = _context7.v;
|
|
692
743
|
console.warn('⚠️ Could not load component dictionary:', _t8);
|
|
693
|
-
return
|
|
744
|
+
return _context7.a(2, {});
|
|
694
745
|
}
|
|
695
746
|
}, _callee6, null, [[0, 3]]);
|
|
696
747
|
}));
|
|
@@ -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.22
|
|
35
35
|
* @updated 2025-10-22
|
|
36
36
|
*
|
|
37
37
|
* @description Creates a new CentralPlant instance and initializes internal managers and utilities.
|
|
@@ -23,6 +23,7 @@ import { ComponentDragManager } from '../managers/controls/componentDragManager.
|
|
|
23
23
|
import { SceneTooltipsManager } from '../managers/scene/sceneTooltipsManager.js';
|
|
24
24
|
import { ComponentTooltipManager } from '../managers/scene/componentTooltipManager.js';
|
|
25
25
|
import { Viewport2DManager } from '../managers/scene/viewport2DManager.js';
|
|
26
|
+
import { IoAnimationManager } from '../managers/behaviors/IoAnimationManager.js';
|
|
26
27
|
import { generateUuidFromName, getHardcodedUuid, findObjectByHardcodedUuid, generateUniqueComponentId } from '../utils/nameUtils.js';
|
|
27
28
|
import { attachIODevicesToComponent } from '../utils/ioDeviceUtils.js';
|
|
28
29
|
import modelPreloader from '../rendering/modelPreloader.js';
|
|
@@ -148,6 +149,7 @@ var CentralPlantInternals = /*#__PURE__*/function () {
|
|
|
148
149
|
this.centralPlant.managers.cameraControlsManager = new CameraControlsManager(this.centralPlant.sceneViewer);
|
|
149
150
|
this.centralPlant.managers.componentDragManager = new ComponentDragManager(this.centralPlant.sceneViewer);
|
|
150
151
|
this.centralPlant.managers.viewport2DManager = new Viewport2DManager(this.centralPlant.sceneViewer);
|
|
152
|
+
this.centralPlant.managers.ioAnimationManager = new IoAnimationManager(this.centralPlant.sceneViewer);
|
|
151
153
|
|
|
152
154
|
// All managers are now stored in the managers collection and will be attached via attachToComponent()
|
|
153
155
|
}
|
|
@@ -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', 'behaviorManager', 'sceneOperationsManager', 'animationManager', 'cameraControlsManager', 'componentDragManager', 'tooltipsManager', 'componentTooltipManager']; // Populate our managers tracking object
|
|
101
|
+
managerKeys = ['threeJSResourceManager', 'performanceMonitorManager', 'settingsManager', 'sceneExportManager', 'componentManager', 'sceneInitializationManager', 'environmentManager', 'keyboardControlsManager', 'pathfindingManager', 'pathFlowManager', 'behaviorManager', 'ioAnimationManager', '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];
|
package/dist/esm/src/index.js
CHANGED
|
@@ -10,6 +10,7 @@ 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
12
|
export { BehaviorManager } from './managers/behaviors/BehaviorManager.js';
|
|
13
|
+
export { IoAnimationManager } from './managers/behaviors/IoAnimationManager.js';
|
|
13
14
|
export { ComponentManager } from './managers/components/componentManager.js';
|
|
14
15
|
export { AnimationManager } from './managers/scene/animationManager.js';
|
|
15
16
|
export { PathfindingManager } from './managers/pathfinding/pathfindingManager.js';
|