@2112-lab/central-plant 0.1.1 → 0.1.3

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.
Files changed (55) hide show
  1. package/dist/bundle/index.js +1 -15140
  2. package/dist/cjs/_virtual/_rollupPluginBabelHelpers.js +1 -353
  3. package/dist/cjs/node_modules/@2112-lab/pathfinder/dist/index.esm.js +1 -0
  4. package/dist/cjs/node_modules/three/examples/jsm/controls/OrbitControls.js +1 -1292
  5. package/dist/cjs/node_modules/three/examples/jsm/controls/TransformControls.js +1 -1543
  6. package/dist/cjs/node_modules/three/examples/jsm/loaders/GLTFLoader.js +1 -4374
  7. package/dist/cjs/node_modules/three/examples/jsm/loaders/RGBELoader.js +1 -465
  8. package/dist/cjs/node_modules/three/examples/jsm/utils/BufferGeometryUtils.js +1 -117
  9. package/dist/cjs/src/animationManager.js +1 -121
  10. package/dist/cjs/src/componentManager.js +1 -151
  11. package/dist/cjs/src/debugLogger.js +1 -176
  12. package/dist/cjs/src/disposalManager.js +1 -185
  13. package/dist/cjs/src/environmentManager.js +1 -1308
  14. package/dist/cjs/src/hotReloadManager.js +1 -252
  15. package/dist/cjs/src/index.js +1 -128
  16. package/dist/cjs/src/keyboardControlsManager.js +1 -206
  17. package/dist/cjs/src/nameUtils.js +1 -106
  18. package/dist/cjs/src/pathfindingManager.js +1 -321
  19. package/dist/cjs/src/performanceMonitor.js +1 -718
  20. package/dist/cjs/src/sceneExportManager.js +1 -292
  21. package/dist/cjs/src/sceneInitializationManager.js +1 -540
  22. package/dist/cjs/src/textureConfig.js +1 -624
  23. package/dist/cjs/src/transformControlsManager.js +1 -851
  24. package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +1 -328
  25. package/dist/esm/node_modules/@2112-lab/pathfinder/dist/index.esm.js +1 -0
  26. package/dist/esm/node_modules/three/examples/jsm/controls/OrbitControls.js +1 -1287
  27. package/dist/esm/node_modules/three/examples/jsm/controls/TransformControls.js +1 -1537
  28. package/dist/esm/node_modules/three/examples/jsm/loaders/GLTFLoader.js +1 -4370
  29. package/dist/esm/node_modules/three/examples/jsm/loaders/RGBELoader.js +1 -461
  30. package/dist/esm/node_modules/three/examples/jsm/utils/BufferGeometryUtils.js +1 -113
  31. package/dist/esm/src/animationManager.js +1 -112
  32. package/dist/esm/src/componentManager.js +1 -123
  33. package/dist/esm/src/debugLogger.js +1 -167
  34. package/dist/esm/src/disposalManager.js +1 -155
  35. package/dist/esm/src/environmentManager.js +1 -1282
  36. package/dist/esm/src/hotReloadManager.js +1 -244
  37. package/dist/esm/src/index.js +1 -118
  38. package/dist/esm/src/keyboardControlsManager.js +1 -196
  39. package/dist/esm/src/nameUtils.js +1 -99
  40. package/dist/esm/src/pathfindingManager.js +1 -295
  41. package/dist/esm/src/performanceMonitor.js +1 -712
  42. package/dist/esm/src/sceneExportManager.js +1 -286
  43. package/dist/esm/src/sceneInitializationManager.js +1 -513
  44. package/dist/esm/src/textureConfig.js +1 -595
  45. package/dist/esm/src/transformControlsManager.js +1 -827
  46. package/dist/index.d.ts +0 -4
  47. package/package.json +1 -1
  48. package/dist/cjs/src/ConnectionManager.js +0 -114
  49. package/dist/cjs/src/Pathfinder.js +0 -88
  50. package/dist/cjs/src/modelPreloader.js +0 -488
  51. package/dist/cjs/src/sceneOperationsManager.js +0 -596
  52. package/dist/esm/src/ConnectionManager.js +0 -110
  53. package/dist/esm/src/Pathfinder.js +0 -84
  54. package/dist/esm/src/modelPreloader.js +0 -464
  55. package/dist/esm/src/sceneOperationsManager.js +0 -572
