@2112-lab/central-plant 0.1.0 → 0.1.2

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 (43) hide show
  1. package/dist/bundle/index.js +7782 -6543
  2. package/dist/cjs/_virtual/_rollupPluginBabelHelpers.js +23 -10
  3. package/dist/cjs/node_modules/@2112-lab/pathfinder/dist/index.esm.js +1448 -0
  4. package/dist/cjs/src/animationManager.js +15 -15
  5. package/dist/cjs/src/componentManager.js +8 -8
  6. package/dist/cjs/src/disposalManager.js +12 -12
  7. package/dist/cjs/src/environmentManager.js +392 -99
  8. package/dist/cjs/src/hotReloadManager.js +26 -26
  9. package/dist/cjs/src/index.js +19 -66
  10. package/dist/cjs/src/keyboardControlsManager.js +23 -23
  11. package/dist/cjs/src/nameUtils.js +21 -21
  12. package/dist/cjs/src/pathfindingManager.js +311 -129
  13. package/dist/cjs/src/performanceMonitor.js +52 -52
  14. package/dist/cjs/src/sceneExportManager.js +23 -23
  15. package/dist/cjs/src/sceneInitializationManager.js +18 -18
  16. package/dist/cjs/src/textureConfig.js +469 -40
  17. package/dist/cjs/src/transformControlsManager.js +79 -79
  18. package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +21 -10
  19. package/dist/esm/node_modules/@2112-lab/pathfinder/dist/index.esm.js +1444 -0
  20. package/dist/esm/src/animationManager.js +15 -15
  21. package/dist/esm/src/componentManager.js +8 -8
  22. package/dist/esm/src/disposalManager.js +12 -12
  23. package/dist/esm/src/environmentManager.js +393 -100
  24. package/dist/esm/src/hotReloadManager.js +26 -26
  25. package/dist/esm/src/index.js +19 -66
  26. package/dist/esm/src/keyboardControlsManager.js +23 -23
  27. package/dist/esm/src/nameUtils.js +21 -21
  28. package/dist/esm/src/pathfindingManager.js +313 -129
  29. package/dist/esm/src/performanceMonitor.js +52 -52
  30. package/dist/esm/src/sceneExportManager.js +23 -23
  31. package/dist/esm/src/sceneInitializationManager.js +18 -18
  32. package/dist/esm/src/textureConfig.js +469 -42
  33. package/dist/esm/src/transformControlsManager.js +79 -79
  34. package/dist/index.d.ts +255 -259
  35. package/package.json +52 -53
  36. package/dist/cjs/src/ConnectionManager.js +0 -114
  37. package/dist/cjs/src/Pathfinder.js +0 -88
  38. package/dist/cjs/src/modelPreloader.js +0 -360
  39. package/dist/cjs/src/sceneOperationsManager.js +0 -560
  40. package/dist/esm/src/ConnectionManager.js +0 -110
  41. package/dist/esm/src/Pathfinder.js +0 -84
  42. package/dist/esm/src/modelPreloader.js +0 -337
  43. package/dist/esm/src/sceneOperationsManager.js +0 -536
@@ -1,8 +1,8 @@
1
1
  import { createClass as _createClass, classCallCheck as _classCallCheck } from '../_virtual/_rollupPluginBabelHelpers.js';
2
2
 
3
- /**
4
- * Hot-Reload Manager Module
5
- * Handles development environment hot-reload detection and cleanup
3
+ /**
4
+ * Hot-Reload Manager Module
5
+ * Handles development environment hot-reload detection and cleanup
6
6
  */
7
7
 
8
8
  // Check if we're in a browser environment
@@ -26,8 +26,8 @@ var HotReloadManager = /*#__PURE__*/function () {
26
26
  this.intervalIds = new Set();
27
27
  }
28
28
 
29
- /**
30
- * Setup hot-reload handling for development environment
29
+ /**
30
+ * Setup hot-reload handling for development environment
31
31
  */
