astrogators-shared-ui 0.17.3 → 0.17.5
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/THIRD-PARTY-LICENSES.md +107 -0
- package/dist/index.css +1 -1
- package/dist/index.js +297 -272
- package/dist/src/services/safeStorage.d.ts +21 -0
- package/dist/src/utils/formatTime.d.ts +9 -1
- package/package.json +4 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* localStorage that cannot take the app down. Internal — not exported from the
|
|
3
|
+
* package barrel.
|
|
4
|
+
*
|
|
5
|
+
* Merely touching `localStorage` throws a SecurityError when the browser blocks
|
|
6
|
+
* site data ("block all cookies", some in-app browsers, locked-down profiles),
|
|
7
|
+
* and `setItem` throws when the quota is full. `AuthProvider` reads the access
|
|
8
|
+
* token on mount, so an unguarded read here meant every app in the suite died
|
|
9
|
+
* before rendering anything.
|
|
10
|
+
*
|
|
11
|
+
* When storage is unavailable this falls back to an in-memory map for the life
|
|
12
|
+
* of the page: a login still works for the session (rather than silently not
|
|
13
|
+
* sticking) and nothing throws. It is deliberately not persistent — a reload
|
|
14
|
+
* or a full-page hop to another app starts logged out, which is the honest
|
|
15
|
+
* outcome when the browser won't let us store anything.
|
|
16
|
+
*/
|
|
17
|
+
export declare const safeStorage: {
|
|
18
|
+
getItem(key: string): string | null;
|
|
19
|
+
setItem(key: string, value: string): void;
|
|
20
|
+
removeItem(key: string): void;
|
|
21
|
+
};
|
|
@@ -16,5 +16,13 @@ export declare function parseBackendTimestamp(iso: string): Date;
|
|
|
16
16
|
* display clock re-renders deterministically.
|
|
17
17
|
*/
|
|
18
18
|
export declare function formatRelativeTime(date: Date, nowMs: number): string;
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Countdown label, adaptive by magnitude: `m:ss` under an hour (e.g.
|
|
21
|
+
* `formatCountdown(125)` → `"2:05"`, matching a short cooldown like the
|
|
22
|
+
* roster-sync floor), `HH:MM:SS` at an hour or more (e.g.
|
|
23
|
+
* `formatCountdown(86399)` → `"23:59:59"`, for a day-long TTL like the
|
|
24
|
+
* guild report's) - the hours digits simply aren't there once the
|
|
25
|
+
* remaining time drops under an hour, rather than a `m:ss` display
|
|
26
|
+
* overflowing into unreadable four-digit minutes (`"1439:59"`).
|
|
27
|
+
*/
|
|
20
28
|
export declare function formatCountdown(sec: number): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astrogators-shared-ui",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.5",
|
|
4
4
|
"description": "Shared UI components and utilities for Astrogator's Table applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"./styles": "./dist/index.css"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
|
-
"dist"
|
|
17
|
+
"dist",
|
|
18
|
+
"THIRD-PARTY-LICENSES.md"
|
|
18
19
|
],
|
|
19
20
|
"engines": {
|
|
20
21
|
"node": ">=24 <25"
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
48
|
+
"@fontsource-variable/orbitron": "^5.3.0",
|
|
47
49
|
"@types/react": "^19.2.14",
|
|
48
50
|
"@types/react-dom": "^19.2.3",
|
|
49
51
|
"@vitejs/plugin-react": "^6.0.1",
|