sh3-core 0.13.2 → 0.13.4
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/actions/MenuButton.svelte +2 -1
- package/dist/actions/contextMenuModel.d.ts +1 -1
- package/dist/actions/contextMenuModel.js +2 -1
- package/dist/actions/dispatcher.svelte.d.ts +1 -1
- package/dist/actions/dispatcher.svelte.js +2 -1
- package/dist/actions/listActive.d.ts +1 -1
- package/dist/actions/listActive.js +2 -1
- package/dist/actions/listeners.d.ts +1 -1
- package/dist/actions/listeners.js +6 -5
- package/dist/actions/menuBarModel.js +3 -2
- package/dist/actions/paletteModel.js +2 -1
- package/dist/actions/resolveLabel.test.d.ts +1 -0
- package/dist/actions/resolveLabel.test.js +14 -0
- package/dist/actions/types.d.ts +12 -1
- package/dist/actions/types.js +7 -1
- package/dist/app/store/AppUpdateAvailableModal.svelte +87 -0
- package/dist/app/store/AppUpdateAvailableModal.svelte.d.ts +11 -0
- package/dist/app/store/StoreView.svelte +15 -4
- package/dist/app/store/UninstallAppDialog.svelte +86 -0
- package/dist/app/store/UninstallAppDialog.svelte.d.ts +10 -0
- package/dist/app/store/permissionConfirm.d.ts +4 -0
- package/dist/app/store/permissionConfirm.js +27 -0
- package/dist/app/store/storeApp.js +0 -1
- package/dist/app/store/storeShard.svelte.d.ts +8 -1
- package/dist/app/store/storeShard.svelte.js +51 -27
- package/dist/app/store/storeTypes.d.ts +21 -0
- package/dist/app/store/storeTypes.js +33 -0
- package/dist/app/store/storeTypes.test.d.ts +1 -0
- package/dist/app/store/storeTypes.test.js +41 -0
- package/dist/app/store/updatePackage.test.d.ts +1 -0
- package/dist/app/store/updatePackage.test.js +34 -0
- package/dist/app/store/verbs.d.ts +1 -0
- package/dist/app/store/verbs.js +79 -5
- package/dist/app/store/verbs.test.d.ts +1 -0
- package/dist/app/store/verbs.test.js +59 -0
- package/dist/app-appearance/AppAppearanceModal.svelte +174 -0
- package/dist/app-appearance/AppAppearanceModal.svelte.d.ts +8 -0
- package/dist/app-appearance/appearanceShard.svelte.d.ts +2 -0
- package/dist/app-appearance/appearanceShard.svelte.js +61 -0
- package/dist/app-appearance/appearanceState.svelte.d.ts +15 -0
- package/dist/app-appearance/appearanceState.svelte.js +59 -0
- package/dist/app-appearance/appearanceState.test.d.ts +1 -0
- package/dist/app-appearance/appearanceState.test.js +30 -0
- package/dist/app-appearance/index.d.ts +3 -0
- package/dist/app-appearance/index.js +2 -0
- package/dist/app-appearance/types.d.ts +11 -0
- package/dist/app-appearance/types.js +1 -0
- package/dist/apps/types.d.ts +7 -0
- package/dist/assets/iconIds.generated.d.ts +2 -0
- package/dist/assets/iconIds.generated.js +154 -0
- package/dist/host.js +2 -1
- package/dist/overlays/FloatFrame.svelte +18 -1
- package/dist/overlays/float.d.ts +12 -0
- package/dist/overlays/float.js +16 -0
- package/dist/overlays/float.test.js +97 -2
- package/dist/overlays/modal.js +1 -0
- package/dist/overlays/modal.test.js +17 -0
- package/dist/overlays/parentHost.d.ts +1 -0
- package/dist/overlays/parentHost.js +15 -0
- package/dist/overlays/parentHost.test.d.ts +1 -0
- package/dist/overlays/parentHost.test.js +39 -0
- package/dist/overlays/popup.js +1 -0
- package/dist/overlays/popup.test.js +19 -0
- package/dist/primitives/widgets/IconPicker.svelte +115 -0
- package/dist/primitives/widgets/IconPicker.svelte.d.ts +9 -0
- package/dist/primitives/widgets/IconPicker.svelte.test.d.ts +1 -0
- package/dist/primitives/widgets/IconPicker.svelte.test.js +43 -0
- package/dist/projects-shard/ProjectManage.svelte +14 -4
- package/dist/sh3core-shard/ShellHome.svelte +64 -38
- package/dist/sh3core-shard/appActions.d.ts +13 -0
- package/dist/sh3core-shard/appActions.js +181 -0
- package/dist/sh3core-shard/appActions.test.d.ts +1 -0
- package/dist/sh3core-shard/appActions.test.js +25 -0
- package/dist/sh3core-shard/sh3coreShard.svelte.js +2 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/app/store/InstalledView.svelte +0 -301
- package/dist/app/store/InstalledView.svelte.d.ts +0 -3
|
@@ -31,6 +31,7 @@ import { registeredApps } from '../apps/registry.svelte';
|
|
|
31
31
|
import { launchApp } from '../apps/lifecycle';
|
|
32
32
|
import { resetActivePresetToDefault } from '../layout/store.svelte';
|
|
33
33
|
import { modalManager } from '../overlays/modal';
|
|
34
|
+
import { registerAppActions } from './appActions';
|
|
34
35
|
export const sh3coreShard = {
|
|
35
36
|
manifest: {
|
|
36
37
|
id: '__sh3core__',
|
|
@@ -96,6 +97,7 @@ export const sh3coreShard = {
|
|
|
96
97
|
};
|
|
97
98
|
ctx.registerView('sh3core:home', factory);
|
|
98
99
|
ctx.registerView('shell:keys-and-peers', keysFactory);
|
|
100
|
+
registerAppActions(ctx);
|
|
99
101
|
// Launcher parent — submenu drill host. No `run` needed: the
|
|
100
102
|
// dispatcher's default behavior opens a sub-palette filtered to
|
|
101
103
|
// `submenuOf === 'sh3.app.launch'`. The single parent replaces the
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Auto-generated from package.json — do not edit manually. */
|
|
2
|
-
export declare const VERSION = "0.13.
|
|
2
|
+
export declare const VERSION = "0.13.4";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Auto-generated from package.json — do not edit manually. */
|
|
2
|
-
export const VERSION = '0.13.
|
|
2
|
+
export const VERSION = '0.13.4';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sh3-core",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
|
-
"build": "node --import tsx scripts/sync-version.ts && svelte-package -i src -o dist && node --import tsx scripts/generate-api-docs.ts",
|
|
32
|
+
"build": "node --import tsx scripts/sync-version.ts && node --import tsx scripts/sync-icon-ids.ts && svelte-package -i src -o dist && node --import tsx scripts/generate-api-docs.ts",
|
|
33
33
|
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
34
34
|
"pack": "npm run build && npm pack",
|
|
35
35
|
"test": "vitest run --passWithNoTests",
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
/*
|
|
3
|
-
* InstalledView — lists installed packages with uninstall capability.
|
|
4
|
-
*
|
|
5
|
-
* Simpler than the browse view: a flat list of installed packages with
|
|
6
|
-
* metadata (type, version, contract version, source registry, install date)
|
|
7
|
-
* and an uninstall button per entry.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { storeContext } from './storeShard.svelte';
|
|
11
|
-
import { uninstallPackage } from '../../registry/installer';
|
|
12
|
-
import { serverUninstallPackage } from '../../env/client';
|
|
13
|
-
import PermissionConfirmModal from './PermissionConfirmModal.svelte';
|
|
14
|
-
import type { InstalledPackage } from '../../registry/types';
|
|
15
|
-
|
|
16
|
-
const ctx = storeContext;
|
|
17
|
-
|
|
18
|
-
let uninstallingIds = $state<Set<string>>(new Set());
|
|
19
|
-
let updatingIds = $state<Set<string>>(new Set());
|
|
20
|
-
let updateError = $state<string | null>(null);
|
|
21
|
-
|
|
22
|
-
let updateModal = $state<null | {
|
|
23
|
-
pkg: InstalledPackage;
|
|
24
|
-
toVersion: string;
|
|
25
|
-
added: string[];
|
|
26
|
-
removed: string[];
|
|
27
|
-
resolve: (ok: boolean) => void;
|
|
28
|
-
}>(null);
|
|
29
|
-
|
|
30
|
-
async function handleUninstall(id: string) {
|
|
31
|
-
if (uninstallingIds.has(id)) return;
|
|
32
|
-
|
|
33
|
-
uninstallingIds = new Set([...uninstallingIds, id]);
|
|
34
|
-
try {
|
|
35
|
-
await serverUninstallPackage(id);
|
|
36
|
-
await uninstallPackage(id);
|
|
37
|
-
await ctx.refreshInstalled();
|
|
38
|
-
} catch (err) {
|
|
39
|
-
console.warn('[sh3-store] Uninstall failed:', err instanceof Error ? err.message : err);
|
|
40
|
-
} finally {
|
|
41
|
-
const next = new Set(uninstallingIds);
|
|
42
|
-
next.delete(id);
|
|
43
|
-
uninstallingIds = next;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
async function handleUpdate(id: string) {
|
|
48
|
-
if (updatingIds.has(id)) return;
|
|
49
|
-
|
|
50
|
-
updatingIds = new Set([...updatingIds, id]);
|
|
51
|
-
updateError = null;
|
|
52
|
-
|
|
53
|
-
try {
|
|
54
|
-
await ctx.updatePackage(id, (added, removed) => {
|
|
55
|
-
return new Promise<boolean>((resolve) => {
|
|
56
|
-
const pkg = ctx.state.ephemeral.installed.find(
|
|
57
|
-
(p: InstalledPackage) => p.id === id,
|
|
58
|
-
);
|
|
59
|
-
const target = ctx.state.ephemeral.updatable[id];
|
|
60
|
-
if (!pkg || !target) {
|
|
61
|
-
resolve(true); // Falls through to the existing behavior.
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
updateModal = {
|
|
65
|
-
pkg,
|
|
66
|
-
toVersion: target.latest.version,
|
|
67
|
-
added,
|
|
68
|
-
removed,
|
|
69
|
-
resolve,
|
|
70
|
-
};
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
} catch (err) {
|
|
74
|
-
updateError = err instanceof Error ? err.message : String(err);
|
|
75
|
-
} finally {
|
|
76
|
-
const next = new Set(updatingIds);
|
|
77
|
-
next.delete(id);
|
|
78
|
-
updatingIds = next;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function confirmUpdate() {
|
|
83
|
-
const m = updateModal;
|
|
84
|
-
if (!m) return;
|
|
85
|
-
updateModal = null;
|
|
86
|
-
m.resolve(true);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function cancelUpdate() {
|
|
90
|
-
const m = updateModal;
|
|
91
|
-
if (!m) return;
|
|
92
|
-
updateModal = null;
|
|
93
|
-
m.resolve(false);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function handleRefresh() {
|
|
97
|
-
ctx.refreshInstalled();
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function formatDate(iso: string): string {
|
|
101
|
-
try {
|
|
102
|
-
return new Date(iso).toLocaleDateString(undefined, {
|
|
103
|
-
year: 'numeric',
|
|
104
|
-
month: 'short',
|
|
105
|
-
day: 'numeric',
|
|
106
|
-
});
|
|
107
|
-
} catch {
|
|
108
|
-
return iso;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
</script>
|
|
112
|
-
|
|
113
|
-
<div class="installed-view">
|
|
114
|
-
<header class="installed-header">
|
|
115
|
-
<h2>Installed Packages</h2>
|
|
116
|
-
<button onclick={handleRefresh}>Refresh</button>
|
|
117
|
-
</header>
|
|
118
|
-
|
|
119
|
-
{#if updateError}
|
|
120
|
-
<div class="installed-error">{updateError}</div>
|
|
121
|
-
{/if}
|
|
122
|
-
|
|
123
|
-
{#if ctx.state.ephemeral.installed.length === 0}
|
|
124
|
-
<div class="installed-empty">No packages installed.</div>
|
|
125
|
-
{:else}
|
|
126
|
-
<ul class="installed-list">
|
|
127
|
-
{#each ctx.state.ephemeral.installed as pkg (pkg.id)}
|
|
128
|
-
{@const uninstalling = uninstallingIds.has(pkg.id)}
|
|
129
|
-
<li class="installed-item">
|
|
130
|
-
<div class="installed-item-main">
|
|
131
|
-
<span class="installed-item-id">{pkg.id}</span>
|
|
132
|
-
<span class="installed-item-badge" class:badge-shard={pkg.type === 'shard'} class:badge-app={pkg.type === 'app'}>
|
|
133
|
-
{pkg.type}
|
|
134
|
-
</span>
|
|
135
|
-
<span class="installed-item-version">{pkg.version}</span>
|
|
136
|
-
</div>
|
|
137
|
-
<div class="installed-item-meta">
|
|
138
|
-
<span>Contract: v{pkg.contractVersion}</span>
|
|
139
|
-
<span>Source: {pkg.sourceRegistry}</span>
|
|
140
|
-
<span>Installed: {formatDate(pkg.installedAt)}</span>
|
|
141
|
-
</div>
|
|
142
|
-
<div class="installed-item-actions">
|
|
143
|
-
{#if pkg.id in ctx.state.ephemeral.updatable}
|
|
144
|
-
{@const target = ctx.state.ephemeral.updatable[pkg.id]}
|
|
145
|
-
{@const updating = updatingIds.has(pkg.id)}
|
|
146
|
-
<button
|
|
147
|
-
class="installed-update-btn"
|
|
148
|
-
onclick={() => handleUpdate(pkg.id)}
|
|
149
|
-
disabled={updating || uninstalling}
|
|
150
|
-
>
|
|
151
|
-
{updating ? 'Updating...' : `Update -> ${target.latest.version}`}
|
|
152
|
-
</button>
|
|
153
|
-
{/if}
|
|
154
|
-
<button
|
|
155
|
-
class="installed-uninstall-btn"
|
|
156
|
-
onclick={() => handleUninstall(pkg.id)}
|
|
157
|
-
disabled={uninstalling}
|
|
158
|
-
>
|
|
159
|
-
{uninstalling ? 'Removing...' : 'Uninstall'}
|
|
160
|
-
</button>
|
|
161
|
-
</div>
|
|
162
|
-
</li>
|
|
163
|
-
{/each}
|
|
164
|
-
</ul>
|
|
165
|
-
{/if}
|
|
166
|
-
|
|
167
|
-
{#if updateModal}
|
|
168
|
-
<PermissionConfirmModal
|
|
169
|
-
mode="update"
|
|
170
|
-
pkg={{ label: updateModal.pkg.id, version: updateModal.toVersion }}
|
|
171
|
-
fromVersion={updateModal.pkg.version}
|
|
172
|
-
added={updateModal.added}
|
|
173
|
-
removed={updateModal.removed}
|
|
174
|
-
onConfirm={confirmUpdate}
|
|
175
|
-
onCancel={cancelUpdate}
|
|
176
|
-
/>
|
|
177
|
-
{/if}
|
|
178
|
-
</div>
|
|
179
|
-
|
|
180
|
-
<style>
|
|
181
|
-
.installed-view {
|
|
182
|
-
font-family: var(--shell-font-ui);
|
|
183
|
-
color: var(--shell-fg, #e0e0e0);
|
|
184
|
-
background: var(--shell-bg, #1e1e1e);
|
|
185
|
-
padding: 16px;
|
|
186
|
-
height: 100%;
|
|
187
|
-
overflow-y: auto;
|
|
188
|
-
box-sizing: border-box;
|
|
189
|
-
}
|
|
190
|
-
.installed-header {
|
|
191
|
-
display: flex;
|
|
192
|
-
align-items: center;
|
|
193
|
-
justify-content: space-between;
|
|
194
|
-
margin-bottom: 16px;
|
|
195
|
-
}
|
|
196
|
-
.installed-header h2 {
|
|
197
|
-
margin: 0;
|
|
198
|
-
font-size: 1.25rem;
|
|
199
|
-
font-weight: 600;
|
|
200
|
-
}
|
|
201
|
-
.installed-empty {
|
|
202
|
-
text-align: center;
|
|
203
|
-
padding: 32px 16px;
|
|
204
|
-
color: var(--shell-fg-muted, #888);
|
|
205
|
-
font-size: 0.875rem;
|
|
206
|
-
}
|
|
207
|
-
.installed-list {
|
|
208
|
-
list-style: none;
|
|
209
|
-
margin: 0;
|
|
210
|
-
padding: 0;
|
|
211
|
-
display: flex;
|
|
212
|
-
flex-direction: column;
|
|
213
|
-
gap: 8px;
|
|
214
|
-
}
|
|
215
|
-
.installed-item {
|
|
216
|
-
background: var(--shell-input-bg, #2a2a2a);
|
|
217
|
-
border: 1px solid var(--shell-border, #444);
|
|
218
|
-
border-radius: var(--shell-radius-md);
|
|
219
|
-
padding: 12px 14px;
|
|
220
|
-
display: flex;
|
|
221
|
-
flex-direction: column;
|
|
222
|
-
gap: 6px;
|
|
223
|
-
}
|
|
224
|
-
.installed-item-main {
|
|
225
|
-
display: flex;
|
|
226
|
-
align-items: center;
|
|
227
|
-
gap: 8px;
|
|
228
|
-
}
|
|
229
|
-
.installed-item-id {
|
|
230
|
-
font-weight: 600;
|
|
231
|
-
font-size: 0.9375rem;
|
|
232
|
-
}
|
|
233
|
-
.installed-item-badge {
|
|
234
|
-
font-size: 0.6875rem;
|
|
235
|
-
padding: 1px 6px;
|
|
236
|
-
border-radius: var(--shell-radius-sm);
|
|
237
|
-
text-transform: uppercase;
|
|
238
|
-
font-weight: 600;
|
|
239
|
-
letter-spacing: 0.04em;
|
|
240
|
-
}
|
|
241
|
-
.badge-shard {
|
|
242
|
-
background: color-mix(in srgb, var(--shell-accent, #007acc) 25%, transparent);
|
|
243
|
-
color: var(--shell-accent, #007acc);
|
|
244
|
-
}
|
|
245
|
-
.badge-app {
|
|
246
|
-
background: color-mix(in srgb, var(--shell-success, #4caf50) 25%, transparent);
|
|
247
|
-
color: var(--shell-success, #4caf50);
|
|
248
|
-
}
|
|
249
|
-
.installed-item-version {
|
|
250
|
-
font-size: 0.75rem;
|
|
251
|
-
color: var(--shell-fg-muted, #888);
|
|
252
|
-
}
|
|
253
|
-
.installed-item-meta {
|
|
254
|
-
display: flex;
|
|
255
|
-
gap: 16px;
|
|
256
|
-
flex-wrap: wrap;
|
|
257
|
-
font-size: 0.75rem;
|
|
258
|
-
color: var(--shell-fg-muted, #888);
|
|
259
|
-
}
|
|
260
|
-
.installed-item-actions {
|
|
261
|
-
display: flex;
|
|
262
|
-
justify-content: flex-end;
|
|
263
|
-
gap: 8px;
|
|
264
|
-
}
|
|
265
|
-
.installed-uninstall-btn {
|
|
266
|
-
padding: 4px 12px;
|
|
267
|
-
background: transparent;
|
|
268
|
-
color: var(--shell-error, #d32f2f);
|
|
269
|
-
border: 1px solid var(--shell-error, #d32f2f);
|
|
270
|
-
font-size: 0.8125rem;
|
|
271
|
-
}
|
|
272
|
-
.installed-uninstall-btn:hover:not(:disabled) {
|
|
273
|
-
background: color-mix(in srgb, var(--shell-error, #d32f2f) 15%, transparent);
|
|
274
|
-
}
|
|
275
|
-
.installed-uninstall-btn:disabled {
|
|
276
|
-
opacity: 0.6;
|
|
277
|
-
cursor: not-allowed;
|
|
278
|
-
}
|
|
279
|
-
.installed-update-btn {
|
|
280
|
-
padding: 4px 12px;
|
|
281
|
-
background: var(--shell-warning, #fbbf24);
|
|
282
|
-
color: var(--shell-fg-on-warning, #1a1b1e);
|
|
283
|
-
font-size: 0.8125rem;
|
|
284
|
-
}
|
|
285
|
-
.installed-update-btn:hover:not(:disabled) {
|
|
286
|
-
filter: brightness(1.1);
|
|
287
|
-
}
|
|
288
|
-
.installed-update-btn:disabled {
|
|
289
|
-
opacity: 0.6;
|
|
290
|
-
cursor: not-allowed;
|
|
291
|
-
}
|
|
292
|
-
.installed-error {
|
|
293
|
-
padding: 8px 12px;
|
|
294
|
-
margin-bottom: 12px;
|
|
295
|
-
background: color-mix(in srgb, var(--shell-error, #d32f2f) 15%, transparent);
|
|
296
|
-
color: var(--shell-error, #d32f2f);
|
|
297
|
-
border: 1px solid var(--shell-error, #d32f2f);
|
|
298
|
-
border-radius: var(--shell-radius);
|
|
299
|
-
font-size: 0.8125rem;
|
|
300
|
-
}
|
|
301
|
-
</style>
|