@2112-lab/central-plant 0.1.63 → 0.1.65
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 +240 -127
- package/dist/cjs/src/core/centralPlant.js +143 -104
- package/dist/cjs/src/managers/components/componentDataManager.js +86 -23
- package/dist/cjs/src/rendering/modelPreloader.js +11 -0
- package/dist/esm/src/core/centralPlant.js +143 -104
- package/dist/esm/src/managers/components/componentDataManager.js +86 -23
- package/dist/esm/src/rendering/modelPreloader.js +11 -0
- package/package.json +1 -1
package/dist/bundle/index.js
CHANGED
|
@@ -17960,6 +17960,17 @@ var ModelPreloader = /*#__PURE__*/function () {
|
|
|
17960
17960
|
console.log("\u2705 Successfully preloaded GLB model: ".concat(modelKey));
|
|
17961
17961
|
// Cache the scene for future use
|
|
17962
17962
|
_this2.modelCache.set(modelKey, gltf.scene);
|
|
17963
|
+
|
|
17964
|
+
// Dispatch event to notify cache has been updated
|
|
17965
|
+
if (typeof window !== 'undefined') {
|
|
17966
|
+
window.dispatchEvent(new CustomEvent('modelCacheUpdated', {
|
|
17967
|
+
detail: {
|
|
17968
|
+
modelKey: modelKey,
|
|
17969
|
+
cacheSize: _this2.modelCache.size
|
|
17970
|
+
}
|
|
17971
|
+
}));
|
|
17972
|
+
}
|
|
17973
|
+
|
|
17963
17974
|
// Remove from loading promises
|
|
17964
17975
|
_this2.loadingPromises.delete(modelKey);
|
|
17965
17976
|
resolve(gltf.scene);
|
|
@@ -18965,6 +18976,69 @@ var ComponentDataManager = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
18965
18976
|
}
|
|
18966
18977
|
return extendComponentDictionary;
|
|
18967
18978
|
}()
|
|
18979
|
+
/**
|
|
18980
|
+
* Remove S3 components from the component dictionary
|
|
18981
|
+
* @returns {Promise<boolean>} True if components were removed successfully
|
|
18982
|
+
*/
|
|
18983
|
+
)
|
|
18984
|
+
}, {
|
|
18985
|
+
key: "removeS3Components",
|
|
18986
|
+
value: (function () {
|
|
18987
|
+
var _removeS3Components = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
18988
|
+
var _this3 = this;
|
|
18989
|
+
var _this$sceneViewer2, keysToRemove, _i2, _Object$entries2, _Object$entries2$_i, key, component, modelPreloader, _t2;
|
|
18990
|
+
return _regenerator().w(function (_context4) {
|
|
18991
|
+
while (1) switch (_context4.n) {
|
|
18992
|
+
case 0:
|
|
18993
|
+
_context4.n = 1;
|
|
18994
|
+
return this.ensureDictionaryLoaded();
|
|
18995
|
+
case 1:
|
|
18996
|
+
if (this.componentDictionary) {
|
|
18997
|
+
_context4.n = 2;
|
|
18998
|
+
break;
|
|
18999
|
+
}
|
|
19000
|
+
console.warn('⚠️ removeS3Components(): Component dictionary not loaded yet');
|
|
19001
|
+
return _context4.a(2, false);
|
|
19002
|
+
case 2:
|
|
19003
|
+
_context4.p = 2;
|
|
19004
|
+
// Find and remove all S3 components
|
|
19005
|
+
keysToRemove = [];
|
|
19006
|
+
for (_i2 = 0, _Object$entries2 = Object.entries(this.componentDictionary); _i2 < _Object$entries2.length; _i2++) {
|
|
19007
|
+
_Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2), key = _Object$entries2$_i[0], component = _Object$entries2$_i[1];
|
|
19008
|
+
if (component.isS3Component) {
|
|
19009
|
+
keysToRemove.push(key);
|
|
19010
|
+
}
|
|
19011
|
+
}
|
|
19012
|
+
|
|
19013
|
+
// Remove the S3 components
|
|
19014
|
+
keysToRemove.forEach(function (key) {
|
|
19015
|
+
delete _this3.componentDictionary[key];
|
|
19016
|
+
});
|
|
19017
|
+
|
|
19018
|
+
// Update ModelPreloader's dictionary reference
|
|
19019
|
+
modelPreloader = (_this$sceneViewer2 = this.sceneViewer) === null || _this$sceneViewer2 === void 0 || (_this$sceneViewer2 = _this$sceneViewer2.centralPlant) === null || _this$sceneViewer2 === void 0 || (_this$sceneViewer2 = _this$sceneViewer2.utilities) === null || _this$sceneViewer2 === void 0 ? void 0 : _this$sceneViewer2.modelPreloader;
|
|
19020
|
+
if (modelPreloader) {
|
|
19021
|
+
modelPreloader.componentDictionary = this.componentDictionary;
|
|
19022
|
+
console.log("\uD83D\uDD04 Updated ModelPreloader's dictionary reference (".concat(Object.keys(this.componentDictionary).length, " total components)"));
|
|
19023
|
+
}
|
|
19024
|
+
|
|
19025
|
+
// Clear cache to force refresh
|
|
19026
|
+
this.clearCache();
|
|
19027
|
+
console.log("\u2705 removeS3Components(): Removed ".concat(keysToRemove.length, " S3 components from dictionary"));
|
|
19028
|
+
return _context4.a(2, true);
|
|
19029
|
+
case 3:
|
|
19030
|
+
_context4.p = 3;
|
|
19031
|
+
_t2 = _context4.v;
|
|
19032
|
+
console.error('❌ removeS3Components(): Error removing S3 components:', _t2);
|
|
19033
|
+
return _context4.a(2, false);
|
|
19034
|
+
}
|
|
19035
|
+
}, _callee4, this, [[2, 3]]);
|
|
19036
|
+
}));
|
|
19037
|
+
function removeS3Components() {
|
|
19038
|
+
return _removeS3Components.apply(this, arguments);
|
|
19039
|
+
}
|
|
19040
|
+
return removeS3Components;
|
|
19041
|
+
}()
|
|
18968
19042
|
/**
|
|
18969
19043
|
* Clear the component cache
|
|
18970
19044
|
*/
|
|
@@ -18984,42 +19058,42 @@ var ComponentDataManager = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
18984
19058
|
}, {
|
|
18985
19059
|
key: "_loadComponentDictionary",
|
|
18986
19060
|
value: (function () {
|
|
18987
|
-
var _loadComponentDictionary2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
18988
|
-
var response,
|
|
18989
|
-
return _regenerator().w(function (
|
|
18990
|
-
while (1) switch (
|
|
19061
|
+
var _loadComponentDictionary2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
19062
|
+
var response, _t3;
|
|
19063
|
+
return _regenerator().w(function (_context5) {
|
|
19064
|
+
while (1) switch (_context5.n) {
|
|
18991
19065
|
case 0:
|
|
18992
|
-
|
|
18993
|
-
|
|
19066
|
+
_context5.p = 0;
|
|
19067
|
+
_context5.n = 1;
|
|
18994
19068
|
return fetch('/library/component-dictionary.json');
|
|
18995
19069
|
case 1:
|
|
18996
|
-
response =
|
|
19070
|
+
response = _context5.v;
|
|
18997
19071
|
if (!response.ok) {
|
|
18998
|
-
|
|
19072
|
+
_context5.n = 3;
|
|
18999
19073
|
break;
|
|
19000
19074
|
}
|
|
19001
|
-
|
|
19075
|
+
_context5.n = 2;
|
|
19002
19076
|
return response.json();
|
|
19003
19077
|
case 2:
|
|
19004
|
-
this.componentDictionary =
|
|
19078
|
+
this.componentDictionary = _context5.v;
|
|
19005
19079
|
console.log('📚 ComponentDataManager: Component dictionary loaded successfully');
|
|
19006
|
-
|
|
19080
|
+
_context5.n = 4;
|
|
19007
19081
|
break;
|
|
19008
19082
|
case 3:
|
|
19009
19083
|
console.warn('⚠️ ComponentDataManager: Could not load component dictionary');
|
|
19010
19084
|
this.componentDictionary = null;
|
|
19011
19085
|
case 4:
|
|
19012
|
-
|
|
19086
|
+
_context5.n = 6;
|
|
19013
19087
|
break;
|
|
19014
19088
|
case 5:
|
|
19015
|
-
|
|
19016
|
-
|
|
19017
|
-
console.warn('⚠️ ComponentDataManager: Error loading component dictionary:',
|
|
19089
|
+
_context5.p = 5;
|
|
19090
|
+
_t3 = _context5.v;
|
|
19091
|
+
console.warn('⚠️ ComponentDataManager: Error loading component dictionary:', _t3);
|
|
19018
19092
|
this.componentDictionary = null;
|
|
19019
19093
|
case 6:
|
|
19020
|
-
return
|
|
19094
|
+
return _context5.a(2);
|
|
19021
19095
|
}
|
|
19022
|
-
},
|
|
19096
|
+
}, _callee5, this, [[0, 5]]);
|
|
19023
19097
|
}));
|
|
19024
19098
|
function _loadComponentDictionary() {
|
|
19025
19099
|
return _loadComponentDictionary2.apply(this, arguments);
|
|
@@ -19040,10 +19114,10 @@ var ComponentDataManager = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
19040
19114
|
if (!this.componentDictionary) return 'unknown';
|
|
19041
19115
|
|
|
19042
19116
|
// Look for component in dictionary
|
|
19043
|
-
for (var
|
|
19044
|
-
var _Object$
|
|
19045
|
-
key = _Object$
|
|
19046
|
-
component = _Object$
|
|
19117
|
+
for (var _i3 = 0, _Object$entries3 = Object.entries(this.componentDictionary); _i3 < _Object$entries3.length; _i3++) {
|
|
19118
|
+
var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
|
|
19119
|
+
key = _Object$entries3$_i[0],
|
|
19120
|
+
component = _Object$entries3$_i[1];
|
|
19047
19121
|
if (key === 'categories') continue;
|
|
19048
19122
|
if (name && name.toLowerCase().includes(key.toLowerCase())) {
|
|
19049
19123
|
return component.category || 'unknown';
|
|
@@ -19069,7 +19143,7 @@ var ComponentDataManager = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
19069
19143
|
}, {
|
|
19070
19144
|
key: "_traverseScene",
|
|
19071
19145
|
value: function _traverseScene(object) {
|
|
19072
|
-
var
|
|
19146
|
+
var _this4 = this;
|
|
19073
19147
|
var components = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
19074
19148
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
19075
19149
|
if (!object) return components;
|
|
@@ -19085,7 +19159,7 @@ var ComponentDataManager = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
19085
19159
|
// Recursively traverse children
|
|
19086
19160
|
if (object.children && object.children.length > 0) {
|
|
19087
19161
|
object.children.forEach(function (child) {
|
|
19088
|
-
|
|
19162
|
+
_this4._traverseScene(child, components, options);
|
|
19089
19163
|
});
|
|
19090
19164
|
}
|
|
19091
19165
|
return components;
|
|
@@ -34399,7 +34473,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
34399
34473
|
* Initialize the CentralPlant manager
|
|
34400
34474
|
*
|
|
34401
34475
|
* @constructor
|
|
34402
|
-
* @version 0.1.
|
|
34476
|
+
* @version 0.1.65
|
|
34403
34477
|
* @updated 2025-10-22
|
|
34404
34478
|
*
|
|
34405
34479
|
* @description Creates a new CentralPlant instance and initializes internal managers and utilities.
|
|
@@ -35605,6 +35679,45 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
35605
35679
|
}
|
|
35606
35680
|
return extendComponentDictionary;
|
|
35607
35681
|
}()
|
|
35682
|
+
/**
|
|
35683
|
+
* Remove S3 components from component dictionary
|
|
35684
|
+
* @returns {Promise<boolean>} True if components were removed successfully, false otherwise
|
|
35685
|
+
* @description Removes all S3 components from the component dictionary, typically called when
|
|
35686
|
+
* user signs out or when S3 components need to be refreshed
|
|
35687
|
+
* @example
|
|
35688
|
+
* // Remove all S3 components from dictionary
|
|
35689
|
+
* const success = await centralPlant.removeS3Components();
|
|
35690
|
+
* if (success) {
|
|
35691
|
+
* console.log('S3 components removed');
|
|
35692
|
+
* }
|
|
35693
|
+
*/
|
|
35694
|
+
)
|
|
35695
|
+
}, {
|
|
35696
|
+
key: "removeS3Components",
|
|
35697
|
+
value: (function () {
|
|
35698
|
+
var _removeS3Components = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
35699
|
+
return _regenerator().w(function (_context4) {
|
|
35700
|
+
while (1) switch (_context4.n) {
|
|
35701
|
+
case 0:
|
|
35702
|
+
if (this.managers.componentDataManager) {
|
|
35703
|
+
_context4.n = 1;
|
|
35704
|
+
break;
|
|
35705
|
+
}
|
|
35706
|
+
console.warn('⚠️ removeS3Components(): Component data manager not available');
|
|
35707
|
+
return _context4.a(2, false);
|
|
35708
|
+
case 1:
|
|
35709
|
+
_context4.n = 2;
|
|
35710
|
+
return this.managers.componentDataManager.removeS3Components();
|
|
35711
|
+
case 2:
|
|
35712
|
+
return _context4.a(2, _context4.v);
|
|
35713
|
+
}
|
|
35714
|
+
}, _callee4, this);
|
|
35715
|
+
}));
|
|
35716
|
+
function removeS3Components() {
|
|
35717
|
+
return _removeS3Components.apply(this, arguments);
|
|
35718
|
+
}
|
|
35719
|
+
return removeS3Components;
|
|
35720
|
+
}()
|
|
35608
35721
|
/**
|
|
35609
35722
|
* Select an object (component, connector, or gateway) in the scene by its ID
|
|
35610
35723
|
* @param {string} objectId - The UUID or name of the object to select
|
|
@@ -35802,49 +35915,49 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
35802
35915
|
}, {
|
|
35803
35916
|
key: "initialize2DViewport",
|
|
35804
35917
|
value: function () {
|
|
35805
|
-
var _initialize2DViewport = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
35918
|
+
var _initialize2DViewport = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(container) {
|
|
35806
35919
|
var viewType,
|
|
35807
35920
|
instanceKey,
|
|
35808
35921
|
success,
|
|
35809
|
-
|
|
35922
|
+
_args5 = arguments,
|
|
35810
35923
|
_t2;
|
|
35811
|
-
return _regenerator().w(function (
|
|
35812
|
-
while (1) switch (
|
|
35924
|
+
return _regenerator().w(function (_context5) {
|
|
35925
|
+
while (1) switch (_context5.n) {
|
|
35813
35926
|
case 0:
|
|
35814
|
-
viewType =
|
|
35815
|
-
instanceKey =
|
|
35927
|
+
viewType = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : 'top';
|
|
35928
|
+
instanceKey = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : null;
|
|
35816
35929
|
if (container) {
|
|
35817
|
-
|
|
35930
|
+
_context5.n = 1;
|
|
35818
35931
|
break;
|
|
35819
35932
|
}
|
|
35820
35933
|
console.warn('⚠️ initialize2DViewport(): No container provided');
|
|
35821
|
-
return
|
|
35934
|
+
return _context5.a(2, false);
|
|
35822
35935
|
case 1:
|
|
35823
35936
|
if (this.managers.viewport2DManager) {
|
|
35824
|
-
|
|
35937
|
+
_context5.n = 2;
|
|
35825
35938
|
break;
|
|
35826
35939
|
}
|
|
35827
35940
|
console.warn('⚠️ initialize2DViewport(): Viewport2D manager not available');
|
|
35828
|
-
return
|
|
35941
|
+
return _context5.a(2, false);
|
|
35829
35942
|
case 2:
|
|
35830
|
-
|
|
35831
|
-
|
|
35943
|
+
_context5.p = 2;
|
|
35944
|
+
_context5.n = 3;
|
|
35832
35945
|
return this.managers.viewport2DManager.initialize(container, viewType, instanceKey);
|
|
35833
35946
|
case 3:
|
|
35834
|
-
success =
|
|
35947
|
+
success = _context5.v;
|
|
35835
35948
|
if (success) {
|
|
35836
35949
|
console.log("\u2705 2D viewport initialized successfully (".concat(viewType, " view, key: ").concat(instanceKey || viewType, ")"));
|
|
35837
35950
|
} else {
|
|
35838
35951
|
console.warn("\u26A0\uFE0F Failed to initialize 2D viewport (".concat(viewType, " view)"));
|
|
35839
35952
|
}
|
|
35840
|
-
return
|
|
35953
|
+
return _context5.a(2, success);
|
|
35841
35954
|
case 4:
|
|
35842
|
-
|
|
35843
|
-
_t2 =
|
|
35955
|
+
_context5.p = 4;
|
|
35956
|
+
_t2 = _context5.v;
|
|
35844
35957
|
console.error('❌ initialize2DViewport(): Error initializing 2D viewport:', _t2);
|
|
35845
|
-
return
|
|
35958
|
+
return _context5.a(2, false);
|
|
35846
35959
|
}
|
|
35847
|
-
},
|
|
35960
|
+
}, _callee5, this, [[2, 4]]);
|
|
35848
35961
|
}));
|
|
35849
35962
|
function initialize2DViewport(_x3) {
|
|
35850
35963
|
return _initialize2DViewport.apply(this, arguments);
|
|
@@ -35992,7 +36105,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
35992
36105
|
}, {
|
|
35993
36106
|
key: "initializeModelPreloading",
|
|
35994
36107
|
value: (function () {
|
|
35995
|
-
var _initializeModelPreloading = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
36108
|
+
var _initializeModelPreloading = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
35996
36109
|
var basePath,
|
|
35997
36110
|
normalizedBasePath,
|
|
35998
36111
|
dictionaryPath,
|
|
@@ -36001,13 +36114,13 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36001
36114
|
componentDictionary,
|
|
36002
36115
|
_modelPreloader2,
|
|
36003
36116
|
progress,
|
|
36004
|
-
|
|
36117
|
+
_args6 = arguments,
|
|
36005
36118
|
_t3;
|
|
36006
|
-
return _regenerator().w(function (
|
|
36007
|
-
while (1) switch (
|
|
36119
|
+
return _regenerator().w(function (_context6) {
|
|
36120
|
+
while (1) switch (_context6.n) {
|
|
36008
36121
|
case 0:
|
|
36009
|
-
basePath =
|
|
36010
|
-
|
|
36122
|
+
basePath = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : '/library/';
|
|
36123
|
+
_context6.p = 1;
|
|
36011
36124
|
// Ensure basePath ends with a slash
|
|
36012
36125
|
normalizedBasePath = basePath.endsWith('/') ? basePath : "".concat(basePath, "/");
|
|
36013
36126
|
dictionaryPath = "".concat(normalizedBasePath, "component-dictionary.json");
|
|
@@ -36018,39 +36131,39 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36018
36131
|
console.log("\uFFFD Models path: ".concat(modelsBasePath));
|
|
36019
36132
|
|
|
36020
36133
|
// Load the component dictionary
|
|
36021
|
-
|
|
36134
|
+
_context6.n = 2;
|
|
36022
36135
|
return fetch(dictionaryPath);
|
|
36023
36136
|
case 2:
|
|
36024
|
-
response =
|
|
36137
|
+
response = _context6.v;
|
|
36025
36138
|
if (response.ok) {
|
|
36026
|
-
|
|
36139
|
+
_context6.n = 3;
|
|
36027
36140
|
break;
|
|
36028
36141
|
}
|
|
36029
36142
|
throw new Error("Failed to load component dictionary: ".concat(response.status));
|
|
36030
36143
|
case 3:
|
|
36031
|
-
|
|
36144
|
+
_context6.n = 4;
|
|
36032
36145
|
return response.json();
|
|
36033
36146
|
case 4:
|
|
36034
|
-
componentDictionary =
|
|
36147
|
+
componentDictionary = _context6.v;
|
|
36035
36148
|
console.log('📚 Component dictionary loaded:', Object.keys(componentDictionary));
|
|
36036
36149
|
|
|
36037
36150
|
// Start preloading all models with the specified base path
|
|
36038
36151
|
_modelPreloader2 = this.getUtility('modelPreloader');
|
|
36039
|
-
|
|
36152
|
+
_context6.n = 5;
|
|
36040
36153
|
return _modelPreloader2.preloadAllModels(componentDictionary, modelsBasePath);
|
|
36041
36154
|
case 5:
|
|
36042
|
-
progress =
|
|
36155
|
+
progress = _context6.v;
|
|
36043
36156
|
console.log('🎉 Model preloading completed:', progress);
|
|
36044
|
-
return
|
|
36157
|
+
return _context6.a(2, progress);
|
|
36045
36158
|
case 6:
|
|
36046
|
-
|
|
36047
|
-
_t3 =
|
|
36159
|
+
_context6.p = 6;
|
|
36160
|
+
_t3 = _context6.v;
|
|
36048
36161
|
console.error('❌ Failed to initialize model preloading:', _t3);
|
|
36049
36162
|
throw _t3;
|
|
36050
36163
|
case 7:
|
|
36051
|
-
return
|
|
36164
|
+
return _context6.a(2);
|
|
36052
36165
|
}
|
|
36053
|
-
},
|
|
36166
|
+
}, _callee6, this, [[1, 6]]);
|
|
36054
36167
|
}));
|
|
36055
36168
|
function initializeModelPreloading() {
|
|
36056
36169
|
return _initializeModelPreloading.apply(this, arguments);
|
|
@@ -36067,55 +36180,55 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36067
36180
|
}, {
|
|
36068
36181
|
key: "importScene",
|
|
36069
36182
|
value: (function () {
|
|
36070
|
-
var _importScene = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
36183
|
+
var _importScene = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(jsonData) {
|
|
36071
36184
|
var validation, _t4;
|
|
36072
|
-
return _regenerator().w(function (
|
|
36073
|
-
while (1) switch (
|
|
36185
|
+
return _regenerator().w(function (_context7) {
|
|
36186
|
+
while (1) switch (_context7.n) {
|
|
36074
36187
|
case 0:
|
|
36075
36188
|
if (jsonData) {
|
|
36076
|
-
|
|
36189
|
+
_context7.n = 1;
|
|
36077
36190
|
break;
|
|
36078
36191
|
}
|
|
36079
36192
|
console.error('❌ No JSON data provided for import');
|
|
36080
|
-
return
|
|
36193
|
+
return _context7.a(2, false);
|
|
36081
36194
|
case 1:
|
|
36082
|
-
|
|
36195
|
+
_context7.p = 1;
|
|
36083
36196
|
// Validate scene data structure
|
|
36084
36197
|
validation = this.internals.validateAndAnalyzeSceneData(jsonData);
|
|
36085
36198
|
if (validation.isValid) {
|
|
36086
|
-
|
|
36199
|
+
_context7.n = 2;
|
|
36087
36200
|
break;
|
|
36088
36201
|
}
|
|
36089
36202
|
console.error('❌ Invalid scene data format:', validation.message);
|
|
36090
|
-
return
|
|
36203
|
+
return _context7.a(2, false);
|
|
36091
36204
|
case 2:
|
|
36092
|
-
|
|
36205
|
+
_context7.n = 3;
|
|
36093
36206
|
return this.setImportedSceneData(jsonData);
|
|
36094
36207
|
case 3:
|
|
36095
36208
|
if (!(this.sceneViewer && this.sceneViewer.sceneOperationsManager)) {
|
|
36096
|
-
|
|
36209
|
+
_context7.n = 5;
|
|
36097
36210
|
break;
|
|
36098
36211
|
}
|
|
36099
|
-
|
|
36212
|
+
_context7.n = 4;
|
|
36100
36213
|
return this.sceneViewer.sceneOperationsManager.loadSceneFromData(jsonData);
|
|
36101
36214
|
case 4:
|
|
36102
36215
|
console.log('✅ Scene imported successfully');
|
|
36103
|
-
return
|
|
36216
|
+
return _context7.a(2, true);
|
|
36104
36217
|
case 5:
|
|
36105
36218
|
console.error('❌ SceneViewer not available for scene loading');
|
|
36106
|
-
return
|
|
36219
|
+
return _context7.a(2, false);
|
|
36107
36220
|
case 6:
|
|
36108
|
-
|
|
36221
|
+
_context7.n = 8;
|
|
36109
36222
|
break;
|
|
36110
36223
|
case 7:
|
|
36111
|
-
|
|
36112
|
-
_t4 =
|
|
36224
|
+
_context7.p = 7;
|
|
36225
|
+
_t4 = _context7.v;
|
|
36113
36226
|
console.error('❌ Error importing scene:', _t4);
|
|
36114
|
-
return
|
|
36227
|
+
return _context7.a(2, false);
|
|
36115
36228
|
case 8:
|
|
36116
|
-
return
|
|
36229
|
+
return _context7.a(2);
|
|
36117
36230
|
}
|
|
36118
|
-
},
|
|
36231
|
+
}, _callee7, this, [[1, 7]]);
|
|
36119
36232
|
}));
|
|
36120
36233
|
function importScene(_x4) {
|
|
36121
36234
|
return _importScene.apply(this, arguments);
|
|
@@ -36139,33 +36252,33 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36139
36252
|
}, {
|
|
36140
36253
|
key: "exportSceneJSON",
|
|
36141
36254
|
value: (function () {
|
|
36142
|
-
var _exportSceneJSON = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
36255
|
+
var _exportSceneJSON = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
|
|
36143
36256
|
var filename,
|
|
36144
|
-
|
|
36257
|
+
_args8 = arguments,
|
|
36145
36258
|
_t5;
|
|
36146
|
-
return _regenerator().w(function (
|
|
36147
|
-
while (1) switch (
|
|
36259
|
+
return _regenerator().w(function (_context8) {
|
|
36260
|
+
while (1) switch (_context8.n) {
|
|
36148
36261
|
case 0:
|
|
36149
|
-
filename =
|
|
36262
|
+
filename = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : null;
|
|
36150
36263
|
if (this.managers.sceneExportManager) {
|
|
36151
|
-
|
|
36264
|
+
_context8.n = 1;
|
|
36152
36265
|
break;
|
|
36153
36266
|
}
|
|
36154
36267
|
console.error('❌ Scene export manager not available');
|
|
36155
|
-
return
|
|
36268
|
+
return _context8.a(2, false);
|
|
36156
36269
|
case 1:
|
|
36157
|
-
|
|
36158
|
-
|
|
36270
|
+
_context8.p = 1;
|
|
36271
|
+
_context8.n = 2;
|
|
36159
36272
|
return this.managers.sceneExportManager.downloadSceneJSON(filename);
|
|
36160
36273
|
case 2:
|
|
36161
|
-
return
|
|
36274
|
+
return _context8.a(2, _context8.v);
|
|
36162
36275
|
case 3:
|
|
36163
|
-
|
|
36164
|
-
_t5 =
|
|
36276
|
+
_context8.p = 3;
|
|
36277
|
+
_t5 = _context8.v;
|
|
36165
36278
|
console.error('❌ Error exporting scene as JSON:', _t5);
|
|
36166
|
-
return
|
|
36279
|
+
return _context8.a(2, false);
|
|
36167
36280
|
}
|
|
36168
|
-
},
|
|
36281
|
+
}, _callee8, this, [[1, 3]]);
|
|
36169
36282
|
}));
|
|
36170
36283
|
function exportSceneJSON() {
|
|
36171
36284
|
return _exportSceneJSON.apply(this, arguments);
|
|
@@ -36190,33 +36303,33 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36190
36303
|
}, {
|
|
36191
36304
|
key: "exportSceneGLTF",
|
|
36192
36305
|
value: (function () {
|
|
36193
|
-
var _exportSceneGLTF = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
36306
|
+
var _exportSceneGLTF = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
|
|
36194
36307
|
var filename,
|
|
36195
|
-
|
|
36308
|
+
_args9 = arguments,
|
|
36196
36309
|
_t6;
|
|
36197
|
-
return _regenerator().w(function (
|
|
36198
|
-
while (1) switch (
|
|
36310
|
+
return _regenerator().w(function (_context9) {
|
|
36311
|
+
while (1) switch (_context9.n) {
|
|
36199
36312
|
case 0:
|
|
36200
|
-
filename =
|
|
36313
|
+
filename = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : null;
|
|
36201
36314
|
if (this.managers.sceneExportManager) {
|
|
36202
|
-
|
|
36315
|
+
_context9.n = 1;
|
|
36203
36316
|
break;
|
|
36204
36317
|
}
|
|
36205
36318
|
console.error('❌ Scene export manager not available');
|
|
36206
|
-
return
|
|
36319
|
+
return _context9.a(2, false);
|
|
36207
36320
|
case 1:
|
|
36208
|
-
|
|
36209
|
-
|
|
36321
|
+
_context9.p = 1;
|
|
36322
|
+
_context9.n = 2;
|
|
36210
36323
|
return this.managers.sceneExportManager.exportSceneAsGLTF(filename, false);
|
|
36211
36324
|
case 2:
|
|
36212
|
-
return
|
|
36325
|
+
return _context9.a(2, _context9.v);
|
|
36213
36326
|
case 3:
|
|
36214
|
-
|
|
36215
|
-
_t6 =
|
|
36327
|
+
_context9.p = 3;
|
|
36328
|
+
_t6 = _context9.v;
|
|
36216
36329
|
console.error('❌ Error exporting scene as GLTF:', _t6);
|
|
36217
|
-
return
|
|
36330
|
+
return _context9.a(2, false);
|
|
36218
36331
|
}
|
|
36219
|
-
},
|
|
36332
|
+
}, _callee9, this, [[1, 3]]);
|
|
36220
36333
|
}));
|
|
36221
36334
|
function exportSceneGLTF() {
|
|
36222
36335
|
return _exportSceneGLTF.apply(this, arguments);
|
|
@@ -36242,33 +36355,33 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36242
36355
|
}, {
|
|
36243
36356
|
key: "exportSceneGLB",
|
|
36244
36357
|
value: (function () {
|
|
36245
|
-
var _exportSceneGLB = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
36358
|
+
var _exportSceneGLB = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
|
|
36246
36359
|
var filename,
|
|
36247
|
-
|
|
36360
|
+
_args0 = arguments,
|
|
36248
36361
|
_t7;
|
|
36249
|
-
return _regenerator().w(function (
|
|
36250
|
-
while (1) switch (
|
|
36362
|
+
return _regenerator().w(function (_context0) {
|
|
36363
|
+
while (1) switch (_context0.n) {
|
|
36251
36364
|
case 0:
|
|
36252
|
-
filename =
|
|
36365
|
+
filename = _args0.length > 0 && _args0[0] !== undefined ? _args0[0] : null;
|
|
36253
36366
|
if (this.managers.sceneExportManager) {
|
|
36254
|
-
|
|
36367
|
+
_context0.n = 1;
|
|
36255
36368
|
break;
|
|
36256
36369
|
}
|
|
36257
36370
|
console.error('❌ Scene export manager not available');
|
|
36258
|
-
return
|
|
36371
|
+
return _context0.a(2, false);
|
|
36259
36372
|
case 1:
|
|
36260
|
-
|
|
36261
|
-
|
|
36373
|
+
_context0.p = 1;
|
|
36374
|
+
_context0.n = 2;
|
|
36262
36375
|
return this.managers.sceneExportManager.exportSceneAsGLB(filename);
|
|
36263
36376
|
case 2:
|
|
36264
|
-
return
|
|
36377
|
+
return _context0.a(2, _context0.v);
|
|
36265
36378
|
case 3:
|
|
36266
|
-
|
|
36267
|
-
_t7 =
|
|
36379
|
+
_context0.p = 3;
|
|
36380
|
+
_t7 = _context0.v;
|
|
36268
36381
|
console.error('❌ Error exporting scene as GLB:', _t7);
|
|
36269
|
-
return
|
|
36382
|
+
return _context0.a(2, false);
|
|
36270
36383
|
}
|
|
36271
|
-
},
|
|
36384
|
+
}, _callee0, this, [[1, 3]]);
|
|
36272
36385
|
}));
|
|
36273
36386
|
function exportSceneGLB() {
|
|
36274
36387
|
return _exportSceneGLB.apply(this, arguments);
|
|
@@ -36307,16 +36420,16 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36307
36420
|
}, {
|
|
36308
36421
|
key: "loadSceneFromData",
|
|
36309
36422
|
value: (function () {
|
|
36310
|
-
var _loadSceneFromData = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
36311
|
-
return _regenerator().w(function (
|
|
36312
|
-
while (1) switch (
|
|
36423
|
+
var _loadSceneFromData = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(sceneData) {
|
|
36424
|
+
return _regenerator().w(function (_context1) {
|
|
36425
|
+
while (1) switch (_context1.n) {
|
|
36313
36426
|
case 0:
|
|
36314
|
-
|
|
36427
|
+
_context1.n = 1;
|
|
36315
36428
|
return this.setImportedSceneData(sceneData);
|
|
36316
36429
|
case 1:
|
|
36317
|
-
return
|
|
36430
|
+
return _context1.a(2, true);
|
|
36318
36431
|
}
|
|
36319
|
-
},
|
|
36432
|
+
}, _callee1, this);
|
|
36320
36433
|
}));
|
|
36321
36434
|
function loadSceneFromData(_x5) {
|
|
36322
36435
|
return _loadSceneFromData.apply(this, arguments);
|