cloud-ide-element 1.0.117 → 1.0.119

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.
@@ -3385,8 +3385,7 @@ class CideEleFloatingContainerService {
3385
3385
  activeComponents = new Map();
3386
3386
  constructor(injector) {
3387
3387
  this.injector = injector;
3388
- // Set up keyboard shortcuts for container navigation
3389
- this.setupKeyboardShortcuts();
3388
+ // Keyboard shortcuts are now handled by FloatingContainerShortcutsService
3390
3389
  }
3391
3390
  // Computed properties
3392
3391
  visibleContainers = computed(() => Array.from(this.containers().values()).filter(container => container.isVisible), ...(ngDevMode ? [{ debugName: "visibleContainers" }] : []));
@@ -3450,75 +3449,24 @@ class CideEleFloatingContainerService {
3450
3449
  bringToFront(containerId) {
3451
3450
  const maxZIndex = this.getMaxZIndex();
3452
3451
  const newZIndex = maxZIndex + 1;
3452
+ console.log(`🎯 [FloatingContainer] Bringing container '${containerId}' to front`);
3453
+ console.log(`🎯 [FloatingContainer] Current max z-index: ${maxZIndex}, new z-index: ${newZIndex}`);
3453
3454
  this.containers.update(containers => {
3454
3455
  const newContainers = new Map(containers);
3455
3456
  const container = newContainers.get(containerId);
3456
3457
  if (container) {
3458
+ const oldZIndex = container.zIndex;
3457
3459
  container.zIndex = newZIndex;
3458
3460
  container.lastAccessed = new Date();
3459
3461
  newContainers.set(containerId, container);
3460
- console.log(`🎯 [FloatingContainer] Container '${containerId}' brought to front with z-index: ${newZIndex}`);
3462
+ console.log(`🎯 [FloatingContainer] Container '${containerId}' z-index updated: ${oldZIndex} → ${newZIndex}`);
3461
3463
  }
3462
- return newContainers;
3463
- });
3464
- }
3465
- /**
3466
- * Set up keyboard shortcuts for container navigation
3467
- */
3468
- setupKeyboardShortcuts() {
3469
- document.addEventListener('keydown', (event) => {
3470
- // Alt + Tab: Cycle through containers (like Windows Alt+Tab)
3471
- if (event.altKey && event.key === 'Tab') {
3472
- event.preventDefault();
3473
- this.cycleToNextContainer();
3474
- }
3475
- // Alt + Shift + Tab: Cycle backwards through containers
3476
- if (event.altKey && event.shiftKey && event.key === 'Tab') {
3477
- event.preventDefault();
3478
- this.cycleToPreviousContainer();
3479
- }
3480
- // Escape: Hide all containers
3481
- if (event.key === 'Escape') {
3482
- this.hideAll();
3464
+ else {
3465
+ console.warn(`⚠️ [FloatingContainer] Container '${containerId}' not found!`);
3483
3466
  }
3467
+ return newContainers;
3484
3468
  });
3485
3469
  }
3486
- /**
3487
- * Cycle to the next container (Alt+Tab behavior)
3488
- */
3489
- cycleToNextContainer() {
3490
- const visibleContainers = this.visibleContainers();
3491
- if (visibleContainers.length === 0)
3492
- return;
3493
- // Sort by last accessed time (most recent first)
3494
- const sortedContainers = visibleContainers.sort((a, b) => b.lastAccessed.getTime() - a.lastAccessed.getTime());
3495
- // Find current front container
3496
- const currentFront = sortedContainers[0];
3497
- const currentIndex = sortedContainers.findIndex(c => c.id === currentFront.id);
3498
- // Get next container (wrap around)
3499
- const nextIndex = (currentIndex + 1) % sortedContainers.length;
3500
- const nextContainer = sortedContainers[nextIndex];
3501
- this.bringToFront(nextContainer.id);
3502
- console.log(`🔄 [FloatingContainer] Cycled to container: ${nextContainer.config.title}`);
3503
- }
3504
- /**
3505
- * Cycle to the previous container (Alt+Shift+Tab behavior)
3506
- */
3507
- cycleToPreviousContainer() {
3508
- const visibleContainers = this.visibleContainers();
3509
- if (visibleContainers.length === 0)
3510
- return;
3511
- // Sort by last accessed time (most recent first)
3512
- const sortedContainers = visibleContainers.sort((a, b) => b.lastAccessed.getTime() - a.lastAccessed.getTime());
3513
- // Find current front container
3514
- const currentFront = sortedContainers[0];
3515
- const currentIndex = sortedContainers.findIndex(c => c.id === currentFront.id);
3516
- // Get previous container (wrap around)
3517
- const prevIndex = currentIndex === 0 ? sortedContainers.length - 1 : currentIndex - 1;
3518
- const prevContainer = sortedContainers[prevIndex];
3519
- this.bringToFront(prevContainer.id);
3520
- console.log(`🔄 [FloatingContainer] Cycled backwards to container: ${prevContainer.config.title}`);
3521
- }
3522
3470
  minimize(containerId) {
3523
3471
  this.containers.update(containers => {
3524
3472
  const newContainers = new Map(containers);
@@ -3757,6 +3705,35 @@ class CideEleFloatingContainerService {
3757
3705
  return container?.isMaximized || false;
3758
3706
  });
3759
3707
  }
3708
+ getZIndexSignal(containerId) {
3709
+ return computed(() => {
3710
+ const container = this.getContainer(containerId);
3711
+ const zIndex = container?.zIndex || 1000;
3712
+ console.log(`🎯 [FloatingContainer] Z-index signal for '${containerId}': ${zIndex}`);
3713
+ return zIndex;
3714
+ });
3715
+ }
3716
+ /**
3717
+ * Set z-index for a specific container
3718
+ */
3719
+ setZIndex(containerId, zIndex) {
3720
+ console.log(`🎯 [FloatingContainer] Setting z-index for '${containerId}' to ${zIndex}`);
3721
+ this.containers.update(containers => {
3722
+ const newContainers = new Map(containers);
3723
+ const container = newContainers.get(containerId);
3724
+ if (container) {
3725
+ const oldZIndex = container.zIndex;
3726
+ container.zIndex = zIndex;
3727
+ container.lastAccessed = new Date();
3728
+ newContainers.set(containerId, container);
3729
+ console.log(`🎯 [FloatingContainer] Container '${containerId}' z-index updated: ${oldZIndex} → ${zIndex}`);
3730
+ }
3731
+ else {
3732
+ console.warn(`⚠️ [FloatingContainer] Container '${containerId}' not found for z-index update!`);
3733
+ }
3734
+ return newContainers;
3735
+ });
3736
+ }
3760
3737
  /**
3761
3738
  * Get visible signal for a container
3762
3739
  */
@@ -5014,7 +4991,7 @@ class CideEleFloatingFileUploaderComponent {
5014
4991
  // Input data from floating container
5015
4992
  data = {};
5016
4993
  // Signals for reactive state
5017
- isVisible = signal(false, ...(ngDevMode ? [{ debugName: "isVisible" }] : []));
4994
+ isVisible = signal(true, ...(ngDevMode ? [{ debugName: "isVisible" }] : [])); // Set to true by default for floating containers
5018
4995
  isMinimized = signal(false, ...(ngDevMode ? [{ debugName: "isMinimized" }] : []));
5019
4996
  currentUserId = signal('', ...(ngDevMode ? [{ debugName: "currentUserId" }] : []));
5020
4997
  currentGroupId = signal(null, ...(ngDevMode ? [{ debugName: "currentGroupId" }] : []));
@@ -5750,6 +5727,510 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
5750
5727
  type: Output
5751
5728
  }] } });
