@gusnips/react 0.9.24 → 0.9.26

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.
Files changed (116) hide show
  1. package/README.md +173 -36
  2. package/dist/api-client.d.ts +51 -51
  3. package/dist/api-client.d.ts.map +1 -1
  4. package/dist/api-client.js +3 -3
  5. package/dist/api-error.d.ts +11 -11
  6. package/dist/api-error.js +11 -11
  7. package/dist/auth-email.d.ts +40 -0
  8. package/dist/auth-email.d.ts.map +1 -0
  9. package/dist/auth-email.js +106 -0
  10. package/dist/auth-email.js.map +1 -0
  11. package/dist/auth-store.d.ts +23 -23
  12. package/dist/auth-store.js +13 -13
  13. package/dist/commands.d.ts +80 -0
  14. package/dist/commands.d.ts.map +1 -0
  15. package/dist/commands.js +192 -0
  16. package/dist/commands.js.map +1 -0
  17. package/dist/copy.d.ts +3 -3
  18. package/dist/copy.js +3 -3
  19. package/dist/deploy-recovery.d.ts +40 -40
  20. package/dist/deploy-recovery.js +40 -40
  21. package/dist/describe-error.d.ts +68 -68
  22. package/dist/describe-error.d.ts.map +1 -1
  23. package/dist/describe-error.js +5 -5
  24. package/dist/error-boundary.d.ts +12 -12
  25. package/dist/guards.d.ts +15 -15
  26. package/dist/guards.js +3 -3
  27. package/dist/hydrate.d.ts +15 -16
  28. package/dist/hydrate.d.ts.map +1 -1
  29. package/dist/hydrate.js +9 -9
  30. package/dist/hydrate.js.map +1 -1
  31. package/dist/i18n.d.ts +15 -16
  32. package/dist/i18n.d.ts.map +1 -1
  33. package/dist/i18n.js +5 -6
  34. package/dist/i18n.js.map +1 -1
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +1 -0
  38. package/dist/index.js.map +1 -1
  39. package/dist/internal-path.d.ts +8 -7
  40. package/dist/internal-path.d.ts.map +1 -1
  41. package/dist/internal-path.js +8 -7
  42. package/dist/internal-path.js.map +1 -1
  43. package/dist/prerender-contract.d.ts +7 -7
  44. package/dist/prerender-contract.js +7 -7
  45. package/dist/query.d.ts +16 -17
  46. package/dist/query.d.ts.map +1 -1
  47. package/dist/query.js +2 -2
  48. package/dist/query.js.map +1 -1
  49. package/dist/sse.d.ts +19 -20
  50. package/dist/sse.d.ts.map +1 -1
  51. package/dist/sse.js +18 -19
  52. package/dist/sse.js.map +1 -1
  53. package/dist/states.d.ts +12 -12
  54. package/dist/states.d.ts.map +1 -1
  55. package/dist/supabase-session.d.ts +47 -48
  56. package/dist/supabase-session.d.ts.map +1 -1
  57. package/dist/supabase-session.js +35 -35
  58. package/dist/supabase-session.js.map +1 -1
  59. package/dist/theme.d.ts +4 -4
  60. package/dist/theme.js +4 -4
  61. package/dist/ui/class-name.d.ts +3 -4
  62. package/dist/ui/class-name.d.ts.map +1 -1
  63. package/dist/ui/class-name.js +3 -4
  64. package/dist/ui/class-name.js.map +1 -1
  65. package/dist/ui/combobox.d.ts +11 -11
  66. package/dist/ui/combobox.d.ts.map +1 -1
  67. package/dist/ui/dialog.d.ts +5 -5
  68. package/dist/ui/dialog.js +2 -2
  69. package/dist/ui/drawer.d.ts +10 -10
  70. package/dist/ui/drawer.d.ts.map +1 -1
  71. package/dist/ui/drawer.js +2 -2
  72. package/dist/ui/input.d.ts +2 -2
  73. package/dist/ui/input.js +2 -2
  74. package/dist/ui/menu.d.ts +9 -9
  75. package/dist/ui/menu.d.ts.map +1 -1
  76. package/dist/ui/menu.js +4 -4
  77. package/dist/ui/menu.js.map +1 -1
  78. package/dist/ui/select.d.ts +12 -12
  79. package/dist/ui/select.d.ts.map +1 -1
  80. package/dist/ui/select.js +3 -3
  81. package/dist/ui/tabs.d.ts +14 -15
  82. package/dist/ui/tabs.d.ts.map +1 -1
  83. package/dist/ui/tabs.js +13 -14
  84. package/dist/ui/tabs.js.map +1 -1
  85. package/package.json +5 -1
  86. package/src/api-client.ts +51 -51
  87. package/src/api-error.ts +11 -11
  88. package/src/auth-email.test.ts +145 -0
  89. package/src/auth-email.ts +112 -0
  90. package/src/auth-store.ts +23 -23
  91. package/src/commands-hook.test.ts +444 -0
  92. package/src/commands.test.ts +245 -0
  93. package/src/commands.ts +268 -0
  94. package/src/copy.ts +3 -3
  95. package/src/deploy-recovery.ts +40 -40
  96. package/src/describe-error.ts +68 -68
  97. package/src/error-boundary.tsx +12 -12
  98. package/src/guards.tsx +15 -15
  99. package/src/hydrate.ts +15 -16
  100. package/src/i18n.ts +15 -16
  101. package/src/index.ts +2 -0
  102. package/src/internal-path.ts +8 -7
  103. package/src/prerender-contract.ts +7 -7
  104. package/src/query.ts +16 -17
  105. package/src/sse.ts +19 -20
  106. package/src/states.ts +12 -12
  107. package/src/supabase-session.ts +46 -47
  108. package/src/theme.ts +4 -4
  109. package/src/ui/class-name.ts +3 -4
  110. package/src/ui/combobox.tsx +11 -11
  111. package/src/ui/dialog.tsx +5 -5
  112. package/src/ui/drawer.tsx +10 -10
  113. package/src/ui/input.tsx +2 -2
  114. package/src/ui/menu.tsx +8 -8
  115. package/src/ui/select.tsx +12 -12
  116. package/src/ui/tabs.tsx +14 -15
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAkBxC,oEAAoE;AACpE,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACtD,MAAM,KAAK,GAAG,kCAAkC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5D,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5C,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE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,MAAM;QACN,aAAa;KACd,CAAC;AACJ,CAAC"}
package/dist/copy.d.ts CHANGED
@@ -8,9 +8,9 @@ export interface CopyOptions {
8
8
  failedMs?: number;
9
9
  }
