@epicbagel/saas-kit 1.25.1 → 1.27.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 +50 -0
- package/dist/chunk-DHXKCMKY.cjs +198 -0
- package/dist/chunk-HO6DRDGD.js +158 -0
- package/dist/chunk-NXFZULS3.js +58 -0
- package/dist/chunk-SG4ZE2EN.js +198 -0
- package/dist/chunk-U7XNNLVP.cjs +58 -0
- package/dist/chunk-ZBWL7OUW.cjs +158 -0
- package/dist/primitives/board-view.cjs +3 -3
- package/dist/primitives/board-view.js +2 -2
- package/dist/primitives/chat-turn-navigator.cjs +16 -0
- package/dist/primitives/chat-turn-navigator.d.cts +40 -0
- package/dist/primitives/chat-turn-navigator.d.ts +40 -0
- package/dist/primitives/chat-turn-navigator.js +16 -0
- package/dist/primitives/chat.cjs +175 -20
- package/dist/primitives/chat.d.cts +78 -1
- package/dist/primitives/chat.d.ts +78 -1
- package/dist/primitives/chat.js +167 -12
- package/dist/primitives/item.cjs +24 -194
- package/dist/primitives/item.js +13 -183
- package/dist/primitives/notes.cjs +3 -3
- package/dist/primitives/notes.js +3 -3
- package/dist/primitives/person-avatar.cjs +4 -50
- package/dist/primitives/person-avatar.js +5 -51
- package/dist/primitives/resource-list.cjs +3 -3
- package/dist/primitives/resource-list.js +2 -2
- package/package.json +11 -1
- package/dist/{chunk-LQPJGZIE.js → chunk-JS6BLIWL.js} +3 -3
- package/dist/{chunk-FBVZRRA4.cjs → chunk-MOJHETNO.cjs} +2 -2
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkWABCLRBRcjs = require('./chunk-WABCLRBR.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkKWLSBTB2cjs = require('./chunk-KWLSBTB2.cjs');
|
|
10
|
+
|
|
11
|
+
// src/primitives/person-avatar.tsx
|
|
12
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
13
|
+
function initials(name) {
|
|
14
|
+
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
15
|
+
const first = words[0];
|
|
16
|
+
if (!first) return "?";
|
|
17
|
+
const last = words[words.length - 1];
|
|
18
|
+
if (words.length === 1 || !last) return first.slice(0, 2).toUpperCase();
|
|
19
|
+
return (first.charAt(0) + last.charAt(0)).toUpperCase();
|
|
20
|
+
}
|
|
21
|
+
function PersonAvatar({
|
|
22
|
+
name,
|
|
23
|
+
photoUrl,
|
|
24
|
+
size,
|
|
25
|
+
className,
|
|
26
|
+
fallbackClassName,
|
|
27
|
+
fallbackSize = "default"
|
|
28
|
+
}) {
|
|
29
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
30
|
+
_chunkWABCLRBRcjs.Avatar,
|
|
31
|
+
{
|
|
32
|
+
className: _chunkKWLSBTB2cjs.cn.call(void 0, "shrink-0 overflow-hidden rounded-full bg-muted", className),
|
|
33
|
+
style: size != null ? { width: size, height: size } : void 0,
|
|
34
|
+
children: [
|
|
35
|
+
photoUrl ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
36
|
+
_chunkWABCLRBRcjs.AvatarImage,
|
|
37
|
+
{
|
|
38
|
+
src: photoUrl,
|
|
39
|
+
alt: name,
|
|
40
|
+
className: "h-full w-full object-cover"
|
|
41
|
+
}
|
|
42
|
+
) : null,
|
|
43
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
44
|
+
_chunkWABCLRBRcjs.AvatarFallback,
|
|
45
|
+
{
|
|
46
|
+
className: _chunkKWLSBTB2cjs.cn.call(void 0, "h-full w-full font-medium", fallbackSize === "default" ? "text-xs" : "text-xl", fallbackClassName),
|
|
47
|
+
children: initials(name)
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
exports.initials = initials; exports.PersonAvatar = PersonAvatar;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } 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
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunk23IETCLVcjs = require('./chunk-23IETCLV.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunkU2NES7VRcjs = require('./chunk-U2NES7VR.cjs');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunkKWLSBTB2cjs = require('./chunk-KWLSBTB2.cjs');
|
|
15
|
+
|
|
16
|
+
// src/primitives/chat-turn-navigator.tsx
|
|
17
|
+
var _react = require('react');
|
|
18
|
+
var _reacttooltip = require('@radix-ui/react-tooltip'); var TooltipPrimitive = _interopRequireWildcard(_reacttooltip);
|
|
19
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
20
|
+
var RAIL_WIDTH = 40;
|
|
21
|
+
var RAIL_GAP = 16;
|
|
22
|
+
function activeNavigatorItem(items, order, visibleMessageIds) {
|
|
23
|
+
if (items.length === 0) return null;
|
|
24
|
+
const position = new Map(order.map((id, index) => [id, index]));
|
|
25
|
+
const firstVisible = visibleMessageIds.map((id) => position.get(id)).filter((index) => index !== void 0).sort((a, b) => a - b)[0];
|
|
26
|
+
if (firstVisible === void 0) return null;
|
|
27
|
+
let active = null;
|
|
28
|
+
for (const item of items) {
|
|
29
|
+
const index = position.get(item.messageId);
|
|
30
|
+
if (index !== void 0 && index <= firstVisible) active = item.messageId;
|
|
31
|
+
}
|
|
32
|
+
return _nullishCoalesce(active, () => ( items[0].messageId));
|
|
33
|
+
}
|
|
34
|
+
function ChatTurnNavigator({
|
|
35
|
+
items,
|
|
36
|
+
order,
|
|
37
|
+
label = "Conversation",
|
|
38
|
+
side = "start",
|
|
39
|
+
columnWidth = 768
|
|
40
|
+
}) {
|
|
41
|
+
const { scrollToMessage } = _chunk23IETCLVcjs.useMessageScroller.call(void 0, );
|
|
42
|
+
const { visibleMessageIds } = _chunk23IETCLVcjs.useMessageScrollerVisibility.call(void 0, );
|
|
43
|
+
const navRef = _react.useRef.call(void 0, null);
|
|
44
|
+
const listRef = _react.useRef.call(void 0, null);
|
|
45
|
+
const [fits, setFits] = _react.useState.call(void 0, false);
|
|
46
|
+
const [focusIndex, setFocusIndex] = _react.useState.call(void 0, 0);
|
|
47
|
+
const active = _react.useMemo.call(void 0,
|
|
48
|
+
() => activeNavigatorItem(items, order, visibleMessageIds),
|
|
49
|
+
[items, order, visibleMessageIds]
|
|
50
|
+
);
|
|
51
|
+
_react.useLayoutEffect.call(void 0, () => {
|
|
52
|
+
const root = _optionalChain([navRef, 'access', _ => _.current, 'optionalAccess', _2 => _2.parentElement]);
|
|
53
|
+
if (!root) return;
|
|
54
|
+
const measure = () => setFits((root.clientWidth - columnWidth) / 2 >= RAIL_WIDTH + RAIL_GAP * 2);
|
|
55
|
+
measure();
|
|
56
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
57
|
+
const observer = new ResizeObserver(measure);
|
|
58
|
+
observer.observe(root);
|
|
59
|
+
return () => observer.disconnect();
|
|
60
|
+
}, [columnWidth]);
|
|
61
|
+
_react.useEffect.call(void 0, () => {
|
|
62
|
+
const list = listRef.current;
|
|
63
|
+
const index = items.findIndex((item) => item.messageId === active);
|
|
64
|
+
const tick = _optionalChain([list, 'optionalAccess', _3 => _3.children, 'access', _4 => _4[index]]);
|
|
65
|
+
if (!list || !tick) return;
|
|
66
|
+
if (tick.offsetTop < list.scrollTop) list.scrollTop = tick.offsetTop;
|
|
67
|
+
else if (tick.offsetTop + tick.offsetHeight > list.scrollTop + list.clientHeight) {
|
|
68
|
+
list.scrollTop = tick.offsetTop + tick.offsetHeight - list.clientHeight;
|
|
69
|
+
}
|
|
70
|
+
if (index >= 0) setFocusIndex(index);
|
|
71
|
+
}, [active, items]);
|
|
72
|
+
if (items.length === 0) return null;
|
|
73
|
+
function jump(item) {
|
|
74
|
+
const reduced = typeof window !== "undefined" && _optionalChain([window, 'access', _5 => _5.matchMedia, 'optionalCall', _6 => _6("(prefers-reduced-motion: reduce)"), 'access', _7 => _7.matches]);
|
|
75
|
+
scrollToMessage(item.messageId, { align: "start", behavior: reduced ? "instant" : "smooth", scrollMargin: 16 });
|
|
76
|
+
}
|
|
77
|
+
function onKeyDown(event, index) {
|
|
78
|
+
const next = event.key === "ArrowDown" ? index + 1 : event.key === "ArrowUp" ? index - 1 : event.key === "Home" ? 0 : event.key === "End" ? items.length - 1 : null;
|
|
79
|
+
if (next === null) return;
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
const target = Math.max(0, Math.min(items.length - 1, next));
|
|
82
|
+
setFocusIndex(target);
|
|
83
|
+
_optionalChain([listRef, 'access', _8 => _8.current, 'optionalAccess', _9 => _9.children, 'access', _10 => _10[target], 'optionalAccess', _11 => _11.querySelector, 'call', _12 => _12("button"), 'optionalAccess', _13 => _13.focus, 'call', _14 => _14({ preventScroll: true })]);
|
|
84
|
+
}
|
|
85
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
86
|
+
"nav",
|
|
87
|
+
{
|
|
88
|
+
ref: navRef,
|
|
89
|
+
"aria-label": label,
|
|
90
|
+
hidden: !fits,
|
|
91
|
+
"data-slot": "chat-turn-navigator",
|
|
92
|
+
className: _chunkKWLSBTB2cjs.cn.call(void 0,
|
|
93
|
+
"absolute top-1/2 z-10 -translate-y-1/2",
|
|
94
|
+
side === "start" ? "left-4" : "right-5"
|
|
95
|
+
),
|
|
96
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU2NES7VRcjs.TooltipProvider, { delayDuration: 150, skipDelayDuration: 300, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
97
|
+
"ol",
|
|
98
|
+
{
|
|
99
|
+
ref: listRef,
|
|
100
|
+
className: "flex max-h-[60vh] flex-col overflow-y-auto py-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
101
|
+
children: items.map((item, index) => {
|
|
102
|
+
const current = item.messageId === active;
|
|
103
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU2NES7VRcjs.Tooltip, { children: [
|
|
104
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU2NES7VRcjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
105
|
+
"button",
|
|
106
|
+
{
|
|
107
|
+
type: "button",
|
|
108
|
+
"aria-label": item.kind ? `${item.kind}: ${item.title}` : item.title,
|
|
109
|
+
"aria-current": current ? "location" : void 0,
|
|
110
|
+
tabIndex: index === focusIndex ? 0 : -1,
|
|
111
|
+
onClick: () => jump(item),
|
|
112
|
+
onKeyDown: (event) => onKeyDown(event, index),
|
|
113
|
+
className: _chunkKWLSBTB2cjs.cn.call(void 0,
|
|
114
|
+
"group flex h-3.5 w-10 items-center rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
115
|
+
side === "start" ? "justify-start ps-1" : "justify-end pe-1"
|
|
116
|
+
),
|
|
117
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
118
|
+
"span",
|
|
119
|
+
{
|
|
120
|
+
"aria-hidden": true,
|
|
121
|
+
className: _chunkKWLSBTB2cjs.cn.call(void 0,
|
|
122
|
+
"h-0.5 rounded-full transition-[width,background-color] duration-150",
|
|
123
|
+
current ? "w-6 bg-foreground" : "w-3.5 bg-muted-foreground/45 group-hover:w-5 group-hover:bg-muted-foreground group-focus-visible:w-5"
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
) }),
|
|
129
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TooltipPrimitive.Portal, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
130
|
+
_chunkU2NES7VRcjs.TooltipContent,
|
|
131
|
+
{
|
|
132
|
+
side: side === "start" ? "right" : "left",
|
|
133
|
+
sideOffset: 10,
|
|
134
|
+
className: "flex max-w-80 flex-col gap-1 rounded-xl px-3.5 py-2.5",
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "truncate font-medium", children: [
|
|
137
|
+
item.kind ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-muted-foreground", children: [
|
|
138
|
+
item.kind,
|
|
139
|
+
" \xB7 "
|
|
140
|
+
] }) : null,
|
|
141
|
+
item.title
|
|
142
|
+
] }),
|
|
143
|
+
item.excerpt ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-clamp-3 text-xs leading-5 text-muted-foreground", children: item.excerpt }) : null
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
) })
|
|
147
|
+
] }) }, item.messageId);
|
|
148
|
+
})
|
|
149
|
+
}
|
|
150
|
+
) })
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
exports.activeNavigatorItem = activeNavigatorItem; exports.ChatTurnNavigator = ChatTurnNavigator;
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkMOJHETNOcjs = require('../chunk-MOJHETNO.cjs');
|
|
6
6
|
require('../chunk-EUFV25KL.cjs');
|
|
7
7
|
require('../chunk-7YCKII7G.cjs');
|
|
8
8
|
require('../chunk-MW67PHAQ.cjs');
|
|
9
9
|
require('../chunk-PPX2VPGI.cjs');
|
|
10
10
|
require('../chunk-WNXVGUBF.cjs');
|
|
11
11
|
require('../chunk-IQZLUT2Y.cjs');
|
|
12
|
+
require('../chunk-LELBCBDT.cjs');
|
|
12
13
|
require('../chunk-U2NES7VR.cjs');
|
|
13
14
|
require('../chunk-JH4GAGOQ.cjs');
|
|
14
|
-
require('../chunk-LELBCBDT.cjs');
|
|
15
15
|
require('../chunk-YYFVG5A6.cjs');
|
|
16
16
|
require('../chunk-XLIAY56V.cjs');
|
|
17
17
|
require('../chunk-V5SPFLKW.cjs');
|
|
@@ -57,7 +57,7 @@ function BoardView({
|
|
|
57
57
|
onSortChange
|
|
58
58
|
}) {
|
|
59
59
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
60
|
-
|
|
60
|
+
_chunkMOJHETNOcjs.ResourceList,
|
|
61
61
|
{
|
|
62
62
|
data,
|
|
63
63
|
loading,
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import {
|
|
4
4
|
ResourceList
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-JS6BLIWL.js";
|
|
6
6
|
import "../chunk-43UMPZWD.js";
|
|
7
7
|
import "../chunk-EEHIMPD7.js";
|
|
8
8
|
import "../chunk-UFFHGKI7.js";
|
|
9
9
|
import "../chunk-G76JANB4.js";
|
|
10
10
|
import "../chunk-YG7FBJRM.js";
|
|
11
11
|
import "../chunk-E2TQMDO7.js";
|
|
12
|
+
import "../chunk-H2O6NMLZ.js";
|
|
12
13
|
import "../chunk-ZRLUUZHK.js";
|
|
13
14
|
import "../chunk-OICAYRVH.js";
|
|
14
|
-
import "../chunk-H2O6NMLZ.js";
|
|
15
15
|
import "../chunk-62UTAG2C.js";
|
|
16
16
|
import "../chunk-LELFPLTE.js";
|
|
17
17
|
import "../chunk-J6NXDZR5.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkZBWL7OUWcjs = require('../chunk-ZBWL7OUW.cjs');
|
|
6
|
+
require('../chunk-23IETCLV.cjs');
|
|
7
|
+
require('../chunk-DMPSKGFM.cjs');
|
|
8
|
+
require('../chunk-Z2H4LJVG.cjs');
|
|
9
|
+
require('../chunk-U2NES7VR.cjs');
|
|
10
|
+
require('../chunk-WABCLRBR.cjs');
|
|
11
|
+
require('../chunk-JDEXZGIY.cjs');
|
|
12
|
+
require('../chunk-KWLSBTB2.cjs');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.ChatTurnNavigator = _chunkZBWL7OUWcjs.ChatTurnNavigator; exports.activeNavigatorItem = _chunkZBWL7OUWcjs.activeNavigatorItem;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/** One place in a conversation the navigator can jump to. */
|
|
4
|
+
interface ChatNavigatorItem {
|
|
5
|
+
/** The id of the thread message it jumps to. */
|
|
6
|
+
messageId: string;
|
|
7
|
+
/** Its preview's first line, and the tick's accessible name. */
|
|
8
|
+
title: string;
|
|
9
|
+
/** A few lines under the title in the preview, such as the reply. */
|
|
10
|
+
excerpt?: string;
|
|
11
|
+
/** What it is, shown before the title ("Plan", "Summary"). */
|
|
12
|
+
kind?: string;
|
|
13
|
+
}
|
|
14
|
+
interface ChatTurnNavigatorProps {
|
|
15
|
+
items: readonly ChatNavigatorItem[];
|
|
16
|
+
/** Every message id in the thread, in order: how an item in view is found. */
|
|
17
|
+
order: readonly string[];
|
|
18
|
+
/** The navigation landmark's name. */
|
|
19
|
+
label?: string;
|
|
20
|
+
/** Which gutter the rail sits in. */
|
|
21
|
+
side?: "start" | "end";
|
|
22
|
+
/** The reading column's width, so the rail only shows where it has room beside it. */
|
|
23
|
+
columnWidth?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The item a reader is on: the last one at or before the first message in
|
|
27
|
+
* view, in thread order, or the first item when none comes before it.
|
|
28
|
+
*/
|
|
29
|
+
declare function activeNavigatorItem(items: readonly ChatNavigatorItem[], order: readonly string[], visibleMessageIds: readonly string[]): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* A conversation's turns as a rail of ticks in the thread's gutter: the one
|
|
32
|
+
* in view marked, a preview of each on hover or focus, and a jump on click.
|
|
33
|
+
* Render it inside `ChatThread` (its `navigator` prop), where the thread's
|
|
34
|
+
* scroller is: jumps use the scroller's anchoring, so incoming content never
|
|
35
|
+
* snaps the reader back to the end. It shows only where the gutter beside
|
|
36
|
+
* the reading column has room for it.
|
|
37
|
+
*/
|
|
38
|
+
declare function ChatTurnNavigator({ items, order, label, side, columnWidth, }: ChatTurnNavigatorProps): react_jsx_runtime.JSX.Element | null;
|
|
39
|
+
|
|
40
|
+
export { type ChatNavigatorItem, ChatTurnNavigator, type ChatTurnNavigatorProps, activeNavigatorItem };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/** One place in a conversation the navigator can jump to. */
|
|
4
|
+
interface ChatNavigatorItem {
|
|
5
|
+
/** The id of the thread message it jumps to. */
|
|
6
|
+
messageId: string;
|
|
7
|
+
/** Its preview's first line, and the tick's accessible name. */
|
|
8
|
+
title: string;
|
|
9
|
+
/** A few lines under the title in the preview, such as the reply. */
|
|
10
|
+
excerpt?: string;
|
|
11
|
+
/** What it is, shown before the title ("Plan", "Summary"). */
|
|
12
|
+
kind?: string;
|
|
13
|
+
}
|
|
14
|
+
interface ChatTurnNavigatorProps {
|
|
15
|
+
items: readonly ChatNavigatorItem[];
|
|
16
|
+
/** Every message id in the thread, in order: how an item in view is found. */
|
|
17
|
+
order: readonly string[];
|
|
18
|
+
/** The navigation landmark's name. */
|
|
19
|
+
label?: string;
|
|
20
|
+
/** Which gutter the rail sits in. */
|
|
21
|
+
side?: "start" | "end";
|
|
22
|
+
/** The reading column's width, so the rail only shows where it has room beside it. */
|
|
23
|
+
columnWidth?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The item a reader is on: the last one at or before the first message in
|
|
27
|
+
* view, in thread order, or the first item when none comes before it.
|
|
28
|
+
*/
|
|
29
|
+
declare function activeNavigatorItem(items: readonly ChatNavigatorItem[], order: readonly string[], visibleMessageIds: readonly string[]): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* A conversation's turns as a rail of ticks in the thread's gutter: the one
|
|
32
|
+
* in view marked, a preview of each on hover or focus, and a jump on click.
|
|
33
|
+
* Render it inside `ChatThread` (its `navigator` prop), where the thread's
|
|
34
|
+
* scroller is: jumps use the scroller's anchoring, so incoming content never
|
|
35
|
+
* snaps the reader back to the end. It shows only where the gutter beside
|
|
36
|
+
* the reading column has room for it.
|
|
37
|
+
*/
|
|
38
|
+
declare function ChatTurnNavigator({ items, order, label, side, columnWidth, }: ChatTurnNavigatorProps): react_jsx_runtime.JSX.Element | null;
|
|
39
|
+
|
|
40
|
+
export { type ChatNavigatorItem, ChatTurnNavigator, type ChatTurnNavigatorProps, activeNavigatorItem };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
ChatTurnNavigator,
|
|
4
|
+
activeNavigatorItem
|
|
5
|
+
} from "../chunk-HO6DRDGD.js";
|
|
6
|
+
import "../chunk-OUZSIA5G.js";
|
|
7
|
+
import "../chunk-36LNA4WM.js";
|
|
8
|
+
import "../chunk-GA5SX7FE.js";
|
|
9
|
+
import "../chunk-ZRLUUZHK.js";
|
|
10
|
+
import "../chunk-3OWGL4Q2.js";
|
|
11
|
+
import "../chunk-W326GKML.js";
|
|
12
|
+
import "../chunk-G6SRSWXB.js";
|
|
13
|
+
export {
|
|
14
|
+
ChatTurnNavigator,
|
|
15
|
+
activeNavigatorItem
|
|
16
|
+
};
|