cloud-ide-layout 1.0.180 → 1.0.181

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 (13) hide show
  1. package/fesm2022/{cloud-ide-layout-cloud-ide-layout-W4WjBty3.mjs → cloud-ide-layout-cloud-ide-layout-BlLjLM3N.mjs} +64 -108
  2. package/fesm2022/{cloud-ide-layout-cloud-ide-layout-W4WjBty3.mjs.map → cloud-ide-layout-cloud-ide-layout-BlLjLM3N.mjs.map} +1 -1
  3. package/fesm2022/{cloud-ide-layout-dashboard-manager.component-BVtdt1TW.mjs → cloud-ide-layout-dashboard-manager.component-DWxN9ReS.mjs} +2 -2
  4. package/fesm2022/{cloud-ide-layout-dashboard-manager.component-BVtdt1TW.mjs.map → cloud-ide-layout-dashboard-manager.component-DWxN9ReS.mjs.map} +1 -1
  5. package/fesm2022/{cloud-ide-layout-drawer-theme.component-DywE01AM.mjs → cloud-ide-layout-drawer-theme.component-D4qmt25K.mjs} +2 -2
  6. package/fesm2022/{cloud-ide-layout-drawer-theme.component-DywE01AM.mjs.map → cloud-ide-layout-drawer-theme.component-D4qmt25K.mjs.map} +1 -1
  7. package/fesm2022/{cloud-ide-layout-home-wrapper.component-DTKumUOV.mjs → cloud-ide-layout-home-wrapper.component-DeR1T21C.mjs} +2 -2
  8. package/fesm2022/{cloud-ide-layout-home-wrapper.component-DTKumUOV.mjs.map → cloud-ide-layout-home-wrapper.component-DeR1T21C.mjs.map} +1 -1
  9. package/fesm2022/{cloud-ide-layout-sidedrawer-notes.component-D4zenTjI.mjs → cloud-ide-layout-sidedrawer-notes.component-BuDfM6ms.mjs} +2 -2
  10. package/fesm2022/{cloud-ide-layout-sidedrawer-notes.component-D4zenTjI.mjs.map → cloud-ide-layout-sidedrawer-notes.component-BuDfM6ms.mjs.map} +1 -1
  11. package/fesm2022/cloud-ide-layout.mjs +1 -1
  12. package/index.d.ts +0 -10
  13. package/package.json +1 -1