32
32
  return _createClass(HotReloadManager, [{
33
33
  key: "setupHotReloadHandling",
@@ -69,8 +69,8 @@ var HotReloadManager = /*#__PURE__*/function () {
69
69
  console.log('✅ [Hot-Reload] Hot-reload handling setup completed');
70
70
  }
71
71
 
72
- /**
73
- * Cleanup hot-reload handlers (development only)
72
+ /**
73
+ * Cleanup hot-reload handlers (development only)
74
74
  */
75
75
  }, {
76
76
  key: "cleanupHotReloadHandlers",
@@ -111,8 +111,8 @@ var HotReloadManager = /*#__PURE__*/function () {
111
111
  }
112
112
  }
113
113
 
114
- /**
115
- * Track a timeout ID for cleanup on component destruction
114
+ /**
115
+ * Track a timeout ID for cleanup on component destruction
116
116
  */
117
117
  }, {
118
118
  key: "trackTimeout",
@@ -123,8 +123,8 @@ var HotReloadManager = /*#__PURE__*/function () {
123
123
  return timeoutId;
124
124
  }
125
125
 
126
- /**
127
- * Track an interval ID for cleanup on component destruction
126
+ /**
127
+ * Track an interval ID for cleanup on component destruction
128
128
  */
129
129
  }, {
130
130
  key: "trackInterval",
@@ -135,8 +135,8 @@ var HotReloadManager = /*#__PURE__*/function () {
135
135
  return intervalId;
136
136
  }
137
137
 
138
- /**
139
- * Clear a tracked timeout and remove from tracking
138
+ /**
139
+ * Clear a tracked timeout and remove from tracking
140
140
  */
141
141
  }, {
142
142
  key: "clearTrackedTimeout",
@@ -149,8 +149,8 @@ var HotReloadManager = /*#__PURE__*/function () {
149
149
  return false;
150
150
  }
151
151
 
152
- /**
153
- * Clear a tracked interval and remove from tracking
152
+ /**
153
+ * Clear a tracked interval and remove from tracking
154
154
  */
155
155
  }, {
156
156
  key: "clearTrackedInterval",
@@ -163,8 +163,8 @@ var HotReloadManager = /*#__PURE__*/function () {
163
163
  return false;
164
164
  }
165
165
 
166
- /**
167
- * Clear all tracked timeouts and intervals
166
+ /**
167
+ * Clear all tracked timeouts and intervals
168
168
  */
169
169
  }, {
170
170
  key: "clearAllTrackedTimers",
@@ -185,10 +185,10 @@ var HotReloadManager = /*#__PURE__*/function () {
185
185
  }]);
186
186
  }();
187
187
 
188
- /**
189
- * Simple utility to handle hot-reload for componentId
190
- * @param {string} instanceId - Unique instance identifier for the component
191
- * @param {Function} cleanupMethod - Method to call to clean up resources
188
+ /**
189
+ * Simple utility to handle hot-reload for componentId
190
+ * @param {string} instanceId - Unique instance identifier for the component
191
+ * @param {Function} cleanupMethod - Method to call to clean up resources
192
192
  */
193
193
  function handleHotReload(instanceId, cleanupMethod) {
194
194
  if (!isBrowser || !isDev) return;
@@ -214,16 +214,16 @@ function handleHotReload(instanceId, cleanupMethod) {
214
214
  });
215
215
  }
216
216
 
217
- /**
218
- * Check if we're currently hot-reloading
217
+ /**
218
+ * Check if we're currently hot-reloading
219
219
  */
220
220
  function isHotReloading() {
221
221
  return isDev && isBrowser && window._hotReloadRegistry && window._hotReloadRegistry.size > 0;
222
222
  }
223
223
 
224
- /**
225
- * Clean up resources for a component before hot-reload
226
- * @param {string} instanceId - ID of the component instance to clean up
224
+ /**
225
+ * Clean up resources for a component before hot-reload
226
+ * @param {string} instanceId - ID of the component instance to clean up
227
227
  */
