@fuzdev/fuz_app 0.121.0 → 0.123.0
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/ui/AccountSessions.svelte +2 -2
- package/dist/ui/AdminAccounts.svelte +19 -11
- package/dist/ui/AdminAuditLog.svelte +3 -3
- package/dist/ui/AdminInvites.svelte +5 -5
- package/dist/ui/AdminOverview.svelte +4 -4
- package/dist/ui/AdminRoleGrantHistory.svelte +2 -2
- package/dist/ui/AdminSessions.svelte +3 -3
- package/dist/ui/BootstrapForm.svelte +1 -1
- package/dist/ui/CLAUDE.md +15 -1
- package/dist/ui/ColumnLayout.svelte +138 -7
- package/dist/ui/ColumnLayout.svelte.d.ts +39 -2
- package/dist/ui/ColumnLayout.svelte.d.ts.map +1 -1
- package/dist/ui/ConfirmButton.svelte +1 -1
- package/dist/ui/Datatable.svelte +2 -2
- package/dist/ui/LoginForm.svelte +1 -1
- package/dist/ui/RoleGrantOfferHistory.svelte +3 -3
- package/dist/ui/RoleGrantOfferInbox.svelte +8 -4
- package/dist/ui/SignupForm.svelte +1 -1
- package/dist/ui/SurfaceExplorer.svelte +14 -14
- package/package.json +9 -5
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<h2>
|
|
44
44
|
Sessions
|
|
45
45
|
{#if account_sessions.active_count > 0}
|
|
46
|
-
<span class="chip
|
|
46
|
+
<span class="chip palette_a">{account_sessions.active_count} active</span>
|
|
47
47
|
{/if}
|
|
48
48
|
</h2>
|
|
49
49
|
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
<Datatable {columns} rows={account_sessions.sessions} height="300px">
|
|
65
65
|
{#snippet cell(column, row)}
|
|
66
66
|
{#if column.key === 'id'}
|
|
67
|
-
<span class="chip
|
|
67
|
+
<span class="chip palette_b">active</span>
|
|
68
68
|
<code class="text_50">{truncate_uuid(row.id)}</code>
|
|
69
69
|
{:else if column.key === 'created_at'}
|
|
70
70
|
<span title={format_datetime_local(row.created_at)}>
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<h1>Accounts</h1>
|
|
48
48
|
{#if admin_accounts.account_count > 0}
|
|
49
49
|
<p>
|
|
50
|
-
<span class="chip
|
|
50
|
+
<span class="chip palette_a">
|
|
51
51
|
{admin_accounts.account_count} account{admin_accounts.account_count === 1 ? '' : 's'}
|
|
52
52
|
</span>
|
|
53
53
|
</p>
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
<span class="text_50 font_size_sm">
|
|
80
80
|
{row.account.email}
|
|
81
81
|
{#if row.account.email_verified}
|
|
82
|
-
<span class="chip font_size_sm
|
|
82
|
+
<span class="chip font_size_sm palette_b">verified</span>
|
|
83
83
|
{:else}
|
|
84
84
|
<span class="chip font_size_sm">unverified</span>
|
|
85
85
|
{/if}
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
{#each row.role_grants as role_grant (role_grant.id)}
|
|
98
98
|
{@const scope = scope_label(role_grant.scope_id, role_grant.role)}
|
|
99
99
|
<div class="row">
|
|
100
|
-
<span class="chip
|
|
100
|
+
<span class="chip palette_b">{role_grant.role}</span>
|
|
101
101
|
{#if scope !== null}
|
|
102
102
|
<span class="text_50 font_size_sm" title={role_grant.scope_id ?? undefined}>
|
|
103
103
|
{scope}
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
<ConfirmButton
|
|
118
118
|
onconfirm={() => admin_accounts.submit_revoke(actor_id, role_grant.id)}
|
|
119
119
|
title="revoke {role_grant.role}"
|
|
120
|
-
class="
|
|
120
|
+
class="sized_sm"
|
|
121
121
|
label="revoke"
|
|
122
122
|
pending={admin_accounts.revoke.loading(role_grant.id)}
|
|
123
123
|
/>
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
<ConfirmButton
|
|
146
146
|
onconfirm={() => admin_accounts.submit_retract(offer.id)}
|
|
147
147
|
title="retract offer"
|
|
148
|
-
class="
|
|
148
|
+
class="sized_sm"
|
|
149
149
|
label="retract"
|
|
150
150
|
pending={admin_accounts.retract.loading(offer.id)}
|
|
151
151
|
/>
|
|
@@ -165,12 +165,16 @@
|
|
|
165
165
|
<ConfirmButton
|
|
166
166
|
onconfirm={() => admin_accounts.submit_grant(row.account.id, role)}
|
|
167
167
|
title="offer {role}"
|
|
168
|
-
class="
|
|
168
|
+
class="sized_sm"
|
|
169
169
|
label={`+ ${role}`}
|
|
170
170
|
pending={admin_accounts.grant.loading(key)}
|
|
171
171
|
>
|
|
172
172
|
{#snippet popover_content(_popover, do_confirm)}
|
|
173
|
-
<button
|
|
173
|
+
<button
|
|
174
|
+
type="button"
|
|
175
|
+
class="palette_b background-color:var(--bg_100)"
|
|
176
|
+
onclick={() => do_confirm()}
|
|
177
|
+
>
|
|
174
178
|
<span class="py_sm">offer '{role}' to @{row.account.username}</span>
|
|
175
179
|
</button>
|
|
176
180
|
{/snippet}
|
|
@@ -184,14 +188,14 @@
|
|
|
184
188
|
{#if row.account.deleted_at}
|
|
185
189
|
{@const undelete_error = admin_accounts.undelete.error(row.account.id)}
|
|
186
190
|
<span
|
|
187
|
-
class="chip font_size_sm
|
|
191
|
+
class="chip font_size_sm palette_c"
|
|
188
192
|
title={format_datetime_local(row.account.deleted_at)}
|
|
189
193
|
>
|
|
190
194
|
deleted {format_relative_time(row.account.deleted_at)}
|
|
191
195
|
</span>
|
|
192
196
|
<button
|
|
193
197
|
type="button"
|
|
194
|
-
class="
|
|
198
|
+
class="sized_sm"
|
|
195
199
|
disabled={admin_accounts.undelete.loading(row.account.id)}
|
|
196
200
|
onclick={() => admin_accounts.submit_undelete(row.account.id)}
|
|
197
201
|
>
|
|
@@ -205,12 +209,16 @@
|
|
|
205
209
|
<ConfirmButton
|
|
206
210
|
onconfirm={() => admin_accounts.submit_delete(row.account.id)}
|
|
207
211
|
title="soft-delete @{row.account.username}"
|
|
208
|
-
class="
|
|
212
|
+
class="sized_sm"
|
|
209
213
|
label="delete"
|
|
210
214
|
pending={admin_accounts.soft_delete.loading(row.account.id)}
|
|
211
215
|
>
|
|
212
216
|
{#snippet popover_content(_popover, do_confirm)}
|
|
213
|
-
<button
|
|
217
|
+
<button
|
|
218
|
+
type="button"
|
|
219
|
+
class="palette_c background-color:var(--bg_100)"
|
|
220
|
+
onclick={() => do_confirm()}
|
|
221
|
+
>
|
|
214
222
|
<span class="py_sm">soft-delete @{row.account.username} (reversible)</span>
|
|
215
223
|
</button>
|
|
216
224
|
{/snippet}
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
</select>
|
|
89
89
|
</label>
|
|
90
90
|
<button type="button" onclick={load}>refresh</button>
|
|
91
|
-
<button type="button" onclick={toggle_streaming} class:
|
|
91
|
+
<button type="button" onclick={toggle_streaming} class:palette_b={streaming}>
|
|
92
92
|
{streaming ? 'stop' : 'stream'}
|
|
93
93
|
</button>
|
|
94
94
|
{#if streaming}
|
|
@@ -114,8 +114,8 @@
|
|
|
114
114
|
{:else if column.key === 'outcome'}
|
|
115
115
|
<span
|
|
116
116
|
class="chip"
|
|
117
|
-
class:
|
|
118
|
-
class:
|
|
117
|
+
class:palette_b={row.outcome === 'success'}
|
|
118
|
+
class:palette_c={row.outcome === 'failure'}
|
|
119
119
|
>
|
|
120
120
|
{row.outcome}
|
|
121
121
|
</span>
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
</fieldset>
|
|
61
61
|
{#if admin_invites.invite_count > 0}
|
|
62
62
|
<p>
|
|
63
|
-
<span class="chip
|
|
63
|
+
<span class="chip palette_a">
|
|
64
64
|
{admin_invites.unclaimed_count} unclaimed / {admin_invites.invite_count} total
|
|
65
65
|
</span>
|
|
66
66
|
</p>
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
>
|
|
76
76
|
<fieldset class="row gap_sm">
|
|
77
77
|
<legend>Invite Target</legend>
|
|
78
|
-
<label class="grow">
|
|
78
|
+
<label class="flex-grow:1">
|
|
79
79
|
<div class="title">email</div>
|
|
80
80
|
<input
|
|
81
81
|
type="email"
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
disabled={admin_invites.create.loading}
|
|
85
85
|
/>
|
|
86
86
|
</label>
|
|
87
|
-
<label class="grow">
|
|
87
|
+
<label class="flex-grow:1">
|
|
88
88
|
<div class="title">username</div>
|
|
89
89
|
<input
|
|
90
90
|
type="text"
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
{#snippet cell(column, row)}
|
|
115
115
|
{#if column.key === 'claimed_at'}
|
|
116
116
|
{#if row.claimed_at}
|
|
117
|
-
<span class="chip
|
|
117
|
+
<span class="chip palette_b">claimed</span>
|
|
118
118
|
<span class="text_50 font_size_sm" title={format_datetime_local(row.claimed_at)}>
|
|
119
119
|
{#if row.claimed_by_username}
|
|
120
120
|
by {row.claimed_by_username}
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
<ConfirmButton
|
|
139
139
|
onconfirm={() => admin_invites.submit_delete(row.id)}
|
|
140
140
|
title="delete invite"
|
|
141
|
-
class="
|
|
141
|
+
class="sized_sm"
|
|
142
142
|
label="delete"
|
|
143
143
|
pending={admin_invites.remove.loading(row.id)}
|
|
144
144
|
/>
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
<div class="baseline-row gap_sm">
|
|
170
170
|
<span class="text_50">public signup</span>
|
|
171
171
|
{#if app_settings.settings?.open_signup}
|
|
172
|
-
<span class="chip
|
|
172
|
+
<span class="chip palette_b">open</span>
|
|
173
173
|
{:else}
|
|
174
174
|
<span class="chip">closed</span>
|
|
175
175
|
{/if}
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
<li>
|
|
188
188
|
<span>{invite.email || invite.username || '—'}</span>
|
|
189
189
|
{#if invite.claimed_at}
|
|
190
|
-
<span class="chip font_size_sm
|
|
190
|
+
<span class="chip font_size_sm palette_b">claimed</span>
|
|
191
191
|
{:else}
|
|
192
192
|
<span class="chip font_size_sm">unclaimed</span>
|
|
193
193
|
{/if}
|
|
@@ -221,7 +221,7 @@
|
|
|
221
221
|
</span>
|
|
222
222
|
<code class="font_size_sm">{event.event_type}</code>
|
|
223
223
|
{#if event.outcome === 'failure'}
|
|
224
|
-
<span class="chip font_size_sm
|
|
224
|
+
<span class="chip font_size_sm palette_c">fail</span>
|
|
225
225
|
{/if}
|
|
226
226
|
</li>
|
|
227
227
|
{/each}
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
<div class="baseline-row gap_sm">
|
|
280
280
|
<span class="text_50">public signup</span>
|
|
281
281
|
{#if app_settings.settings?.open_signup}
|
|
282
|
-
<span class="chip
|
|
282
|
+
<span class="chip palette_b">open</span>
|
|
283
283
|
{:else}
|
|
284
284
|
<span class="chip">invite-only</span>
|
|
285
285
|
{/if}
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
{#if column.key === 'event_type'}
|
|
51
51
|
<span
|
|
52
52
|
class="chip"
|
|
53
|
-
class:
|
|
54
|
-
class:
|
|
53
|
+
class:palette_b={row.event_type === 'role_grant_create'}
|
|
54
|
+
class:palette_c={row.event_type === 'role_grant_revoke'}
|
|
55
55
|
>
|
|
56
56
|
{row.event_type === 'role_grant_create' ? 'grant' : 'revoke'}
|
|
57
57
|
</span>
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<h1>Active Sessions</h1>
|
|
36
36
|
{#if admin_sessions.active_count > 0}
|
|
37
37
|
<p>
|
|
38
|
-
<span class="chip
|
|
38
|
+
<span class="chip palette_a">{admin_sessions.active_count} active</span>
|
|
39
39
|
</p>
|
|
40
40
|
{/if}
|
|
41
41
|
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
<ConfirmButton
|
|
63
63
|
onconfirm={() => admin_sessions.submit_revoke_sessions(row.account_id)}
|
|
64
64
|
title="revoke all sessions for {row.username}"
|
|
65
|
-
class="
|
|
65
|
+
class="sized_sm"
|
|
66
66
|
label="revoke sessions"
|
|
67
67
|
pending={admin_sessions.revoke_sessions.loading(row.account_id)}
|
|
68
68
|
/>
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
<ConfirmButton
|
|
73
73
|
onconfirm={() => admin_sessions.submit_revoke_tokens(row.account_id)}
|
|
74
74
|
title="revoke all tokens for {row.username}"
|
|
75
|
-
class="
|
|
75
|
+
class="sized_sm"
|
|
76
76
|
label="revoke tokens"
|
|
77
77
|
pending={admin_sessions.revoke_tokens.loading(row.account_id)}
|
|
78
78
|
/>
|
package/dist/ui/CLAUDE.md
CHANGED
|
@@ -221,7 +221,21 @@ pattern rather than reintroducing prop-drilling.
|
|
|
221
221
|
to keep narrow mode at `0px`. To change only the wide open offset, target
|
|
222
222
|
`.app-shell.wide-open > .app-shell-content`, also inside that negation.
|
|
223
223
|
- `ColumnLayout.svelte` — fixed `aside` column + fluid `children`
|
|
224
|
-
column; `column_width = '280px'`.
|
|
224
|
+
column; `column_width = '280px'`, `aside_label = 'menu'`. Below 64rem of
|
|
225
|
+
its own width (an `inline-size` container query named `column_layout`;
|
|
226
|
+
64rem under fuz_css's 62.5% root is fuz_css's `sm` breakpoint, 640px at
|
|
227
|
+
the default font size) the columns stack and the aside collapses behind a
|
|
228
|
+
sticky `type="button"` toggle (`menuitem plain` with a `chevron`, text
|
|
229
|
+
`aside_label`, `aria-expanded`/`aria-controls`); opened, the aside sits in flow above the content (scrolled into view under the toggle when scroll anchoring would leave it above the view), and `afterNavigate` closes it. With a bounded height, the stacked layout
|
|
230
|
+
scrolls as one column and the toggle sticks to its top; under a parent
|
|
231
|
+
that grows with its content, the page scrolls and the toggle scrolls away
|
|
232
|
+
with it. Above the threshold the toggle is `display: none`. The switch is
|
|
233
|
+
CSS alone, so the server render shows the right form at any width and
|
|
234
|
+
hydration changes nothing. The
|
|
235
|
+
`<aside>` takes `aria-label={aside_label}`; consumers wrap links in their
|
|
236
|
+
own `<nav>`. Hooks: `--column_width`, `--column_toggle_bg` (default
|
|
237
|
+
`--shade_00`). The container can't size from its content, so a
|
|
238
|
+
shrink-to-fit placement collapses it to zero width.
|
|
225
239
|
- `MenuLink.svelte` — SvelteKit `<a>` with `selected` derived from
|
|
226
240
|
`page.url.pathname` (fires for exact match + descendant pages).
|
|
227
241
|
Exact matches additionally get `aria-current="page"`. Takes `path`
|
|
@@ -1,18 +1,52 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
/**
|
|
3
|
-
* Two-column layout
|
|
3
|
+
* Two-column layout - fixed-width `aside` on the left, fluid `children`
|
|
4
4
|
* column on the right. Both columns scroll independently.
|
|
5
5
|
*
|
|
6
|
+
* Below a threshold of the layout's own width - a container query, not a
|
|
7
|
+
* media query, so a nested layout decides for itself - the columns stack:
|
|
8
|
+
* the aside collapses behind a toggle button labelled `aside_label`, and
|
|
9
|
+
* when opened it sits in flow above the content, pushing it down, until
|
|
10
|
+
* the toggle closes it or a navigation does. Opening scrolls the aside
|
|
11
|
+
* into view, under the toggle, when it would land above the view.
|
|
12
|
+
*
|
|
13
|
+
* With a bounded height, the stacked layout scrolls as one column and the
|
|
14
|
+
* toggle sticks to its top; under a parent that grows with its content,
|
|
15
|
+
* the page scrolls and the toggle scrolls away with it.
|
|
16
|
+
*
|
|
17
|
+
* The threshold matches fuz_css's `sm` breakpoint. Above it the toggle is
|
|
18
|
+
* `display: none`. The switch is CSS alone, so the server render shows the
|
|
19
|
+
* right form at any width and hydration changes nothing.
|
|
20
|
+
*
|
|
21
|
+
* The root is an `inline-size` query container, so its width can't come
|
|
22
|
+
* from its content: a layout placed where it would shrink to fit (an
|
|
23
|
+
* inline-block, an absolutely positioned or floated box without a width,
|
|
24
|
+
* a flex row item that doesn't grow) collapses to zero width. Give it a
|
|
25
|
+
* width from its context, as a block or a stretched or growing flex item.
|
|
26
|
+
*
|
|
27
|
+
* Requires the SvelteKit runtime - it closes the aside from
|
|
28
|
+
* `afterNavigate`. Without JS the stacked aside can't be opened, since the
|
|
29
|
+
* toggle is client state; above the threshold it's always shown.
|
|
30
|
+
*
|
|
31
|
+
* Renders a generic `<aside>` named by `aside_label`; wrap navigation
|
|
32
|
+
* links in a `<nav>` inside the `aside` snippet.
|
|
33
|
+
*
|
|
34
|
+
* Styling hooks: `--column_width` (set from `column_width`) and
|
|
35
|
+
* `--column_toggle_bg`, the stacked toggle bar's opaque background so
|
|
36
|
+
* content scrolls under it unseen (default `--shade_00`, the page ground).
|
|
37
|
+
*
|
|
6
38
|
* @module
|
|
7
39
|
*/
|
|
8
40
|
|
|
9
|
-
import type
|
|
41
|
+
import { tick, type Snippet } from 'svelte';
|
|
10
42
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
43
|
+
import { afterNavigate } from '$app/navigation';
|
|
11
44
|
|
|
12
45
|
const {
|
|
13
46
|
aside,
|
|
14
47
|
children,
|
|
15
48
|
column_width = '280px',
|
|
49
|
+
aside_label = 'menu',
|
|
16
50
|
class: class_name = '',
|
|
17
51
|
...rest
|
|
18
52
|
}: SvelteHTMLElements['div'] & {
|
|
@@ -23,24 +57,85 @@
|
|
|
23
57
|
* @default '280px'
|
|
24
58
|
*/
|
|
25
59
|
column_width?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The stacked toggle's text and the aside's accessible name.
|
|
62
|
+
* @default 'menu'
|
|
63
|
+
*/
|
|
64
|
+
aside_label?: string;
|
|
26
65
|
} = $props();
|
|
66
|
+
|
|
67
|
+
const uid = $props.id();
|
|
68
|
+
const aside_id = `${uid}-aside`;
|
|
69
|
+
|
|
70
|
+
let aside_open = $state(false);
|
|
71
|
+
|
|
72
|
+
let toggle_bar_el: HTMLDivElement;
|
|
73
|
+
let aside_el: HTMLElement;
|
|
74
|
+
|
|
75
|
+
const toggle_aside = async (): Promise<void> => {
|
|
76
|
+
aside_open = !aside_open;
|
|
77
|
+
await tick();
|
|
78
|
+
// closed, or closed again before the DOM settled
|
|
79
|
+
if (!aside_open) return;
|
|
80
|
+
// the aside goes in above the content, and scroll anchoring keeps the
|
|
81
|
+
// content where it was, so opening while scrolled - the stacked body,
|
|
82
|
+
// or the page past a toggle half out of view - leaves the aside above
|
|
83
|
+
// the view; bring its start back under the toggle, whether the toggle
|
|
84
|
+
// sticks (bounded) or sits just above it (growing)
|
|
85
|
+
const bar = toggle_bar_el.getBoundingClientRect();
|
|
86
|
+
if (aside_el.getBoundingClientRect().top >= Math.max(0, bar.bottom)) return;
|
|
87
|
+
aside_el.style.scrollMarginTop = `${bar.height}px`;
|
|
88
|
+
aside_el.scrollIntoView({ block: 'start' });
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
afterNavigate(() => {
|
|
92
|
+
aside_open = false;
|
|
93
|
+
});
|
|
27
94
|
</script>
|
|
28
95
|
|
|
29
96
|
<div class="column-layout {class_name}" style:--column_width={column_width} {...rest}>
|
|
30
|
-
<
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
97
|
+
<div class={['column-layout-body', { 'aside-open': aside_open }]}>
|
|
98
|
+
<div class="column-toggle-bar" bind:this={toggle_bar_el}>
|
|
99
|
+
<button
|
|
100
|
+
type="button"
|
|
101
|
+
class="column-toggle menuitem plain"
|
|
102
|
+
aria-expanded={aside_open}
|
|
103
|
+
aria-controls={aside_id}
|
|
104
|
+
onclick={toggle_aside}
|
|
105
|
+
>
|
|
106
|
+
{aside_label}
|
|
107
|
+
<span class="chevron" aria-hidden="true"></span>
|
|
108
|
+
</button>
|
|
109
|
+
</div>
|
|
110
|
+
<aside
|
|
111
|
+
id={aside_id}
|
|
112
|
+
class="column-fixed unstyled"
|
|
113
|
+
aria-label={aside_label}
|
|
114
|
+
bind:this={aside_el}
|
|
115
|
+
>
|
|
116
|
+
{@render aside()}
|
|
117
|
+
</aside>
|
|
118
|
+
<div class="column-fluid">
|
|
119
|
+
{@render children()}
|
|
120
|
+
</div>
|
|
35
121
|
</div>
|
|
36
122
|
</div>
|
|
37
123
|
|
|
38
124
|
<style>
|
|
39
125
|
.column-layout {
|
|
126
|
+
container: column_layout / inline-size;
|
|
127
|
+
height: 100%;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.column-layout-body {
|
|
40
131
|
display: flex;
|
|
41
132
|
height: 100%;
|
|
42
133
|
}
|
|
43
134
|
|
|
135
|
+
.column-toggle-bar {
|
|
136
|
+
display: none;
|
|
137
|
+
}
|
|
138
|
+
|
|
44
139
|
.column-fixed {
|
|
45
140
|
width: var(--column_width, 280px);
|
|
46
141
|
min-width: var(--column_width, 280px);
|
|
@@ -54,4 +149,40 @@
|
|
|
54
149
|
min-width: 0;
|
|
55
150
|
overflow: auto;
|
|
56
151
|
}
|
|
152
|
+
|
|
153
|
+
/* fuz_css's `sm` breakpoint is the media query `40rem`, where `rem` is the
|
|
154
|
+
initial font size; in a container query `rem` reads the root, which
|
|
155
|
+
fuz_css sets to 62.5%, so `64rem` is the same width at any user font
|
|
156
|
+
size - keep in sync with `sm` in fuz_css's `modifiers.ts` */
|
|
157
|
+
@container column_layout (width < 64rem) {
|
|
158
|
+
.column-layout-body {
|
|
159
|
+
flex-direction: column;
|
|
160
|
+
overflow: auto;
|
|
161
|
+
}
|
|
162
|
+
.column-toggle-bar {
|
|
163
|
+
display: block;
|
|
164
|
+
position: sticky;
|
|
165
|
+
top: 0;
|
|
166
|
+
z-index: 1;
|
|
167
|
+
background-color: var(--column_toggle_bg, var(--shade_00));
|
|
168
|
+
}
|
|
169
|
+
/* `flex: none` because the aside scrolls, so it would otherwise shrink
|
|
170
|
+
to nothing in the body's fixed height */
|
|
171
|
+
.column-layout-body > .column-fixed {
|
|
172
|
+
flex: none;
|
|
173
|
+
width: auto;
|
|
174
|
+
min-width: 0;
|
|
175
|
+
height: auto;
|
|
176
|
+
}
|
|
177
|
+
.column-layout-body:not(.aside-open) > .column-fixed {
|
|
178
|
+
display: none;
|
|
179
|
+
}
|
|
180
|
+
.column-fluid {
|
|
181
|
+
flex: none;
|
|
182
|
+
height: auto;
|
|
183
|
+
}
|
|
184
|
+
.column-layout-body.aside-open > .column-toggle-bar .chevron {
|
|
185
|
+
rotate: 90deg;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
57
188
|
</style>
|
|
@@ -1,10 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Two-column layout
|
|
2
|
+
* Two-column layout - fixed-width `aside` on the left, fluid `children`
|
|
3
3
|
* column on the right. Both columns scroll independently.
|
|
4
4
|
*
|
|
5
|
+
* Below a threshold of the layout's own width - a container query, not a
|
|
6
|
+
* media query, so a nested layout decides for itself - the columns stack:
|
|
7
|
+
* the aside collapses behind a toggle button labelled `aside_label`, and
|
|
8
|
+
* when opened it sits in flow above the content, pushing it down, until
|
|
9
|
+
* the toggle closes it or a navigation does. Opening scrolls the aside
|
|
10
|
+
* into view, under the toggle, when it would land above the view.
|
|
11
|
+
*
|
|
12
|
+
* With a bounded height, the stacked layout scrolls as one column and the
|
|
13
|
+
* toggle sticks to its top; under a parent that grows with its content,
|
|
14
|
+
* the page scrolls and the toggle scrolls away with it.
|
|
15
|
+
*
|
|
16
|
+
* The threshold matches fuz_css's `sm` breakpoint. Above it the toggle is
|
|
17
|
+
* `display: none`. The switch is CSS alone, so the server render shows the
|
|
18
|
+
* right form at any width and hydration changes nothing.
|
|
19
|
+
*
|
|
20
|
+
* The root is an `inline-size` query container, so its width can't come
|
|
21
|
+
* from its content: a layout placed where it would shrink to fit (an
|
|
22
|
+
* inline-block, an absolutely positioned or floated box without a width,
|
|
23
|
+
* a flex row item that doesn't grow) collapses to zero width. Give it a
|
|
24
|
+
* width from its context, as a block or a stretched or growing flex item.
|
|
25
|
+
*
|
|
26
|
+
* Requires the SvelteKit runtime - it closes the aside from
|
|
27
|
+
* `afterNavigate`. Without JS the stacked aside can't be opened, since the
|
|
28
|
+
* toggle is client state; above the threshold it's always shown.
|
|
29
|
+
*
|
|
30
|
+
* Renders a generic `<aside>` named by `aside_label`; wrap navigation
|
|
31
|
+
* links in a `<nav>` inside the `aside` snippet.
|
|
32
|
+
*
|
|
33
|
+
* Styling hooks: `--column_width` (set from `column_width`) and
|
|
34
|
+
* `--column_toggle_bg`, the stacked toggle bar's opaque background so
|
|
35
|
+
* content scrolls under it unseen (default `--shade_00`, the page ground).
|
|
36
|
+
*
|
|
5
37
|
* @module
|
|
6
38
|
*/
|
|
7
|
-
import type
|
|
39
|
+
import { type Snippet } from 'svelte';
|
|
8
40
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
9
41
|
type $$ComponentProps = SvelteHTMLElements['div'] & {
|
|
10
42
|
aside: Snippet;
|
|
@@ -14,6 +46,11 @@ type $$ComponentProps = SvelteHTMLElements['div'] & {
|
|
|
14
46
|
* @default '280px'
|
|
15
47
|
*/
|
|
16
48
|
column_width?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The stacked toggle's text and the aside's accessible name.
|
|
51
|
+
* @default 'menu'
|
|
52
|
+
*/
|
|
53
|
+
aside_label?: string;
|
|
17
54
|
};
|
|
18
55
|
declare const ColumnLayout: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
19
56
|
type ColumnLayout = ReturnType<typeof ColumnLayout>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnLayout.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/ColumnLayout.svelte"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"ColumnLayout.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/ColumnLayout.svelte"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCI;AACJ,OAAO,EAAQ,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG;IACpD,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAmEH,QAAA,MAAM,YAAY,sDAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
{:else}
|
|
131
131
|
<button
|
|
132
132
|
type="button"
|
|
133
|
-
class="
|
|
133
|
+
class="palette_c background-color:var(--bg_100)"
|
|
134
134
|
class:icon_button={!popover_button_content}
|
|
135
135
|
onclick={() => confirm(popover)}
|
|
136
136
|
title={rest.title ? `confirm ${rest.title}` : 'confirm'}
|
package/dist/ui/Datatable.svelte
CHANGED
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
position: sticky;
|
|
157
157
|
top: 0;
|
|
158
158
|
z-index: 1;
|
|
159
|
-
background: var(--
|
|
159
|
+
background: var(--shade_00, Canvas);
|
|
160
160
|
border-bottom: var(--border_width, 1px) solid var(--border_color);
|
|
161
161
|
}
|
|
162
162
|
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
.datatable-resize-handle:hover {
|
|
181
|
-
background: var(--
|
|
181
|
+
background: var(--palette_a_10);
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
.datatable-row {
|
package/dist/ui/LoginForm.svelte
CHANGED
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
const status_chip_class = (status: string): string => {
|
|
57
57
|
switch (status) {
|
|
58
58
|
case 'accepted':
|
|
59
|
-
return 'chip
|
|
59
|
+
return 'chip palette_b';
|
|
60
60
|
case 'pending':
|
|
61
|
-
return 'chip
|
|
61
|
+
return 'chip palette_a';
|
|
62
62
|
case 'declined':
|
|
63
63
|
case 'retracted':
|
|
64
64
|
case 'superseded':
|
|
65
65
|
case 'expired':
|
|
66
|
-
return 'chip
|
|
66
|
+
return 'chip palette_c';
|
|
67
67
|
default:
|
|
68
68
|
return 'chip';
|
|
69
69
|
}
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
<ul class="column gap_md">
|
|
66
66
|
{#each role_grant_offers.incoming as offer (offer.id)}
|
|
67
67
|
<li class="box p_md column gap_sm">
|
|
68
|
-
<div class="row gap_sm
|
|
69
|
-
<span class="chip
|
|
68
|
+
<div class="row gap_sm">
|
|
69
|
+
<span class="chip palette_a">{format_role(offer.role)}</span>
|
|
70
70
|
<span class="text_50 font_size_sm">{scope_label(offer.scope_id, offer.role)}</span>
|
|
71
71
|
<span class="text_50 font_size_sm">from {format_actor(offer.from_actor_id)}</span>
|
|
72
72
|
<span
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
pending={role_grant_offers.accept.loading}
|
|
87
87
|
disabled={role_grant_offers.accept.loading}
|
|
88
88
|
onclick={() => role_grant_offers.submit_accept(offer.id)}
|
|
89
|
-
class="
|
|
89
|
+
class="palette_b"
|
|
90
90
|
>
|
|
91
91
|
accept
|
|
92
92
|
</PendingButton>
|
|
@@ -117,7 +117,11 @@
|
|
|
117
117
|
></textarea>
|
|
118
118
|
</label>
|
|
119
119
|
<div class="row gap_sm">
|
|
120
|
-
<button
|
|
120
|
+
<button
|
|
121
|
+
type="button"
|
|
122
|
+
class="palette_c background-color:var(--bg_100)"
|
|
123
|
+
onclick={confirm}
|
|
124
|
+
>
|
|
121
125
|
confirm decline
|
|
122
126
|
</button>
|
|
123
127
|
<button type="button" onclick={() => popover.hide()}>cancel</button>
|
|
@@ -90,11 +90,11 @@
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
const auth_chip_class = (auth: RouteAuth): string => {
|
|
93
|
-
if (is_public_auth(auth)) return 'chip
|
|
94
|
-
if (is_keeper_auth(auth)) return 'chip
|
|
95
|
-
if (is_role_auth(auth)) return 'chip
|
|
96
|
-
if (is_credential_gated_auth(auth)) return 'chip
|
|
97
|
-
if (is_plain_authenticated_auth(auth)) return 'chip
|
|
93
|
+
if (is_public_auth(auth)) return 'chip palette_b';
|
|
94
|
+
if (is_keeper_auth(auth)) return 'chip palette_c';
|
|
95
|
+
if (is_role_auth(auth)) return 'chip palette_d';
|
|
96
|
+
if (is_credential_gated_auth(auth)) return 'chip palette_e';
|
|
97
|
+
if (is_plain_authenticated_auth(auth)) return 'chip palette_a';
|
|
98
98
|
return 'chip';
|
|
99
99
|
};
|
|
100
100
|
|
|
@@ -107,15 +107,15 @@
|
|
|
107
107
|
<section>
|
|
108
108
|
<div class="row" style:gap="var(--space_md)" style:flex-wrap="wrap" style:align-items="center">
|
|
109
109
|
<span class="chip">{surface.routes.length} routes</span>
|
|
110
|
-
{#if summary.none > 0}<span class="chip
|
|
110
|
+
{#if summary.none > 0}<span class="chip palette_b">{summary.none} public</span>{/if}
|
|
111
111
|
{#if summary.authenticated > 0}
|
|
112
|
-
<span class="chip
|
|
112
|
+
<span class="chip palette_a">{summary.authenticated} authenticated</span>
|
|
113
113
|
{/if}
|
|
114
|
-
{#if role_count > 0}<span class="chip
|
|
114
|
+
{#if role_count > 0}<span class="chip palette_d">{role_count} role</span>{/if}
|
|
115
115
|
{#if credential_count > 0}
|
|
116
|
-
<span class="chip
|
|
116
|
+
<span class="chip palette_e">{credential_count} credential-gated</span>
|
|
117
117
|
{/if}
|
|
118
|
-
{#if summary.keeper > 0}<span class="chip
|
|
118
|
+
{#if summary.keeper > 0}<span class="chip palette_c">{summary.keeper} keeper</span>{/if}
|
|
119
119
|
<span class="chip">{surface.middleware.length} middleware</span>
|
|
120
120
|
{#if rpc_method_count > 0}<span class="chip">{rpc_method_count} rpc methods</span>{/if}
|
|
121
121
|
{#if ws_method_count > 0}<span class="chip">{ws_method_count} ws methods</span>{/if}
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
(d: AppSurfaceDiagnostic) => d.level === 'warning'
|
|
127
127
|
)}
|
|
128
128
|
{#if warnings.length}
|
|
129
|
-
<span class="chip
|
|
129
|
+
<span class="chip palette_e">
|
|
130
130
|
{warnings.length} warning{warnings.length === 1 ? '' : 's'}
|
|
131
131
|
</span>
|
|
132
132
|
{/if}
|
|
@@ -391,10 +391,10 @@
|
|
|
391
391
|
<code>{endpoint.path}</code>
|
|
392
392
|
<span class="chip">{endpoint.methods.length} methods</span>
|
|
393
393
|
{#each endpoint.required_roles as role (role)}
|
|
394
|
-
<span class="chip
|
|
394
|
+
<span class="chip palette_d">role:{role}</span>
|
|
395
395
|
{/each}
|
|
396
396
|
{#each endpoint.allowed_origins as origin (origin)}
|
|
397
|
-
<span class="chip
|
|
397
|
+
<span class="chip palette_b"><code>{origin}</code></span>
|
|
398
398
|
{/each}
|
|
399
399
|
</div>
|
|
400
400
|
{#if endpoint.methods.length === 0}
|
|
@@ -473,7 +473,7 @@
|
|
|
473
473
|
{#each surface.diagnostics as d, i (i)}
|
|
474
474
|
<tr>
|
|
475
475
|
<td>
|
|
476
|
-
<span class={d.level === 'warning' ? 'chip
|
|
476
|
+
<span class={d.level === 'warning' ? 'chip palette_e' : 'chip'}>{d.level}</span>
|
|
477
477
|
</td>
|
|
478
478
|
<td><code>{d.category}</code></td>
|
|
479
479
|
<td>{d.message}</td>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.123.0",
|
|
4
4
|
"description": "fullstack app library",
|
|
5
5
|
"glyph": "🗝",
|
|
6
6
|
"logo": "logo.svg",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@electric-sql/pglite": ">=0.4",
|
|
35
35
|
"@fuzdev/blake3-wasm": ">=0.2.0",
|
|
36
|
+
"@fuzdev/fuz_css": ">=0.65.0",
|
|
36
37
|
"@fuzdev/fuz_util": ">=0.70.0",
|
|
37
38
|
"@hono/node-server": ">=1",
|
|
38
39
|
"@hono/node-ws": ">=1",
|
|
@@ -49,6 +50,9 @@
|
|
|
49
50
|
"@electric-sql/pglite": {
|
|
50
51
|
"optional": true
|
|
51
52
|
},
|
|
53
|
+
"@fuzdev/fuz_css": {
|
|
54
|
+
"optional": true
|
|
55
|
+
},
|
|
52
56
|
"@hono/node-server": {
|
|
53
57
|
"optional": true
|
|
54
58
|
},
|
|
@@ -74,10 +78,10 @@
|
|
|
74
78
|
"devDependencies": {
|
|
75
79
|
"@electric-sql/pglite": "^0.4.5",
|
|
76
80
|
"@fuzdev/blake3-wasm": "^0.2.0",
|
|
77
|
-
"@fuzdev/fuz_code": "^0.
|
|
78
|
-
"@fuzdev/fuz_css": "^0.
|
|
79
|
-
"@fuzdev/fuz_ui": "^0.
|
|
80
|
-
"@fuzdev/fuz_util": "^0.
|
|
81
|
+
"@fuzdev/fuz_code": "^0.50.0",
|
|
82
|
+
"@fuzdev/fuz_css": "^0.65.0",
|
|
83
|
+
"@fuzdev/fuz_ui": "^0.210.0",
|
|
84
|
+
"@fuzdev/fuz_util": "^0.71.0",
|
|
81
85
|
"@fuzdev/gro": "^0.213.0",
|
|
82
86
|
"@fuzdev/mdz": "^0.3.0",
|
|
83
87
|
"@hono/node-server": "^1.19.14",
|