@@ -4734,82 +4734,11 @@ class CustomRouteReuseStrategy {
4734
4734
  shouldReuseRoute(future, curr) {
4735
4735
  return future.routeConfig === curr.routeConfig;
4736
4736
  }
4737
- /**
4738
- * Clears a stored route by path and optional parameters.
4739
- * This method attempts to find a matching stored route using a robust matching algorithm.
4740
- */
4741
- clearRoute(path, params) {
4742
- // 1. Try to construct the exact key first
4743
- let exactKey = path;
4744
- // Normalize path: remove leading slash if present
4745
- if (exactKey.startsWith('/')) {
4746
- exactKey = exactKey.substring(1);
4747
- }
4748
- // Attempt to construct key with params if they exist
4749
- let exactKeyWithParams = exactKey;
4750
- if (params && Object.keys(params).length > 0) {
4751
- const queryParams = Object.keys(params)
4752
- .sort()
4753
- .map(key => `${key}=${params[key]}`)
4754
- .join('&');
4755
- exactKeyWithParams += '?' + queryParams;
4756
- }
4757
- // Check strict match first
4758
- if (this.storedRoutes[exactKeyWithParams]) {
4759
- console.log(`🎯 [RouteReuseStrategy] Found exact match for clearing: ${exactKeyWithParams}`);
4760
- this.destroyAndRemove(exactKeyWithParams);
4761
- return;
4762
- }
4763
- // Check if the key exists without params (sometimes stored without them if no reuseTab data at that moment)
4764
- if (this.storedRoutes[exactKey]) {
4765
- console.log(`🎯 [RouteReuseStrategy] Found path-only match for clearing: ${exactKey}`);
4766
- this.destroyAndRemove(exactKey);
4767
- return;
4768
- }
4769
- // 2. Fuzzy Match: Iterate through all keys to find a substantial match
4770
- // This handles cases where params might be string vs number, or order differences not caught by simple sort
4771
- console.log(`🔍 [RouteReuseStrategy] No exact match for ${exactKeyWithParams}. Searching candidates...`);
4772
- const candidates = Object.keys(this.storedRoutes);
4773
- for (const startKey of candidates) {
4774
- // Check if the path part matches
4775
- const [storedPath, storedQuery] = startKey.split('?');
4776
- if (storedPath === exactKey || storedPath === '/' + exactKey) {
4777
- // Path matches. Now check params if requested
4778
- if (!params || Object.keys(params).length === 0) {
4779
- // If we didn't ask for specific params, and we found a path match, this is likely it
4780
- // BUT be careful not to delete a specific parameterized tab if we meant a generic one
4781
- // For safety, if the stored route HAS params, but we didn't specify any, strictness might be needed.
4782
- // For now, let's assume if path matches and we have no params, it's a match.
4783
- console.log(`⚠️ [RouteReuseStrategy] Fuzzy match (Path match, input has no params): ${startKey}`);
4784
- this.destroyAndRemove(startKey);
4785
- return;
4786
- }
4787
- // Both have params, compare them
4788
- if (storedQuery) {
4789
- const storedParams = new URLSearchParams(storedQuery);
4790
- let allParamsMatch = true;
4791
- for (const key of Object.keys(params)) {
4792
- const val = params[key];
4793
- const storedVal = storedParams.get(key);
4794
- // Loose equality for string/number match
4795
- if (storedVal != val) {
4796
- allParamsMatch = false;
4797
- break;
4798
- }
4799
- }
4800
- if (allParamsMatch) {
4801
- console.log(`⚠️ [RouteReuseStrategy] Fuzzy match (Params match loose equality): ${startKey}`);
4802
- this.destroyAndRemove(startKey);
4803
- return;
4804
- }
4805
- }
4806
- }
4807
- }
4808
- console.warn(`❌ [RouteReuseStrategy] Could not find route to clear for: ${path}`, params);
4809
- }
4810
- // Private helper to destroy component and remove from map
4811
- destroyAndRemove(key) {
4812
- const handle = this.storedRoutes[key];
4737
+ // Clears a stored route, typically when a tab is closed.
4738
+ // This method now properly destroys the component instance to prevent memory leaks
4739
+ // and ensure old data doesn't persist when reopening the same route.
4740
+ clearStoredRoute(pathKey) {
4741
+ const handle = this.storedRoutes[pathKey];
4813
4742
  if (handle) {
4814
4743
  // Properly destroy the component instance to prevent memory leaks
4815
4744
  // and ensure clean state when the route is reopened
@@ -4821,14 +4750,14 @@ class CustomRouteReuseStrategy {
4821
4750
  const componentRef = handle;
4822
4751
  // Verify it has hostView (ComponentRef signature)
4823
4752
  if (componentRef.hostView || componentRef.location) {
4824
- console.log(`🗑️ Destroying component instance (ComponentRef) for route: ${key}`);
4753
+ console.log(`🗑️ Destroying component instance (ComponentRef) for route: ${pathKey}`);
4825
4754
  componentRef.destroy();
4826
4755
  }
4827
4756
  }
4828
4757
  // Method 2: Check if handle is a ViewContainerRef
4829
4758
  if (handle && typeof handle.clear === 'function' && typeof handle.length === 'number') {
4830
4759
  const viewContainerRef = handle;
4831
- console.log(`🗑️ Clearing view container for route: ${key}`);
4760
+ console.log(`🗑️ Clearing view container for route: ${pathKey}`);
4832
4761
  viewContainerRef.clear();
4833
4762
  }
4834
4763
  // Method 3: Check if handle is an object with nested ComponentRef
@@ -4850,19 +4779,19 @@ class CustomRouteReuseStrategy {
4850
4779
  componentRef = handleObj._componentRef;
4851
4780
  }
4852
4781
  if (componentRef) {
4853
- console.log(`🗑️ Destroying component instance from handle object for route: ${key}`);
4782
+ console.log(`🗑️ Destroying component instance from handle object for route: ${pathKey}`);
4854
4783
  componentRef.destroy();
4855
4784
  }
4856
4785
  // Also try to clear view container if it exists
4857
4786
  if (handleObj.viewContainerRef && typeof handleObj.viewContainerRef.clear === 'function') {
4858
- console.log(`🗑️ Clearing view container from handle object for route: ${key}`);
4787
+ console.log(`🗑️ Clearing view container from handle object for route: ${pathKey}`);
4859
4788
  handleObj.viewContainerRef.clear();
4860
4789
  }
4861
4790
  // Try to destroy any nested components
4862
4791
  if (handleObj.components && Array.isArray(handleObj.components)) {
4863
4792
  handleObj.components.forEach((comp, index) => {
4864
4793
  if (comp && typeof comp.destroy === 'function') {
4865
- console.log(`🗑️ Destroying nested component ${index} for route: ${key}`);
4794
+ console.log(`🗑️ Destroying nested component ${index} for route: ${pathKey}`);
4866
4795
  comp.destroy();
4867
4796
  }
4868
4797
  });
@@ -4870,23 +4799,16 @@ class CustomRouteReuseStrategy {
4870
4799
  }
4871
4800
  }
4872
4801
  catch (error) {
4873
- console.warn(`⚠️ Error destroying route handle for ${key}:`, error);
4802
+ console.warn(`⚠️ Error destroying route handle for ${pathKey}:`, error);
4874
4803
  }
4875
4804
  // Remove from stored routes - this ensures shouldAttach will return false for this route
4876
- delete this.storedRoutes[key];
4877
- console.log(`✅ Cleared stored route: ${key} (removed from storedRoutes map)`);
4805
+ delete this.storedRoutes[pathKey];
4806
+ console.log(`✅ Cleared stored route: ${pathKey} (removed from storedRoutes map)`);
4878
4807
  }
4879
4808
  else {
4880
- console.log(`ℹ️ No stored route found for: ${key}`);
4809
+ console.log(`ℹ️ No stored route found for: ${pathKey}`);
4881
4810
  }
4882
4811
  }
4883
- /**
4884
- * Legacy method for backward compatibility, redirects to new clearRoute or destroys directly if key provided
4885
- * @deprecated Use clearRoute instead
4886
- */
4887
- clearStoredRoute(pathKey) {
4888
- this.destroyAndRemove(pathKey);
4889
- }
4890
4812
  // Clears all stored routes (useful for cleanup)
4891
4813
  // This method ensures all component instances are destroyed and removed from DOM
4892
4814
  clearAllStoredRoutes() {
@@ -5160,12 +5082,18 @@ class CideLytRequestService {
5160
5082
  }
5161
5083
  // Before navigating, ensure the route is fresh by clearing any cached state
5162
5084
  // This prevents old component data from persisting when reopening a tab
5163
- // Before navigating, ensure the route is fresh by clearing any cached state
5164
- // This prevents old component data from persisting when reopening a tab
5165
5085
  if (this.routeReuseStrategy instanceof CustomRouteReuseStrategy) {
5166
- // Use the new robust clearRoute method
5167
- this.routeReuseStrategy.clearRoute(tabToActivate.route, tabToActivate.params);
5168
- console.log(`🔄 REQUEST SERVICE: Cleared cached route for ${tabToActivate.title} before activating tab`);
5086
+ let pathKey = tabToActivate.route.startsWith('/') ? tabToActivate.route.substring(1) : tabToActivate.route;
5087
+ if (tabToActivate.params && Object.keys(tabToActivate.params).length > 0) {
5088
+ const queryParamsString = Object.keys(tabToActivate.params)
5089
+ .sort()
5090
+ .map(key => `${key}=${tabToActivate.params[key]}`)
5091
+ .join('&');
5092
+ pathKey += '?' + queryParamsString;
5093
+ }
5094
+ // Clear any cached route to ensure fresh component state
5095
+ this.routeReuseStrategy.clearStoredRoute(pathKey);
5096
+ console.log(`🔄 REQUEST SERVICE: Cleared cached route ${pathKey} before activating tab`);
5169
5097
  }
5170
5098
  // Update tabs: deactivate all, then activate the target
5171
5099
  const updatedTabs = tabs.map(tab => ({
@@ -5194,11 +5122,30 @@ class CideLytRequestService {
5194
5122
  // Sync with TabStateService by removing the tab state
5195
5123
  this.tabStateService.removeTab(id);
5196
5124
  // Clear stored route from strategy and ensure proper component cleanup
5197
- // Clear stored route from strategy and ensure proper component cleanup
5198
5125
  if (this.routeReuseStrategy instanceof CustomRouteReuseStrategy) {
5199
- // Use the new robust clearRoute method
5200
- this.routeReuseStrategy.clearRoute(tabToClose.route, tabToClose.params);
5201
- console.log(`🧹 REQUEST SERVICE: Cleared stored route for closed tab ${tabToClose.title}`);
5126
+ // Generate pathKey in the same format as CustomRouteReuseStrategy.getPathKey()
5127
+ // Remove leading slash to match the format used by getPathKey
5128
+ let pathKey = tabToClose.route.startsWith('/') ? tabToClose.route.substring(1) : tabToClose.route;
5129
+ // Only add query params if the route is marked for reuse (matching getPathKey logic)
5130
+ // But we'll try to clear with both formats to be safe
5131
+ if (tabToClose.params && Object.keys(tabToClose.params).length > 0) {
5132
+ const queryParamsString = Object.keys(tabToClose.params)
5133
+ .sort()
5134
+ .map(key => `${key}=${tabToClose.params[key]}`)
5135
+ .join('&');
5136
+ pathKey += '?' + queryParamsString;
5137
+ }
5138
+ // Clear the stored route and destroy the component instance
5139
+ this.routeReuseStrategy.clearStoredRoute(pathKey);
5140
+ // Also try clearing without query params in case the route wasn't marked for reuse
5141
+ // This ensures we catch all possible pathKey variations
5142
+ const pathKeyWithoutParams = tabToClose.route.startsWith('/') ? tabToClose.route.substring(1) : tabToClose.route;
5143
+ if (pathKeyWithoutParams !== pathKey) {
5144
+ this.routeReuseStrategy.clearStoredRoute(pathKeyWithoutParams);
5145
+ }
5146
+ // Force a route refresh to ensure clean component state
5147
+ // This prevents old data from persisting when the same route is reopened
5148
+ console.log(`🧹 REQUEST SERVICE: Cleared stored route for ${pathKey} and destroyed component instance`);
5202
5149
  // If this was the active tab, navigate away to ensure component is removed from DOM
5203
5150
  if (wasActive) {
5204
5151
  // The navigation to the new active tab will happen below, which will properly clear the router outlet
@@ -5310,8 +5257,17 @@ class CideLytRequestService {
5310
5257
  */
5311
5258
  forceRefreshRoute(route, params) {
5312
5259
  if (this.routeReuseStrategy instanceof CustomRouteReuseStrategy) {
5313
- this.routeReuseStrategy.clearRoute(route, params);
5314
- console.log(`🔄 REQUEST SERVICE: Force refreshed route ${route}`);
5260
+ let pathKey = route.startsWith('/') ? route.substring(1) : route;
5261
+ if (params && Object.keys(params).length > 0) {
5262
+ const queryParamsString = Object.keys(params)
5263
+ .sort()
5264
+ .map(key => `${key}=${params[key]}`)
5265
+ .join('&');
5266
+ pathKey += '?' + queryParamsString;
5267
+ }
5268
+ // Clear the stored route to force a fresh component instance
5269
+ this.routeReuseStrategy.clearStoredRoute(pathKey);
5270
+ console.log(`🔄 REQUEST SERVICE: Force refreshed route ${pathKey}`);
5315
5271
  }
5316
5272
  }
5317
5273
  /**
@@ -5417,8 +5373,8 @@ class CideLytSidedrawerWrapperComponent {
5417
5373
  }
5418
5374
  ngOnInit() {
5419
5375
  // Initialize the component map (You'd likely populate this from a config or service)
5420
- this.componentMap['drowar_notes'] = () => import('./cloud-ide-layout-sidedrawer-notes.component-D4zenTjI.mjs').then(m => m.CideLytSidedrawerNotesComponent);
5421
- this.componentMap['drawer_theme'] = () => import('./cloud-ide-layout-drawer-theme.component-DywE01AM.mjs').then(m => m.CideLytDrawerThemeComponent);
5376
+ this.componentMap['drowar_notes'] = () => import('./cloud-ide-layout-sidedrawer-notes.component-BuDfM6ms.mjs').then(m => m.CideLytSidedrawerNotesComponent);
5377
+ this.componentMap['drawer_theme'] = () => import('./cloud-ide-layout-drawer-theme.component-D4qmt25K.mjs').then(m => m.CideLytDrawerThemeComponent);
5422
5378
  }
5423
5379
  async loadComponent(configFor) {
5424
5380
  console.log('🔍 SIDEDRAWER - Loading component:', configFor, 'Current tab:', this.currentTabId);
@@ -7110,7 +7066,7 @@ const layoutControlPannelChildRoutes = [{
7110
7066
  },
7111
7067
  {
7112
7068
  path: "home",
7113
- loadComponent: () => import('./cloud-ide-layout-home-wrapper.component-DTKumUOV.mjs').then(c => c.CideLytHomeWrapperComponent),
7069
+ loadComponent: () => import('./cloud-ide-layout-home-wrapper.component-DeR1T21C.mjs').then(c => c.CideLytHomeWrapperComponent),
7114
7070
  canActivate: [authGuard],
7115
7071
  data: {
7116
7072
  sypg_page_code: "cide_lyt_home" // Used by RequestService to fetch tab properties
@@ -7118,7 +7074,7 @@ const layoutControlPannelChildRoutes = [{
7118
7074
  },
7119
7075
  {
7120
7076
  path: "dashboard-manager",
7121
- loadComponent: () => import('./cloud-ide-layout-dashboard-manager.component-BVtdt1TW.mjs').then(c => c.DashboardManagerComponent),
7077
+ loadComponent: () => import('./cloud-ide-layout-dashboard-manager.component-DWxN9ReS.mjs').then(c => c.DashboardManagerComponent),
7122
7078
  canActivate: [authGuard],
7123
7079
  data: {
7124
7080
  sypg_page_code: "cide_lyt_dashboard_manager"
@@ -8942,4 +8898,4 @@ var floatingEntitySelection_component = /*#__PURE__*/Object.freeze({
8942
8898
  */
8943
8899
 
8944
8900
  export { AppStateHelperService as A, CideLytSharedWrapperComponent as C, ENVIRONMENT_CONFIG as E, NotificationSettingsService as N, RightsService as R, CideLytSidebarService as a, CideLytSidedrawerService as b, CideLytThemeService as c, CloudIdeLayoutService as d, CloudIdeLayoutComponent as e, CideLytSharedService as f, ComponentContextService as g, layoutControlPannelChildRoutes as h, CustomRouteReuseStrategy as i, AppStateService as j, CideLytUserStatusService as k, layoutRoutes as l, CacheManagerService as m, CideLytFileManagerService as n, CideLytFloatingEntityRightsSharingComponent as o, processThemeVariable as p, CideLytFloatingEntityRightsSharingService as q, CideLytFloatingEntitySelectionComponent as r, setCSSVariable as s, themeFactory as t, CideLytFloatingEntitySelectionService as u };
8945
- //# sourceMappingURL=cloud-ide-layout-cloud-ide-layout-W4WjBty3.mjs.map
8901
+ //# sourceMappingURL=cloud-ide-layout-cloud-ide-layout-BlLjLM3N.mjs.map