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,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as x, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { cva as ue } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
3
|
+
import { cva as me } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
4
|
import * as k from "react";
|
|
6
5
|
import { useState as y, useEffect as A, useCallback as j } from "react";
|
|
7
6
|
import { designTokens as u } from "../design-tokens.js";
|
|
7
|
+
import { useDebounce as ue } from "../../hooks/use-debounce.js";
|
|
8
8
|
import { cn as z } from "../../lib/utils.js";
|
|
9
9
|
import { Checkbox as he } from "./checkbox.js";
|
|
10
10
|
import { Command as ge, CommandInput as pe, CommandList as we, CommandEmpty as xe, CommandGroup as _, CommandItem as O } from "./command.js";
|
|
@@ -12,7 +12,7 @@ import { Icon as Z } from "./icon.js";
|
|
|
12
12
|
import { Label as ye } from "./label.js";
|
|
13
13
|
import { Popover as Ne, PopoverTrigger as be, PopoverContent as Ce } from "./popover.js";
|
|
14
14
|
import Ae from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
|
|
15
|
-
const Se =
|
|
15
|
+
const Se = me(
|
|
16
16
|
z(
|
|
17
17
|
u.input.base,
|
|
18
18
|
u.radius.default,
|
|
@@ -56,7 +56,7 @@ function $e({
|
|
|
56
56
|
id: ee,
|
|
57
57
|
"data-testid": re
|
|
58
58
|
}) {
|
|
59
|
-
const [m, P] = y(!1), L = k.useRef(null), F = k.useRef(null), te = k.useRef(null), [ne, W] = y({ loading: !1, error: null }), [X, se] = y(""), B =
|
|
59
|
+
const [m, P] = y(!1), L = k.useRef(null), F = k.useRef(null), te = k.useRef(null), [ne, W] = y({ loading: !1, error: null }), [X, se] = y(""), B = ue(X, N), [$, ce] = y(/* @__PURE__ */ new Map()), [G, K] = y([]), [q, ae] = y(0), [H, J] = y(() => n?.length ? new Map(
|
|
60
60
|
n.map((e) => [s(e), e])
|
|
61
61
|
) : /* @__PURE__ */ new Map());
|
|
62
62
|
A(() => {
|
|
@@ -157,7 +157,7 @@ function $e({
|
|
|
157
157
|
(e) => {
|
|
158
158
|
e.stopPropagation(), e.preventDefault(), g?.(o ? [] : ""), P(!1);
|
|
159
159
|
},
|
|
160
|
-
[g]
|
|
160
|
+
[g, o]
|
|
161
161
|
), ie = k.useId(), Y = ee ?? ie;
|
|
162
162
|
return /* @__PURE__ */ x("div", { className: z("flex flex-col gap-1.5", E), children: [
|
|
163
163
|
C && /* @__PURE__ */ r(ye, { htmlFor: Y, children: C }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as i, useEffect as
|
|
2
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as i, useEffect as R, useCallback as f } from "react";
|
|
4
4
|
const c = {
|
|
5
5
|
FFT_SIZE: 512,
|
|
6
6
|
SMOOTHING: 0.8,
|
|
@@ -16,80 +16,83 @@ const c = {
|
|
|
16
16
|
// MAX_INTENSITY - MIN_INTENSITY
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
function
|
|
20
|
-
stream:
|
|
21
|
-
isRecording:
|
|
22
|
-
onClick:
|
|
19
|
+
function F({
|
|
20
|
+
stream: a,
|
|
21
|
+
isRecording: s,
|
|
22
|
+
onClick: B
|
|
23
23
|
}) {
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const u = i(null), d = i(null), I = i(null), h = i(null), N = i(null), A = () => {
|
|
25
|
+
h.current && cancelAnimationFrame(h.current), d.current && d.current.close();
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}, [u, l]), w(() => {
|
|
30
|
-
const e = () => {
|
|
31
|
-
if (typeof window > "u" || !a.current || !h.current)
|
|
32
|
-
return;
|
|
33
|
-
const t = h.current, n = a.current, o = window.devicePixelRatio || 1, r = t.getBoundingClientRect();
|
|
34
|
-
n.width = (r.width - 2) * o, n.height = (r.height - 2) * o, n.style.width = `${r.width - 2}px`, n.style.height = `${r.height - 2}px`;
|
|
35
|
-
};
|
|
36
|
-
if (typeof window < "u")
|
|
37
|
-
return window.addEventListener("resize", e), e(), () => window.removeEventListener("resize", e);
|
|
38
|
-
}, []);
|
|
39
|
-
const C = async () => {
|
|
40
|
-
try {
|
|
41
|
-
const e = new AudioContext();
|
|
42
|
-
d.current = e;
|
|
43
|
-
const t = e.createAnalyser();
|
|
44
|
-
t.fftSize = c.FFT_SIZE, t.smoothingTimeConstant = c.SMOOTHING, f.current = t, e.createMediaStreamSource(u).connect(t), p();
|
|
45
|
-
} catch (e) {
|
|
46
|
-
console.error("Error starting visualization:", e);
|
|
47
|
-
}
|
|
48
|
-
}, E = (e) => {
|
|
27
|
+
R(() => A, []);
|
|
28
|
+
const T = f((e) => {
|
|
49
29
|
const t = Math.floor(e * c.COLOR.INTENSITY_RANGE) + c.COLOR.MIN_INTENSITY;
|
|
50
30
|
return `rgb(${t}, ${t}, ${t})`;
|
|
51
|
-
},
|
|
52
|
-
e
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
31
|
+
}, []), _ = f(
|
|
32
|
+
(e, t, n, o, r, l) => {
|
|
33
|
+
e.fillStyle = l, e.fillRect(t, n - r, o, r), e.fillRect(t, n, o, r);
|
|
34
|
+
},
|
|
35
|
+
[]
|
|
36
|
+
), m = f(() => {
|
|
37
|
+
if (!s) return;
|
|
38
|
+
const e = u.current, t = e?.getContext("2d");
|
|
39
|
+
if (!e || !t || !I.current) return;
|
|
57
40
|
const n = window.devicePixelRatio || 1;
|
|
58
41
|
t.scale(n, n);
|
|
59
|
-
const o =
|
|
60
|
-
|
|
61
|
-
const
|
|
42
|
+
const o = I.current, r = o.frequencyBinCount, l = new Uint8Array(r), C = () => {
|
|
43
|
+
h.current = requestAnimationFrame(C), o.getByteFrequencyData(l), t.clearRect(0, 0, e.width / n, e.height / n);
|
|
44
|
+
const S = Math.max(
|
|
62
45
|
c.MIN_BAR_WIDTH,
|
|
63
46
|
e.width / n / r - c.BAR_SPACING
|
|
64
|
-
),
|
|
65
|
-
let
|
|
66
|
-
for (let
|
|
67
|
-
const
|
|
47
|
+
), g = e.height / n / 2;
|
|
48
|
+
let E = 0;
|
|
49
|
+
for (let w = 0; w < r; w++) {
|
|
50
|
+
const M = l[w] / 255, O = Math.max(
|
|
68
51
|
c.MIN_BAR_HEIGHT,
|
|
69
|
-
|
|
52
|
+
M * g
|
|
70
53
|
);
|
|
71
|
-
|
|
54
|
+
_(
|
|
72
55
|
t,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
),
|
|
56
|
+
E,
|
|
57
|
+
g,
|
|
58
|
+
S,
|
|
59
|
+
O,
|
|
60
|
+
T(M)
|
|
61
|
+
), E += S + c.BAR_SPACING;
|
|
79
62
|
}
|
|
80
63
|
};
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
64
|
+
C();
|
|
65
|
+
}, [s, _, T]), y = f(async () => {
|
|
66
|
+
try {
|
|
67
|
+
const e = new AudioContext();
|
|
68
|
+
d.current = e;
|
|
69
|
+
const t = e.createAnalyser();
|
|
70
|
+
t.fftSize = c.FFT_SIZE, t.smoothingTimeConstant = c.SMOOTHING, I.current = t, e.createMediaStreamSource(a).connect(t), m();
|
|
71
|
+
} catch (e) {
|
|
72
|
+
console.error("Error starting visualization:", e);
|
|
73
|
+
}
|
|
74
|
+
}, [a, m]);
|
|
75
|
+
return R(() => {
|
|
76
|
+
a && s ? y() : A();
|
|
77
|
+
}, [a, s, y]), R(() => {
|
|
78
|
+
const e = () => {
|
|
79
|
+
if (typeof window > "u" || !u.current || !N.current)
|
|
80
|
+
return;
|
|
81
|
+
const t = N.current, n = u.current, o = window.devicePixelRatio || 1, r = t.getBoundingClientRect();
|
|
82
|
+
n.width = (r.width - 2) * o, n.height = (r.height - 2) * o, n.style.width = `${r.width - 2}px`, n.style.height = `${r.height - 2}px`;
|
|
83
|
+
};
|
|
84
|
+
if (typeof window < "u")
|
|
85
|
+
return window.addEventListener("resize", e), e(), () => window.removeEventListener("resize", e);
|
|
86
|
+
}, []), /* @__PURE__ */ p(
|
|
84
87
|
"div",
|
|
85
88
|
{
|
|
86
|
-
ref:
|
|
89
|
+
ref: N,
|
|
87
90
|
className: "bg-d-background/80 h-full w-full cursor-pointer rounded-lg backdrop-blur",
|
|
88
|
-
onClick:
|
|
89
|
-
children: /* @__PURE__ */
|
|
91
|
+
onClick: B,
|
|
92
|
+
children: /* @__PURE__ */ p("canvas", { ref: u, className: "h-full w-full" })
|
|
90
93
|
}
|
|
91
94
|
);
|
|
92
95
|
}
|
|
93
96
|
export {
|
|
94
|
-
|
|
97
|
+
F as AudioVisualizer
|
|
95
98
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import * as n from "react";
|
|
3
4
|
import { designTokens as c } from "../design-tokens.js";
|
|
4
5
|
import { cn as o } from "../../lib/utils.js";
|
|
5
|
-
import * as n from "react";
|
|
6
6
|
const s = n.createContext({
|
|
7
7
|
size: "default"
|
|
8
8
|
}), d = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a, jsxs as h } from "react/jsx-runtime";
|
|
3
|
-
import * as l from "react";
|
|
4
3
|
import k from "../../node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js";
|
|
5
|
-
import
|
|
4
|
+
import * as l from "react";
|
|
6
5
|
import { Button as v } from "./button.js";
|
|
6
|
+
import { cn as d } from "../../lib/utils.js";
|
|
7
7
|
import z from "../../node_modules/lucide-react/dist/esm/icons/arrow-right.js";
|
|
8
8
|
import g from "../../node_modules/lucide-react/dist/esm/icons/arrow-left.js";
|
|
9
9
|
const p = l.createContext(null);
|
|
@@ -142,7 +142,7 @@ function A({
|
|
|
142
142
|
m ? k : null,
|
|
143
143
|
/* @__PURE__ */ s("span", { className: "text-muted-foreground", children: h?.label || n.name })
|
|
144
144
|
] }),
|
|
145
|
-
n.value && /* @__PURE__ */ s("span", { className: "text-foreground font-mono font-medium tabular-nums", children: n.value.toLocaleString() })
|
|
145
|
+
typeof n.value == "number" && /* @__PURE__ */ s("span", { className: "text-foreground font-mono font-medium tabular-nums", children: n.value.toLocaleString() })
|
|
146
146
|
]
|
|
147
147
|
}
|
|
148
148
|
)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as n, jsx as e, Fragment as T } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { cn as l } from "../../lib/utils.js";
|
|
3
|
+
import { cva as P } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import { motion as V } from "framer-motion";
|
|
5
|
+
import { useMemo as X, useState as N, useRef as J, useEffect as j, Suspense as D } from "react";
|
|
7
6
|
import { Collapsible as _, CollapsibleTrigger as q, CollapsibleContent as G } from "./collapsible.js";
|
|
8
7
|
import { FilePreview as H } from "./file-preview/index.js";
|
|
9
8
|
import { MarkdownRenderer as M } from "./markdown-renderer.js";
|
|
9
|
+
import { cn as l } from "../../lib/utils.js";
|
|
10
10
|
import O from "../../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
11
11
|
import R from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
12
12
|
import K from "../../node_modules/lucide-react/dist/esm/icons/pen.js";
|
|
@@ -15,7 +15,7 @@ import W from "../../node_modules/lucide-react/dist/esm/icons/ban.js";
|
|
|
15
15
|
import Y from "../../node_modules/lucide-react/dist/esm/icons/code-xml.js";
|
|
16
16
|
import Z from "../../node_modules/lucide-react/dist/esm/icons/terminal.js";
|
|
17
17
|
import A from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
|
|
18
|
-
const z =
|
|
18
|
+
const z = P(
|
|
19
19
|
"group/message relative break-words rounded-lg p-3 text-sm sm:max-w-[70%]",
|
|
20
20
|
{
|
|
21
21
|
variants: {
|
|
@@ -65,10 +65,10 @@ const z = X(
|
|
|
65
65
|
toolInvocations: y,
|
|
66
66
|
parts: w
|
|
67
67
|
}) => {
|
|
68
|
-
const I =
|
|
68
|
+
const I = X(() => B?.map((r) => {
|
|
69
69
|
const m = ee(r.url);
|
|
70
70
|
return new File([m], r.name ?? "Unknown");
|
|
71
|
-
}), [B]), i = s === "user", C = !i && v, [a, k] = N(!1), [c, f] = N(t), [b, F] = N(t), d =
|
|
71
|
+
}), [B]), i = s === "user", C = !i && v, [a, k] = N(!1), [c, f] = N(t), [b, F] = N(t), d = J(null);
|
|
72
72
|
j(() => {
|
|
73
73
|
a || (F(t), f(t));
|
|
74
74
|
}, [t, a]), j(() => {
|
|
@@ -345,7 +345,7 @@ const re = ({ part: s }) => {
|
|
|
345
345
|
/* @__PURE__ */ e("span", { children: "Thinking" })
|
|
346
346
|
] }) }) }),
|
|
347
347
|
/* @__PURE__ */ e(G, { forceMount: !0, children: /* @__PURE__ */ e(
|
|
348
|
-
|
|
348
|
+
V.div,
|
|
349
349
|
{
|
|
350
350
|
initial: !1,
|
|
351
351
|
animate: t ? "open" : "closed",
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as b, Fragment as y, jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef as A, useRef as M, useCallback as k, useState as O } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { useAutoScroll as H } from "../../hooks/use-auto-scroll.js";
|
|
6
|
-
import { Button as N } from "./button.js";
|
|
4
|
+
import { Button as v } from "./button.js";
|
|
7
5
|
import { CopyButton as S } from "./copy-button.js";
|
|
8
|
-
import { MessageInput as
|
|
9
|
-
import { MessageList as
|
|
10
|
-
import { PromptSuggestions as
|
|
6
|
+
import { MessageInput as q } from "./message-input.js";
|
|
7
|
+
import { MessageList as H } from "./message-list.js";
|
|
8
|
+
import { PromptSuggestions as J } from "./prompt-suggestions.js";
|
|
9
|
+
import { useAutoScroll as K } from "../../hooks/use-auto-scroll.js";
|
|
10
|
+
import { cn as Q } from "../../lib/utils.js";
|
|
11
11
|
import { Typo as z } from "./typo.js";
|
|
12
12
|
import j from "../../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
13
13
|
import V from "../../node_modules/lucide-react/dist/esm/icons/thumbs-up.js";
|
|
14
14
|
import W from "../../node_modules/lucide-react/dist/esm/icons/thumbs-down.js";
|
|
15
15
|
import X from "../../node_modules/lucide-react/dist/esm/icons/arrow-down.js";
|
|
16
16
|
function Y({
|
|
17
|
-
messages:
|
|
17
|
+
messages: o,
|
|
18
18
|
welcomeTitle: n = "Da dove iniziamo?",
|
|
19
19
|
handleSubmit: i,
|
|
20
|
-
input:
|
|
20
|
+
input: f,
|
|
21
21
|
handleInputChange: c,
|
|
22
22
|
stop: s,
|
|
23
|
-
isGenerating:
|
|
24
|
-
append:
|
|
25
|
-
suggestions:
|
|
26
|
-
className:
|
|
27
|
-
onRateResponse:
|
|
23
|
+
isGenerating: w,
|
|
24
|
+
append: m,
|
|
25
|
+
suggestions: u,
|
|
26
|
+
className: g,
|
|
27
|
+
onRateResponse: N,
|
|
28
28
|
setMessages: x,
|
|
29
|
-
transcribeAudio:
|
|
30
|
-
allowAttachments:
|
|
29
|
+
transcribeAudio: D,
|
|
30
|
+
allowAttachments: L = !1,
|
|
31
31
|
onEdit: B,
|
|
32
32
|
onMessageSave: d
|
|
33
33
|
}) {
|
|
34
|
-
const P =
|
|
35
|
-
C.current =
|
|
34
|
+
const P = o.at(-1), T = o.length === 0, I = P?.role === "user", C = M(o);
|
|
35
|
+
C.current = o;
|
|
36
36
|
const U = k(() => {
|
|
37
37
|
if (s?.(), !x) return;
|
|
38
|
-
const
|
|
38
|
+
const e = [...C.current], l = e.findLast(
|
|
39
39
|
(a) => a.role === "assistant"
|
|
40
40
|
);
|
|
41
41
|
if (!l) return;
|
|
42
|
-
let
|
|
42
|
+
let h = !1, p = { ...l };
|
|
43
43
|
if (l.toolInvocations) {
|
|
44
44
|
const a = l.toolInvocations.map(
|
|
45
|
-
(r) => r.state === "call" ? (
|
|
45
|
+
(r) => r.state === "call" ? (h = !0, {
|
|
46
46
|
...r,
|
|
47
47
|
state: "result",
|
|
48
48
|
result: {
|
|
@@ -52,13 +52,13 @@ function Y({
|
|
|
52
52
|
}
|
|
53
53
|
}) : r
|
|
54
54
|
);
|
|
55
|
-
|
|
56
|
-
...
|
|
55
|
+
h && (p = {
|
|
56
|
+
...p,
|
|
57
57
|
toolInvocations: a
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
if (l.parts && l.parts.length > 0) {
|
|
61
|
-
const a = l.parts.map((r) => r.type === "tool-invocation" && r.toolInvocation && r.toolInvocation.state === "call" ? (
|
|
61
|
+
const a = l.parts.map((r) => r.type === "tool-invocation" && r.toolInvocation && r.toolInvocation.state === "call" ? (h = !0, {
|
|
62
62
|
...r,
|
|
63
63
|
toolInvocation: {
|
|
64
64
|
...r.toolInvocation,
|
|
@@ -69,73 +69,74 @@ function Y({
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}) : r);
|
|
72
|
-
|
|
73
|
-
...
|
|
72
|
+
h && (p = {
|
|
73
|
+
...p,
|
|
74
74
|
parts: a
|
|
75
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
|
-
if (
|
|
78
|
-
const a =
|
|
78
|
+
if (h) {
|
|
79
|
+
const a = e.findIndex(
|
|
79
80
|
(r) => r.id === l.id
|
|
80
81
|
);
|
|
81
|
-
a !== -1 && (
|
|
82
|
+
a !== -1 && (e[a] = p, x(e));
|
|
82
83
|
}
|
|
83
84
|
}, [s, x, C]), E = k(
|
|
84
|
-
(
|
|
85
|
-
actions:
|
|
85
|
+
(e) => ({
|
|
86
|
+
actions: N ? /* @__PURE__ */ b(y, { children: [
|
|
86
87
|
/* @__PURE__ */ t("div", { className: "border-d-border border-r pr-1", children: /* @__PURE__ */ t(
|
|
87
88
|
S,
|
|
88
89
|
{
|
|
89
|
-
content:
|
|
90
|
+
content: e.content,
|
|
90
91
|
copyMessage: "Copied response to clipboard!"
|
|
91
92
|
}
|
|
92
93
|
) }),
|
|
93
94
|
d && /* @__PURE__ */ t("div", { className: "border-d-border border-r pr-1", children: /* @__PURE__ */ t(
|
|
94
|
-
|
|
95
|
+
v,
|
|
95
96
|
{
|
|
96
97
|
size: "icon",
|
|
97
98
|
variant: "ghost",
|
|
98
99
|
className: "h-6 w-6",
|
|
99
|
-
onClick: () => d(
|
|
100
|
+
onClick: () => d(e.id, e.content),
|
|
100
101
|
title: "Save message",
|
|
101
102
|
children: /* @__PURE__ */ t(j, { className: "h-4 w-4" })
|
|
102
103
|
}
|
|
103
104
|
) }),
|
|
104
105
|
/* @__PURE__ */ t(
|
|
105
|
-
|
|
106
|
+
v,
|
|
106
107
|
{
|
|
107
108
|
size: "icon",
|
|
108
109
|
variant: "ghost",
|
|
109
110
|
className: "h-6 w-6",
|
|
110
|
-
onClick: () =>
|
|
111
|
+
onClick: () => N(e.id, "thumbs-up"),
|
|
111
112
|
children: /* @__PURE__ */ t(V, { className: "h-4 w-4" })
|
|
112
113
|
}
|
|
113
114
|
),
|
|
114
115
|
/* @__PURE__ */ t(
|
|
115
|
-
|
|
116
|
+
v,
|
|
116
117
|
{
|
|
117
118
|
size: "icon",
|
|
118
119
|
variant: "ghost",
|
|
119
120
|
className: "h-6 w-6",
|
|
120
|
-
onClick: () =>
|
|
121
|
+
onClick: () => N(e.id, "thumbs-down"),
|
|
121
122
|
children: /* @__PURE__ */ t(W, { className: "h-4 w-4" })
|
|
122
123
|
}
|
|
123
124
|
)
|
|
124
|
-
] }) : /* @__PURE__ */
|
|
125
|
+
] }) : /* @__PURE__ */ b(y, { children: [
|
|
125
126
|
/* @__PURE__ */ t(
|
|
126
127
|
S,
|
|
127
128
|
{
|
|
128
|
-
content:
|
|
129
|
+
content: e.content,
|
|
129
130
|
copyMessage: "Copied response to clipboard!"
|
|
130
131
|
}
|
|
131
132
|
),
|
|
132
133
|
d && /* @__PURE__ */ t("div", { className: "border-d-border border-l pl-1", children: /* @__PURE__ */ t(
|
|
133
|
-
|
|
134
|
+
v,
|
|
134
135
|
{
|
|
135
136
|
size: "icon",
|
|
136
137
|
variant: "ghost",
|
|
137
138
|
className: "h-6 w-6",
|
|
138
|
-
onClick: () => d(
|
|
139
|
+
onClick: () => d(e.id, e.content),
|
|
139
140
|
title: "Save message",
|
|
140
141
|
children: /* @__PURE__ */ t(j, { className: "h-4 w-4" })
|
|
141
142
|
}
|
|
@@ -143,48 +144,48 @@ function Y({
|
|
|
143
144
|
] }),
|
|
144
145
|
onMessageSave: d
|
|
145
146
|
}),
|
|
146
|
-
[
|
|
147
|
+
[N, d]
|
|
147
148
|
);
|
|
148
|
-
return /* @__PURE__ */
|
|
149
|
-
T && /* @__PURE__ */ t("div", { className: "flex flex-1 flex-col items-center justify-center p-8", children:
|
|
149
|
+
return /* @__PURE__ */ b(F, { className: g, children: [
|
|
150
|
+
T && /* @__PURE__ */ t("div", { className: "flex flex-1 flex-col items-center justify-center p-8", children: m && u && /* @__PURE__ */ b(y, { children: [
|
|
150
151
|
/* @__PURE__ */ t(z, { variant: "h3", className: "mb-8 text-center", children: n }),
|
|
151
152
|
/* @__PURE__ */ t(
|
|
152
|
-
|
|
153
|
+
J,
|
|
153
154
|
{
|
|
154
155
|
label: "",
|
|
155
|
-
append:
|
|
156
|
-
suggestions:
|
|
156
|
+
append: m,
|
|
157
|
+
suggestions: u
|
|
157
158
|
}
|
|
158
159
|
)
|
|
159
160
|
] }) }),
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
o.length > 0 ? /* @__PURE__ */ t(Z, { children: /* @__PURE__ */ t(
|
|
162
|
+
H,
|
|
162
163
|
{
|
|
163
|
-
messages:
|
|
164
|
+
messages: o,
|
|
164
165
|
isTyping: I,
|
|
165
166
|
messageOptions: E,
|
|
166
167
|
onEdit: B,
|
|
167
168
|
onMessageSave: d
|
|
168
169
|
}
|
|
169
170
|
) }) : null,
|
|
170
|
-
T && !
|
|
171
|
+
T && !m && !u && /* @__PURE__ */ t(z, { variant: "h3", className: "mb-8 text-center", children: n }),
|
|
171
172
|
/* @__PURE__ */ t(
|
|
172
173
|
_,
|
|
173
174
|
{
|
|
174
175
|
className: "flex-shrink-0",
|
|
175
|
-
isPending:
|
|
176
|
+
isPending: w || I,
|
|
176
177
|
handleSubmit: i,
|
|
177
|
-
children: ({ files:
|
|
178
|
-
|
|
178
|
+
children: ({ files: e, setFiles: l }) => /* @__PURE__ */ t(
|
|
179
|
+
q,
|
|
179
180
|
{
|
|
180
|
-
value:
|
|
181
|
+
value: f,
|
|
181
182
|
onChange: c,
|
|
182
|
-
allowAttachments:
|
|
183
|
-
files:
|
|
183
|
+
allowAttachments: L,
|
|
184
|
+
files: e,
|
|
184
185
|
setFiles: l,
|
|
185
186
|
stop: U,
|
|
186
|
-
isGenerating:
|
|
187
|
-
transcribeAudio:
|
|
187
|
+
isGenerating: w,
|
|
188
|
+
transcribeAudio: D
|
|
188
189
|
}
|
|
189
190
|
)
|
|
190
191
|
}
|
|
@@ -192,30 +193,27 @@ function Y({
|
|
|
192
193
|
] });
|
|
193
194
|
}
|
|
194
195
|
Y.displayName = "Chat";
|
|
195
|
-
function Z({
|
|
196
|
-
messages: e,
|
|
197
|
-
children: n
|
|
198
|
-
}) {
|
|
196
|
+
function Z({ children: o }) {
|
|
199
197
|
const {
|
|
200
|
-
containerRef:
|
|
201
|
-
scrollToBottom:
|
|
202
|
-
handleScroll:
|
|
203
|
-
shouldAutoScroll:
|
|
204
|
-
handleTouchStart:
|
|
205
|
-
} =
|
|
206
|
-
return /* @__PURE__ */
|
|
198
|
+
containerRef: n,
|
|
199
|
+
scrollToBottom: i,
|
|
200
|
+
handleScroll: f,
|
|
201
|
+
shouldAutoScroll: c,
|
|
202
|
+
handleTouchStart: s
|
|
203
|
+
} = K();
|
|
204
|
+
return /* @__PURE__ */ b(
|
|
207
205
|
"div",
|
|
208
206
|
{
|
|
209
207
|
className: "relative flex-1 overflow-y-auto pb-4",
|
|
210
|
-
ref:
|
|
211
|
-
onScroll:
|
|
212
|
-
onTouchStart:
|
|
208
|
+
ref: n,
|
|
209
|
+
onScroll: f,
|
|
210
|
+
onTouchStart: s,
|
|
213
211
|
children: [
|
|
214
|
-
/* @__PURE__ */ t("div", { className: "max-w-full", children:
|
|
215
|
-
!
|
|
216
|
-
|
|
212
|
+
/* @__PURE__ */ t("div", { className: "max-w-full", children: o }),
|
|
213
|
+
!c && /* @__PURE__ */ t("div", { className: "pointer-events-none absolute right-0 bottom-0 left-0 flex items-end justify-end", children: /* @__PURE__ */ t("div", { className: "sticky bottom-0 left-0 flex w-full justify-end", children: /* @__PURE__ */ t(
|
|
214
|
+
v,
|
|
217
215
|
{
|
|
218
|
-
onClick:
|
|
216
|
+
onClick: i,
|
|
219
217
|
className: "animate-in fade-in-0 slide-in-from-bottom-1 pointer-events-auto h-8 w-8 rounded-full ease-in-out",
|
|
220
218
|
size: "icon",
|
|
221
219
|
variant: "ghost",
|
|
@@ -226,34 +224,34 @@ function Z({
|
|
|
226
224
|
}
|
|
227
225
|
);
|
|
228
226
|
}
|
|
229
|
-
const F = A(({ className:
|
|
227
|
+
const F = A(({ className: o, ...n }, i) => /* @__PURE__ */ t(
|
|
230
228
|
"div",
|
|
231
229
|
{
|
|
232
230
|
ref: i,
|
|
233
|
-
className:
|
|
231
|
+
className: Q("flex h-full max-h-full w-full flex-col", o),
|
|
234
232
|
...n
|
|
235
233
|
}
|
|
236
234
|
));
|
|
237
235
|
F.displayName = "ChatContainer";
|
|
238
236
|
const _ = A(
|
|
239
|
-
({ children:
|
|
237
|
+
({ children: o, handleSubmit: n, className: i }, f) => {
|
|
240
238
|
const [c, s] = O(null);
|
|
241
|
-
return /* @__PURE__ */ t("form", { ref:
|
|
239
|
+
return /* @__PURE__ */ t("form", { ref: f, onSubmit: (m) => {
|
|
242
240
|
if (!c) {
|
|
243
|
-
n(
|
|
241
|
+
n(m);
|
|
244
242
|
return;
|
|
245
243
|
}
|
|
246
|
-
const
|
|
247
|
-
n(
|
|
248
|
-
}, className: i, children:
|
|
244
|
+
const u = $(c);
|
|
245
|
+
n(m, { experimental_attachments: u }), s(null);
|
|
246
|
+
}, className: i, children: o({ files: c, setFiles: s }) });
|
|
249
247
|
}
|
|
250
248
|
);
|
|
251
249
|
_.displayName = "ChatForm";
|
|
252
|
-
function $(
|
|
250
|
+
function $(o) {
|
|
253
251
|
if (typeof window > "u")
|
|
254
252
|
return {};
|
|
255
253
|
const n = new DataTransfer();
|
|
256
|
-
for (const i of Array.from(
|
|
254
|
+
for (const i of Array.from(o))
|
|
257
255
|
n.items.add(i);
|
|
258
256
|
return n.files;
|
|
259
257
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
import * as c from "react";
|
|
4
3
|
import { Command as d } from "../../node_modules/cmdk/dist/index.js";
|
|
5
|
-
import
|
|
4
|
+
import * as c from "react";
|
|
6
5
|
import { Dialog as i, DialogHeader as l, DialogTitle as p, DialogDescription as u, DialogContent as g } from "./dialog.js";
|
|
6
|
+
import { cn as a } from "../../lib/utils.js";
|
|
7
7
|
import f from "../../node_modules/lucide-react/dist/esm/icons/search.js";
|
|
8
8
|
const m = c.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ o(
|
|
9
9
|
d,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { Button as n } from "./button.js";
|
|
4
|
+
import { useCopyToClipboard as c } from "../../hooks/use-copy-to-clipboard.js";
|
|
3
5
|
import { cn as t } from "../../lib/utils.js";
|
|
4
|
-
import { useCopyToClipboard as n } from "../../hooks/use-copy-to-clipboard.js";
|
|
5
|
-
import { Button as c } from "./button.js";
|
|
6
6
|
import l from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
7
7
|
import m from "../../node_modules/lucide-react/dist/esm/icons/copy.js";
|
|
8
8
|
function y({ content: s, copyMessage: i }) {
|
|
9
|
-
const { isCopied: e, handleCopy: r } =
|
|
9
|
+
const { isCopied: e, handleCopy: r } = c({
|
|
10
10
|
text: s,
|
|
11
11
|
copyMessage: i
|
|
12
12
|
});
|
|
13
13
|
return /* @__PURE__ */ a(
|
|
14
|
-
|
|
14
|
+
n,
|
|
15
15
|
{
|
|
16
16
|
variant: "ghost",
|
|
17
17
|
size: "icon",
|