@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.
- package/dist/api/index.js +7 -7
- package/dist/api/services.d.ts +3 -1
- package/dist/api/services.d.ts.map +1 -1
- package/dist/{api-Da9zQcfd.js → api-DImisUWV.js} +296 -305
- package/dist/api-DImisUWV.js.map +1 -0
- package/dist/assets/{js-runtime-worker-DAva_aXx.js.map → js-runtime-worker-X93bOre4.js.map} +1 -1
- package/dist/components/attribution.d.ts +1 -0
- package/dist/components/attribution.d.ts.map +1 -1
- package/dist/components/command.d.ts +0 -1
- package/dist/components/command.d.ts.map +1 -1
- package/dist/components/extensions.d.ts +3 -0
- package/dist/components/extensions.d.ts.map +1 -1
- package/dist/components/language-selector.d.ts.map +1 -1
- package/dist/components/layout-switcher.d.ts +1 -1
- package/dist/components/layout-switcher.d.ts.map +1 -1
- package/dist/components/npm-packages.d.ts +1 -0
- package/dist/components/npm-packages.d.ts.map +1 -1
- package/dist/components/release-history.d.ts +9 -2
- package/dist/components/release-history.d.ts.map +1 -1
- package/dist/components/tasks.d.ts.map +1 -1
- package/dist/core/apploader.d.ts +2 -9
- package/dist/core/apploader.d.ts.map +1 -1
- package/dist/core/contribution-targets.d.ts +1 -0
- package/dist/core/contribution-targets.d.ts.map +1 -1
- package/dist/core/dialogservice.d.ts +3 -1
- package/dist/core/dialogservice.d.ts.map +1 -1
- package/dist/core/dropdown-item.d.ts +8 -0
- package/dist/core/dropdown-item.d.ts.map +1 -1
- package/dist/core/events.js +1 -1
- package/dist/core/layout-panels.d.ts +25 -0
- package/dist/core/layout-panels.d.ts.map +1 -0
- package/dist/dialogs/navigable-info-dialog.d.ts.map +1 -1
- package/dist/dialogs/version-info-dialog.d.ts +18 -2
- package/dist/dialogs/version-info-dialog.d.ts.map +1 -1
- package/dist/{events-B_ZxkU_G.js → events-BAE5R6TH.js} +1 -1
- package/dist/{events-B_ZxkU_G.js.map → events-BAE5R6TH.js.map} +1 -1
- package/dist/{extensions.de-Ct1DIybE.js → extensions.de-O6Sx3_t4.js} +1 -1
- package/dist/{extensions.de-Ct1DIybE.js.map → extensions.de-O6Sx3_t4.js.map} +1 -1
- package/dist/{extensions.en-DRPFtVHT.js → extensions.en-fwqJr8P-.js} +1 -1
- package/dist/{extensions.en-DRPFtVHT.js.map → extensions.en-fwqJr8P-.js.map} +1 -1
- package/dist/externals/lit.js +1 -1
- package/dist/externals/third-party.js.map +1 -1
- package/dist/externals/webawesome.js +1 -1
- package/dist/{fastviews.de-BFxFslBz.js → fastviews.de-C-B48vwv.js} +1 -1
- package/dist/fastviews.de-C-B48vwv.js.map +1 -0
- package/dist/{fastviews.en-Cb4J_JXL.js → fastviews.en-BlAxYlHD.js} +1 -1
- package/dist/fastviews.en-BlAxYlHD.js.map +1 -0
- package/dist/{filebrowser.de-GEf6Eilh.js → filebrowser.de-LWsrI9xj.js} +1 -1
- package/dist/{filebrowser.de-GEf6Eilh.js.map → filebrowser.de-LWsrI9xj.js.map} +1 -1
- package/dist/{filebrowser.en-o0Ad5f7Z.js → filebrowser.en-C02vpzAs.js} +1 -1
- package/dist/{filebrowser.en-o0Ad5f7Z.js.map → filebrowser.en-C02vpzAs.js.map} +1 -1
- package/dist/{fs-access-DTXPsV1W.js → fs-access-Cjcg0_Me.js} +27 -25
- package/dist/{fs-access-DTXPsV1W.js.map → fs-access-Cjcg0_Me.js.map} +1 -1
- package/dist/fs-access-Dp9Fwsxk.js +2 -0
- package/dist/index.js +7 -7
- package/dist/layouts/standard-layout.d.ts +9 -1
- package/dist/layouts/standard-layout.d.ts.map +1 -1
- package/dist/{logger-DT0_NW3S.js → logger-CiT0Cc4g.js} +1 -1
- package/dist/{logger-DT0_NW3S.js.map → logger-CiT0Cc4g.js.map} +1 -1
- package/dist/{logterminal.de-DKp940Ox.js → logterminal.de-BP1FuxHH.js} +1 -1
- package/dist/{logterminal.de-DKp940Ox.js.map → logterminal.de-BP1FuxHH.js.map} +1 -1
- package/dist/{logterminal.en-Ci2nm0b2.js → logterminal.en-BeDRvTvb.js} +1 -1
- package/dist/{logterminal.en-Ci2nm0b2.js.map → logterminal.en-BeDRvTvb.js.map} +1 -1
- package/dist/{partname.de-v76uEl0F.js → partname.de-C0I4Wf2X.js} +1 -1
- package/dist/{partname.de-v76uEl0F.js.map → partname.de-C0I4Wf2X.js.map} +1 -1
- package/dist/{partname.en-By5aAawT.js → partname.en-CIT8z3cY.js} +1 -1
- package/dist/{partname.en-By5aAawT.js.map → partname.en-CIT8z3cY.js.map} +1 -1
- package/dist/parts/contextmenu.d.ts.map +1 -1
- package/dist/parts/index.js +1 -1
- package/dist/parts/part.d.ts +2 -0
- package/dist/parts/part.d.ts.map +1 -1
- package/dist/parts/resizable-grid.d.ts +10 -3
- package/dist/parts/resizable-grid.d.ts.map +1 -1
- package/dist/parts/tabs.d.ts +6 -0
- package/dist/parts/tabs.d.ts.map +1 -1
- package/dist/{parts-CRVxaDd-.js → parts-DQRktiiR.js} +1086 -611
- package/dist/parts-DQRktiiR.js.map +1 -0
- package/dist/{tasks.de-y2xPmQ1k.js → tasks.de-DRvUVugd.js} +1 -1
- package/dist/{tasks.de-y2xPmQ1k.js.map → tasks.de-DRvUVugd.js.map} +1 -1
- package/dist/{tasks.en-BTbFrxJj.js → tasks.en-dRDildBd.js} +1 -1
- package/dist/{tasks.en-BTbFrxJj.js.map → tasks.en-dRDildBd.js.map} +1 -1
- package/dist/vite-plugin-app-splash.js.map +1 -1
- package/dist/vite-plugin-local-aliases.js +1 -1
- package/dist/vite-plugin-local-aliases.js.map +1 -1
- package/dist/vite-plugin-resolve-deps.d.ts +6 -3
- package/dist/vite-plugin-resolve-deps.d.ts.map +1 -1
- package/dist/vite-plugin-resolve-deps.js +17 -15
- package/dist/vite-plugin-resolve-deps.js.map +1 -1
- package/dist/{webawesome-Y1_HnKa_.js → webawesome-C0Da7hPu.js} +19 -11
- package/dist/webawesome-C0Da7hPu.js.map +1 -0
- package/dist/{widget-BqQtioK1.js → widget-DUR6wxME.js} +6 -5
- package/dist/{widget-BqQtioK1.js.map → widget-DUR6wxME.js.map} +1 -1
- package/dist/widgets/index.js +1 -1
- package/dist/{widgets-C9V42Mqq.js → widgets-A9XMOA_j.js} +2 -2
- package/dist/{widgets-C9V42Mqq.js.map → widgets-A9XMOA_j.js.map} +1 -1
- package/package.json +1 -1
- package/src/api/services.ts +12 -0
- package/src/components/attribution.ts +2 -0
- package/src/components/command.ts +2 -8
- package/src/components/extensions.ts +20 -3
- package/src/components/language-selector.ts +0 -1
- package/src/components/layout-switcher.ts +39 -26
- package/src/components/npm-packages.ts +2 -0
- package/src/components/release-history.ts +29 -40
- package/src/components/tasks.ts +0 -1
- package/src/contributions/default-layout-contributions.ts +7 -43
- package/src/contributions/default-ui-contributions.ts +4 -4
- package/src/core/apploader.ts +7 -54
- package/src/core/contribution-targets.ts +1 -0
- package/src/core/dialogservice.ts +76 -19
- package/src/core/dropdown-item.ts +52 -17
- package/src/core/extensionregistry.ts +1 -1
- package/src/core/layout-panels.ts +121 -0
- package/src/dialogs/navigable-info-dialog.ts +5 -2
- package/src/dialogs/version-info-dialog.ts +163 -21
- package/src/icons/icons.txt +4 -2
- package/src/icons/layout-standard-bottom-panel.svg +4 -4
- package/src/icons/layout-standard-full.svg +4 -4
- package/src/icons/layout-standard-left-aux.svg +8 -0
- package/src/icons/layout-standard-left-sidebar.svg +5 -0
- package/src/icons/layout-standard-right-aux.svg +8 -0
- package/src/icons/layout-standard-right-sidebar.svg +5 -0
- package/src/layouts/standard-layout.ts +81 -5
- package/src/parts/contextmenu.ts +2 -1
- package/src/parts/part.ts +24 -0
- package/src/parts/resizable-grid.ts +125 -57
- package/src/parts/tabs.ts +103 -0
- package/src/vite-plugin-resolve-deps.ts +29 -25
- package/dist/api-Da9zQcfd.js.map +0 -1
- package/dist/fastviews.de-BFxFslBz.js.map +0 -1
- package/dist/fastviews.en-Cb4J_JXL.js.map +0 -1
- package/dist/fs-access-CzOh5ot8.js +0 -2
- package/dist/parts-CRVxaDd-.js.map +0 -1
- package/dist/webawesome-Y1_HnKa_.js.map +0 -1
- package/src/icons/layout-standard-bottom-sidebar.svg +0 -6
- 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
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
|
79
|
-
|
|
80
|
-
child =>
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
86
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
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
|
-
|
|
100
|
-
if (
|
|
101
|
-
|
|
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
|
-
|
|
111
|
-
if (
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
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 (
|
|
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.
|
|
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;
|
|
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
|
|
144
|
-
* `import 'virtual:eclipse-docks-extension-imports'`
|
|
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
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
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
|
}
|