@sovereignfs/ui 0.99.0 → 0.104.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/CHANGELOG.md +46 -0
- package/dist/Account.module.css +122 -0
- package/dist/Auth.module.css +38 -0
- package/dist/ExportPanel.module.css +18 -0
- package/dist/InstallPrompt.module.css +44 -0
- package/dist/PushControl.module.css +52 -0
- package/dist/UpdateNotice.module.css +31 -0
- package/dist/index.d.ts +398 -4
- package/dist/index.js +3589 -2340
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, ButtonHTMLAttributes, HTMLAttributes, FormHTMLAttributes, AnchorHTMLAttributes, SelectHTMLAttributes, ReactElement, CSSProperties, InputHTMLAttributes, Ref, TextareaHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, LabelHTMLAttributes, ElementType, MouseEventHandler, PointerEvent, KeyboardEvent,
|
|
2
|
+
import { ReactNode, ButtonHTMLAttributes, HTMLAttributes, FormHTMLAttributes, AnchorHTMLAttributes, SelectHTMLAttributes, ReactElement, CSSProperties, InputHTMLAttributes, Ref, TextareaHTMLAttributes, MouseEvent, TdHTMLAttributes, ThHTMLAttributes, LabelHTMLAttributes, ElementType, MouseEventHandler, PointerEvent, KeyboardEvent, RefObject } from 'react';
|
|
3
3
|
import * as _dnd_kit_core from '@dnd-kit/core';
|
|
4
4
|
|
|
5
5
|
interface LegalLinksProps {
|
|
@@ -135,6 +135,252 @@ interface AuthCodeInputProps {
|
|
|
135
135
|
*/
|
|
136
136
|
declare function AuthCodeInput({ label, value, onChange, length, disabled, invalid, }: AuthCodeInputProps): react.JSX.Element;
|
|
137
137
|
|
|
138
|
+
/** How a link is drawn: the consumer's router link, or a plain `<a>` when none is given. */
|
|
139
|
+
type AuthLinkRenderer = (props: AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
140
|
+
href: string;
|
|
141
|
+
}) => ReactNode;
|
|
142
|
+
|
|
143
|
+
interface SignInFormProps {
|
|
144
|
+
/** The app's name, for "New to … ?". */
|
|
145
|
+
appName: string;
|
|
146
|
+
/** What the person arrived to be told (signed out, a link that did not work), above the form. */
|
|
147
|
+
notice?: ReactNode;
|
|
148
|
+
/** What went wrong with the last attempt, in one sentence. */
|
|
149
|
+
error?: string | undefined;
|
|
150
|
+
/** The address must be verified before signing in: what to show, with the address typed (a way to send the link again). */
|
|
151
|
+
renderUnverified?: ((email: string) => ReactNode) | undefined;
|
|
152
|
+
/** Whether that is the case now. */
|
|
153
|
+
unverified?: boolean;
|
|
154
|
+
/** A sign-in is under way: the boxes are off and the button says so. */
|
|
155
|
+
pending?: boolean;
|
|
156
|
+
/** Signing in with a passkey, when the browser offers one. Leave out to offer none. */
|
|
157
|
+
passkey?: {
|
|
158
|
+
pending: boolean;
|
|
159
|
+
onClick: () => void;
|
|
160
|
+
} | undefined;
|
|
161
|
+
/** The email and password, once the person submits them. The form never sends anything itself. */
|
|
162
|
+
onSubmit: (values: {
|
|
163
|
+
email: string;
|
|
164
|
+
password: string;
|
|
165
|
+
}) => void;
|
|
166
|
+
/** Where to ask for a reset link. Leave out where the app cannot send one (no mail). */
|
|
167
|
+
forgotPasswordHref?: string | undefined;
|
|
168
|
+
/** Other ways in, under the passkey: "Continue with Sovereign" for an app that signs in through core too. */
|
|
169
|
+
otherWays?: ReactNode;
|
|
170
|
+
/** Where to create an account. Leave out where nobody may. */
|
|
171
|
+
signUpHref?: string | undefined;
|
|
172
|
+
renderLink?: AuthLinkRenderer;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* The sign-in form of core and every app (auth.md §7): an email, a password, a passkey if the browser has one, and a way to create an
|
|
176
|
+
* account. It draws and collects; the consumer signs in (`@sovereignfs/auth/client`) and says what happened through its props.
|
|
177
|
+
*/
|
|
178
|
+
declare function SignInForm({ appName, notice, error, renderUnverified, unverified, pending, passkey, onSubmit, forgotPasswordHref, otherWays, signUpHref, renderLink, }: SignInFormProps): react.JSX.Element;
|
|
179
|
+
|
|
180
|
+
interface ForgotPasswordFormProps {
|
|
181
|
+
/** The address the link went to, once it has: the form gives way to what was sent. */
|
|
182
|
+
sentTo?: string | undefined;
|
|
183
|
+
error?: string | undefined;
|
|
184
|
+
pending?: boolean;
|
|
185
|
+
/** The address, once the person submits it. The form never sends anything itself. */
|
|
186
|
+
onSubmit: (email: string) => void;
|
|
187
|
+
signInHref: string;
|
|
188
|
+
renderLink?: AuthLinkRenderer;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Asking for a link to reset the password (auth.md §7), for core and every app. What it says once sent is the same whether or not the
|
|
192
|
+
* address has an account.
|
|
193
|
+
*/
|
|
194
|
+
declare function ForgotPasswordForm({ sentTo, error, pending, onSubmit, signInHref, renderLink, }: ForgotPasswordFormProps): react.JSX.Element;
|
|
195
|
+
|
|
196
|
+
interface ResetPasswordFormProps {
|
|
197
|
+
/** The password policy in one sentence, under the box. */
|
|
198
|
+
passwordHint: string;
|
|
199
|
+
error?: string | undefined;
|
|
200
|
+
/** The link has run out or was used: the form gives way to a way to ask for a new one. */
|
|
201
|
+
expired?: boolean;
|
|
202
|
+
pending?: boolean;
|
|
203
|
+
/** The new password, typed twice, once the person submits it. The form never sends anything itself. */
|
|
204
|
+
onSubmit: (values: {
|
|
205
|
+
password: string;
|
|
206
|
+
confirm: string;
|
|
207
|
+
}) => void;
|
|
208
|
+
signInHref: string;
|
|
209
|
+
newLinkHref: string;
|
|
210
|
+
renderLink?: AuthLinkRenderer;
|
|
211
|
+
}
|
|
212
|
+
/** Setting a new password from an emailed link (auth.md §7), for core and every app. */
|
|
213
|
+
declare function ResetPasswordForm({ passwordHint, error, expired, pending, onSubmit, signInHref, newLinkHref, renderLink, }: ResetPasswordFormProps): react.JSX.Element;
|
|
214
|
+
|
|
215
|
+
/** What a sign-up hands over. */
|
|
216
|
+
interface SignUpValues {
|
|
217
|
+
name: string;
|
|
218
|
+
email: string;
|
|
219
|
+
password: string;
|
|
220
|
+
confirm: string;
|
|
221
|
+
/** Whether the box accepting the terms is ticked; `true` where the app asks for none. */
|
|
222
|
+
agreed: boolean;
|
|
223
|
+
}
|
|
224
|
+
interface SignUpFormProps {
|
|
225
|
+
appName: string;
|
|
226
|
+
/** The password policy in one sentence, under the box. */
|
|
227
|
+
passwordHint: string;
|
|
228
|
+
/** The address of the invitation the page was opened from: the box starts with it and cannot be changed. */
|
|
229
|
+
invitedEmail?: string | undefined;
|
|
230
|
+
/** The privacy policy and terms to accept, as a box to tick. `false` for an app that has none. */
|
|
231
|
+
terms?: {
|
|
232
|
+
privacyHref: string;
|
|
233
|
+
tosHref: string;
|
|
234
|
+
} | false;
|
|
235
|
+
error?: string | undefined;
|
|
236
|
+
pending?: boolean;
|
|
237
|
+
/** The address a verification link went to: the form gives way to waiting for it. */
|
|
238
|
+
waitingFor?: string | undefined;
|
|
239
|
+
/** While waiting: a way to send the link again, for that address. */
|
|
240
|
+
renderWaiting?: ((email: string) => ReactNode) | undefined;
|
|
241
|
+
/** What the person typed, once they submit it. The form never sends anything itself. */
|
|
242
|
+
onSubmit: (values: SignUpValues) => void;
|
|
243
|
+
signInHref: string;
|
|
244
|
+
renderLink?: AuthLinkRenderer;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Creating an account (auth.md §7), for core and every app: a name, the address (an invitation's, when there is one), the password
|
|
248
|
+
* typed twice, and the terms when the app has them. Once a verification link is sent, it says so and waits.
|
|
249
|
+
*/
|
|
250
|
+
declare function SignUpForm({ appName, passwordHint, invitedEmail, terms, error, pending, waitingFor, renderWaiting, onSubmit, signInHref, renderLink, }: SignUpFormProps): react.JSX.Element;
|
|
251
|
+
|
|
252
|
+
interface TwoFactorFormProps {
|
|
253
|
+
error?: string | undefined;
|
|
254
|
+
pending?: boolean;
|
|
255
|
+
/** The sign-in this step belongs to cannot go on (it timed out, or too many wrong codes): only signing in again helps. */
|
|
256
|
+
over?: boolean;
|
|
257
|
+
/** Signing in with a passkey instead, when the browser offers one. Leave out to offer none. */
|
|
258
|
+
passkey?: {
|
|
259
|
+
pending: boolean;
|
|
260
|
+
onClick: () => void;
|
|
261
|
+
} | undefined;
|
|
262
|
+
/** The code, once the person submits it, and whether it is a backup code. The form never sends anything itself. */
|
|
263
|
+
onSubmit: (values: {
|
|
264
|
+
code: string;
|
|
265
|
+
backup: boolean;
|
|
266
|
+
}) => void;
|
|
267
|
+
/** The person switched between the authenticator's code and a backup code: what was said about the last one no longer holds. */
|
|
268
|
+
onModeChange?: () => void;
|
|
269
|
+
signInAgainHref: string;
|
|
270
|
+
renderLink?: AuthLinkRenderer;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* The second sign-in step (auth.md §4, rule 4), for core and every app: the six digits from the authenticator app, or one of the
|
|
274
|
+
* backup codes, or a passkey instead. There is no "trust this device".
|
|
275
|
+
*/
|
|
276
|
+
declare function TwoFactorForm({ error, pending, over, passkey, onSubmit, onModeChange, signInAgainHref, renderLink, }: TwoFactorFormProps): react.JSX.Element;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* What a server action of an account panel answers (the design system's error convention): an expected failure is never thrown, it is
|
|
280
|
+
* said in one sentence the person can act on, beside what they were doing.
|
|
281
|
+
*/
|
|
282
|
+
type ActionResult = {
|
|
283
|
+
ok: true;
|
|
284
|
+
message?: string;
|
|
285
|
+
} | {
|
|
286
|
+
ok: false;
|
|
287
|
+
error: string;
|
|
288
|
+
};
|
|
289
|
+
/** A server action as `useActionState` takes it. */
|
|
290
|
+
type PanelAction = (previous: ActionResult | null, form: FormData) => Promise<ActionResult>;
|
|
291
|
+
|
|
292
|
+
/** One of the person's sessions, as the panel shows it. It never carries the session's token. */
|
|
293
|
+
interface SessionRow {
|
|
294
|
+
id: string;
|
|
295
|
+
/** The session this very browser is using. */
|
|
296
|
+
current: boolean;
|
|
297
|
+
/** "Chrome on macOS". */
|
|
298
|
+
device: string;
|
|
299
|
+
ipAddress: string | null;
|
|
300
|
+
signedInAt: number;
|
|
301
|
+
lastActiveAt: number;
|
|
302
|
+
}
|
|
303
|
+
interface SessionsPanelProps {
|
|
304
|
+
sessions: SessionRow[];
|
|
305
|
+
/** Ends one session, by its id: the app's server action, which checks it is the person's own. */
|
|
306
|
+
endSession: (id: string, previous: ActionResult | null, form: FormData) => Promise<ActionResult>;
|
|
307
|
+
/** Ends every session but this one. */
|
|
308
|
+
endOthers: PanelAction;
|
|
309
|
+
}
|
|
310
|
+
/** The person's open sessions, with a way to end any of them, or all but this one (auth.md §7). */
|
|
311
|
+
declare function SessionsPanel({ sessions, endSession, endOthers }: SessionsPanelProps): react.JSX.Element;
|
|
312
|
+
|
|
313
|
+
interface ChangePasswordFormProps {
|
|
314
|
+
error?: string | undefined;
|
|
315
|
+
/** The password is changed: the boxes empty and the form says so. */
|
|
316
|
+
done?: boolean;
|
|
317
|
+
pending?: boolean;
|
|
318
|
+
/** The current and the new password, once the person submits them. The form never sends anything itself. */
|
|
319
|
+
onSubmit: (values: {
|
|
320
|
+
current: string;
|
|
321
|
+
next: string;
|
|
322
|
+
}) => void;
|
|
323
|
+
}
|
|
324
|
+
/** Changing the password (auth.md §7): it asks for the current one, and ends every other session. */
|
|
325
|
+
declare function ChangePasswordForm({ error, done, pending, onSubmit, }: ChangePasswordFormProps): react.JSX.Element;
|
|
326
|
+
|
|
327
|
+
/** A change to the second step, which always asks for the password first. */
|
|
328
|
+
type TwoFactorAction = 'enable' | 'regenerate' | 'disable';
|
|
329
|
+
/** What starting a change came to: a sentence to show, an enrolment to confirm, new backup codes, or the second step turned off. */
|
|
330
|
+
type TwoFactorStart = {
|
|
331
|
+
error: string;
|
|
332
|
+
} | {
|
|
333
|
+
uri: string;
|
|
334
|
+
codes: string[];
|
|
335
|
+
} | {
|
|
336
|
+
codes: string[];
|
|
337
|
+
} | {
|
|
338
|
+
off: true;
|
|
339
|
+
};
|
|
340
|
+
interface TwoFactorPanelProps {
|
|
341
|
+
enabled: boolean;
|
|
342
|
+
/** Whether the address is verified: the second step needs it first. */
|
|
343
|
+
verified: boolean;
|
|
344
|
+
/** Starts a change with the password the person typed (the app derives and sends it). */
|
|
345
|
+
start: (action: TwoFactorAction, password: string) => Promise<TwoFactorStart>;
|
|
346
|
+
/** Confirms an enrolment with a code from the authenticator app; a sentence when it was refused. */
|
|
347
|
+
confirm: (code: string) => Promise<{
|
|
348
|
+
error?: string;
|
|
349
|
+
}>;
|
|
350
|
+
/** Draws the enrolment's QR code; the app brings the encoder (`QrCode` takes its modules). */
|
|
351
|
+
renderQr: (uri: string) => ReactNode;
|
|
352
|
+
/** After a change is done or cancelled, so the page shows what the server holds (the app reloads it). */
|
|
353
|
+
onDone: () => void;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Turning the second sign-in step on and off, and its backup codes (auth.md §7), for core and every app. Every change asks for the
|
|
357
|
+
* password again, which the app checks on the server.
|
|
358
|
+
*/
|
|
359
|
+
declare function TwoFactorPanel({ enabled, verified, start, confirm, renderQr, onDone, }: TwoFactorPanelProps): react.JSX.Element;
|
|
360
|
+
|
|
361
|
+
interface ProfilePanelProps {
|
|
362
|
+
name: string;
|
|
363
|
+
email: string;
|
|
364
|
+
/** The address of the person's picture, or null when they have none. */
|
|
365
|
+
image: string | null;
|
|
366
|
+
/** Saves the name; a sentence when it was refused. */
|
|
367
|
+
saveName: (name: string) => Promise<{
|
|
368
|
+
error?: string;
|
|
369
|
+
}>;
|
|
370
|
+
/** Makes a chosen file the picture to keep (cropped and scaled by the app); throws when it cannot. */
|
|
371
|
+
preparePicture: (file: Blob) => Promise<Blob>;
|
|
372
|
+
/** What to say when a file could not be prepared. */
|
|
373
|
+
describePictureError?: (error: unknown) => string;
|
|
374
|
+
/** Keeps a prepared picture, or removes the picture with `null`: the new address, or a sentence. */
|
|
375
|
+
savePicture: (picture: Blob | null) => Promise<{
|
|
376
|
+
image: string | null;
|
|
377
|
+
} | {
|
|
378
|
+
error: string;
|
|
379
|
+
}>;
|
|
380
|
+
}
|
|
381
|
+
/** The person's name, their picture, and their email address, which is shown and cannot be changed (auth.md §7). */
|
|
382
|
+
declare function ProfilePanel({ name, email, image, saveName, preparePicture, describePictureError, savePicture, }: ProfilePanelProps): react.JSX.Element;
|
|
383
|
+
|
|
138
384
|
interface ConsentPromptProps {
|
|
139
385
|
/** The plugin requesting access. */
|
|
140
386
|
consumerName: string;
|
|
@@ -808,6 +1054,54 @@ interface ConfirmDialogProps {
|
|
|
808
1054
|
*/
|
|
809
1055
|
declare function ConfirmDialog({ open, onClose, title, message, onConfirm, confirmLabel, cancelLabel, destructive, pending, error, }: ConfirmDialogProps): react.JSX.Element;
|
|
810
1056
|
|
|
1057
|
+
/** Where an export stands, as a page shows it: never its file, nor whose session asked (`viewOf` in `@sovereignfs/export`). */
|
|
1058
|
+
type ExportPanelStatus = {
|
|
1059
|
+
state: 'none';
|
|
1060
|
+
} | {
|
|
1061
|
+
state: 'making';
|
|
1062
|
+
requestedAt: number;
|
|
1063
|
+
} | {
|
|
1064
|
+
state: 'ready';
|
|
1065
|
+
id: string;
|
|
1066
|
+
size: number;
|
|
1067
|
+
until: number;
|
|
1068
|
+
here: boolean;
|
|
1069
|
+
} | {
|
|
1070
|
+
state: 'failed';
|
|
1071
|
+
finishedAt: number;
|
|
1072
|
+
} | {
|
|
1073
|
+
state: 'gone';
|
|
1074
|
+
};
|
|
1075
|
+
type ExportStartResult = {
|
|
1076
|
+
ok: true;
|
|
1077
|
+
} | {
|
|
1078
|
+
ok: false;
|
|
1079
|
+
error: string;
|
|
1080
|
+
};
|
|
1081
|
+
interface ExportPanelProps {
|
|
1082
|
+
status: ExportPanelStatus;
|
|
1083
|
+
/** Asks for an export with the password the person typed. The consumer derives what it sends and calls its own action. */
|
|
1084
|
+
onStart: (password: string) => Promise<ExportStartResult>;
|
|
1085
|
+
/** Where the download form posts, for a ready export. */
|
|
1086
|
+
downloadAction: (id: string) => string;
|
|
1087
|
+
/** Called every few seconds while an export is being made, and after a download, to show the new state. */
|
|
1088
|
+
onRefresh?: () => void;
|
|
1089
|
+
/** Says why no export can be taken yet, and turns the form off. */
|
|
1090
|
+
disabledReason?: string;
|
|
1091
|
+
confirmTitle: string;
|
|
1092
|
+
confirmMessage: string;
|
|
1093
|
+
startLabel: string;
|
|
1094
|
+
passwordHint?: string;
|
|
1095
|
+
/** The time zone times are written in. Default UTC, so the server and the browser agree. */
|
|
1096
|
+
timeZone?: string;
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* Taking an export and downloading it once: the password asked again, a confirmation of what the export holds, the state while it is
|
|
1100
|
+
* made, and a download that works once. The same for an operator's export and a person's, in core and in an app with no core. It knows
|
|
1101
|
+
* no framework: the consumer says how to start one, where to download it and how to look again.
|
|
1102
|
+
*/
|
|
1103
|
+
declare function ExportPanel({ status, onStart, downloadAction, onRefresh, disabledReason, confirmTitle, confirmMessage, startLabel, passwordHint, timeZone, }: ExportPanelProps): react.JSX.Element;
|
|
1104
|
+
|
|
811
1105
|
interface MenuItem {
|
|
812
1106
|
type?: 'item';
|
|
813
1107
|
label: string;
|
|
@@ -1088,13 +1382,18 @@ interface AppTileProps {
|
|
|
1088
1382
|
external?: boolean;
|
|
1089
1383
|
/** Draws the picture in shades of grey, so tiles whose icons come from elsewhere still look like one set. */
|
|
1090
1384
|
monochrome?: boolean;
|
|
1385
|
+
/**
|
|
1386
|
+
* Called when the link is clicked, before the browser follows it. The consumer decides how it opens (for example, in a new window
|
|
1387
|
+
* when the page runs as an installed app) and calls `event.preventDefault()` when it does so itself. Only with `href`.
|
|
1388
|
+
*/
|
|
1389
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
1091
1390
|
className?: string;
|
|
1092
1391
|
}
|
|
1093
1392
|
/**
|
|
1094
1393
|
* AppTile — one app in a grid: a rounded icon box, the name, a line about it and, beneath a divider, what kind of app it is. The
|
|
1095
1394
|
* whole tile is the link when `href` is given. Lay tiles out with `CardTileGrid`.
|
|
1096
1395
|
*/
|
|
1097
|
-
declare function AppTile({ icon, name, description, tags, href, variant, external, monochrome, className, }: AppTileProps): react.JSX.Element;
|
|
1396
|
+
declare function AppTile({ icon, name, description, tags, href, variant, external, monochrome, onClick, className, }: AppTileProps): react.JSX.Element;
|
|
1098
1397
|
|
|
1099
1398
|
interface CardTileGridProps {
|
|
1100
1399
|
children: ReactNode;
|
|
@@ -1521,6 +1820,101 @@ interface OfflineGateProps {
|
|
|
1521
1820
|
*/
|
|
1522
1821
|
declare function OfflineGate({ children, surfaceName, className }: OfflineGateProps): react.JSX.Element;
|
|
1523
1822
|
|
|
1823
|
+
/** How to add a site to the Home Screen on an iPhone or iPad, which has no install prompt: one sentence, shared with `PushControl`. */
|
|
1824
|
+
declare const IOS_INSTALL_STEPS = "tap Share, then Add to Home Screen.";
|
|
1825
|
+
/** What a device lets a page do about installing it. */
|
|
1826
|
+
type InstallKind = 'prompt' | 'ios';
|
|
1827
|
+
interface InstallHintProps {
|
|
1828
|
+
/** The name the installed app will have. */
|
|
1829
|
+
appName: string;
|
|
1830
|
+
/**
|
|
1831
|
+
* `prompt`: the browser has its own install prompt, which **Install** opens. `ios`: Safari on an iPhone or iPad,
|
|
1832
|
+
* which has none, so the hint says how (Share, then Add to Home Screen).
|
|
1833
|
+
*/
|
|
1834
|
+
kind: InstallKind;
|
|
1835
|
+
/** Called by **Install** (only for `prompt`). */
|
|
1836
|
+
onInstall?: () => void;
|
|
1837
|
+
/** Called by **Not now**. */
|
|
1838
|
+
onDismiss: () => void;
|
|
1839
|
+
className?: string;
|
|
1840
|
+
}
|
|
1841
|
+
/**
|
|
1842
|
+
* InstallHint — says that this site can be installed as an app, and how. The presentation only: `InstallPrompt`
|
|
1843
|
+
* decides whether to show it.
|
|
1844
|
+
*/
|
|
1845
|
+
declare function InstallHint({ appName, kind, onInstall, onDismiss, className }: InstallHintProps): react.JSX.Element;
|
|
1846
|
+
/** Whether the page is already running as an installed app. Read only in an effect or a handler. */
|
|
1847
|
+
declare function isInstalledDisplay(): boolean;
|
|
1848
|
+
interface UseInstallPrompt {
|
|
1849
|
+
/** What can be offered now, or `null` when nothing should be shown. */
|
|
1850
|
+
kind: InstallKind | null;
|
|
1851
|
+
install(): Promise<void>;
|
|
1852
|
+
dismiss(): void;
|
|
1853
|
+
}
|
|
1854
|
+
/**
|
|
1855
|
+
* useInstallPrompt — whether to offer installing this site, decided on the device: nothing in an installed window,
|
|
1856
|
+
* nothing once dismissed (kept on this device only), the browser's prompt where it offers one, words for iPhone and
|
|
1857
|
+
* iPad Safari. Starts as `null` on the server and on the first render, so the markup is the same for everyone.
|
|
1858
|
+
*/
|
|
1859
|
+
declare function useInstallPrompt(storageKey?: string): UseInstallPrompt;
|
|
1860
|
+
interface InstallPromptProps {
|
|
1861
|
+
appName: string;
|
|
1862
|
+
/** Where a dismissal is remembered on the device. */
|
|
1863
|
+
storageKey?: string;
|
|
1864
|
+
className?: string;
|
|
1865
|
+
}
|
|
1866
|
+
/**
|
|
1867
|
+
* InstallPrompt — offers to install this site as an app where the device allows it, and renders nothing anywhere
|
|
1868
|
+
* else (an installed window, a browser with no install, a dismissed hint).
|
|
1869
|
+
*/
|
|
1870
|
+
declare function InstallPrompt({ appName, storageKey, className }: InstallPromptProps): react.JSX.Element | null;
|
|
1871
|
+
|
|
1872
|
+
interface UpdateNoticeProps {
|
|
1873
|
+
/** The app's name, as the person knows it. */
|
|
1874
|
+
appName: string;
|
|
1875
|
+
/** Called by **Reload**: the consumer activates the new version, then reloads. */
|
|
1876
|
+
onReload: () => void;
|
|
1877
|
+
/** Called by **Later**. If omitted, no Later button is shown. */
|
|
1878
|
+
onDismiss?: () => void;
|
|
1879
|
+
/** While the new version is taking over, **Reload** says so and cannot be pressed twice. */
|
|
1880
|
+
reloading?: boolean;
|
|
1881
|
+
className?: string;
|
|
1882
|
+
}
|
|
1883
|
+
/**
|
|
1884
|
+
* UpdateNotice — a quiet notice, fixed at the bottom of the window, that a new version of the app is ready and
|
|
1885
|
+
* takes over when the person chooses, so nothing they were doing is thrown away by a silent swap. The consumer
|
|
1886
|
+
* decides when to show it (a service worker waiting) and what Reload does.
|
|
1887
|
+
*/
|
|
1888
|
+
declare function UpdateNotice({ appName, onReload, onDismiss, reloading, className, }: UpdateNoticeProps): react.JSX.Element;
|
|
1889
|
+
|
|
1890
|
+
/**
|
|
1891
|
+
* What a device can do about notifications from an app, as `usePush` in `@sovereignfs/pwa/client` reports it:
|
|
1892
|
+
* - `checking`: not known yet (the server and the first render). Nothing is shown.
|
|
1893
|
+
* - `unavailable`: the app sends no notifications (its server has no key). Nothing is shown.
|
|
1894
|
+
* - `unsupported`, `insecure`, `install-first`, `blocked`: why this device can't have them, and what to do.
|
|
1895
|
+
* - `off` / `on`: the switch.
|
|
1896
|
+
*/
|
|
1897
|
+
type PushControlState = 'checking' | 'unavailable' | 'unsupported' | 'insecure' | 'install-first' | 'blocked' | 'off' | 'on';
|
|
1898
|
+
interface PushControlProps {
|
|
1899
|
+
/** The app's name, as people know it. */
|
|
1900
|
+
appName: string;
|
|
1901
|
+
state: PushControlState;
|
|
1902
|
+
/** Turning on or off is under way: the switch is busy. */
|
|
1903
|
+
working?: boolean;
|
|
1904
|
+
/** Why turning on or off didn't work, shown beside the switch. */
|
|
1905
|
+
error?: string | null;
|
|
1906
|
+
onTurnOn: () => void;
|
|
1907
|
+
onTurnOff: () => void;
|
|
1908
|
+
/** More for when it is on or off, such as a button that sends a test notification. */
|
|
1909
|
+
children?: ReactNode;
|
|
1910
|
+
className?: string;
|
|
1911
|
+
}
|
|
1912
|
+
/**
|
|
1913
|
+
* PushControl — "Notifications on this device", for an app's settings (RFC 0009 §3). It says plainly what this device can do and
|
|
1914
|
+
* offers one switch. Framework-agnostic: the state and the two actions come from the app (`usePush`).
|
|
1915
|
+
*/
|
|
1916
|
+
declare function PushControl({ appName, state, working, error, onTurnOn, onTurnOff, children, className, }: PushControlProps): react.JSX.Element | null;
|
|
1917
|
+
|
|
1524
1918
|
interface DeviceOnlyGateProps {
|
|
1525
1919
|
children: ReactNode;
|
|
1526
1920
|
/** Defaults to a generic "this app" phrasing — pass the plugin's own name. */
|
|
@@ -3801,5 +4195,5 @@ interface QrCodeProps {
|
|
|
3801
4195
|
*/
|
|
3802
4196
|
declare function QrCode({ modules, label }: QrCodeProps): react.JSX.Element;
|
|
3803
4197
|
|
|
3804
|
-
export { Accordion, Alert, AppTile, AppsLauncher, AspectRatio, AuthButton, AuthCard, AuthCodeInput, AuthDivider, AuthError, AuthField, AuthFooter, AuthForm, AuthLink, AuthLinkButton, AuthNotice, AuthShell, Avatar, AvatarStack, Badge, BalanceChip, BrandBadge, Breadcrumb, Button, ButtonGroup, ButtonLink, Calendar, Card, CardTile, CardTileGrid, CheckableListRow, Checkbox, CodeTextarea, Collapsible, ColorPicker, Combobox, Command, ConfirmDialog, ConsentPrompt, ContextMenu, CopyButton, CurrencyInput, DataTable, DatePicker, DateRangePicker, DeviceOnlyGate, DeviceStorageKeyGate, Dialog, DragHandleRow, Drawer, EmptyState, FileDropzone, FloatingActionButton, FormField, GripIcon, Header, HeaderFooterLayout, HoverCard, Icon, IconPicker, Input, Item, Kbd, Label, LegalLinks, LockedState, MOBILE_BREAKPOINT_PX, Markdown, Marker, MemberMultiSelect, Menu, MenuEntries, Menubar, Message, MessageScroller, MobileAppsDrawer, MobileFooter, MobileHeader, NavList, NavTabs, NavigationMenu, NewCardTile, NotificationsPanel, OfflineGate, OverlayHeader, PageContainer, PageHeader, PageLayout, Pagination, PhotoGallery, PhotoGrid, PhotoViewer, Popover, Progress, QrCode, QuantityStepper, RadioGroup, RangeCalendar, RecoveryKit, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResponsiveSurface, RootLayout, SWIPE_STACK_TRANSITION_MS, ScrollArea, SegmentedControl, Select, Sheet, Slider, Spinner, SplitMethodSelector, SplitPane, StatusBadge, StepStrip, SuggestionInput, SwipableMobileCarousel, SwipableMobileCarouselDots, SwipableMobileCarouselSlide, SwipableMobileCarouselSlideBody, SwipableMobileCarouselSlideFooter, SwipableMobileCarouselSlideHeader, SwipeStack, SwipeStackCard, SystemBanner, THEME_PRESETS, THEME_PRESET_NAMES, Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Tabs, TagInput, Textarea, ThreeColumnLayout, ToastProvider, Toggle, Tooltip, Typography, UserMenu, recoveryKitFileName, recoveryKitFileText, shouldHandleDndEvent, useCarouselRouteSync, useCommitOnEnterOrBlur, useDoubleTapHandler, useIsMobile, useIsOffline, useLongPress, useOfflineTileState, useOverlaySecondRow, useReorderSensors, useResponsiveLayout, useSingleOrDoubleTap, useSnapCarousel, useSwipeReveal, useSwipeStack, useToast };
|
|
3805
|
-
export type { AccordionItem, AccordionProps, AlertProps, AlertVariant, AppTileProps, AppsLauncherItem, AppsLauncherProps, AspectRatioProps, AuthCardProps, AuthCodeInputProps, AuthFieldControl, AuthFieldProps, AuthFooterProps, AvatarProps, AvatarStackPerson, AvatarStackProps, BadgeProps, BadgeStatus, BadgeVariant, BalanceChipProps, BannerVariant, BrandBadgeProps, BreadcrumbItem, BreadcrumbProps, ButtonGroupProps, ButtonLinkProps, ButtonProps, ButtonSize, ButtonVariant, CalendarProps, CardProps, CardTileGridProps, CardTileProps, CheckableListRowProps, CheckboxProps, CodeTextareaProps, CollapsibleProps, ColorPickerProps, ColorPickerSwatch, ComboboxOption, ComboboxProps, CommandItem, CommandProps, CommitOnEnterOrBlurHandlers, ConfirmDialogProps, ConsentPromptProps, ContextMenuProps, CopyButtonProps, CurrencyInputProps, DataTableColumn, DataTableProps, DatePickerProps, DateRange, DateRangePickerProps, DeviceOnlyGateProps, DeviceStorageKeyGateProps, DeviceStorageKeyGateStatus, DialogProps, DialogSize, DragHandleRowProps, DrawerProps, EmptyStateProps, FileDropzoneProps, FloatingActionButtonProps, FooterIcon, FormFieldProps, FormFieldRenderProps, GripIconProps, HeaderFooterLayoutProps, HeaderPlugin, HeaderProps, HoverCardProps, IconName, IconPickerProps, IconProps, InputProps, ItemProps, KbdProps, LabelProps, LegalLinksProps, LockedReason, LockedStateProps, LongPressHandlers, MarkdownProps, MarkerProps, MemberMultiSelectOption, MemberMultiSelectProps, MenuEntry, MenuItem, MenuLabel, MenuProps, MenuSeparator, MenubarMenu, MenubarProps, MessageProps, MessageScrollerProps, MessageSender, MobileAppsDrawerItem, MobileAppsDrawerProps, MobileFooterProps, MobileHeaderProps, NavListGroup, NavListItem, NavListLinkProps, NavListProps, NavTabItem, NavTabLinkProps, NavTabsProps, NavigationMenuItem, NavigationMenuProps, NewCardTileProps, NotificationsPanelItem, NotificationsPanelProps, OfflineGateProps, OfflineTileState, OverlayHeaderProps, PageContainerProps, PageHeaderProps, PageLayoutPadding, PageLayoutProps, PaginationProps, Photo, PhotoGalleryProps, PhotoGridProps, PhotoViewerProps, PopoverProps, ProgressProps, QrCodeProps, QuantityStepperProps, RadioGroupItem, RadioGroupProps, RangeCalendarProps, RecoveryKitProps, ResizableDirection, ResizableHandleProps, ResizablePanelGroupProps, ResizablePanelProps, ResponsiveSurfaceProps, RootLayoutProps, RootLayoutVariant, ScrollAreaProps, SegmentedControlProps, SegmentedOption, SelectProps, SheetProps, SliderProps, SortDirection, SpinnerProps, SplitMethod, SplitMethodSelectorProps, SplitPaneProps, StatusBadgeProps, StatusBadgeStatus, StepStripItem, StepStripProps, SuggestionInputProps, SuggestionOption, SwipableMobileCarouselDotsProps, SwipableMobileCarouselIndicatorProps, SwipableMobileCarouselProps, SwipableMobileCarouselSlideBodyProps, SwipableMobileCarouselSlideFooterProps, SwipableMobileCarouselSlideHeaderProps, SwipableMobileCarouselSlideProps, SwipeDirection, SwipeDirectionMeta, SwipeStackCardProps, SwipeStackProps, SystemBannerProps, TabItem, TableProps, TabsProps, TagInputProps, TextareaProps, ThemePresetName, ThemePresetTokens, ThreeColumnLayoutProps, ToastContextValue, ToastItem, ToggleProps, TooltipProps, TypographyProps, TypographyVariant, UseCarouselRouteSyncOptions, UseCarouselRouteSyncResult, UseLongPressOptions, UseReorderSensorsOptions, UseResponsiveLayoutOptions, UseResponsiveLayoutResult, UseSnapCarouselOptions, UseSnapCarouselResult, UseSwipeRevealHandlers, UseSwipeRevealOptions, UseSwipeRevealResult, UseSwipeStackHandlers, UseSwipeStackOptions, UseSwipeStackResult, UserMenuItem, UserMenuProps };
|
|
4198
|
+
export { Accordion, Alert, AppTile, AppsLauncher, AspectRatio, AuthButton, AuthCard, AuthCodeInput, AuthDivider, AuthError, AuthField, AuthFooter, AuthForm, AuthLink, AuthLinkButton, AuthNotice, AuthShell, Avatar, AvatarStack, Badge, BalanceChip, BrandBadge, Breadcrumb, Button, ButtonGroup, ButtonLink, Calendar, Card, CardTile, CardTileGrid, ChangePasswordForm, CheckableListRow, Checkbox, CodeTextarea, Collapsible, ColorPicker, Combobox, Command, ConfirmDialog, ConsentPrompt, ContextMenu, CopyButton, CurrencyInput, DataTable, DatePicker, DateRangePicker, DeviceOnlyGate, DeviceStorageKeyGate, Dialog, DragHandleRow, Drawer, EmptyState, ExportPanel, FileDropzone, FloatingActionButton, ForgotPasswordForm, FormField, GripIcon, Header, HeaderFooterLayout, HoverCard, IOS_INSTALL_STEPS, Icon, IconPicker, Input, InstallHint, InstallPrompt, Item, Kbd, Label, LegalLinks, LockedState, MOBILE_BREAKPOINT_PX, Markdown, Marker, MemberMultiSelect, Menu, MenuEntries, Menubar, Message, MessageScroller, MobileAppsDrawer, MobileFooter, MobileHeader, NavList, NavTabs, NavigationMenu, NewCardTile, NotificationsPanel, OfflineGate, OverlayHeader, PageContainer, PageHeader, PageLayout, Pagination, PhotoGallery, PhotoGrid, PhotoViewer, Popover, ProfilePanel, Progress, PushControl, QrCode, QuantityStepper, RadioGroup, RangeCalendar, RecoveryKit, ResetPasswordForm, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResponsiveSurface, RootLayout, SWIPE_STACK_TRANSITION_MS, ScrollArea, SegmentedControl, Select, SessionsPanel, Sheet, SignInForm, SignUpForm, Slider, Spinner, SplitMethodSelector, SplitPane, StatusBadge, StepStrip, SuggestionInput, SwipableMobileCarousel, SwipableMobileCarouselDots, SwipableMobileCarouselSlide, SwipableMobileCarouselSlideBody, SwipableMobileCarouselSlideFooter, SwipableMobileCarouselSlideHeader, SwipeStack, SwipeStackCard, SystemBanner, THEME_PRESETS, THEME_PRESET_NAMES, Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Tabs, TagInput, Textarea, ThreeColumnLayout, ToastProvider, Toggle, Tooltip, TwoFactorForm, TwoFactorPanel, Typography, UpdateNotice, UserMenu, isInstalledDisplay, recoveryKitFileName, recoveryKitFileText, shouldHandleDndEvent, useCarouselRouteSync, useCommitOnEnterOrBlur, useDoubleTapHandler, useInstallPrompt, useIsMobile, useIsOffline, useLongPress, useOfflineTileState, useOverlaySecondRow, useReorderSensors, useResponsiveLayout, useSingleOrDoubleTap, useSnapCarousel, useSwipeReveal, useSwipeStack, useToast };
|
|
4199
|
+
export type { AccordionItem, AccordionProps, ActionResult, AlertProps, AlertVariant, AppTileProps, AppsLauncherItem, AppsLauncherProps, AspectRatioProps, AuthCardProps, AuthCodeInputProps, AuthFieldControl, AuthFieldProps, AuthFooterProps, AuthLinkRenderer, AvatarProps, AvatarStackPerson, AvatarStackProps, BadgeProps, BadgeStatus, BadgeVariant, BalanceChipProps, BannerVariant, BrandBadgeProps, BreadcrumbItem, BreadcrumbProps, ButtonGroupProps, ButtonLinkProps, ButtonProps, ButtonSize, ButtonVariant, CalendarProps, CardProps, CardTileGridProps, CardTileProps, ChangePasswordFormProps, CheckableListRowProps, CheckboxProps, CodeTextareaProps, CollapsibleProps, ColorPickerProps, ColorPickerSwatch, ComboboxOption, ComboboxProps, CommandItem, CommandProps, CommitOnEnterOrBlurHandlers, ConfirmDialogProps, ConsentPromptProps, ContextMenuProps, CopyButtonProps, CurrencyInputProps, DataTableColumn, DataTableProps, DatePickerProps, DateRange, DateRangePickerProps, DeviceOnlyGateProps, DeviceStorageKeyGateProps, DeviceStorageKeyGateStatus, DialogProps, DialogSize, DragHandleRowProps, DrawerProps, EmptyStateProps, ExportPanelProps, ExportPanelStatus, ExportStartResult, FileDropzoneProps, FloatingActionButtonProps, FooterIcon, ForgotPasswordFormProps, FormFieldProps, FormFieldRenderProps, GripIconProps, HeaderFooterLayoutProps, HeaderPlugin, HeaderProps, HoverCardProps, IconName, IconPickerProps, IconProps, InputProps, InstallHintProps, InstallKind, InstallPromptProps, ItemProps, KbdProps, LabelProps, LegalLinksProps, LockedReason, LockedStateProps, LongPressHandlers, MarkdownProps, MarkerProps, MemberMultiSelectOption, MemberMultiSelectProps, MenuEntry, MenuItem, MenuLabel, MenuProps, MenuSeparator, MenubarMenu, MenubarProps, MessageProps, MessageScrollerProps, MessageSender, MobileAppsDrawerItem, MobileAppsDrawerProps, MobileFooterProps, MobileHeaderProps, NavListGroup, NavListItem, NavListLinkProps, NavListProps, NavTabItem, NavTabLinkProps, NavTabsProps, NavigationMenuItem, NavigationMenuProps, NewCardTileProps, NotificationsPanelItem, NotificationsPanelProps, OfflineGateProps, OfflineTileState, OverlayHeaderProps, PageContainerProps, PageHeaderProps, PageLayoutPadding, PageLayoutProps, PaginationProps, PanelAction, Photo, PhotoGalleryProps, PhotoGridProps, PhotoViewerProps, PopoverProps, ProfilePanelProps, ProgressProps, PushControlProps, PushControlState, QrCodeProps, QuantityStepperProps, RadioGroupItem, RadioGroupProps, RangeCalendarProps, RecoveryKitProps, ResetPasswordFormProps, ResizableDirection, ResizableHandleProps, ResizablePanelGroupProps, ResizablePanelProps, ResponsiveSurfaceProps, RootLayoutProps, RootLayoutVariant, ScrollAreaProps, SegmentedControlProps, SegmentedOption, SelectProps, SessionRow, SessionsPanelProps, SheetProps, SignInFormProps, SignUpFormProps, SignUpValues, SliderProps, SortDirection, SpinnerProps, SplitMethod, SplitMethodSelectorProps, SplitPaneProps, StatusBadgeProps, StatusBadgeStatus, StepStripItem, StepStripProps, SuggestionInputProps, SuggestionOption, SwipableMobileCarouselDotsProps, SwipableMobileCarouselIndicatorProps, SwipableMobileCarouselProps, SwipableMobileCarouselSlideBodyProps, SwipableMobileCarouselSlideFooterProps, SwipableMobileCarouselSlideHeaderProps, SwipableMobileCarouselSlideProps, SwipeDirection, SwipeDirectionMeta, SwipeStackCardProps, SwipeStackProps, SystemBannerProps, TabItem, TableProps, TabsProps, TagInputProps, TextareaProps, ThemePresetName, ThemePresetTokens, ThreeColumnLayoutProps, ToastContextValue, ToastItem, ToggleProps, TooltipProps, TwoFactorAction, TwoFactorFormProps, TwoFactorPanelProps, TwoFactorStart, TypographyProps, TypographyVariant, UpdateNoticeProps, UseCarouselRouteSyncOptions, UseCarouselRouteSyncResult, UseInstallPrompt, UseLongPressOptions, UseReorderSensorsOptions, UseResponsiveLayoutOptions, UseResponsiveLayoutResult, UseSnapCarouselOptions, UseSnapCarouselResult, UseSwipeRevealHandlers, UseSwipeRevealOptions, UseSwipeRevealResult, UseSwipeStackHandlers, UseSwipeStackOptions, UseSwipeStackResult, UserMenuItem, UserMenuProps };
|