@eclipse-docks/core 0.7.127 → 0.7.130

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 (85) hide show
  1. package/dist/api/index.js +3 -3
  2. package/dist/api/services.d.ts +3 -1
  3. package/dist/api/services.d.ts.map +1 -1
  4. package/dist/{api-Da9zQcfd.js → api-oPg3Bv1S.js} +243 -264
  5. package/dist/api-oPg3Bv1S.js.map +1 -0
  6. package/dist/components/attribution.d.ts +1 -0
  7. package/dist/components/attribution.d.ts.map +1 -1
  8. package/dist/components/command.d.ts +0 -1
  9. package/dist/components/command.d.ts.map +1 -1
  10. package/dist/components/extensions.d.ts +3 -0
  11. package/dist/components/extensions.d.ts.map +1 -1
  12. package/dist/components/language-selector.d.ts.map +1 -1
  13. package/dist/components/layout-switcher.d.ts +1 -1
  14. package/dist/components/layout-switcher.d.ts.map +1 -1
  15. package/dist/components/npm-packages.d.ts +1 -0
  16. package/dist/components/npm-packages.d.ts.map +1 -1
  17. package/dist/components/release-history.d.ts +9 -2
  18. package/dist/components/release-history.d.ts.map +1 -1
  19. package/dist/components/tasks.d.ts.map +1 -1
  20. package/dist/core/apploader.d.ts +2 -9
  21. package/dist/core/apploader.d.ts.map +1 -1
  22. package/dist/core/contribution-targets.d.ts +1 -0
  23. package/dist/core/contribution-targets.d.ts.map +1 -1
  24. package/dist/core/dialogservice.d.ts +3 -1
  25. package/dist/core/dialogservice.d.ts.map +1 -1
  26. package/dist/core/dropdown-item.d.ts +8 -0
  27. package/dist/core/dropdown-item.d.ts.map +1 -1
  28. package/dist/core/layout-panels.d.ts +25 -0
  29. package/dist/core/layout-panels.d.ts.map +1 -0
  30. package/dist/dialogs/navigable-info-dialog.d.ts.map +1 -1
  31. package/dist/dialogs/version-info-dialog.d.ts +18 -2
  32. package/dist/dialogs/version-info-dialog.d.ts.map +1 -1
  33. package/dist/externals/lit.js +1 -1
  34. package/dist/externals/webawesome.js +1 -1
  35. package/dist/index.js +3 -3
  36. package/dist/layouts/standard-layout.d.ts +9 -1
  37. package/dist/layouts/standard-layout.d.ts.map +1 -1
  38. package/dist/parts/contextmenu.d.ts.map +1 -1
  39. package/dist/parts/index.js +1 -1
  40. package/dist/parts/part.d.ts +2 -0
  41. package/dist/parts/part.d.ts.map +1 -1
  42. package/dist/parts/resizable-grid.d.ts +10 -3
  43. package/dist/parts/resizable-grid.d.ts.map +1 -1
  44. package/dist/parts/tabs.d.ts +6 -0
  45. package/dist/parts/tabs.d.ts.map +1 -1
  46. package/dist/{parts-CRVxaDd-.js → parts-CAt8aeU8.js} +1050 -586
  47. package/dist/parts-CAt8aeU8.js.map +1 -0
  48. package/dist/{webawesome-Y1_HnKa_.js → webawesome-BGXn04Mw.js} +18 -10
  49. package/dist/webawesome-BGXn04Mw.js.map +1 -0
  50. package/package.json +1 -1
  51. package/src/api/services.ts +12 -0
  52. package/src/components/attribution.ts +2 -0
  53. package/src/components/command.ts +2 -8
  54. package/src/components/extensions.ts +20 -3
  55. package/src/components/language-selector.ts +0 -1
  56. package/src/components/layout-switcher.ts +39 -26
  57. package/src/components/npm-packages.ts +2 -0
  58. package/src/components/release-history.ts +29 -40
  59. package/src/components/tasks.ts +0 -1
  60. package/src/contributions/default-layout-contributions.ts +7 -43
  61. package/src/contributions/default-ui-contributions.ts +4 -4
  62. package/src/core/apploader.ts +7 -54
  63. package/src/core/contribution-targets.ts +1 -0
  64. package/src/core/dialogservice.ts +76 -19
  65. package/src/core/dropdown-item.ts +52 -17
  66. package/src/core/layout-panels.ts +121 -0
  67. package/src/dialogs/navigable-info-dialog.ts +5 -2
  68. package/src/dialogs/version-info-dialog.ts +163 -21
  69. package/src/icons/icons.txt +4 -2
  70. package/src/icons/layout-standard-bottom-panel.svg +4 -4
  71. package/src/icons/layout-standard-full.svg +4 -4
  72. package/src/icons/layout-standard-left-aux.svg +8 -0
  73. package/src/icons/layout-standard-left-sidebar.svg +5 -0
  74. package/src/icons/layout-standard-right-aux.svg +8 -0
  75. package/src/icons/layout-standard-right-sidebar.svg +5 -0
  76. package/src/layouts/standard-layout.ts +81 -5
  77. package/src/parts/contextmenu.ts +2 -1
  78. package/src/parts/part.ts +24 -0
  79. package/src/parts/resizable-grid.ts +125 -57
  80. package/src/parts/tabs.ts +103 -0
  81. package/dist/api-Da9zQcfd.js.map +0 -1
  82. package/dist/parts-CRVxaDd-.js.map +0 -1
  83. package/dist/webawesome-Y1_HnKa_.js.map +0 -1
  84. package/src/icons/layout-standard-bottom-sidebar.svg +0 -6
  85. package/src/icons/layout-standard.svg +0 -6
