@q9labsai/chalk-react 5.4.1 → 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,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
chalkThemeStyle
|
|
3
|
+
} from "./chunk-XY7WXXME.js";
|
|
1
4
|
import {
|
|
2
5
|
createRecordingWhiteboardCursor,
|
|
3
6
|
recordingWhiteboardFileAssetId,
|
|
@@ -7,15 +10,9 @@ import {
|
|
|
7
10
|
import {
|
|
8
11
|
CallCard,
|
|
9
12
|
CallDialog,
|
|
10
|
-
|
|
11
|
-
ChalkBadge,
|
|
12
|
-
ChalkButton,
|
|
13
|
-
ChalkEmptyState,
|
|
14
|
-
ChalkPanel,
|
|
15
|
-
ChalkProvider,
|
|
13
|
+
CallEventIcon,
|
|
16
14
|
ChatPanelPresentation,
|
|
17
15
|
ControlBarPresentation,
|
|
18
|
-
MediaRequestDialog,
|
|
19
16
|
ParticipantTileSurface,
|
|
20
17
|
QuietSpace,
|
|
21
18
|
ReactionsOverlayPresentation,
|
|
@@ -25,10 +22,12 @@ import {
|
|
|
25
22
|
SpaceView,
|
|
26
23
|
Stage,
|
|
27
24
|
StageContentTileSurface,
|
|
28
|
-
StatusSurface,
|
|
29
25
|
WhiteboardView,
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
commandFailure
|
|
27
|
+
} from "./chunk-F6QZY5SM.js";
|
|
28
|
+
import {
|
|
29
|
+
Avatar,
|
|
30
|
+
ChalkProvider,
|
|
32
31
|
useCan,
|
|
33
32
|
useCanDrawWhiteboard,
|
|
34
33
|
useConnection,
|
|
@@ -36,35 +35,218 @@ import {
|
|
|
36
35
|
useRecording,
|
|
37
36
|
useSpaceClient,
|
|
38
37
|
useWhiteboard
|
|
39
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-YOWY22N7.js";
|
|
40
39
|
import {
|
|
41
40
|
WHITEBOARD_ITEM_ID,
|
|
42
41
|
screenShareItemId
|
|
43
42
|
} from "./chunk-ES7AECAD.js";
|
|
44
43
|
import {
|
|
44
|
+
CancelCircleIcon,
|
|
45
|
+
Clock01Icon,
|
|
45
46
|
Download01Icon,
|
|
46
47
|
FileTextIcon,
|
|
47
48
|
Loading01Icon,
|
|
48
49
|
PlayIcon,
|
|
49
50
|
RefreshIcon,
|
|
50
|
-
Video01Icon
|
|
51
|
+
Video01Icon
|
|
52
|
+
} from "./chunk-TSBY6C5U.js";
|
|
53
|
+
import {
|
|
54
|
+
ChalkBadge,
|
|
55
|
+
ChalkButton,
|
|
56
|
+
ChalkEmptyState,
|
|
57
|
+
ChalkPanel,
|
|
58
|
+
usePrefersReducedMotion
|
|
59
|
+
} from "./chunk-PH3RC6T6.js";
|
|
60
|
+
import {
|
|
51
61
|
cn
|
|
52
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-ADIDI7AJ.js";
|
|
63
|
+
|
|
64
|
+
// src/components/call-limbo/CallLimbo.tsx
|
|
65
|
+
import { useEffect, useRef, useState } from "react";
|
|
66
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
67
|
+
function CallLimbo({ spaceName = "Call", message, detail, action, children, joiningAs, glyph, overlay = false, active = true, initiallyCovered = false, theme, recorded = false, blocking = true, className }) {
|
|
68
|
+
const layerRef = useRef(null);
|
|
69
|
+
const reducedMotion = usePrefersReducedMotion();
|
|
70
|
+
const [covered, setCovered] = useState(active || initiallyCovered);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
let nextFrame = 0;
|
|
73
|
+
const frame = requestAnimationFrame(() => {
|
|
74
|
+
nextFrame = requestAnimationFrame(() => setCovered(active));
|
|
75
|
+
});
|
|
76
|
+
return () => {
|
|
77
|
+
cancelAnimationFrame(frame);
|
|
78
|
+
cancelAnimationFrame(nextFrame);
|
|
79
|
+
};
|
|
80
|
+
}, [active]);
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (!overlay || !active || !layerRef.current) return;
|
|
83
|
+
const root = layerRef.current.closest("[data-chalk]");
|
|
84
|
+
if (!root) return;
|
|
85
|
+
const previousFocus = document.activeElement;
|
|
86
|
+
const siblings = [];
|
|
87
|
+
let branch = layerRef.current;
|
|
88
|
+
while (branch !== root && branch.parentElement) {
|
|
89
|
+
for (const sibling of branch.parentElement.children) {
|
|
90
|
+
if (sibling !== branch && sibling instanceof HTMLElement) {
|
|
91
|
+
siblings.push({ element: sibling, inert: sibling.inert, filter: sibling.style.filter });
|
|
92
|
+
if (blocking) sibling.inert = true;
|
|
93
|
+
if (!blocking) sibling.style.filter = root.getAttribute("data-chalk-theme") === "light" ? "blur(10px) grayscale(.75)" : "blur(10px) grayscale(.75) brightness(.6)";
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
branch = branch.parentElement;
|
|
97
|
+
}
|
|
98
|
+
if (blocking) layerRef.current.focus({ preventScroll: true });
|
|
99
|
+
return () => {
|
|
100
|
+
for (const { element, inert, filter } of siblings) {
|
|
101
|
+
if (blocking) element.inert = inert;
|
|
102
|
+
element.style.filter = filter;
|
|
103
|
+
}
|
|
104
|
+
if (blocking && previousFocus instanceof HTMLElement && previousFocus.isConnected) previousFocus.focus({ preventScroll: true });
|
|
105
|
+
};
|
|
106
|
+
}, [active, blocking, overlay]);
|
|
107
|
+
const stacked = blocking && (glyph ?? (children ? "name" : message.endsWith("\u2026") ? "entering" : detail && action ? "waiting" : null));
|
|
108
|
+
const layer = /* @__PURE__ */ jsx(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
ref: layerRef,
|
|
112
|
+
tabIndex: -1,
|
|
113
|
+
"data-call-limbo": true,
|
|
114
|
+
"data-covered": covered,
|
|
115
|
+
"aria-hidden": !active,
|
|
116
|
+
className: cn("absolute inset-0 z-50 flex items-center justify-center px-6 text-[var(--chalk-app-text)]", blocking && "bg-[var(--chalk-app-canvas)]"),
|
|
117
|
+
style: {
|
|
118
|
+
pointerEvents: active && blocking ? "auto" : "none",
|
|
119
|
+
opacity: covered ? 1 : 0,
|
|
120
|
+
transition: reducedMotion ? "none" : "opacity 220ms cubic-bezier(.2,.8,.2,1)"
|
|
121
|
+
},
|
|
122
|
+
children: /* @__PURE__ */ jsxs(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
"data-part": active ? "limbo-message" : void 0,
|
|
126
|
+
style: { borderRadius: "var(--corner-2xl)" },
|
|
127
|
+
className: cn("flex max-w-full flex-col items-center gap-2 rounded-2xl border border-[var(--chalk-line)] bg-[var(--chalk-surface)] px-7 py-(--space-6) text-center", stacked && "w-[340px] py-8", className),
|
|
128
|
+
children: [
|
|
129
|
+
stacked ? /* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: "mb-1 flex h-8 items-center text-[var(--chalk-soft-text)] [&>svg]:h-8 [&>svg]:w-8", children: [
|
|
130
|
+
stacked === "name" ? /* @__PURE__ */ jsx(CallEventIcon, { kind: "host" }) : null,
|
|
131
|
+
stacked === "waiting" ? /* @__PURE__ */ jsx(CallEventIcon, { kind: "hand" }) : null,
|
|
132
|
+
stacked === "declined" ? /* @__PURE__ */ jsx(CancelCircleIcon, {}) : null,
|
|
133
|
+
stacked === "expired" ? /* @__PURE__ */ jsx(Clock01Icon, {}) : null,
|
|
134
|
+
stacked === "entering" ? /* @__PURE__ */ jsx("span", { className: "h-7 w-7 animate-spin rounded-full border-2 border-[var(--chalk-line-strong)] border-t-[var(--chalk-text)] motion-reduce:animate-none" }) : null
|
|
135
|
+
] }) : null,
|
|
136
|
+
message ? /* @__PURE__ */ jsxs("p", { role: active ? "status" : void 0, className: cn("flex items-center gap-2.5 font-semibold", stacked ? "text-(length:--type-lead)" : "text-(length:--type-lead)"), children: [
|
|
137
|
+
message.endsWith("\u2026") && !stacked ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "h-[18px] w-[18px] animate-spin rounded-full border-2 border-[var(--chalk-line-strong)] border-t-[var(--chalk-text)] motion-reduce:animate-none" }) : null,
|
|
138
|
+
message
|
|
139
|
+
] }) : null,
|
|
140
|
+
detail ? /* @__PURE__ */ jsx("p", { className: "text-sm leading-[1.4] text-[var(--chalk-soft-text)]", children: detail }) : null,
|
|
141
|
+
joiningAs ? /* @__PURE__ */ jsxs("span", { className: "mt-3 flex items-center gap-2 text-sm text-[var(--chalk-muted-text)]", children: [
|
|
142
|
+
/* @__PURE__ */ jsx(Avatar, { name: joiningAs, size: "xs", generated: true, animated: false }),
|
|
143
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
144
|
+
"Joining as",
|
|
145
|
+
" ",
|
|
146
|
+
/* @__PURE__ */ jsx("b", { dir: "auto", className: "font-semibold text-[var(--chalk-text)]", children: joiningAs })
|
|
147
|
+
] })
|
|
148
|
+
] }) : null,
|
|
149
|
+
recorded ? /* @__PURE__ */ jsxs("p", { className: "mt-1 flex items-center gap-1.5 text-xs leading-[1.4] text-[var(--chalk-muted-text)]", children: [
|
|
150
|
+
/* @__PURE__ */ jsx("span", { className: "[&>svg]:h-3.5 [&>svg]:w-3.5", children: /* @__PURE__ */ jsx(CallEventIcon, { kind: "recording", error: true }) }),
|
|
151
|
+
"This call is recorded. By joining, you agree to be recorded."
|
|
152
|
+
] }) : null,
|
|
153
|
+
stacked === "waiting" ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "mt-3 flex gap-1.5", children: [0, 1, 2].map((dot) => /* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-[var(--chalk-muted-text)] motion-reduce:animate-none", style: { animationDelay: `${dot * 200}ms` } }, dot)) }) : null,
|
|
154
|
+
children,
|
|
155
|
+
action ? /* @__PURE__ */ jsx(ChalkButton, { className: cn("mt-6 !h-11", stacked && "w-full"), variant: "outline", onClick: action.onClick, disabled: action.disabled, children: action.label }) : null
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
if (overlay) return layer;
|
|
162
|
+
return /* @__PURE__ */ jsxs("div", { "data-chalk": true, "data-chalk-theme": theme?.colorScheme ?? "dark", className: "chalk-root relative h-full min-h-0 w-full overflow-hidden bg-[var(--chalk-app-canvas)]", style: { ...chalkThemeStyle(theme), fontSize: "var(--type-body)", lineHeight: 1.4 }, children: [
|
|
163
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: "absolute left-5 top-5 text-sm font-medium text-[var(--chalk-muted-text)]", children: spaceName }),
|
|
164
|
+
layer
|
|
165
|
+
] });
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// src/components/chalk/StatusSurface.tsx
|
|
169
|
+
import { callEndNotice, formatSyncConnectDiagnostic, getConnectionFailureDetail } from "@q9labsai/chalk-client";
|
|
170
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
171
|
+
function StatusSurface({ phase, callName = "the call", reason, episodeEndReason, endAction, errorCode, sync, theme, onRejoin, onHome, onRetry, onReportProblem, rejoinDisabled = false, retryPending = false }) {
|
|
172
|
+
const connectionLost = phase === "failed" && errorCode === "connection.sync_recovery_exhausted";
|
|
173
|
+
const copy = {
|
|
174
|
+
entering: { title: `Joining ${callName}\u2026`, detail: "" },
|
|
175
|
+
left: { title: `You left ${callName}`, detail: "" },
|
|
176
|
+
"timed-out": { title: `You were disconnected from ${callName}`, detail: "Your connection was lost for too long, so your seat was released. Rejoin to come back." },
|
|
177
|
+
"episode-ended": callEndNotice(episodeEndReason),
|
|
178
|
+
failed: { title: connectionLost ? "Connection lost" : `Couldn\u2019t connect to ${callName}`, detail: getConnectionFailureDetail({ code: errorCode, sync }) },
|
|
179
|
+
removed: { title: `You were removed from ${callName}`, detail: "The host removed you from this call." },
|
|
180
|
+
full: { title: "This call is full", detail: `${callName} has reached 100 people. Ask the host to make room, then try again.` },
|
|
181
|
+
elsewhere: { title: "You joined from another tab", detail: `${callName} is open in another tab or window. Use it here instead?` }
|
|
182
|
+
}[phase];
|
|
183
|
+
const retry = onRejoin ?? onRetry;
|
|
184
|
+
const canRetry = phase === "left" || phase === "timed-out" || phase === "failed" || phase === "full" || phase === "elsewhere";
|
|
185
|
+
return /* @__PURE__ */ jsxs2(
|
|
186
|
+
"main",
|
|
187
|
+
{
|
|
188
|
+
"data-chalk": true,
|
|
189
|
+
"data-chalk-theme": theme?.colorScheme ?? "dark",
|
|
190
|
+
"data-chalk-status": phase,
|
|
191
|
+
style: { ...chalkThemeStyle(theme), fontSize: "var(--type-body)", lineHeight: 1.4 },
|
|
192
|
+
className: "chalk-root relative flex h-full min-h-0 w-full flex-col items-center justify-center gap-3 bg-[var(--chalk-canvas)] p-6 text-center text-[var(--chalk-text)]",
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ jsx2("h1", { role: phase === "entering" ? "status" : void 0, style: { fontSize: "var(--type-title)", fontWeight: 600, lineHeight: 1.4, fontFamily: "inherit", letterSpacing: "normal", textWrap: "wrap" }, children: copy.title }),
|
|
195
|
+
reason || copy.detail ? /* @__PURE__ */ jsx2("p", { className: "text-(length:--type-body) text-[var(--chalk-muted-text)]", children: reason ?? copy.detail }) : null,
|
|
196
|
+
phase === "failed" && errorCode ? /* @__PURE__ */ jsxs2("p", { className: "text-(length:--type-body-sm) text-[var(--chalk-muted-text)]", children: [
|
|
197
|
+
"Reference:",
|
|
198
|
+
" ",
|
|
199
|
+
/* @__PURE__ */ jsxs2("code", { dir: "ltr", className: "break-all", children: [
|
|
200
|
+
errorCode,
|
|
201
|
+
sync ? ` ${formatSyncConnectDiagnostic(sync)}` : ""
|
|
202
|
+
] })
|
|
203
|
+
] }) : null,
|
|
204
|
+
/* @__PURE__ */ jsxs2("div", { "data-part": "status-actions", className: "mt-5 flex gap-7", children: [
|
|
205
|
+
phase === "episode-ended" && episodeEndReason === "maximum_duration" && endAction ? /* @__PURE__ */ jsx2(StatusAction, { icon: /* @__PURE__ */ jsx2(StatusIcon, { retry: true }), label: endAction.label, onClick: endAction.onClick }) : null,
|
|
206
|
+
canRetry && retry ? /* @__PURE__ */ jsx2(StatusAction, { icon: /* @__PURE__ */ jsx2(StatusIcon, { retry: true }), label: phase === "elsewhere" ? "Use here" : phase === "left" || phase === "timed-out" || connectionLost ? "Rejoin" : "Try again", onClick: retry, disabled: rejoinDisabled || retryPending }) : null,
|
|
207
|
+
phase !== "entering" && onHome ? /* @__PURE__ */ jsx2(StatusAction, { icon: /* @__PURE__ */ jsx2(StatusIcon, {}), label: "Home", onClick: onHome }) : null
|
|
208
|
+
] }),
|
|
209
|
+
onReportProblem && phase !== "entering" ? /* @__PURE__ */ jsx2("button", { type: "button", onClick: onReportProblem, className: "mt-(--space-4) px-2.5 py-2 text-(length:--type-body-sm) text-[var(--chalk-muted-text)] underline underline-offset-4 focus-visible:outline-2 focus-visible:outline-offset-2", children: "Report a problem" }) : null
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
function StatusIcon({ retry = false }) {
|
|
215
|
+
return /* @__PURE__ */ jsx2("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", children: retry ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
216
|
+
/* @__PURE__ */ jsx2("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
217
|
+
/* @__PURE__ */ jsx2("path", { d: "M3 3v5h5" })
|
|
218
|
+
] }) : /* @__PURE__ */ jsx2("path", { d: "M3 10.5L12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z" }) });
|
|
219
|
+
}
|
|
220
|
+
function StatusAction({ icon, label, onClick, disabled }) {
|
|
221
|
+
return /* @__PURE__ */ jsxs2("button", { type: "button", onClick, disabled, style: { fontSize: "var(--type-body-sm)", fontWeight: 500, lineHeight: 1.4 }, className: "group flex flex-col items-center gap-2 text-[var(--chalk-soft-text)] outline-none disabled:pointer-events-none disabled:opacity-50", children: [
|
|
222
|
+
/* @__PURE__ */ jsx2(
|
|
223
|
+
"span",
|
|
224
|
+
{
|
|
225
|
+
"aria-hidden": "true",
|
|
226
|
+
"data-part": "status-action-circle",
|
|
227
|
+
style: { borderRadius: "50%", color: "var(--chalk-text)" },
|
|
228
|
+
className: "grid h-14 w-14 place-items-center rounded-full bg-[var(--chalk-raised)] text-[var(--chalk-text)] transition-transform duration-150 ease-out group-hover:bg-[var(--chalk-hover)] group-active:scale-[.94] group-focus-visible:outline-2 group-focus-visible:outline-offset-2 group-focus-visible:outline-[var(--chalk-text)] motion-reduce:transition-none",
|
|
229
|
+
children: icon
|
|
230
|
+
}
|
|
231
|
+
),
|
|
232
|
+
label
|
|
233
|
+
] });
|
|
234
|
+
}
|
|
53
235
|
|
|
54
236
|
// src/components/chalk/Chalk.tsx
|
|
55
237
|
import { createSpaceClient } from "@q9labsai/chalk-client";
|
|
56
238
|
import { preloadWhiteboardStylesheet } from "@q9labsai/chalk-whiteboard/react";
|
|
57
|
-
import { useCallback, useEffect as
|
|
239
|
+
import { useCallback, useEffect as useEffect3, useMemo, useRef as useRef2, useState as useState3 } from "react";
|
|
58
240
|
|
|
59
241
|
// src/internal/useWhiteboardSceneSubscription.ts
|
|
60
|
-
import { useEffect, useState } from "react";
|
|
242
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
61
243
|
var errorMessage = (cause) => cause instanceof Error ? cause : new Error("Whiteboard could not connect.");
|
|
62
244
|
var summaryError = (summary) => summary.error ? new Error(summary.error.message) : errorMessage(void 0);
|
|
63
245
|
var MAX_RECOVERY_ATTEMPTS = 3;
|
|
64
246
|
var recoveryDelayMs = (attempt) => 250 * 2 ** attempt;
|
|
65
247
|
function useWhiteboardSceneSubscription(transport, active) {
|
|
66
|
-
const [subscription, setSubscription] =
|
|
67
|
-
|
|
248
|
+
const [subscription, setSubscription] = useState2({ status: "closed" });
|
|
249
|
+
useEffect2(() => {
|
|
68
250
|
if (!active || !transport) {
|
|
69
251
|
setSubscription({ status: "closed" });
|
|
70
252
|
return;
|
|
@@ -201,22 +383,23 @@ function toWhiteboardCollaborationEvent(event) {
|
|
|
201
383
|
}
|
|
202
384
|
|
|
203
385
|
// src/components/chalk/Chalk.tsx
|
|
204
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
386
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
387
|
+
var keepsCallOnFailure = (code) => code === "connection.sync_recovery_exhausted";
|
|
205
388
|
function Chalk(props) {
|
|
206
|
-
const [localColorScheme, setLocalColorScheme] =
|
|
389
|
+
const [localColorScheme, setLocalColorScheme] = useState3("dark");
|
|
207
390
|
const colorScheme = props.theme?.colorScheme ?? localColorScheme;
|
|
208
391
|
const changeColorScheme = (next) => {
|
|
209
392
|
setLocalColorScheme(next);
|
|
210
393
|
props.onColorSchemeChange?.(next);
|
|
211
394
|
};
|
|
212
|
-
const [reportOpen, setReportOpen] =
|
|
213
|
-
const container =
|
|
395
|
+
const [reportOpen, setReportOpen] = useState3(false);
|
|
396
|
+
const container = useRef2(null);
|
|
214
397
|
const openReport = props.onReportProblem && !props.reportUnavailableReason ? () => {
|
|
215
398
|
if (props.onOpenReportProblem) props.onOpenReportProblem();
|
|
216
399
|
else setReportOpen(true);
|
|
217
400
|
} : void 0;
|
|
218
401
|
const suppliedClient = props.client;
|
|
219
|
-
const getAccessRef =
|
|
402
|
+
const getAccessRef = useRef2(props.getAccess);
|
|
220
403
|
getAccessRef.current = props.getAccess;
|
|
221
404
|
const getLatestAccess = useCallback((context) => {
|
|
222
405
|
const latestGetAccess = getAccessRef.current;
|
|
@@ -229,17 +412,17 @@ function Chalk(props) {
|
|
|
229
412
|
return createSpaceClient({ space: props.space, getAccess: getLatestAccess });
|
|
230
413
|
}, [getLatestAccess, props.space, suppliedClient]);
|
|
231
414
|
const client = suppliedClient ?? ownedClient;
|
|
232
|
-
|
|
415
|
+
useEffect3(() => {
|
|
233
416
|
if (!ownedClient) return;
|
|
234
417
|
return () => {
|
|
235
|
-
void ownedClient.
|
|
418
|
+
void ownedClient.close();
|
|
236
419
|
};
|
|
237
420
|
}, [ownedClient]);
|
|
238
|
-
return /* @__PURE__ */
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
-
props.onReportProblem && !props.onOpenReportProblem ? /* @__PURE__ */
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
/* @__PURE__ */
|
|
421
|
+
return /* @__PURE__ */ jsx3(Fragment2, { children: /* @__PURE__ */ jsx3("div", { ref: container, "data-chalk": true, "data-chalk-theme": colorScheme, className: "chalk-root h-full min-h-0 w-full", style: chalkThemeStyle(props.theme, colorScheme), children: /* @__PURE__ */ jsxs3(ChalkProvider, { client, children: [
|
|
422
|
+
/* @__PURE__ */ jsx3(SpaceExperience, { ...props, theme: { ...props.theme, colorScheme }, onColorSchemeChange: changeColorScheme, resolvedColorScheme: colorScheme, onOpenReport: openReport }),
|
|
423
|
+
props.onReportProblem && !props.onOpenReportProblem ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
424
|
+
/* @__PURE__ */ jsx3(ShellStyles, {}),
|
|
425
|
+
/* @__PURE__ */ jsx3(
|
|
243
426
|
CallDialog,
|
|
244
427
|
{
|
|
245
428
|
kind: "report",
|
|
@@ -259,15 +442,15 @@ function SpaceExperience(props) {
|
|
|
259
442
|
const client = useSpaceClient();
|
|
260
443
|
const connection = useConnection();
|
|
261
444
|
const recorded = useRecording().current?.status === "recording";
|
|
262
|
-
const previousStatus =
|
|
263
|
-
const hasObservedStatus =
|
|
264
|
-
const autoJoinAttempted =
|
|
265
|
-
const [previousClient, setPreviousClient] =
|
|
266
|
-
const [joinError, setJoinError] =
|
|
267
|
-
const [retryPending, setRetryPending] =
|
|
268
|
-
const [episodeEnded, setEpisodeEnded] =
|
|
269
|
-
const [handledTerminal, setHandledTerminal] =
|
|
270
|
-
const [previousTerminal, setPreviousTerminal] =
|
|
445
|
+
const previousStatus = useRef2(connection.status);
|
|
446
|
+
const hasObservedStatus = useRef2(false);
|
|
447
|
+
const autoJoinAttempted = useRef2(false);
|
|
448
|
+
const [previousClient, setPreviousClient] = useState3(client);
|
|
449
|
+
const [joinError, setJoinError] = useState3(null);
|
|
450
|
+
const [retryPending, setRetryPending] = useState3(false);
|
|
451
|
+
const [episodeEnded, setEpisodeEnded] = useState3(false);
|
|
452
|
+
const [handledTerminal, setHandledTerminal] = useState3(void 0);
|
|
453
|
+
const [previousTerminal, setPreviousTerminal] = useState3(props.terminalState);
|
|
271
454
|
if (previousTerminal !== props.terminalState) {
|
|
272
455
|
setPreviousTerminal(props.terminalState);
|
|
273
456
|
setHandledTerminal(void 0);
|
|
@@ -299,18 +482,18 @@ function SpaceExperience(props) {
|
|
|
299
482
|
setRetryPending(true);
|
|
300
483
|
void join(defaultJoinOptions(props)).finally(() => setRetryPending(false));
|
|
301
484
|
}, [join, props]);
|
|
302
|
-
|
|
485
|
+
useEffect3(
|
|
303
486
|
() => client.on("episodeEnded", () => {
|
|
304
487
|
setEpisodeEnded(true);
|
|
305
488
|
}),
|
|
306
489
|
[client]
|
|
307
490
|
);
|
|
308
|
-
|
|
491
|
+
useEffect3(() => {
|
|
309
492
|
if (connection.status !== "idle" || autoJoinAttempted.current) return;
|
|
310
493
|
autoJoinAttempted.current = true;
|
|
311
494
|
void join(defaultJoinOptions(props));
|
|
312
495
|
}, [connection.status, join, props.defaults?.camera, props.defaults?.microphone, props.displayName]);
|
|
313
|
-
|
|
496
|
+
useEffect3(() => {
|
|
314
497
|
const previous = previousStatus.current;
|
|
315
498
|
if (hasObservedStatus.current) {
|
|
316
499
|
if (connection.status === "live" && previous !== "live" && previous !== "reconnecting") props.onJoined?.();
|
|
@@ -321,14 +504,14 @@ function SpaceExperience(props) {
|
|
|
321
504
|
}, [connection.status, props.onJoined, props.onLeft]);
|
|
322
505
|
const callName = props.spaceName ?? props.space;
|
|
323
506
|
const statusTheme = { ...props.theme, colorScheme: props.resolvedColorScheme };
|
|
324
|
-
if (props.terminalState && props.terminalState !== handledTerminal) return /* @__PURE__ */
|
|
507
|
+
if (props.terminalState && props.terminalState !== handledTerminal) return /* @__PURE__ */ jsx3(StatusSurface, { phase: props.terminalState, callName, theme: statusTheme, onRejoin: props.onRejoin ?? retryAutomaticJoin, onHome: props.onHome, onReportProblem: props.onOpenReport, retryPending });
|
|
325
508
|
if (connection.status === "idle")
|
|
326
|
-
return /* @__PURE__ */
|
|
327
|
-
if (connection.status === "joining") return /* @__PURE__ */
|
|
509
|
+
return /* @__PURE__ */ jsx3(CallLimbo, { theme: { ...props.theme, colorScheme: props.resolvedColorScheme }, recorded, spaceName, message: joinError ?? `Joining ${spaceName}\u2026`, action: joinError ? { label: "Try again", onClick: retryAutomaticJoin, disabled: retryPending } : void 0 });
|
|
510
|
+
if (connection.status === "joining") return /* @__PURE__ */ jsx3(CallLimbo, { theme: { ...props.theme, colorScheme: props.resolvedColorScheme }, recorded, spaceName, message: `Joining ${spaceName}\u2026` });
|
|
328
511
|
if (connection.status === "failed" && connection.lastError?.code === "episode.ended")
|
|
329
|
-
return /* @__PURE__ */
|
|
330
|
-
if (connection.status === "failed") {
|
|
331
|
-
return /* @__PURE__ */
|
|
512
|
+
return /* @__PURE__ */ jsx3(StatusSurface, { phase: "episode-ended", callName, episodeEndReason: connection.episodeEndReason, endAction: props.timeLimit?.endAction, theme: statusTheme, onHome: props.onHome, onReportProblem: props.onOpenReport });
|
|
513
|
+
if (connection.status === "failed" && !keepsCallOnFailure(connection.lastError?.code)) {
|
|
514
|
+
return /* @__PURE__ */ jsx3(
|
|
332
515
|
StatusSurface,
|
|
333
516
|
{
|
|
334
517
|
phase: "failed",
|
|
@@ -345,10 +528,10 @@ function SpaceExperience(props) {
|
|
|
345
528
|
);
|
|
346
529
|
}
|
|
347
530
|
if (connection.status === "leaving" || connection.status === "left")
|
|
348
|
-
return /* @__PURE__ */
|
|
531
|
+
return /* @__PURE__ */ jsx3(
|
|
349
532
|
StatusSurface,
|
|
350
533
|
{
|
|
351
|
-
phase: episodeEnded || connection.episodeEnded ? "episode-ended" : "left",
|
|
534
|
+
phase: episodeEnded || connection.episodeEnded ? "episode-ended" : connection.timedOut ? "timed-out" : "left",
|
|
352
535
|
episodeEndReason: connection.episodeEndReason,
|
|
353
536
|
endAction: props.timeLimit?.endAction,
|
|
354
537
|
callName,
|
|
@@ -359,9 +542,9 @@ function SpaceExperience(props) {
|
|
|
359
542
|
onHome: props.onHome
|
|
360
543
|
}
|
|
361
544
|
);
|
|
362
|
-
return /* @__PURE__ */
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
/* @__PURE__ */
|
|
545
|
+
return /* @__PURE__ */ jsxs3("div", { className: "relative h-full min-h-0", children: [
|
|
546
|
+
/* @__PURE__ */ jsx3(SpaceSurface, { ...props, spaceName, onRetry: retryAutomaticJoin }),
|
|
547
|
+
/* @__PURE__ */ jsx3(CallLimbo, { overlay: true, active: false, initiallyCovered: true, message: "" })
|
|
365
548
|
] });
|
|
366
549
|
}
|
|
367
550
|
function SpaceSurface(props) {
|
|
@@ -371,9 +554,9 @@ function SpaceSurface(props) {
|
|
|
371
554
|
const whiteboardState = useWhiteboard();
|
|
372
555
|
const canEndEpisode = useCan("endEpisode");
|
|
373
556
|
const canDrawWhiteboard = useCanDrawWhiteboard();
|
|
374
|
-
const [commandError, setCommandError] =
|
|
375
|
-
const [commandSource, setCommandSource] =
|
|
376
|
-
const [commandAction, setCommandAction] =
|
|
557
|
+
const [commandError, setCommandError] = useState3(() => connection.lastError?.recoverable && connection.lastError.code.startsWith("media.") ? connection.lastError : null);
|
|
558
|
+
const [commandSource, setCommandSource] = useState3();
|
|
559
|
+
const [commandAction, setCommandAction] = useState3();
|
|
377
560
|
const runCommand = useCallback(async (command, source, action) => {
|
|
378
561
|
try {
|
|
379
562
|
await command();
|
|
@@ -388,12 +571,12 @@ function SpaceSurface(props) {
|
|
|
388
571
|
}, []);
|
|
389
572
|
const whiteboardTransport = client.whiteboard.transport();
|
|
390
573
|
const whiteboardAvailable = props.features?.whiteboard !== false;
|
|
391
|
-
|
|
574
|
+
useEffect3(() => {
|
|
392
575
|
if (whiteboardAvailable) preloadWhiteboardStylesheet();
|
|
393
576
|
}, [whiteboardAvailable]);
|
|
394
577
|
const whiteboardSubscription = useWhiteboardSceneSubscription(whiteboardTransport, whiteboardAvailable);
|
|
395
578
|
const setWhiteboardPresentation = whiteboardSubscription.status === "ready" ? bindWhiteboardPresentation(whiteboardSubscription.transport) : void 0;
|
|
396
|
-
|
|
579
|
+
useEffect3(() => {
|
|
397
580
|
if (whiteboardSubscription.status === "failed") setCommandError(whiteboardSubscription.error.message);
|
|
398
581
|
else if (whiteboardSubscription.status === "loading" || whiteboardSubscription.status === "ready") setCommandError(null);
|
|
399
582
|
}, [whiteboardSubscription]);
|
|
@@ -415,7 +598,7 @@ function SpaceSurface(props) {
|
|
|
415
598
|
},
|
|
416
599
|
sendView: whiteboardSubscription.transport.supportsViews ?? Boolean(whiteboardSubscription.transport.sendView) ? (view) => whiteboardSubscription.transport.sendView?.(view) ?? false : void 0
|
|
417
600
|
} : void 0;
|
|
418
|
-
return /* @__PURE__ */
|
|
601
|
+
return /* @__PURE__ */ jsx3(
|
|
419
602
|
SpaceView,
|
|
420
603
|
{
|
|
421
604
|
timeLimit: props.timeLimit,
|
|
@@ -439,18 +622,8 @@ function SpaceSurface(props) {
|
|
|
439
622
|
onToggleWhiteboard: canDrawWhiteboard && setWhiteboardPresentation ? () => void runCommand(() => setWhiteboardPresentation(!whiteboardState.engine.presenting)) : void 0,
|
|
440
623
|
onLeft: () => runCommand(() => client.leave()),
|
|
441
624
|
onEndEpisode: canEndEpisode ? () => runCommand(() => client.endEpisode()) : void 0,
|
|
442
|
-
|
|
443
|
-
overlay: /* @__PURE__ */
|
|
444
|
-
media.microphoneMutedByOtherDevice ? /* @__PURE__ */ jsx("div", { role: "status", className: "pointer-events-none absolute inset-x-3 top-16 z-40 flex justify-center", children: /* @__PURE__ */ jsx("p", { className: "chalk-toast text-center text-sm", children: "Mic off: your other device is using it." }) }) : null,
|
|
445
|
-
media.incomingRequests[0] ? /* @__PURE__ */ jsx(
|
|
446
|
-
MediaRequestDialog,
|
|
447
|
-
{
|
|
448
|
-
request: media.incomingRequests[0],
|
|
449
|
-
onDecline: () => void runCommand(() => client.media.declineRequest(media.incomingRequests[0].requestId), media.incomingRequests[0].kind === "start_camera" ? "camera" : "microphone", "request"),
|
|
450
|
-
onAllow: () => void runCommand(() => client.media.acceptRequest(media.incomingRequests[0].requestId), media.incomingRequests[0].kind === "start_camera" ? "camera" : "microphone", "request")
|
|
451
|
-
}
|
|
452
|
-
) : null
|
|
453
|
-
] })
|
|
625
|
+
onRejoin: props.onRejoin ?? props.onRetry,
|
|
626
|
+
overlay: media.microphoneMutedByOtherDevice ? /* @__PURE__ */ jsx3("div", { role: "status", className: "pointer-events-none absolute inset-x-3 top-16 z-40 flex justify-center", children: /* @__PURE__ */ jsx3("p", { className: "chalk-toast text-center text-sm", children: "Mic off: your other device is using it." }) }) : void 0
|
|
454
627
|
}
|
|
455
628
|
);
|
|
456
629
|
}
|
|
@@ -461,20 +634,20 @@ function bindWhiteboardPresentation(transport) {
|
|
|
461
634
|
}
|
|
462
635
|
function defaultJoinOptions(props) {
|
|
463
636
|
const displayName = props.displayName?.trim();
|
|
464
|
-
return { ...displayName ? { displayName } : {}, microphone: props.defaults?.microphone ?? true, camera: props.defaults?.camera ?? true };
|
|
637
|
+
return { ...displayName ? { displayName } : {}, ...props.defaults, microphone: props.defaults?.microphone ?? true, camera: props.defaults?.camera ?? true };
|
|
465
638
|
}
|
|
466
639
|
function useClientEvents(client, callbacks) {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
640
|
+
useEffect3(() => client.on("participantJoined", (event) => callbacks.onParticipantJoined?.(event)), [callbacks.onParticipantJoined, client]);
|
|
641
|
+
useEffect3(() => client.on("participantLeft", (event) => callbacks.onParticipantLeft?.(event)), [callbacks.onParticipantLeft, client]);
|
|
642
|
+
useEffect3(() => client.on("episodeEnded", (event) => callbacks.onEpisodeEnded?.(event)), [callbacks.onEpisodeEnded, client]);
|
|
643
|
+
useEffect3(() => client.on("screenShareStarted", (event) => callbacks.onScreenShareStarted?.(event)), [callbacks.onScreenShareStarted, client]);
|
|
644
|
+
useEffect3(() => client.on("screenShareStopped", (event) => callbacks.onScreenShareStopped?.(event)), [callbacks.onScreenShareStopped, client]);
|
|
645
|
+
useEffect3(() => client.on("error", (event) => callbacks.onError?.(event)), [callbacks.onError, client]);
|
|
473
646
|
}
|
|
474
647
|
|
|
475
648
|
// src/components/space-view/RecordingSpaceView.tsx
|
|
476
649
|
import { CHALK_CHAT_ATTACHMENT_MIME_TYPES } from "@q9labsai/chalk-client";
|
|
477
|
-
import { Fragment as
|
|
650
|
+
import { Fragment as Fragment3, jsx as jsx4 } from "react/jsx-runtime";
|
|
478
651
|
var RECORDING_TOOLBAR_BUTTONS = ["record", "participants", "chat", "reactions", "whiteboard"];
|
|
479
652
|
var CHAT_ATTACHMENT_MIME_TYPES = new Set(CHALK_CHAT_ATTACHMENT_MIME_TYPES);
|
|
480
653
|
function hasRenderableMedia(media) {
|
|
@@ -554,16 +727,16 @@ function RecordingSpaceView({ frame, resolveMedia, resolveAssetUrl, renderWhiteb
|
|
|
554
727
|
const renderContent = (item) => {
|
|
555
728
|
if (item.kind === "whiteboard") {
|
|
556
729
|
const content = sharedContent.kind === "whiteboard" ? renderWhiteboard?.(sharedContent) : null;
|
|
557
|
-
return /* @__PURE__ */
|
|
730
|
+
return /* @__PURE__ */ jsx4(StageContentTileSurface, { item, media: content, mediaVisible: hasRenderableMedia(content), className: "h-full w-full" });
|
|
558
731
|
}
|
|
559
732
|
if (sharedContent.kind !== "screen_share") throw new TypeError("recording stage contains a screen share without shared-content state");
|
|
560
733
|
const source = visibleMedia.find((candidate) => candidate.sourceId === sharedContent.sourceId);
|
|
561
734
|
if (!source) throw new TypeError("recording screen share source is not visible");
|
|
562
735
|
const media = mediaNodes.get(source.sourceId);
|
|
563
|
-
return /* @__PURE__ */
|
|
736
|
+
return /* @__PURE__ */ jsx4(ScreenSharePresentation, { sharedByName: item.participant.displayName, media, mediaVisible: hasRenderableMedia(media) });
|
|
564
737
|
};
|
|
565
738
|
const layout = frame.view.layout === "grid" ? "grid" : "focus";
|
|
566
|
-
return /* @__PURE__ */
|
|
739
|
+
return /* @__PURE__ */ jsx4(Fragment3, { children: /* @__PURE__ */ jsx4(
|
|
567
740
|
SpacePresentation,
|
|
568
741
|
{
|
|
569
742
|
colorScheme: frame.profile.theme.colorScheme,
|
|
@@ -574,7 +747,7 @@ function RecordingSpaceView({ frame, resolveMedia, resolveAssetUrl, renderWhiteb
|
|
|
574
747
|
isRecording: true,
|
|
575
748
|
layout
|
|
576
749
|
},
|
|
577
|
-
stage: /* @__PURE__ */
|
|
750
|
+
stage: /* @__PURE__ */ jsx4(
|
|
578
751
|
Stage,
|
|
579
752
|
{
|
|
580
753
|
items,
|
|
@@ -582,11 +755,11 @@ function RecordingSpaceView({ frame, resolveMedia, resolveAssetUrl, renderWhiteb
|
|
|
582
755
|
interactive: false,
|
|
583
756
|
animate: false,
|
|
584
757
|
generatedAvatars: frame.profile.theme.generatedAvatars,
|
|
585
|
-
emptyState: /* @__PURE__ */
|
|
758
|
+
emptyState: /* @__PURE__ */ jsx4(QuietSpace, {}),
|
|
586
759
|
renderParticipant: (item, context) => {
|
|
587
760
|
const source = cameraByParticipant.get(item.participant.id);
|
|
588
761
|
const media = source ? mediaNodes.get(source.sourceId) : null;
|
|
589
|
-
return /* @__PURE__ */
|
|
762
|
+
return /* @__PURE__ */ jsx4(
|
|
590
763
|
ParticipantTileSurface,
|
|
591
764
|
{
|
|
592
765
|
participant: item.participant,
|
|
@@ -603,15 +776,15 @@ function RecordingSpaceView({ frame, resolveMedia, resolveAssetUrl, renderWhiteb
|
|
|
603
776
|
},
|
|
604
777
|
renderContentTile: (item, context) => {
|
|
605
778
|
const media = item.kind === "whiteboard" && frame.sharedContent.kind === "whiteboard" ? renderWhiteboard?.(frame.sharedContent) : frame.sharedContent.kind === "screen_share" ? mediaNodes.get(frame.sharedContent.sourceId) : null;
|
|
606
|
-
return /* @__PURE__ */
|
|
779
|
+
return /* @__PURE__ */ jsx4(StageContentTileSurface, { item, media, mediaVisible: hasRenderableMedia(media), pinned: context.pinned, style: context.style, hidden: context.hidden });
|
|
607
780
|
},
|
|
608
781
|
renderPrimaryContent: renderContent,
|
|
609
782
|
className: "h-full"
|
|
610
783
|
}
|
|
611
784
|
),
|
|
612
|
-
controls: /* @__PURE__ */
|
|
613
|
-
stageOverlay: /* @__PURE__ */
|
|
614
|
-
sidebar: /* @__PURE__ */
|
|
785
|
+
controls: /* @__PURE__ */ jsx4(ControlBarPresentation, { density: "comfortable", buttons: RECORDING_TOOLBAR_BUTTONS, isRecording: true, isChatOpen: true, isWhiteboardOpen: sharedContent.kind === "whiteboard", expanded: true, detectDevices: false, displayOnly: true }),
|
|
786
|
+
stageOverlay: /* @__PURE__ */ jsx4(ReactionsOverlayPresentation, { reactions: frame.reactions, elapsedMs: frame.elapsedMs }),
|
|
787
|
+
sidebar: /* @__PURE__ */ jsx4(CallCard, { state: "open", interactive: false, children: /* @__PURE__ */ jsx4(
|
|
615
788
|
ChatPanelPresentation,
|
|
616
789
|
{
|
|
617
790
|
messages,
|
|
@@ -637,7 +810,7 @@ RecordingSpaceView.displayName = "RecordingSpaceView";
|
|
|
637
810
|
|
|
638
811
|
// src/components/recording-history/RecordingHistoryPanel.tsx
|
|
639
812
|
import "react";
|
|
640
|
-
import { jsx as
|
|
813
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
641
814
|
function RecordingHistoryPanel({
|
|
642
815
|
recordings,
|
|
643
816
|
isLoading = false,
|
|
@@ -658,18 +831,18 @@ function RecordingHistoryPanel({
|
|
|
658
831
|
onWatch,
|
|
659
832
|
className
|
|
660
833
|
}) {
|
|
661
|
-
return /* @__PURE__ */
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
-
/* @__PURE__ */
|
|
834
|
+
return /* @__PURE__ */ jsxs4(ChalkPanel, { className: cn("h-full min-h-0 w-full overflow-hidden bg-[var(--chalk-app-panel)] p-0", className), contentClassName: "flex h-full min-h-0 flex-col", role: "region", "aria-label": "Recording history", children: [
|
|
835
|
+
/* @__PURE__ */ jsxs4("header", { className: "flex items-center justify-between gap-3 border-b border-[var(--chalk-app-line)] px-4 py-3", children: [
|
|
836
|
+
/* @__PURE__ */ jsxs4("div", { children: [
|
|
837
|
+
/* @__PURE__ */ jsx5("h2", { className: "text-base font-semibold", children: "Recordings" }),
|
|
838
|
+
/* @__PURE__ */ jsx5("p", { className: "mt-0.5 text-xs text-[var(--chalk-app-text-muted)]", children: "Captured Episode activity" })
|
|
666
839
|
] }),
|
|
667
|
-
isLoading ? /* @__PURE__ */
|
|
840
|
+
isLoading ? /* @__PURE__ */ jsx5(Loading01Icon, { className: "size-4 animate-spin text-[var(--chalk-app-text-muted)]", "aria-label": "Loading recordings" }) : null
|
|
668
841
|
] }),
|
|
669
|
-
/* @__PURE__ */
|
|
670
|
-
/* @__PURE__ */
|
|
842
|
+
/* @__PURE__ */ jsx5("div", { className: "min-h-0 flex-1 overflow-y-auto p-3", children: error ? /* @__PURE__ */ jsx5(ChalkEmptyState, { title: "Recordings could not be loaded", description: error, tone: "danger", children: onRetry ? /* @__PURE__ */ jsxs4(ChalkButton, { className: "mt-4", onClick: onRetry, tone: "danger", children: [
|
|
843
|
+
/* @__PURE__ */ jsx5(RefreshIcon, { className: "size-4" }),
|
|
671
844
|
"Try again"
|
|
672
|
-
] }) : null }) : recordings.length === 0 && !isLoading ? /* @__PURE__ */
|
|
845
|
+
] }) : null }) : recordings.length === 0 && !isLoading ? /* @__PURE__ */ jsx5(ChalkEmptyState, { title: "No recordings yet", description: "Captured Episode activity will appear here.", children: /* @__PURE__ */ jsx5(Video01Icon, { className: "mx-auto mt-4 size-8 text-[var(--chalk-app-text-muted)]", "aria-hidden": "true" }) }) : /* @__PURE__ */ jsx5("ul", { className: "grid gap-2", "aria-label": "Recordings", children: recordings.map((recording) => /* @__PURE__ */ jsx5(
|
|
673
846
|
RecordingHistoryRow,
|
|
674
847
|
{
|
|
675
848
|
recording,
|
|
@@ -687,22 +860,22 @@ function RecordingHistoryPanel({
|
|
|
687
860
|
},
|
|
688
861
|
recording.id
|
|
689
862
|
)) }) }),
|
|
690
|
-
hasMore && !error ? /* @__PURE__ */
|
|
863
|
+
hasMore && !error ? /* @__PURE__ */ jsx5("footer", { className: "border-t border-[var(--chalk-app-line)] p-3", children: /* @__PURE__ */ jsx5(ChalkButton, { className: "w-full", disabled: isLoading || !onLoadMore, loading: isLoading, onClick: onLoadMore, children: "Load more" }) }) : null
|
|
691
864
|
] });
|
|
692
865
|
}
|
|
693
866
|
function RecordingHistoryRow({ downloading, onDownload, onReadTranscript, onRefreshExport, onRequestExport, onRequestTranscript, onWatch, readingTranscript, recording, refreshingExport, requestingExport, requestingTranscript }) {
|
|
694
|
-
return /* @__PURE__ */
|
|
695
|
-
/* @__PURE__ */
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
/* @__PURE__ */
|
|
698
|
-
/* @__PURE__ */
|
|
867
|
+
return /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsxs4(ChalkPanel, { className: "p-3", contentClassName: "flex items-start gap-3", children: [
|
|
868
|
+
/* @__PURE__ */ jsx5("span", { className: "grid size-10 shrink-0 place-items-center rounded-full bg-[var(--chalk-app-control)] text-[var(--chalk-app-text-muted)]", "aria-hidden": "true", children: /* @__PURE__ */ jsx5(Video01Icon, { className: "size-5" }) }),
|
|
869
|
+
/* @__PURE__ */ jsxs4("div", { className: "min-w-0 flex-1", children: [
|
|
870
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
871
|
+
/* @__PURE__ */ jsxs4("span", { className: "truncate text-sm font-medium", children: [
|
|
699
872
|
"Episode ",
|
|
700
873
|
shortId(recording.episode_id)
|
|
701
874
|
] }),
|
|
702
|
-
recording.export ? null : /* @__PURE__ */
|
|
875
|
+
recording.export ? null : /* @__PURE__ */ jsx5(StatusBadge, { label: legacyStatusLabel(recording.status), tone: legacyStatusTone(recording.status) })
|
|
703
876
|
] }),
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
recording.export ? /* @__PURE__ */
|
|
877
|
+
/* @__PURE__ */ jsx5("p", { className: "mt-1 text-xs text-[var(--chalk-app-text-muted)]", children: /* @__PURE__ */ jsx5("time", { dateTime: recording.created_at, children: formatTimestamp(recording.created_at) }) }),
|
|
878
|
+
recording.export ? /* @__PURE__ */ jsx5(
|
|
706
879
|
RecordingArtifactStatus,
|
|
707
880
|
{
|
|
708
881
|
downloading,
|
|
@@ -718,7 +891,7 @@ function RecordingHistoryRow({ downloading, onDownload, onReadTranscript, onRefr
|
|
|
718
891
|
requestingExport,
|
|
719
892
|
requestingTranscript
|
|
720
893
|
}
|
|
721
|
-
) : /* @__PURE__ */
|
|
894
|
+
) : /* @__PURE__ */ jsx5(LegacyRecordingActions, { downloading, onDownload, recording })
|
|
722
895
|
] })
|
|
723
896
|
] }) });
|
|
724
897
|
}
|
|
@@ -726,97 +899,97 @@ function RecordingArtifactStatus({ downloading, onDownload, onReadTranscript, on
|
|
|
726
899
|
const video = recording.export;
|
|
727
900
|
if (!video) throw new Error("Recording export is required when rendering artifact status");
|
|
728
901
|
const transcriptStatus = recording.transcript?.status === "none" && recording.transcript.requestable ? "requestable" : recording.transcript?.status;
|
|
729
|
-
return /* @__PURE__ */
|
|
730
|
-
recording.source ? /* @__PURE__ */
|
|
731
|
-
transcriptStatus ? /* @__PURE__ */
|
|
732
|
-
recording.transcript ? /* @__PURE__ */
|
|
733
|
-
/* @__PURE__ */
|
|
734
|
-
video.status === "ready" ? /* @__PURE__ */
|
|
735
|
-
video.status === "pending" ? /* @__PURE__ */
|
|
736
|
-
canRequestExport(video) ? /* @__PURE__ */
|
|
902
|
+
return /* @__PURE__ */ jsxs4("div", { className: "mt-3 grid gap-2 border-t border-[var(--chalk-app-line)] pt-3", children: [
|
|
903
|
+
recording.source ? /* @__PURE__ */ jsx5(ArtifactStatus, { icon: /* @__PURE__ */ jsx5(Video01Icon, { className: "size-4" }), label: "Capture", detail: sourceDetail(recording.source), status: sourceLabel(recording.source.status), tone: sourceTone(recording.source.status) }) : null,
|
|
904
|
+
transcriptStatus ? /* @__PURE__ */ jsx5(ArtifactStatus, { icon: /* @__PURE__ */ jsx5(FileTextIcon, { className: "size-4" }), label: "Transcript", detail: transcriptDetail(transcriptStatus), status: transcriptLabel(transcriptStatus), tone: transcriptTone(transcriptStatus) }) : null,
|
|
905
|
+
recording.transcript ? /* @__PURE__ */ jsx5(TranscriptContent, { onReadTranscript, onRequestTranscript, reading: readingTranscript, recording, requestingTranscript }) : null,
|
|
906
|
+
/* @__PURE__ */ jsx5(ArtifactStatus, { icon: /* @__PURE__ */ jsx5(Video01Icon, { className: "size-4" }), label: "Video", detail: exportDetail(video), status: exportLabel(video.status), tone: exportTone(video.status) }),
|
|
907
|
+
video.status === "ready" ? /* @__PURE__ */ jsx5(ReadyVideoActions, { downloading, onDownload, onWatch, recording }) : null,
|
|
908
|
+
video.status === "pending" ? /* @__PURE__ */ jsx5(PendingVideoActions, { onRefreshExport, recording, refreshingExport, requestingExport }) : null,
|
|
909
|
+
canRequestExport(video) ? /* @__PURE__ */ jsx5(RequestedVideoActions, { onRequestExport, recording, requestingExport }) : null
|
|
737
910
|
] });
|
|
738
911
|
}
|
|
739
912
|
function TranscriptContent({ onReadTranscript, onRequestTranscript, reading, recording, requestingTranscript }) {
|
|
740
913
|
const transcript = recording.transcript;
|
|
741
914
|
if (!transcript) return null;
|
|
742
915
|
if ((transcript.status === "none" || transcript.status === "requestable") && transcript.requestable && onRequestTranscript) {
|
|
743
|
-
return /* @__PURE__ */
|
|
744
|
-
/* @__PURE__ */
|
|
916
|
+
return /* @__PURE__ */ jsx5("div", { className: "pt-1", children: /* @__PURE__ */ jsxs4(ChalkButton, { "aria-label": `Request transcript ${shortId(recording.id)}`, disabled: requestingTranscript, loading: requestingTranscript, onClick: () => onRequestTranscript(recording), variant: "ghost", className: "shrink-0 px-3", children: [
|
|
917
|
+
/* @__PURE__ */ jsx5(FileTextIcon, { className: "size-4" }),
|
|
745
918
|
"Request transcript"
|
|
746
919
|
] }) });
|
|
747
920
|
}
|
|
748
921
|
if (transcript.status !== "completed") return null;
|
|
749
922
|
if (transcript.text !== void 0) {
|
|
750
|
-
return /* @__PURE__ */
|
|
751
|
-
/* @__PURE__ */
|
|
752
|
-
/* @__PURE__ */
|
|
923
|
+
return /* @__PURE__ */ jsxs4("details", { className: "rounded border border-[var(--chalk-app-line)] p-2", children: [
|
|
924
|
+
/* @__PURE__ */ jsx5("summary", { className: "cursor-pointer text-xs font-medium", children: "Transcript" }),
|
|
925
|
+
/* @__PURE__ */ jsx5("p", { className: "mt-2 whitespace-pre-wrap text-xs leading-5 text-[var(--chalk-app-text-muted)]", children: transcript.text })
|
|
753
926
|
] });
|
|
754
927
|
}
|
|
755
928
|
if (!onReadTranscript) return null;
|
|
756
|
-
return /* @__PURE__ */
|
|
757
|
-
/* @__PURE__ */
|
|
929
|
+
return /* @__PURE__ */ jsx5("div", { className: "pt-1", children: /* @__PURE__ */ jsxs4(ChalkButton, { "aria-label": `Read transcript ${shortId(recording.id)}`, disabled: reading, loading: reading, onClick: () => onReadTranscript(recording), variant: "ghost", className: "shrink-0 px-3", children: [
|
|
930
|
+
/* @__PURE__ */ jsx5(FileTextIcon, { className: "size-4" }),
|
|
758
931
|
"Read transcript"
|
|
759
932
|
] }) });
|
|
760
933
|
}
|
|
761
934
|
function ArtifactStatus({ detail, icon, label, status, tone }) {
|
|
762
|
-
return /* @__PURE__ */
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
/* @__PURE__ */
|
|
765
|
-
/* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */
|
|
767
|
-
/* @__PURE__ */
|
|
935
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex items-start gap-2 text-xs", children: [
|
|
936
|
+
/* @__PURE__ */ jsx5("span", { className: "mt-0.5 text-[var(--chalk-app-text-muted)]", "aria-hidden": "true", children: icon }),
|
|
937
|
+
/* @__PURE__ */ jsxs4("div", { className: "min-w-0 flex-1", children: [
|
|
938
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
939
|
+
/* @__PURE__ */ jsx5("span", { className: "font-medium", children: label }),
|
|
940
|
+
/* @__PURE__ */ jsx5(StatusBadge, { label: status, tone })
|
|
768
941
|
] }),
|
|
769
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ jsx5("p", { className: "mt-0.5 text-[var(--chalk-app-text-muted)]", children: detail })
|
|
770
943
|
] })
|
|
771
944
|
] });
|
|
772
945
|
}
|
|
773
946
|
function StatusBadge({ label, tone }) {
|
|
774
|
-
return /* @__PURE__ */
|
|
947
|
+
return /* @__PURE__ */ jsx5(ChalkBadge, { tone, children: label });
|
|
775
948
|
}
|
|
776
949
|
function ReadyVideoActions({ downloading, onDownload, onWatch, recording }) {
|
|
777
950
|
if (!onDownload && !onWatch) return null;
|
|
778
|
-
return /* @__PURE__ */
|
|
779
|
-
onWatch ? /* @__PURE__ */
|
|
780
|
-
/* @__PURE__ */
|
|
951
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-wrap gap-2 pt-1", children: [
|
|
952
|
+
onWatch ? /* @__PURE__ */ jsxs4(ChalkButton, { "aria-label": `Watch recording ${shortId(recording.id)}`, onClick: () => onWatch(recording), variant: "ghost", className: "shrink-0 px-3", children: [
|
|
953
|
+
/* @__PURE__ */ jsx5(PlayIcon, { className: "size-4" }),
|
|
781
954
|
"Watch"
|
|
782
955
|
] }) : null,
|
|
783
|
-
onDownload ? /* @__PURE__ */
|
|
784
|
-
/* @__PURE__ */
|
|
956
|
+
onDownload ? /* @__PURE__ */ jsxs4(ChalkButton, { "aria-label": `Download recording ${shortId(recording.id)}`, disabled: downloading, loading: downloading, onClick: () => onDownload(recording), variant: "ghost", className: "shrink-0 px-3", children: [
|
|
957
|
+
/* @__PURE__ */ jsx5(Download01Icon, { className: "size-4" }),
|
|
785
958
|
"Download"
|
|
786
959
|
] }) : null
|
|
787
960
|
] });
|
|
788
961
|
}
|
|
789
962
|
function PendingVideoActions({ onRefreshExport, recording, refreshingExport, requestingExport }) {
|
|
790
963
|
if (!onRefreshExport) return null;
|
|
791
|
-
return /* @__PURE__ */
|
|
792
|
-
/* @__PURE__ */
|
|
964
|
+
return /* @__PURE__ */ jsx5("div", { className: "pt-1", children: /* @__PURE__ */ jsxs4(ChalkButton, { "aria-label": `Check video status ${shortId(recording.id)}`, disabled: refreshingExport || requestingExport, loading: refreshingExport || requestingExport, onClick: () => onRefreshExport(recording), variant: "ghost", className: "shrink-0 px-3", children: [
|
|
965
|
+
/* @__PURE__ */ jsx5(RefreshIcon, { className: "size-4" }),
|
|
793
966
|
"Check video status"
|
|
794
967
|
] }) });
|
|
795
968
|
}
|
|
796
969
|
function RequestedVideoActions({ onRequestExport, recording, requestingExport }) {
|
|
797
970
|
if (!onRequestExport) return null;
|
|
798
971
|
if (recording.export?.status === "failed") {
|
|
799
|
-
return /* @__PURE__ */
|
|
800
|
-
/* @__PURE__ */
|
|
972
|
+
return /* @__PURE__ */ jsx5("div", { className: "pt-1", children: /* @__PURE__ */ jsxs4(ChalkButton, { "aria-label": `Retry Export ${shortId(recording.id)}`, disabled: requestingExport, loading: requestingExport, onClick: () => onRequestExport(recording, "retry"), variant: "ghost", className: "shrink-0 px-3", children: [
|
|
973
|
+
/* @__PURE__ */ jsx5(RefreshIcon, { className: "size-4" }),
|
|
801
974
|
"Retry Export"
|
|
802
975
|
] }) });
|
|
803
976
|
}
|
|
804
|
-
return /* @__PURE__ */
|
|
805
|
-
/* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */
|
|
977
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-wrap gap-2 pt-1", children: [
|
|
978
|
+
/* @__PURE__ */ jsxs4(ChalkButton, { "aria-label": `Watch recording ${shortId(recording.id)}`, disabled: requestingExport, loading: requestingExport, onClick: () => onRequestExport(recording, "watch"), variant: "ghost", className: "shrink-0 px-3", children: [
|
|
979
|
+
/* @__PURE__ */ jsx5(PlayIcon, { className: "size-4" }),
|
|
807
980
|
"Watch"
|
|
808
981
|
] }),
|
|
809
|
-
/* @__PURE__ */
|
|
810
|
-
/* @__PURE__ */
|
|
982
|
+
/* @__PURE__ */ jsxs4(ChalkButton, { "aria-label": `Download recording ${shortId(recording.id)}`, disabled: requestingExport, loading: requestingExport, onClick: () => onRequestExport(recording, "download"), variant: "ghost", className: "shrink-0 px-3", children: [
|
|
983
|
+
/* @__PURE__ */ jsx5(Download01Icon, { className: "size-4" }),
|
|
811
984
|
"Download"
|
|
812
985
|
] })
|
|
813
986
|
] });
|
|
814
987
|
}
|
|
815
988
|
function LegacyRecordingActions({ downloading, onDownload, recording }) {
|
|
816
989
|
if (recording.status !== "completed" || !onDownload) return null;
|
|
817
|
-
return /* @__PURE__ */
|
|
818
|
-
/* @__PURE__ */
|
|
819
|
-
/* @__PURE__ */
|
|
990
|
+
return /* @__PURE__ */ jsx5("div", { className: "pt-3", children: /* @__PURE__ */ jsxs4(ChalkButton, { "aria-label": `Download recording ${shortId(recording.id)}`, disabled: downloading, loading: downloading, onClick: () => onDownload(recording), variant: "ghost", className: "shrink-0 px-3", children: [
|
|
991
|
+
/* @__PURE__ */ jsx5(Download01Icon, { className: "size-4" }),
|
|
992
|
+
/* @__PURE__ */ jsx5("span", { className: "hidden sm:inline", children: "Download" })
|
|
820
993
|
] }) });
|
|
821
994
|
}
|
|
822
995
|
function canRequestExport(value) {
|
|
@@ -910,15 +1083,15 @@ RecordingHistoryPanel.displayName = "RecordingHistoryPanel";
|
|
|
910
1083
|
|
|
911
1084
|
// src/components/whiteboard-view/RecordingWhiteboardView.tsx
|
|
912
1085
|
import { fromWireElement } from "@q9labsai/chalk-whiteboard";
|
|
913
|
-
import { useCallback as useCallback2, useEffect as
|
|
914
|
-
import { jsx as
|
|
1086
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useMemo as useMemo2, useState as useState4 } from "react";
|
|
1087
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
915
1088
|
function RecordingWhiteboardView({ state: stateValue, files, expectedSceneId, expectedRevision, theme, excalidrawCssPath, onLoadError, onPresented, className }) {
|
|
916
1089
|
const cursor = useMemo2(() => createRecordingWhiteboardCursor(stateValue), [stateValue]);
|
|
917
1090
|
const state = useMemo2(() => cursor.at(expectedRevision), [cursor, expectedRevision]);
|
|
918
1091
|
const elements = useMemo2(() => state.elements.map(fromWireElement), [state.elements]);
|
|
919
1092
|
const resolvedTheme = theme ?? "light";
|
|
920
|
-
const [ready, setReady] =
|
|
921
|
-
const [presentedState, setPresentedState] =
|
|
1093
|
+
const [ready, setReady] = useState4(null);
|
|
1094
|
+
const [presentedState, setPresentedState] = useState4(null);
|
|
922
1095
|
const handleReady = useCallback2((api) => setReady(Object.freeze({ api, defaultViewBackgroundColor: api.getAppState().viewBackgroundColor })), []);
|
|
923
1096
|
const requiredFileIds = recordingWhiteboardFileIds(state);
|
|
924
1097
|
if (expectedSceneId !== void 0 && state.sceneId !== expectedSceneId) throw new TypeError("recording whiteboard scene does not match the presentation frame");
|
|
@@ -926,7 +1099,7 @@ function RecordingWhiteboardView({ state: stateValue, files, expectedSceneId, ex
|
|
|
926
1099
|
for (const fileId of requiredFileIds) {
|
|
927
1100
|
if (!Object.hasOwn(files ?? {}, fileId)) throw new TypeError(`recording whiteboard file is missing: ${recordingWhiteboardFileAssetId(fileId)}`);
|
|
928
1101
|
}
|
|
929
|
-
|
|
1102
|
+
useEffect4(() => {
|
|
930
1103
|
if (!ready) return;
|
|
931
1104
|
setPresentedState(null);
|
|
932
1105
|
const installScene = () => {
|
|
@@ -947,16 +1120,16 @@ function RecordingWhiteboardView({ state: stateValue, files, expectedSceneId, ex
|
|
|
947
1120
|
if (presentedFrameRef !== void 0) cancelAnimationFrame(presentedFrameRef);
|
|
948
1121
|
};
|
|
949
1122
|
}, [elements, files, ready, state]);
|
|
950
|
-
|
|
1123
|
+
useEffect4(() => {
|
|
951
1124
|
if (presentedState !== state || onPresented === void 0) return;
|
|
952
1125
|
onPresented(state);
|
|
953
1126
|
}, [onPresented, presentedState, state]);
|
|
954
|
-
return /* @__PURE__ */
|
|
1127
|
+
return /* @__PURE__ */ jsx6(WhiteboardView, { canDraw: false, className: cn("h-full w-full !min-h-0 !border-0", className), excalidrawCssPath, onExcalidrawApiReady: handleReady, onLoadError, theme: resolvedTheme });
|
|
955
1128
|
}
|
|
956
1129
|
RecordingWhiteboardView.displayName = "RecordingWhiteboardView";
|
|
957
1130
|
|
|
958
1131
|
// src/components/logo/Logo.tsx
|
|
959
|
-
import { jsx as
|
|
1132
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
960
1133
|
var DEFAULT_COLOR = "currentColor";
|
|
961
1134
|
var DEFAULT_HEIGHT = 32;
|
|
962
1135
|
var DEFAULT_VARIANT = "wordmark";
|
|
@@ -967,7 +1140,7 @@ function Logo({ accessibilityLabel = "Chalk", color = DEFAULT_COLOR, height = DE
|
|
|
967
1140
|
const viewBox = isWordmark ? WORDMARK_VIEW_BOX : MARK_VIEW_BOX;
|
|
968
1141
|
const width = isWordmark ? height * 2.5 : height * (68 / 80);
|
|
969
1142
|
const accessible = accessibilityLabel !== null;
|
|
970
|
-
return /* @__PURE__ */
|
|
1143
|
+
return /* @__PURE__ */ jsxs5(
|
|
971
1144
|
"svg",
|
|
972
1145
|
{
|
|
973
1146
|
"aria-hidden": accessible ? void 0 : true,
|
|
@@ -983,22 +1156,24 @@ function Logo({ accessibilityLabel = "Chalk", color = DEFAULT_COLOR, height = DE
|
|
|
983
1156
|
xmlns: "http://www.w3.org/2000/svg",
|
|
984
1157
|
fill: "none",
|
|
985
1158
|
children: [
|
|
986
|
-
/* @__PURE__ */
|
|
987
|
-
/* @__PURE__ */
|
|
988
|
-
/* @__PURE__ */
|
|
989
|
-
/* @__PURE__ */
|
|
1159
|
+
/* @__PURE__ */ jsxs5("svg", { x: "0", y: "6", width: "68", height: "68", viewBox: "0 0 48 48", children: [
|
|
1160
|
+
/* @__PURE__ */ jsxs5("g", { transform: "rotate(28 24 24)", fill: "currentColor", children: [
|
|
1161
|
+
/* @__PURE__ */ jsx7("path", { d: "M18 8h12v28a6 6 0 0 1-12 0z" }),
|
|
1162
|
+
/* @__PURE__ */ jsx7("path", { d: "M18 8h12l-1.5 4.5h-9z", opacity: "0.45" })
|
|
990
1163
|
] }),
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
/* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */
|
|
1164
|
+
/* @__PURE__ */ jsx7("circle", { cx: "10.5", cy: "41.5", r: "1.7", fill: "currentColor", opacity: "0.55" }),
|
|
1165
|
+
/* @__PURE__ */ jsx7("circle", { cx: "6.5", cy: "37", r: "1.2", fill: "currentColor", opacity: "0.4" }),
|
|
1166
|
+
/* @__PURE__ */ jsx7("circle", { cx: "4", cy: "43.5", r: "0.85", fill: "currentColor", opacity: "0.28" })
|
|
994
1167
|
] }),
|
|
995
|
-
isWordmark ? /* @__PURE__ */
|
|
1168
|
+
isWordmark ? /* @__PURE__ */ jsx7("text", { className: "chalk-logo__wordmark", x: "90", y: "52", fontFamily: "system-ui, -apple-system, BlinkMacSystemFont, sans-serif", fontSize: "38", fontWeight: "600", letterSpacing: "-0.02em", fill: "currentColor", children: "chalk" }) : null
|
|
996
1169
|
]
|
|
997
1170
|
}
|
|
998
1171
|
);
|
|
999
1172
|
}
|
|
1000
1173
|
|
|
1001
1174
|
export {
|
|
1175
|
+
CallLimbo,
|
|
1176
|
+
StatusSurface,
|
|
1002
1177
|
Chalk,
|
|
1003
1178
|
RecordingSpaceView,
|
|
1004
1179
|
RecordingHistoryPanel,
|