@epicbagel/saas-kit 1.12.0 → 1.14.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 +41 -0
- package/THIRD_PARTY_NOTICES.md +20 -0
- package/dist/chunk-34AS3OCC.cjs +256 -0
- package/dist/chunk-KI7SWNIN.js +53 -0
- package/dist/{chunk-5VMKDVB6.cjs → chunk-PD5UQEKY.cjs} +21 -2
- package/dist/chunk-SJB4DPGQ.cjs +51 -0
- package/dist/chunk-SRIGG5I5.js +51 -0
- package/dist/{chunk-2V7AVB2U.js → chunk-UBTLWSKK.js} +19 -0
- package/dist/chunk-VKYRB37O.cjs +53 -0
- package/dist/chunk-VT2WDFSU.js +256 -0
- package/dist/primitives/chat.cjs +15 -13
- package/dist/primitives/chat.js +6 -4
- package/dist/primitives/message-scroller.cjs +6 -2
- package/dist/primitives/message-scroller.d.cts +5 -1
- package/dist/primitives/message-scroller.d.ts +5 -1
- package/dist/primitives/message-scroller.js +5 -1
- package/dist/primitives/notes.cjs +259 -0
- package/dist/primitives/notes.d.cts +123 -0
- package/dist/primitives/notes.d.ts +123 -0
- package/dist/primitives/notes.js +259 -0
- package/dist/primitives/panel-section.cjs +4 -48
- package/dist/primitives/panel-section.js +3 -47
- package/dist/primitives/scroll-navigator.cjs +10 -0
- package/dist/primitives/scroll-navigator.d.cts +40 -0
- package/dist/primitives/scroll-navigator.d.ts +40 -0
- package/dist/primitives/scroll-navigator.js +10 -0
- package/dist/primitives/section-header.cjs +4 -45
- package/dist/primitives/section-header.js +4 -45
- package/package.json +21 -1
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Avatar,
|
|
4
|
+
AvatarFallback,
|
|
5
|
+
AvatarImage
|
|
6
|
+
} from "./chunk-3OWGL4Q2.js";
|
|
7
|
+
import {
|
|
8
|
+
cn
|
|
9
|
+
} from "./chunk-G6SRSWXB.js";
|
|
10
|
+
|
|
11
|
+
// src/primitives/scroll-navigator.tsx
|
|
12
|
+
import { forwardRef, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
13
|
+
import { createPortal } from "react-dom";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var GAP = 12;
|
|
16
|
+
var RAIL_WIDTH = 56;
|
|
17
|
+
var ROW_HEIGHT = 64;
|
|
18
|
+
var initialPlacement = { mode: "row", top: 0, left: 0, width: 0, maxHeight: 0, active: 0, visible: false };
|
|
19
|
+
function findScrollRoot(element) {
|
|
20
|
+
for (let parent = element.parentElement; parent; parent = parent.parentElement) {
|
|
21
|
+
if (/(auto|scroll|overlay)/.test(getComputedStyle(parent).overflowY) && parent.scrollHeight > parent.clientHeight) return parent;
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
function viewportBounds(root) {
|
|
26
|
+
const viewport = window.visualViewport;
|
|
27
|
+
const top = viewport?.offsetTop ?? 0;
|
|
28
|
+
const left = viewport?.offsetLeft ?? 0;
|
|
29
|
+
const bounds = { top, left, right: left + (viewport?.width ?? innerWidth), bottom: top + (viewport?.height ?? innerHeight) };
|
|
30
|
+
for (let parent = root; parent; parent = parent.parentElement) {
|
|
31
|
+
const style = getComputedStyle(parent);
|
|
32
|
+
if (parent !== root && !/(auto|scroll|hidden|clip)/.test(`${style.overflowX} ${style.overflowY}`)) continue;
|
|
33
|
+
const rect = parent.getBoundingClientRect();
|
|
34
|
+
bounds.top = Math.max(bounds.top, rect.top + parent.clientTop);
|
|
35
|
+
bounds.left = Math.max(bounds.left, rect.left + parent.clientLeft);
|
|
36
|
+
bounds.right = Math.min(bounds.right, rect.left + parent.clientLeft + parent.clientWidth);
|
|
37
|
+
bounds.bottom = Math.min(bounds.bottom, rect.top + parent.clientTop + parent.clientHeight);
|
|
38
|
+
}
|
|
39
|
+
return bounds;
|
|
40
|
+
}
|
|
41
|
+
var ScrollNavigator = forwardRef(function ScrollNavigator2({
|
|
42
|
+
items,
|
|
43
|
+
label = "Browse items",
|
|
44
|
+
topOffset = 0,
|
|
45
|
+
scrollRoot,
|
|
46
|
+
onNavigate,
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}, forwardedRef) {
|
|
50
|
+
const rootRef = useRef(null);
|
|
51
|
+
const targets = useRef(/* @__PURE__ */ new Map());
|
|
52
|
+
const controls = useRef(/* @__PURE__ */ new Map());
|
|
53
|
+
const indexRef = useRef(null);
|
|
54
|
+
const scroller = useRef(null);
|
|
55
|
+
const [placement, setPlacement] = useState(initialPlacement);
|
|
56
|
+
const [focusId, setFocusId] = useState(null);
|
|
57
|
+
const id = useId();
|
|
58
|
+
const keys = JSON.stringify(items.map((item) => item.id));
|
|
59
|
+
const navigable = items.length > 1;
|
|
60
|
+
useLayoutEffect(() => {
|
|
61
|
+
const element = rootRef.current;
|
|
62
|
+
if (!element || !navigable) return;
|
|
63
|
+
let frame = 0;
|
|
64
|
+
let intersects = true;
|
|
65
|
+
const measure = () => {
|
|
66
|
+
frame = 0;
|
|
67
|
+
if (!intersects) {
|
|
68
|
+
setPlacement((previous) => previous.visible ? { ...previous, visible: false } : previous);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const scrollElement = scrollRoot === void 0 ? findScrollRoot(element) : scrollRoot;
|
|
72
|
+
scroller.current = scrollElement;
|
|
73
|
+
const view = viewportBounds(scrollElement);
|
|
74
|
+
const box = element.getBoundingClientRect();
|
|
75
|
+
const mode = box.left - view.left >= RAIL_WIDTH + GAP ? "rail" : "row";
|
|
76
|
+
const top = Math.max(view.top + topOffset + GAP, box.top);
|
|
77
|
+
const bottom = Math.min(view.bottom, box.bottom) - GAP;
|
|
78
|
+
const visible = box.width > 0 && box.right > view.left && box.left < view.right && bottom - top >= ROW_HEIGHT;
|
|
79
|
+
const readingEdge = view.top + topOffset + GAP + (mode === "row" ? ROW_HEIGHT : 0);
|
|
80
|
+
const active = visible ? Math.max(0, items.findIndex((item) => (targets.current.get(item.id)?.getBoundingClientRect().bottom ?? 0) > readingEdge + 1)) : 0;
|
|
81
|
+
const next = {
|
|
82
|
+
mode,
|
|
83
|
+
top,
|
|
84
|
+
left: mode === "rail" ? box.left - RAIL_WIDTH - GAP : Math.max(box.left, view.left),
|
|
85
|
+
width: mode === "rail" ? RAIL_WIDTH : Math.max(0, Math.min(box.right, view.right) - Math.max(box.left, view.left)),
|
|
86
|
+
maxHeight: Math.max(0, bottom - top),
|
|
87
|
+
active,
|
|
88
|
+
visible
|
|
89
|
+
};
|
|
90
|
+
setPlacement((previous) => Object.keys(next).every((key) => previous[key] === next[key]) ? previous : next);
|
|
91
|
+
};
|
|
92
|
+
const schedule = () => {
|
|
93
|
+
if (!frame) frame = requestAnimationFrame(measure);
|
|
94
|
+
};
|
|
95
|
+
const visibility = typeof IntersectionObserver === "undefined" ? null : new IntersectionObserver((entries) => {
|
|
96
|
+
intersects = entries[entries.length - 1]?.isIntersecting ?? intersects;
|
|
97
|
+
schedule();
|
|
98
|
+
});
|
|
99
|
+
visibility?.observe(element);
|
|
100
|
+
const resize = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(schedule);
|
|
101
|
+
for (let parent = element; parent; parent = parent.parentElement) {
|
|
102
|
+
resize?.observe(parent);
|
|
103
|
+
}
|
|
104
|
+
targets.current.forEach((target) => resize?.observe(target));
|
|
105
|
+
document.addEventListener("scroll", schedule, { passive: true, capture: true });
|
|
106
|
+
window.addEventListener("resize", schedule);
|
|
107
|
+
window.visualViewport?.addEventListener("resize", schedule);
|
|
108
|
+
window.visualViewport?.addEventListener("scroll", schedule);
|
|
109
|
+
measure();
|
|
110
|
+
return () => {
|
|
111
|
+
cancelAnimationFrame(frame);
|
|
112
|
+
resize?.disconnect();
|
|
113
|
+
visibility?.disconnect();
|
|
114
|
+
document.removeEventListener("scroll", schedule, true);
|
|
115
|
+
window.removeEventListener("resize", schedule);
|
|
116
|
+
window.visualViewport?.removeEventListener("resize", schedule);
|
|
117
|
+
window.visualViewport?.removeEventListener("scroll", schedule);
|
|
118
|
+
};
|
|
119
|
+
}, [keys, navigable, topOffset, scrollRoot]);
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
const index = indexRef.current;
|
|
122
|
+
const button = controls.current.get(focusId ?? items[placement.active]?.id ?? "");
|
|
123
|
+
if (!index || !button || !placement.visible) return;
|
|
124
|
+
const horizontal = placement.mode === "row";
|
|
125
|
+
const start = horizontal ? button.offsetLeft : button.offsetTop;
|
|
126
|
+
const end = start + (horizontal ? button.offsetWidth : button.offsetHeight);
|
|
127
|
+
const position = horizontal ? index.scrollLeft : index.scrollTop;
|
|
128
|
+
const size = horizontal ? index.clientWidth : index.clientHeight;
|
|
129
|
+
const next = start < position ? start : end > position + size ? end - size : position;
|
|
130
|
+
if (horizontal) index.scrollLeft = next;
|
|
131
|
+
else index.scrollTop = next;
|
|
132
|
+
}, [placement.active, placement.mode, placement.visible, focusId, keys]);
|
|
133
|
+
function navigate(item) {
|
|
134
|
+
const target = targets.current.get(item.id);
|
|
135
|
+
if (!target) return;
|
|
136
|
+
const options = {
|
|
137
|
+
offset: topOffset + GAP + (placement.mode === "row" ? ROW_HEIGHT : 0),
|
|
138
|
+
behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "instant" : "smooth"
|
|
139
|
+
};
|
|
140
|
+
if (onNavigate?.(item.id, target, options) === true) return;
|
|
141
|
+
const scrollElement = scroller.current;
|
|
142
|
+
const view = viewportBounds(scrollElement);
|
|
143
|
+
const top = (scrollElement?.scrollTop ?? window.scrollY) + target.getBoundingClientRect().top - view.top - options.offset;
|
|
144
|
+
if (scrollElement) scrollElement.scrollTo({ top, behavior: options.behavior });
|
|
145
|
+
else window.scrollTo({ top, behavior: options.behavior });
|
|
146
|
+
}
|
|
147
|
+
const activeId = items[placement.active]?.id;
|
|
148
|
+
const tabId = focusId && items.some((item) => item.id === focusId) ? focusId : activeId;
|
|
149
|
+
const row = placement.mode === "row";
|
|
150
|
+
return /* @__PURE__ */ jsxs(
|
|
151
|
+
"div",
|
|
152
|
+
{
|
|
153
|
+
...props,
|
|
154
|
+
"data-slot": "scroll-navigator",
|
|
155
|
+
"data-orientation": row ? "horizontal" : "vertical",
|
|
156
|
+
ref: (element) => {
|
|
157
|
+
rootRef.current = element;
|
|
158
|
+
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
159
|
+
else if (forwardedRef) forwardedRef.current = element;
|
|
160
|
+
},
|
|
161
|
+
className: cn("relative min-w-0", navigable && row && "pt-16", className),
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-col gap-4", children: items.map((item, index) => /* @__PURE__ */ jsx(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
id: `${id}-${index}`,
|
|
167
|
+
"data-slot": "scroll-navigator-item",
|
|
168
|
+
"data-item-id": item.id,
|
|
169
|
+
ref: (element) => {
|
|
170
|
+
if (element) targets.current.set(item.id, element);
|
|
171
|
+
else targets.current.delete(item.id);
|
|
172
|
+
},
|
|
173
|
+
className: "min-w-0",
|
|
174
|
+
children: item.content
|
|
175
|
+
},
|
|
176
|
+
item.id
|
|
177
|
+
)) }),
|
|
178
|
+
navigable && placement.visible && createPortal(
|
|
179
|
+
/* @__PURE__ */ jsxs(
|
|
180
|
+
"nav",
|
|
181
|
+
{
|
|
182
|
+
"aria-label": label,
|
|
183
|
+
"data-slot": "scroll-navigator-controls",
|
|
184
|
+
"data-orientation": row ? "horizontal" : "vertical",
|
|
185
|
+
className: cn("fixed z-20 flex rounded-full border border-border/60 bg-background/95 p-1 shadow-sm backdrop-blur-sm", row ? "items-center gap-1" : "flex-col items-center gap-1"),
|
|
186
|
+
style: { top: placement.top, left: placement.left, width: placement.width, maxHeight: placement.maxHeight },
|
|
187
|
+
onBlur: (event) => {
|
|
188
|
+
if (!event.currentTarget.contains(event.relatedTarget)) setFocusId(null);
|
|
189
|
+
},
|
|
190
|
+
children: [
|
|
191
|
+
/* @__PURE__ */ jsx(
|
|
192
|
+
"div",
|
|
193
|
+
{
|
|
194
|
+
ref: indexRef,
|
|
195
|
+
"data-slot": "scroll-navigator-index",
|
|
196
|
+
className: cn("relative flex min-h-0 min-w-0 gap-1 overscroll-contain p-0.5 scrollbar-none", row ? "flex-1 overflow-x-auto" : "flex-col overflow-y-auto"),
|
|
197
|
+
onKeyDown: (event) => {
|
|
198
|
+
const current = items.findIndex((item) => controls.current.get(item.id) === document.activeElement);
|
|
199
|
+
let next = current;
|
|
200
|
+
if (event.key === "Home") next = 0;
|
|
201
|
+
else if (event.key === "End") next = items.length - 1;
|
|
202
|
+
else if (event.key === (row ? "ArrowRight" : "ArrowDown")) next = Math.min(items.length - 1, current + 1);
|
|
203
|
+
else if (event.key === (row ? "ArrowLeft" : "ArrowUp")) next = Math.max(0, current - 1);
|
|
204
|
+
else return;
|
|
205
|
+
event.preventDefault();
|
|
206
|
+
const button = controls.current.get(items[next].id);
|
|
207
|
+
button?.focus({ preventScroll: true });
|
|
208
|
+
const index = indexRef.current;
|
|
209
|
+
if (index && button) {
|
|
210
|
+
if (row) index.scrollLeft = button.offsetLeft - (index.clientWidth - button.offsetWidth) / 2;
|
|
211
|
+
else index.scrollTop = button.offsetTop - (index.clientHeight - button.offsetHeight) / 2;
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
children: items.map((item, index) => /* @__PURE__ */ jsx(
|
|
215
|
+
"button",
|
|
216
|
+
{
|
|
217
|
+
type: "button",
|
|
218
|
+
ref: (element) => {
|
|
219
|
+
if (element) controls.current.set(item.id, element);
|
|
220
|
+
else controls.current.delete(item.id);
|
|
221
|
+
},
|
|
222
|
+
"aria-label": `${item.label}, ${index + 1} / ${items.length}`,
|
|
223
|
+
title: item.label,
|
|
224
|
+
"aria-controls": `${id}-${index}`,
|
|
225
|
+
"aria-current": item.id === activeId ? "location" : void 0,
|
|
226
|
+
tabIndex: item.id === tabId ? 0 : -1,
|
|
227
|
+
onFocus: () => setFocusId(item.id),
|
|
228
|
+
onClick: () => navigate(item),
|
|
229
|
+
className: cn("flex size-11 shrink-0 items-center justify-center rounded-full border-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", item.id === activeId ? "border-primary bg-primary/10" : "border-transparent opacity-60 hover:bg-muted hover:opacity-100 focus-visible:opacity-100"),
|
|
230
|
+
children: /* @__PURE__ */ jsxs(Avatar, { size: "xs", "aria-hidden": "true", children: [
|
|
231
|
+
item.imageSrc ? /* @__PURE__ */ jsx(AvatarImage, { src: item.imageSrc, alt: "" }) : null,
|
|
232
|
+
/* @__PURE__ */ jsx(AvatarFallback, { textSize: "micro", children: item.fallback ?? item.label.trim().split(/\s+/).map((word) => word[0]).slice(0, 2).join("") })
|
|
233
|
+
] })
|
|
234
|
+
},
|
|
235
|
+
item.id
|
|
236
|
+
))
|
|
237
|
+
}
|
|
238
|
+
),
|
|
239
|
+
/* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: cn("shrink-0 text-center text-[10px] tabular-nums text-muted-foreground", row ? "px-2" : "pb-1"), children: [
|
|
240
|
+
placement.active + 1,
|
|
241
|
+
" / ",
|
|
242
|
+
items.length
|
|
243
|
+
] })
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
),
|
|
247
|
+
document.body
|
|
248
|
+
)
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
);
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
export {
|
|
255
|
+
ScrollNavigator
|
|
256
|
+
};
|
package/dist/primitives/chat.cjs
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var _chunkYMI3X2YLcjs = require('../chunk-YMI3X2YL.cjs');
|
|
6
|
-
|
|
7
|
-
|
|
8
5
|
|
|
9
6
|
|
|
10
7
|
var _chunk2BTDBZYNcjs = require('../chunk-2BTDBZYN.cjs');
|
|
@@ -13,6 +10,9 @@ var _chunk2BTDBZYNcjs = require('../chunk-2BTDBZYN.cjs');
|
|
|
13
10
|
var _chunkQWUMIAYDcjs = require('../chunk-QWUMIAYD.cjs');
|
|
14
11
|
|
|
15
12
|
|
|
13
|
+
var _chunkYMI3X2YLcjs = require('../chunk-YMI3X2YL.cjs');
|
|
14
|
+
|
|
15
|
+
|
|
16
16
|
|
|
17
17
|
var _chunkM4V7OJNFcjs = require('../chunk-M4V7OJNF.cjs');
|
|
18
18
|
|
|
@@ -26,7 +26,8 @@ var _chunkB765DSRGcjs = require('../chunk-B765DSRG.cjs');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _chunkPD5UQEKYcjs = require('../chunk-PD5UQEKY.cjs');
|
|
30
|
+
require('../chunk-34AS3OCC.cjs');
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
|
|
@@ -75,6 +76,7 @@ var _chunkFYRQFEU4cjs = require('../chunk-FYRQFEU4.cjs');
|
|
|
75
76
|
|
|
76
77
|
var _chunk2KFZQJH5cjs = require('../chunk-2KFZQJH5.cjs');
|
|
77
78
|
require('../chunk-PQUSJEXL.cjs');
|
|
79
|
+
require('../chunk-WABCLRBR.cjs');
|
|
78
80
|
require('../chunk-NKWHDI4C.cjs');
|
|
79
81
|
|
|
80
82
|
|
|
@@ -176,15 +178,15 @@ var ChatThread = _react.forwardRef.call(void 0,
|
|
|
176
178
|
const markers = timelineMarkers(messages, /* @__PURE__ */ new Date());
|
|
177
179
|
const anchorId = useArrivingUserTurnId(messages);
|
|
178
180
|
const workspace = appearance === "workspace";
|
|
179
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
180
|
-
|
|
181
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPD5UQEKYcjs.MessageScrollerProvider, { autoScroll: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
182
|
+
_chunkPD5UQEKYcjs.MessageScroller,
|
|
181
183
|
{
|
|
182
184
|
ref,
|
|
183
185
|
style: { maxHeight },
|
|
184
186
|
className: _chunkKWLSBTB2cjs.cn.call(void 0, "min-h-0", className),
|
|
185
187
|
children: [
|
|
186
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
187
|
-
|
|
188
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPD5UQEKYcjs.MessageScrollerViewport, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
189
|
+
_chunkPD5UQEKYcjs.MessageScrollerContent,
|
|
188
190
|
{
|
|
189
191
|
className: _chunkKWLSBTB2cjs.cn.call(void 0,
|
|
190
192
|
workspace ? "mx-auto w-full max-w-3xl gap-10 px-4 py-6 md:px-6 md:py-8" : "gap-2.5 px-px py-px"
|
|
@@ -193,7 +195,7 @@ var ChatThread = _react.forwardRef.call(void 0,
|
|
|
193
195
|
messages.map((m, index) => {
|
|
194
196
|
const isUser = m.role === "user";
|
|
195
197
|
if (m.status === "running") {
|
|
196
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
198
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPD5UQEKYcjs.MessageScrollerItem, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
197
199
|
ChatRunningLine,
|
|
198
200
|
{
|
|
199
201
|
label: m.text || pendingLabel,
|
|
@@ -206,7 +208,7 @@ var ChatThread = _react.forwardRef.call(void 0,
|
|
|
206
208
|
const marker = markers[index];
|
|
207
209
|
const actions = messageActions && offersActions(m) ? messageActions(m) : null;
|
|
208
210
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
209
|
-
|
|
211
|
+
_chunkPD5UQEKYcjs.MessageScrollerItem,
|
|
210
212
|
{
|
|
211
213
|
messageId: m.id,
|
|
212
214
|
scrollAnchor: m.id === anchorId,
|
|
@@ -262,15 +264,15 @@ var ChatThread = _react.forwardRef.call(void 0,
|
|
|
262
264
|
m.id
|
|
263
265
|
);
|
|
264
266
|
}),
|
|
265
|
-
pending && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
267
|
+
pending && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPD5UQEKYcjs.MessageScrollerItem, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChatRunningLine, { label: pendingLabel, workspace }) }),
|
|
266
268
|
footer && // Always painted: content-visibility:auto would contain the
|
|
267
269
|
// footer's paint and layout, clipping a ring or shadow at its
|
|
268
270
|
// edge and re-parenting anything fixed inside it.
|
|
269
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
271
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPD5UQEKYcjs.MessageScrollerItem, { className: "[content-visibility:visible]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNWDPH2Z7cjs.Message, { align: "start", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNWDPH2Z7cjs.MessageContent, { children: footer }) }) })
|
|
270
272
|
]
|
|
271
273
|
}
|
|
272
274
|
) }),
|
|
273
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
275
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPD5UQEKYcjs.MessageScrollerButton, { variant: "outline", className: "rounded-full shadow-sm", children: [
|
|
274
276
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArrowDown, { className: "h-4 w-4" }),
|
|
275
277
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", children: scrollButtonLabel })
|
|
276
278
|
] })
|
package/dist/primitives/chat.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
|
-
import {
|
|
4
|
-
VoiceSessionControls
|
|
5
|
-
} from "../chunk-KF4X37DP.js";
|
|
6
3
|
import {
|
|
7
4
|
Trace,
|
|
8
5
|
TraceLine,
|
|
@@ -11,6 +8,9 @@ import {
|
|
|
11
8
|
import {
|
|
12
9
|
VoiceDictationButton
|
|
13
10
|
} from "../chunk-JKVVTFAP.js";
|
|
11
|
+
import {
|
|
12
|
+
VoiceSessionControls
|
|
13
|
+
} from "../chunk-KF4X37DP.js";
|
|
14
14
|
import {
|
|
15
15
|
Suggestion,
|
|
16
16
|
Suggestions
|
|
@@ -26,7 +26,8 @@ import {
|
|
|
26
26
|
MessageScrollerItem,
|
|
27
27
|
MessageScrollerProvider,
|
|
28
28
|
MessageScrollerViewport
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-UBTLWSKK.js";
|
|
30
|
+
import "../chunk-VT2WDFSU.js";
|
|
30
31
|
import {
|
|
31
32
|
Message,
|
|
32
33
|
MessageAction,
|
|
@@ -75,6 +76,7 @@ import {
|
|
|
75
76
|
ActionDock
|
|
76
77
|
} from "../chunk-42RTTHND.js";
|
|
77
78
|
import "../chunk-QMA3WVB7.js";
|
|
79
|
+
import "../chunk-3OWGL4Q2.js";
|
|
78
80
|
import "../chunk-5OF6D3GH.js";
|
|
79
81
|
import {
|
|
80
82
|
Button
|
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
var _chunkPD5UQEKYcjs = require('../chunk-PD5UQEKY.cjs');
|
|
15
|
+
require('../chunk-34AS3OCC.cjs');
|
|
16
|
+
require('../chunk-WABCLRBR.cjs');
|
|
14
17
|
require('../chunk-JDEXZGIY.cjs');
|
|
15
18
|
require('../chunk-KWLSBTB2.cjs');
|
|
16
19
|
|
|
@@ -23,4 +26,5 @@ require('../chunk-KWLSBTB2.cjs');
|
|
|
23
26
|
|
|
24
27
|
|
|
25
28
|
|
|
26
|
-
|
|
29
|
+
|
|
30
|
+
exports.MessageScroller = _chunkPD5UQEKYcjs.MessageScroller; exports.MessageScrollerButton = _chunkPD5UQEKYcjs.MessageScrollerButton; exports.MessageScrollerContent = _chunkPD5UQEKYcjs.MessageScrollerContent; exports.MessageScrollerItem = _chunkPD5UQEKYcjs.MessageScrollerItem; exports.MessageScrollerNavigator = _chunkPD5UQEKYcjs.MessageScrollerNavigator; exports.MessageScrollerProvider = _chunkPD5UQEKYcjs.MessageScrollerProvider; exports.MessageScrollerViewport = _chunkPD5UQEKYcjs.MessageScrollerViewport; exports.useMessageScroller = _chunkPD5UQEKYcjs.useMessageScroller; exports.useMessageScrollerScrollable = _chunkPD5UQEKYcjs.useMessageScrollerScrollable; exports.useMessageScrollerVisibility = _chunkPD5UQEKYcjs.useMessageScrollerVisibility;
|
|
@@ -3,14 +3,18 @@ import * as React from 'react';
|
|
|
3
3
|
import { MessageScroller as MessageScroller$1 } from '@shadcn/react/message-scroller';
|
|
4
4
|
export { useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility } from '@shadcn/react/message-scroller';
|
|
5
5
|
import { Button } from './button.cjs';
|
|
6
|
+
import { ScrollNavigatorProps } from './scroll-navigator.cjs';
|
|
6
7
|
import 'class-variance-authority/types';
|
|
7
8
|
import 'class-variance-authority';
|
|
8
9
|
|
|
9
10
|
declare function MessageScrollerProvider(props: React.ComponentProps<typeof MessageScroller$1.Provider>): react_jsx_runtime.JSX.Element;
|
|
11
|
+
/** A list index inside a message. Jumps use the thread's own anchoring API,
|
|
12
|
+
* so incoming content cannot snap the reader back to the end of the thread. */
|
|
13
|
+
declare function MessageScrollerNavigator(props: ScrollNavigatorProps): react_jsx_runtime.JSX.Element;
|
|
10
14
|
declare function MessageScroller({ className, ...props }: React.ComponentProps<typeof MessageScroller$1.Root>): react_jsx_runtime.JSX.Element;
|
|
11
15
|
declare function MessageScrollerViewport({ className, ...props }: React.ComponentProps<typeof MessageScroller$1.Viewport>): react_jsx_runtime.JSX.Element;
|
|
12
16
|
declare function MessageScrollerContent({ className, ...props }: React.ComponentProps<typeof MessageScroller$1.Content>): react_jsx_runtime.JSX.Element;
|
|
13
17
|
declare function MessageScrollerItem({ className, scrollAnchor, ...props }: React.ComponentProps<typeof MessageScroller$1.Item>): react_jsx_runtime.JSX.Element;
|
|
14
18
|
declare function MessageScrollerButton({ direction, className, children, render, variant, size, ...props }: React.ComponentProps<typeof MessageScroller$1.Button> & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): react_jsx_runtime.JSX.Element;
|
|
15
19
|
|
|
16
|
-
export { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport };
|
|
20
|
+
export { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerNavigator, MessageScrollerProvider, MessageScrollerViewport };
|
|
@@ -3,14 +3,18 @@ import * as React from 'react';
|
|
|
3
3
|
import { MessageScroller as MessageScroller$1 } from '@shadcn/react/message-scroller';
|
|
4
4
|
export { useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility } from '@shadcn/react/message-scroller';
|
|
5
5
|
import { Button } from './button.js';
|
|
6
|
+
import { ScrollNavigatorProps } from './scroll-navigator.js';
|
|
6
7
|
import 'class-variance-authority/types';
|
|
7
8
|
import 'class-variance-authority';
|
|
8
9
|
|
|
9
10
|
declare function MessageScrollerProvider(props: React.ComponentProps<typeof MessageScroller$1.Provider>): react_jsx_runtime.JSX.Element;
|
|
11
|
+
/** A list index inside a message. Jumps use the thread's own anchoring API,
|
|
12
|
+
* so incoming content cannot snap the reader back to the end of the thread. */
|
|
13
|
+
declare function MessageScrollerNavigator(props: ScrollNavigatorProps): react_jsx_runtime.JSX.Element;
|
|
10
14
|
declare function MessageScroller({ className, ...props }: React.ComponentProps<typeof MessageScroller$1.Root>): react_jsx_runtime.JSX.Element;
|
|
11
15
|
declare function MessageScrollerViewport({ className, ...props }: React.ComponentProps<typeof MessageScroller$1.Viewport>): react_jsx_runtime.JSX.Element;
|
|
12
16
|
declare function MessageScrollerContent({ className, ...props }: React.ComponentProps<typeof MessageScroller$1.Content>): react_jsx_runtime.JSX.Element;
|
|
13
17
|
declare function MessageScrollerItem({ className, scrollAnchor, ...props }: React.ComponentProps<typeof MessageScroller$1.Item>): react_jsx_runtime.JSX.Element;
|
|
14
18
|
declare function MessageScrollerButton({ direction, className, children, render, variant, size, ...props }: React.ComponentProps<typeof MessageScroller$1.Button> & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): react_jsx_runtime.JSX.Element;
|
|
15
19
|
|
|
16
|
-
export { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport };
|
|
20
|
+
export { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerNavigator, MessageScrollerProvider, MessageScrollerViewport };
|
|
@@ -5,12 +5,15 @@ import {
|
|
|
5
5
|
MessageScrollerButton,
|
|
6
6
|
MessageScrollerContent,
|
|
7
7
|
MessageScrollerItem,
|
|
8
|
+
MessageScrollerNavigator,
|
|
8
9
|
MessageScrollerProvider,
|
|
9
10
|
MessageScrollerViewport,
|
|
10
11
|
useMessageScroller,
|
|
11
12
|
useMessageScrollerScrollable,
|
|
12
13
|
useMessageScrollerVisibility
|
|
13
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-UBTLWSKK.js";
|
|
15
|
+
import "../chunk-VT2WDFSU.js";
|
|
16
|
+
import "../chunk-3OWGL4Q2.js";
|
|
14
17
|
import "../chunk-W326GKML.js";
|
|
15
18
|
import "../chunk-G6SRSWXB.js";
|
|
16
19
|
export {
|
|
@@ -18,6 +21,7 @@ export {
|
|
|
18
21
|
MessageScrollerButton,
|
|
19
22
|
MessageScrollerContent,
|
|
20
23
|
MessageScrollerItem,
|
|
24
|
+
MessageScrollerNavigator,
|
|
21
25
|
MessageScrollerProvider,
|
|
22
26
|
MessageScrollerViewport,
|
|
23
27
|
useMessageScroller,
|