@@ -46,10 +46,10 @@ export class DocksResizableGrid extends DocksElement {
46
46
  } | null = null;
47
47
 
48
48
  private resizeOverlay: HTMLDivElement | null = null;
49
- private childrenLoaded = false;
50
49
  private childStylesApplied = false;
51
50
  private mutationObserver?: MutationObserver;
52
- private settingsLoaded = false;
51
+ private refreshScheduled = false;
52
+ private layoutGeneration = 0;
53
53
 
54
54
  createRenderRoot() {
55
55
  // intentionally disabling shadow DOM for the resizable grid
@@ -59,87 +59,162 @@ export class DocksResizableGrid extends DocksElement {
59
59
  // ============= Lifecycle Methods =============
60
60
 
61
61
  protected doBeforeUI() {
62
- // Only set up observer if children not yet loaded
63
- if (!this.childrenLoaded) {
64
- // Use MutationObserver to detect when children are added
65
- this.mutationObserver = new MutationObserver(() => {
66
- if (!this.childrenLoaded) {
67
- this.loadChildren();
68
- }
69
- });
70
-
71
- this.mutationObserver.observe(this, { childList: true, subtree: false });
72
-
73
- // Also try to load immediately
74
- this.loadChildren();
62
+ this.mutationObserver = new MutationObserver(() => {
63
+ this.scheduleRefreshGridLayout();
64
+ });
65
+ this.mutationObserver.observe(this, { childList: true, subtree: false });
66
+ this.scheduleRefreshGridLayout();
67
+ }
68
+
69
+ private scheduleRefreshGridLayout() {
70
+ if (this.refreshScheduled) {
71
+ return;
75
72
  }
73
+ this.refreshScheduled = true;
74
+ queueMicrotask(() => {
75
+ this.refreshScheduled = false;
76
+ void this.refreshGridLayout();
77
+ });
76
78
  }
77
79
 
78
- private async loadChildren() {
79
- const potentialChildren = Array.from(this.children).filter(
80
- child => child.tagName !== 'STYLE' &&
81
- child.tagName !== 'SCRIPT' &&
82
- !child.classList.contains('resize-handle')
80
+ private getGridChildrenFromDom(): HTMLElement[] {
81
+ return Array.from(this.children).filter(
82
+ (child) =>
83
+ child.tagName !== 'STYLE' &&
84
+ child.tagName !== 'SCRIPT' &&
85
+ !child.classList.contains('resize-handle'),
83
86
  ) as HTMLElement[];
87
+ }
84
88
 
85
- if (potentialChildren.length === 0) {
86
- return;
89
+ private static isNestedResizableGrid(child: HTMLElement): boolean {
90
+ return child.tagName.toLowerCase() === 'docks-resizable-grid';
91
+ }
92
+
93
+ private applyChildLayoutStyles(): void {
94
+ this.gridChildren.forEach((child, index) => {
95
+ child.style.overflow = 'hidden';
96
+ child.style.height = '100%';
97
+ child.style.width = '100%';
98
+ child.style.gridColumn = this.orientation === 'horizontal' ? `${index * 2 + 1}` : '1';
99
+ child.style.gridRow = this.orientation === 'vertical' ? `${index * 2 + 1}` : '1';
100
+ if (!DocksResizableGrid.isNestedResizableGrid(child)) {
101
+ child.style.display = 'flex';
102
+ child.style.flexDirection = 'column';
103
+ }
104
+ });
105
+ }
106
+
107
+ private resolveGridSizes(childCount: number): string[] {
108
+ const parsedSizes = this.sizes?.split(',').map((s) => s.trim()).filter(Boolean) ?? [];
109
+ if (parsedSizes.length === childCount) {
110
+ return parsedSizes;
111
+ }
112
+ const equalSize = `${100 / childCount}%`;
113
+ return Array.from({ length: childCount }, () => equalSize);
114
+ }
115
+
116
+ private resolvePersistedSizes(persisted: unknown, childCount: number): string[] | null {
117
+ if (!persisted || typeof persisted !== 'object') {
118
+ return null;
87
119
  }
88
120
 
89
- // Mark as loaded and disconnect observer
90
- this.childrenLoaded = true;
91
- if (this.mutationObserver) {
92
- this.mutationObserver.disconnect();
93
- this.mutationObserver = undefined;
121
+ const record = persisted as {
122
+ sizes?: unknown;
123
+ sizesByCount?: Record<string, unknown>;
124
+ };
125
+ const byCount = record.sizesByCount?.[String(childCount)];
126
+ if (Array.isArray(byCount) && byCount.length === childCount && byCount.every((size) => typeof size === 'string')) {
127
+ return byCount;
128
+ }
129
+
130
+ if (Array.isArray(record.sizes) && record.sizes.length === childCount && record.sizes.every((size) => typeof size === 'string')) {
131
+ return record.sizes;
132
+ }
133
+
134
+ return null;
135
+ }
136
+
137
+ private async refreshGridLayout() {
138
+ const generation = ++this.layoutGeneration;
139
+ const potentialChildren = this.getGridChildrenFromDom();
140
+ if (potentialChildren.length === 0) {
141
+ this.gridChildren = [];
142
+ this.gridSizes = [];
143
+ this.childStylesApplied = false;
144
+ this.requestUpdate();
145
+ return;
94
146
  }
95
147
 
96
- // Store children references
148
+ const countChanged = potentialChildren.length !== this.gridChildren.length;
149
+ const identityChanged = countChanged
150
+ || potentialChildren.some((child, index) => child !== this.gridChildren[index]);
97
151
  this.gridChildren = potentialChildren;
98
152
 
99
- // Load persisted sizes once if available
100
- if (!this.settingsLoaded) {
101
- this.settingsLoaded = true;
102
- const persisted = await this.getDialogSetting();
103
- if (persisted && Array.isArray(persisted.sizes) && persisted.sizes.length === this.gridChildren.length) {
104
- this.gridSizes = persisted.sizes;
105
- this.requestUpdate();
106
- return;
107
- }
153
+ const persisted = await this.getDialogSetting();
154
+ if (generation !== this.layoutGeneration) {
155
+ return;
108
156
  }
109
157
 
110
- // Use sizes attribute or equal distribution (only if not restored from settings)
111
- if (this.sizes) {
112
- this.gridSizes = this.sizes.split(',').map(s => s.trim());
113
- } else {
114
- const equalSize = `${100 / this.gridChildren.length}%`;
115
- this.gridSizes = this.gridChildren.map(() => equalSize);
158
+ const restoredSizes = this.resolvePersistedSizes(persisted, this.gridChildren.length);
159
+ if (restoredSizes) {
160
+ const sizesChanged = restoredSizes.join('|') !== this.gridSizes.join('|');
161
+ this.gridSizes = restoredSizes;
162
+ if (identityChanged || sizesChanged) {
163
+ this.childStylesApplied = false;
164
+ }
165
+ this.requestUpdate();
166
+ return;
116
167
  }
117
168
 
169
+ const nextSizes = this.resolveGridSizes(this.gridChildren.length);
170
+ const sizesChanged = nextSizes.join('|') !== this.gridSizes.join('|');
171
+ this.gridSizes = nextSizes;
172
+
173
+ if (identityChanged || sizesChanged) {
174
+ this.childStylesApplied = false;
175
+ }
118
176
  this.requestUpdate();
119
177
  }
120
178
 
179
+ protected doInitUI() {
180
+ this.scheduleRefreshGridLayout();
181
+ }
182
+
121
183
  private async saveSizes() {
122
184
  if (this.gridSizes.length === 0) {
123
185
  return;
124
186
  }
125
187
 
188
+ const persisted = await this.getDialogSetting();
189
+ const existingByCount = persisted && typeof persisted === 'object'
190
+ ? (persisted as { sizesByCount?: Record<string, string[]> }).sizesByCount ?? {}
191
+ : {};
192
+
126
193
  await this.setDialogSetting({
127
194
  sizes: this.gridSizes,
128
- orientation: this.orientation
195
+ sizesByCount: {
196
+ ...existingByCount,
197
+ [String(this.gridSizes.length)]: this.gridSizes,
198
+ },
199
+ orientation: this.orientation,
129
200
  });
130
201
  }
131
202
 
132
203
  updated(changedProperties: Map<string, any>) {
133
204
  super.updated(changedProperties);
134
-
205
+
206
+ if (changedProperties.has('sizes')) {
207
+ this.scheduleRefreshGridLayout();
208
+ }
209
+
135
210
  // Only apply child styles once when children are first loaded
136
211
  // This prevents interfering with nested resizable grids during resize operations
137
- if (changedProperties.has('gridChildren') && !this.childStylesApplied && this.gridChildren.length > 0) {
212
+ if (!this.childStylesApplied && this.gridChildren.length > 0) {
138
213
  this.childStylesApplied = true;
139
-
214
+
140
215
  /**
141
216
  * Direct style manipulation is intentionally used here.
142
- *
217
+ *
143
218
  * Reasoning:
144
219
  * - Grid positioning (gridColumn/gridRow) must be computed dynamically based on
145
220
  * the number of children and orientation at runtime
@@ -149,16 +224,9 @@ export class DocksResizableGrid extends DocksElement {
149
224
  * (e.g., child at index 0 → column 1, index 1 → column 3, etc.)
150
225
  * - This is a layout container whose primary job is to programmatically position
151
226
  * its children within a CSS grid system
227
+ * - Nested resizable grids manage their own display mode and must not receive flex
152
228
  */
153
- this.gridChildren.forEach((child, index) => {
154
- child.style.overflow = 'hidden';
155
- child.style.height = '100%';
156
- child.style.width = '100%';
157
- child.style.gridColumn = this.orientation === 'horizontal' ? `${index * 2 + 1}` : '1';
158
- child.style.gridRow = this.orientation === 'vertical' ? `${index * 2 + 1}` : '1';
159
- child.style.display = 'flex';
160
- child.style.flexDirection = 'column';
161
- });
229
+ this.applyChildLayoutStyles();
162
230
  }
163
231
  }
164
232
 
package/src/parts/tabs.ts CHANGED
@@ -45,6 +45,14 @@ export class DocksTabs extends DocksContainer {
45
45
  @property({ type: Boolean, reflect: true, attribute: 'hide-tabs' })
46
46
  hideTabs: boolean = false;
47
47
 
48
+ /** Size to tab content instead of filling the parent height (e.g. About dialog). */
49
+ @property({ type: Boolean, reflect: true, attribute: 'fit-content' })
50
+ fitContent: boolean = false;
51
+
52
+ /** Fill a fixed-height parent; tab body scrolls instead of resizing the container. */
53
+ @property({ type: Boolean, reflect: true, attribute: 'fill-height' })
54
+ fillHeight: boolean = false;
55
+
48
56
  /** Tab and nav-toolbar control sizing (`s` | `m` | `l`). */
49
57
  @property({ reflect: true, attribute: 'item-size' })
50
58
  itemSize: 's' | 'm' | 'l' = 'm';
@@ -129,6 +137,12 @@ export class DocksTabs extends DocksContainer {
129
137
  return this.tabGroup.value.getAttribute("active");
130
138
  }
131
139
 
140
+ public getTabPart(tabName: string): DocksPart | null {
141
+ const tabPanel = this.getTabPanel(tabName);
142
+ if (!tabPanel) return null;
143
+ return this.getPartFromPanel(tabPanel);
144
+ }
145
+
132
146
  open(contribution: TabContribution): void {
133
147
  const existing = this.contributions.find(c => c.name === contribution.name);
134
148
  if (existing) {
@@ -472,6 +486,95 @@ export class DocksTabs extends DocksContainer {
472
486
  width: 100%;
473
487
  }
474
488
 
489
+ :host([fit-content]) {
490
+ display: flex;
491
+ flex-direction: column;
492
+ height: auto;
493
+ max-height: 100%;
494
+ min-height: 0;
495
+ }
496
+
497
+ :host([fit-content]) wa-tab-group {
498
+ display: flex;
499
+ flex-direction: column;
500
+ flex: 1 1 auto;
501
+ min-height: 0;
502
+ height: auto;
503
+ max-height: 100%;
504
+ }
505
+
506
+ :host([fit-content]) wa-tab-group::part(base) {
507
+ display: flex;
508
+ flex-direction: column;
509
+ flex: 1 1 auto;
510
+ min-height: 0;
511
+ max-height: 100%;
512
+ height: auto;
513
+ }
514
+
515
+ :host([fit-content]) wa-tab-group::part(body) {
516
+ flex: 1 1 auto;
517
+ min-height: 0;
518
+ height: auto;
519
+ overflow-x: hidden;
520
+ overflow-y: auto;
521
+ }
522
+
523
+ :host([fit-content]) wa-tab-panel[active] {
524
+ display: block;
525
+ height: auto;
526
+ overflow: visible;
527
+ }
528
+
529
+ :host([fit-content]) wa-tab-panel > * {
530
+ height: auto;
531
+ min-height: 0;
532
+ }
533
+
534
+ :host([fill-height]) {
535
+ display: flex;
536
+ flex-direction: column;
537
+ height: 100%;
538
+ min-height: 0;
539
+ max-height: 100%;
540
+ }
541
+
542
+ :host([fill-height]) wa-tab-group {
543
+ display: flex;
544
+ flex-direction: column;
545
+ flex: 1 1 auto;
546
+ min-height: 0;
547
+ height: 100%;
548
+ max-height: 100%;
549
+ }
550
+
551
+ :host([fill-height]) wa-tab-group::part(base) {
552
+ display: flex;
553
+ flex-direction: column;
554
+ flex: 1 1 auto;
555
+ min-height: 0;
556
+ max-height: 100%;
557
+ height: 100%;
558
+ }
559
+
560
+ :host([fill-height]) wa-tab-group::part(body) {
561
+ flex: 1 1 auto;
562
+ min-height: 0;
563
+ overflow-x: hidden;
564
+ overflow-y: auto;
565
+ }
566
+
567
+ :host([fill-height]) wa-tab-panel[active] {
568
+ display: block;
569
+ height: auto;
570
+ overflow: visible;
571
+ }
572
+
573
+ :host([fill-height]) wa-tab-panel > * {
574
+ height: auto;
575
+ min-height: 0;
576
+ }
577
+
475
578
  wa-tab-group {
476
579
  height: 100%;
477
580
  width: 100%;