@eclipse-docks/core 0.7.127 → 0.7.132

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 (136) hide show
  1. package/dist/api/index.js +7 -7
  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-DImisUWV.js} +296 -305
  5. package/dist/api-DImisUWV.js.map +1 -0
  6. package/dist/assets/{js-runtime-worker-DAva_aXx.js.map → js-runtime-worker-X93bOre4.js.map} +1 -1
  7. package/dist/components/attribution.d.ts +1 -0
  8. package/dist/components/attribution.d.ts.map +1 -1
  9. package/dist/components/command.d.ts +0 -1
  10. package/dist/components/command.d.ts.map +1 -1
  11. package/dist/components/extensions.d.ts +3 -0
  12. package/dist/components/extensions.d.ts.map +1 -1
  13. package/dist/components/language-selector.d.ts.map +1 -1
  14. package/dist/components/layout-switcher.d.ts +1 -1
  15. package/dist/components/layout-switcher.d.ts.map +1 -1
  16. package/dist/components/npm-packages.d.ts +1 -0
  17. package/dist/components/npm-packages.d.ts.map +1 -1
  18. package/dist/components/release-history.d.ts +9 -2
  19. package/dist/components/release-history.d.ts.map +1 -1
  20. package/dist/components/tasks.d.ts.map +1 -1
  21. package/dist/core/apploader.d.ts +2 -9
  22. package/dist/core/apploader.d.ts.map +1 -1
  23. package/dist/core/contribution-targets.d.ts +1 -0
  24. package/dist/core/contribution-targets.d.ts.map +1 -1
  25. package/dist/core/dialogservice.d.ts +3 -1
  26. package/dist/core/dialogservice.d.ts.map +1 -1
  27. package/dist/core/dropdown-item.d.ts +8 -0
  28. package/dist/core/dropdown-item.d.ts.map +1 -1
  29. package/dist/core/events.js +1 -1
  30. package/dist/core/layout-panels.d.ts +25 -0
  31. package/dist/core/layout-panels.d.ts.map +1 -0
  32. package/dist/dialogs/navigable-info-dialog.d.ts.map +1 -1
  33. package/dist/dialogs/version-info-dialog.d.ts +18 -2
  34. package/dist/dialogs/version-info-dialog.d.ts.map +1 -1
  35. package/dist/{events-B_ZxkU_G.js → events-BAE5R6TH.js} +1 -1
  36. package/dist/{events-B_ZxkU_G.js.map → events-BAE5R6TH.js.map} +1 -1
  37. package/dist/{extensions.de-Ct1DIybE.js → extensions.de-O6Sx3_t4.js} +1 -1
  38. package/dist/{extensions.de-Ct1DIybE.js.map → extensions.de-O6Sx3_t4.js.map} +1 -1
  39. package/dist/{extensions.en-DRPFtVHT.js → extensions.en-fwqJr8P-.js} +1 -1
  40. package/dist/{extensions.en-DRPFtVHT.js.map → extensions.en-fwqJr8P-.js.map} +1 -1
  41. package/dist/externals/lit.js +1 -1
  42. package/dist/externals/third-party.js.map +1 -1
  43. package/dist/externals/webawesome.js +1 -1
  44. package/dist/{fastviews.de-BFxFslBz.js → fastviews.de-C-B48vwv.js} +1 -1
  45. package/dist/fastviews.de-C-B48vwv.js.map +1 -0
  46. package/dist/{fastviews.en-Cb4J_JXL.js → fastviews.en-BlAxYlHD.js} +1 -1
  47. package/dist/fastviews.en-BlAxYlHD.js.map +1 -0
  48. package/dist/{filebrowser.de-GEf6Eilh.js → filebrowser.de-LWsrI9xj.js} +1 -1
  49. package/dist/{filebrowser.de-GEf6Eilh.js.map → filebrowser.de-LWsrI9xj.js.map} +1 -1
  50. package/dist/{filebrowser.en-o0Ad5f7Z.js → filebrowser.en-C02vpzAs.js} +1 -1
  51. package/dist/{filebrowser.en-o0Ad5f7Z.js.map → filebrowser.en-C02vpzAs.js.map} +1 -1
  52. package/dist/{fs-access-DTXPsV1W.js → fs-access-Cjcg0_Me.js} +27 -25
  53. package/dist/{fs-access-DTXPsV1W.js.map → fs-access-Cjcg0_Me.js.map} +1 -1
  54. package/dist/fs-access-Dp9Fwsxk.js +2 -0
  55. package/dist/index.js +7 -7
  56. package/dist/layouts/standard-layout.d.ts +9 -1
  57. package/dist/layouts/standard-layout.d.ts.map +1 -1
  58. package/dist/{logger-DT0_NW3S.js → logger-CiT0Cc4g.js} +1 -1
  59. package/dist/{logger-DT0_NW3S.js.map → logger-CiT0Cc4g.js.map} +1 -1
  60. package/dist/{logterminal.de-DKp940Ox.js → logterminal.de-BP1FuxHH.js} +1 -1
  61. package/dist/{logterminal.de-DKp940Ox.js.map → logterminal.de-BP1FuxHH.js.map} +1 -1
  62. package/dist/{logterminal.en-Ci2nm0b2.js → logterminal.en-BeDRvTvb.js} +1 -1
  63. package/dist/{logterminal.en-Ci2nm0b2.js.map → logterminal.en-BeDRvTvb.js.map} +1 -1
  64. package/dist/{partname.de-v76uEl0F.js → partname.de-C0I4Wf2X.js} +1 -1
  65. package/dist/{partname.de-v76uEl0F.js.map → partname.de-C0I4Wf2X.js.map} +1 -1
  66. package/dist/{partname.en-By5aAawT.js → partname.en-CIT8z3cY.js} +1 -1
  67. package/dist/{partname.en-By5aAawT.js.map → partname.en-CIT8z3cY.js.map} +1 -1
  68. package/dist/parts/contextmenu.d.ts.map +1 -1
  69. package/dist/parts/index.js +1 -1
  70. package/dist/parts/part.d.ts +2 -0
  71. package/dist/parts/part.d.ts.map +1 -1
  72. package/dist/parts/resizable-grid.d.ts +10 -3
  73. package/dist/parts/resizable-grid.d.ts.map +1 -1
  74. package/dist/parts/tabs.d.ts +6 -0
  75. package/dist/parts/tabs.d.ts.map +1 -1
  76. package/dist/{parts-CRVxaDd-.js → parts-DQRktiiR.js} +1086 -611
  77. package/dist/parts-DQRktiiR.js.map +1 -0
  78. package/dist/{tasks.de-y2xPmQ1k.js → tasks.de-DRvUVugd.js} +1 -1
  79. package/dist/{tasks.de-y2xPmQ1k.js.map → tasks.de-DRvUVugd.js.map} +1 -1
  80. package/dist/{tasks.en-BTbFrxJj.js → tasks.en-dRDildBd.js} +1 -1
  81. package/dist/{tasks.en-BTbFrxJj.js.map → tasks.en-dRDildBd.js.map} +1 -1
  82. package/dist/vite-plugin-app-splash.js.map +1 -1
  83. package/dist/vite-plugin-local-aliases.js +1 -1
  84. package/dist/vite-plugin-local-aliases.js.map +1 -1
  85. package/dist/vite-plugin-resolve-deps.d.ts +6 -3
  86. package/dist/vite-plugin-resolve-deps.d.ts.map +1 -1
  87. package/dist/vite-plugin-resolve-deps.js +17 -15
  88. package/dist/vite-plugin-resolve-deps.js.map +1 -1
  89. package/dist/{webawesome-Y1_HnKa_.js → webawesome-C0Da7hPu.js} +19 -11
  90. package/dist/webawesome-C0Da7hPu.js.map +1 -0
  91. package/dist/{widget-BqQtioK1.js → widget-DUR6wxME.js} +6 -5
  92. package/dist/{widget-BqQtioK1.js.map → widget-DUR6wxME.js.map} +1 -1
  93. package/dist/widgets/index.js +1 -1
  94. package/dist/{widgets-C9V42Mqq.js → widgets-A9XMOA_j.js} +2 -2
  95. package/dist/{widgets-C9V42Mqq.js.map → widgets-A9XMOA_j.js.map} +1 -1
  96. package/package.json +1 -1
  97. package/src/api/services.ts +12 -0
  98. package/src/components/attribution.ts +2 -0
  99. package/src/components/command.ts +2 -8
  100. package/src/components/extensions.ts +20 -3
  101. package/src/components/language-selector.ts +0 -1
  102. package/src/components/layout-switcher.ts +39 -26
  103. package/src/components/npm-packages.ts +2 -0
  104. package/src/components/release-history.ts +29 -40
  105. package/src/components/tasks.ts +0 -1
  106. package/src/contributions/default-layout-contributions.ts +7 -43
  107. package/src/contributions/default-ui-contributions.ts +4 -4
  108. package/src/core/apploader.ts +7 -54
  109. package/src/core/contribution-targets.ts +1 -0
  110. package/src/core/dialogservice.ts +76 -19
  111. package/src/core/dropdown-item.ts +52 -17
  112. package/src/core/extensionregistry.ts +1 -1
  113. package/src/core/layout-panels.ts +121 -0
  114. package/src/dialogs/navigable-info-dialog.ts +5 -2
  115. package/src/dialogs/version-info-dialog.ts +163 -21
  116. package/src/icons/icons.txt +4 -2
  117. package/src/icons/layout-standard-bottom-panel.svg +4 -4
  118. package/src/icons/layout-standard-full.svg +4 -4
  119. package/src/icons/layout-standard-left-aux.svg +8 -0
  120. package/src/icons/layout-standard-left-sidebar.svg +5 -0
  121. package/src/icons/layout-standard-right-aux.svg +8 -0
  122. package/src/icons/layout-standard-right-sidebar.svg +5 -0
  123. package/src/layouts/standard-layout.ts +81 -5
  124. package/src/parts/contextmenu.ts +2 -1
  125. package/src/parts/part.ts +24 -0
  126. package/src/parts/resizable-grid.ts +125 -57
  127. package/src/parts/tabs.ts +103 -0
  128. package/src/vite-plugin-resolve-deps.ts +29 -25
  129. package/dist/api-Da9zQcfd.js.map +0 -1
  130. package/dist/fastviews.de-BFxFslBz.js.map +0 -1
  131. package/dist/fastviews.en-Cb4J_JXL.js.map +0 -1
  132. package/dist/fs-access-CzOh5ot8.js +0 -2
  133. package/dist/parts-CRVxaDd-.js.map +0 -1
  134. package/dist/webawesome-Y1_HnKa_.js.map +0 -1
  135. package/src/icons/layout-standard-bottom-sidebar.svg +0 -6
  136. 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%;
