anentrypoint-design 0.0.77 → 0.0.78
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/package.json +1 -1
- package/src/desktop/shell.js +28 -1
- package/src/desktop/theme.css +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anentrypoint-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.78",
|
|
4
4
|
"description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/247420.js",
|
package/src/desktop/shell.js
CHANGED
|
@@ -140,11 +140,23 @@ export function createDesktopShell({ root = document.body, wm, registry, brand =
|
|
|
140
140
|
const clockTimer = setInterval(tickClock, 30000);
|
|
141
141
|
|
|
142
142
|
let activeContext = null;
|
|
143
|
+
let activeInstanceId = null;
|
|
143
144
|
function setContext(ctx) { activeContext = ctx; }
|
|
144
145
|
|
|
146
|
+
function applyInstanceFilter() {
|
|
147
|
+
if (!activeInstanceId) return;
|
|
148
|
+
for (const wEl of document.querySelectorAll('.wm-win[data-instance-id]')) {
|
|
149
|
+
const wInst = wEl.dataset.instanceId;
|
|
150
|
+
wEl.style.display = (wInst === activeInstanceId) ? '' : 'none';
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
145
154
|
function refreshTaskbar() {
|
|
146
155
|
taskbar.innerHTML = '';
|
|
147
156
|
for (const w of wm.list()) {
|
|
157
|
+
const wEl = document.querySelector('.wm-win[data-id="' + w.id + '"]');
|
|
158
|
+
const wInst = wEl && wEl.dataset.instanceId;
|
|
159
|
+
if (activeInstanceId && wInst && wInst !== activeInstanceId) continue;
|
|
148
160
|
const t = document.createElement('button');
|
|
149
161
|
t.className = 'os-task' + (w.focused ? ' focused' : '');
|
|
150
162
|
t.type = 'button';
|
|
@@ -155,6 +167,15 @@ export function createDesktopShell({ root = document.body, wm, registry, brand =
|
|
|
155
167
|
}
|
|
156
168
|
}
|
|
157
169
|
|
|
170
|
+
function setActiveInstance(id) {
|
|
171
|
+
activeInstanceId = id;
|
|
172
|
+
for (const btn of instSwitch.querySelectorAll('.os-btn')) {
|
|
173
|
+
btn.classList.toggle('active', btn.dataset.instanceId === id);
|
|
174
|
+
}
|
|
175
|
+
applyInstanceFilter();
|
|
176
|
+
refreshTaskbar();
|
|
177
|
+
}
|
|
178
|
+
|
|
158
179
|
function openApp(appId) {
|
|
159
180
|
const app = (typeof registry.get === 'function') ? registry.get(appId) : registry[appId];
|
|
160
181
|
if (!app) throw new Error('unknown app: ' + appId);
|
|
@@ -165,6 +186,11 @@ export function createDesktopShell({ root = document.body, wm, registry, brand =
|
|
|
165
186
|
const titlePrefix = (activeContext && activeContext.titlePrefix) ? activeContext.titlePrefix + ' · ' : '';
|
|
166
187
|
const win = wm.open({ title: titlePrefix + app.name, body: r.node, kind: appId, width: sz.w, height: sz.h, x: 100 + (wm.count * 28) % 240, y: 80 + (wm.count * 22) % 180 });
|
|
167
188
|
win._app = { id: appId, dispose: r.dispose };
|
|
189
|
+
if (activeInstanceId && win.el) {
|
|
190
|
+
win.el.dataset.instanceId = activeInstanceId;
|
|
191
|
+
win.instanceId = activeInstanceId;
|
|
192
|
+
}
|
|
193
|
+
win.appId = appId;
|
|
168
194
|
refreshTaskbar();
|
|
169
195
|
return win;
|
|
170
196
|
};
|
|
@@ -176,8 +202,9 @@ export function createDesktopShell({ root = document.body, wm, registry, brand =
|
|
|
176
202
|
const taskTimer = setInterval(refreshTaskbar, 500);
|
|
177
203
|
|
|
178
204
|
const api = {
|
|
179
|
-
wm, registry, openApp, setContext, refreshTaskbar,
|
|
205
|
+
wm, registry, openApp, setContext, refreshTaskbar, setActiveInstance,
|
|
180
206
|
openDrawer, closeDrawer, openMenu, closeMenu,
|
|
207
|
+
get activeInstanceId() { return activeInstanceId; },
|
|
181
208
|
elements: { osRoot, menubar, taskbar, appsMenu, sideRail, drawer, instSwitch, homeBtn, appsBtn },
|
|
182
209
|
dispose() { clearInterval(clockTimer); clearInterval(taskTimer); osRoot.remove(); sideRail.remove(); drawer.remove(); },
|
|
183
210
|
};
|
package/src/desktop/theme.css
CHANGED
|
@@ -308,7 +308,10 @@ html, body {
|
|
|
308
308
|
|
|
309
309
|
.os-spacer { flex: 1 1 auto; }
|
|
310
310
|
.os-tray { display: flex; align-items: center; gap: 6px; }
|
|
311
|
-
.os-instances { display: flex; gap:
|
|
311
|
+
.os-instances { display: flex; gap: 4px; margin-left: 8px; max-width: 280px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; padding: 0 4px; }
|
|
312
|
+
.os-instances::-webkit-scrollbar { height: 4px; }
|
|
313
|
+
.os-instances .os-btn { flex: 0 0 auto; min-width: 36px; padding: 2px 8px; font-family: var(--os-mono); font-size: 11px; }
|
|
314
|
+
.os-instances .os-btn.active { background: var(--panel-select, var(--os-accent-soft)); color: var(--os-fg); border-color: var(--panel-accent, var(--os-accent)); box-shadow: inset 0 0 0 1px var(--panel-accent, var(--os-accent)); }
|
|
312
315
|
.os-menubar [data-role="home"] { display: none; }
|
|
313
316
|
.os-root { position: fixed; inset: 0; display: flex; flex-direction: column; pointer-events: none; z-index: 8000; }
|
|
314
317
|
.os-menubar, .os-taskbar { pointer-events: auto; flex: 0 0 auto; }
|