10
10
  /**
11
- * A copy with an outcome the reader can see. What it says stays yours — "Copied", or "Select it
12
- * and copy it yourself", in a label or a toast — and so does announcing it: a label that changes
13
- * needs `aria-live="polite"` to be heard.
11
+ * A copy with an outcome the reader can see. You choose what it says, such as "Copied" or "Select
12
+ * it and copy it yourself", in a label or a toast. You also choose how to announce it: a label that
13
+ * changes needs `aria-live="polite"` to be heard.
14
14
  *
15
15
  * The outcome goes back to `"idle"` on its own. A "Copied" that never clears makes the second copy
16
16
  * look like it did not take.
package/dist/copy.js CHANGED
@@ -18,9 +18,9 @@ export async function copyText(text) {
18
18
  }
19
19
  }
20
20
  /**
21
- * A copy with an outcome the reader can see. What it says stays yours — "Copied", or "Select it
22
- * and copy it yourself", in a label or a toast — and so does announcing it: a label that changes
23
- * needs `aria-live="polite"` to be heard.
21
+ * A copy with an outcome the reader can see. You choose what it says, such as "Copied" or "Select
22
+ * it and copy it yourself", in a label or a toast. You also choose how to announce it: a label that
23
+ * changes needs `aria-live="polite"` to be heard.
24
24
  *
25
25
  * The outcome goes back to `"idle"` on its own. A "Copied" that never clears makes the second copy
26
26
  * look like it did not take.
@@ -5,26 +5,26 @@
5
5
  * every hashed asset underneath whatever tabs are already open, and those tabs go on running
6
6
  * yesterday's bundle. It surfaces two ways, and only one of them looks like a missing file:
7
7
  *
8
- * 1. The next navigation asks for a chunk whose hashed name is gone. React's lazy boundary
9
- * throws, and the person gets a white screen on a click that worked a minute ago.
10
- * 2. The old bundle reads a field the API has since renamed, and throws. That one arrives as a
11
- * plain `TypeError` with nothing in it about a deploy — no file, no hash, no signal.
8
+ * 1. The next navigation asks for a chunk whose hashed name is gone. React's lazy boundary throws,
9
+ * and the person gets a white screen on a click that worked a minute ago. 2. The old bundle reads a
10
+ * field the API has since renamed, and throws. That one arrives as a plain `TypeError` with nothing
11
+ * in it about a deploy: no file, no hash, no signal.
12
12
  *
13
13
  * So there are two detectors here and they are not interchangeable. {@link isChunkLoadError}
14
- * matches the message, which is all you have for a failure that never reaches a boundary.
15
- * {@link isStaleBuild} asks the server, which is evidence rather than a guess — and it is the
16
- * only one that catches case 2 at all.
14
+ * matches the message, which is all you have for a failure that never reaches a boundary. {@link
15
+ * isStaleBuild} asks the server for evidence rather than a guess. It is the only one that catches
16
+ * case 2 at all.
17
17
  *
18
18
  * **The deepest fix is not in this file, and it is worth more than everything in it.** A static
19
- * host answers a missing `/assets/x.js` with the SPA fallback — `index.html`, at a 200, as
20
- * `text/html` — which is what the browser's "MIME type text/html" module-script refusal actually
21
- * is. Hosts then match cache rules against the REQUEST PATH rather than the outcome, so the
22
- * `immutable, max-age=31536000` rule written for hashed assets gets applied to that HTML body:
23
- * one poisoned asset URL, at the edge and in every browser that touched it, for a year. One
24
- * adopter removed the cause instead of recovering from it — no blanket fallback over `/assets/`,
25
- * and an edge function that refuses to answer an asset path with `text/html` — which turns a
26
- * dead chunk into a real, uncacheable 404 and lets everything below be recovery rather than the
27
- * plan. A package cannot ship that; it can refuse to let it go unwritten.
19
+ * host answers a missing `/assets/x.js` with the SPA fallback, `index.html`, at a 200, as
20
+ * `text/html`. That is what the browser's "MIME type text/html" module-script refusal actually is.
21
+ * Hosts then match cache rules against the REQUEST PATH rather than the outcome, so the `immutable,
22
+ * max-age=31536000` rule written for hashed assets gets applied to that HTML body: one poisoned
23
+ * asset URL, at the edge and in every browser that touched it, for a year. One adopter removed the
24
+ * cause instead of recovering from it: no blanket fallback over `/assets/`, and an edge function
25
+ * that refuses to answer an asset path with `text/html`. That turns a dead chunk into a real,
26
+ * uncacheable 404 and lets everything below be recovery rather than the plan. A package cannot ship
27
+ * that; it can refuse to let it go unwritten.
28
28
  */
29
29
  /**
30
30
  * One stamp for every reason to reload, which is the part that is easy to get wrong.
@@ -40,14 +40,14 @@
40
40
  */
41
41
  export declare const RELOAD_GUARD_KEY = "frontkit:reload-at";
