@q9labsai/chalk-react 5.4.0 → 5.5.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/README.md +7 -30
- package/dist/Board-PPO62QTR.js +80 -0
- package/dist/CallCharts-7ZQLN47C.js +114 -0
- package/dist/CallDetails-IG57GXT2.js +200 -0
- package/dist/CallDialogContent-GST2I23W.js +177 -0
- package/dist/CameraBackgroundPicker-AZXKBGRF.js +72 -0
- package/dist/ConnectionNotice-NQUBBT46.js +55 -0
- package/dist/DeviceAccessCard-MLRBTPRP.js +238 -0
- package/dist/DeviceAccessWaiting-MQXXW45M.js +25 -0
- package/dist/DeviceSheet-GZTV44UW.js +118 -0
- package/dist/InviteQrCode-TNTZA3GS.js +54 -0
- package/dist/KnockNotice-CAW4CJ4S.js +181 -0
- package/dist/ReactionSheet-ZU6RWC66.js +132 -0
- package/dist/chunk-26PBFST5.js +25 -0
- package/dist/{chunk-K5DV2OTY.js → chunk-4RSCAIFK.js} +340 -165
- package/dist/chunk-ADIDI7AJ.js +10 -0
- package/dist/chunk-ALGD3RBI.js +10 -0
- package/dist/chunk-CQBYFA2W.js +73 -0
- package/dist/chunk-E6HPIMFO.js +44 -0
- package/dist/{chunk-LYZ7EBFF.js → chunk-F6QZY5SM.js} +4116 -4605
- package/dist/chunk-I6FSUWKG.js +51 -0
- package/dist/chunk-JDCFKSGV.js +95 -0
- package/dist/chunk-PH3RC6T6.js +476 -0
- package/dist/chunk-PMGIER77.js +92 -0
- package/dist/chunk-Q36UO2T2.js +363 -0
- package/dist/chunk-SBGC5DKV.js +114 -0
- package/dist/chunk-SZNV3J4B.js +9 -0
- package/dist/{chunk-4U7QZC72.js → chunk-TSBY6C5U.js} +1 -102
- package/dist/chunk-XY7WXXME.js +85 -0
- package/dist/chunk-YOWY22N7.js +148 -0
- package/dist/chunk-Z5AASN4L.js +34 -0
- package/dist/components/admission-panel/KnockNotice.d.ts +31 -0
- package/dist/components/admission-panel/answer-all.d.ts +2 -0
- package/dist/components/call-limbo/CallLimbo.d.ts +5 -1
- package/dist/components/chalk/Chalk.d.ts +2 -5
- package/dist/components/chalk/StatusSurface.d.ts +3 -3
- package/dist/components/chalk-ui/ChalkSheet.d.ts +6 -2
- package/dist/components/chalk-ui/InviteLinkButton.d.ts +5 -0
- package/dist/components/chalk-ui/InviteQR.d.ts +4 -0
- package/dist/components/chalk-ui/InviteQrCode.d.ts +3 -0
- package/dist/components/chalk-ui/MenuIcon.d.ts +17 -0
- package/dist/components/chalk-ui/invite-qr-path.d.ts +10 -0
- package/dist/components/chalk-ui/sheet-drag.d.ts +17 -0
- package/dist/components/chalk-ui/useCopyText.d.ts +6 -0
- package/dist/components/chalk-ui/useSheetDrag.d.ts +11 -0
- package/dist/components/composite/ReactionSheet.d.ts +5 -0
- package/dist/components/connection-notice/ConnectionBars.d.ts +4 -0
- package/dist/components/connection-notice/ConnectionNotice.d.ts +12 -0
- package/dist/components/connection-notice/shown-notice.d.ts +12 -0
- package/dist/components/connection-status/ConnectionRing.d.ts +2 -0
- package/dist/components/connection-status/ConnectionStatus.d.ts +24 -0
- package/dist/components/connection-status/LiveConnectionStatus.d.ts +9 -0
- package/dist/components/connection-status/use-connection-phase.d.ts +23 -0
- package/dist/components/control-bar/DockLayout.d.ts +2 -1
- package/dist/components/control-bar/ShareControl.d.ts +3 -1
- package/dist/components/control-bar/ShellIcon.d.ts +18 -6
- package/dist/components/control-bar/control-bar-behavior.d.ts +19 -8
- package/dist/components/control-bar/control-bar-devices.d.ts +8 -0
- package/dist/components/control-bar/useDeviceSheets.d.ts +7 -0
- package/dist/components/device-access/DeviceAccessCard.d.ts +17 -0
- package/dist/components/device-access/DeviceAccessStyles.d.ts +1 -0
- package/dist/components/device-access/DeviceAccessWaiting.d.ts +4 -0
- package/dist/components/device-access/LazyDeviceAccessCard.d.ts +7 -0
- package/dist/components/device-access/browser-marks.d.ts +5 -0
- package/dist/components/device-access/card-copy.d.ts +17 -0
- package/dist/components/device-access/load-card.d.ts +2 -0
- package/dist/components/device-access/model.d.ts +29 -0
- package/dist/components/device-access/ports.d.ts +21 -0
- package/dist/components/device-access/resolve.d.ts +31 -0
- package/dist/components/device-access/store.d.ts +32 -0
- package/dist/components/device-access/useDeviceAccess.d.ts +7 -0
- package/dist/components/device-popover/CameraBackgroundPicker.d.ts +23 -0
- package/dist/components/device-popover/DevicePopover.d.ts +7 -1
- package/dist/components/device-popover/DevicePreview.d.ts +12 -0
- package/dist/components/device-popover/DeviceSheet.d.ts +26 -0
- package/dist/components/index.js +30 -15
- package/dist/components/participant-grid/ParticipantGrid.d.ts +9 -0
- package/dist/components/participant-tile/ParticipantTile.d.ts +12 -1
- package/dist/components/participant-tile/TileConnection.d.ts +9 -0
- package/dist/components/participant-tile/TileShell.d.ts +2 -1
- package/dist/components/participant-tile/useFrozenFrame.d.ts +12 -0
- package/dist/components/participant-tile/useVideoTileVisibility.d.ts +6 -0
- package/dist/components/participants-panel/ParticipantsPanel.d.ts +5 -0
- package/dist/components/participants-panel/participant-options-menu.d.ts +4 -1
- package/dist/components/participants-panel/participant-order.d.ts +13 -0
- package/dist/components/participants-panel/participant-row.d.ts +5 -1
- package/dist/components/participants-panel/participant-search.d.ts +4 -0
- package/dist/components/space-header/CallCharts.d.ts +22 -0
- package/dist/components/space-header/CallDetails.d.ts +5 -13
- package/dist/components/space-header/CallDialog.d.ts +5 -0
- package/dist/components/space-header/CallDialogContent.d.ts +13 -0
- package/dist/components/space-header/CallMenuStyles.d.ts +2 -0
- package/dist/components/space-header/RowIcon.d.ts +12 -0
- package/dist/components/space-header/call-diagnostics.d.ts +2 -1
- package/dist/components/space-header/call-network.d.ts +18 -0
- package/dist/components/space-header/space-header-contract.d.ts +8 -1
- package/dist/components/space-view/SpacePresentation.d.ts +3 -1
- package/dist/components/space-view/SpaceView.d.ts +3 -5
- package/dist/components/space-view/useBoardNotices.d.ts +7 -0
- package/dist/components/space-view/useMicrophoneNotice.d.ts +11 -0
- package/dist/components/toast-stack/ToastStack.d.ts +3 -1
- package/dist/components/toast-stack/call-events.d.ts +4 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.js +298 -28
- package/dist/internal/call-width.d.ts +9 -0
- package/dist/internal/media-devices.d.ts +11 -0
- package/dist/internal/speaker-test.d.ts +2 -0
- package/dist/internal/useHandOrder.d.ts +2 -0
- package/dist/internal/useHeldWhile.d.ts +2 -0
- package/dist/internal/useInputLevel.d.ts +4 -0
- package/dist/internal/useLongPress.d.ts +15 -0
- package/dist/internal/useSeenConnected.d.ts +9 -0
- package/dist/internal/useSilentMicrophone.d.ts +4 -0
- package/dist/internal/useTrueFor.d.ts +4 -0
- package/dist/participant-options-menu-S3EL6K3M.js +330 -0
- package/dist/pre-join/remembered-devices.d.ts +12 -0
- package/dist/pre-join/usePreJoinDevices.d.ts +47 -0
- package/dist/public-surface.contract.d.ts +1 -1
- package/dist/test-support/index.d.ts +1 -1
- package/dist/test-support/index.js +41 -10
- package/dist/theme.d.ts +32 -32
- package/dist/toast.d.ts +1 -0
- package/dist/toast.js +7 -0
- package/dist/utils/formatClockTime.d.ts +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +20 -12
- package/package.json +24 -11
- package/dist/components/call-limbo/qr-code.d.ts +0 -4
- package/dist/components/offline-actions/OfflineActions.d.ts +0 -9
- package/dist/components/participants-panel/index.d.ts +0 -2
- package/dist/components/reconnecting-overlay/ReconnectingOverlay.d.ts +0 -12
- package/dist/components/space-header/share-qr.d.ts +0 -2
- package/dist/components/space-view/countdown.d.ts +0 -5
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
// src/utils/cn.ts
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { twMerge } from "tailwind-merge";
|
|
4
|
-
function cn(...inputs) {
|
|
5
|
-
return twMerge(clsx(inputs));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
1
|
// src/utils/icons.tsx
|
|
9
2
|
import {
|
|
10
3
|
Alert02Icon as Alert02IconSvg,
|
|
@@ -139,92 +132,7 @@ var VolumeMute01Icon = createIcon(StaticVolumeMute01Icon);
|
|
|
139
132
|
var WifiOffIcon = createIcon(WifiOffIconSvg);
|
|
140
133
|
var ThumbsUpIcon = createIcon(StaticThumbsUpIcon);
|
|
141
134
|
|
|
142
|
-
// src/utils/colorGenerator.ts
|
|
143
|
-
var PARTICIPANT_GRADIENT_PRESETS = [
|
|
144
|
-
{ id: "aurora", label: "Aurora", from: "#0ea5e9", to: "#22c55e" },
|
|
145
|
-
{ id: "ember", label: "Ember", from: "#f97316", to: "#ef4444" },
|
|
146
|
-
{ id: "orchid", label: "Orchid", from: "#a855f7", to: "#ec4899" },
|
|
147
|
-
{ id: "cobalt", label: "Cobalt", from: "#2563eb", to: "#14b8a6" },
|
|
148
|
-
{ id: "gold", label: "Gold", from: "#eab308", to: "#f97316" },
|
|
149
|
-
{ id: "slate", label: "Slate", from: "#64748b", to: "#94a3b8" }
|
|
150
|
-
];
|
|
151
|
-
var AUTO_PALETTE = [
|
|
152
|
-
["#315f72", "#dcebef"],
|
|
153
|
-
["#5c6650", "#e3eadf"],
|
|
154
|
-
["#6b5b4f", "#ece3dc"],
|
|
155
|
-
["#64576b", "#e8e0ea"],
|
|
156
|
-
["#49645d", "#dfeae6"],
|
|
157
|
-
["#665d42", "#ebe6d6"],
|
|
158
|
-
["#4d5d73", "#e1e6ec"],
|
|
159
|
-
["#6d5158", "#eee0e3"]
|
|
160
|
-
];
|
|
161
|
-
function hashIdentity(identity) {
|
|
162
|
-
let hash = 2166136261;
|
|
163
|
-
for (const char of identity.trim().toLowerCase() || "chalk") {
|
|
164
|
-
hash ^= char.charCodeAt(0);
|
|
165
|
-
hash = Math.imul(hash, 16777619);
|
|
166
|
-
}
|
|
167
|
-
return hash >>> 0;
|
|
168
|
-
}
|
|
169
|
-
function resolveGradient(identity = "chalk", preference) {
|
|
170
|
-
if (preference?.mode === "custom" && preference.from && preference.to) {
|
|
171
|
-
return [preference.from, preference.to];
|
|
172
|
-
}
|
|
173
|
-
return AUTO_PALETTE[hashIdentity(identity) % AUTO_PALETTE.length] ?? ["#64748b", "#94a3b8"];
|
|
174
|
-
}
|
|
175
|
-
function getParticipantInitial(name) {
|
|
176
|
-
return (name?.trim()?.[0] ?? "?").toUpperCase();
|
|
177
|
-
}
|
|
178
|
-
function getParticipantInitials(name) {
|
|
179
|
-
const parts = (name ?? "").trim().split(/\s+/).filter(Boolean);
|
|
180
|
-
const first = parts[0]?.[0] ?? getParticipantInitial(name);
|
|
181
|
-
const second = parts[1]?.[0] ?? "";
|
|
182
|
-
return (parts.length > 1 ? first + second : first).toUpperCase();
|
|
183
|
-
}
|
|
184
|
-
function getParticipantColor(identity = "chalk", preference) {
|
|
185
|
-
const [primary, secondary] = resolveGradient(identity, preference);
|
|
186
|
-
return {
|
|
187
|
-
primary,
|
|
188
|
-
secondary,
|
|
189
|
-
text: "#ffffff",
|
|
190
|
-
gradientEnd: secondary
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
function getParticipantGradient(identity = "chalk", preference) {
|
|
194
|
-
const [primary, secondary] = resolveGradient(identity, preference);
|
|
195
|
-
return `linear-gradient(135deg, ${primary}, ${secondary})`;
|
|
196
|
-
}
|
|
197
|
-
function getParticipantAvatarGradient(identity = "chalk", preference) {
|
|
198
|
-
return getParticipantGradient(identity, preference);
|
|
199
|
-
}
|
|
200
|
-
function getParticipantBorder(identity = "chalk", preference) {
|
|
201
|
-
return getParticipantColor(identity, preference).primary;
|
|
202
|
-
}
|
|
203
|
-
function getParticipantThemeVariables(identity = "chalk", preference) {
|
|
204
|
-
const colors = getParticipantColor(identity, preference);
|
|
205
|
-
return {
|
|
206
|
-
"--primary": colors.primary,
|
|
207
|
-
"--ring": colors.primary,
|
|
208
|
-
"--chalk-accent": colors.primary,
|
|
209
|
-
"--chalk-accent-2": colors.secondary
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
function getParticipantAvatarRecipe(identity = "chalk", preference) {
|
|
213
|
-
const colors = getParticipantColor(identity, preference);
|
|
214
|
-
const avatarGradient = getParticipantGradient(identity, preference);
|
|
215
|
-
return {
|
|
216
|
-
initials: getParticipantInitials(identity),
|
|
217
|
-
gradient: avatarGradient,
|
|
218
|
-
avatarGradient,
|
|
219
|
-
darkerAvatarGradient: `linear-gradient(135deg, ${colors.primary}, #111827)`,
|
|
220
|
-
color: colors.primary,
|
|
221
|
-
border: colors.primary,
|
|
222
|
-
facehashColors: [colors.primary]
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
|
|
226
135
|
export {
|
|
227
|
-
cn,
|
|
228
136
|
Alert02Icon,
|
|
229
137
|
ArrowDown01Icon,
|
|
230
138
|
ArrowLeft01Icon,
|
|
@@ -285,14 +193,5 @@ export {
|
|
|
285
193
|
VolumeHighIcon,
|
|
286
194
|
VolumeMute01Icon,
|
|
287
195
|
WifiOffIcon,
|
|
288
|
-
ThumbsUpIcon
|
|
289
|
-
PARTICIPANT_GRADIENT_PRESETS,
|
|
290
|
-
getParticipantInitial,
|
|
291
|
-
getParticipantInitials,
|
|
292
|
-
getParticipantColor,
|
|
293
|
-
getParticipantGradient,
|
|
294
|
-
getParticipantAvatarGradient,
|
|
295
|
-
getParticipantBorder,
|
|
296
|
-
getParticipantThemeVariables,
|
|
297
|
-
getParticipantAvatarRecipe
|
|
196
|
+
ThumbsUpIcon
|
|
298
197
|
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// src/theme.ts
|
|
2
|
+
var LIGHT_CHALK_THEME_TOKENS = {
|
|
3
|
+
canvas: "#f3f3f5",
|
|
4
|
+
surface: "#ffffff",
|
|
5
|
+
raised: "#ececf0",
|
|
6
|
+
hover: "#e1e1e6",
|
|
7
|
+
pressed: "#d3d3d9",
|
|
8
|
+
tile: "#e2e2e7",
|
|
9
|
+
popover: "#ffffff",
|
|
10
|
+
line: "rgba(0,0,0,.09)",
|
|
11
|
+
lineStrong: "rgba(0,0,0,.15)",
|
|
12
|
+
text: "#18181b",
|
|
13
|
+
textStrong: "#000",
|
|
14
|
+
mutedText: "#5c5d65",
|
|
15
|
+
softText: "#3d3e45",
|
|
16
|
+
danger: "#d93a3f",
|
|
17
|
+
dangerHover: "#e04b50",
|
|
18
|
+
dangerPressed: "#c93d42",
|
|
19
|
+
dangerText: "#bf272c",
|
|
20
|
+
positive: "#2b8a3e",
|
|
21
|
+
warning: "#8a6400",
|
|
22
|
+
accent: "#1b70a0",
|
|
23
|
+
wash: "rgba(0,0,0,.04)",
|
|
24
|
+
washStrong: "rgba(0,0,0,.07)",
|
|
25
|
+
chrome: "#f3f3f5",
|
|
26
|
+
stage: "#f3f3f5",
|
|
27
|
+
accentText: "#f3f3f5",
|
|
28
|
+
dangerSurface: "#ececf0",
|
|
29
|
+
focus: "#18181b",
|
|
30
|
+
shadow: "0 12px 32px rgba(0,0,0,0.12)",
|
|
31
|
+
overlay: "rgba(12,14,18,0.75)",
|
|
32
|
+
overlayStrong: "rgba(12,14,18,0.82)",
|
|
33
|
+
overlayHover: "rgba(40,42,48,0.95)",
|
|
34
|
+
onOverlay: "#ffffff",
|
|
35
|
+
overlayWarning: "#e2bd3a",
|
|
36
|
+
overlayDanger: "#ff6b6b",
|
|
37
|
+
scrim: "rgba(0,0,0,0.55)"
|
|
38
|
+
};
|
|
39
|
+
var DARK_CHALK_THEME_TOKENS = {
|
|
40
|
+
canvas: "#000000",
|
|
41
|
+
surface: "#060606",
|
|
42
|
+
raised: "#0c0c0c",
|
|
43
|
+
hover: "#161616",
|
|
44
|
+
pressed: "#1f1f1f",
|
|
45
|
+
line: "rgba(255,255,255,0.045)",
|
|
46
|
+
lineStrong: "rgba(255,255,255,0.08)",
|
|
47
|
+
text: "#ececee",
|
|
48
|
+
mutedText: "#9a9ca3",
|
|
49
|
+
danger: "#e5484d",
|
|
50
|
+
dangerHover: "#ec5d61",
|
|
51
|
+
dangerPressed: "#c93d42",
|
|
52
|
+
dangerText: "#ff6b6b",
|
|
53
|
+
positive: "#80b879",
|
|
54
|
+
warning: "#d9b641",
|
|
55
|
+
accent: "#55aac9",
|
|
56
|
+
tile: "#060606",
|
|
57
|
+
popover: "#0c0c0c",
|
|
58
|
+
textStrong: "#fff",
|
|
59
|
+
softText: "#c4c6cc",
|
|
60
|
+
wash: "rgba(255,255,255,.05)",
|
|
61
|
+
washStrong: "rgba(255,255,255,.08)",
|
|
62
|
+
chrome: "#000000",
|
|
63
|
+
stage: "#000000",
|
|
64
|
+
accentText: "#000000",
|
|
65
|
+
dangerSurface: "#0c0c0c",
|
|
66
|
+
focus: "#ececee",
|
|
67
|
+
shadow: "0 12px 32px rgba(0,0,0,0.5)",
|
|
68
|
+
overlay: "rgba(0,0,0,0.75)",
|
|
69
|
+
overlayStrong: "rgba(0,0,0,0.82)",
|
|
70
|
+
overlayHover: "rgba(34,34,34,0.95)",
|
|
71
|
+
onOverlay: "#ffffff",
|
|
72
|
+
overlayWarning: "#e2bd3a",
|
|
73
|
+
overlayDanger: "#ff6b6b",
|
|
74
|
+
scrim: "rgba(0,0,0,0.55)"
|
|
75
|
+
};
|
|
76
|
+
function chalkThemeStyle(theme, colorScheme = theme?.colorScheme ?? "dark") {
|
|
77
|
+
const defaults = colorScheme === "dark" ? DARK_CHALK_THEME_TOKENS : LIGHT_CHALK_THEME_TOKENS;
|
|
78
|
+
const tokens = { ...defaults, ...theme?.tokens, ...theme?.accent ? { accent: theme.accent } : {} };
|
|
79
|
+
return Object.fromEntries(Object.entries(tokens).map(([token, value]) => [`--chalk-${token.replace(/[A-Z]/gu, (letter) => `-${letter.toLowerCase()}`)}`, value]));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export {
|
|
83
|
+
LIGHT_CHALK_THEME_TOKENS,
|
|
84
|
+
chalkThemeStyle
|
|
85
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getParticipantAvatarRecipe
|
|
3
|
+
} from "./chunk-JDCFKSGV.js";
|
|
4
|
+
import {
|
|
5
|
+
cn
|
|
6
|
+
} from "./chunk-ADIDI7AJ.js";
|
|
7
|
+
|
|
8
|
+
// src/bindings/context.tsx
|
|
9
|
+
import { createContext } from "react";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var SpaceClientContext = createContext(null);
|
|
12
|
+
function ChalkProvider({ children, client }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(SpaceClientContext.Provider, { value: client, children });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// src/bindings/hooks.ts
|
|
17
|
+
import { useCallback, useContext, useMemo, useSyncExternalStore } from "react";
|
|
18
|
+
function useSnapshotSlice(select) {
|
|
19
|
+
const client = useSpaceClient();
|
|
20
|
+
const subscribe = useCallback((listener) => client.subscribe(listener), [client]);
|
|
21
|
+
const getSnapshot = useCallback(() => select(client.getSnapshot()), [client, select]);
|
|
22
|
+
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
23
|
+
}
|
|
24
|
+
var selectConnection = (snapshot) => snapshot.connection;
|
|
25
|
+
var selectSelf = (snapshot) => snapshot.self;
|
|
26
|
+
var selectParticipants = (snapshot) => snapshot.participants;
|
|
27
|
+
var selectMedia = (snapshot) => snapshot.media;
|
|
28
|
+
var selectChat = (snapshot) => snapshot.chat;
|
|
29
|
+
var selectOffline = (snapshot) => snapshot.offline;
|
|
30
|
+
var selectReactions = (snapshot) => snapshot.reactions;
|
|
31
|
+
var selectRecording = (snapshot) => snapshot.recording;
|
|
32
|
+
var selectWhiteboard = (snapshot) => snapshot.whiteboard;
|
|
33
|
+
function useSpaceClient() {
|
|
34
|
+
const client = useContext(SpaceClientContext);
|
|
35
|
+
if (client === null) {
|
|
36
|
+
throw new Error("Chalk hooks must be used within a ChalkProvider.");
|
|
37
|
+
}
|
|
38
|
+
return client;
|
|
39
|
+
}
|
|
40
|
+
function useConnection() {
|
|
41
|
+
return useSnapshotSlice(selectConnection);
|
|
42
|
+
}
|
|
43
|
+
function useSelf() {
|
|
44
|
+
return useSnapshotSlice(selectSelf);
|
|
45
|
+
}
|
|
46
|
+
function useParticipants() {
|
|
47
|
+
return useSnapshotSlice(selectParticipants);
|
|
48
|
+
}
|
|
49
|
+
function useMedia() {
|
|
50
|
+
return useSnapshotSlice(selectMedia);
|
|
51
|
+
}
|
|
52
|
+
function useChat() {
|
|
53
|
+
const chat = useSnapshotSlice(selectChat);
|
|
54
|
+
const self = useSelf();
|
|
55
|
+
const client = useSpaceClient();
|
|
56
|
+
return useMemo(
|
|
57
|
+
() => ({ ...chat, react: client.chat.react, messages: chat.messages.map((message) => ({ ...message, reactions: (message.reactions ?? []).map((reaction) => ({ ...reaction, isMine: self.participantId !== null && reaction.participantIds.includes(self.participantId) })) })) }),
|
|
58
|
+
[chat, client, self.participantId]
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
function useOffline() {
|
|
62
|
+
return useSnapshotSlice(selectOffline);
|
|
63
|
+
}
|
|
64
|
+
function useReactions() {
|
|
65
|
+
return useSnapshotSlice(selectReactions);
|
|
66
|
+
}
|
|
67
|
+
function useRecording() {
|
|
68
|
+
return useSnapshotSlice(selectRecording);
|
|
69
|
+
}
|
|
70
|
+
function useWhiteboard() {
|
|
71
|
+
return useSnapshotSlice(selectWhiteboard);
|
|
72
|
+
}
|
|
73
|
+
function useCan(capability) {
|
|
74
|
+
return useSelf().can(capability);
|
|
75
|
+
}
|
|
76
|
+
function useCanDrawWhiteboard() {
|
|
77
|
+
const whiteboard = useWhiteboard();
|
|
78
|
+
const roleDefault = useCan("drawWhiteboard");
|
|
79
|
+
if (whiteboard.engine.status === "unsubscribed") return roleDefault;
|
|
80
|
+
if (whiteboard.access.policy === null) return roleDefault && whiteboard.access.canDraw;
|
|
81
|
+
return whiteboard.access.canDraw;
|
|
82
|
+
}
|
|
83
|
+
function useScreenShare() {
|
|
84
|
+
const client = useSpaceClient();
|
|
85
|
+
const { screenShare } = useMedia();
|
|
86
|
+
return { ...screenShare, setEnabled: client.media.setScreenShareEnabled };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// src/components/atomic/Avatar.tsx
|
|
90
|
+
import React, { useMemo as useMemo2, useState } from "react";
|
|
91
|
+
import { Facehash } from "@q9labsai/facehash/react";
|
|
92
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
93
|
+
var GeneratedFacehash = Facehash;
|
|
94
|
+
var sizeMap = {
|
|
95
|
+
xs: { size: 24, fontSize: "var(--type-caption)" },
|
|
96
|
+
sm: { size: 32, fontSize: "var(--type-body)" },
|
|
97
|
+
md: { size: 48, fontSize: "var(--type-lead)" },
|
|
98
|
+
lg: { size: 64, fontSize: "var(--type-title)" },
|
|
99
|
+
xl: { size: 96, fontSize: "var(--type-display-sm)" },
|
|
100
|
+
"2xl": { size: 120, fontSize: "var(--type-display)" }
|
|
101
|
+
};
|
|
102
|
+
var statusColorMap = {
|
|
103
|
+
online: "var(--chalk-positive)",
|
|
104
|
+
away: "var(--chalk-accent)",
|
|
105
|
+
busy: "var(--chalk-danger)",
|
|
106
|
+
offline: "var(--chalk-muted-text)"
|
|
107
|
+
};
|
|
108
|
+
var Avatar = React.memo(({ name, src, size = "md", status, className, style, gradientPreference, generated = true, animated = true }) => {
|
|
109
|
+
const [image, setImage] = useState({ src, name, generated, failed: false });
|
|
110
|
+
if (image.src !== src || image.name !== name || image.generated !== generated) setImage({ src, name, generated, failed: false });
|
|
111
|
+
const hasUploadedImage = Boolean(src) && !image.failed;
|
|
112
|
+
const shouldShowGeneratedAvatar = generated && Boolean(name) && !hasUploadedImage;
|
|
113
|
+
const avatarRecipe = useMemo2(() => getParticipantAvatarRecipe(name || "unknown", gradientPreference), [gradientPreference, name]);
|
|
114
|
+
const { size: pxSize, fontSize } = sizeMap[size];
|
|
115
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative inline-flex shrink-0 rounded-full", className), style: { width: pxSize, height: pxSize, ...style }, role: "img", "aria-label": `Avatar for ${name || "Unknown"}`, children: [
|
|
116
|
+
hasUploadedImage ? /* @__PURE__ */ jsx2("img", { src: src || "", alt: name, className: "h-full w-full rounded-full object-cover", onError: () => setImage({ src, name, generated, failed: true }) }) : shouldShowGeneratedAvatar ? /* @__PURE__ */ jsx2("div", { "aria-hidden": "true", className: "h-full w-full overflow-hidden rounded-full", children: /* @__PURE__ */ jsx2(GeneratedFacehash, { name: name || "guest", size: "100%", variant: "flat", interactive: false, intensity3d: "subtle", enableBlink: animated, colors: [...avatarRecipe.facehashColors] }) }) : /* @__PURE__ */ jsx2("div", { className: "flex h-full w-full items-center justify-center rounded-full font-medium !text-[var(--chalk-accent-text)]", style: { fontSize, backgroundColor: avatarRecipe.color }, children: avatarRecipe.initials }),
|
|
117
|
+
status && /* @__PURE__ */ jsx2(
|
|
118
|
+
"span",
|
|
119
|
+
{
|
|
120
|
+
className: "absolute bottom-0 right-0 block rounded-full ring-2 ring-[var(--chalk-surface)]",
|
|
121
|
+
style: {
|
|
122
|
+
width: Math.max(8, pxSize / 4),
|
|
123
|
+
height: Math.max(8, pxSize / 4),
|
|
124
|
+
backgroundColor: statusColorMap[status]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
] });
|
|
129
|
+
});
|
|
130
|
+
Avatar.displayName = "Avatar";
|
|
131
|
+
|
|
132
|
+
export {
|
|
133
|
+
ChalkProvider,
|
|
134
|
+
useSpaceClient,
|
|
135
|
+
useConnection,
|
|
136
|
+
useSelf,
|
|
137
|
+
useParticipants,
|
|
138
|
+
useMedia,
|
|
139
|
+
useChat,
|
|
140
|
+
useOffline,
|
|
141
|
+
useReactions,
|
|
142
|
+
useRecording,
|
|
143
|
+
useWhiteboard,
|
|
144
|
+
useCan,
|
|
145
|
+
useCanDrawWhiteboard,
|
|
146
|
+
useScreenShare,
|
|
147
|
+
Avatar
|
|
148
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// src/components/space-header/call-network.ts
|
|
2
|
+
var FAIR_RTT_MS = 200;
|
|
3
|
+
var UNSTABLE_RTT_MS = 400;
|
|
4
|
+
var FAIR_LOSS_PCT = 1;
|
|
5
|
+
var UNSTABLE_LOSS_PCT = 5;
|
|
6
|
+
var lossOf = (sample) => {
|
|
7
|
+
const measured = [sample.send_loss_pct, sample.recv_loss_pct].filter((value) => typeof value === "number");
|
|
8
|
+
return measured.length ? Math.max(...measured) : null;
|
|
9
|
+
};
|
|
10
|
+
var rounded = (value, digits) => value === null ? "\u2013" : String(Number(value.toFixed(digits)));
|
|
11
|
+
function connectionQuality({ live, samples = [], link }) {
|
|
12
|
+
if (!live) return { level: 1, tone: "bad", word: "Reconnecting\u2026", helper: "Lost the connection. Trying again; you don't need to rejoin." };
|
|
13
|
+
const latest = samples.at(-1);
|
|
14
|
+
const loss = latest ? lossOf(latest) : null;
|
|
15
|
+
const rtt = latest?.rtt_ms ?? null;
|
|
16
|
+
if (link?.tier === "poor") return { level: 1, tone: "bad", word: "Very poor", helper: "Video may freeze and audio may cut out. Turning off your video can help." };
|
|
17
|
+
if (link?.tier === "weak") return { level: 2, tone: "warn", word: "Unstable", helper: weakHelper(link, loss) };
|
|
18
|
+
if (link?.tier === "good" && ((loss ?? 0) >= UNSTABLE_LOSS_PCT || (rtt ?? 0) >= UNSTABLE_RTT_MS)) return { level: 3, tone: "warn", word: "Fair" };
|
|
19
|
+
if ((loss ?? 0) >= UNSTABLE_LOSS_PCT) return { level: 2, tone: "warn", word: "Unstable", helper: `${rounded(loss, 0)}% of packets are getting lost. Audio may break up.` };
|
|
20
|
+
if ((rtt ?? 0) >= UNSTABLE_RTT_MS) return { level: 2, tone: "warn", word: "Unstable", helper: "The connection is slow to respond. Audio may lag." };
|
|
21
|
+
if ((loss ?? 0) >= FAIR_LOSS_PCT || (rtt ?? 0) >= FAIR_RTT_MS) return { level: 3, tone: "warn", word: "Fair" };
|
|
22
|
+
return latest ? { level: 4, tone: "good", word: "Excellent" } : { level: 4, tone: "good", word: "Connected" };
|
|
23
|
+
}
|
|
24
|
+
function weakHelper(link, loss) {
|
|
25
|
+
if (link.reason === "sync") return "Chat and reactions are slow to arrive.";
|
|
26
|
+
if (link.reason === "latency") return "The connection is slow to respond. Audio may lag.";
|
|
27
|
+
return loss === null ? "Packets are getting lost. Audio may break up." : `${rounded(loss, 0)}% of packets are getting lost. Audio may break up.`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
lossOf,
|
|
32
|
+
rounded,
|
|
33
|
+
connectionQuality
|
|
34
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface KnockRequest {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly displayName: string;
|
|
4
|
+
}
|
|
5
|
+
/** One request reads as a person, two or more as one group, so a flood of knocks never makes more than one notice. */
|
|
6
|
+
export type KnockSummary = {
|
|
7
|
+
readonly kind: "one";
|
|
8
|
+
readonly request: KnockRequest;
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: "several";
|
|
11
|
+
readonly count: number;
|
|
12
|
+
readonly faces: readonly KnockRequest[];
|
|
13
|
+
readonly names: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function summarizeKnocks(requests: readonly KnockRequest[]): KnockSummary | null;
|
|
16
|
+
export interface KnockNoticeSurfaceProps {
|
|
17
|
+
readonly requests: readonly KnockRequest[];
|
|
18
|
+
readonly onAdmit: (id: string) => Promise<unknown>;
|
|
19
|
+
readonly onDeny: (id: string) => Promise<unknown>;
|
|
20
|
+
readonly onReview: () => void;
|
|
21
|
+
readonly onHide: () => void;
|
|
22
|
+
}
|
|
23
|
+
/** A quiet notice for the host: it never takes focus and stays until the request is answered. */
|
|
24
|
+
export declare function KnockNoticeSurface({ requests, onAdmit, onDeny, onReview, onHide }: KnockNoticeSurfaceProps): import("react").JSX.Element | null;
|
|
25
|
+
export interface KnockNoticeProps {
|
|
26
|
+
/** Request ids whose notice the host hid. The notice lists only the requests not hidden, so a later knock shows alone and the bulk action never reaches a hidden request. */
|
|
27
|
+
readonly hiddenIds: ReadonlySet<string>;
|
|
28
|
+
readonly onReview: () => void;
|
|
29
|
+
readonly onHide: (ids: readonly string[]) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare function KnockNotice({ hiddenIds, onReview, onHide }: KnockNoticeProps): import("react").JSX.Element | null;
|
|
@@ -5,6 +5,10 @@ export interface CallLimboProps {
|
|
|
5
5
|
readonly message: string;
|
|
6
6
|
readonly detail?: string;
|
|
7
7
|
readonly recorded?: boolean;
|
|
8
|
+
/** Who the guest will appear as, shown under the detail line while they wait. */
|
|
9
|
+
readonly joiningAs?: string;
|
|
10
|
+
/** A neutral symbol for a request that ended, so declined and expired look different from waiting before they are read. */
|
|
11
|
+
readonly glyph?: "declined" | "expired";
|
|
8
12
|
readonly action?: {
|
|
9
13
|
readonly label: string;
|
|
10
14
|
readonly onClick: () => void;
|
|
@@ -22,4 +26,4 @@ export interface CallLimboProps {
|
|
|
22
26
|
readonly className?: string;
|
|
23
27
|
}
|
|
24
28
|
/** One surface for joining, admission and connection recovery. Never renders participant data. */
|
|
25
|
-
export declare function CallLimbo({ spaceName, message, detail, action, children, overlay, active, initiallyCovered, theme, recorded, blocking, className }: CallLimboProps): React.JSX.Element;
|
|
29
|
+
export declare function CallLimbo({ spaceName, message, detail, action, children, joiningAs, glyph, overlay, active, initiallyCovered, theme, recorded, blocking, className }: CallLimboProps): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ChatUploadFile, type ClientEventMap, type GetAccess, type SpaceClient } from "@q9labsai/chalk-client";
|
|
1
|
+
import { type ChatUploadFile, type ClientEventMap, type GetAccess, type JoinOptions, type SpaceClient } from "@q9labsai/chalk-client";
|
|
2
2
|
import type React from "react";
|
|
3
3
|
import { type ChalkColorScheme, type ChalkTheme } from "../../theme";
|
|
4
4
|
import { type SpaceViewProps } from "../space-view/SpaceView";
|
|
@@ -36,10 +36,7 @@ type SpaceEventCallbacks = {
|
|
|
36
36
|
readonly onError?: (event: ClientEventMap["error"]) => void;
|
|
37
37
|
};
|
|
38
38
|
export type ChalkProps = SpaceIntegration & SpaceEventCallbacks & {
|
|
39
|
-
readonly defaults?:
|
|
40
|
-
readonly microphone?: boolean;
|
|
41
|
-
readonly camera?: boolean;
|
|
42
|
-
};
|
|
39
|
+
readonly defaults?: Pick<JoinOptions, "microphone" | "camera" | "microphoneDeviceId" | "cameraDeviceId" | "speakerDeviceId">;
|
|
43
40
|
readonly displayName?: string;
|
|
44
41
|
readonly features?: ChalkFeatures;
|
|
45
42
|
readonly theme?: ChalkTheme;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
|
-
import { type ClientFailure, type ErrorCode } from "@q9labsai/chalk-client";
|
|
2
|
+
import { type CallEndReason, type ClientFailure, type ErrorCode } from "@q9labsai/chalk-client";
|
|
3
3
|
import { type ChalkTheme } from "../../theme";
|
|
4
|
-
export type StatusSurfacePhase = "entering" | "left" | "episode-ended" | "failed" | "removed" | "full" | "elsewhere";
|
|
4
|
+
export type StatusSurfacePhase = "entering" | "left" | "timed-out" | "episode-ended" | "failed" | "removed" | "full" | "elsewhere";
|
|
5
5
|
export interface StatusSurfaceProps {
|
|
6
6
|
readonly phase: StatusSurfacePhase;
|
|
7
7
|
readonly callName?: string;
|
|
8
8
|
readonly reason?: string;
|
|
9
|
-
readonly episodeEndReason?:
|
|
9
|
+
readonly episodeEndReason?: CallEndReason;
|
|
10
10
|
readonly endAction?: {
|
|
11
11
|
readonly label: string;
|
|
12
12
|
readonly onClick: () => void;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
export interface ChalkSheetProps {
|
|
3
|
-
|
|
3
|
+
/** `reactions` has no scrim, so what floats over the call stays bright. */
|
|
4
|
+
readonly variant?: "default" | "details" | "panel" | "reactions" | "ready" | "stage";
|
|
4
5
|
readonly open: boolean;
|
|
5
6
|
readonly onOpenChange: (open: boolean) => void;
|
|
6
7
|
readonly title: string;
|
|
7
8
|
readonly accessibleLabel?: string;
|
|
8
9
|
readonly children: ReactNode;
|
|
9
10
|
}
|
|
10
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Base UI owns the focus trap, Escape, outside press and return to the opener.
|
|
13
|
+
* A drag that starts on the grabber or the heading closes the sheet, past 30% of its height or on a flick.
|
|
14
|
+
*/
|
|
11
15
|
export declare function ChalkSheet({ open, onOpenChange, title, accessibleLabel, children, variant }: ChalkSheetProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** The one way to grab the invite link. `menu` is a row in the call menu; `card` is the filled button on the invite card. */
|
|
2
|
+
export declare function InviteLinkButton({ link, variant }: {
|
|
3
|
+
readonly link: string;
|
|
4
|
+
readonly variant: "menu" | "card";
|
|
5
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
declare const GLYPHS: {
|
|
3
|
+
link: import("react").JSX.Element;
|
|
4
|
+
copy: import("react").JSX.Element;
|
|
5
|
+
check: import("react").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
/** One call-menu glyph on the same 24 grid and 1.75 stroke as ShellIcon. */
|
|
8
|
+
export declare function GlyphSvg({ size, children }: {
|
|
9
|
+
readonly size?: number;
|
|
10
|
+
readonly children: ReactNode;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
/** The glyphs the invite link button shows, in the menu and on the invite card. */
|
|
13
|
+
export declare function MenuIcon({ name, size }: {
|
|
14
|
+
readonly name: keyof typeof GLYPHS;
|
|
15
|
+
readonly size?: number;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type QrMatrix = readonly (readonly boolean[])[];
|
|
2
|
+
/**
|
|
3
|
+
* Rounded QR artwork as SVG path data. Every module keeps its full square, so the grid stays as solid and
|
|
4
|
+
* high-contrast as a square code; a corner rounds only where both of its side neighbours are empty, which
|
|
5
|
+
* joins touching modules into one shape. The three finder patterns are drawn as rounded rings with a rounded dot.
|
|
6
|
+
*/
|
|
7
|
+
export declare function roundedQrPaths(matrix: QrMatrix): {
|
|
8
|
+
readonly modules: string;
|
|
9
|
+
readonly finders: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** A bottom sheet closes when dragged past this share of its height. */
|
|
2
|
+
export declare const SHEET_CLOSE_FRACTION = 0.3;
|
|
3
|
+
/** Or when it leaves the finger faster than this, in pixels per millisecond. */
|
|
4
|
+
export declare const SHEET_FLICK_SPEED = 0.5;
|
|
5
|
+
/** Upward drags move the sheet by this share of the finger travel, like a rubber band. */
|
|
6
|
+
export declare const SHEET_RUBBER_BAND = 0.3;
|
|
7
|
+
/** Spring back and slide away both take this long. */
|
|
8
|
+
export declare const SHEET_SETTLE_MS = 240;
|
|
9
|
+
export interface DragSample {
|
|
10
|
+
readonly time: number;
|
|
11
|
+
readonly y: number;
|
|
12
|
+
}
|
|
13
|
+
/** Where the sheet sits for a finger that has moved `travel` pixels down (negative is up). */
|
|
14
|
+
export declare function sheetOffset(travel: number): number;
|
|
15
|
+
/** Downward speed in pixels per millisecond over the last 100 ms of samples. */
|
|
16
|
+
export declare function releaseSpeed(samples: readonly DragSample[]): number;
|
|
17
|
+
export declare function shouldDismiss(offset: number, sheetHeight: number, speed: number): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type PointerEvent, type RefObject } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Pointer handlers for the part of a bottom sheet that starts a drag (the grabber and the heading).
|
|
4
|
+
* The sheet follows the finger and the scrim fades with it; on release it closes or springs back.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useSheetDrag(sheet: RefObject<HTMLElement | null>, scrim: RefObject<HTMLElement | null>, dismiss: () => void): {
|
|
7
|
+
onPointerDown: (event: PointerEvent<HTMLElement>) => void;
|
|
8
|
+
onPointerMove: (event: PointerEvent<HTMLElement>) => void;
|
|
9
|
+
onPointerUp: (event: PointerEvent<HTMLElement>) => void;
|
|
10
|
+
onPointerCancel: (event: PointerEvent<HTMLElement>) => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ReactionTrayProps } from "./ReactionTray";
|
|
2
|
+
/** The reactions tray on a phone: a bottom sheet with no scrim, so the emoji floating up over the tiles stay bright. */
|
|
3
|
+
export default function ReactionSheet({ open, isHandRaised, onToggleHandRaise, reactions, onSelect, onClose }: Pick<ReactionTrayProps, "isHandRaised" | "onToggleHandRaise" | "reactions" | "onSelect" | "onClose"> & {
|
|
4
|
+
readonly open: boolean;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ConnectionNoticeReason = "loss" | "latency" | "bandwidth" | "sync";
|
|
2
|
+
export interface ConnectionNoticeProps {
|
|
3
|
+
readonly tier: "weak" | "poor";
|
|
4
|
+
/** Names the cause of a weak link. A very poor link never names one, because the advice is the same. */
|
|
5
|
+
readonly reason?: ConnectionNoticeReason;
|
|
6
|
+
readonly videoOn: boolean;
|
|
7
|
+
readonly onOpenDetails: () => void;
|
|
8
|
+
readonly onTurnOffVideo: () => void;
|
|
9
|
+
readonly onDismiss: () => void;
|
|
10
|
+
}
|
|
11
|
+
/** One pill in the header: how bad the link is, what it means for the person, and one action. */
|
|
12
|
+
export declare function ConnectionNotice({ tier, reason, videoOn, onOpenDetails, onTurnOffVideo, onDismiss }: ConnectionNoticeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LinkQuality } from "@q9labsai/chalk-client";
|
|
2
|
+
import type { ConnectionNoticeReason } from "./ConnectionNotice";
|
|
3
|
+
export type NoticeTier = "weak" | "poor";
|
|
4
|
+
export type ShownNotice = {
|
|
5
|
+
readonly tier: NoticeTier;
|
|
6
|
+
readonly reason?: ConnectionNoticeReason;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The chip to show for the link, or none. A dismissed chip stays hidden until the tier gets worse.
|
|
10
|
+
* The caller clears `dismissed` once the link is good again, so the chip returns the next time it goes bad.
|
|
11
|
+
*/
|
|
12
|
+
export declare function shownNotice(link: LinkQuality | undefined, dismissed: NoticeTier | null): ShownNotice | null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ConnectionStatusProps {
|
|
2
|
+
readonly phase: "reconnecting" | "offline" | "reconnected" | "failed";
|
|
3
|
+
/** When the drop began, by this page's clock. The count on the card starts here, not when the card appears. */
|
|
4
|
+
readonly since: number | null;
|
|
5
|
+
/** How long the person was away; the "Back in the call" confirmation says it. */
|
|
6
|
+
readonly awayMs?: number;
|
|
7
|
+
/** Queued chat, named for people ("3 messages"), which will send once the call is back. */
|
|
8
|
+
readonly pending?: string | null;
|
|
9
|
+
/** The code that identifies a failure for support. */
|
|
10
|
+
readonly errorCode?: string;
|
|
11
|
+
readonly onRejoin?: () => void;
|
|
12
|
+
readonly onLeave?: () => void;
|
|
13
|
+
readonly onReportProblem?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const formatElapsed: (seconds: number) => string;
|
|
16
|
+
export declare function reconnectingCopy(phase: "reconnecting" | "offline", seconds: number, pending: string | null | undefined): {
|
|
17
|
+
readonly title: string;
|
|
18
|
+
readonly detail: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Everything the call says about a lost link. The stage keeps its last picture, dimmed, and the dock stays
|
|
22
|
+
* usable, so this is one calm card, one confirmation, or (after a failure) one card with a way back.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ConnectionStatus({ phase, since, awayMs, pending, errorCode, onRejoin, onLeave, onReportProblem }: ConnectionStatusProps): import("react").JSX.Element;
|