laif-ds 0.2.74 → 0.2.76
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/dist/CHANGELOG.md +446 -0
- package/dist/agent-docs/adoption-report.json +615 -0
- package/dist/agent-docs/components/Accordion.md +46 -16
- package/dist/agent-docs/components/Alert.md +90 -95
- package/dist/agent-docs/components/AlertDialog.md +132 -126
- package/dist/agent-docs/components/AppEditor.md +90 -90
- package/dist/agent-docs/components/AppRadioGroup.md +18 -18
- package/dist/agent-docs/components/AppSidebar.md +129 -122
- package/dist/agent-docs/components/AppStepper.md +81 -77
- package/dist/agent-docs/components/AspectRatio.md +70 -62
- package/dist/agent-docs/components/AudioVisualizer.md +5 -5
- package/dist/agent-docs/components/Avatar.md +112 -113
- package/dist/agent-docs/components/Badge.md +123 -118
- package/dist/agent-docs/components/Breadcrumb.md +8 -1
- package/dist/agent-docs/components/Button.md +131 -129
- package/dist/agent-docs/components/Card.md +172 -147
- package/dist/agent-docs/components/Carousel.md +148 -129
- package/dist/agent-docs/components/Chat.md +121 -109
- package/dist/agent-docs/components/ChatMessage.md +72 -61
- package/dist/agent-docs/components/Checkbox.md +150 -135
- package/dist/agent-docs/components/CircularProgress.md +53 -49
- package/dist/agent-docs/components/CodeHighlighter.md +4 -4
- package/dist/agent-docs/components/Collapsible.md +114 -95
- package/dist/agent-docs/components/Command.md +141 -142
- package/dist/agent-docs/components/Confirmer.md +182 -175
- package/dist/agent-docs/components/ContextMenu.md +196 -191
- package/dist/agent-docs/components/DataCrossTable.md +114 -94
- package/dist/agent-docs/components/DataTable.md +32 -24
- package/dist/agent-docs/components/Dialog.md +130 -125
- package/dist/agent-docs/components/Drawer.md +141 -127
- package/dist/agent-docs/components/FilePreviewer.md +138 -139
- package/dist/agent-docs/components/FileUploader.md +149 -129
- package/dist/agent-docs/components/Form.md +3 -1
- package/dist/agent-docs/components/FormComposer.md +163 -137
- package/dist/agent-docs/components/GanttChart.md +125 -122
- package/dist/agent-docs/components/HoverCard.md +1 -1
- package/dist/agent-docs/components/Icon.md +98 -99
- package/dist/agent-docs/components/Input.md +173 -138
- package/dist/agent-docs/components/InputOtp.md +6 -1
- package/dist/agent-docs/components/InputSelector.md +94 -97
- package/dist/agent-docs/components/InterruptPrompt.md +4 -4
- package/dist/agent-docs/components/MarkdownRenderer.md +5 -2
- package/dist/agent-docs/components/Menubar.md +60 -57
- package/dist/agent-docs/components/MessageInput.md +134 -131
- package/dist/agent-docs/components/MessageList.md +110 -96
- package/dist/agent-docs/components/MultipleSelector.md +147 -146
- package/dist/agent-docs/components/NavigationMenu.md +6 -2
- package/dist/agent-docs/components/Popover.md +112 -103
- package/dist/agent-docs/components/PromptSuggestions.md +5 -5
- package/dist/agent-docs/components/RadioGroup.md +97 -90
- package/dist/agent-docs/components/Resizable.md +4 -1
- package/dist/agent-docs/components/ResizePrompt.md +12 -13
- package/dist/agent-docs/components/ScrollArea.md +6 -2
- package/dist/agent-docs/components/SecurePdfViewer.md +10 -6
- package/dist/agent-docs/components/Select.md +131 -132
- package/dist/agent-docs/components/Sheet.md +8 -1
- package/dist/agent-docs/components/ShikiHighlighter.md +5 -5
- package/dist/agent-docs/components/Sidebar.md +94 -85
- package/dist/agent-docs/components/Slider.md +62 -58
- package/dist/agent-docs/components/Sonner.md +1 -0
- package/dist/agent-docs/components/Spinner.md +14 -14
- package/dist/agent-docs/components/Stepper.md +93 -67
- package/dist/agent-docs/components/Switch.md +41 -42
- package/dist/agent-docs/components/TableSkeleton.md +8 -8
- package/dist/agent-docs/components/Tabs.md +106 -86
- package/dist/agent-docs/components/TextArea.md +51 -52
- package/dist/agent-docs/components/ThemeSwitcher.md +72 -69
- package/dist/agent-docs/components/Toaster.md +1 -0
- package/dist/agent-docs/components/Tooltip.md +102 -91
- package/dist/agent-docs/components/Typo.md +68 -65
- package/dist/agent-docs/components/WeeklyCalendar.md +63 -64
- package/dist/agent-docs/components-list.md +1 -0
- package/dist/agent-docs/manifest.json +5981 -0
- package/dist/agent-docs/truncated-cell.md +342 -0
- package/dist/components/editor/editor-hooks/use-update-toolbar.js +6 -6
- package/dist/components/editor/plugins/actions/counter-character-plugin.js +6 -6
- package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +18 -18
- package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +10 -10
- package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +9 -9
- package/dist/components/ui/app-checkbox.js +1 -1
- package/dist/components/ui/app-dialog.js +70 -64
- package/dist/components/ui/app-editor.js +51 -51
- package/dist/components/ui/app-form.js +81 -81
- package/dist/components/ui/app-multiple-select-dropdown.js +36 -36
- package/dist/components/ui/app-select.js +109 -104
- package/dist/components/ui/app-sidebar.js +41 -41
- package/dist/components/ui/app-stepper.js +1 -1
- package/dist/components/ui/app-time-picker.js +18 -18
- package/dist/components/ui/app-tooltip.js +1 -1
- package/dist/components/ui/async-select.js +5 -5
- package/dist/components/ui/audio-visualizer.js +61 -58
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/carousel.js +2 -2
- package/dist/components/ui/chart.js +1 -1
- package/dist/components/ui/chat-message.js +8 -8
- package/dist/components/ui/chat.js +86 -88
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/copy-button.js +4 -4
- package/dist/components/ui/date-picker.js +20 -20
- package/dist/components/ui/file-preview/index.js +13 -13
- package/dist/components/ui/file-previewer.js +12 -11
- package/dist/components/ui/file-uploader.js +86 -78
- package/dist/components/ui/form.js +2 -2
- package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +56 -56
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +12 -12
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +1 -1
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +4 -4
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +2 -2
- package/dist/components/ui/gantt/components/Chart/Chart.js +23 -23
- package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +1 -1
- package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +34 -34
- package/dist/components/ui/gantt/components/Controls/Controls.js +5 -5
- package/dist/components/ui/gantt/components/Gantt/Gantt.js +4 -4
- package/dist/components/ui/gantt/hooks/useGanttCalculate.js +25 -18
- package/dist/components/ui/input-selector.js +1 -1
- package/dist/components/ui/input.js +23 -23
- package/dist/components/ui/kanban.js +8 -9
- package/dist/components/ui/markdown-renderer.js +41 -35
- package/dist/components/ui/message-input.js +45 -44
- package/dist/components/ui/multiple-selector.js +91 -82
- package/dist/components/ui/secure-pdf-viewer.js +19 -7
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/spinner.js +4 -4
- package/dist/components/ui/stepper.js +157 -138
- package/dist/components/ui/tables/data-cross-table/data-cross-table-buttons.js +29 -29
- package/dist/components/ui/tables/data-cross-table/data-cross-table.js +258 -246
- package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +4 -1
- package/dist/components/ui/tables/data-table/components/data-table-body.js +211 -367
- package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +114 -112
- package/dist/components/ui/tables/data-table/components/data-table-filters.js +116 -96
- package/dist/components/ui/tables/data-table/components/data-table-header.js +211 -0
- package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +8 -8
- package/dist/components/ui/tables/data-table/components/data-table-skeleton-rows.js +33 -0
- package/dist/components/ui/tables/data-table/data-table.js +258 -250
- package/dist/components/ui/tables/data-table/data-table.service.js +112 -97
- package/dist/components/ui/tables/data-table/data-table.utils.js +25 -15
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/theme-switcher.js +1 -1
- package/dist/components/ui/toggle-group.js +2 -2
- package/dist/components/ui/truncated-cell.js +100 -0
- package/dist/components/ui/weekly-calendar/appointment-card.js +16 -16
- package/dist/components/ui/weekly-calendar/calendar-context.js +6 -6
- package/dist/components/ui/weekly-calendar/calendar-header.js +12 -12
- package/dist/components/ui/weekly-calendar/day-column.js +16 -16
- package/dist/components/ui/weekly-calendar/time-column.js +4 -4
- package/dist/components/ui/weekly-calendar/weekly-calendar.js +4 -4
- package/dist/hooks/use-audio-recording.js +1 -1
- package/dist/hooks/use-auto-scroll.js +18 -18
- package/dist/hooks/use-autosize-textarea.js +12 -13
- package/dist/index.d.ts +100 -45
- package/dist/index.js +362 -360
- package/dist/lib/utils.js +6 -6
- package/dist/styles.v3.css +1 -1
- package/package.json +14 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as w } from "react/jsx-runtime";
|
|
3
|
-
import { cn as n } from "../../lib/utils.js";
|
|
4
3
|
import { motion as c } from "framer-motion";
|
|
5
4
|
import * as s from "react";
|
|
5
|
+
import { cn as n } from "../../lib/utils.js";
|
|
6
6
|
const x = {
|
|
7
7
|
container: {
|
|
8
8
|
initial: { opacity: 0, y: 20 },
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as f, jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import { cva as j } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import * as a from "react";
|
|
3
5
|
import { designTokens as o } from "../design-tokens.js";
|
|
4
6
|
import { Label as se } from "./label.js";
|
|
5
7
|
import { cn as n } from "../../lib/utils.js";
|
|
6
|
-
import { cva as j } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
7
|
-
import * as a from "react";
|
|
8
8
|
import { Icon as N } from "./icon.js";
|
|
9
9
|
import { Typo as te } from "./typo.js";
|
|
10
10
|
const ae = j(
|
|
@@ -64,7 +64,7 @@ const ae = j(
|
|
|
64
64
|
startContent: S,
|
|
65
65
|
endContent: E,
|
|
66
66
|
size: g,
|
|
67
|
-
disabled:
|
|
67
|
+
disabled: c,
|
|
68
68
|
required: C,
|
|
69
69
|
onBlur: O,
|
|
70
70
|
onChange: _,
|
|
@@ -76,18 +76,18 @@ const ae = j(
|
|
|
76
76
|
validityI18n: e,
|
|
77
77
|
...$
|
|
78
78
|
}, J) => {
|
|
79
|
-
const [
|
|
79
|
+
const [d, K] = a.useState(!1), [h, k] = a.useState(!0), [Q, L] = a.useState(!1), [U, V] = a.useState(""), X = a.useId(), w = G ?? X, R = `${w}-validity`, x = a.useRef(null), b = p === "password", Y = b ? d ? "text" : "password" : p, W = F ?? (!h && Q ? !0 : void 0), Z = [H, B && R].filter(Boolean).join(" ").trim() || void 0;
|
|
80
80
|
a.useImperativeHandle(J, () => x.current);
|
|
81
81
|
const q = a.useCallback(
|
|
82
82
|
(t) => {
|
|
83
|
-
if (
|
|
83
|
+
if (c) return;
|
|
84
84
|
const s = t.target;
|
|
85
85
|
if (s.tagName === "INPUT" || s.tagName === "BUTTON") return;
|
|
86
86
|
const r = x.current;
|
|
87
87
|
r && (r.focus(), !b && p !== "file" && r.select());
|
|
88
88
|
},
|
|
89
|
-
[
|
|
90
|
-
),
|
|
89
|
+
[c, b, p]
|
|
90
|
+
), u = a.useCallback(
|
|
91
91
|
(t) => {
|
|
92
92
|
const s = t.validity, r = t.validationMessage !== "" ? t.validationMessage : "✓";
|
|
93
93
|
if (s.valid)
|
|
@@ -104,28 +104,28 @@ const ae = j(
|
|
|
104
104
|
);
|
|
105
105
|
a.useEffect(() => {
|
|
106
106
|
if (x.current) {
|
|
107
|
-
const { isValid: t, message: s } =
|
|
107
|
+
const { isValid: t, message: s } = u(x.current);
|
|
108
108
|
k(t), V(s);
|
|
109
109
|
}
|
|
110
|
-
}, [
|
|
110
|
+
}, [u]);
|
|
111
111
|
const y = a.useCallback(
|
|
112
112
|
(t) => {
|
|
113
113
|
L(!0);
|
|
114
|
-
const { isValid: s, message: r } =
|
|
114
|
+
const { isValid: s, message: r } = u(t.currentTarget);
|
|
115
115
|
k(s), V(r), _?.(t);
|
|
116
116
|
},
|
|
117
|
-
[_,
|
|
117
|
+
[_, u]
|
|
118
118
|
), I = a.useCallback(
|
|
119
119
|
(t) => {
|
|
120
120
|
L(!0), O?.(t);
|
|
121
121
|
},
|
|
122
|
-
[O
|
|
122
|
+
[O]
|
|
123
123
|
), ee = a.useCallback(
|
|
124
124
|
(t) => {
|
|
125
|
-
const { isValid: s, message: r } =
|
|
125
|
+
const { isValid: s, message: r } = u(t.currentTarget);
|
|
126
126
|
k(s), V(r), z?.(t);
|
|
127
127
|
},
|
|
128
|
-
[z,
|
|
128
|
+
[z, u]
|
|
129
129
|
);
|
|
130
130
|
return /* @__PURE__ */ f("div", { className: n("flex flex-col gap-1.5", A), children: [
|
|
131
131
|
T && /* @__PURE__ */ f(se, { htmlFor: w, className: n("gap-0.5", D), children: [
|
|
@@ -138,7 +138,7 @@ const ae = j(
|
|
|
138
138
|
{
|
|
139
139
|
className: n(
|
|
140
140
|
ae({ size: g }),
|
|
141
|
-
|
|
141
|
+
c ? "cursor-not-allowed opacity-50" : "cursor-text"
|
|
142
142
|
),
|
|
143
143
|
"aria-invalid": W,
|
|
144
144
|
onClick: q,
|
|
@@ -155,7 +155,7 @@ const ae = j(
|
|
|
155
155
|
"data-slot": "input",
|
|
156
156
|
className: n(re({ size: g })),
|
|
157
157
|
ref: x,
|
|
158
|
-
disabled:
|
|
158
|
+
disabled: c,
|
|
159
159
|
onChange: y,
|
|
160
160
|
onBlur: I,
|
|
161
161
|
onInvalid: ee,
|
|
@@ -175,22 +175,22 @@ const ae = j(
|
|
|
175
175
|
},
|
|
176
176
|
className: n(
|
|
177
177
|
"text-d-muted-foreground flex shrink-0 cursor-pointer items-center",
|
|
178
|
-
|
|
178
|
+
c && "cursor-not-allowed"
|
|
179
179
|
),
|
|
180
|
-
"aria-label":
|
|
181
|
-
"aria-pressed":
|
|
180
|
+
"aria-label": d ? m.hide : m.show,
|
|
181
|
+
"aria-pressed": d,
|
|
182
182
|
"aria-controls": w,
|
|
183
|
-
title:
|
|
184
|
-
disabled:
|
|
183
|
+
title: d ? m.hide : m.show,
|
|
184
|
+
disabled: c,
|
|
185
185
|
children: [
|
|
186
186
|
/* @__PURE__ */ l(
|
|
187
187
|
N,
|
|
188
188
|
{
|
|
189
|
-
name:
|
|
189
|
+
name: d ? "EyeOff" : "Eye",
|
|
190
190
|
size: g === "lg" ? "sm" : "xs"
|
|
191
191
|
}
|
|
192
192
|
),
|
|
193
|
-
/* @__PURE__ */ l("span", { className: "sr-only", children:
|
|
193
|
+
/* @__PURE__ */ l("span", { className: "sr-only", children: d ? m.hide : m.show })
|
|
194
194
|
]
|
|
195
195
|
}
|
|
196
196
|
) : (M || E) && /* @__PURE__ */ f("div", { className: "text-d-muted-foreground flex shrink-0 items-center gap-2", children: [
|
|
@@ -248,10 +248,7 @@ function xe({
|
|
|
248
248
|
}, []), c = h(() => {
|
|
249
249
|
const s = d.current;
|
|
250
250
|
if (!s) return;
|
|
251
|
-
if (t && Object.prototype.hasOwnProperty.call(
|
|
252
|
-
t,
|
|
253
|
-
"--kanban-column-min-height"
|
|
254
|
-
)) {
|
|
251
|
+
if (t && Object.prototype.hasOwnProperty.call(t, "--kanban-column-min-height")) {
|
|
255
252
|
n(null);
|
|
256
253
|
return;
|
|
257
254
|
}
|
|
@@ -279,7 +276,9 @@ function xe({
|
|
|
279
276
|
x = Math.max(x, k.scrollHeight);
|
|
280
277
|
b && s.style.setProperty("--kanban-column-min-height", b);
|
|
281
278
|
const B = Math.ceil(x);
|
|
282
|
-
n(
|
|
279
|
+
n(
|
|
280
|
+
Number.isFinite(B) && B > 0 ? B : 0
|
|
281
|
+
);
|
|
283
282
|
}, [n, t]), f = h(() => {
|
|
284
283
|
i.current === null && (i.current = requestAnimationFrame(() => {
|
|
285
284
|
i.current = null, c();
|
|
@@ -348,8 +347,8 @@ function ye({
|
|
|
348
347
|
"aria-labelledby": `column-${r}-title`,
|
|
349
348
|
className: D(
|
|
350
349
|
se,
|
|
351
|
-
g && "border-d-primary/80 bg-d-primary/10 ring-
|
|
352
|
-
m && "border-d-destructive/70 bg-d-destructive/10 ring-
|
|
350
|
+
g && "border-d-primary/80 bg-d-primary/10 ring-d-primary/30 ring-2",
|
|
351
|
+
m && "border-d-destructive/70 bg-d-destructive/10 ring-d-destructive/20 ring-2",
|
|
353
352
|
e
|
|
354
353
|
),
|
|
355
354
|
"aria-disabled": l,
|
|
@@ -523,7 +522,7 @@ function Te({
|
|
|
523
522
|
!a && "bg-d-card/95",
|
|
524
523
|
le,
|
|
525
524
|
"focus-visible:ring-d-ring inline-flex w-full touch-manipulation flex-col gap-2 transition-all duration-200 focus-visible:ring-1 focus-visible:outline-none",
|
|
526
|
-
t ? "group/card relative cursor-default" : c ? "cursor-grabbing active:cursor-grabbing
|
|
525
|
+
t ? "group/card relative cursor-default" : c ? "cursor-grabbing opacity-40 active:cursor-grabbing" : "group/card relative cursor-grab hover:-translate-y-0.5 hover:shadow-lg",
|
|
527
526
|
l && "rotate-1 transform shadow-lg",
|
|
528
527
|
e
|
|
529
528
|
),
|
|
@@ -539,7 +538,7 @@ function Te({
|
|
|
539
538
|
g && g.length > 0 && /* @__PURE__ */ p("div", { className: "mt-1.5 flex flex-wrap gap-1.5", children: g.map((o, b) => /* @__PURE__ */ C(
|
|
540
539
|
"div",
|
|
541
540
|
{
|
|
542
|
-
className: "text-d-muted-foreground inline-flex items-center gap-1 rounded-full border
|
|
541
|
+
className: "text-d-muted-foreground bg-d-muted/40 inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px]",
|
|
543
542
|
style: {
|
|
544
543
|
borderColor: a ? `${a}40` : void 0
|
|
545
544
|
},
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import { cn as m } from "../../lib/utils.js";
|
|
2
|
+
import { jsx as o, jsxs as p, Fragment as y } from "react/jsx-runtime";
|
|
3
|
+
import g, { Suspense as x } from "react";
|
|
5
4
|
import { CopyButton as k } from "./copy-button.js";
|
|
5
|
+
import { cn as m } from "../../lib/utils.js";
|
|
6
6
|
import { Markdown as N } from "../../node_modules/react-markdown/lib/index.js";
|
|
7
7
|
import v from "../../node_modules/remark-gfm/lib/index.js";
|
|
8
8
|
function q({ children: e }) {
|
|
9
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ o("div", { className: "space-y-3", children: /* @__PURE__ */ o(N, { remarkPlugins: [v], components: C, children: e }) });
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
async ({ children: e, language:
|
|
13
|
-
const { codeToTokens:
|
|
14
|
-
if (!(
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
const { tokens: l } = await
|
|
17
|
-
lang:
|
|
11
|
+
const h = g.memo(
|
|
12
|
+
async ({ children: e, language: t, ...n }) => {
|
|
13
|
+
const { codeToTokens: i, bundledLanguages: d } = await import("../../node_modules/shiki/dist/index.js");
|
|
14
|
+
if (!(t in d))
|
|
15
|
+
return /* @__PURE__ */ o("pre", { ...n, children: e });
|
|
16
|
+
const { tokens: l } = await i(e, {
|
|
17
|
+
lang: t,
|
|
18
18
|
defaultColor: !1,
|
|
19
19
|
themes: {
|
|
20
20
|
light: "github-light",
|
|
21
21
|
dark: "github-dark"
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
const
|
|
27
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ o("pre", { ...n, children: /* @__PURE__ */ o("code", { children: l.map((u, c) => /* @__PURE__ */ p(y, { children: [
|
|
25
|
+
/* @__PURE__ */ o("span", { children: u.map((a, b) => {
|
|
26
|
+
const f = typeof a.htmlStyle == "string" ? void 0 : a.htmlStyle;
|
|
27
|
+
return /* @__PURE__ */ o(
|
|
28
28
|
"span",
|
|
29
29
|
{
|
|
30
30
|
className: "text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",
|
|
31
|
-
style:
|
|
31
|
+
style: f,
|
|
32
32
|
children: a.content
|
|
33
33
|
},
|
|
34
|
-
|
|
34
|
+
b
|
|
35
35
|
);
|
|
36
36
|
}) }, c),
|
|
37
37
|
c !== l.length - 1 && `
|
|
@@ -39,34 +39,34 @@ const g = y.memo(
|
|
|
39
39
|
] })) }) });
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
|
-
|
|
42
|
+
h.displayName = "HighlightedCode";
|
|
43
43
|
const w = ({
|
|
44
44
|
children: e,
|
|
45
|
-
className:
|
|
45
|
+
className: t,
|
|
46
46
|
language: n,
|
|
47
|
-
...
|
|
47
|
+
...i
|
|
48
48
|
}) => {
|
|
49
|
-
const
|
|
49
|
+
const d = typeof e == "string" ? e : s(e), l = m(
|
|
50
50
|
"overflow-x-scroll rounded-md border border-d-border bg-d-background/50 p-4 font-mono text-sm [scrollbar-width:none]",
|
|
51
|
-
|
|
51
|
+
t
|
|
52
52
|
);
|
|
53
53
|
return /* @__PURE__ */ p("div", { className: "group/code relative mb-4", children: [
|
|
54
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ o(
|
|
55
55
|
x,
|
|
56
56
|
{
|
|
57
|
-
fallback: /* @__PURE__ */
|
|
58
|
-
children: /* @__PURE__ */
|
|
57
|
+
fallback: /* @__PURE__ */ o("pre", { className: l, ...i, children: e }),
|
|
58
|
+
children: /* @__PURE__ */ o(h, { language: n, className: l, children: d })
|
|
59
59
|
}
|
|
60
60
|
),
|
|
61
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ o("div", { className: "invisible absolute top-2 right-2 flex space-x-1 rounded-lg p-1 opacity-0 transition-all duration-200 group-hover/code:visible group-hover/code:opacity-100", children: /* @__PURE__ */ o(k, { content: d, copyMessage: "Copied code to clipboard" }) })
|
|
62
62
|
] });
|
|
63
63
|
};
|
|
64
64
|
function s(e) {
|
|
65
65
|
if (typeof e == "string")
|
|
66
66
|
return e;
|
|
67
|
-
if (e
|
|
68
|
-
|
|
69
|
-
return Array.isArray(
|
|
67
|
+
if (g.isValidElement(e) && e.props && typeof e.props == "object" && "children" in e.props) {
|
|
68
|
+
const t = e.props.children;
|
|
69
|
+
return t && typeof t == "object" && Array.isArray(t) ? t.map((n) => s(n)).join("") : s(t);
|
|
70
70
|
}
|
|
71
71
|
return "";
|
|
72
72
|
}
|
|
@@ -79,15 +79,19 @@ const C = {
|
|
|
79
79
|
strong: r("strong", "font-semibold"),
|
|
80
80
|
a: r("a", "text-d-primary underline underline-offset-2"),
|
|
81
81
|
blockquote: r("blockquote", "border-l-2 border-d-primary pl-4"),
|
|
82
|
-
code: ({
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
code: ({
|
|
83
|
+
children: e,
|
|
84
|
+
className: t,
|
|
85
|
+
...n
|
|
86
|
+
}) => {
|
|
87
|
+
const i = /language-(\w+)/.exec(t || "");
|
|
88
|
+
return i ? /* @__PURE__ */ o(w, { className: t, language: i[1], ...n, children: e }) : /* @__PURE__ */ o(
|
|
85
89
|
"code",
|
|
86
90
|
{
|
|
87
91
|
className: m(
|
|
88
92
|
"[:not(pre)>&]:bg-d-background/50 font-mono [:not(pre)>&]:rounded-md [:not(pre)>&]:px-1 [:not(pre)>&]:py-0.5"
|
|
89
93
|
),
|
|
90
|
-
...
|
|
94
|
+
...n,
|
|
91
95
|
children: e
|
|
92
96
|
}
|
|
93
97
|
);
|
|
@@ -112,8 +116,10 @@ const C = {
|
|
|
112
116
|
p: r("p", "whitespace-pre-wrap"),
|
|
113
117
|
hr: r("hr", "border-foreground/20")
|
|
114
118
|
};
|
|
115
|
-
function r(e,
|
|
116
|
-
const n = ({
|
|
119
|
+
function r(e, t) {
|
|
120
|
+
const n = ({
|
|
121
|
+
...i
|
|
122
|
+
}) => /* @__PURE__ */ o(e, { className: t, ...i });
|
|
117
123
|
return n.displayName = String(e), n;
|
|
118
124
|
}
|
|
119
125
|
export {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import { AnimatePresence as v, motion as w } from "framer-motion";
|
|
4
|
-
import { useState as y, useEffect as
|
|
5
|
-
import { omit as
|
|
4
|
+
import { useState as y, useEffect as z, useRef as Q } from "react";
|
|
5
|
+
import { omit as S } from "../../node_modules/remeda/dist/omit-HZOiLuMO.js";
|
|
6
6
|
import { AudioVisualizer as X } from "./audio-visualizer.js";
|
|
7
7
|
import { Button as g } from "./button.js";
|
|
8
8
|
import { FilePreview as Y } from "./file-preview/index.js";
|
|
9
9
|
import { InterruptPrompt as Z } from "./interrupt-prompt.js";
|
|
10
10
|
import { useAudioRecording as _ } from "../../hooks/use-audio-recording.js";
|
|
11
11
|
import { useAutosizeTextArea as $ } from "../../hooks/use-autosize-textarea.js";
|
|
12
|
-
import { cn as
|
|
13
|
-
import
|
|
12
|
+
import { cn as T } from "../../lib/utils.js";
|
|
13
|
+
import C from "../../node_modules/lucide-react/dist/esm/icons/paperclip.js";
|
|
14
14
|
import G from "../../node_modules/lucide-react/dist/esm/icons/mic.js";
|
|
15
15
|
import ee from "../../node_modules/lucide-react/dist/esm/icons/square.js";
|
|
16
16
|
import te from "../../node_modules/lucide-react/dist/esm/icons/arrow-up.js";
|
|
@@ -24,39 +24,41 @@ function ae({
|
|
|
24
24
|
stop: s,
|
|
25
25
|
isGenerating: u,
|
|
26
26
|
enableInterrupt: A = !0,
|
|
27
|
-
transcribeAudio:
|
|
28
|
-
"data-testid":
|
|
27
|
+
transcribeAudio: P,
|
|
28
|
+
"data-testid": I,
|
|
29
29
|
...r
|
|
30
30
|
}) {
|
|
31
|
-
const [
|
|
32
|
-
isListening:
|
|
33
|
-
isSpeechSupported:
|
|
31
|
+
const [R, x] = y(!1), [N, f] = y(!1), {
|
|
32
|
+
isListening: F,
|
|
33
|
+
isSpeechSupported: L,
|
|
34
34
|
isRecording: D,
|
|
35
|
-
isTranscribing:
|
|
36
|
-
audioStream:
|
|
37
|
-
toggleListening:
|
|
35
|
+
isTranscribing: M,
|
|
36
|
+
audioStream: O,
|
|
37
|
+
toggleListening: j,
|
|
38
38
|
stopRecording: k
|
|
39
39
|
} = _({
|
|
40
|
-
transcribeAudio:
|
|
40
|
+
transcribeAudio: P,
|
|
41
41
|
onTranscriptionComplete: (t) => {
|
|
42
|
-
r.onChange?.({
|
|
42
|
+
r.onChange?.({
|
|
43
|
+
target: { value: t }
|
|
44
|
+
});
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
|
-
|
|
47
|
+
z(() => {
|
|
46
48
|
u || f(!1);
|
|
47
49
|
}, [u]);
|
|
48
50
|
const h = (t) => {
|
|
49
51
|
r.allowAttachments && r.setFiles((a) => a === null ? t : t === null ? a : [...a, ...t]);
|
|
50
|
-
},
|
|
52
|
+
}, q = (t) => {
|
|
51
53
|
r.allowAttachments === !0 && (t.preventDefault(), x(!0));
|
|
52
|
-
},
|
|
54
|
+
}, E = (t) => {
|
|
53
55
|
r.allowAttachments === !0 && (t.preventDefault(), x(!1));
|
|
54
|
-
},
|
|
56
|
+
}, H = (t) => {
|
|
55
57
|
if (x(!1), r.allowAttachments !== !0) return;
|
|
56
58
|
t.preventDefault();
|
|
57
59
|
const a = t.dataTransfer;
|
|
58
60
|
a.files.length && h(Array.from(a.files));
|
|
59
|
-
},
|
|
61
|
+
}, K = (t) => {
|
|
60
62
|
const a = t.clipboardData?.items;
|
|
61
63
|
if (!a) return;
|
|
62
64
|
const c = t.clipboardData.getData("text");
|
|
@@ -71,7 +73,7 @@ function ae({
|
|
|
71
73
|
}
|
|
72
74
|
const b = Array.from(a).map((m) => m.getAsFile()).filter((m) => m !== null);
|
|
73
75
|
r.allowAttachments && b.length > 0 && h(b);
|
|
74
|
-
},
|
|
76
|
+
}, U = (t) => {
|
|
75
77
|
if (l && t.key === "Enter" && !t.shiftKey) {
|
|
76
78
|
if (t.preventDefault(), u && s && A) {
|
|
77
79
|
if (N)
|
|
@@ -86,23 +88,22 @@ function ae({
|
|
|
86
88
|
d?.(t);
|
|
87
89
|
}, p = Q(
|
|
88
90
|
null
|
|
89
|
-
), [
|
|
90
|
-
|
|
91
|
-
p.current &&
|
|
91
|
+
), [V, B] = y(0);
|
|
92
|
+
z(() => {
|
|
93
|
+
p.current && B(p.current.offsetHeight);
|
|
92
94
|
}, [r.value]);
|
|
93
|
-
const
|
|
95
|
+
const W = r.allowAttachments && r.files && r.files.length > 0;
|
|
94
96
|
return $({
|
|
95
97
|
ref: p,
|
|
96
98
|
maxHeight: 240,
|
|
97
|
-
borderWidth: 1
|
|
98
|
-
dependencies: [r.value, z]
|
|
99
|
+
borderWidth: 1
|
|
99
100
|
}), /* @__PURE__ */ o(
|
|
100
101
|
"div",
|
|
101
102
|
{
|
|
102
103
|
className: "relative flex w-full",
|
|
103
|
-
onDragOver:
|
|
104
|
-
onDragLeave:
|
|
105
|
-
onDrop:
|
|
104
|
+
onDragOver: q,
|
|
105
|
+
onDragLeave: E,
|
|
106
|
+
onDrop: H,
|
|
106
107
|
children: [
|
|
107
108
|
A && /* @__PURE__ */ e(
|
|
108
109
|
Z,
|
|
@@ -125,15 +126,15 @@ function ae({
|
|
|
125
126
|
"aria-label": "Write your prompt here",
|
|
126
127
|
placeholder: i,
|
|
127
128
|
ref: p,
|
|
128
|
-
onPaste:
|
|
129
|
-
onKeyDown:
|
|
130
|
-
"data-testid":
|
|
131
|
-
className:
|
|
129
|
+
onPaste: K,
|
|
130
|
+
onKeyDown: U,
|
|
131
|
+
"data-testid": I,
|
|
132
|
+
className: T(
|
|
132
133
|
"border-d-input bg-d-input ring-offset-d-background placeholder:text-d-muted-foreground focus-visible:border-d-primary z-10 w-full grow resize-none rounded-xl border p-3 pr-24 text-sm transition-[border] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
133
|
-
|
|
134
|
+
W && "pb-16",
|
|
134
135
|
n
|
|
135
136
|
),
|
|
136
|
-
...r.allowAttachments ?
|
|
137
|
+
...r.allowAttachments ? S(r, ["allowAttachments", "files", "setFiles"]) : S(r, ["allowAttachments"])
|
|
137
138
|
}
|
|
138
139
|
),
|
|
139
140
|
r.allowAttachments && /* @__PURE__ */ e("div", { className: "absolute inset-x-3 bottom-2 z-20 overflow-x-scroll py-3 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: /* @__PURE__ */ e("div", { className: "flex space-x-3", children: /* @__PURE__ */ e(v, { mode: "popLayout", children: r.files?.map((t) => /* @__PURE__ */ e(
|
|
@@ -166,18 +167,18 @@ function ae({
|
|
|
166
167
|
const t = await le();
|
|
167
168
|
h(t);
|
|
168
169
|
},
|
|
169
|
-
children: /* @__PURE__ */ e(
|
|
170
|
+
children: /* @__PURE__ */ e(C, { className: "h-4 w-4" })
|
|
170
171
|
}
|
|
171
172
|
),
|
|
172
|
-
|
|
173
|
+
L && /* @__PURE__ */ e(
|
|
173
174
|
g,
|
|
174
175
|
{
|
|
175
176
|
type: "button",
|
|
176
177
|
variant: "outline",
|
|
177
|
-
className:
|
|
178
|
+
className: T("h-8 w-8", F && "text-d-primary"),
|
|
178
179
|
"aria-label": "Voice input",
|
|
179
180
|
size: "icon",
|
|
180
|
-
onClick:
|
|
181
|
+
onClick: j,
|
|
181
182
|
children: /* @__PURE__ */ e(G, { className: "h-4 w-4" })
|
|
182
183
|
}
|
|
183
184
|
),
|
|
@@ -203,14 +204,14 @@ function ae({
|
|
|
203
204
|
}
|
|
204
205
|
)
|
|
205
206
|
] }),
|
|
206
|
-
r.allowAttachments && /* @__PURE__ */ e(ne, { isDragging:
|
|
207
|
+
r.allowAttachments && /* @__PURE__ */ e(ne, { isDragging: R }),
|
|
207
208
|
/* @__PURE__ */ e(
|
|
208
209
|
ce,
|
|
209
210
|
{
|
|
210
211
|
isRecording: D,
|
|
211
|
-
isTranscribing:
|
|
212
|
-
audioStream:
|
|
213
|
-
textAreaHeight:
|
|
212
|
+
isTranscribing: M,
|
|
213
|
+
audioStream: O,
|
|
214
|
+
textAreaHeight: V,
|
|
214
215
|
onStopRecording: k
|
|
215
216
|
}
|
|
216
217
|
)
|
|
@@ -230,7 +231,7 @@ function ne({ isDragging: i }) {
|
|
|
230
231
|
transition: { duration: 0.2 },
|
|
231
232
|
"aria-hidden": !0,
|
|
232
233
|
children: [
|
|
233
|
-
/* @__PURE__ */ e(
|
|
234
|
+
/* @__PURE__ */ e(C, { className: "h-4 w-4" }),
|
|
234
235
|
/* @__PURE__ */ e("span", { children: "Drop your files here to attach them." })
|
|
235
236
|
]
|
|
236
237
|
}
|