42
42
  /**
43
- * A lazy-chunk fetch failure — recoverable by reloading.
43
+ * A lazy-chunk fetch failure that a reload can fix.
44
44
  *
45
- * Matched by message because no browser gives it a shared type. Every phrasing in the wild is
46
- * here: Chrome/Edge "Failed to fetch dynamically imported module", Firefox "error loading
47
- * dynamically imported module", Safari "Importing a module script failed", webpack's
48
- * ChunkLoadError and "Loading chunk N failed", and the SPA-fallback "MIME type" refusal —
49
- * which is the one that fires on a static host that has not fixed the cause above, because the
50
- * missing `.js` is answered with `index.html`.
45
+ * Matched by message because no browser gives it a shared type. Every phrasing in the wild is here:
46
+ * Chrome/Edge "Failed to fetch dynamically imported module", Firefox "error loading dynamically
47
+ * imported module", Safari "Importing a module script failed", webpack's ChunkLoadError and
48
+ * "Loading chunk N failed", and the SPA-fallback "MIME type" refusal. The last one that fires on a
49
+ * static host that has not fixed the cause above, because the missing `.js` is answered with
50
+ * `index.html`.
51
51
  *
52
52
  * A standalone predicate rather than a method on the boundary, so a global `unhandledrejection`
53
53
  * handler can classify the same failure without importing a component.
@@ -56,13 +56,13 @@ export declare function isChunkLoadError(error: unknown): boolean;
56
56
  /**
57
57
  * Is the build this tab is running still the one being served?
58
58
  *
59
- * Asked of the server, so the answer is evidence rather than a guess. Everything ambiguous —
60
- * offline, a non-200, a captive portal, a probe that times out — resolves to `false`: dressing a
61
- * genuine bug up as an update hides it from the user and from us.
59
+ * Asked of the server, so the answer is evidence rather than a guess. An offline request, a non-200
60
+ * response, a captive portal or a timed-out probe resolves to `false`: dressing a genuine bug up as
61
+ * an update hides it from the user and from us.
62
62
  *
63
63
  * It asks for the PAGE, not for the asset, and that is not the obvious choice. A missing asset
64
64
  * looks like the direct question, but a CDN commonly serves assets with a long `s-maxage`, so a
65
- * bundle a deploy retired an hour ago still answers 200 from the edge — it would report "current"
65
+ * bundle a deploy retired an hour ago still answers 200 from the edge. It would report "current"
66
66
  * during exactly the window when skew is most likely. The page is the one URL that cannot lie: it
67
67
  * ships `max-age=0, must-revalidate` and never enters the edge cache.
68
68
  */
@@ -73,9 +73,9 @@ export declare function isStaleBuild(): Promise<boolean>;
73
73
  * rather than watching the same attempt loop.
74
74
  *
75
75
  * The guard is the part that matters. Reloading on a failure is obvious; reloading on a failure
76
- * that the reload does not fix is an infinite loop with the user inside it. At most one reload
77
- * per minute, so a genuinely broken deploy degrades to the error screen — which can at least say
78
- * something — instead of flickering forever.
76
+ * that the reload does not fix is an infinite loop with the user inside it. At most one reload per
77
+ * minute, so a genuinely broken deploy shows the error screen instead of flickering forever. That
78
+ * screen can at least say something.
79
79
  *
80
80
  * `sessionStorage` and not `localStorage`: the guard is about this tab's current predicament, and
81
81
  * a stale stamp in another tab must not suppress a reload this one needs. Wrapped because storage
@@ -86,22 +86,22 @@ export declare function reloadOnce(): boolean;
86
86
  /**
87
87
  * Vite's *hint* failure, which is not the same thing and must not be treated as one.
88
88
  *
89
- * Vite injects a speculative `<link rel="stylesheet">` for a chunk's CSS before importing it.
90
- * When that link fails, the import itself still runs right after and usually succeeds — so this
91
- * one is worth swallowing, where a failure of the import is the real thing
92
- * {@link isChunkLoadError} matches. Vite builds this message in exactly one place and only ever
93
- * for a stylesheet link; script hints never reject.
89
+ * Vite injects a speculative `<link rel="stylesheet">` for a chunk's CSS before importing it. When
90
+ * that link fails, the import itself still runs right after and usually succeeds, so this one is
91
+ * worth swallowing, where a failure of the import is the real thing {@link isChunkLoadError}
92
+ * matches. Vite builds this message in exactly one place and only ever for a stylesheet link;
93
+ * script hints never reject.
94
94
  */
95
95
  export declare function isPreloadHintFailure(error: unknown): boolean;
96
96
  /**
97
97
  * Install the `vite:preloadError` listener. Call once, from the browser entry.
98
98
  *
99
- * Vite offers `preventDefault()` here so an app can own a failed asset itself — but taking that
100
- * deal unconditionally resolves the dynamic import with `undefined` (Vite's helper ends in
99
+ * Vite offers `preventDefault()` here so an app can own a failed asset itself, but taking that deal
100
+ * unconditionally resolves the dynamic import with `undefined` (Vite's helper ends in
101
101
  * `baseModule().catch(handlePreloadError)`), and `React.lazy` then reads `.default` off nothing.
102
- * The user gets the crash screen and the developer gets a TypeError with only React frames in
103
- * it, naming no chunk. So it is taken ONLY for a failed preload hint, where the import still
104
- * runs. A real module failure is left to throw, where the error boundary can recognise it.
102
+ * The user gets the crash screen and the developer gets a TypeError with only React frames in it,
103
+ * naming no chunk. So it is taken ONLY for a failed preload hint, where the import still runs. A
104
+ * real module failure is left to throw, where the error boundary can recognise it.
105
105
  */
106
106
  export declare function installPreloadErrorHandler(): void;
107
107
  //# sourceMappingURL=deploy-recovery.d.ts.map
@@ -5,26 +5,26 @@
5
5
  * every hashed asset underneath whatever tabs are already open, and those tabs go on running
6
6
  * yesterday's bundle. It surfaces two ways, and only one of them looks like a missing file:
7
7
  *
8
- * 1. The next navigation asks for a chunk whose hashed name is gone. React's lazy boundary
9
- * throws, and the person gets a white screen on a click that worked a minute ago.
10
- * 2. The old bundle reads a field the API has since renamed, and throws. That one arrives as a
11
- * plain `TypeError` with nothing in it about a deploy — no file, no hash, no signal.
8
+ * 1. The next navigation asks for a chunk whose hashed name is gone. React's lazy boundary throws,
9
+ * and the person gets a white screen on a click that worked a minute ago. 2. The old bundle reads a
10
+ * field the API has since renamed, and throws. That one arrives as a plain `TypeError` with nothing
11
+ * in it about a deploy: no file, no hash, no signal.
12
12
  *
