tempest-react-sdk 0.41.0 → 0.42.1
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/README.md +3 -3
- package/bin/tempest.mjs +3 -3
- package/dist/auth/create-tempest-auth.cjs +1 -1
- package/dist/auth/create-tempest-auth.cjs.map +1 -1
- package/dist/auth/create-tempest-auth.js +34 -30
- package/dist/auth/create-tempest-auth.js.map +1 -1
- package/dist/br.cjs +1 -1
- package/dist/br.cjs.map +1 -1
- package/dist/br.d.ts +0 -13
- package/dist/br.js +14 -15
- package/dist/br.js.map +1 -1
- package/dist/charts/palette.cjs +1 -1
- package/dist/charts/palette.cjs.map +1 -1
- package/dist/charts/palette.js +4 -4
- package/dist/charts/palette.js.map +1 -1
- package/dist/charts.cjs +1 -1
- package/dist/charts.d.ts +0 -3
- package/dist/charts.js +8 -8
- package/dist/http/api-client.cjs +1 -1
- package/dist/http/api-client.cjs.map +1 -1
- package/dist/http/api-client.js +58 -30
- package/dist/http/api-client.js.map +1 -1
- package/dist/http/resumable-upload.cjs +1 -1
- package/dist/http/resumable-upload.js +6 -6
- package/dist/icons/generated/aliases.cjs +1 -1
- package/dist/icons/generated/aliases.cjs.map +1 -1
- package/dist/icons/generated/aliases.js +9 -0
- package/dist/icons/generated/aliases.js.map +1 -1
- package/dist/icons/generated/icon-names.cjs +1 -1
- package/dist/icons/generated/icon-names.cjs.map +1 -1
- package/dist/icons/generated/icon-names.js +1 -1
- package/dist/icons/generated/icon-names.js.map +1 -1
- package/dist/icons/generated/shard-a.cjs +1 -1
- package/dist/icons/generated/shard-a.cjs.map +1 -1
- package/dist/icons/generated/shard-a.js +61 -61
- package/dist/icons/generated/shard-a.js.map +1 -1
- package/dist/icons/generated/shard-b.cjs +1 -1
- package/dist/icons/generated/shard-b.cjs.map +1 -1
- package/dist/icons/generated/shard-b.js +15 -13
- package/dist/icons/generated/shard-b.js.map +1 -1
- package/dist/icons/generated/shard-e.cjs +1 -1
- package/dist/icons/generated/shard-e.cjs.map +1 -1
- package/dist/icons/generated/shard-e.js +20 -19
- package/dist/icons/generated/shard-e.js.map +1 -1
- package/dist/icons/generated/shard-f.cjs +1 -1
- package/dist/icons/generated/shard-f.cjs.map +1 -1
- package/dist/icons/generated/shard-f.js +140 -134
- package/dist/icons/generated/shard-f.js.map +1 -1
- package/dist/icons/generated/shard-h.cjs +1 -1
- package/dist/icons/generated/shard-h.cjs.map +1 -1
- package/dist/icons/generated/shard-h.js +13 -14
- package/dist/icons/generated/shard-h.js.map +1 -1
- package/dist/icons/generated/shard-l.cjs +1 -1
- package/dist/icons/generated/shard-l.cjs.map +1 -1
- package/dist/icons/generated/shard-l.js +73 -69
- package/dist/icons/generated/shard-l.js.map +1 -1
- package/dist/icons/generated/shard-m.cjs +1 -1
- package/dist/icons/generated/shard-m.cjs.map +1 -1
- package/dist/icons/generated/shard-m.js +101 -98
- package/dist/icons/generated/shard-m.js.map +1 -1
- package/dist/icons/generated/shard-p.cjs +1 -1
- package/dist/icons/generated/shard-p.cjs.map +1 -1
- package/dist/icons/generated/shard-p.js +19 -20
- package/dist/icons/generated/shard-p.js.map +1 -1
- package/dist/icons/generated/shard-r.cjs +1 -1
- package/dist/icons/generated/shard-r.cjs.map +1 -1
- package/dist/icons/generated/shard-r.js +19 -17
- package/dist/icons/generated/shard-r.js.map +1 -1
- package/dist/icons/generated/shard-s.cjs +1 -1
- package/dist/icons/generated/shard-s.cjs.map +1 -1
- package/dist/icons/generated/shard-s.js +160 -159
- package/dist/icons/generated/shard-s.js.map +1 -1
- package/dist/icons/generated/shard-u.cjs +1 -1
- package/dist/icons/generated/shard-u.cjs.map +1 -1
- package/dist/icons/generated/shard-u.js +11 -10
- package/dist/icons/generated/shard-u.js.map +1 -1
- package/dist/icons/material-symbols.cjs +2 -0
- package/dist/icons/material-symbols.cjs.map +1 -0
- package/dist/icons/material-symbols.js +32 -0
- package/dist/icons/material-symbols.js.map +1 -0
- package/dist/icons/shard-cache.cjs.map +1 -1
- package/dist/icons/shard-cache.js.map +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.d.ts +74 -5
- package/dist/icons.js +2 -1
- package/dist/imaging/encode.cjs +1 -1
- package/dist/imaging/encode.cjs.map +1 -1
- package/dist/imaging/encode.js +1 -4
- package/dist/imaging/encode.js.map +1 -1
- package/dist/imaging.cjs +1 -1
- package/dist/imaging.d.ts +0 -7
- package/dist/imaging.js +6 -6
- package/dist/tabular/compact.cjs +1 -1
- package/dist/tabular/compact.cjs.map +1 -1
- package/dist/tabular/compact.js +8 -8
- package/dist/tabular/compact.js.map +1 -1
- package/dist/tabular/manifest.cjs +1 -1
- package/dist/tabular/manifest.cjs.map +1 -1
- package/dist/tabular/manifest.js +13 -14
- package/dist/tabular/manifest.js.map +1 -1
- package/dist/tabular.cjs +1 -1
- package/dist/tabular.d.ts +0 -9
- package/dist/tabular.js +5 -5
- package/dist/tempest-react-sdk.cjs +1 -1
- package/dist/tempest-react-sdk.d.ts +72 -305
- package/dist/tempest-react-sdk.js +183 -188
- package/dist/vision/index.cjs +1 -1
- package/dist/vision/index.cjs.map +1 -1
- package/dist/vision/index.js +1 -1
- package/dist/vision/index.js.map +1 -1
- package/dist/vision/preprocess/pipeline.cjs +1 -1
- package/dist/vision/preprocess/pipeline.cjs.map +1 -1
- package/dist/vision/preprocess/pipeline.js +43 -28
- package/dist/vision/preprocess/pipeline.js.map +1 -1
- package/dist/vision.d.ts +6 -3
- package/dist/vite.cjs +1 -1
- package/dist/vite.d.ts +0 -25
- package/dist/vite.js +6 -6
- package/package.json +5 -5
|
@@ -564,13 +564,37 @@ export declare interface ApiClientConfig {
|
|
|
564
564
|
* Return an empty string to disable the header.
|
|
565
565
|
*/
|
|
566
566
|
requestId?: () => string;
|
|
567
|
-
/**
|
|
567
|
+
/**
|
|
568
|
+
* Called when a request ends up unauthorized — a 401 with no `refresh`
|
|
569
|
+
* configured, a `refresh()` that threw, or a retry that came back 401 again
|
|
570
|
+
* after a refresh that resolved. Use it to end the session.
|
|
571
|
+
*/
|
|
568
572
|
onUnauthorized?: (response: Response) => void | Promise<void>;
|
|
569
573
|
/**
|
|
570
574
|
* Optional refresh hook. When provided and the original request returns 401,
|
|
571
575
|
* the client awaits `refresh()` then retries the request once.
|
|
572
576
|
*/
|
|
573
577
|
refresh?: () => Promise<void>;
|
|
578
|
+
/**
|
|
579
|
+
* Retry failed requests with exponential backoff. Off by default, so the
|
|
580
|
+
* client keeps failing fast unless you opt in.
|
|
581
|
+
*
|
|
582
|
+
* `true` uses the built-in policy, which is deliberately conservative: only
|
|
583
|
+
* idempotent methods (`GET`, `HEAD`, `OPTIONS`) and only failures a retry
|
|
584
|
+
* can plausibly fix — a network error, `408`, `425`, `429`, or any `5xx`. A
|
|
585
|
+
* `POST` is never retried on its own, so nothing gets duplicated.
|
|
586
|
+
*
|
|
587
|
+
* Pass {@link RetryOptions} to tune it. Supplying your own `shouldRetry`
|
|
588
|
+
* replaces the built-in policy entirely, method check included — that is the
|
|
589
|
+
* escape hatch for retrying a write you made idempotent with
|
|
590
|
+
* {@link generateIdempotencyKey}.
|
|
591
|
+
*
|
|
592
|
+
* Retries wrap the whole request, refresh included, and each attempt carries
|
|
593
|
+
* its own `X-Request-ID`. A `4xx` outside the three listed above is never
|
|
594
|
+
* retried: repeating an identical request cannot fix a bad payload or a
|
|
595
|
+
* permission the caller does not have.
|
|
596
|
+
*/
|
|
597
|
+
retry?: boolean | RetryOptions;
|
|
574
598
|
/** Whether to send cookies on cross-origin requests (default: false). */
|
|
575
599
|
withCredentials?: boolean;
|
|
576
600
|
/** Default headers merged into every request. */
|
|
@@ -716,27 +740,6 @@ export declare interface ApplyThemeOptions {
|
|
|
716
740
|
target?: Document | ShadowRoot | HTMLElement;
|
|
717
741
|
}
|
|
718
742
|
|
|
719
|
-
/**
|
|
720
|
-
* Apply a move and return the next value.
|
|
721
|
-
*
|
|
722
|
-
* Disabled rows are dropped here rather than at the call site, so no caller can
|
|
723
|
-
* move one by pressing the bulk button — the check has to live where the
|
|
724
|
-
* decision is made, not in each of the four places that trigger one.
|
|
725
|
-
*
|
|
726
|
-
* @param params.value - Current target ids.
|
|
727
|
-
* @param params.moving - Ids being moved.
|
|
728
|
-
* @param params.to - Destination pane.
|
|
729
|
-
* @param params.items - The catalogue, to look disabled rows up.
|
|
730
|
-
* @param params.order - Ids in catalogue order, so the result stays stable.
|
|
731
|
-
* @returns The next value, in catalogue order.
|
|
732
|
-
*/
|
|
733
|
-
export declare function applyTransferMove({ value, moving, to, items, }: {
|
|
734
|
-
value: readonly string[];
|
|
735
|
-
moving: readonly string[];
|
|
736
|
-
to: TransferSide;
|
|
737
|
-
items: readonly TransferItem[];
|
|
738
|
-
}): string[];
|
|
739
|
-
|
|
740
743
|
/**
|
|
741
744
|
* Compose the Tempest app-wide providers in one place: error boundary →
|
|
742
745
|
* TanStack Query → theme → i18n. Query and theme are on by default; i18n and
|
|
@@ -1548,28 +1551,6 @@ export declare const BREAKPOINTS: Record<Breakpoint, number>;
|
|
|
1548
1551
|
|
|
1549
1552
|
export { BrowserRouter }
|
|
1550
1553
|
|
|
1551
|
-
/**
|
|
1552
|
-
* Parse an error body + response into the Tempest {@link ApiError} envelope.
|
|
1553
|
-
*
|
|
1554
|
-
* Reads `detail`/`message`, the programmatic `code`, and the correlation id
|
|
1555
|
-
* from `details.request_id` (falling back to the `X-Request-ID` header, then
|
|
1556
|
-
* the id the client sent).
|
|
1557
|
-
*
|
|
1558
|
-
* @param status - HTTP status code.
|
|
1559
|
-
* @param body - The parsed error body (object, string, or null).
|
|
1560
|
-
* @param headers - The response headers (for the `X-Request-ID` fallback).
|
|
1561
|
-
* @param sentRequestId - The id the client sent on the request, if any.
|
|
1562
|
-
* @returns A fully-populated `ApiError`.
|
|
1563
|
-
*
|
|
1564
|
-
* @tempest-limits param-count — the arguments are the response as it arrives
|
|
1565
|
-
* (`status`, `body`, `headers`) plus the id the request was sent with, and they are
|
|
1566
|
-
* passed at exactly one place: the client's response path. Exported from the package
|
|
1567
|
-
* root, so the rewrite would be breaking for callers that build their own errors.
|
|
1568
|
-
*/
|
|
1569
|
-
export declare function buildApiError(status: number, body: unknown, headers?: Headers | {
|
|
1570
|
-
get(name: string): string | null;
|
|
1571
|
-
}, sentRequestId?: string): ApiError;
|
|
1572
|
-
|
|
1573
1554
|
/**
|
|
1574
1555
|
* Builds an `intent://` URL that re-opens the current page inside Chrome on
|
|
1575
1556
|
* Android. When Chrome is missing, the fallback URL points to the Play Store so
|
|
@@ -2019,28 +2000,6 @@ export declare interface ChatRun {
|
|
|
2019
2000
|
|
|
2020
2001
|
export declare type ChatSection = ChatDay | ChatRun;
|
|
2021
2002
|
|
|
2022
|
-
/** Labels the thread needs, per locale. */
|
|
2023
|
-
declare interface ChatStrings {
|
|
2024
|
-
thread: string;
|
|
2025
|
-
today: string;
|
|
2026
|
-
yesterday: string;
|
|
2027
|
-
you: string;
|
|
2028
|
-
typingOne: (name: string) => string;
|
|
2029
|
-
typingTwo: (a: string, b: string) => string;
|
|
2030
|
-
typingMany: (n: number) => string;
|
|
2031
|
-
sending: string;
|
|
2032
|
-
sent: string;
|
|
2033
|
-
read: string;
|
|
2034
|
-
failed: string;
|
|
2035
|
-
retry: string;
|
|
2036
|
-
empty: string;
|
|
2037
|
-
placeholder: string;
|
|
2038
|
-
send: string;
|
|
2039
|
-
}
|
|
2040
|
-
|
|
2041
|
-
/** Locale strings for the thread. */
|
|
2042
|
-
export declare function chatStrings(locale: "pt-BR" | "en"): ChatStrings;
|
|
2043
|
-
|
|
2044
2003
|
/**
|
|
2045
2004
|
* Accessible checkbox. Supports a tri-state via `indeterminate` and pairs the
|
|
2046
2005
|
* input with a label/description column for forms.
|
|
@@ -2116,27 +2075,6 @@ export declare function clamp(value: number, min: number, max: number): number;
|
|
|
2116
2075
|
/** Clamp a latitude into the valid `[-90, 90]` range. */
|
|
2117
2076
|
export declare function clampLatitude(latitude: number): number;
|
|
2118
2077
|
|
|
2119
|
-
/**
|
|
2120
|
-
* Map an unknown `getUserMedia` failure into a {@link MediaAccessError}.
|
|
2121
|
-
*
|
|
2122
|
-
* The order matters. A missing `navigator.mediaDevices` is almost never "this
|
|
2123
|
-
* browser cannot do audio" — it is a page served over plain HTTP, where the whole
|
|
2124
|
-
* API is simply absent. Reporting `unsupported` there sends the developer looking
|
|
2125
|
-
* for a polyfill for a problem an `https://` URL fixes, so the secure-context check
|
|
2126
|
-
* runs first and wins.
|
|
2127
|
-
*
|
|
2128
|
-
* The `DOMException.name` values are then collapsed into kinds an app can actually
|
|
2129
|
-
* branch on, because the raw names do not group the way a UI needs them:
|
|
2130
|
-
* `NotFoundError` and `OverconstrainedError` both mean "you will not get a device
|
|
2131
|
-
* with these constraints", and `NotReadableError` and `AbortError` both mean "the
|
|
2132
|
-
* hardware is busy" — most often another tab of the same app.
|
|
2133
|
-
*
|
|
2134
|
-
* @param err - Whatever `getUserMedia` (or a device query) rejected with.
|
|
2135
|
-
* @param device - Which device was being opened, for the message.
|
|
2136
|
-
* @returns A stable kind plus a message safe to show a user.
|
|
2137
|
-
*/
|
|
2138
|
-
export declare function classifyMediaError(err: unknown, device?: MediaDeviceKindLabel): MediaAccessError;
|
|
2139
|
-
|
|
2140
2078
|
/**
|
|
2141
2079
|
* Map a thrown WebAuthn failure onto a {@link PasskeyError}.
|
|
2142
2080
|
*
|
|
@@ -2562,9 +2500,29 @@ export declare const CPFInput: ForwardRefExoticComponent<Omit<InputProps, "value
|
|
|
2562
2500
|
/**
|
|
2563
2501
|
* Create a typed HTTP client backed by `fetch`.
|
|
2564
2502
|
*
|
|
2565
|
-
* Handles JSON serialization, query params, bearer auth via `getToken`,
|
|
2566
|
-
*
|
|
2567
|
-
*
|
|
2503
|
+
* Handles JSON serialization, query params, bearer auth via `getToken`, uploads
|
|
2504
|
+
* via `FormData`, and throws a typed `ApiError` on any non-2xx response.
|
|
2505
|
+
*
|
|
2506
|
+
* **Expired sessions.** A `401` with `refresh` configured awaits the refresh and
|
|
2507
|
+
* replays the request once. `onUnauthorized` fires whenever that path ends
|
|
2508
|
+
* unauthorized anyway — the refresh threw, or the replay came back `401` — which
|
|
2509
|
+
* is the signal to clear the session. Without `refresh`, the first `401` calls
|
|
2510
|
+
* it directly.
|
|
2511
|
+
*
|
|
2512
|
+
* **Retries** are off unless you set `retry`. See {@link ApiClientConfig.retry}
|
|
2513
|
+
* for the built-in policy; it never replays a write.
|
|
2514
|
+
*
|
|
2515
|
+
* @example
|
|
2516
|
+
* const api = createApiClient({
|
|
2517
|
+
* baseURL: import.meta.env.VITE_API_URL,
|
|
2518
|
+
* getToken: () => useAuthStore.getState().token,
|
|
2519
|
+
* refresh,
|
|
2520
|
+
* onUnauthorized: () => useAuthStore.getState().logout(),
|
|
2521
|
+
* retry: true,
|
|
2522
|
+
* });
|
|
2523
|
+
*
|
|
2524
|
+
* @param config - Base URL plus the optional auth, retry and fetch hooks.
|
|
2525
|
+
* @returns A client with `request`/`get`/`post`/`put`/`patch`/`delete`/`upload`.
|
|
2568
2526
|
*/
|
|
2569
2527
|
export declare function createApiClient(config: ApiClientConfig): ApiClient;
|
|
2570
2528
|
|
|
@@ -3389,8 +3347,13 @@ export declare interface CreateStorePersistOptions<T> {
|
|
|
3389
3347
|
* Turn-key auth preset wiring `createAuthStore` + `createRefreshQueue` +
|
|
3390
3348
|
* `createApiClient` to the Tempest FastAPI SDK auth contract: login returns
|
|
3391
3349
|
* `{ access_token, token_type }`, requests carry `Authorization: Bearer`, and a
|
|
3392
|
-
* `401` triggers a single deduplicated refresh +
|
|
3393
|
-
*
|
|
3350
|
+
* `401` triggers a single deduplicated refresh + replay.
|
|
3351
|
+
*
|
|
3352
|
+
* The session is cleared whenever that path ends unauthorized anyway — the
|
|
3353
|
+
* refresh threw, or the replay came back `401` — so a refresh token that the
|
|
3354
|
+
* backend has revoked cannot leave the app holding a dead session. With
|
|
3355
|
+
* `redirectTo` set, the browser also leaves the page; without it, clearing the
|
|
3356
|
+
* store is enough for a `<RouteGuard>` to navigate on its own.
|
|
3394
3357
|
*
|
|
3395
3358
|
* @example
|
|
3396
3359
|
* const auth = createTempestAuth<User, { email: string; password: string }>({
|
|
@@ -3442,6 +3405,23 @@ export declare interface CreateTempestAuthOptions<TUser> {
|
|
|
3442
3405
|
* refresh token is stored, else `undefined` (cookie-based refresh).
|
|
3443
3406
|
*/
|
|
3444
3407
|
refreshBody?: (refreshToken: string | null) => unknown;
|
|
3408
|
+
/**
|
|
3409
|
+
* Retry policy for `api`, forwarded to {@link createApiClient}. Off by
|
|
3410
|
+
* default; `true` enables the conservative built-in policy, which never
|
|
3411
|
+
* replays a write.
|
|
3412
|
+
*/
|
|
3413
|
+
retry?: boolean | RetryOptions;
|
|
3414
|
+
/**
|
|
3415
|
+
* Where to send the browser when the session ends — a hard navigation via
|
|
3416
|
+
* `window.location.assign`, after the store is cleared.
|
|
3417
|
+
*
|
|
3418
|
+
* **Prefer leaving this unset.** `logout()` already clears the store, so a
|
|
3419
|
+
* `<RouteGuard when={isAuthenticated} redirectTo="/login">` wrapped around
|
|
3420
|
+
* the protected area navigates on its own, which keeps the SPA alive and the
|
|
3421
|
+
* router history intact. Reach for this only when the expiry can happen
|
|
3422
|
+
* outside any guarded subtree and a full reload is acceptable.
|
|
3423
|
+
*/
|
|
3424
|
+
redirectTo?: string;
|
|
3445
3425
|
}
|
|
3446
3426
|
|
|
3447
3427
|
/**
|
|
@@ -3931,17 +3911,6 @@ export declare interface DateRangePickerProps extends Omit<HTMLAttributes<HTMLDi
|
|
|
3931
3911
|
weekStartsOn?: WeekStart_2;
|
|
3932
3912
|
}
|
|
3933
3913
|
|
|
3934
|
-
/**
|
|
3935
|
-
* Label for a date heading: `"Hoje"`, `"Ontem"`, or the formatted date.
|
|
3936
|
-
*
|
|
3937
|
-
* @param date - Local midnight of the day being labelled.
|
|
3938
|
-
* @param params.now - Reference instant, so tests and SSR-free renders are stable.
|
|
3939
|
-
*/
|
|
3940
|
-
export declare function dayLabel(date: number, { locale, now }?: {
|
|
3941
|
-
locale?: "pt-BR" | "en";
|
|
3942
|
-
now?: number;
|
|
3943
|
-
}): string;
|
|
3944
|
-
|
|
3945
3914
|
/** The visible time window of a day, in minutes from midnight. */
|
|
3946
3915
|
export declare interface DayWindow {
|
|
3947
3916
|
startMinute: number;
|
|
@@ -4299,16 +4268,6 @@ export declare interface DropzoneProps {
|
|
|
4299
4268
|
className?: string;
|
|
4300
4269
|
}
|
|
4301
4270
|
|
|
4302
|
-
/**
|
|
4303
|
-
* Look up the duration multiplier for a travel mode, falling back to `1.0`
|
|
4304
|
-
* for unknown modes. Mirrors `duration_factor` from `tempest-fastapi-sdk`.
|
|
4305
|
-
*
|
|
4306
|
-
* @param mode - Travel mode.
|
|
4307
|
-
* @param factors - Optional override map (partial merges over the defaults).
|
|
4308
|
-
* @returns The multiplier for `mode`.
|
|
4309
|
-
*/
|
|
4310
|
-
export declare function durationFactor(mode: TravelMode, factors?: Partial<Record<TravelMode, number>>): number;
|
|
4311
|
-
|
|
4312
4271
|
/**
|
|
4313
4272
|
* Mean Earth radius in kilometers. Same value used by `tempest-fastapi-sdk`
|
|
4314
4273
|
* (`geo/distance.py`) so client and server distances agree.
|
|
@@ -5234,33 +5193,6 @@ export declare interface GridProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
5234
5193
|
*/
|
|
5235
5194
|
export declare function groupBy<T, K extends PropertyKey>(items: T[], key: (item: T) => K): Record<K, T[]>;
|
|
5236
5195
|
|
|
5237
|
-
/**
|
|
5238
|
-
* Turn a flat message list into the sections a thread renders: a date heading
|
|
5239
|
-
* whenever the local day changes, and runs of consecutive messages from the same
|
|
5240
|
-
* author.
|
|
5241
|
-
*
|
|
5242
|
-
* Grouping is what makes a thread readable — repeating the avatar and the name on
|
|
5243
|
-
* every line of a five-line burst turns a conversation into a list of receipts.
|
|
5244
|
-
* The run breaks on a different author, a different day, or a gap longer than
|
|
5245
|
-
* `windowMs`: a reply an hour later is a new beat in the conversation even when
|
|
5246
|
-
* nobody else spoke, and joining it to the earlier burst would put one timestamp
|
|
5247
|
-
* on messages an hour apart.
|
|
5248
|
-
*
|
|
5249
|
-
* Order is taken as given, oldest first, and never sorted here: a thread that
|
|
5250
|
-
* reorders what the server sent would fight optimistic inserts, where the
|
|
5251
|
-
* pending message is deliberately last.
|
|
5252
|
-
*
|
|
5253
|
-
* @param params.messages - Oldest first.
|
|
5254
|
-
* @param params.currentUserId - Author id treated as "own".
|
|
5255
|
-
* @param params.windowMs - Gap that still keeps a run together. Default 5 min.
|
|
5256
|
-
* @returns Sections in render order.
|
|
5257
|
-
*/
|
|
5258
|
-
export declare function groupMessages({ messages, currentUserId, windowMs, }: {
|
|
5259
|
-
messages: readonly ChatMessage[];
|
|
5260
|
-
currentUserId?: string;
|
|
5261
|
-
windowMs?: number;
|
|
5262
|
-
}): ChatSection[];
|
|
5263
|
-
|
|
5264
5196
|
/**
|
|
5265
5197
|
* Minimal subset of [`@growthbook/growthbook`](https://docs.growthbook.io/lib/js)
|
|
5266
5198
|
* used by the adapter. Pass a `GrowthBook` instance directly.
|
|
@@ -6827,12 +6759,6 @@ export declare interface MenubarProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
6827
6759
|
menus: MenubarMenu[];
|
|
6828
6760
|
}
|
|
6829
6761
|
|
|
6830
|
-
/**
|
|
6831
|
-
* Web Mercator (EPSG:3857) latitude clamp. Latitudes beyond this diverge to
|
|
6832
|
-
* infinity in the projection, so tile maps cap here.
|
|
6833
|
-
*/
|
|
6834
|
-
export declare const MERCATOR_MAX_LATITUDE = 85.05112878;
|
|
6835
|
-
|
|
6836
6762
|
/**
|
|
6837
6763
|
* A point projected onto the unit Web Mercator plane. Both axes are in `[0, 1]`
|
|
6838
6764
|
* — `x` grows east, `y` grows south (screen convention).
|
|
@@ -6847,20 +6773,6 @@ export declare type Messages = Record<string, string>;
|
|
|
6847
6773
|
/** Lifecycle of a microphone stream. */
|
|
6848
6774
|
export declare type MicrophoneStatus = "idle" | "requesting" | "ready" | "error";
|
|
6849
6775
|
|
|
6850
|
-
/**
|
|
6851
|
-
* The error for "the API is not here at all", which is a different question from
|
|
6852
|
-
* "the API rejected".
|
|
6853
|
-
*
|
|
6854
|
-
* `classifyMediaError` takes a thrown value; a missing `navigator.mediaDevices` never
|
|
6855
|
-
* threw one, and handing it `null` would come back `unknown` — the least actionable
|
|
6856
|
-
* kind there is. The two real causes are an insecure page (the fix is a URL) and an
|
|
6857
|
-
* engine that genuinely cannot capture (the fix is another browser), and telling them
|
|
6858
|
-
* apart is the whole point.
|
|
6859
|
-
*
|
|
6860
|
-
* @param device - Which device was being opened, for the message.
|
|
6861
|
-
*/
|
|
6862
|
-
export declare function missingCaptureApiError(device?: MediaDeviceKindLabel): MediaAccessError;
|
|
6863
|
-
|
|
6864
6776
|
/**
|
|
6865
6777
|
* Portal-rendered modal dialog with backdrop, Esc handler, and slots for
|
|
6866
6778
|
* header/body/footer. Locks body scroll while open.
|
|
@@ -7806,14 +7718,6 @@ export { Params }
|
|
|
7806
7718
|
/** Query-param values accepted by the API client for a list request. */
|
|
7807
7719
|
declare type ParamValue = string | number | boolean | undefined | null;
|
|
7808
7720
|
|
|
7809
|
-
/**
|
|
7810
|
-
* Parse a Markdown document into blocks.
|
|
7811
|
-
*
|
|
7812
|
-
* @param source - Raw Markdown.
|
|
7813
|
-
* @returns Block nodes in document order.
|
|
7814
|
-
*/
|
|
7815
|
-
export declare function parseMarkdown(source: string): MarkdownBlock[];
|
|
7816
|
-
|
|
7817
7721
|
/**
|
|
7818
7722
|
* Validate an unknown response payload against a zod schema.
|
|
7819
7723
|
*
|
|
@@ -8172,14 +8076,6 @@ export declare function pick<T extends object, K extends keyof T>(obj: T, keys:
|
|
|
8172
8076
|
*/
|
|
8173
8077
|
export declare function pickAudioMimeType(preferred?: readonly string[]): string | null;
|
|
8174
8078
|
|
|
8175
|
-
/**
|
|
8176
|
-
* First container in `preferred` the browser can actually produce, or `null`.
|
|
8177
|
-
*
|
|
8178
|
-
* @param preferred - Candidates, best first.
|
|
8179
|
-
* @returns A supported MIME type, or `null` when none is.
|
|
8180
|
-
*/
|
|
8181
|
-
export declare function pickRecordingMimeType(preferred: readonly string[]): string | null;
|
|
8182
|
-
|
|
8183
8079
|
/**
|
|
8184
8080
|
* First video container in `preferred` the browser can actually produce, or `null`.
|
|
8185
8081
|
*
|
|
@@ -8966,14 +8862,6 @@ export declare interface ResizableProps extends Omit<HTMLAttributes<HTMLDivEleme
|
|
|
8966
8862
|
|
|
8967
8863
|
export declare type ResolvedTheme = "light" | "dark";
|
|
8968
8864
|
|
|
8969
|
-
/**
|
|
8970
|
-
* Normalise a language name onto a known grammar.
|
|
8971
|
-
*
|
|
8972
|
-
* @param language - Whatever the caller passed, e.g. `"ts"` or `"Shell"`.
|
|
8973
|
-
* @returns The grammar to use; `"plain"` when there is no match.
|
|
8974
|
-
*/
|
|
8975
|
-
export declare function resolveLanguage(language: string | undefined): CodeLanguage;
|
|
8976
|
-
|
|
8977
8865
|
/**
|
|
8978
8866
|
* Responsive value — either a single value applied at all breakpoints, or
|
|
8979
8867
|
* an object with `mobile` / `tablet` / `desktop` overrides. Apps can mix
|
|
@@ -9285,28 +9173,6 @@ export declare interface SafeAreaProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
9285
9173
|
children?: ReactNode;
|
|
9286
9174
|
}
|
|
9287
9175
|
|
|
9288
|
-
/**
|
|
9289
|
-
* URL vetting for links and images in rendered Markdown.
|
|
9290
|
-
*
|
|
9291
|
-
* This is the security boundary of the whole component. Markdown that arrives from
|
|
9292
|
-
* a user — a comment, a ticket description, a review — reaches the DOM as a real
|
|
9293
|
-
* `href`, and `javascript:alert(1)` in a link is script execution on click. So the
|
|
9294
|
-
* scheme is checked against an allowlist rather than a blocklist: a blocklist has
|
|
9295
|
-
* to enumerate `javascript:`, `JaVaScRiPt:`, `java\tscript:`, `javascript:`
|
|
9296
|
-
* and whatever comes next, and misses the one nobody thought of.
|
|
9297
|
-
*/
|
|
9298
|
-
/**
|
|
9299
|
-
* The href to render, or `null` when the URL must not be linked.
|
|
9300
|
-
*
|
|
9301
|
-
* Relative URLs (`/docs`, `./x`, `#anchor`, `foo/bar`) are kept: they cannot carry
|
|
9302
|
-
* a scheme, so they cannot execute anything, and dropping them would break every
|
|
9303
|
-
* in-app link.
|
|
9304
|
-
*
|
|
9305
|
-
* @param raw - URL as written in the Markdown.
|
|
9306
|
-
* @returns A safe href, or `null`.
|
|
9307
|
-
*/
|
|
9308
|
-
export declare function safeLinkUrl(raw: string): string | null;
|
|
9309
|
-
|
|
9310
9176
|
/** The ten steps of a Tempest tint scale, lightest to darkest. */
|
|
9311
9177
|
export declare type ScaleStep = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
9312
9178
|
|
|
@@ -9482,19 +9348,6 @@ export declare interface SegmentedControlProps<TValue extends string = string> e
|
|
|
9482
9348
|
*/
|
|
9483
9349
|
export declare const Select: ForwardRefExoticComponent<SelectProps & RefAttributes<HTMLSelectElement>>;
|
|
9484
9350
|
|
|
9485
|
-
/**
|
|
9486
|
-
* Pick the densest mode the payload qualifies for.
|
|
9487
|
-
*
|
|
9488
|
-
* Numeric packs 3 digits into 10 bits and alphanumeric 2 characters into 11, so
|
|
9489
|
-
* a phone number or an upper-case code encodes far smaller than the same string
|
|
9490
|
-
* as bytes — often a whole version smaller, which is a visibly coarser symbol
|
|
9491
|
-
* and therefore easier to scan.
|
|
9492
|
-
*
|
|
9493
|
-
* @param text - The payload.
|
|
9494
|
-
* @returns The narrowest mode that can represent it.
|
|
9495
|
-
*/
|
|
9496
|
-
export declare function selectMode(text: string): QRMode;
|
|
9497
|
-
|
|
9498
9351
|
export declare interface SelectOption {
|
|
9499
9352
|
value: string | number;
|
|
9500
9353
|
label: string;
|
|
@@ -10040,25 +9893,6 @@ export declare interface SpinnerProps {
|
|
|
10040
9893
|
|
|
10041
9894
|
export declare type SpinnerSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
10042
9895
|
|
|
10043
|
-
/**
|
|
10044
|
-
* Split the catalogue into the two panes.
|
|
10045
|
-
*
|
|
10046
|
-
* The selected ids are the single source of truth — the panes are derived, never
|
|
10047
|
-
* stored. Two stored lists drift the moment the catalogue changes under them: a
|
|
10048
|
-
* permission that is removed upstream lingers in whichever pane held it, and an
|
|
10049
|
-
* id that appears in both is a bug nobody can see.
|
|
10050
|
-
*
|
|
10051
|
-
* Order follows `items`, so both panes read in the catalogue's order rather than
|
|
10052
|
-
* in the order somebody happened to click.
|
|
10053
|
-
*
|
|
10054
|
-
* @param items - The whole catalogue.
|
|
10055
|
-
* @param value - Ids currently on the target side.
|
|
10056
|
-
*/
|
|
10057
|
-
export declare function splitTransferSides(items: readonly TransferItem[], value: readonly string[]): {
|
|
10058
|
-
source: TransferItem[];
|
|
10059
|
-
target: TransferItem[];
|
|
10060
|
-
};
|
|
10061
|
-
|
|
10062
9896
|
/** Flex-based vertical or horizontal stack with a numeric `gap`. */
|
|
10063
9897
|
export declare function Stack({ direction, gap, align, justify, wrap, className, style, children, ...props }: StackProps): JSX.Element;
|
|
10064
9898
|
|
|
@@ -10593,9 +10427,6 @@ export declare interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAr
|
|
|
10593
10427
|
wrapperClassName?: string;
|
|
10594
10428
|
}
|
|
10595
10429
|
|
|
10596
|
-
/** The default `<style>` element id owned by {@link applyTheme}. */
|
|
10597
|
-
export declare const THEME_STYLE_ID = "tempest-theme";
|
|
10598
|
-
|
|
10599
10430
|
export declare interface ThemeContextValue {
|
|
10600
10431
|
/** Raw user preference (light / dark / system). */
|
|
10601
10432
|
theme: ThemeMode;
|
|
@@ -10712,9 +10543,6 @@ export declare function throttle<A extends unknown[]>(fn: (...args: A) => void,
|
|
|
10712
10543
|
cancel: () => void;
|
|
10713
10544
|
};
|
|
10714
10545
|
|
|
10715
|
-
/** Clock label for a single message — the time, not a relative phrase. */
|
|
10716
|
-
export declare function timeLabel(timestamp: number, locale?: "pt-BR" | "en"): string;
|
|
10717
|
-
|
|
10718
10546
|
/**
|
|
10719
10547
|
* Vertical event timeline — activity feeds, order trackers, audit logs.
|
|
10720
10548
|
* Each entry has a marker (color or custom icon), title, optional
|
|
@@ -10900,42 +10728,6 @@ export declare interface Token {
|
|
|
10900
10728
|
value: string;
|
|
10901
10729
|
}
|
|
10902
10730
|
|
|
10903
|
-
/**
|
|
10904
|
-
* Split source into coloured tokens.
|
|
10905
|
-
*
|
|
10906
|
-
* This is a **scanner, not a parser**: it recognises comments, strings, numbers,
|
|
10907
|
-
* keywords and punctuation by pattern, and knows nothing about scope, types or
|
|
10908
|
-
* grammar. That is a deliberate ceiling. A real parser per language is a
|
|
10909
|
-
* dependency the size of the rest of the SDK, and the payoff — being right about
|
|
10910
|
-
* the corner cases in a documentation snippet — is small. Where it is unsure it
|
|
10911
|
-
* emits `plain`, which renders as ordinary text rather than as something wrong.
|
|
10912
|
-
*
|
|
10913
|
-
* Unknown languages produce a single `plain` token, so an unhighlighted block is
|
|
10914
|
-
* a normal outcome and never an error.
|
|
10915
|
-
*
|
|
10916
|
-
* @param code - The source.
|
|
10917
|
-
* @param language - Grammar name or alias.
|
|
10918
|
-
* @returns Tokens covering the input exactly, in order.
|
|
10919
|
-
*
|
|
10920
|
-
* @example
|
|
10921
|
-
* tokenize("const x = 1;", "ts");
|
|
10922
|
-
* // [{kind: "keyword", value: "const"}, {kind: "plain", value: " x "}, …]
|
|
10923
|
-
*/
|
|
10924
|
-
export declare function tokenize(code: string, language: string | undefined): Token[];
|
|
10925
|
-
|
|
10926
|
-
/**
|
|
10927
|
-
* The same tokens, split at newlines so each line can be rendered on its own.
|
|
10928
|
-
*
|
|
10929
|
-
* Line numbers and highlighted lines both need a per-line structure, and a token
|
|
10930
|
-
* is free to span a line break — a block comment usually does. Splitting here
|
|
10931
|
-
* keeps that out of the component.
|
|
10932
|
-
*
|
|
10933
|
-
* @param code - The source.
|
|
10934
|
-
* @param language - Grammar name or alias.
|
|
10935
|
-
* @returns One token array per line. Always at least one line.
|
|
10936
|
-
*/
|
|
10937
|
-
export declare function tokenizeLines(code: string, language: string | undefined): Token[][];
|
|
10938
|
-
|
|
10939
10731
|
/** What a token is painted as. */
|
|
10940
10732
|
export declare type TokenKind = "plain" | "comment" | "string" | "number" | "keyword" | "literal" | "function" | "punctuation" | "tag" | "attribute" | "property";
|
|
10941
10733
|
|
|
@@ -11289,12 +11081,6 @@ export declare interface TruncateTextProps extends HTMLAttributes<HTMLDivElement
|
|
|
11289
11081
|
*/
|
|
11290
11082
|
export declare function turnTime(timestamp: number, locale?: "pt-BR" | "en"): string;
|
|
11291
11083
|
|
|
11292
|
-
/** The tus protocol version this client speaks. */
|
|
11293
|
-
export declare const TUS_VERSION = "1.0.0";
|
|
11294
|
-
|
|
11295
|
-
/** Sentence for the typing indicator, or `null` when nobody is typing. */
|
|
11296
|
-
export declare function typingLabel(names: readonly string[], locale?: "pt-BR" | "en"): string | null;
|
|
11297
|
-
|
|
11298
11084
|
/**
|
|
11299
11085
|
* Remove duplicate items, keeping the first occurrence of each distinct key.
|
|
11300
11086
|
*
|
|
@@ -13959,25 +13745,6 @@ export declare interface ViaCEPResult {
|
|
|
13959
13745
|
siafi?: string;
|
|
13960
13746
|
}
|
|
13961
13747
|
|
|
13962
|
-
/**
|
|
13963
|
-
* Container/codec candidates for video, best first.
|
|
13964
|
-
*
|
|
13965
|
-
* VP9 in WebM leads because it is the best quality per byte that Chromium and Firefox
|
|
13966
|
-
* both encode natively; VP8 is the fallback for older Chromium and for hardware that
|
|
13967
|
-
* refuses VP9. `video/mp4` is last and exists for Safari, which produces H.264 in MP4
|
|
13968
|
-
* and nothing else — and only since Safari 14.1.
|
|
13969
|
-
*
|
|
13970
|
-
* Every candidate carries **Opus or AAC audio in the same container**, because a
|
|
13971
|
-
* screen recording with the tab's audio dropped is a support ticket, not a
|
|
13972
|
-
* simplification. On a stream with no audio track the browser simply omits it.
|
|
13973
|
-
*
|
|
13974
|
-
* Ported from the intersection of what `MediaRecorder.isTypeSupported` accepts in
|
|
13975
|
-
* Chrome 120+, Firefox 115+ and Safari 17. Re-check against
|
|
13976
|
-
* <https://developer.mozilla.org/docs/Web/API/MediaRecorder/isTypeSupported> before
|
|
13977
|
-
* adding to the list.
|
|
13978
|
-
*/
|
|
13979
|
-
export declare const VIDEO_MIME_CANDIDATES: readonly string[];
|
|
13980
|
-
|
|
13981
13748
|
/** Imperative video recorder. Same shape as the audio one. */
|
|
13982
13749
|
export declare type VideoRecorderHandle = MediaRecorderHandle;
|
|
13983
13750
|
|