@epicbagel/saas-kit 1.19.0 → 1.21.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 +52 -0
- package/dist/chunk-4YJ6DGPL.cjs +1215 -0
- package/dist/chunk-C23Q4FRM.js +1215 -0
- package/dist/{chunk-TP74SBRH.cjs → chunk-E2UVQXBO.cjs} +6 -6
- package/dist/{chunk-C3VZMTVB.js → chunk-FPOJ2NGG.js} +1 -1
- package/dist/primitives/chat.cjs +23 -1051
- package/dist/primitives/chat.d.cts +9 -1
- package/dist/primitives/chat.d.ts +9 -1
- package/dist/primitives/chat.js +25 -1053
- package/dist/primitives/document-preview.cjs +5 -5
- package/dist/primitives/document-preview.js +3 -3
- package/dist/primitives/file-preview-internals.cjs +4 -4
- package/dist/primitives/file-preview-internals.js +3 -3
- package/dist/primitives/file-preview.cjs +12 -12
- package/dist/primitives/file-preview.js +3 -3
- package/dist/primitives/responsive-dialog.cjs +3 -3
- package/dist/primitives/responsive-dialog.js +2 -2
- package/dist/primitives/workflow-assistant.cjs +204 -0
- package/dist/primitives/workflow-assistant.d.cts +44 -0
- package/dist/primitives/workflow-assistant.d.ts +44 -0
- package/dist/primitives/workflow-assistant.js +204 -0
- package/package.json +11 -1
- package/dist/{chunk-BTHYGHOH.cjs → chunk-AO56ET4F.cjs} +2 -2
- package/dist/{chunk-JTI4244T.js → chunk-CRZ4INEJ.js} +10 -10
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('../chunk-
|
|
10
|
-
require('../chunk-2BHI5ZWJ.cjs');
|
|
8
|
+
var _chunkE2UVQXBOcjs = require('../chunk-E2UVQXBO.cjs');
|
|
9
|
+
require('../chunk-AO56ET4F.cjs');
|
|
11
10
|
require('../chunk-WDXEJDMO.cjs');
|
|
11
|
+
require('../chunk-2BHI5ZWJ.cjs');
|
|
12
12
|
require('../chunk-T2ZFSPE4.cjs');
|
|
13
13
|
require('../chunk-JDEXZGIY.cjs');
|
|
14
14
|
require('../chunk-KWLSBTB2.cjs');
|
|
@@ -29,7 +29,7 @@ function DocumentPreview({
|
|
|
29
29
|
fallback
|
|
30
30
|
}) {
|
|
31
31
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
32
|
-
|
|
32
|
+
_chunkE2UVQXBOcjs.PreviewDialog,
|
|
33
33
|
{
|
|
34
34
|
open,
|
|
35
35
|
onOpenChange,
|
|
@@ -37,7 +37,7 @@ function DocumentPreview({
|
|
|
37
37
|
onDownload,
|
|
38
38
|
downloading,
|
|
39
39
|
downloadLabel,
|
|
40
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
40
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2UVQXBOcjs.PreviewStage, { children: loading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2UVQXBOcjs.PreviewLoading, { label: "Loading preview\u2026" }) : error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2UVQXBOcjs.PreviewNotice, { icon: _lucidereact.FileWarning, alert: true, message: error, children: fallback }) : src ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
41
41
|
"iframe",
|
|
42
42
|
{
|
|
43
43
|
src,
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
PreviewLoading,
|
|
6
6
|
PreviewNotice,
|
|
7
7
|
PreviewStage
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-4HWCNRK4.js";
|
|
8
|
+
} from "../chunk-FPOJ2NGG.js";
|
|
9
|
+
import "../chunk-CRZ4INEJ.js";
|
|
11
10
|
import "../chunk-3QT5VYZ3.js";
|
|
11
|
+
import "../chunk-4HWCNRK4.js";
|
|
12
12
|
import "../chunk-KN4RPX35.js";
|
|
13
13
|
import "../chunk-W326GKML.js";
|
|
14
14
|
import "../chunk-G6SRSWXB.js";
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('../chunk-
|
|
10
|
-
require('../chunk-2BHI5ZWJ.cjs');
|
|
8
|
+
var _chunkE2UVQXBOcjs = require('../chunk-E2UVQXBO.cjs');
|
|
9
|
+
require('../chunk-AO56ET4F.cjs');
|
|
11
10
|
require('../chunk-WDXEJDMO.cjs');
|
|
11
|
+
require('../chunk-2BHI5ZWJ.cjs');
|
|
12
12
|
require('../chunk-T2ZFSPE4.cjs');
|
|
13
13
|
require('../chunk-JDEXZGIY.cjs');
|
|
14
14
|
require('../chunk-KWLSBTB2.cjs');
|
|
@@ -17,4 +17,4 @@ require('../chunk-KWLSBTB2.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
exports.PreviewDialog =
|
|
20
|
+
exports.PreviewDialog = _chunkE2UVQXBOcjs.PreviewDialog; exports.PreviewLoading = _chunkE2UVQXBOcjs.PreviewLoading; exports.PreviewNotice = _chunkE2UVQXBOcjs.PreviewNotice; exports.PreviewStage = _chunkE2UVQXBOcjs.PreviewStage;
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
PreviewLoading,
|
|
6
6
|
PreviewNotice,
|
|
7
7
|
PreviewStage
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-4HWCNRK4.js";
|
|
8
|
+
} from "../chunk-FPOJ2NGG.js";
|
|
9
|
+
import "../chunk-CRZ4INEJ.js";
|
|
11
10
|
import "../chunk-3QT5VYZ3.js";
|
|
11
|
+
import "../chunk-4HWCNRK4.js";
|
|
12
12
|
import "../chunk-KN4RPX35.js";
|
|
13
13
|
import "../chunk-W326GKML.js";
|
|
14
14
|
import "../chunk-G6SRSWXB.js";
|
|
@@ -8,14 +8,14 @@ var _chunk4UUTKR3Vcjs = require('../chunk-4UUTKR3V.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
require('../chunk-
|
|
13
|
-
require('../chunk-2BHI5ZWJ.cjs');
|
|
11
|
+
var _chunkE2UVQXBOcjs = require('../chunk-E2UVQXBO.cjs');
|
|
12
|
+
require('../chunk-AO56ET4F.cjs');
|
|
14
13
|
require('../chunk-WDXEJDMO.cjs');
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
var _chunkKENBU3NVcjs = require('../chunk-KENBU3NV.cjs');
|
|
18
17
|
require('../chunk-ELPV44S6.cjs');
|
|
18
|
+
require('../chunk-2BHI5ZWJ.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
var _chunkBGCNGYPLcjs = require('../chunk-BGCNGYPL.cjs');
|
|
@@ -155,7 +155,7 @@ function FilePreview({
|
|
|
155
155
|
truncatedLabel = "Showing the start of this file. Download it to see the rest."
|
|
156
156
|
}) {
|
|
157
157
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
158
|
-
|
|
158
|
+
_chunkE2UVQXBOcjs.PreviewDialog,
|
|
159
159
|
{
|
|
160
160
|
open,
|
|
161
161
|
onOpenChange,
|
|
@@ -266,17 +266,17 @@ function FilePreviewBody({
|
|
|
266
266
|
const reads = kind === "text" || kind === "markdown";
|
|
267
267
|
const text = useFileText(ready && reads ? file : null, ready && reads ? src : null);
|
|
268
268
|
const objectUrl = useObjectUrl(ready && !reads ? file : null, kind === "pdf" ? "application/pdf" : void 0);
|
|
269
|
-
const pending = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
270
|
-
const failed = (message) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
269
|
+
const pending = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2UVQXBOcjs.PreviewStage, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2UVQXBOcjs.PreviewLoading, { label: loadingLabel }) });
|
|
270
|
+
const failed = (message) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2UVQXBOcjs.PreviewStage, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2UVQXBOcjs.PreviewNotice, { icon: _lucidereact.FileWarning, alert: true, message, children: _nullishCoalesce(fallback, () => ( download)) }) });
|
|
271
271
|
if (loading) return pending;
|
|
272
272
|
if (error) return failed(error);
|
|
273
273
|
if (kind === "none" || !file && !src) {
|
|
274
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
274
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2UVQXBOcjs.PreviewStage, { children: _nullishCoalesce(fallback, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2UVQXBOcjs.PreviewNotice, { icon: _lucidereact.FileQuestion, message: unavailableLabel, children: download }))) });
|
|
275
275
|
}
|
|
276
276
|
if (reads) {
|
|
277
277
|
if (!text || text.status === "reading") return pending;
|
|
278
278
|
if (text.status === "failed") return failed(failedLabel);
|
|
279
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
279
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkE2UVQXBOcjs.PreviewStage, { layout: "scroll", label: `Preview of ${title}`, children: [
|
|
280
280
|
text.truncated && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk373W6VADcjs.Text, { variant: "caption", marginBottom: "sm", children: truncatedLabel }),
|
|
281
281
|
kind === "markdown" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKENBU3NVcjs.LazyMarkdown, { components: { a: NewTabLink, ...markdownComponents }, children: text.text }) : (
|
|
282
282
|
// The theme's relaxed leading is a fixed 1.8rem, which spaces a
|
|
@@ -300,13 +300,13 @@ function ShownFile({
|
|
|
300
300
|
const fail = () => setBroken(true);
|
|
301
301
|
const label = `Preview of ${title}`;
|
|
302
302
|
if (kind === "image") {
|
|
303
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
303
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2UVQXBOcjs.PreviewStage, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-full w-full items-center justify-center p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UUTKR3Vcjs.Image, { src: url, alt: title, fit: "contain", radius: "sm", className: "max-h-full max-w-full", onError: fail }) }) });
|
|
304
304
|
}
|
|
305
305
|
if (kind === "audio") {
|
|
306
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
306
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2UVQXBOcjs.PreviewStage, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-full max-w-md p-6", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "audio", { src: url, controls: true, preload: "metadata", "aria-label": label, className: "w-full", onError: fail }) }) });
|
|
307
307
|
}
|
|
308
308
|
if (kind === "video") {
|
|
309
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
309
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2UVQXBOcjs.PreviewStage, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-full w-full items-center justify-center p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
310
310
|
"video",
|
|
311
311
|
{
|
|
312
312
|
src: url,
|
|
@@ -319,7 +319,7 @@ function ShownFile({
|
|
|
319
319
|
}
|
|
320
320
|
) }) });
|
|
321
321
|
}
|
|
322
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
322
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2UVQXBOcjs.PreviewStage, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "iframe", { src: url, title: label, referrerPolicy: "no-referrer", className: "h-full w-full border-0 bg-background" }) });
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
PreviewLoading,
|
|
9
9
|
PreviewNotice,
|
|
10
10
|
PreviewStage
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-4HWCNRK4.js";
|
|
11
|
+
} from "../chunk-FPOJ2NGG.js";
|
|
12
|
+
import "../chunk-CRZ4INEJ.js";
|
|
14
13
|
import "../chunk-3QT5VYZ3.js";
|
|
15
14
|
import {
|
|
16
15
|
LazyMarkdown
|
|
17
16
|
} from "../chunk-VY5U4VGV.js";
|
|
18
17
|
import "../chunk-INNGGLMZ.js";
|
|
18
|
+
import "../chunk-4HWCNRK4.js";
|
|
19
19
|
import {
|
|
20
20
|
CodeBlock
|
|
21
21
|
} from "../chunk-HTPPNW74.js";
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('../chunk-2BHI5ZWJ.cjs');
|
|
12
|
+
var _chunkAO56ET4Fcjs = require('../chunk-AO56ET4F.cjs');
|
|
14
13
|
require('../chunk-WDXEJDMO.cjs');
|
|
14
|
+
require('../chunk-2BHI5ZWJ.cjs');
|
|
15
15
|
require('../chunk-KWLSBTB2.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
@@ -23,4 +23,4 @@ require('../chunk-KWLSBTB2.cjs');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
exports.ResponsiveDialog =
|
|
26
|
+
exports.ResponsiveDialog = _chunkAO56ET4Fcjs.ResponsiveDialog; exports.ResponsiveDialogBody = _chunkAO56ET4Fcjs.ResponsiveDialogBody; exports.ResponsiveDialogClose = _chunkAO56ET4Fcjs.ResponsiveDialogClose; exports.ResponsiveDialogContent = _chunkAO56ET4Fcjs.ResponsiveDialogContent; exports.ResponsiveDialogDescription = _chunkAO56ET4Fcjs.ResponsiveDialogDescription; exports.ResponsiveDialogFooter = _chunkAO56ET4Fcjs.ResponsiveDialogFooter; exports.ResponsiveDialogHeader = _chunkAO56ET4Fcjs.ResponsiveDialogHeader; exports.ResponsiveDialogTitle = _chunkAO56ET4Fcjs.ResponsiveDialogTitle; exports.ResponsiveDialogTrigger = _chunkAO56ET4Fcjs.ResponsiveDialogTrigger;
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
ResponsiveDialogHeader,
|
|
10
10
|
ResponsiveDialogTitle,
|
|
11
11
|
ResponsiveDialogTrigger
|
|
12
|
-
} from "../chunk-
|
|
13
|
-
import "../chunk-4HWCNRK4.js";
|
|
12
|
+
} from "../chunk-CRZ4INEJ.js";
|
|
14
13
|
import "../chunk-3QT5VYZ3.js";
|
|
14
|
+
import "../chunk-4HWCNRK4.js";
|
|
15
15
|
import "../chunk-G6SRSWXB.js";
|
|
16
16
|
export {
|
|
17
17
|
ResponsiveDialog,
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk4YJ6DGPLcjs = require('../chunk-4YJ6DGPL.cjs');
|
|
7
|
+
require('../chunk-2BTDBZYN.cjs');
|
|
8
|
+
require('../chunk-PH2TV7XI.cjs');
|
|
9
|
+
require('../chunk-YMI3X2YL.cjs');
|
|
10
|
+
require('../chunk-M4V7OJNF.cjs');
|
|
11
|
+
require('../chunk-B765DSRG.cjs');
|
|
12
|
+
require('../chunk-23IETCLV.cjs');
|
|
13
|
+
require('../chunk-DMPSKGFM.cjs');
|
|
14
|
+
require('../chunk-NWDPH2Z7.cjs');
|
|
15
|
+
require('../chunk-Z2H4LJVG.cjs');
|
|
16
|
+
require('../chunk-7LDJAXRX.cjs');
|
|
17
|
+
require('../chunk-2HV2KKOE.cjs');
|
|
18
|
+
require('../chunk-ZLEM2SAU.cjs');
|
|
19
|
+
require('../chunk-KENBU3NV.cjs');
|
|
20
|
+
require('../chunk-ELPV44S6.cjs');
|
|
21
|
+
require('../chunk-2BHI5ZWJ.cjs');
|
|
22
|
+
require('../chunk-ZAITUDYD.cjs');
|
|
23
|
+
require('../chunk-U2NES7VR.cjs');
|
|
24
|
+
require('../chunk-V4YWTRLD.cjs');
|
|
25
|
+
require('../chunk-373W6VAD.cjs');
|
|
26
|
+
require('../chunk-W5HPHEE7.cjs');
|
|
27
|
+
require('../chunk-FYRQFEU4.cjs');
|
|
28
|
+
require('../chunk-2KFZQJH5.cjs');
|
|
29
|
+
require('../chunk-PQUSJEXL.cjs');
|
|
30
|
+
require('../chunk-WABCLRBR.cjs');
|
|
31
|
+
require('../chunk-NKWHDI4C.cjs');
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
var _chunkJDEXZGIYcjs = require('../chunk-JDEXZGIY.cjs');
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
var _chunkKWLSBTB2cjs = require('../chunk-KWLSBTB2.cjs');
|
|
38
|
+
require('../chunk-2BSFYU22.cjs');
|
|
39
|
+
require('../chunk-4LXN6GLZ.cjs');
|
|
40
|
+
require('../chunk-7Q4EFCUI.cjs');
|
|
41
|
+
require('../chunk-R35FT53G.cjs');
|
|
42
|
+
require('../chunk-H2UFRLLN.cjs');
|
|
43
|
+
|
|
44
|
+
// src/primitives/workflow-assistant.tsx
|
|
45
|
+
var _react = require('react');
|
|
46
|
+
var _lucidereact = require('lucide-react');
|
|
47
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
48
|
+
var SESSION_LABELS = {
|
|
49
|
+
disconnected: "Voice chat",
|
|
50
|
+
connecting: "Connecting\u2026",
|
|
51
|
+
listening: "Listening\u2026",
|
|
52
|
+
thinking: "Thinking\u2026",
|
|
53
|
+
speaking: "Speaking",
|
|
54
|
+
reconnecting: "Reconnecting\u2026",
|
|
55
|
+
error: "Voice chat unavailable"
|
|
56
|
+
};
|
|
57
|
+
var WorkflowAssistant = _react.forwardRef.call(void 0, function WorkflowAssistant2({
|
|
58
|
+
open,
|
|
59
|
+
onOpenChange,
|
|
60
|
+
expanded = false,
|
|
61
|
+
onExpandedChange,
|
|
62
|
+
title = "Voice review",
|
|
63
|
+
context,
|
|
64
|
+
description,
|
|
65
|
+
messages,
|
|
66
|
+
value,
|
|
67
|
+
onChange,
|
|
68
|
+
onSend,
|
|
69
|
+
voiceSession,
|
|
70
|
+
pending,
|
|
71
|
+
disabled,
|
|
72
|
+
error,
|
|
73
|
+
placeholder = "Describe an action\u2026",
|
|
74
|
+
besideCornerAction = false,
|
|
75
|
+
labels,
|
|
76
|
+
className
|
|
77
|
+
}, ref) {
|
|
78
|
+
const titleId = _react.useId.call(void 0, );
|
|
79
|
+
const statusId = _react.useId.call(void 0, );
|
|
80
|
+
const launcher = _react.useRef.call(void 0, null);
|
|
81
|
+
const heading = _react.useRef.call(void 0, null);
|
|
82
|
+
const moveFocus = _react.useRef.call(void 0, false);
|
|
83
|
+
_react.useEffect.call(void 0, () => {
|
|
84
|
+
if (!moveFocus.current) return;
|
|
85
|
+
moveFocus.current = false;
|
|
86
|
+
_optionalChain([(open ? heading.current : launcher.current), 'optionalAccess', _ => _.focus, 'call', _2 => _2()]);
|
|
87
|
+
}, [open]);
|
|
88
|
+
const toggle = (next) => {
|
|
89
|
+
moveFocus.current = true;
|
|
90
|
+
onOpenChange(next);
|
|
91
|
+
};
|
|
92
|
+
const startDisabled = pending || disabled || _optionalChain([voiceSession, 'optionalAccess', _3 => _3.disabled]);
|
|
93
|
+
const active = voiceSession && voiceSession.state !== "disconnected" && voiceSession.state !== "error";
|
|
94
|
+
const status = voiceSession && (voiceSession.muted && voiceSession.state === "listening" ? _nullishCoalesce(_optionalChain([voiceSession, 'access', _4 => _4.labels, 'optionalAccess', _5 => _5.muted]), () => ( "Microphone muted")) : _nullishCoalesce(_optionalChain([voiceSession, 'access', _6 => _6.labels, 'optionalAccess', _7 => _7[voiceSession.state]]), () => ( SESSION_LABELS[voiceSession.state])));
|
|
95
|
+
if (!open) return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
96
|
+
"aside",
|
|
97
|
+
{
|
|
98
|
+
ref,
|
|
99
|
+
"data-slot": "workflow-assistant-launcher",
|
|
100
|
+
"aria-label": title,
|
|
101
|
+
className: _chunkKWLSBTB2cjs.cn.call(void 0, "fixed bottom-[calc(1.5rem+env(safe-area-inset-bottom))] z-40 flex max-w-[calc(100vw-9rem)] items-center gap-1", besideCornerAction ? "right-32 md:right-36" : "right-6 md:right-8", className),
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
104
|
+
_chunkJDEXZGIYcjs.Button,
|
|
105
|
+
{
|
|
106
|
+
ref: launcher,
|
|
107
|
+
type: "button",
|
|
108
|
+
shape: "pill",
|
|
109
|
+
className: "min-h-12 min-w-12 max-w-full gap-2 shadow-lg",
|
|
110
|
+
disabled: startDisabled && !active,
|
|
111
|
+
"aria-label": active ? title : _nullishCoalesce(_optionalChain([labels, 'optionalAccess', _8 => _8.start]), () => ( "Start voice review")),
|
|
112
|
+
"aria-expanded": false,
|
|
113
|
+
"aria-describedby": active ? statusId : void 0,
|
|
114
|
+
onClick: () => {
|
|
115
|
+
toggle(true);
|
|
116
|
+
if (!active && !startDisabled) _optionalChain([voiceSession, 'optionalAccess', _9 => _9.onStart, 'call', _10 => _10()]);
|
|
117
|
+
},
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AudioLines, { "aria-hidden": "true", className: "shrink-0" }),
|
|
120
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { id: statusId, role: active ? "status" : void 0, className: "truncate", children: active ? status : title })
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
active && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
125
|
+
_chunkJDEXZGIYcjs.Button,
|
|
126
|
+
{
|
|
127
|
+
type: "button",
|
|
128
|
+
variant: "outline",
|
|
129
|
+
shape: "circle",
|
|
130
|
+
size: "icon",
|
|
131
|
+
className: "min-h-12 min-w-12 bg-background shadow-lg",
|
|
132
|
+
onClick: () => {
|
|
133
|
+
_optionalChain([launcher, 'access', _11 => _11.current, 'optionalAccess', _12 => _12.focus, 'call', _13 => _13()]);
|
|
134
|
+
voiceSession.onEnd();
|
|
135
|
+
},
|
|
136
|
+
"aria-label": _nullishCoalesce(_nullishCoalesce(_optionalChain([labels, 'optionalAccess', _14 => _14.end]), () => ( _optionalChain([voiceSession, 'access', _15 => _15.labels, 'optionalAccess', _16 => _16.end]))), () => ( "End voice chat")),
|
|
137
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Square, { "aria-hidden": "true" })
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
144
|
+
"aside",
|
|
145
|
+
{
|
|
146
|
+
ref,
|
|
147
|
+
"data-slot": "workflow-assistant",
|
|
148
|
+
"aria-labelledby": titleId,
|
|
149
|
+
className: _chunkKWLSBTB2cjs.cn.call(void 0,
|
|
150
|
+
"fixed inset-x-2 bottom-[calc(1rem+env(safe-area-inset-bottom))] z-40 flex min-h-0 flex-col overflow-y-auto overscroll-contain rounded-2xl border bg-background shadow-xl sm:inset-x-auto sm:right-6 sm:w-[28rem] md:right-8",
|
|
151
|
+
expanded ? "h-[calc(100dvh-6rem)]" : "max-h-[min(36rem,70dvh)]",
|
|
152
|
+
className
|
|
153
|
+
),
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "sticky top-0 z-10 flex shrink-0 items-start gap-2 border-b bg-background p-3", children: [
|
|
156
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "min-w-0 flex-1", children: [
|
|
157
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { ref: heading, tabIndex: -1, id: titleId, className: "text-sm font-semibold", children: title }),
|
|
158
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { title: context, className: "mt-1 truncate text-xs text-muted-foreground", children: context })
|
|
159
|
+
] }),
|
|
160
|
+
onExpandedChange && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
161
|
+
_chunkJDEXZGIYcjs.Button,
|
|
162
|
+
{
|
|
163
|
+
type: "button",
|
|
164
|
+
variant: "ghost",
|
|
165
|
+
size: "icon",
|
|
166
|
+
"aria-label": expanded ? _nullishCoalesce(_optionalChain([labels, 'optionalAccess', _17 => _17.collapse]), () => ( "Reduce panel")) : _nullishCoalesce(_optionalChain([labels, 'optionalAccess', _18 => _18.expand]), () => ( "Expand panel")),
|
|
167
|
+
onClick: () => onExpandedChange(!expanded),
|
|
168
|
+
children: expanded ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Minimize2, { "aria-hidden": "true" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Maximize2, { "aria-hidden": "true" })
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJDEXZGIYcjs.Button, { type: "button", variant: "ghost", size: "icon", "aria-label": _nullishCoalesce(_optionalChain([labels, 'optionalAccess', _19 => _19.minimize]), () => ( "Minimize voice review")), onClick: () => toggle(false), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronDown, { "aria-hidden": "true" }) })
|
|
172
|
+
] }),
|
|
173
|
+
description && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "shrink-0 px-4 py-2 text-xs text-muted-foreground", children: description }),
|
|
174
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
175
|
+
_chunk4YJ6DGPLcjs.ChatThread,
|
|
176
|
+
{
|
|
177
|
+
messages,
|
|
178
|
+
pending,
|
|
179
|
+
maxHeight: expanded ? "60dvh" : "32dvh",
|
|
180
|
+
className: _chunkKWLSBTB2cjs.cn.call(void 0, "flex-1 px-3", messages.length > 0 || pending ? "min-h-24" : "min-h-0")
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { role: "alert", className: "shrink-0 px-4 py-2 text-sm text-destructive", children: error }),
|
|
184
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "shrink-0 p-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
185
|
+
_chunk4YJ6DGPLcjs.ChatInput,
|
|
186
|
+
{
|
|
187
|
+
value,
|
|
188
|
+
onChange,
|
|
189
|
+
onSend,
|
|
190
|
+
disabled,
|
|
191
|
+
pending,
|
|
192
|
+
placeholder,
|
|
193
|
+
size: "sm",
|
|
194
|
+
voice: false,
|
|
195
|
+
voiceSession
|
|
196
|
+
}
|
|
197
|
+
) })
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
exports.WorkflowAssistant = WorkflowAssistant;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { ChatMessage } from './chat.cjs';
|
|
4
|
+
import { VoiceSessionControlsProps } from './voice-session-controls.cjs';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import './markdown.cjs';
|
|
7
|
+
import 'react-markdown';
|
|
8
|
+
import './rich-text.cjs';
|
|
9
|
+
|
|
10
|
+
interface WorkflowAssistantProps {
|
|
11
|
+
open: boolean;
|
|
12
|
+
onOpenChange: (open: boolean) => void;
|
|
13
|
+
expanded?: boolean;
|
|
14
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
15
|
+
title?: string;
|
|
16
|
+
/** Current host-owned scope. Keep it visible while the transcript scrolls. */
|
|
17
|
+
context: string;
|
|
18
|
+
description?: ReactNode;
|
|
19
|
+
messages: ChatMessage[];
|
|
20
|
+
value: string;
|
|
21
|
+
onChange: (value: string) => void;
|
|
22
|
+
onSend: (value: string) => void;
|
|
23
|
+
/** Minimizing preserves this host-owned session; only End calls onEnd. */
|
|
24
|
+
voiceSession?: VoiceSessionControlsProps;
|
|
25
|
+
pending?: boolean;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
error?: string | null;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
/** Leave room for an existing corner action such as New. */
|
|
30
|
+
besideCornerAction?: boolean;
|
|
31
|
+
labels?: {
|
|
32
|
+
start?: string;
|
|
33
|
+
minimize?: string;
|
|
34
|
+
expand?: string;
|
|
35
|
+
collapse?: string;
|
|
36
|
+
end?: string;
|
|
37
|
+
};
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
/** A non-modal workflow conversation: the underlying list stays usable.
|
|
41
|
+
* The host owns scope, authorization, persistence and the voice connection. */
|
|
42
|
+
declare const WorkflowAssistant: React.ForwardRefExoticComponent<WorkflowAssistantProps & React.RefAttributes<HTMLElement>>;
|
|
43
|
+
|
|
44
|
+
export { WorkflowAssistant, type WorkflowAssistantProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { ChatMessage } from './chat.js';
|
|
4
|
+
import { VoiceSessionControlsProps } from './voice-session-controls.js';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import './markdown.js';
|
|
7
|
+
import 'react-markdown';
|
|
8
|
+
import './rich-text.js';
|
|
9
|
+
|
|
10
|
+
interface WorkflowAssistantProps {
|
|
11
|
+
open: boolean;
|
|
12
|
+
onOpenChange: (open: boolean) => void;
|
|
13
|
+
expanded?: boolean;
|
|
14
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
15
|
+
title?: string;
|
|
16
|
+
/** Current host-owned scope. Keep it visible while the transcript scrolls. */
|
|
17
|
+
context: string;
|
|
18
|
+
description?: ReactNode;
|
|
19
|
+
messages: ChatMessage[];
|
|
20
|
+
value: string;
|
|
21
|
+
onChange: (value: string) => void;
|
|
22
|
+
onSend: (value: string) => void;
|
|
23
|
+
/** Minimizing preserves this host-owned session; only End calls onEnd. */
|
|
24
|
+
voiceSession?: VoiceSessionControlsProps;
|
|
25
|
+
pending?: boolean;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
error?: string | null;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
/** Leave room for an existing corner action such as New. */
|
|
30
|
+
besideCornerAction?: boolean;
|
|
31
|
+
labels?: {
|
|
32
|
+
start?: string;
|
|
33
|
+
minimize?: string;
|
|
34
|
+
expand?: string;
|
|
35
|
+
collapse?: string;
|
|
36
|
+
end?: string;
|
|
37
|
+
};
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
/** A non-modal workflow conversation: the underlying list stays usable.
|
|
41
|
+
* The host owns scope, authorization, persistence and the voice connection. */
|
|
42
|
+
declare const WorkflowAssistant: React.ForwardRefExoticComponent<WorkflowAssistantProps & React.RefAttributes<HTMLElement>>;
|
|
43
|
+
|
|
44
|
+
export { WorkflowAssistant, type WorkflowAssistantProps };
|