13
13
  * So there are two detectors here and they are not interchangeable. {@link isChunkLoadError}
14
- * matches the message, which is all you have for a failure that never reaches a boundary.
15
- * {@link isStaleBuild} asks the server, which is evidence rather than a guess — and it is the
16
- * only one that catches case 2 at all.
14
+ * matches the message, which is all you have for a failure that never reaches a boundary. {@link
15
+ * isStaleBuild} asks the server for evidence rather than a guess. It is the only one that catches
16
+ * case 2 at all.
17
17
  *
18
18
  * **The deepest fix is not in this file, and it is worth more than everything in it.** A static
19
- * host answers a missing `/assets/x.js` with the SPA fallback — `index.html`, at a 200, as
20
- * `text/html` — which is what the browser's "MIME type text/html" module-script refusal actually
21
- * is. Hosts then match cache rules against the REQUEST PATH rather than the outcome, so the
22
- * `immutable, max-age=31536000` rule written for hashed assets gets applied to that HTML body:
23
- * one poisoned asset URL, at the edge and in every browser that touched it, for a year. One
24
- * adopter removed the cause instead of recovering from it — no blanket fallback over `/assets/`,
25
- * and an edge function that refuses to answer an asset path with `text/html` — which turns a
26
- * dead chunk into a real, uncacheable 404 and lets everything below be recovery rather than the
27
- * plan. A package cannot ship that; it can refuse to let it go unwritten.
19
+ * host answers a missing `/assets/x.js` with the SPA fallback, `index.html`, at a 200, as
20
+ * `text/html`. That is what the browser's "MIME type text/html" module-script refusal actually is.
21
+ * Hosts then match cache rules against the REQUEST PATH rather than the outcome, so the `immutable,
22
+ * max-age=31536000` rule written for hashed assets gets applied to that HTML body: one poisoned
23
+ * asset URL, at the edge and in every browser that touched it, for a year. One adopter removed the
24
+ * cause instead of recovering from it: no blanket fallback over `/assets/`, and an edge function
25
+ * that refuses to answer an asset path with `text/html`. That turns a dead chunk into a real,
26
+ * uncacheable 404 and lets everything below be recovery rather than the plan. A package cannot ship
27
+ * that; it can refuse to let it go unwritten.
28
28
  */
29
29
  /**
30
30
  * One stamp for every reason to reload, which is the part that is easy to get wrong.
@@ -44,14 +44,14 @@ const RELOAD_WINDOW_MS = 60_000;
44
44
  * land on the real error screen instead of an endless spinner. */
45
45
  const PROBE_TIMEOUT_MS = 4_000;
46
46
  /**
47
- * A lazy-chunk fetch failure — recoverable by reloading.
47
+ * A lazy-chunk fetch failure that a reload can fix.
48
48
  *
49
- * Matched by message because no browser gives it a shared type. Every phrasing in the wild is
50
- * here: Chrome/Edge "Failed to fetch dynamically imported module", Firefox "error loading
51
- * dynamically imported module", Safari "Importing a module script failed", webpack's
52
- * ChunkLoadError and "Loading chunk N failed", and the SPA-fallback "MIME type" refusal —
53
- * which is the one that fires on a static host that has not fixed the cause above, because the
54
- * missing `.js` is answered with `index.html`.
49
+ * Matched by message because no browser gives it a shared type. Every phrasing in the wild is here:
50
+ * Chrome/Edge "Failed to fetch dynamically imported module", Firefox "error loading dynamically
51
+ * imported module", Safari "Importing a module script failed", webpack's ChunkLoadError and
52
+ * "Loading chunk N failed", and the SPA-fallback "MIME type" refusal. The last one that fires on a
53
+ * static host that has not fixed the cause above, because the missing `.js` is answered with
54
+ * `index.html`.
55
55
  *
56
56
  * A standalone predicate rather than a method on the boundary, so a global `unhandledrejection`
57
57
  * handler can classify the same failure without importing a component.
@@ -86,13 +86,13 @@ function runningEntry() {
86
86
  /**
87
87
  * Is the build this tab is running still the one being served?
88
88
  *
89
- * Asked of the server, so the answer is evidence rather than a guess. Everything ambiguous —
90
- * offline, a non-200, a captive portal, a probe that times out — resolves to `false`: dressing a
91
- * genuine bug up as an update hides it from the user and from us.
89
+ * Asked of the server, so the answer is evidence rather than a guess. An offline request, a non-200
90
+ * response, a captive portal or a timed-out probe resolves to `false`: dressing a genuine bug up as
91
+ * an update hides it from the user and from us.
92
92
  *
93
93
  * It asks for the PAGE, not for the asset, and that is not the obvious choice. A missing asset
94
94
  * looks like the direct question, but a CDN commonly serves assets with a long `s-maxage`, so a
95
- * bundle a deploy retired an hour ago still answers 200 from the edge — it would report "current"
95
+ * bundle a deploy retired an hour ago still answers 200 from the edge. It would report "current"
96
96
  * during exactly the window when skew is most likely. The page is the one URL that cannot lie: it
97
97
  * ships `max-age=0, must-revalidate` and never enters the edge cache.
98
98
  */