@@ -103,20 +103,29 @@ export function resolveDepVersions(
103
103
 
104
104
  const RESOLVED_PACKAGE_INFO_KEY = '__RESOLVED_PACKAGE_INFO__';
105
105
 
106
- /** Virtual module id; injected into `index.html` before `main.ts` when extension side-effects are enabled. */
106
+ /** Virtual module id; prepended to `src/main.ts` when extension side-effects are enabled. */
107
107
  export const VIRTUAL_EXTENSION_IMPORTS = 'virtual:eclipse-docks-extension-imports';
108
108
 
109
109
  const RESOLVED_VIRTUAL_EXTENSION_IMPORTS = `\0${VIRTUAL_EXTENSION_IMPORTS}`;
110
110
 
111
+ /** App entry module transformed by {@link resolveDepVersionsPlugin}. */
112
+ const MAIN_TS_MODULE_RE = /[/\\]src[/\\]main\.ts$/;
113
+
114
+ const EXTENSION_IMPORT_STATEMENT = `import ${JSON.stringify(VIRTUAL_EXTENSION_IMPORTS)};\n`;
115
+
116
+ /** Prepends the virtual extension side-effect import when not already present. */
117
+ export function prependExtensionSideEffectImport(code: string): string {
118
+ if (code.includes(VIRTUAL_EXTENSION_IMPORTS)) {
119
+ return code;
120
+ }
121
+ return EXTENSION_IMPORT_STATEMENT + code;
122
+ }
123
+
111
124
  /** Unscoped `extension-*` or scoped `@namespace/extension-*` (any npm scope). */
112
125
  const DEFAULT_EXTENSION_PATTERN = /^(?:@[^/]+\/)?extension-/;
113
126
 
114
127
  const DEFAULT_PRIORITY_FIRST = ['@eclipse-docks/extension-pwa', 'extension-pwa'];
115
128
 
116
- /** Matches Vite’s default app entry in index.html. */
117
- const MAIN_TS_SCRIPT_RE =
118
- /<script\b[^>]*\btype\s*=\s*["']module["'][^>]*\bsrc\s*=\s*["'][^"']*\/src\/main\.ts["'][^>]*>\s*<\/script>/i;
119
-
120
129
  export interface ExtensionSideEffectsOptions {
121
130
  /**
122
131
  * When false, disables automatic extension side-effect imports. Omitted or true keeps them on.
@@ -140,8 +149,9 @@ export type ResolveDepVersionsPluginOptions = {
140
149
  includeDevDependencies?: boolean;
141
150
  /**
142
151
  * By default, registers a virtual module that side-effect-imports every matching direct
143
- * `dependencies` entry (see `ExtensionSideEffectsOptions`), and injects
144
- * `import 'virtual:eclipse-docks-extension-imports'` into `index.html` **before** `/src/main.ts`.
152
+ * `dependencies` entry (see `ExtensionSideEffectsOptions`), and prepends
153
+ * `import 'virtual:eclipse-docks-extension-imports'` to `src/main.ts` so extension
154
+ * registration completes before `registerApp({ autoStart: true })`.
145
155
  * Pass `false` or `{ enabled: false }` to disable.
146
156
  */
147
157
  extensionSideEffects?: boolean | ExtensionSideEffectsOptions;
@@ -287,24 +297,18 @@ export function resolveDepVersionsPlugin(
287
297
  }
288
298
  return extensionImportPackages.map((pkg) => `import ${JSON.stringify(pkg)};\n`).join('');
289
299
  },
290
- transformIndexHtml: {
291
- order: 'pre',
292
- handler(html) {
293
- if (!extensionSideEffectsActive) {
294
- return html;
295
- }
296
- if (extensionImportPackages.length === 0) {
297
- return html;
298
- }
299
- if (html.includes(VIRTUAL_EXTENSION_IMPORTS)) {
300
- return html;
301
- }
302
- if (!MAIN_TS_SCRIPT_RE.test(html)) {
303
- return html;
304
- }
305
- const inject = `<script type="module">import ${JSON.stringify(VIRTUAL_EXTENSION_IMPORTS)};</script>\n`;
306
- return html.replace(MAIN_TS_SCRIPT_RE, (match) => `${inject}${match}`);
307
- },
300
+ transform(code, id) {
301
+ if (!extensionSideEffectsActive || extensionImportPackages.length === 0) {
302
+ return null;
303
+ }
304
+ if (!MAIN_TS_MODULE_RE.test(id)) {
305
+ return null;
306
+ }
307
+ const next = prependExtensionSideEffectImport(code);
308
+ if (next === code) {
309
+ return null;
310
+ }
311
+ return next;
308
312
  },
309
313
  };
310
314
  }