@2112-lab/central-plant 0.1.65 → 0.1.66
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 +230 -124
- package/dist/cjs/src/core/centralPlant.js +147 -107
- package/dist/cjs/src/managers/components/componentDataManager.js +83 -17
- package/dist/esm/src/core/centralPlant.js +147 -107
- package/dist/esm/src/managers/components/componentDataManager.js +83 -17
- package/package.json +1 -1
package/dist/bundle/index.js
CHANGED
|
@@ -19039,6 +19039,72 @@ var ComponentDataManager = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
19039
19039
|
}
|
|
19040
19040
|
return removeS3Components;
|
|
19041
19041
|
}()
|
|
19042
|
+
/**
|
|
19043
|
+
* Remove a specific component from the dictionary by its key
|
|
19044
|
+
* @param {string} componentKey - The dictionary key of the component to remove (typically UUID)
|
|
19045
|
+
* @returns {Promise<boolean>} True if component was removed successfully
|
|
19046
|
+
*/
|
|
19047
|
+
)
|
|
19048
|
+
}, {
|
|
19049
|
+
key: "removeComponentFromDictionary",
|
|
19050
|
+
value: (function () {
|
|
19051
|
+
var _removeComponentFromDictionary = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(componentKey) {
|
|
19052
|
+
var _this$sceneViewer3, modelPreloader, _t3;
|
|
19053
|
+
return _regenerator().w(function (_context5) {
|
|
19054
|
+
while (1) switch (_context5.n) {
|
|
19055
|
+
case 0:
|
|
19056
|
+
_context5.n = 1;
|
|
19057
|
+
return this.ensureDictionaryLoaded();
|
|
19058
|
+
case 1:
|
|
19059
|
+
if (this.componentDictionary) {
|
|
19060
|
+
_context5.n = 2;
|
|
19061
|
+
break;
|
|
19062
|
+
}
|
|
19063
|
+
console.warn('⚠️ removeComponentFromDictionary(): Component dictionary not loaded yet');
|
|
19064
|
+
return _context5.a(2, false);
|
|
19065
|
+
case 2:
|
|
19066
|
+
if (componentKey) {
|
|
19067
|
+
_context5.n = 3;
|
|
19068
|
+
break;
|
|
19069
|
+
}
|
|
19070
|
+
console.warn('⚠️ removeComponentFromDictionary(): No component key provided');
|
|
19071
|
+
return _context5.a(2, false);
|
|
19072
|
+
case 3:
|
|
19073
|
+
_context5.p = 3;
|
|
19074
|
+
if (this.componentDictionary[componentKey]) {
|
|
19075
|
+
_context5.n = 4;
|
|
19076
|
+
break;
|
|
19077
|
+
}
|
|
19078
|
+
console.warn("\u26A0\uFE0F removeComponentFromDictionary(): Component ".concat(componentKey, " not found in dictionary"));
|
|
19079
|
+
return _context5.a(2, false);
|
|
19080
|
+
case 4:
|
|
19081
|
+
// Remove the component
|
|
19082
|
+
delete this.componentDictionary[componentKey];
|
|
19083
|
+
|
|
19084
|
+
// Update ModelPreloader's dictionary reference
|
|
19085
|
+
modelPreloader = (_this$sceneViewer3 = this.sceneViewer) === null || _this$sceneViewer3 === void 0 || (_this$sceneViewer3 = _this$sceneViewer3.centralPlant) === null || _this$sceneViewer3 === void 0 || (_this$sceneViewer3 = _this$sceneViewer3.utilities) === null || _this$sceneViewer3 === void 0 ? void 0 : _this$sceneViewer3.modelPreloader;
|
|
19086
|
+
if (modelPreloader) {
|
|
19087
|
+
modelPreloader.componentDictionary = this.componentDictionary;
|
|
19088
|
+
console.log("\uD83D\uDD04 Updated ModelPreloader's dictionary reference (".concat(Object.keys(this.componentDictionary).length, " total components)"));
|
|
19089
|
+
}
|
|
19090
|
+
|
|
19091
|
+
// Clear cache to force refresh
|
|
19092
|
+
this.clearCache();
|
|
19093
|
+
console.log("\u2705 removeComponentFromDictionary(): Removed component ".concat(componentKey, " from dictionary"));
|
|
19094
|
+
return _context5.a(2, true);
|
|
19095
|
+
case 5:
|
|
19096
|
+
_context5.p = 5;
|
|
19097
|
+
_t3 = _context5.v;
|
|
19098
|
+
console.error("\u274C removeComponentFromDictionary(): Error removing component ".concat(componentKey, ":"), _t3);
|
|
19099
|
+
return _context5.a(2, false);
|
|
19100
|
+
}
|
|
19101
|
+
}, _callee5, this, [[3, 5]]);
|
|
19102
|
+
}));
|
|
19103
|
+
function removeComponentFromDictionary(_x2) {
|
|
19104
|
+
return _removeComponentFromDictionary.apply(this, arguments);
|
|
19105
|
+
}
|
|
19106
|
+
return removeComponentFromDictionary;
|
|
19107
|
+
}()
|
|
19042
19108
|
/**
|
|
19043
19109
|
* Clear the component cache
|
|
19044
19110
|
*/
|
|
@@ -19058,42 +19124,42 @@ var ComponentDataManager = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
19058
19124
|
}, {
|
|
19059
19125
|
key: "_loadComponentDictionary",
|
|
19060
19126
|
value: (function () {
|
|
19061
|
-
var _loadComponentDictionary2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
19062
|
-
var response,
|
|
19063
|
-
return _regenerator().w(function (
|
|
19064
|
-
while (1) switch (
|
|
19127
|
+
var _loadComponentDictionary2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
19128
|
+
var response, _t4;
|
|
19129
|
+
return _regenerator().w(function (_context6) {
|
|
19130
|
+
while (1) switch (_context6.n) {
|
|
19065
19131
|
case 0:
|
|
19066
|
-
|
|
19067
|
-
|
|
19132
|
+
_context6.p = 0;
|
|
19133
|
+
_context6.n = 1;
|
|
19068
19134
|
return fetch('/library/component-dictionary.json');
|
|
19069
19135
|
case 1:
|
|
19070
|
-
response =
|
|
19136
|
+
response = _context6.v;
|
|
19071
19137
|
if (!response.ok) {
|
|
19072
|
-
|
|
19138
|
+
_context6.n = 3;
|
|
19073
19139
|
break;
|
|
19074
19140
|
}
|
|
19075
|
-
|
|
19141
|
+
_context6.n = 2;
|
|
19076
19142
|
return response.json();
|
|
19077
19143
|
case 2:
|
|
19078
|
-
this.componentDictionary =
|
|
19144
|
+
this.componentDictionary = _context6.v;
|
|
19079
19145
|
console.log('📚 ComponentDataManager: Component dictionary loaded successfully');
|
|
19080
|
-
|
|
19146
|
+
_context6.n = 4;
|
|
19081
19147
|
break;
|
|
19082
19148
|
case 3:
|
|
19083
19149
|
console.warn('⚠️ ComponentDataManager: Could not load component dictionary');
|
|
19084
19150
|
this.componentDictionary = null;
|
|
19085
19151
|
case 4:
|
|
19086
|
-
|
|
19152
|
+
_context6.n = 6;
|
|
19087
19153
|
break;
|
|
19088
19154
|
case 5:
|
|
19089
|
-
|
|
19090
|
-
|
|
19091
|
-
console.warn('⚠️ ComponentDataManager: Error loading component dictionary:',
|
|
19155
|
+
_context6.p = 5;
|
|
19156
|
+
_t4 = _context6.v;
|
|
19157
|
+
console.warn('⚠️ ComponentDataManager: Error loading component dictionary:', _t4);
|
|
19092
19158
|
this.componentDictionary = null;
|
|
19093
19159
|
case 6:
|
|
19094
|
-
return
|
|
19160
|
+
return _context6.a(2);
|
|
19095
19161
|
}
|
|
19096
|
-
},
|
|
19162
|
+
}, _callee6, this, [[0, 5]]);
|
|
19097
19163
|
}));
|
|
19098
19164
|
function _loadComponentDictionary() {
|
|
19099
19165
|
return _loadComponentDictionary2.apply(this, arguments);
|
|
@@ -34473,7 +34539,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
34473
34539
|
* Initialize the CentralPlant manager
|
|
34474
34540
|
*
|
|
34475
34541
|
* @constructor
|
|
34476
|
-
* @version 0.1.
|
|
34542
|
+
* @version 0.1.66
|
|
34477
34543
|
* @updated 2025-10-22
|
|
34478
34544
|
*
|
|
34479
34545
|
* @description Creates a new CentralPlant instance and initializes internal managers and utilities.
|
|
@@ -35718,6 +35784,46 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
35718
35784
|
}
|
|
35719
35785
|
return removeS3Components;
|
|
35720
35786
|
}()
|
|
35787
|
+
/**
|
|
35788
|
+
* Remove a specific component from the dictionary by its key
|
|
35789
|
+
* @param {string} componentKey - The dictionary key of the component to remove (typically UUID)
|
|
35790
|
+
* @returns {Promise<boolean>} True if component was removed successfully, false otherwise
|
|
35791
|
+
* @description Removes a single component from the component dictionary by its key.
|
|
35792
|
+
* This is typically used when deleting user-uploaded S3 components.
|
|
35793
|
+
* @example
|
|
35794
|
+
* // Remove a specific component by UUID
|
|
35795
|
+
* const success = await centralPlant.removeComponentFromDictionary('my-component-uuid-123');
|
|
35796
|
+
* if (success) {
|
|
35797
|
+
* console.log('Component removed from dictionary');
|
|
35798
|
+
* }
|
|
35799
|
+
*/
|
|
35800
|
+
)
|
|
35801
|
+
}, {
|
|
35802
|
+
key: "removeComponentFromDictionary",
|
|
35803
|
+
value: (function () {
|
|
35804
|
+
var _removeComponentFromDictionary = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(componentKey) {
|
|
35805
|
+
return _regenerator().w(function (_context5) {
|
|
35806
|
+
while (1) switch (_context5.n) {
|
|
35807
|
+
case 0:
|
|
35808
|
+
if (this.managers.componentDataManager) {
|
|
35809
|
+
_context5.n = 1;
|
|
35810
|
+
break;
|
|
35811
|
+
}
|
|
35812
|
+
console.warn('⚠️ removeComponentFromDictionary(): Component data manager not available');
|
|
35813
|
+
return _context5.a(2, false);
|
|
35814
|
+
case 1:
|
|
35815
|
+
_context5.n = 2;
|
|
35816
|
+
return this.managers.componentDataManager.removeComponentFromDictionary(componentKey);
|
|
35817
|
+
case 2:
|
|
35818
|
+
return _context5.a(2, _context5.v);
|
|
35819
|
+
}
|
|
35820
|
+
}, _callee5, this);
|
|
35821
|
+
}));
|
|
35822
|
+
function removeComponentFromDictionary(_x3) {
|
|
35823
|
+
return _removeComponentFromDictionary.apply(this, arguments);
|
|
35824
|
+
}
|
|
35825
|
+
return removeComponentFromDictionary;
|
|
35826
|
+
}()
|
|
35721
35827
|
/**
|
|
35722
35828
|
* Select an object (component, connector, or gateway) in the scene by its ID
|
|
35723
35829
|
* @param {string} objectId - The UUID or name of the object to select
|
|
@@ -35915,51 +36021,51 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
35915
36021
|
}, {
|
|
35916
36022
|
key: "initialize2DViewport",
|
|
35917
36023
|
value: function () {
|
|
35918
|
-
var _initialize2DViewport = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
36024
|
+
var _initialize2DViewport = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(container) {
|
|
35919
36025
|
var viewType,
|
|
35920
36026
|
instanceKey,
|
|
35921
36027
|
success,
|
|
35922
|
-
|
|
36028
|
+
_args6 = arguments,
|
|
35923
36029
|
_t2;
|
|
35924
|
-
return _regenerator().w(function (
|
|
35925
|
-
while (1) switch (
|
|
36030
|
+
return _regenerator().w(function (_context6) {
|
|
36031
|
+
while (1) switch (_context6.n) {
|
|
35926
36032
|
case 0:
|
|
35927
|
-
viewType =
|
|
35928
|
-
instanceKey =
|
|
36033
|
+
viewType = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : 'top';
|
|
36034
|
+
instanceKey = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : null;
|
|
35929
36035
|
if (container) {
|
|
35930
|
-
|
|
36036
|
+
_context6.n = 1;
|
|
35931
36037
|
break;
|
|
35932
36038
|
}
|
|
35933
36039
|
console.warn('⚠️ initialize2DViewport(): No container provided');
|
|
35934
|
-
return
|
|
36040
|
+
return _context6.a(2, false);
|
|
35935
36041
|
case 1:
|
|
35936
36042
|
if (this.managers.viewport2DManager) {
|
|
35937
|
-
|
|
36043
|
+
_context6.n = 2;
|
|
35938
36044
|
break;
|
|
35939
36045
|
}
|
|
35940
36046
|
console.warn('⚠️ initialize2DViewport(): Viewport2D manager not available');
|
|
35941
|
-
return
|
|
36047
|
+
return _context6.a(2, false);
|
|
35942
36048
|
case 2:
|
|
35943
|
-
|
|
35944
|
-
|
|
36049
|
+
_context6.p = 2;
|
|
36050
|
+
_context6.n = 3;
|
|
35945
36051
|
return this.managers.viewport2DManager.initialize(container, viewType, instanceKey);
|
|
35946
36052
|
case 3:
|
|
35947
|
-
success =
|
|
36053
|
+
success = _context6.v;
|
|
35948
36054
|
if (success) {
|
|
35949
36055
|
console.log("\u2705 2D viewport initialized successfully (".concat(viewType, " view, key: ").concat(instanceKey || viewType, ")"));
|
|
35950
36056
|
} else {
|
|
35951
36057
|
console.warn("\u26A0\uFE0F Failed to initialize 2D viewport (".concat(viewType, " view)"));
|
|
35952
36058
|
}
|
|
35953
|
-
return
|
|
36059
|
+
return _context6.a(2, success);
|
|
35954
36060
|
case 4:
|
|
35955
|
-
|
|
35956
|
-
_t2 =
|
|
36061
|
+
_context6.p = 4;
|
|
36062
|
+
_t2 = _context6.v;
|
|
35957
36063
|
console.error('❌ initialize2DViewport(): Error initializing 2D viewport:', _t2);
|
|
35958
|
-
return
|
|
36064
|
+
return _context6.a(2, false);
|
|
35959
36065
|
}
|
|
35960
|
-
},
|
|
36066
|
+
}, _callee6, this, [[2, 4]]);
|
|
35961
36067
|
}));
|
|
35962
|
-
function initialize2DViewport(
|
|
36068
|
+
function initialize2DViewport(_x4) {
|
|
35963
36069
|
return _initialize2DViewport.apply(this, arguments);
|
|
35964
36070
|
}
|
|
35965
36071
|
return initialize2DViewport;
|
|
@@ -36105,7 +36211,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36105
36211
|
}, {
|
|
36106
36212
|
key: "initializeModelPreloading",
|
|
36107
36213
|
value: (function () {
|
|
36108
|
-
var _initializeModelPreloading = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
36214
|
+
var _initializeModelPreloading = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
|
|
36109
36215
|
var basePath,
|
|
36110
36216
|
normalizedBasePath,
|
|
36111
36217
|
dictionaryPath,
|
|
@@ -36114,13 +36220,13 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36114
36220
|
componentDictionary,
|
|
36115
36221
|
_modelPreloader2,
|
|
36116
36222
|
progress,
|
|
36117
|
-
|
|
36223
|
+
_args7 = arguments,
|
|
36118
36224
|
_t3;
|
|
36119
|
-
return _regenerator().w(function (
|
|
36120
|
-
while (1) switch (
|
|
36225
|
+
return _regenerator().w(function (_context7) {
|
|
36226
|
+
while (1) switch (_context7.n) {
|
|
36121
36227
|
case 0:
|
|
36122
|
-
basePath =
|
|
36123
|
-
|
|
36228
|
+
basePath = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : '/library/';
|
|
36229
|
+
_context7.p = 1;
|
|
36124
36230
|
// Ensure basePath ends with a slash
|
|
36125
36231
|
normalizedBasePath = basePath.endsWith('/') ? basePath : "".concat(basePath, "/");
|
|
36126
36232
|
dictionaryPath = "".concat(normalizedBasePath, "component-dictionary.json");
|
|
@@ -36131,39 +36237,39 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36131
36237
|
console.log("\uFFFD Models path: ".concat(modelsBasePath));
|
|
36132
36238
|
|
|
36133
36239
|
// Load the component dictionary
|
|
36134
|
-
|
|
36240
|
+
_context7.n = 2;
|
|
36135
36241
|
return fetch(dictionaryPath);
|
|
36136
36242
|
case 2:
|
|
36137
|
-
response =
|
|
36243
|
+
response = _context7.v;
|
|
36138
36244
|
if (response.ok) {
|
|
36139
|
-
|
|
36245
|
+
_context7.n = 3;
|
|
36140
36246
|
break;
|
|
36141
36247
|
}
|
|
36142
36248
|
throw new Error("Failed to load component dictionary: ".concat(response.status));
|
|
36143
36249
|
case 3:
|
|
36144
|
-
|
|
36250
|
+
_context7.n = 4;
|
|
36145
36251
|
return response.json();
|
|
36146
36252
|
case 4:
|
|
36147
|
-
componentDictionary =
|
|
36253
|
+
componentDictionary = _context7.v;
|
|
36148
36254
|
console.log('📚 Component dictionary loaded:', Object.keys(componentDictionary));
|
|
36149
36255
|
|
|
36150
36256
|
// Start preloading all models with the specified base path
|
|
36151
36257
|
_modelPreloader2 = this.getUtility('modelPreloader');
|
|
36152
|
-
|
|
36258
|
+
_context7.n = 5;
|
|
36153
36259
|
return _modelPreloader2.preloadAllModels(componentDictionary, modelsBasePath);
|
|
36154
36260
|
case 5:
|
|
36155
|
-
progress =
|
|
36261
|
+
progress = _context7.v;
|
|
36156
36262
|
console.log('🎉 Model preloading completed:', progress);
|
|
36157
|
-
return
|
|
36263
|
+
return _context7.a(2, progress);
|
|
36158
36264
|
case 6:
|
|
36159
|
-
|
|
36160
|
-
_t3 =
|
|
36265
|
+
_context7.p = 6;
|
|
36266
|
+
_t3 = _context7.v;
|
|
36161
36267
|
console.error('❌ Failed to initialize model preloading:', _t3);
|
|
36162
36268
|
throw _t3;
|
|
36163
36269
|
case 7:
|
|
36164
|
-
return
|
|
36270
|
+
return _context7.a(2);
|
|
36165
36271
|
}
|
|
36166
|
-
},
|
|
36272
|
+
}, _callee7, this, [[1, 6]]);
|
|
36167
36273
|
}));
|
|
36168
36274
|
function initializeModelPreloading() {
|
|
36169
36275
|
return _initializeModelPreloading.apply(this, arguments);
|
|
@@ -36180,57 +36286,57 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36180
36286
|
}, {
|
|
36181
36287
|
key: "importScene",
|
|
36182
36288
|
value: (function () {
|
|
36183
|
-
var _importScene = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
36289
|
+
var _importScene = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(jsonData) {
|
|
36184
36290
|
var validation, _t4;
|
|
36185
|
-
return _regenerator().w(function (
|
|
36186
|
-
while (1) switch (
|
|
36291
|
+
return _regenerator().w(function (_context8) {
|
|
36292
|
+
while (1) switch (_context8.n) {
|
|
36187
36293
|
case 0:
|
|
36188
36294
|
if (jsonData) {
|
|
36189
|
-
|
|
36295
|
+
_context8.n = 1;
|
|
36190
36296
|
break;
|
|
36191
36297
|
}
|
|
36192
36298
|
console.error('❌ No JSON data provided for import');
|
|
36193
|
-
return
|
|
36299
|
+
return _context8.a(2, false);
|
|
36194
36300
|
case 1:
|
|
36195
|
-
|
|
36301
|
+
_context8.p = 1;
|
|
36196
36302
|
// Validate scene data structure
|
|
36197
36303
|
validation = this.internals.validateAndAnalyzeSceneData(jsonData);
|
|
36198
36304
|
if (validation.isValid) {
|
|
36199
|
-
|
|
36305
|
+
_context8.n = 2;
|
|
36200
36306
|
break;
|
|
36201
36307
|
}
|
|
36202
36308
|
console.error('❌ Invalid scene data format:', validation.message);
|
|
36203
|
-
return
|
|
36309
|
+
return _context8.a(2, false);
|
|
36204
36310
|
case 2:
|
|
36205
|
-
|
|
36311
|
+
_context8.n = 3;
|
|
36206
36312
|
return this.setImportedSceneData(jsonData);
|
|
36207
36313
|
case 3:
|
|
36208
36314
|
if (!(this.sceneViewer && this.sceneViewer.sceneOperationsManager)) {
|
|
36209
|
-
|
|
36315
|
+
_context8.n = 5;
|
|
36210
36316
|
break;
|
|
36211
36317
|
}
|
|
36212
|
-
|
|
36318
|
+
_context8.n = 4;
|
|
36213
36319
|
return this.sceneViewer.sceneOperationsManager.loadSceneFromData(jsonData);
|
|
36214
36320
|
case 4:
|
|
36215
36321
|
console.log('✅ Scene imported successfully');
|
|
36216
|
-
return
|
|
36322
|
+
return _context8.a(2, true);
|
|
36217
36323
|
case 5:
|
|
36218
36324
|
console.error('❌ SceneViewer not available for scene loading');
|
|
36219
|
-
return
|
|
36325
|
+
return _context8.a(2, false);
|
|
36220
36326
|
case 6:
|
|
36221
|
-
|
|
36327
|
+
_context8.n = 8;
|
|
36222
36328
|
break;
|
|
36223
36329
|
case 7:
|
|
36224
|
-
|
|
36225
|
-
_t4 =
|
|
36330
|
+
_context8.p = 7;
|
|
36331
|
+
_t4 = _context8.v;
|
|
36226
36332
|
console.error('❌ Error importing scene:', _t4);
|
|
36227
|
-
return
|
|
36333
|
+
return _context8.a(2, false);
|
|
36228
36334
|
case 8:
|
|
36229
|
-
return
|
|
36335
|
+
return _context8.a(2);
|
|
36230
36336
|
}
|
|
36231
|
-
},
|
|
36337
|
+
}, _callee8, this, [[1, 7]]);
|
|
36232
36338
|
}));
|
|
36233
|
-
function importScene(
|
|
36339
|
+
function importScene(_x5) {
|
|
36234
36340
|
return _importScene.apply(this, arguments);
|
|
36235
36341
|
}
|
|
36236
36342
|
return importScene;
|
|
@@ -36252,33 +36358,33 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36252
36358
|
}, {
|
|
36253
36359
|
key: "exportSceneJSON",
|
|
36254
36360
|
value: (function () {
|
|
36255
|
-
var _exportSceneJSON = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
36361
|
+
var _exportSceneJSON = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
|
|
36256
36362
|
var filename,
|
|
36257
|
-
|
|
36363
|
+
_args9 = arguments,
|
|
36258
36364
|
_t5;
|
|
36259
|
-
return _regenerator().w(function (
|
|
36260
|
-
while (1) switch (
|
|
36365
|
+
return _regenerator().w(function (_context9) {
|
|
36366
|
+
while (1) switch (_context9.n) {
|
|
36261
36367
|
case 0:
|
|
36262
|
-
filename =
|
|
36368
|
+
filename = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : null;
|
|
36263
36369
|
if (this.managers.sceneExportManager) {
|
|
36264
|
-
|
|
36370
|
+
_context9.n = 1;
|
|
36265
36371
|
break;
|
|
36266
36372
|
}
|
|
36267
36373
|
console.error('❌ Scene export manager not available');
|
|
36268
|
-
return
|
|
36374
|
+
return _context9.a(2, false);
|
|
36269
36375
|
case 1:
|
|
36270
|
-
|
|
36271
|
-
|
|
36376
|
+
_context9.p = 1;
|
|
36377
|
+
_context9.n = 2;
|
|
36272
36378
|
return this.managers.sceneExportManager.downloadSceneJSON(filename);
|
|
36273
36379
|
case 2:
|
|
36274
|
-
return
|
|
36380
|
+
return _context9.a(2, _context9.v);
|
|
36275
36381
|
case 3:
|
|
36276
|
-
|
|
36277
|
-
_t5 =
|
|
36382
|
+
_context9.p = 3;
|
|
36383
|
+
_t5 = _context9.v;
|
|
36278
36384
|
console.error('❌ Error exporting scene as JSON:', _t5);
|
|
36279
|
-
return
|
|
36385
|
+
return _context9.a(2, false);
|
|
36280
36386
|
}
|
|
36281
|
-
},
|
|
36387
|
+
}, _callee9, this, [[1, 3]]);
|
|
36282
36388
|
}));
|
|
36283
36389
|
function exportSceneJSON() {
|
|
36284
36390
|
return _exportSceneJSON.apply(this, arguments);
|
|
@@ -36303,33 +36409,33 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36303
36409
|
}, {
|
|
36304
36410
|
key: "exportSceneGLTF",
|
|
36305
36411
|
value: (function () {
|
|
36306
|
-
var _exportSceneGLTF = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
36412
|
+
var _exportSceneGLTF = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
|
|
36307
36413
|
var filename,
|
|
36308
|
-
|
|
36414
|
+
_args0 = arguments,
|
|
36309
36415
|
_t6;
|
|
36310
|
-
return _regenerator().w(function (
|
|
36311
|
-
while (1) switch (
|
|
36416
|
+
return _regenerator().w(function (_context0) {
|
|
36417
|
+
while (1) switch (_context0.n) {
|
|
36312
36418
|
case 0:
|
|
36313
|
-
filename =
|
|
36419
|
+
filename = _args0.length > 0 && _args0[0] !== undefined ? _args0[0] : null;
|
|
36314
36420
|
if (this.managers.sceneExportManager) {
|
|
36315
|
-
|
|
36421
|
+
_context0.n = 1;
|
|
36316
36422
|
break;
|
|
36317
36423
|
}
|
|
36318
36424
|
console.error('❌ Scene export manager not available');
|
|
36319
|
-
return
|
|
36425
|
+
return _context0.a(2, false);
|
|
36320
36426
|
case 1:
|
|
36321
|
-
|
|
36322
|
-
|
|
36427
|
+
_context0.p = 1;
|
|
36428
|
+
_context0.n = 2;
|
|
36323
36429
|
return this.managers.sceneExportManager.exportSceneAsGLTF(filename, false);
|
|
36324
36430
|
case 2:
|
|
36325
|
-
return
|
|
36431
|
+
return _context0.a(2, _context0.v);
|
|
36326
36432
|
case 3:
|
|
36327
|
-
|
|
36328
|
-
_t6 =
|
|
36433
|
+
_context0.p = 3;
|
|
36434
|
+
_t6 = _context0.v;
|
|
36329
36435
|
console.error('❌ Error exporting scene as GLTF:', _t6);
|
|
36330
|
-
return
|
|
36436
|
+
return _context0.a(2, false);
|
|
36331
36437
|
}
|
|
36332
|
-
},
|
|
36438
|
+
}, _callee0, this, [[1, 3]]);
|
|
36333
36439
|
}));
|
|
36334
36440
|
function exportSceneGLTF() {
|
|
36335
36441
|
return _exportSceneGLTF.apply(this, arguments);
|
|
@@ -36355,33 +36461,33 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36355
36461
|
}, {
|
|
36356
36462
|
key: "exportSceneGLB",
|
|
36357
36463
|
value: (function () {
|
|
36358
|
-
var _exportSceneGLB = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
36464
|
+
var _exportSceneGLB = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
|
|
36359
36465
|
var filename,
|
|
36360
|
-
|
|
36466
|
+
_args1 = arguments,
|
|
36361
36467
|
_t7;
|
|
36362
|
-
return _regenerator().w(function (
|
|
36363
|
-
while (1) switch (
|
|
36468
|
+
return _regenerator().w(function (_context1) {
|
|
36469
|
+
while (1) switch (_context1.n) {
|
|
36364
36470
|
case 0:
|
|
36365
|
-
filename =
|
|
36471
|
+
filename = _args1.length > 0 && _args1[0] !== undefined ? _args1[0] : null;
|
|
36366
36472
|
if (this.managers.sceneExportManager) {
|
|
36367
|
-
|
|
36473
|
+
_context1.n = 1;
|
|
36368
36474
|
break;
|
|
36369
36475
|
}
|
|
36370
36476
|
console.error('❌ Scene export manager not available');
|
|
36371
|
-
return
|
|
36477
|
+
return _context1.a(2, false);
|
|
36372
36478
|
case 1:
|
|
36373
|
-
|
|
36374
|
-
|
|
36479
|
+
_context1.p = 1;
|
|
36480
|
+
_context1.n = 2;
|
|
36375
36481
|
return this.managers.sceneExportManager.exportSceneAsGLB(filename);
|
|
36376
36482
|
case 2:
|
|
36377
|
-
return
|
|
36483
|
+
return _context1.a(2, _context1.v);
|
|
36378
36484
|
case 3:
|
|
36379
|
-
|
|
36380
|
-
_t7 =
|
|
36485
|
+
_context1.p = 3;
|
|
36486
|
+
_t7 = _context1.v;
|
|
36381
36487
|
console.error('❌ Error exporting scene as GLB:', _t7);
|
|
36382
|
-
return
|
|
36488
|
+
return _context1.a(2, false);
|
|
36383
36489
|
}
|
|
36384
|
-
},
|
|
36490
|
+
}, _callee1, this, [[1, 3]]);
|
|
36385
36491
|
}));
|
|
36386
36492
|
function exportSceneGLB() {
|
|
36387
36493
|
return _exportSceneGLB.apply(this, arguments);
|
|
@@ -36420,18 +36526,18 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
36420
36526
|
}, {
|
|
36421
36527
|
key: "loadSceneFromData",
|
|
36422
36528
|
value: (function () {
|
|
36423
|
-
var _loadSceneFromData = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
36424
|
-
return _regenerator().w(function (
|
|
36425
|
-
while (1) switch (
|
|
36529
|
+
var _loadSceneFromData = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(sceneData) {
|
|
36530
|
+
return _regenerator().w(function (_context10) {
|
|
36531
|
+
while (1) switch (_context10.n) {
|
|
36426
36532
|
case 0:
|
|
36427
|
-
|
|
36533
|
+
_context10.n = 1;
|
|
36428
36534
|
return this.setImportedSceneData(sceneData);
|
|
36429
36535
|
case 1:
|
|
36430
|
-
return
|
|
36536
|
+
return _context10.a(2, true);
|
|
36431
36537
|
}
|
|
36432
|
-
},
|
|
36538
|
+
}, _callee10, this);
|
|
36433
36539
|
}));
|
|
36434
|
-
function loadSceneFromData(
|
|
36540
|
+
function loadSceneFromData(_x6) {
|
|
36435
36541
|
return _loadSceneFromData.apply(this, arguments);
|
|
36436
36542
|
}
|
|
36437
36543
|
return loadSceneFromData;
|