@@ -119,9 +119,9 @@ export async function isStaleBuild() {
119
119
  * rather than watching the same attempt loop.
120
120
  *
121
121
  * The guard is the part that matters. Reloading on a failure is obvious; reloading on a failure
122
- * that the reload does not fix is an infinite loop with the user inside it. At most one reload
123
- * per minute, so a genuinely broken deploy degrades to the error screen — which can at least say
124
- * something — instead of flickering forever.
122
+ * that the reload does not fix is an infinite loop with the user inside it. At most one reload per
123
+ * minute, so a genuinely broken deploy shows the error screen instead of flickering forever. That
124
+ * screen can at least say something.
125
125
  *
126
126
  * `sessionStorage` and not `localStorage`: the guard is about this tab's current predicament, and
127
127
  * a stale stamp in another tab must not suppress a reload this one needs. Wrapped because storage
@@ -145,11 +145,11 @@ export function reloadOnce() {
145
145
  /**
146
146
  * Vite's *hint* failure, which is not the same thing and must not be treated as one.
147
147
  *
148
- * Vite injects a speculative `<link rel="stylesheet">` for a chunk's CSS before importing it.
149
- * When that link fails, the import itself still runs right after and usually succeeds — so this
150
- * one is worth swallowing, where a failure of the import is the real thing
151
- * {@link isChunkLoadError} matches. Vite builds this message in exactly one place and only ever
152
- * for a stylesheet link; script hints never reject.
148
+ * Vite injects a speculative `<link rel="stylesheet">` for a chunk's CSS before importing it. When
149
+ * that link fails, the import itself still runs right after and usually succeeds, so this one is
150
+ * worth swallowing, where a failure of the import is the real thing {@link isChunkLoadError}
151
+ * matches. Vite builds this message in exactly one place and only ever for a stylesheet link;
152
+ * script hints never reject.
153
153
  */
154
154
  export function isPreloadHintFailure(error) {
155
155
  return error instanceof Error && error.message.startsWith("Unable to preload CSS for");
@@ -157,12 +157,12 @@ export function isPreloadHintFailure(error) {
157
157
  /**
158
158
  * Install the `vite:preloadError` listener. Call once, from the browser entry.
159
159
  *
160
- * Vite offers `preventDefault()` here so an app can own a failed asset itself — but taking that
161
- * deal unconditionally resolves the dynamic import with `undefined` (Vite's helper ends in
160
+ * Vite offers `preventDefault()` here so an app can own a failed asset itself, but taking that deal
161
+ * unconditionally resolves the dynamic import with `undefined` (Vite's helper ends in
162
162
  * `baseModule().catch(handlePreloadError)`), and `React.lazy` then reads `.default` off nothing.
163
- * The user gets the crash screen and the developer gets a TypeError with only React frames in
164
- * it, naming no chunk. So it is taken ONLY for a failed preload hint, where the import still
165
- * runs. A real module failure is left to throw, where the error boundary can recognise it.
163
+ * The user gets the crash screen and the developer gets a TypeError with only React frames in it,
164
+ * naming no chunk. So it is taken ONLY for a failed preload hint, where the import still runs. A
165
+ * real module failure is left to throw, where the error boundary can recognise it.
166
166
  */
167
167
  export function installPreloadErrorHandler() {
168
168
  window.addEventListener("vite:preloadError", (event) => {
@@ -3,21 +3,21 @@ import { ApiError } from "./api-error.ts";
3
3
  * Turning anything thrown into copy a person can act on.
4
4
  *
5
5
  * The API already answers with a message written for a developer, a stable `messageKey` for the
6
- * domain refusals, and `details` carrying the parts that make a refusal actionable. This is the
7
- * one place that decides what the SCREEN says — which is not always the same sentence.
8
- * "Monthly quota spent, upgrade or buy a pack" is right in a JSON body and wrong under a button
9
- * that could just say what to do next.
6
+ * domain refusals, and `details` carrying the parts that make a refusal actionable. This is the one
7
+ * place that decides what the SCREEN says. It is not always the same sentence. "Monthly quota
8
+ * spent, upgrade or buy a pack" is right in a JSON body and wrong under a button that could just
9
+ * say what to do next.
10
10
  *
11
11
  * `cause` is what happened. `fix` is what to do about it. **A surface that shows only the first
12
- * half is the dead end this exists to prevent** — which is why the type has two fields and not
13
- * one, and why `fix` being absent should be a deliberate choice at each call site rather than
14
- * the default nobody noticed.
12
+ * half is the dead end this exists to prevent**. That is why the type has two fields and not one,
13
+ * and why `fix` being absent should be a deliberate choice at each call site rather than the
14
+ * default nobody noticed.
15
15
  *
16
- * `fix`, and not the `hint` this returned until 0.6.0. `ErrorStateProps` — the contract this same
17
- * package ships for the component that renders this — has always called it `fix`, so every
18
- * adopter wrote `fix={hint}` at every error surface: a rename adapter, which is the shape of an
19
- * API we got wrong. It also clears a collision, because in at least one adopter a form field's
20
- * `hint` is the requirement text under the input, which is a different thing entirely.
16
+ * `fix`, and not the `hint` this returned until 0.6.0. `ErrorStateProps`, the contract this same
17
+ * package ships for the component that renders this, has always called it `fix`, so every adopter
18
+ * wrote `fix={hint}` at every error surface: a rename adapter, which is the shape of an API we got
19
+ * wrong. It also clears a collision, because in at least one adopter a form field's `hint` is the
20
+ * requirement text under the input, which is a different thing entirely.
21
21
  *
22
22
  * The per-code switch stays in the product: two donors' switches shared their SHAPE and almost
23
23
  * no arms, because the arms are that API's vocabulary. What ships is the scaffolding around it,
@@ -26,11 +26,11 @@ import { ApiError } from "./api-error.ts";
26
26
  /**
27
27
  * Which control to offer beside the words.
28
28
  *
29
- * The fourth adopter had this and the package did not, which left every adopter re-deriving
30
- * "can a second attempt fix this" from its own switch — beside a `shouldRetry` already deciding
31
- * exactly that for react-query. Two answers to one question drift, and the drift is visible: a
32
- * screen offering "try again" for a refusal the query layer refuses to retry, so the button does
33
- * nothing and the reader presses it twice.
29
+ * The fourth adopter had this and the package did not, which left every adopter re-deriving "can a
30
+ * second attempt fix this" from its own switch, beside a `shouldRetry` already deciding exactly
31
+ * that for react-query. Two answers to one question drift, and the drift is visible: a screen
32
+ * offering "try again" for a refusal the query layer refuses to retry, so the button does nothing
33
+ * and the reader presses it twice.
34
34
  *
35
35
  * So this is DERIVED from `shouldRetry`, not switched on separately. One rule, two consumers.
36
36
  */
@@ -49,7 +49,7 @@ export interface ErrorCopy {
49
49
  cause: string;
50
50
  /** What to do about it. Its absence should be a decision, not an oversight. */
51
51
  fix?: string;
52
- /** Override the derived kind — a 429 whose code means a spent quota is `"none"`, not `"wait"`. */
52
+ /** Override the derived kind. A 429 whose code means a spent quota is `"none"`, not `"wait"`. */
53
53
  recover?: RecoveryKind;
54
54
  /** Override the request id. Rarely wanted; the envelope's is used by default. */
55
55
  reference?: string;
@@ -59,14 +59,14 @@ export interface DescribedError extends ErrorCopy {
59
59
  recover: RecoveryKind;
60
60
  }
61
61
  /**
62
- * The subset of i18next's `t` this module needs — typed here so `i18next` stays optional.
62
+ * The subset of i18next's `t` this module needs, typed here so `i18next` stays optional.
63
63
  *
64
- * `Key` is a parameter and not plain `string` for a reason the first migration found. Every app
65
- * on this stack declares `CustomTypeOptions.resources`, which types `t` to accept ONLY the keys
66
- * its catalog has — so a `t` is not assignable to anything asking for `(key: string) => string`,
67
- * and the adopter is left with a cast. Naming the keys instead turns that around: each function
68
- * below asks for exactly the keys it looks up, a typed `t` accepts a superset of them and goes
69
- * in directly, and a catalog missing one is a compile error rather than a raw key on screen.
64
+ * `Key` is a parameter and not plain `string` for a reason the first migration found. Every app on
65
+ * this stack declares `CustomTypeOptions.resources`, which types `t` to accept ONLY the keys its
66
+ * catalog has, so a `t` is not assignable to anything asking for `(key: string) => string`, and the
67
+ * adopter is left with a cast. Naming the keys instead turns that around: each function below asks
68
+ * for exactly the keys it looks up, a typed `t` accepts a superset of them and goes in directly,
69
+ * and a catalog missing one is a compile error rather than a raw key on screen.
70
70
  */
71
71
  export type Translate<Key extends string = string> = (key: Key, params?: Record<string, unknown>) => string;
72
72
  /** The three names {@link humanizeWait} looks up, under whatever prefix you pass it. */
@@ -75,8 +75,8 @@ type WaitName = "waitSeconds" | "waitMinutes" | "waitHours";
75
75
  * Every name {@link createErrorDescriber} looks up itself. Your catalog carries all of them.
76
76
  *
77
77
  * The three wait names are deliberately NOT here, which is the other half of 0.6.0. This module
78
- * used to humanize a stated wait itself, so `waitSeconds`/`waitMinutes`/`waitHours` — each with
79
- * an ICU plural — landed in the key union of every adopter's `t` whether or not a wait was ever
78
+ * used to humanize a stated wait itself, so `waitSeconds`/`waitMinutes`/`waitHours`, each with an
79
+ * ICU plural, landed in the key union of every adopter's `t` whether or not a wait was ever
80
80
  * rendered. An app that formats waits with `Intl.RelativeTimeFormat` needs none of them and was
81
81
  * left adding six entries per language to satisfy a compiler. `formatWait` owns that now.
82
82
  */
@@ -86,26 +86,26 @@ type CopyName = "network" | "networkHint" | "unexpected" | "retrySoon";
86
86
  *
87
87
  * i18next keeps `seatLimitReached_one` and `seatLimitReached_other`; the server sends
88
88
  * `serverErrors.seatLimitReached`, because that is the key a person resolves with a `count`. So
89
- * `Object.keys` on a catalog does NOT contain the name the server actually sends, and a gate
90
- * built from it alone rejects a sentence the app is carrying — falling back to the server's
91
- * English for the one refusal that had a written answer. Measured in the seventh migration: two
92
- * of that API's 112 keys, both of them plan limits, both of them the exact screen where a
93
- * specific sentence earns its keep.
89
+ * `Object.keys` on a catalog does NOT contain the name the server actually sends, and a gate built
90
+ * from it alone rejects a sentence the app is carrying, falling back to the server's English for
91
+ * the one refusal that had a written answer. Measured in the seventh migration: two of that API's
92
+ * 112 keys, both of them plan limits, both of them the exact screen where a specific sentence earns
93
+ * its keep.
94
94
  */
95
95
  type PluralSuffix = "zero" | "one" | "two" | "few" | "many" | "other";
96
96
  type PluralBase<N extends string> = N extends `${infer Base}_${PluralSuffix}` ? Base : N;
97
97
  /**
98
- * "in 4 minutes" / "in 2 hours" — a wait nobody has to convert from seconds.
98
+ * Format a wait as "in 4 minutes" or "in 2 hours", without making the reader convert seconds.
99
99
  *
100
100
  * The thresholds are deliberately not round: 90 seconds rather than 60, so "in 75 seconds" does
101
101
  * not become the less precise "in 1 minute", and 90 minutes rather than 60 for the same reason
102
102
  * one rung up. Needs `waitSeconds` / `waitMinutes` / `waitHours` under `prefix`, each with a
103
103
  * `count` plural.
104
104
  *
105
- * This is what you pass as `formatWait` when your catalog carries those three:
106
- * `formatWait: (secs) => humanizeWait(t, secs, "errors.")`. An app that formats a wait with
107
- * `Intl.RelativeTimeFormat` passes its own one-liner instead and needs no wait keys at all —
108
- * which also gets it correct plurals in languages with more than two forms, for free.
105
+ * This is what you pass as `formatWait` when your catalog carries those three: `formatWait: (secs)
106
+ * => humanizeWait(t, secs, "errors.")`. An app that formats a wait with `Intl.RelativeTimeFormat`
107
+ * passes its own one-liner instead and needs no wait keys at all. It also gets correct plurals in
108
+ * languages with more than two forms, for free.
109
109
  */
110
110
  export declare function humanizeWait<Prefix extends string>(t: Translate<`${Prefix}${WaitName}`>, secs: number, prefix: Prefix): string;
111
111
  export interface ErrorContext {
@@ -129,17 +129,17 @@ interface DescriberRules {
129
129
  * How a stated wait becomes words, for the `wait` an arm reads off its context.
130
130
  *
131
131
  * Required rather than defaulted, because there is no answer that is right for everyone and a
132
- * default hid the cost: {@link humanizeWait} reads three ICU plural keys out of your catalog,
133
- * and an app that already formats relative time with `Intl` would have had to add them to
134
- * compile. Say which you want — `(secs) => humanizeWait(t, secs, "errors.")`, or your own
135
- * `(secs) => formatIn(secs, locale)` — and the catalog you need is the one you can see.
132
+ * default hid the cost: {@link humanizeWait} reads three ICU plural keys out of your catalog, and
133
+ * an app that already formats relative time with `Intl` would have had to add them to compile.
134
+ * Pass `(secs) => humanizeWait(t, secs, "errors.")` or your own `(secs) => formatIn(secs,
135
+ * locale)`. The choice makes the catalog you need visible.
136
136
  */
137
137
  formatWait: (secs: number) => string;
138
138
  /**
139
139
  * Per-code copy. Everything not listed falls through to the default arm.
140
140
  *
141
- * The arms look up the app's own keys, so they close over the app's `t` rather than being
142
- * handed one — this module has no names for that copy and no business typing it.
141
+ * The arms look up the app's own keys, so they close over the app's `t` rather than being handed
142
+ * one. This module has no names for that copy and no business typing it.
143
143
  *
144
144
  * Annotate your object `Partial<Record<YourErrorCode, ErrorArm>>` where you write it, and a
145
145
  * code that does not exist is a compile error at the arm rather than a branch that never runs.
@@ -149,21 +149,21 @@ interface DescriberRules {
149
149
  * What to say when nothing in `codes` matches: a code this build has no arm for, or an answer
150
150
  * with no envelope at all.
151
151
  *
152
- * The built-in arm hands the reader the server's own `message`, and for one API in the fleet
153
- * that is right — its message IS the sentence a person should read. For another it is exactly
152
+ * The built-in arm hands the reader the server's own `message`, and for one API in the fleet that
153
+ * is right, because its message IS the sentence a person should read. For another it is exactly
154
154
  * wrong: that repo's own i18n rules say `message` is "the English fallback for logs", and it
155
155
  * ships three languages, so the built-in would put developer English in front of a reader who
156
- * does not speak it. One default cannot be right for both, and the one baked in here was
157
- * simply the first adopter's convention, mistaken for a fact.
156
+ * does not speak it. One default cannot be right for both, and the one baked in here was simply
157
+ * the first adopter's convention, mistaken for a fact.
158
158
  *
159
159
  * An arm here is also handed the stated wait, which the built-in spends on nothing: a refusal
160
160
  * with no arm of its own could state its expiry and have that go unsaid.
161
161
  */
162
162
  fallback?: ErrorArm;
163
163
  /**
164
- * The codes that mean "this limit does not clear by waiting" — **the same list you hand
165
- * `queryDefaults`**, because it answers the same question and a second copy is a second
166
- * chance to disagree with the retry rule. Declare it once in the app and pass it twice.
164
+ * The codes that mean "this limit does not clear by waiting". Pass **the same list to
165
+ * `queryDefaults`**, because it answers the same question and a second copy is a second chance to
166
+ * disagree with the retry rule. Declare it once in the app and pass it twice.
167
167
  */
168
168
  durableLimitCodes?: readonly string[];
169
169
  /** Longest stated wait still worth a retry rather than a countdown. Matches `queryDefaults`. */
@@ -173,23 +173,23 @@ export interface ErrorDescriberOptions<Prefix extends string, ServerPrefix exten
173
173
  /**
174
174
  * Checked against the keys, never used to find them: the three type parameters come from
175
175
  * `copyPrefix`, `messageKeyPrefix` and `knownMessageKeys`. With `t` as a source too, the call
176
- * every adopter writes — an inline `(key, params) => i18n.t(key, params)` beside an inline arm —
176
+ * every adopter writes, an inline `(key, params) => i18n.t(key, params)` beside an inline arm,
177
177
  * failed overload resolution (TS2769, measured on TypeScript 5.9.3) once the one-language
178
- * overload existed, although this signature alone accepted it. A typed `t` missing a key is
179
- * still refused.
178
+ * overload existed, although this signature alone accepted it. A typed `t` missing a key is still
179
+ * refused.
180
180
  */
181
181
  t: Translate<NoInfer<`${Prefix}${CopyName}` | `${ServerPrefix}${ServerName | PluralBase<ServerName>}`>>;
182
182
  /** Catalog namespace for this module's own copy, e.g. `"errors."`. */
183
183
  copyPrefix: Prefix;
184
184
  /**
185
185
  * The server's own catalog namespace, e.g. `"serverErrors."`. A `messageKey` outside it is
186
- * ignored — the server names a sentence, it does not get to name any key in the app.
186
+ * ignored. The server names a sentence, it does not get to name any key in the app.
187
187
  *
188
- * The `code` is read under this prefix too, for an API that has no `messageKey` field and
189
- * lets the code name the sentence — one repo in the fleet has 98 of those, `errors.NOT_FOUND`
190
- * and its siblings, against another repo's `messageKey`. Both are the same claim ("the server
191
- * named a sentence this app carries"), both pass the same gate below, and an app that uses
192
- * neither is unaffected because nothing matches.
188
+ * The `code` is read under this prefix too, for an API that has no `messageKey` field and lets
189
+ * the code name the sentence. One repo in the fleet has 98 of those, `errors.NOT_FOUND` and its
190
+ * siblings, against another repo's `messageKey`. Both are the same claim ("the server named a
191
+ * sentence this app carries"), both pass the same gate below, and an app that uses neither is
192
+ * unaffected because nothing matches.
193
193
  */
194
194
  messageKeyPrefix: ServerPrefix;
195
195
  /**
@@ -197,13 +197,13 @@ export interface ErrorDescriberOptions<Prefix extends string, ServerPrefix exten
197
197
  * catalog. Passing the catalog itself is both the membership test and the proof the compiler
198
198
  * wants: a name that is in it IS a key, so the lookup below needs no cast.
199
199
  *
200
- * It is required because leaving it out is not a smaller version of this — it is the bug the
201
- * option exists to prevent. i18next answers a key it does not have with the key itself, so a
200
+ * It is required because leaving it out reintroduces the bug the option exists to prevent rather
201
+ * than making this smaller. i18next answers a key it does not have with the key itself, so a
202
202
  * deploy landing ahead of the bundle a tab is still running would render `serverErrors.foo` at
203
203
  * somebody. A name that is absent falls back to the server's English `message` instead.
204
204
  *
205
- * Hand it over as it is. A plural sits in the catalog under suffixed names while the server
206
- * names the base, so the base is admitted too — see {@link PluralBase}.
205
+ * Hand it over as it is. A plural sits in the catalog under suffixed names while the server names
206
+ * the base, so the base is admitted too. See {@link PluralBase}.
207
207
  */
208
208
  knownMessageKeys: Record<ServerName, unknown>;
209
209
  /**
@@ -211,13 +211,13 @@ export interface ErrorDescriberOptions<Prefix extends string, ServerPrefix exten
211
211
  *
212
212
  * The envelope carries what the SERVER knows, which is not always a word anyone should read: a
213
213
  * role id (`admin`), an action verb (`approve_content`). The sentence needs whatever the app's
214
- * own screens call those things, and the substitution happens here — inside the one lookup that
215
- * reads `params` — so there is nowhere else an adopter could intervene. Without this seam the
216
- * choice is to ship the raw id into `{{role}}`, or to stop using the server's sentence at all
217
- * and re-resolve every key by hand, which is how i18n ended up inside a transport once already.
214
+ * own screens call those things, and the substitution happens here, inside the one lookup that
215
+ * reads `params`. There is nowhere else an adopter could intervene. Without this seam the choice
216
+ * is to ship the raw id into `{{role}}`, or to stop using the server's sentence at all and
217
+ * re-resolve every key by hand, which is how i18n ended up inside a transport once already.
218
218
  *
219
219
  * Optional, and identity by default: an API whose params are already words passes nothing. It
220
- * deliberately takes only the params — an arm that needs the error has `ctx` for that.
220
+ * deliberately takes only the params. An arm that needs the error has `ctx` for that.
221
221
  */
222
222
  localizeParams?: (params: Record<string, string | number> | undefined) => Record<string, unknown> | undefined;
223
223
  }
@@ -1 +1 @@
1
- {"version":3,"file":"describe-error.d.ts","sourceRoot":"","sources":["../src/describe-error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY;AACtB,mDAAmD;AACjD,OAAO;AACT,gEAAgE;GAC9D,QAAQ;AACV,gFAAgF;GAC9E,MAAM;AACR,iFAAiF;GAC/E,MAAM,CAAC;AAEX,+FAA+F;AAC/F,MAAM,WAAW,SAAS;IACxB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kGAAkG;IAClG,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,mFAAmF;IACnF,OAAO,EAAE,YAAY,CAAC;CACvB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,SAAS,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,IAAI,CACnD,GAAG,EAAE,GAAG,EACR,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,MAAM,CAAC;AAEZ,wFAAwF;AACxF,KAAK,QAAQ,GAAG,aAAa,GAAG,aAAa,GAAG,WAAW,CAAC;AAE5D;;;;;;;;GAQG;AACH,KAAK,QAAQ,GAAG,SAAS,GAAG,aAAa,GAAG,YAAY,GAAG,WAAW,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,KAAK,YAAY,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AACtE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AAG,SAAS,KAChD,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAC1C;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,2BAA4B,SAAQ,cAAc;IACjE,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,YAAY,KAAK,SAAS,CAAC;AAkDxD,sDAAsD;AACtD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,2BAA2B,GACnC,CAAC,KAAK,EAAE,OAAO,KAAK,cAAc,CAAC;AACtC,sDAAsD;AACtD,wBAAgB,oBAAoB,CAClC,MAAM,SAAS,MAAM,EACrB,YAAY,SAAS,MAAM,EAC3B,UAAU,SAAS,MAAM,EAEzB,OAAO,EAAE,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,CAAC,GAC/D,CAAC,KAAK,EAAE,OAAO,KAAK,cAAc,CAAC"}
@@ -3,17 +3,17 @@ import { ApiError } from "./api-error.js";
3
3
  import { shouldRetry } from "./query.js";
4
4
  const PLURAL_SUFFIX = /_(zero|one|two|few|many|other)$/;
5
5
  /**
6
- * "in 4 minutes" / "in 2 hours" — a wait nobody has to convert from seconds.
6
+ * Format a wait as "in 4 minutes" or "in 2 hours", without making the reader convert seconds.
7
7
  *
8
8
  * The thresholds are deliberately not round: 90 seconds rather than 60, so "in 75 seconds" does
9
9
  * not become the less precise "in 1 minute", and 90 minutes rather than 60 for the same reason
10
10
  * one rung up. Needs `waitSeconds` / `waitMinutes` / `waitHours` under `prefix`, each with a
11
11
  * `count` plural.
12
12
  *
13
- * This is what you pass as `formatWait` when your catalog carries those three:
14
- * `formatWait: (secs) => humanizeWait(t, secs, "errors.")`. An app that formats a wait with
15
- * `Intl.RelativeTimeFormat` passes its own one-liner instead and needs no wait keys at all —
16
- * which also gets it correct plurals in languages with more than two forms, for free.
13
+ * This is what you pass as `formatWait` when your catalog carries those three: `formatWait: (secs)
14
+ * => humanizeWait(t, secs, "errors.")`. An app that formats a wait with `Intl.RelativeTimeFormat`
15
+ * passes its own one-liner instead and needs no wait keys at all. It also gets correct plurals in
16
+ * languages with more than two forms, for free.
17
17
  */
18
18
  export function humanizeWait(t, secs, prefix) {
19
19
  // Up, never to the nearest: a wait is a floor, and "in 2 hours" for 2h24 sends the reader back