package/dist/index.d.ts CHANGED
@@ -1,7 +1,3 @@
1
- // Type definitions for central-plant-utils
2
- // Project: https://github.com/your-username/central-plant-utils
3
- // Definitions by: Central Plant Team
4
-
5
1
  import * as THREE from 'three';
6
2
 
7
3
  // Common types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2112-lab/central-plant",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Utility modules for the Central Plant Application",
5
5
  "main": "dist/bundle/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,114 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
6
-
7
- /**
8
- * ConnectionManager class
9
- * Handles object connections in the pathfinding system with improved safety for missing data
10
- */
11
- var ConnectionManager = /*#__PURE__*/function () {
12
- function ConnectionManager(sceneManager) {
13
- _rollupPluginBabelHelpers.classCallCheck(this, ConnectionManager);
14
- this.sceneManager = sceneManager;
15
- }
16
-
17
- /**
18
- * Safely cluster connections by shared objects
19
- * @param {Array<Object>} connections - Array of connections between objects (or null/undefined)
20
- * @returns {Array<Object>} Array of clusters
21
- */
22
- return _rollupPluginBabelHelpers.createClass(ConnectionManager, [{
23
- key: "clusterConnections",
24
- value: function clusterConnections(connections) {
25
- // Safety check for undefined or non-array connections
26
- if (!connections || !Array.isArray(connections)) {
27
- console.warn('ConnectionManager: No valid connections provided');
28
- return [];
29
- }
30
- var clusters = new Map(); // Map of object UUID to its cluster
31
- var clusterMap = new Map(); // Map of cluster ID to set of object UUIDs
32
- var nextClusterId = 0;
33
-
34
- // Process each connection
35
- connections.forEach(function (conn) {
36
- // Safety check for invalid connection format
37
- if (!conn || _rollupPluginBabelHelpers["typeof"](conn) !== 'object' || !conn.from || !conn.to) {
38
- console.warn('ConnectionManager: Invalid connection format', conn);
39
- return;
40
- }
41
- var from = conn.from,
42
- to = conn.to;
43
-
44
- // If neither object is in a cluster, create new cluster
45
- if (!clusters.has(from) && !clusters.has(to)) {
46
- var clusterId = nextClusterId++;
47
- clusters.set(from, clusterId);
48
- clusters.set(to, clusterId);
49
- clusterMap.set(clusterId, new Set([from, to]));
50
- }
51
- // If only 'from' is in a cluster, add 'to' to that cluster
52
- else if (clusters.has(from) && !clusters.has(to)) {
53
- var _clusterId = clusters.get(from);
54
- clusters.set(to, _clusterId);
55
- clusterMap.get(_clusterId).add(to);
56
- }
57
- // If only 'to' is in a cluster, add 'from' to that cluster
58
- else if (!clusters.has(from) && clusters.has(to)) {
59
- var _clusterId2 = clusters.get(to);
60
- clusters.set(from, _clusterId2);
61
- clusterMap.get(_clusterId2).add(from);
62
- }
63
- // If both are in different clusters, merge the clusters
64
- else if (clusters.has(from) && clusters.has(to) && clusters.get(from) !== clusters.get(to)) {
65
- var fromCluster = clusters.get(from);
66
- var toCluster = clusters.get(to);
67
- var fromObjects = clusterMap.get(fromCluster);
68
- var toObjects = clusterMap.get(toCluster);
69
-
70
- // Merge all objects from 'to' cluster into 'from' cluster
71
- var _iterator = _rollupPluginBabelHelpers.createForOfIteratorHelper(toObjects),
72
- _step;
73
- try {
74
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
75
- var obj = _step.value;
76
- clusters.set(obj, fromCluster);
77
- fromObjects.add(obj);
78
- }
79
-
80
- // Delete the now-empty 'to' cluster
81
- } catch (err) {
82
- _iterator.e(err);
83
- } finally {
84
- _iterator.f();
85
- }
86
- clusterMap.delete(toCluster);
87
- }
88
- });
89
-
90
- // Convert clusters to array format
91
- var result = [];
92
- var _iterator2 = _rollupPluginBabelHelpers.createForOfIteratorHelper(clusterMap.entries()),
93
- _step2;
94
- try {
95
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
96
- var _step2$value = _rollupPluginBabelHelpers.slicedToArray(_step2.value, 2),
97
- clusterId = _step2$value[0],
98
- objectSet = _step2$value[1];
99
- result.push({
100
- id: clusterId,
101
- objects: Array.from(objectSet)
102
- });
103
- }
104
- } catch (err) {
105
- _iterator2.e(err);
106
- } finally {
107
- _iterator2.f();
108
- }
109
- return result;
110
- }
111
- }]);
112
- }();
113
-
114
- exports["default"] = ConnectionManager;
@@ -1,88 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
6
- var ConnectionManager = require('./ConnectionManager.js');
7
-
8
- /**
9
- * Pathfinder class
10
- * Enhanced version with better error handling for missing data
11
- */
12
- var Pathfinder = /*#__PURE__*/function () {
13
- function Pathfinder(sceneData) {
14
- _rollupPluginBabelHelpers.classCallCheck(this, Pathfinder);
15
- this.sceneData = sceneData || {};
16
- this.connectionManager = new ConnectionManager["default"]();
17
- }
18
-
19
- /**
20
- * Find paths in the scene
21
- * @returns {Array} Array of paths
22
- */
23
- return _rollupPluginBabelHelpers.createClass(Pathfinder, [{
24
- key: "findPaths",
25
- value: function findPaths() {
26
- var _this = this;
27
- console.log('[DEBUG] Starting findPaths()');
28
- try {
29
- var connections = this.sceneData.connections;
30
-
31
- // Safety check for connections
32
- if (!connections || !Array.isArray(connections)) {
33
- console.warn('Pathfinder: No valid connections provided in scene data');
34
- return [];
35
- }
36
-
37
- // Create clusters from connections
38
- var clusters = this.connectionManager.clusterConnections(connections);
39
-
40
- // Return empty array if there are no valid clusters
41
- if (!clusters || !clusters.length) {
42
- console.log('Pathfinder: No valid connection clusters generated');
43
- return [];
44
- }
45
-
46
- // Process the clusters and generate paths
47
- // (Simplified implementation, the actual process would be more complex)
48
- var paths = [];
49
- clusters.forEach(function (cluster) {
50
- if (cluster && cluster.objects && Array.isArray(cluster.objects)) {
51
- // Generate path for this cluster
52
- var clusterPaths = _this._generatePathsForCluster(cluster);
53
- paths.push.apply(paths, _rollupPluginBabelHelpers.toConsumableArray(clusterPaths));
54
- }
55
- });
56
- return paths;
57
- } catch (error) {
58
- console.error('Pathfinder: Error finding paths:', error);
59
- return [];
60
- }
61
- }
62
-
63
- /**
64
- * Generate paths for a single cluster
65
- * @param {Object} cluster - The cluster to generate paths for
66
- * @returns {Array} Array of paths for this cluster
67
- * @private
68
- */
69
- }, {
70
- key: "_generatePathsForCluster",
71
- value: function _generatePathsForCluster(cluster) {
72
- // This is a placeholder implementation
73
- // In your actual system, this would use your existing pathfinding logic
74
- return cluster.objects.map(function (obj, index, arr) {
75
- if (index < arr.length - 1) {
76
- return {
77
- from: obj,
78
- to: arr[index + 1],
79
- path: [] // This would normally contain 3D points for the path
80
- };
81
- }
82
- return null;
83
- }).filter(Boolean);
84
- }
85
- }]);
86
- }();
87
-
88
- exports["default"] = Pathfinder;