@sovereignfs/ui 0.104.0 → 0.105.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 +12 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +31 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ versions follow [semver](https://semver.org/). A version's section is written in
|
|
|
5
5
|
and becomes the release notes when the version is published. This file starts at 0.96.0; earlier versions are in the repository's
|
|
6
6
|
history and tags.
|
|
7
7
|
|
|
8
|
+
## [0.105.0] - 2026-11-21
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `SessionsPanel` takes `timeZone`, the person's own, for the times it writes.
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- `SessionsPanel` wrote "Signed in" and "Last active" in the runtime's own language and zone, which differ between the server and the
|
|
17
|
+
browser, so React threw the server's page away and logged error #418. It now writes them the same way everywhere: in `timeZone`,
|
|
18
|
+
or in UTC without one.
|
|
19
|
+
|
|
8
20
|
## [0.104.0] - 2026-11-20
|
|
9
21
|
|
|
10
22
|
### Added
|
package/dist/index.d.ts
CHANGED
|
@@ -306,9 +306,14 @@ interface SessionsPanelProps {
|
|
|
306
306
|
endSession: (id: string, previous: ActionResult | null, form: FormData) => Promise<ActionResult>;
|
|
307
307
|
/** Ends every session but this one. */
|
|
308
308
|
endOthers: PanelAction;
|
|
309
|
+
/**
|
|
310
|
+
* The time zone the times are written in: the person's own, where the app knows it. Default UTC. Times are written the same way on
|
|
311
|
+
* the server and in the browser, so the page the server sent is the page the browser shows.
|
|
312
|
+
*/
|
|
313
|
+
timeZone?: string;
|
|
309
314
|
}
|
|
310
315
|
/** 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;
|
|
316
|
+
declare function SessionsPanel({ sessions, endSession, endOthers, timeZone, }: SessionsPanelProps): react.JSX.Element;
|
|
312
317
|
|
|
313
318
|
interface ChangePasswordFormProps {
|
|
314
319
|
error?: string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -3680,14 +3680,27 @@ function Alert({ variant, heading, icon, children, id, className }) {
|
|
|
3680
3680
|
// src/components/Account/SessionsPanel.tsx
|
|
3681
3681
|
import styles18 from "./Account.module.css";
|
|
3682
3682
|
import { jsx as jsx141, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
3683
|
-
function SessionsPanel({
|
|
3683
|
+
function SessionsPanel({
|
|
3684
|
+
sessions,
|
|
3685
|
+
endSession,
|
|
3686
|
+
endOthers,
|
|
3687
|
+
timeZone = "UTC"
|
|
3688
|
+
}) {
|
|
3684
3689
|
const [others, endAllOthers, endingOthers] = useActionState(
|
|
3685
3690
|
endOthers,
|
|
3686
3691
|
null
|
|
3687
3692
|
);
|
|
3688
3693
|
const hasOthers = sessions.some((session) => !session.current);
|
|
3689
3694
|
return /* @__PURE__ */ jsxs121("div", { className: styles18.form, children: [
|
|
3690
|
-
/* @__PURE__ */ jsx141("ul", { className: styles18.list, children: sessions.map((session) => /* @__PURE__ */ jsx141(
|
|
3695
|
+
/* @__PURE__ */ jsx141("ul", { className: styles18.list, children: sessions.map((session) => /* @__PURE__ */ jsx141(
|
|
3696
|
+
SessionItem,
|
|
3697
|
+
{
|
|
3698
|
+
session,
|
|
3699
|
+
endSession,
|
|
3700
|
+
timeZone
|
|
3701
|
+
},
|
|
3702
|
+
session.id
|
|
3703
|
+
)) }),
|
|
3691
3704
|
others?.ok && others.message ? /* @__PURE__ */ jsx141(Alert, { variant: "success", children: others.message }) : null,
|
|
3692
3705
|
others && !others.ok ? /* @__PURE__ */ jsx141(Alert, { variant: "error", children: others.error }) : null,
|
|
3693
3706
|
hasOthers ? /* @__PURE__ */ jsx141("form", { action: endAllOthers, children: /* @__PURE__ */ jsx141(Button, { type: "submit", variant: "secondary", loading: endingOthers, children: endingOthers ? "Signing out\u2026" : "Sign out everywhere else" }) }) : null
|
|
@@ -3695,7 +3708,8 @@ function SessionsPanel({ sessions, endSession, endOthers }) {
|
|
|
3695
3708
|
}
|
|
3696
3709
|
function SessionItem({
|
|
3697
3710
|
session,
|
|
3698
|
-
endSession
|
|
3711
|
+
endSession,
|
|
3712
|
+
timeZone
|
|
3699
3713
|
}) {
|
|
3700
3714
|
const [state, action, pending] = useActionState(
|
|
3701
3715
|
endSession.bind(null, session.id),
|
|
@@ -3709,9 +3723,10 @@ function SessionItem({
|
|
|
3709
3723
|
] }),
|
|
3710
3724
|
/* @__PURE__ */ jsxs121("p", { className: styles18.footer, children: [
|
|
3711
3725
|
session.ipAddress ? `${session.ipAddress}. ` : "",
|
|
3712
|
-
"Signed in
|
|
3713
|
-
|
|
3714
|
-
|
|
3726
|
+
"Signed in",
|
|
3727
|
+
" ",
|
|
3728
|
+
when(session.signedInAt, timeZone),
|
|
3729
|
+
session.current ? "" : `. Last active ${when(session.lastActiveAt, timeZone)}`,
|
|
3715
3730
|
"."
|
|
3716
3731
|
] })
|
|
3717
3732
|
] }),
|
|
@@ -3719,11 +3734,17 @@ function SessionItem({
|
|
|
3719
3734
|
/* @__PURE__ */ jsx141("form", { action, children: /* @__PURE__ */ jsx141(Button, { type: "submit", variant: "secondary", loading: pending, children: pending ? "Signing out\u2026" : session.current ? "Sign out of this device" : "Sign out" }) })
|
|
3720
3735
|
] });
|
|
3721
3736
|
}
|
|
3722
|
-
function when(milliseconds) {
|
|
3723
|
-
|
|
3737
|
+
function when(milliseconds, timeZone) {
|
|
3738
|
+
const format = (zone) => new Intl.DateTimeFormat("en-GB", {
|
|
3724
3739
|
dateStyle: "medium",
|
|
3725
|
-
timeStyle: "short"
|
|
3726
|
-
|
|
3740
|
+
timeStyle: "short",
|
|
3741
|
+
timeZone: zone
|
|
3742
|
+
}).format(milliseconds);
|
|
3743
|
+
try {
|
|
3744
|
+
return format(timeZone);
|
|
3745
|
+
} catch {
|
|
3746
|
+
return format("UTC");
|
|
3747
|
+
}
|
|
3727
3748
|
}
|
|
3728
3749
|
|
|
3729
3750
|
// src/components/Account/ChangePasswordForm.tsx
|