228
228
  function cleanupForHotReload(instanceId) {
229
229
  if (!isBrowser || !isDev || !window._hotReloadRegistry) return;
@@ -13,85 +13,42 @@ import * as hotReloadManager from './hotReloadManager.js';
13
13
  export { hotReloadManager };
14
14
  import * as keyboardControlsManager from './keyboardControlsManager.js';
15
15
  export { keyboardControlsManager };
16
- import * as modelPreloader from './modelPreloader.js';
17
- export { modelPreloader };
18
16
  import * as nameUtils from './nameUtils.js';
19
17
  export { nameUtils };
20
18
  export { findObjectByHardcodedUuid, generateUuidFromName, getHardcodedUuid } from './nameUtils.js';
21
19
  import * as pathfindingManager from './pathfindingManager.js';
22
20
  export { pathfindingManager };
23
21
  import * as performanceMonitor from './performanceMonitor.js';
24
- export { performanceMonitor };
25
22
  import * as sceneExportManager from './sceneExportManager.js';
26
23
  export { sceneExportManager };
27
24
  export { getSceneExportManager } from './sceneExportManager.js';
28
25
  import * as sceneInitializationManager from './sceneInitializationManager.js';
29
26
  export { sceneInitializationManager };
30
- import * as sceneOperationsManager from './sceneOperationsManager.js';
31
- export { sceneOperationsManager };
32
- export { getSceneOperationsManager } from './sceneOperationsManager.js';
33
27
  import * as textureConfig from './textureConfig.js';
34
28
  export { textureConfig };
35
29
  import * as transformControlsManager from './transformControlsManager.js';
36
30
  export { transformControlsManager };
37
31
  export { getTransformControlsManager } from './transformControlsManager.js';
38
- import * as Pathfinder from './Pathfinder.js';
39
- export { Pathfinder };
40
- import * as ConnectionManager from './ConnectionManager.js';
41
- export { ConnectionManager };
42
32
 
43
- /**
44
- * @module CentralPlant/Utils
45
- * @description Central Plant Utilities Module
46
- *
47
- * This is the main entry point for all utility functions and classes
48
- * used in the Central Plant application. Import this module to access
49
- * all utility functions through a single interface.
50
- *
51
- * @example
52
- * // Import the entire utilities module
53
- * import CentralPlant from 'central-plant';
54
- *
55
- * // Use a specific utility
56
- * CentralPlant.modelPreloader.preloadAllModels(...);
57
- *
58
- * @example
59
- * // Import specific modules
60
- * import { modelPreloader, nameUtils } from 'CentralPlant';
61
- *
62
- * // Use them directly
63
- * modelPreloader.preloadAllModels(...);
64
- *
65
- * @example
66
- * // Import common functions directly
67
- * import { getHardcodedUuid, logger } from 'CentralPlant';
68
- *
69
- * // Use functions directly
70
- * const uuid = getHardcodedUuid(object);
71
- * logger.info('Operation completed');
72
- */
33
+ // Import all utility modules
73
34
 
74
- /**
75
- * Central API object that provides access to all utility modules
76
- * @type {Object}
77
- * @property {Object} animation - Animation management utilities
78
- * @property {Object} component - Component management utilities
79
- * @property {Object} debug - Debugging and logging utilities
80
- * @property {Object} disposal - Resource disposal utilities
81
- * @property {Object} environment - 3D environment management utilities
82
- * @property {Object} hotReload - Hot reload handling utilities
83
- * @property {Object} keyboardControls - Keyboard controls management
84
- * @property {Object} modelPreloader - Model preloading utilities
85
- * @property {Object} name - Name and UUID management utilities
86
- * @property {Object} pathfinding - Pathfinding utilities
87
- * @property {Object} performance - Performance monitoring utilities
88
- * @property {Object} sceneExport - Scene export utilities
89
- * @property {Object} sceneInitialization - Scene initialization utilities
90
- * @property {Object} sceneOperations - Scene operations utilities
91
- * @property {Object} texture - Texture management utilities
92
- * @property {Object} transformControls - Transform controls utilities
93
- * @property {Object} pathfinder - Pathfinder utilities
94
- * @property {Object} connectionManager - Connection management utilities
35
+ /**
36
+ * Central API object that provides access to all utility modules
37
+ * @type {Object}
38
+ * @property {Object} animation - Animation management utilities
39
+ * @property {Object} component - Component management utilities
40
+ * @property {Object} debug - Debugging and logging utilities
41
+ * @property {Object} disposal - Resource disposal utilities
42
+ * @property {Object} environment - 3D environment management utilities
43
+ * @property {Object} hotReload - Hot reload handling utilities
44
+ * @property {Object} keyboardControls - Keyboard controls management
45
+ * @property {Object} name - Name and UUID management utilities
46
+ * @property {Object} pathfinding - Pathfinding utilities
47
+ * @property {Object} performance - Performance monitoring utilities
48
+ * @property {Object} sceneExport - Scene export utilities
49
+ * @property {Object} sceneInitialization - Scene initialization utilities
50
+ * @property {Object} texture - Texture management utilities
51
+ * @property {Object} transformControls - Transform controls utilities
95
52
  */
96
53
  var CentralPlantUtils = {
97
54
  animation: animationManager,
@@ -101,17 +58,13 @@ var CentralPlantUtils = {
101
58
  environment: environmentManager,
102
59
  hotReload: hotReloadManager,
103
60
  keyboardControls: keyboardControlsManager,
104
- modelPreloader: modelPreloader,
105
61
  name: nameUtils,
106
62
  pathfinding: pathfindingManager,
107
63
  performance: performanceMonitor,
108
64
  sceneExport: sceneExportManager,
109
65
  sceneInitialization: sceneInitializationManager,
110
- sceneOperations: sceneOperationsManager,
111
66
  texture: textureConfig,
112
- transformControls: transformControlsManager,
113
- pathfinder: Pathfinder,
114
- connectionManager: ConnectionManager
67
+ transformControls: transformControlsManager
115
68
  };
116
69
 
117
70
  export { CentralPlantUtils as default };
@@ -1,16 +1,16 @@
1
1
  import { logger } from './debugLogger.js';
2
2
 
3
- /**
4
- * Keyboard Controls Manager
5
- * Manages keyboard shortcuts and controls
3
+ /**
4
+ * Keyboard Controls Manager
5
+ * Manages keyboard shortcuts and controls
6
6
  */
7
7
 
8
8
  // Store registered key handlers
9
9
  var keyHandlers = new Map();
10
10
  var isListening = false;
11
11
 
12
- /**
13
- * Initialize keyboard controls
12
+ /**
13
+ * Initialize keyboard controls
14
14
  */
15
15
  function initKeyboardControls() {
16
16
  if (typeof window === 'undefined') {
@@ -28,8 +28,8 @@ function initKeyboardControls() {
28
28
  logger.info('Keyboard controls initialized');
29
29
  }
30
30
 
31
- /**
32
- * Clean up keyboard controls
31
+ /**
32
+ * Clean up keyboard controls
33
33
  */
34
34
  function cleanupKeyboardControls() {
35
35
  if (typeof window === 'undefined' || !isListening) {
@@ -42,8 +42,8 @@ function cleanupKeyboardControls() {
42
42
  logger.info('Keyboard controls cleaned up');
43
43
  }
44
44
 
45
- /**
46
- * Handler for keydown events
45
+ /**
46
+ * Handler for keydown events
47
47
  */
48
48
  function handleKeyDown(event) {
49
49
  // Get key or combination
@@ -57,8 +57,8 @@ function handleKeyDown(event) {
57
57
  }
58
58
  }
59
59
 
60
- /**
61
- * Handler for keyup events
60
+ /**
61
+ * Handler for keyup events
62
62
  */
63
63
  function handleKeyUp(event) {
64
64
  var keyCombo = getKeyCombo(event);
@@ -71,8 +71,8 @@ function handleKeyUp(event) {
71
71
  }
72
72
  }
73
73
 
74
- /**
75
- * Register a key handler
74
+ /**
75
+ * Register a key handler
76
76
  */
77
77
  function registerKeyHandler(key, callback) {
78
78
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
@@ -93,16 +93,16 @@ function registerKeyHandler(key, callback) {
93
93
  return normalizedKey;
94
94
  }
95
95
 
96
- /**
97
- * Unregister a key handler
96
+ /**
97
+ * Unregister a key handler
98
98
  */
99
99
  function unregisterKeyHandler(key) {
100
100
  var normalizedKey = normalizeKey(key);
101
101
  return keyHandlers.delete(normalizedKey);
102
102
  }
103
103
 
104
- /**
105
- * Get all registered key handlers
104
+ /**
105
+ * Get all registered key handlers
106
106
  */
107
107
  function getRegisteredKeyHandlers() {
108
108
  var handlers = [];
@@ -115,15 +115,15 @@ function getRegisteredKeyHandlers() {
115
115
  return handlers;
116
116
  }
117
117
 
118
- /**
119
- * Helper function to normalize key format
118
+ /**
119
+ * Helper function to normalize key format
120
120
  */
121
121
  function normalizeKey(key) {
122
122
  return key.toLowerCase();
123
123
  }
124
124
 
125
- /**
126
- * Helper function to get key combo string from event
125
+ /**
126
+ * Helper function to get key combo string from event
127
127
  */
128
128
  function getKeyCombo(event) {
129
129
  var combo = '';
@@ -135,8 +135,8 @@ function getKeyCombo(event) {
135
135
  return combo;
136
136
  }
137
137
 
138
- /**
139
- * Setup common keyboard controls for a Three.js scene
138
+ /**
139
+ * Setup common keyboard controls for a Three.js scene
140
140
  */
141
141
  function setupCommonControls(component) {
142
142
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -1,12 +1,12 @@
1
- /**
2
- * Name Utilities
3
- * Common helper functions for name and UUID generation
1
+ /**
2
+ * Name Utilities
3
+ * Common helper functions for name and UUID generation
4
4
  */
5
5
 
6
- /**
7
- * Generate UUID from name using consistent transformation rules
8
- * @param {string} name - The name to convert to UUID
9
- * @returns {string} The generated UUID
6
+ /**
7
+ * Generate UUID from name using consistent transformation rules
8
+ * @param {string} name - The name to convert to UUID
9
+ * @returns {string} The generated UUID
10
10
  */
11
11
  function generateUuidFromName(name) {
12
12
  if (!name) return null;
@@ -21,11 +21,11 @@ function generateUuidFromName(name) {
21
21
  return uuid;
22
22
  }
23
23
 
24
- /**
25
- * Check if two names would generate the same UUID
26
- * @param {string} name1 - First name
27
- * @param {string} name2 - Second name
28
- * @returns {boolean} Whether the names generate the same UUID
24
+ /**
25
+ * Check if two names would generate the same UUID
26
+ * @param {string} name1 - First name
27
+ * @param {string} name2 - Second name
28
+ * @returns {boolean} Whether the names generate the same UUID
29
29
  */
30
30
  function namesGenerateSameUuid(name1, name2) {
31
31
  var uuid1 = generateUuidFromName(name1);
@@ -33,11 +33,11 @@ function namesGenerateSameUuid(name1, name2) {
33
33
  return uuid1 && uuid2 && uuid1 === uuid2;
34
34
  }
35
35
 
36
- /**
37
- * Find an object in a Three.js scene by hardcoded UUID with fallback strategies
38
- * @param {THREE.Scene} scene - The Three.js scene to search
39
- * @param {string} targetUuid - The UUID to search for
40
- * @returns {THREE.Object3D|null} The found object or null
36
+ /**
37
+ * Find an object in a Three.js scene by hardcoded UUID with fallback strategies
38
+ * @param {THREE.Scene} scene - The Three.js scene to search
39
+ * @param {string} targetUuid - The UUID to search for
40
+ * @returns {THREE.Object3D|null} The found object or null
41
41
  */
42
42
  function findObjectByHardcodedUuid(scene, targetUuid) {
43
43
  if (!scene || !targetUuid) return null;
@@ -70,10 +70,10 @@ function findObjectByHardcodedUuid(scene, targetUuid) {
70
70
  return foundObject;
71
71
  }
72
72
 
73
- /**
74
- * Get the hardcoded UUID for an object, prioritizing original over current
75
- * @param {THREE.Object3D} object - The Three.js object
76
- * @returns {string|null} The hardcoded UUID or null
73
+ /**
74
+ * Get the hardcoded UUID for an object, prioritizing original over current
75
+ * @param {THREE.Object3D} object - The Three.js object
76
+ * @returns {string|null} The hardcoded UUID or null
77
77
  */
78
78
  function getHardcodedUuid(object) {
79
79
  var _object$userData;