5752
5729
 
5730
+ class KeyboardShortcutService {
5731
+ shortcuts = new Map();
5732
+ overrides = new Map();
5733
+ keydownListener;
5734
+ constructor() {
5735
+ this.setupGlobalListener();
5736
+ }
5737
+ ngOnDestroy() {
5738
+ this.removeGlobalListener();
5739
+ }
5740
+ /**
5741
+ * Register a new keyboard shortcut
5742
+ */
5743
+ register(shortcut) {
5744
+ this.shortcuts.set(shortcut.id, shortcut);
5745
+ console.log(`⌨️ [KeyboardShortcut] Registered shortcut: ${shortcut.id} (${this.getKeyDescription(shortcut)})`);
5746
+ }
5747
+ /**
5748
+ * Override an existing shortcut with new key combination
5749
+ */
5750
+ override(shortcutId, newKey, options) {
5751
+ const originalShortcut = this.shortcuts.get(shortcutId);
5752
+ if (!originalShortcut) {
5753
+ console.warn(`⚠️ [KeyboardShortcut] Cannot override shortcut '${shortcutId}' - not found`);
5754
+ return;
5755
+ }
5756
+ const override = {
5757
+ shortcutId,
5758
+ newKey,
5759
+ newCtrlKey: options?.ctrlKey,
5760
+ newAltKey: options?.altKey,
5761
+ newShiftKey: options?.shiftKey,
5762
+ newMetaKey: options?.metaKey
5763
+ };
5764
+ this.overrides.set(shortcutId, override);
5765
+ console.log(`🔄 [KeyboardShortcut] Override registered for '${shortcutId}': ${this.getKeyDescription({ ...originalShortcut, ...options, key: newKey })}`);
5766
+ }
5767
+ /**
5768
+ * Remove a shortcut
5769
+ */
5770
+ unregister(shortcutId) {
5771
+ this.shortcuts.delete(shortcutId);
5772
+ this.overrides.delete(shortcutId);
5773
+ console.log(`🗑️ [KeyboardShortcut] Removed shortcut: ${shortcutId}`);
5774
+ }
5775
+ /**
5776
+ * Remove override for a shortcut (restore original key combination)
5777
+ */
5778
+ removeOverride(shortcutId) {
5779
+ this.overrides.delete(shortcutId);
5780
+ console.log(`🔄 [KeyboardShortcut] Override removed for: ${shortcutId}`);
5781
+ }
5782
+ /**
5783
+ * Get all registered shortcuts
5784
+ */
5785
+ getAllShortcuts() {
5786
+ return Array.from(this.shortcuts.values());
5787
+ }
5788
+ /**
5789
+ * Get shortcuts by category or filter
5790
+ */
5791
+ getShortcuts(filter) {
5792
+ const shortcuts = this.getAllShortcuts();
5793
+ return filter ? shortcuts.filter(filter) : shortcuts;
5794
+ }
5795
+ /**
5796
+ * Check if a shortcut is registered
5797
+ */
5798
+ hasShortcut(shortcutId) {
5799
+ return this.shortcuts.has(shortcutId);
5800
+ }
5801
+ /**
5802
+ * Get shortcut information
5803
+ */
5804
+ getShortcut(shortcutId) {
5805
+ return this.shortcuts.get(shortcutId);
5806
+ }
5807
+ /**
5808
+ * Clear all shortcuts
5809
+ */
5810
+ clearAll() {
5811
+ this.shortcuts.clear();
5812
+ this.overrides.clear();
5813
+ console.log(`🧹 [KeyboardShortcut] All shortcuts cleared`);
5814
+ }
5815
+ /**
5816
+ * Set up global keyboard listener
5817
+ */
5818
+ setupGlobalListener() {
5819
+ this.keydownListener = (event) => {
5820
+ this.handleKeydown(event);
5821
+ };
5822
+ document.addEventListener('keydown', this.keydownListener);
5823
+ console.log(`🎧 [KeyboardShortcut] Global keyboard listener attached`);
5824
+ }
5825
+ /**
5826
+ * Remove global keyboard listener
5827
+ */
5828
+ removeGlobalListener() {
5829
+ if (this.keydownListener) {
5830
+ document.removeEventListener('keydown', this.keydownListener);
5831
+ this.keydownListener = undefined;
5832
+ console.log(`🎧 [KeyboardShortcut] Global keyboard listener removed`);
5833
+ }
5834
+ }
5835
+ /**
5836
+ * Handle keydown events
5837
+ */
5838
+ handleKeydown(event) {
5839
+ for (const [shortcutId, shortcut] of this.shortcuts) {
5840
+ if (this.matchesShortcut(event, shortcut)) {
5841
+ // Check for override
5842
+ const override = this.overrides.get(shortcutId);
5843
+ if (override && !this.matchesOverride(event, override)) {
5844
+ continue; // Skip if override doesn't match
5845
+ }
5846
+ if (shortcut.preventDefault !== false) {
5847
+ event.preventDefault();
5848
+ }
5849
+ if (shortcut.stopPropagation) {
5850
+ event.stopPropagation();
5851
+ }
5852
+ console.log(`⌨️ [KeyboardShortcut] Executing shortcut: ${shortcutId}`);
5853
+ shortcut.action();
5854
+ break; // Only execute one shortcut per keydown
5855
+ }
5856
+ }
5857
+ }
5858
+ /**
5859
+ * Check if event matches shortcut
5860
+ */
5861
+ matchesShortcut(event, shortcut) {
5862
+ return event.key === shortcut.key &&
5863
+ (shortcut.ctrlKey === undefined || event.ctrlKey === shortcut.ctrlKey) &&
5864
+ (shortcut.altKey === undefined || event.altKey === shortcut.altKey) &&
5865
+ (shortcut.shiftKey === undefined || event.shiftKey === shortcut.shiftKey) &&
5866
+ (shortcut.metaKey === undefined || event.metaKey === shortcut.metaKey);
5867
+ }
5868
+ /**
5869
+ * Check if event matches override
5870
+ */
5871
+ matchesOverride(event, override) {
5872
+ return event.key === override.newKey &&
5873
+ (override.newCtrlKey === undefined || event.ctrlKey === override.newCtrlKey) &&
5874
+ (override.newAltKey === undefined || event.altKey === override.newAltKey) &&
5875
+ (override.newShiftKey === undefined || event.shiftKey === override.newShiftKey) &&
5876
+ (override.newMetaKey === undefined || event.metaKey === override.newMetaKey);
5877
+ }
5878
+ /**
5879
+ * Get human-readable key description
5880
+ */
5881
+ getKeyDescription(shortcut) {
5882
+ const modifiers = [];
5883
+ if (shortcut.ctrlKey)
5884
+ modifiers.push('Ctrl');
5885
+ if (shortcut.altKey)
5886
+ modifiers.push('Alt');
5887
+ if (shortcut.shiftKey)
5888
+ modifiers.push('Shift');
5889
+ if (shortcut.metaKey)
5890
+ modifiers.push('Meta');
5891
+ return [...modifiers, shortcut.key].join(' + ');
5892
+ }
5893
+ /**
5894
+ * Get key description for a shortcut ID
5895
+ */
5896
+ getKeyDescriptionForShortcut(shortcutId) {
5897
+ const shortcut = this.shortcuts.get(shortcutId);
5898
+ if (!shortcut)
5899
+ return 'Not found';
5900
+ const override = this.overrides.get(shortcutId);
5901
+ if (override) {
5902
+ return this.getKeyDescription({
5903
+ key: override.newKey,
5904
+ ctrlKey: override.newCtrlKey,
5905
+ altKey: override.newAltKey,
5906
+ shiftKey: override.newShiftKey,
5907
+ metaKey: override.newMetaKey
5908
+ });
5909
+ }
5910
+ return this.getKeyDescription(shortcut);
5911
+ }
5912
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: KeyboardShortcutService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5913
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: KeyboardShortcutService, providedIn: 'root' });
5914
+ }
5915
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: KeyboardShortcutService, decorators: [{
5916
+ type: Injectable,
5917
+ args: [{
5918
+ providedIn: 'root'
5919
+ }]
5920
+ }], ctorParameters: () => [] });
5921
+
5922
+ class FloatingContainerShortcutsService {
5923
+ keyboardShortcutService = inject(KeyboardShortcutService);
5924
+ containerService = inject(CideEleFloatingContainerService);
5925
+ // Z-index layers for different container states
5926
+ Z_INDEX_LAYERS = {
5927
+ HIDDEN: 100, // Hidden containers (behind everything)
5928
+ BACKGROUND: 1000, // Background containers
5929
+ NORMAL: 2000, // Normal visible containers
5930
+ FOCUSED: 3000, // Focused containers
5931
+ MODAL: 4000, // Modal containers
5932
+ TOOLTIP: 5000 // Tooltips and overlays
5933
+ };
5934
+ constructor() {
5935
+ this.registerDefaultShortcuts();
5936
+ }
5937
+ /**
5938
+ * Register default floating container shortcuts using custom key combinations
5939
+ */
5940
+ registerDefaultShortcuts() {
5941
+ // C + 1: Focus on first container
5942
+ this.keyboardShortcutService.register({
5943
+ id: 'floating-container-focus-first',
5944
+ key: '1',
5945
+ ctrlKey: true,
5946
+ description: 'Focus on first floating container (C+1)',
5947
+ action: () => this.focusFirstContainer(),
5948
+ preventDefault: true
5949
+ });
5950
+ // C + 2: Focus on second container
5951
+ this.keyboardShortcutService.register({
5952
+ id: 'floating-container-focus-second',
5953
+ key: '2',
5954
+ ctrlKey: true,
5955
+ description: 'Focus on second floating container (C+2)',
5956
+ action: () => this.focusContainerByIndex(1),
5957
+ preventDefault: true
5958
+ });
5959
+ // C + 3: Focus on third container
5960
+ this.keyboardShortcutService.register({
5961
+ id: 'floating-container-focus-third',
5962
+ key: '3',
5963
+ ctrlKey: true,
5964
+ description: 'Focus on third floating container (C+3)',
5965
+ action: () => this.focusContainerByIndex(2),
5966
+ preventDefault: true
5967
+ });
5968
+ // C + 4: Focus on fourth container
5969
+ this.keyboardShortcutService.register({
5970
+ id: 'floating-container-focus-fourth',
5971
+ key: '4',
5972
+ ctrlKey: true,
5973
+ description: 'Focus on fourth floating container (C+4)',
5974
+ action: () => this.focusContainerByIndex(3),
5975
+ preventDefault: true
5976
+ });
5977
+ // C + 5: Focus on fifth container
5978
+ this.keyboardShortcutService.register({
5979
+ id: 'floating-container-focus-fifth',
5980
+ key: '5',
5981
+ ctrlKey: true,
5982
+ description: 'Focus on fifth floating container (C+5)',
5983
+ action: () => this.focusContainerByIndex(4),
5984
+ preventDefault: true
5985
+ });
5986
+ // C + N: Cycle to next container
5987
+ this.keyboardShortcutService.register({
5988
+ id: 'floating-container-cycle-forward',
5989
+ key: 'n',
5990
+ ctrlKey: true,
5991
+ description: 'Cycle forward through floating containers (C+N)',
5992
+ action: () => this.cycleToNextContainer(),
5993
+ preventDefault: true
5994
+ });
5995
+ // C + P: Cycle to previous container
5996
+ this.keyboardShortcutService.register({
5997
+ id: 'floating-container-cycle-backward',
5998
+ key: 'p',
5999
+ ctrlKey: true,
6000
+ description: 'Cycle backward through floating containers (C+P)',
6001
+ action: () => this.cycleToPreviousContainer(),
6002
+ preventDefault: true
6003
+ });
6004
+ // C + H: Hide all containers
6005
+ this.keyboardShortcutService.register({
6006
+ id: 'floating-container-hide-all',
6007
+ key: 'h',
6008
+ ctrlKey: true,
6009
+ description: 'Hide all floating containers (C+H)',
6010
+ action: () => this.hideAllContainers(),
6011
+ preventDefault: true
6012
+ });
6013
+ // C + M: Minimize all containers
6014
+ this.keyboardShortcutService.register({
6015
+ id: 'floating-container-minimize-all',
6016
+ key: 'm',
6017
+ ctrlKey: true,
6018
+ description: 'Minimize all floating containers (C+M)',
6019
+ action: () => this.minimizeAllContainers(),
6020
+ preventDefault: true
6021
+ });
6022
+ // C + O: Open file uploader
6023
+ this.keyboardShortcutService.register({
6024
+ id: 'floating-container-open-file-uploader',
6025
+ key: 'o',
6026
+ ctrlKey: true,
6027
+ description: 'Open file uploader (C+O)',
6028
+ action: () => this.openFileUploader(),
6029
+ preventDefault: true
6030
+ });
6031
+ // C + R: Open entity rights sharing
6032
+ this.keyboardShortcutService.register({
6033
+ id: 'floating-container-open-entity-rights',
6034
+ key: 'r',
6035
+ ctrlKey: true,
6036
+ description: 'Open entity rights sharing (C+R)',
6037
+ action: () => this.openEntityRightsSharing(),
6038
+ preventDefault: true
6039
+ });
6040
+ // C + S: Show all containers
6041
+ this.keyboardShortcutService.register({
6042
+ id: 'floating-container-show-all',
6043
+ key: 's',
6044
+ ctrlKey: true,
6045
+ description: 'Show all floating containers (C+S)',
6046
+ action: () => this.showAllContainers(),
6047
+ preventDefault: true
6048
+ });
6049
+ // C + D: Duplicate current container
6050
+ this.keyboardShortcutService.register({
6051
+ id: 'floating-container-duplicate',
6052
+ key: 'd',
6053
+ ctrlKey: true,
6054
+ description: 'Duplicate current container (C+D)',
6055
+ action: () => this.duplicateCurrentContainer(),
6056
+ preventDefault: true
6057
+ });
6058
+ // C + W: Close current container
6059
+ this.keyboardShortcutService.register({
6060
+ id: 'floating-container-close-current',
6061
+ key: 'w',
6062
+ ctrlKey: true,
6063
+ description: 'Close current container (C+W)',
6064
+ action: () => this.closeCurrentContainer(),
6065
+ preventDefault: true
6066
+ });
6067
+ // C + T: Toggle container visibility
6068
+ this.keyboardShortcutService.register({
6069
+ id: 'floating-container-toggle-visibility',
6070
+ key: 't',
6071
+ ctrlKey: true,
6072
+ description: 'Toggle container visibility (C+T)',
6073
+ action: () => this.toggleContainerVisibility(),
6074
+ preventDefault: true
6075
+ });
6076
+ console.log('🎯 [FloatingContainerShortcuts] Custom shortcuts registered (C+1, C+2, C+O, etc.)');
6077
+ }
6078
+ /**
6079
+ * Override a floating container shortcut
6080
+ */
6081
+ overrideShortcut(shortcutId, newKey, options) {
6082
+ this.keyboardShortcutService.override(shortcutId, newKey, options);
6083
+ }
6084
+ /**
6085
+ * Add a custom floating container shortcut
6086
+ */
6087
+ addCustomShortcut(shortcut) {
6088
+ this.keyboardShortcutService.register({
6089
+ ...shortcut,
6090
+ preventDefault: true
6091
+ });
6092
+ }
6093
+ /**
6094
+ * Remove a floating container shortcut
6095
+ */
6096
+ removeShortcut(shortcutId) {
6097
+ this.keyboardShortcutService.unregister(shortcutId);
6098
+ }
6099
+ /**
6100
+ * Get all floating container shortcuts
6101
+ */
6102
+ getShortcuts() {
6103
+ return this.keyboardShortcutService.getShortcuts(shortcut => shortcut.id.startsWith('floating-container-'));
6104
+ }
6105
+ // Action methods
6106
+ cycleToNextContainer() {
6107
+ const visibleContainers = this.containerService.visibleContainers();
6108
+ if (visibleContainers.length === 0)
6109
+ return;
6110
+ // Sort by last accessed time (most recent first)
6111
+ const sortedContainers = visibleContainers.sort((a, b) => b.lastAccessed.getTime() - a.lastAccessed.getTime());
6112
+ // Find current front container
6113
+ const currentFront = sortedContainers[0];
6114
+ const currentIndex = sortedContainers.findIndex(c => c.id === currentFront.id);
6115
+ // Get next container (wrap around)
6116
+ const nextIndex = (currentIndex + 1) % sortedContainers.length;
6117
+ const nextContainer = sortedContainers[nextIndex];
6118
+ this.containerService.bringToFront(nextContainer.id);
6119
+ console.log(`🔄 [FloatingContainerShortcuts] Cycled to container: ${nextContainer.config.title}`);
6120
+ }
6121
+ cycleToPreviousContainer() {
6122
+ const visibleContainers = this.containerService.visibleContainers();
6123
+ if (visibleContainers.length === 0)
6124
+ return;
6125
+ // Sort by last accessed time (most recent first)
6126
+ const sortedContainers = visibleContainers.sort((a, b) => b.lastAccessed.getTime() - a.lastAccessed.getTime());
6127
+ // Find current front container
6128
+ const currentFront = sortedContainers[0];
6129
+ const currentIndex = sortedContainers.findIndex(c => c.id === currentFront.id);
6130
+ // Get previous container (wrap around)
6131
+ const prevIndex = currentIndex === 0 ? sortedContainers.length - 1 : currentIndex - 1;
6132
+ const prevContainer = sortedContainers[prevIndex];
6133
+ this.containerService.bringToFront(prevContainer.id);
6134
+ console.log(`🔄 [FloatingContainerShortcuts] Cycled backwards to container: ${prevContainer.config.title}`);
6135
+ }
6136
+ hideAllContainers() {
6137
+ const visibleContainers = this.containerService.visibleContainers();
6138
+ visibleContainers.forEach(container => {
6139
+ this.containerService.setZIndex(container.id, this.Z_INDEX_LAYERS.HIDDEN);
6140
+ });
6141
+ console.log(`👁️ [FloatingContainerShortcuts] All containers moved to hidden layer (z-index: ${this.Z_INDEX_LAYERS.HIDDEN})`);
6142
+ }
6143
+ focusFirstContainer() {
6144
+ const visibleContainers = this.containerService.visibleContainers();
6145
+ if (visibleContainers.length === 0)
6146
+ return;
6147
+ const firstContainer = visibleContainers[0];
6148
+ this.containerService.bringToFront(firstContainer.id);
6149
+ console.log(`🎯 [FloatingContainerShortcuts] Focused on first container: ${firstContainer.config.title}`);
6150
+ }
6151
+ minimizeAllContainers() {
6152
+ this.containerService.minimizeAll();
6153
+ console.log(`📦 [FloatingContainerShortcuts] All containers minimized`);
6154
+ }
6155
+ focusContainerByIndex(index) {
6156
+ const visibleContainers = this.containerService.visibleContainers();
6157
+ if (visibleContainers.length === 0 || index >= visibleContainers.length) {
6158
+ console.log(`⚠️ [FloatingContainerShortcuts] No container at index ${index}`);
6159
+ return;
6160
+ }
6161
+ const container = visibleContainers[index];
6162
+ this.containerService.bringToFront(container.id);
6163
+ console.log(`🎯 [FloatingContainerShortcuts] Focused on container ${index + 1}: ${container.config.title}`);
6164
+ }
6165
+ openFileUploader() {
6166
+ console.log(`📁 [FloatingContainerShortcuts] Opening file uploader...`);
6167
+ // This would need to be implemented based on your file uploader service
6168
+ // Example: this.fileUploaderService.show();
6169
+ }
6170
+ openEntityRightsSharing() {
6171
+ console.log(`🔐 [FloatingContainerShortcuts] Opening entity rights sharing...`);
6172
+ // This would need to be implemented based on your entity rights service
6173
+ // Example: this.entityRightsService.show();
6174
+ }
6175
+ showAllContainers() {
6176
+ const visibleContainers = this.containerService.visibleContainers();
6177
+ visibleContainers.forEach((container, index) => {
6178
+ // Give each container a slightly different z-index to maintain order
6179
+ const zIndex = this.Z_INDEX_LAYERS.NORMAL + index;
6180
+ this.containerService.setZIndex(container.id, zIndex);
6181
+ });
6182
+ console.log(`👁️ [FloatingContainerShortcuts] All containers moved to normal layer (z-index: ${this.Z_INDEX_LAYERS.NORMAL}+)`);
6183
+ }
6184
+ duplicateCurrentContainer() {
6185
+ const visibleContainers = this.containerService.visibleContainers();
6186
+ if (visibleContainers.length === 0) {
6187
+ console.log(`⚠️ [FloatingContainerShortcuts] No containers to duplicate`);
6188
+ return;
6189
+ }
6190
+ const currentContainer = visibleContainers[0]; // Most recent container
6191
+ console.log(`📋 [FloatingContainerShortcuts] Duplicating container: ${currentContainer.config.title}`);
6192
+ // This would need to be implemented based on your container duplication logic
6193
+ }
6194
+ closeCurrentContainer() {
6195
+ const visibleContainers = this.containerService.visibleContainers();
6196
+ if (visibleContainers.length === 0) {
6197
+ console.log(`⚠️ [FloatingContainerShortcuts] No containers to close`);
6198
+ return;
6199
+ }
6200
+ const currentContainer = visibleContainers[0]; // Most recent container
6201
+ this.containerService.hide(currentContainer.id);
6202
+ console.log(`❌ [FloatingContainerShortcuts] Closed container: ${currentContainer.config.title}`);
6203
+ }
6204
+ toggleContainerVisibility() {
6205
+ const visibleContainers = this.containerService.visibleContainers();
6206
+ if (visibleContainers.length === 0) {
6207
+ console.log(`⚠️ [FloatingContainerShortcuts] No containers to toggle`);
6208
+ return;
6209
+ }
6210
+ // Toggle visibility of the most recent container using z-index
6211
+ const currentContainer = visibleContainers[0];
6212
+ const currentZIndex = currentContainer.zIndex;
6213
+ if (currentZIndex >= this.Z_INDEX_LAYERS.NORMAL) {
6214
+ // Container is visible, move to hidden layer
6215
+ this.containerService.setZIndex(currentContainer.id, this.Z_INDEX_LAYERS.HIDDEN);
6216
+ console.log(`👁️ [FloatingContainerShortcuts] Hidden container (z-index: ${this.Z_INDEX_LAYERS.HIDDEN}): ${currentContainer.config.title}`);
6217
+ }
6218
+ else {
6219
+ // Container is hidden, move to normal layer
6220
+ this.containerService.setZIndex(currentContainer.id, this.Z_INDEX_LAYERS.NORMAL);
6221
+ console.log(`👁️ [FloatingContainerShortcuts] Shown container (z-index: ${this.Z_INDEX_LAYERS.NORMAL}): ${currentContainer.config.title}`);
6222
+ }
6223
+ }
6224
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: FloatingContainerShortcutsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
6225
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: FloatingContainerShortcutsService, providedIn: 'root' });
6226
+ }
6227
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: FloatingContainerShortcutsService, decorators: [{
6228
+ type: Injectable,
6229
+ args: [{
6230
+ providedIn: 'root'
6231
+ }]
6232
+ }], ctorParameters: () => [] });
6233
+
5753
6234
  /**
5754
6235
  <!-- Basic horizontal (left-right) layout -->
5755
6236
  <div class="panel-container">
@@ -9869,8 +10350,12 @@ class CideEleFloatingContainerComponent {
9869
10350
  savedPosition = { x: 100, y: 100 }; // Store position before maximizing
9870
10351
  savedHeight = ''; // Store height before maximizing
9871
10352
  ngAfterViewInit() {
9872
- // Center the container on screen
9873
- this.centerContainer();
10353
+ // Only center the container if it's at the default position (100, 100)
10354
+ // This prevents position jumping when containers are focused
10355
+ const currentPos = this.position();
10356
+ if (currentPos.x === 100 && currentPos.y === 100) {
10357
+ this.centerContainer();
10358
+ }
9874
10359
  }
9875
10360
  constructor() {
9876
10361
  // Watch for maximize state changes
@@ -9987,6 +10472,9 @@ class CideEleFloatingContainerComponent {
9987
10472
  // This will be handled by the container service through the manager component
9988
10473
  // The manager component will call the service's bringToFront method
9989
10474
  console.log(`🎯 [FloatingContainer] Container '${this.computedConfig().id}' clicked - bringing to front`);
10475
+ // Preserve current position to prevent jumping
10476
+ const currentPos = this.position();
10477
+ console.log(`🎯 [FloatingContainer] Preserving position: x=${currentPos.x}, y=${currentPos.y}`);
9990
10478
  }
9991
10479
  toggleMaximize() {
9992
10480
  this.maximizeEvent.emit(this.computedConfig().id);
@@ -10239,96 +10727,96 @@ class CideEleFloatingContainerManagerComponent {
10239
10727
  // Computed properties
10240
10728
  visibleContainers = computed(() => this.containerService.visibleContainers(), ...(ngDevMode ? [{ debugName: "visibleContainers" }] : []));
10241
10729
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideEleFloatingContainerManagerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
10242
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: CideEleFloatingContainerManagerComponent, isStandalone: true, selector: "cide-ele-floating-container-manager", ngImport: i0, template: `
10243
- @for (container of visibleContainers(); track container.id) {
10244
- <cide-ele-floating-container
10245
- [config]="containerService.getConfigSignal(container.config)"
10246
- [isMinimized]="containerService.getMinimizedSignal(container.id)"
10247
- [isMaximized]="containerService.getMaximizedSignal(container.id)"
10248
- [isVisible]="containerService.getVisibleSignal(container.id)"
10249
- [style.z-index]="container.zIndex"
10250
- (closeEvent)="containerService.onClose($event)"
10251
- (minimizeEvent)="containerService.onMinimize($event)"
10252
- (maximizeEvent)="containerService.onMaximize($event)"
10253
- (clickEvent)="containerService.bringToFront($event)">
10254
-
10255
- <!-- Dynamic content loading with @defer for performance -->
10256
- @defer (when container.isVisible) {
10257
- <div
10258
- cideEleFloatingDynamic
10259
- [componentId]="container.config.componentId || container.config.id"
10260
- [componentConfig]="containerService.getComponentConfig(container.config)"
10261
- [isVisible]="container.isVisible">
10262
- </div>
10263
- } @placeholder {
10264
- <div class="tw-flex tw-items-center tw-justify-center tw-p-4">
10265
- <cide-ele-spinner size="sm"></cide-ele-spinner>
10266
- <span class="tw-ml-2 tw-text-sm tw-text-gray-600">Loading component...</span>
10267
- </div>
10268
- } @error {
10269
- <div class="tw-flex tw-flex-col tw-items-center tw-justify-center tw-p-4 tw-text-center">
10270
- <cide-ele-icon class="tw-w-8 tw-h-8 tw-text-red-500 tw-mb-2">error</cide-ele-icon>
10271
- <p class="tw-text-red-600 tw-font-medium">Failed to load component</p>
10272
- <p class="tw-text-gray-500 tw-text-sm">Component "{{ container.config.componentId || container.config.id }}" is not available</p>
10273
- <button
10274
- cideEleButton
10275
- variant="outline"
10276
- size="xs"
10277
- (click)="containerService.onClose(container.id)"
10278
- class="tw-mt-2">
10279
- Close
10280
- </button>
10281
- </div>
10282
- }
10283
- </cide-ele-floating-container>
10284
- }
10730
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: CideEleFloatingContainerManagerComponent, isStandalone: true, selector: "cide-ele-floating-container-manager", ngImport: i0, template: `
10731
+ @for (container of visibleContainers(); track container.id) {
10732
+ <cide-ele-floating-container
10733
+ [config]="containerService.getConfigSignal(container.config)"
10734
+ [isMinimized]="containerService.getMinimizedSignal(container.id)"
10735
+ [isMaximized]="containerService.getMaximizedSignal(container.id)"
10736
+ [isVisible]="containerService.getVisibleSignal(container.id)"
10737
+ [style.z-index]="containerService.getZIndexSignal(container.id)()"
10738
+ (closeEvent)="containerService.onClose($event)"
10739
+ (minimizeEvent)="containerService.onMinimize($event)"
10740
+ (maximizeEvent)="containerService.onMaximize($event)"
10741
+ (clickEvent)="containerService.bringToFront($event)">
10742
+
10743
+ <!-- Dynamic content loading with @defer for performance -->
10744
+ @defer (when container.isVisible) {
10745
+ <div
10746
+ cideEleFloatingDynamic
10747
+ [componentId]="container.config.componentId || container.config.id"
10748
+ [componentConfig]="containerService.getComponentConfig(container.config)"
10749
+ [isVisible]="container.isVisible">
10750
+ </div>
10751
+ } @placeholder {
10752
+ <div class="tw-flex tw-items-center tw-justify-center tw-p-4">
10753
+ <cide-ele-spinner size="sm"></cide-ele-spinner>
10754
+ <span class="tw-ml-2 tw-text-sm tw-text-gray-600">Loading component...</span>
10755
+ </div>
10756
+ } @error {
10757
+ <div class="tw-flex tw-flex-col tw-items-center tw-justify-center tw-p-4 tw-text-center">
10758
+ <cide-ele-icon class="tw-w-8 tw-h-8 tw-text-red-500 tw-mb-2">error</cide-ele-icon>
10759
+ <p class="tw-text-red-600 tw-font-medium">Failed to load component</p>
10760
+ <p class="tw-text-gray-500 tw-text-sm">Component "{{ container.config.componentId || container.config.id }}" is not available</p>
10761
+ <button
10762
+ cideEleButton
10763
+ variant="outline"
10764
+ size="xs"
10765
+ (click)="containerService.onClose(container.id)"
10766
+ class="tw-mt-2">
10767
+ Close
10768
+ </button>
10769
+ </div>
10770
+ }
10771
+ </cide-ele-floating-container>
10772
+ }
10285
10773
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: CideEleFloatingContainerComponent, selector: "cide-ele-floating-container", inputs: ["config", "isMinimized", "isMaximized", "isVisible"], outputs: ["closeEvent", "minimizeEvent", "maximizeEvent", "clickEvent"] }, { kind: "component", type: CideSpinnerComponent, selector: "cide-ele-spinner", inputs: ["size", "type"] }, { kind: "component", type: CideEleButtonComponent, selector: "button[cideEleButton], a[cideEleButton]", inputs: ["label", "variant", "size", "type", "shape", "elevation", "disabled", "id", "loading", "fullWidth", "leftIcon", "rightIcon", "customClass", "tooltip", "ariaLabel", "testId", "routerLink", "routerExtras", "preventDoubleClick", "animated"], outputs: ["btnClick", "doubleClick"] }, { kind: "component", type: CideIconComponent, selector: "cide-ele-icon", inputs: ["size", "type", "toolTip"] }], deferBlockDependencies: [() => [Promise.resolve().then(function () { return floatingContainerDynamic_directive; }).then(m => m.CideEleFloatingContainerDynamicDirective)]] });
10286
10774
  }
10287
10775
  i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "20.1.7", ngImport: i0, type: CideEleFloatingContainerManagerComponent, resolveDeferredDeps: () => [Promise.resolve().then(function () { return floatingContainerDynamic_directive; }).then(m => m.CideEleFloatingContainerDynamicDirective)], resolveMetadata: CideEleFloatingContainerDynamicDirective => ({ decorators: [{
10288
10776
  type: Component,
10289
- args: [{ selector: 'cide-ele-floating-container-manager', standalone: true, imports: [CommonModule, CideEleFloatingContainerComponent, CideEleFloatingContainerDynamicDirective, CideSpinnerComponent, CideEleButtonComponent, CideIconComponent], template: `
10290
- @for (container of visibleContainers(); track container.id) {
10291
- <cide-ele-floating-container
10292
- [config]="containerService.getConfigSignal(container.config)"
10293
- [isMinimized]="containerService.getMinimizedSignal(container.id)"
10294
- [isMaximized]="containerService.getMaximizedSignal(container.id)"
10295
- [isVisible]="containerService.getVisibleSignal(container.id)"
10296
- [style.z-index]="container.zIndex"
10297
- (closeEvent)="containerService.onClose($event)"
10298
- (minimizeEvent)="containerService.onMinimize($event)"
10299
- (maximizeEvent)="containerService.onMaximize($event)"
10300
- (clickEvent)="containerService.bringToFront($event)">
10301
-
10302
- <!-- Dynamic content loading with @defer for performance -->
10303
- @defer (when container.isVisible) {
10304
- <div
10305
- cideEleFloatingDynamic
10306
- [componentId]="container.config.componentId || container.config.id"
10307
- [componentConfig]="containerService.getComponentConfig(container.config)"
10308
- [isVisible]="container.isVisible">
10309
- </div>
10310
- } @placeholder {
10311
- <div class="tw-flex tw-items-center tw-justify-center tw-p-4">
10312
- <cide-ele-spinner size="sm"></cide-ele-spinner>
10313
- <span class="tw-ml-2 tw-text-sm tw-text-gray-600">Loading component...</span>
10314
- </div>
10315
- } @error {
10316
- <div class="tw-flex tw-flex-col tw-items-center tw-justify-center tw-p-4 tw-text-center">
10317
- <cide-ele-icon class="tw-w-8 tw-h-8 tw-text-red-500 tw-mb-2">error</cide-ele-icon>
10318
- <p class="tw-text-red-600 tw-font-medium">Failed to load component</p>
10319
- <p class="tw-text-gray-500 tw-text-sm">Component "{{ container.config.componentId || container.config.id }}" is not available</p>
10320
- <button
10321
- cideEleButton
10322
- variant="outline"
10323
- size="xs"
10324
- (click)="containerService.onClose(container.id)"
10325
- class="tw-mt-2">
10326
- Close
10327
- </button>
10328
- </div>
10329
- }
10330
- </cide-ele-floating-container>
10331
- }
10777
+ args: [{ selector: 'cide-ele-floating-container-manager', standalone: true, imports: [CommonModule, CideEleFloatingContainerComponent, CideEleFloatingContainerDynamicDirective, CideSpinnerComponent, CideEleButtonComponent, CideIconComponent], template: `
10778
+ @for (container of visibleContainers(); track container.id) {
10779
+ <cide-ele-floating-container
10780
+ [config]="containerService.getConfigSignal(container.config)"
10781
+ [isMinimized]="containerService.getMinimizedSignal(container.id)"
10782
+ [isMaximized]="containerService.getMaximizedSignal(container.id)"
10783
+ [isVisible]="containerService.getVisibleSignal(container.id)"
10784
+ [style.z-index]="containerService.getZIndexSignal(container.id)()"
10785
+ (closeEvent)="containerService.onClose($event)"
10786
+ (minimizeEvent)="containerService.onMinimize($event)"
10787
+ (maximizeEvent)="containerService.onMaximize($event)"
10788
+ (clickEvent)="containerService.bringToFront($event)">
10789
+
10790
+ <!-- Dynamic content loading with @defer for performance -->
10791
+ @defer (when container.isVisible) {
10792
+ <div
10793
+ cideEleFloatingDynamic
10794
+ [componentId]="container.config.componentId || container.config.id"
10795
+ [componentConfig]="containerService.getComponentConfig(container.config)"
10796
+ [isVisible]="container.isVisible">
10797
+ </div>
10798
+ } @placeholder {
10799
+ <div class="tw-flex tw-items-center tw-justify-center tw-p-4">
10800
+ <cide-ele-spinner size="sm"></cide-ele-spinner>
10801
+ <span class="tw-ml-2 tw-text-sm tw-text-gray-600">Loading component...</span>
10802
+ </div>
10803
+ } @error {
10804
+ <div class="tw-flex tw-flex-col tw-items-center tw-justify-center tw-p-4 tw-text-center">
10805
+ <cide-ele-icon class="tw-w-8 tw-h-8 tw-text-red-500 tw-mb-2">error</cide-ele-icon>
10806
+ <p class="tw-text-red-600 tw-font-medium">Failed to load component</p>
10807
+ <p class="tw-text-gray-500 tw-text-sm">Component "{{ container.config.componentId || container.config.id }}" is not available</p>
10808
+ <button
10809
+ cideEleButton
10810
+ variant="outline"
10811
+ size="xs"
10812
+ (click)="containerService.onClose(container.id)"
10813
+ class="tw-mt-2">
10814
+ Close
10815
+ </button>
10816
+ </div>
10817
+ }
10818
+ </cide-ele-floating-container>
10819
+ }
10332
10820
  ` }]
10333
10821
  }], ctorParameters: null, propDecorators: null }) });
10334
10822
 
@@ -10588,5 +11076,5 @@ var floatingContainerDynamic_directive = /*#__PURE__*/Object.freeze({
10588
11076
  * Generated bundle index. Do not edit.
10589
11077
  */
10590
11078
 
10591
- export { CideCoreFileManagerService, CideEleButtonComponent, CideEleConfirmationModalComponent, CideEleDataGridComponent, CideEleDropdownComponent, CideEleFileImageDirective, CideEleFileInputComponent, CideEleFileManagerService, CideEleFloatingContainerComponent, CideEleFloatingContainerDynamicDirective, CideEleFloatingContainerManagerComponent, CideEleFloatingContainerService, CideEleFloatingFeaturesService, CideEleFloatingFileUploaderComponent, CideEleFloatingFileUploaderService, CideEleGlobalNotificationsComponent, CideEleJsonEditorComponent, CideEleResizerDirective, CideEleSkeletonLoaderComponent, CideEleTabComponent, CideEleToastNotificationComponent, CideElementsService, CideIconComponent, CideInputComponent, CideSelectComponent, CideSelectOptionComponent, CideSpinnerComponent, CideTextareaComponent, ConfirmationService, CoreFileManagerInsertUpdatePayload, DEFAULT_GRID_CONFIG, DropdownManagerService, ICoreCyfmSave, MFileManager, NotificationService, TooltipDirective };
11079
+ export { CideCoreFileManagerService, CideEleButtonComponent, CideEleConfirmationModalComponent, CideEleDataGridComponent, CideEleDropdownComponent, CideEleFileImageDirective, CideEleFileInputComponent, CideEleFileManagerService, CideEleFloatingContainerComponent, CideEleFloatingContainerDynamicDirective, CideEleFloatingContainerManagerComponent, CideEleFloatingContainerService, CideEleFloatingFeaturesService, CideEleFloatingFileUploaderComponent, CideEleFloatingFileUploaderService, CideEleGlobalNotificationsComponent, CideEleJsonEditorComponent, CideEleResizerDirective, CideEleSkeletonLoaderComponent, CideEleTabComponent, CideEleToastNotificationComponent, CideElementsService, CideIconComponent, CideInputComponent, CideSelectComponent, CideSelectOptionComponent, CideSpinnerComponent, CideTextareaComponent, ConfirmationService, CoreFileManagerInsertUpdatePayload, DEFAULT_GRID_CONFIG, DropdownManagerService, FloatingContainerShortcutsService, ICoreCyfmSave, KeyboardShortcutService, MFileManager, NotificationService, TooltipDirective };
10592
11080
  //# sourceMappingURL=cloud-ide-element.mjs.map