laif-ds 0.1.76 → 0.1.79
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/_virtual/prism-cpp.js +3 -0
- package/dist/_virtual/prism-cpp2.js +5 -0
- package/dist/_virtual/prism-java.js +3 -0
- package/dist/_virtual/prism-java2.js +5 -0
- package/dist/_virtual/prism-python.js +3 -0
- package/dist/_virtual/prism-python2.js +5 -0
- package/dist/_virtual/prism-rust.js +3 -0
- package/dist/_virtual/prism-rust2.js +5 -0
- package/dist/_virtual/prism-typescript.js +3 -0
- package/dist/_virtual/prism-typescript2.js +5 -0
- package/dist/_virtual/prism.js +3 -0
- package/dist/_virtual/prism2.js +5 -0
- package/dist/components/editor/context/toolbar-context.js +42 -0
- package/dist/components/editor/editor-hooks/use-modal.js +30 -0
- package/dist/components/editor/editor-hooks/use-update-toolbar.js +24 -0
- package/dist/components/editor/editor-ui/content-editable.js +26 -0
- package/dist/components/editor/plugins/actions/actions-plugin.js +7 -0
- package/dist/components/editor/plugins/actions/clear-editor-plugin.js +39 -0
- package/dist/components/editor/plugins/actions/counter-character-plugin.js +53 -0
- package/dist/components/editor/plugins/toolbar/block-format/block-format-data.js +52 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-bulleted-list.js +26 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-check-list.js +26 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-heading.js +31 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-numbered-list.js +26 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-paragraph.js +23 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-quote.js +24 -0
- package/dist/components/editor/plugins/toolbar/block-format-toolbar-plugin.js +56 -0
- package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +50 -0
- package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +69 -0
- package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +34 -0
- package/dist/components/editor/themes/editor-theme.js +112 -0
- package/dist/components/ui/accordion.js +1 -1
- package/dist/components/ui/alert-dialog.js +3 -3
- package/dist/components/ui/alert.js +3 -3
- package/dist/components/ui/app-editor.js +150 -0
- package/dist/components/ui/app-multiple-select-dropdown.js +13 -13
- package/dist/components/ui/async-select.js +18 -18
- package/dist/components/ui/button.js +25 -24
- package/dist/components/ui/calendar.js +9 -9
- package/dist/components/ui/card.js +26 -26
- package/dist/components/ui/chat-message.js +6 -6
- package/dist/components/ui/chat.js +44 -44
- package/dist/components/ui/context-menu.js +2 -2
- package/dist/components/ui/dialog.js +46 -40
- package/dist/components/ui/drawer.js +33 -33
- package/dist/components/ui/dropdown-menu.js +20 -20
- package/dist/components/ui/file-preview.js +51 -51
- package/dist/components/ui/gantt/components/Controls/Controls.js +51 -60
- package/dist/components/ui/hover-card.js +5 -5
- package/dist/components/ui/input-selector.js +19 -19
- package/dist/components/ui/interrupt-prompt.js +6 -6
- package/dist/components/ui/markdown-renderer.js +16 -16
- package/dist/components/ui/menubar.js +26 -26
- package/dist/components/ui/message-input.js +9 -9
- package/dist/components/ui/multiple-selector.js +20 -20
- package/dist/components/ui/navigation-menu.js +5 -5
- package/dist/components/ui/popover.js +4 -4
- package/dist/components/ui/prompt-suggestions.js +11 -11
- package/dist/components/ui/resizable.js +2 -2
- package/dist/components/ui/sheet.js +16 -16
- package/dist/components/ui/sidebar.js +24 -23
- package/dist/components/ui/table-skeleton.js +36 -36
- package/dist/components/ui/table.js +25 -25
- package/dist/components/ui/toggle-group.js +15 -15
- package/dist/components/ui/weekly-calendar/appointment-card.js +24 -24
- package/dist/index.d.ts +23 -1
- package/dist/index.js +48 -44
- package/dist/laif-ds.css +1 -0
- package/dist/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +159 -0
- package/dist/node_modules/@lexical/code/LexicalCode.prod.js +236 -0
- package/dist/node_modules/@lexical/dragon/LexicalDragon.prod.js +46 -0
- package/dist/node_modules/@lexical/history/LexicalHistory.prod.js +89 -0
- package/dist/node_modules/@lexical/html/LexicalHtml.prod.js +108 -0
- package/dist/node_modules/@lexical/link/LexicalLink.prod.js +187 -0
- package/dist/node_modules/@lexical/list/LexicalList.prod.js +729 -0
- package/dist/node_modules/@lexical/markdown/LexicalMarkdown.prod.js +367 -0
- package/dist/node_modules/@lexical/react/LexicalCheckListPlugin.prod.js +11 -0
- package/dist/node_modules/@lexical/react/LexicalClearEditorPlugin.prod.js +17 -0
- package/dist/node_modules/@lexical/react/LexicalComposer.prod.js +45 -0
- package/dist/node_modules/@lexical/react/LexicalComposerContext.prod.js +22 -0
- package/dist/node_modules/@lexical/react/LexicalContentEditable.prod.js +55 -0
- package/dist/node_modules/@lexical/react/LexicalErrorBoundary.prod.js +49 -0
- package/dist/node_modules/@lexical/react/LexicalHistoryPlugin.prod.js +15 -0
- package/dist/node_modules/@lexical/react/LexicalListPlugin.prod.js +17 -0
- package/dist/node_modules/@lexical/react/LexicalOnChangePlugin.prod.js +16 -0
- package/dist/node_modules/@lexical/react/LexicalRichTextPlugin.prod.js +56 -0
- package/dist/node_modules/@lexical/react/useLexicalEditable.prod.js +21 -0
- package/dist/node_modules/@lexical/rich-text/LexicalRichText.prod.js +376 -0
- package/dist/node_modules/@lexical/selection/LexicalSelection.prod.js +107 -0
- package/dist/node_modules/@lexical/table/LexicalTable.prod.js +661 -0
- package/dist/node_modules/@lexical/text/LexicalText.prod.js +37 -0
- package/dist/node_modules/@lexical/utils/LexicalUtils.prod.js +102 -0
- package/dist/node_modules/lexical/Lexical.prod.js +4901 -0
- package/dist/node_modules/prismjs/components/prism-c.js +77 -0
- package/dist/node_modules/prismjs/components/prism-clike.js +32 -0
- package/dist/node_modules/prismjs/components/prism-cpp.js +93 -0
- package/dist/node_modules/prismjs/components/prism-css.js +56 -0
- package/dist/node_modules/prismjs/components/prism-java.js +122 -0
- package/dist/node_modules/prismjs/components/prism-javascript.js +138 -0
- package/dist/node_modules/prismjs/components/prism-markdown.js +301 -0
- package/dist/node_modules/prismjs/components/prism-markup.js +174 -0
- package/dist/node_modules/prismjs/components/prism-objectivec.js +11 -0
- package/dist/node_modules/prismjs/components/prism-powershell.js +56 -0
- package/dist/node_modules/prismjs/components/prism-python.js +69 -0
- package/dist/node_modules/prismjs/components/prism-rust.js +124 -0
- package/dist/node_modules/prismjs/components/prism-sql.js +34 -0
- package/dist/node_modules/prismjs/components/prism-swift.js +114 -0
- package/dist/node_modules/prismjs/components/prism-typescript.js +53 -0
- package/dist/node_modules/prismjs/prism.js +1165 -0
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +12 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Root as
|
|
2
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
3
|
+
import { Root as v } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
4
4
|
import { cva as h } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
5
|
import { cn as l } from "../../lib/utils.js";
|
|
6
6
|
import { Icon as u } from "./icon.js";
|
|
@@ -12,7 +12,8 @@ const m = h(
|
|
|
12
12
|
default: "bg-d-primary text-d-primary-foreground shadow-xs hover:bg-d-primary/90",
|
|
13
13
|
destructive: "bg-d-destructive text-white shadow-xs hover:bg-d-destructive/90 focus-visible:ring-d-destructive/20 dark:focus-visible:ring-d-destructive/40 dark:bg-d-destructive/60",
|
|
14
14
|
outline: "border bg-d-background shadow-xs hover:bg-d-accent hover:text-d-accent-foreground dark:bg-d-input/30 dark:border-d-input dark:hover:bg-d-input/50",
|
|
15
|
-
|
|
15
|
+
"outline-primary": "border !border-d-primary bg-d-background shadow-xs text-d-primary/80 hover:!text-d-primary",
|
|
16
|
+
secondary: "bg-d-secondary text-d-secondary-foreground shadow-xs hover:bg-d-secondary/80 hover:text-d-secondary-foreground",
|
|
16
17
|
ghost: "hover:bg-d-accent hover:text-d-accent-foreground dark:hover:bg-d-accent/50",
|
|
17
18
|
link: "text-d-primary underline-offset-4 hover:underline"
|
|
18
19
|
},
|
|
@@ -31,40 +32,40 @@ const m = h(
|
|
|
31
32
|
);
|
|
32
33
|
function k({
|
|
33
34
|
className: d,
|
|
34
|
-
variant:
|
|
35
|
-
size:
|
|
36
|
-
asChild:
|
|
37
|
-
iconLeft:
|
|
38
|
-
iconRight:
|
|
39
|
-
isLoading:
|
|
35
|
+
variant: o,
|
|
36
|
+
size: r,
|
|
37
|
+
asChild: a = !1,
|
|
38
|
+
iconLeft: n,
|
|
39
|
+
iconRight: i,
|
|
40
|
+
isLoading: g = !1,
|
|
40
41
|
...t
|
|
41
42
|
}) {
|
|
42
|
-
const s =
|
|
43
|
-
return
|
|
43
|
+
const s = a ? v : "button";
|
|
44
|
+
return a ? /* @__PURE__ */ e(
|
|
44
45
|
s,
|
|
45
46
|
{
|
|
46
47
|
"data-slot": "button",
|
|
47
|
-
className: l(m({ variant:
|
|
48
|
+
className: l(m({ variant: o, size: r, className: d })),
|
|
48
49
|
...t
|
|
49
50
|
}
|
|
50
51
|
) : /* @__PURE__ */ c(
|
|
51
52
|
s,
|
|
52
53
|
{
|
|
53
54
|
"data-slot": "button",
|
|
54
|
-
className: l(m({ variant:
|
|
55
|
+
className: l(m({ variant: o, size: r, className: d }), "relative"),
|
|
55
56
|
...t,
|
|
56
57
|
children: [
|
|
57
|
-
|
|
58
|
+
g ? /* @__PURE__ */ c(
|
|
58
59
|
"svg",
|
|
59
60
|
{
|
|
60
61
|
className: "mr-1 -ml-1 animate-spin",
|
|
61
62
|
xmlns: "http://www.w3.org/2000/svg",
|
|
62
63
|
fill: "none",
|
|
63
64
|
viewBox: "0 0 24 24",
|
|
64
|
-
width:
|
|
65
|
-
height:
|
|
65
|
+
width: r === "sm" ? 14 : r === "lg" ? 20 : 16,
|
|
66
|
+
height: r === "sm" ? 14 : r === "lg" ? 20 : 16,
|
|
66
67
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ e(
|
|
68
69
|
"circle",
|
|
69
70
|
{
|
|
70
71
|
className: "opacity-25",
|
|
@@ -75,7 +76,7 @@ function k({
|
|
|
75
76
|
strokeWidth: "4"
|
|
76
77
|
}
|
|
77
78
|
),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ e(
|
|
79
80
|
"path",
|
|
80
81
|
{
|
|
81
82
|
className: "opacity-75",
|
|
@@ -85,19 +86,19 @@ function k({
|
|
|
85
86
|
)
|
|
86
87
|
]
|
|
87
88
|
}
|
|
88
|
-
) :
|
|
89
|
+
) : n && /* @__PURE__ */ e(
|
|
89
90
|
u,
|
|
90
91
|
{
|
|
91
|
-
name:
|
|
92
|
-
size:
|
|
92
|
+
name: n,
|
|
93
|
+
size: r === "default" ? "md" : r === "sm" ? "xs" : "sm"
|
|
93
94
|
}
|
|
94
95
|
),
|
|
95
96
|
t.children,
|
|
96
|
-
|
|
97
|
+
i && /* @__PURE__ */ e(
|
|
97
98
|
u,
|
|
98
99
|
{
|
|
99
|
-
name:
|
|
100
|
-
size:
|
|
100
|
+
name: i,
|
|
101
|
+
size: r === "default" ? "md" : r === "sm" ? "xs" : "sm"
|
|
101
102
|
}
|
|
102
103
|
)
|
|
103
104
|
]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
3
3
|
import * as g from "react";
|
|
4
4
|
import { cn as e } from "../../lib/utils.js";
|
|
5
5
|
import { buttonVariants as m, Button as b } from "./button.js";
|
|
@@ -19,7 +19,7 @@ function B({
|
|
|
19
19
|
...x
|
|
20
20
|
}) {
|
|
21
21
|
const t = f();
|
|
22
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ d(
|
|
23
23
|
w,
|
|
24
24
|
{
|
|
25
25
|
showOutsideDays: r,
|
|
@@ -114,24 +114,24 @@ function B({
|
|
|
114
114
|
...i
|
|
115
115
|
},
|
|
116
116
|
components: {
|
|
117
|
-
Root: ({ className: a, rootRef:
|
|
117
|
+
Root: ({ className: a, rootRef: n, ...o }) => /* @__PURE__ */ d(
|
|
118
118
|
"div",
|
|
119
119
|
{
|
|
120
120
|
"data-slot": "calendar",
|
|
121
|
-
ref:
|
|
121
|
+
ref: n,
|
|
122
122
|
className: e(a),
|
|
123
123
|
...o
|
|
124
124
|
}
|
|
125
125
|
),
|
|
126
|
-
Chevron: ({ className: a, orientation:
|
|
126
|
+
Chevron: ({ className: a, orientation: n, ...o }) => n === "left" ? /* @__PURE__ */ d(_, { className: e("size-4", a), ...o }) : n === "right" ? /* @__PURE__ */ d(
|
|
127
127
|
h,
|
|
128
128
|
{
|
|
129
129
|
className: e("size-4", a),
|
|
130
130
|
...o
|
|
131
131
|
}
|
|
132
|
-
) : /* @__PURE__ */
|
|
132
|
+
) : /* @__PURE__ */ d(y, { className: e("size-4", a), ...o }),
|
|
133
133
|
DayButton: v,
|
|
134
|
-
WeekNumber: ({ children: a, ...
|
|
134
|
+
WeekNumber: ({ children: a, ...n }) => /* @__PURE__ */ d("td", { ...n, children: /* @__PURE__ */ d("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: a }) }),
|
|
135
135
|
...p
|
|
136
136
|
},
|
|
137
137
|
...x
|
|
@@ -147,7 +147,7 @@ function v({
|
|
|
147
147
|
const s = f(), u = g.useRef(null);
|
|
148
148
|
return g.useEffect(() => {
|
|
149
149
|
r.focused && u.current?.focus();
|
|
150
|
-
}, [r.focused]), /* @__PURE__ */
|
|
150
|
+
}, [r.focused]), /* @__PURE__ */ d(
|
|
151
151
|
b,
|
|
152
152
|
{
|
|
153
153
|
ref: u,
|
|
@@ -159,7 +159,7 @@ function v({
|
|
|
159
159
|
"data-range-end": r.range_end,
|
|
160
160
|
"data-range-middle": r.range_middle,
|
|
161
161
|
className: e(
|
|
162
|
-
"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[
|
|
162
|
+
"data-[selected-single=true]:bg-d-primary data-[selected-single=true]:text-d-primary-foreground data-[range-middle=true]:bg-d-accent data-[range-middle=true]:text-d-accent-foreground data-[range-start=true]:bg-d-primary data-[range-start=true]:text-d-primary-foreground data-[range-end=true]:bg-d-primary data-[range-end=true]:text-d-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-d-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[1px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
|
|
163
163
|
s.day,
|
|
164
164
|
c
|
|
165
165
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import * as n from "react";
|
|
4
4
|
import { cn as o } from "../../lib/utils.js";
|
|
5
5
|
const s = n.createContext({
|
|
@@ -26,73 +26,73 @@ const s = n.createContext({
|
|
|
26
26
|
gap: ""
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
function l({ className:
|
|
30
|
-
return /* @__PURE__ */
|
|
29
|
+
function l({ className: a, size: t = "default", ...e }) {
|
|
30
|
+
return /* @__PURE__ */ r(s.Provider, { value: { size: t }, children: /* @__PURE__ */ r(
|
|
31
31
|
"div",
|
|
32
32
|
{
|
|
33
33
|
"data-slot": "card",
|
|
34
34
|
className: o(
|
|
35
|
-
`bg-d-card text-d-card-foreground
|
|
36
|
-
|
|
35
|
+
`bg-d-card text-d-card-foreground flex flex-col rounded-xl border shadow-sm ${d[t].py} ${d[t].gap}`,
|
|
36
|
+
a
|
|
37
37
|
),
|
|
38
|
-
...
|
|
38
|
+
...e
|
|
39
39
|
}
|
|
40
40
|
) });
|
|
41
41
|
}
|
|
42
|
-
function u({ className:
|
|
43
|
-
const { size:
|
|
44
|
-
return /* @__PURE__ */
|
|
42
|
+
function u({ className: a, ...t }) {
|
|
43
|
+
const { size: e } = n.useContext(s);
|
|
44
|
+
return /* @__PURE__ */ r(
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
47
47
|
"data-slot": "card-header",
|
|
48
48
|
className: o(
|
|
49
|
-
`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 ${d[
|
|
50
|
-
|
|
49
|
+
`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 ${d[e].px} has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,
|
|
50
|
+
a
|
|
51
51
|
),
|
|
52
52
|
...t
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
|
-
function x({ className:
|
|
57
|
-
return /* @__PURE__ */
|
|
56
|
+
function x({ className: a, ...t }) {
|
|
57
|
+
return /* @__PURE__ */ r(
|
|
58
58
|
"div",
|
|
59
59
|
{
|
|
60
60
|
"data-slot": "card-title",
|
|
61
|
-
className: o("leading-none font-semibold",
|
|
61
|
+
className: o("leading-none font-semibold", a),
|
|
62
62
|
...t
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
|
-
function f({ className:
|
|
67
|
-
return /* @__PURE__ */
|
|
66
|
+
function f({ className: a, ...t }) {
|
|
67
|
+
return /* @__PURE__ */ r(
|
|
68
68
|
"div",
|
|
69
69
|
{
|
|
70
70
|
"data-slot": "card-description",
|
|
71
|
-
className: o("text-d-secondary-foreground text-sm",
|
|
71
|
+
className: o("text-d-secondary-foreground text-sm", a),
|
|
72
72
|
...t
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
|
-
function m({ className:
|
|
77
|
-
const { size:
|
|
78
|
-
return /* @__PURE__ */
|
|
76
|
+
function m({ className: a, ...t }) {
|
|
77
|
+
const { size: e } = n.useContext(s);
|
|
78
|
+
return /* @__PURE__ */ r(
|
|
79
79
|
"div",
|
|
80
80
|
{
|
|
81
81
|
"data-slot": "card-content",
|
|
82
|
-
className: o(d[
|
|
82
|
+
className: o(d[e].px, a),
|
|
83
83
|
...t
|
|
84
84
|
}
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
|
-
function g({ className:
|
|
88
|
-
const { size:
|
|
89
|
-
return /* @__PURE__ */
|
|
87
|
+
function g({ className: a, ...t }) {
|
|
88
|
+
const { size: e } = n.useContext(s);
|
|
89
|
+
return /* @__PURE__ */ r(
|
|
90
90
|
"div",
|
|
91
91
|
{
|
|
92
92
|
"data-slot": "card-footer",
|
|
93
93
|
className: o(
|
|
94
|
-
`flex items-center ${d[
|
|
95
|
-
|
|
94
|
+
`flex items-center ${d[e].px} [.border-t]:pt-6`,
|
|
95
|
+
a
|
|
96
96
|
),
|
|
97
97
|
...t
|
|
98
98
|
}
|
|
@@ -110,7 +110,7 @@ const x = C(
|
|
|
110
110
|
children: /* @__PURE__ */ e(h, { children: l.text })
|
|
111
111
|
}
|
|
112
112
|
),
|
|
113
|
-
m ? /* @__PURE__ */ e("div", { className: "bg-d-background text-d-foreground
|
|
113
|
+
m ? /* @__PURE__ */ e("div", { className: "bg-d-background text-d-foreground absolute right-2 -bottom-4 flex space-x-1 rounded-lg border p-1 opacity-0 transition-opacity group-hover/message:opacity-100", children: m }) : null
|
|
114
114
|
] }),
|
|
115
115
|
c && n ? /* @__PURE__ */ e(
|
|
116
116
|
"time",
|
|
@@ -167,7 +167,7 @@ const F = ({ part: s }) => {
|
|
|
167
167
|
{
|
|
168
168
|
open: a,
|
|
169
169
|
onOpenChange: n,
|
|
170
|
-
className: "group bg-d-secondary/50
|
|
170
|
+
className: "group bg-d-secondary/50 w-full overflow-hidden rounded-lg border",
|
|
171
171
|
children: [
|
|
172
172
|
/* @__PURE__ */ e("div", { className: "flex items-center p-2", children: /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ r("button", { className: "text-d-secondary-foreground hover:text-d-foreground flex items-center gap-2 text-sm", children: [
|
|
173
173
|
/* @__PURE__ */ e(B, { className: "h-4 w-4 transition-transform group-data-[state=open]:rotate-90" }),
|
|
@@ -183,7 +183,7 @@ const F = ({ part: s }) => {
|
|
|
183
183
|
closed: { height: 0, opacity: 0 }
|
|
184
184
|
},
|
|
185
185
|
transition: { duration: 0.3, ease: [0.04, 0.62, 0.23, 0.98] },
|
|
186
|
-
className: "border-
|
|
186
|
+
className: "border-t",
|
|
187
187
|
children: /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e("div", { className: "text-xs whitespace-pre-wrap", children: s.reasoning }) })
|
|
188
188
|
}
|
|
189
189
|
) })
|
|
@@ -199,7 +199,7 @@ function y({
|
|
|
199
199
|
return /* @__PURE__ */ r(
|
|
200
200
|
"div",
|
|
201
201
|
{
|
|
202
|
-
className: "bg-d-secondary/50 text-d-secondary-foreground
|
|
202
|
+
className: "bg-d-secondary/50 text-d-secondary-foreground flex items-center gap-2 rounded-lg border px-3 py-2 text-sm",
|
|
203
203
|
children: [
|
|
204
204
|
/* @__PURE__ */ e(M, { className: "h-4 w-4" }),
|
|
205
205
|
/* @__PURE__ */ r("span", { children: [
|
|
@@ -221,7 +221,7 @@ function y({
|
|
|
221
221
|
return /* @__PURE__ */ r(
|
|
222
222
|
"div",
|
|
223
223
|
{
|
|
224
|
-
className: "bg-d-secondary/50 text-d-secondary-foreground
|
|
224
|
+
className: "bg-d-secondary/50 text-d-secondary-foreground flex items-center gap-2 rounded-lg border px-3 py-2 text-sm",
|
|
225
225
|
children: [
|
|
226
226
|
/* @__PURE__ */ e(I, { className: "h-4 w-4" }),
|
|
227
227
|
/* @__PURE__ */ r("span", { children: [
|
|
@@ -243,7 +243,7 @@ function y({
|
|
|
243
243
|
return /* @__PURE__ */ r(
|
|
244
244
|
"div",
|
|
245
245
|
{
|
|
246
|
-
className: "bg-d-secondary/50
|
|
246
|
+
className: "bg-d-secondary/50 flex flex-col gap-1.5 rounded-lg border px-3 py-2 text-sm",
|
|
247
247
|
children: [
|
|
248
248
|
/* @__PURE__ */ r("div", { className: "text-d-secondary-foreground flex items-center gap-2", children: [
|
|
249
249
|
/* @__PURE__ */ e(R, { className: "h-4 w-4" }),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as g, useRef as L, useCallback as
|
|
2
|
+
import { jsxs as x, jsx as t, Fragment as j } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as g, useRef as L, useCallback as b, useState as z } from "react";
|
|
4
4
|
import { cn as B } from "../../lib/utils.js";
|
|
5
5
|
import { useAutoScroll as D } from "../../hooks/use-auto-scroll.js";
|
|
6
|
-
import { Button as
|
|
6
|
+
import { Button as y } from "./button.js";
|
|
7
7
|
import { CopyButton as T } from "./copy-button.js";
|
|
8
8
|
import { MessageInput as P } from "./message-input.js";
|
|
9
9
|
import { MessageList as U } from "./message-list.js";
|
|
@@ -18,24 +18,24 @@ function J({
|
|
|
18
18
|
handleInputChange: u,
|
|
19
19
|
stop: s,
|
|
20
20
|
isGenerating: c,
|
|
21
|
-
append:
|
|
22
|
-
suggestions:
|
|
21
|
+
append: f,
|
|
22
|
+
suggestions: d,
|
|
23
23
|
className: w,
|
|
24
24
|
onRateResponse: p,
|
|
25
25
|
setMessages: v,
|
|
26
26
|
transcribeAudio: M
|
|
27
27
|
}) {
|
|
28
|
-
const k = e.at(-1), A = e.length === 0,
|
|
29
|
-
|
|
30
|
-
const F =
|
|
28
|
+
const k = e.at(-1), A = e.length === 0, N = k?.role === "user", C = L(e);
|
|
29
|
+
C.current = e;
|
|
30
|
+
const F = b(() => {
|
|
31
31
|
if (s?.(), !v) return;
|
|
32
|
-
const
|
|
32
|
+
const l = [...C.current], r = l.findLast(
|
|
33
33
|
(a) => a.role === "assistant"
|
|
34
34
|
);
|
|
35
|
-
if (!
|
|
36
|
-
let m = !1, h = { ...
|
|
37
|
-
if (
|
|
38
|
-
const a =
|
|
35
|
+
if (!r) return;
|
|
36
|
+
let m = !1, h = { ...r };
|
|
37
|
+
if (r.toolInvocations) {
|
|
38
|
+
const a = r.toolInvocations.map(
|
|
39
39
|
(o) => o.state === "call" ? (m = !0, {
|
|
40
40
|
...o,
|
|
41
41
|
state: "result",
|
|
@@ -51,8 +51,8 @@ function J({
|
|
|
51
51
|
toolInvocations: a
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
55
|
-
const a =
|
|
54
|
+
if (r.parts && r.parts.length > 0) {
|
|
55
|
+
const a = r.parts.map((o) => o.type === "tool-invocation" && o.toolInvocation && o.toolInvocation.state === "call" ? (m = !0, {
|
|
56
56
|
...o,
|
|
57
57
|
toolInvocation: {
|
|
58
58
|
...o.toolInvocation,
|
|
@@ -69,65 +69,65 @@ function J({
|
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
if (m) {
|
|
72
|
-
const a =
|
|
73
|
-
(o) => o.id ===
|
|
72
|
+
const a = l.findIndex(
|
|
73
|
+
(o) => o.id === r.id
|
|
74
74
|
);
|
|
75
|
-
a !== -1 && (
|
|
75
|
+
a !== -1 && (l[a] = h, v(l));
|
|
76
76
|
}
|
|
77
|
-
}, [s, v,
|
|
78
|
-
(
|
|
79
|
-
actions: p ? /* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */ t("div", { className: "border-
|
|
77
|
+
}, [s, v, C]), _ = b(
|
|
78
|
+
(l) => ({
|
|
79
|
+
actions: p ? /* @__PURE__ */ x(j, { children: [
|
|
80
|
+
/* @__PURE__ */ t("div", { className: "border-r pr-1", children: /* @__PURE__ */ t(
|
|
81
81
|
T,
|
|
82
82
|
{
|
|
83
|
-
content:
|
|
83
|
+
content: l.content,
|
|
84
84
|
copyMessage: "Copied response to clipboard!"
|
|
85
85
|
}
|
|
86
86
|
) }),
|
|
87
87
|
/* @__PURE__ */ t(
|
|
88
|
-
|
|
88
|
+
y,
|
|
89
89
|
{
|
|
90
90
|
size: "icon",
|
|
91
91
|
variant: "ghost",
|
|
92
92
|
className: "h-6 w-6",
|
|
93
|
-
onClick: () => p(
|
|
93
|
+
onClick: () => p(l.id, "thumbs-up"),
|
|
94
94
|
children: /* @__PURE__ */ t(O, { className: "h-4 w-4" })
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
97
|
/* @__PURE__ */ t(
|
|
98
|
-
|
|
98
|
+
y,
|
|
99
99
|
{
|
|
100
100
|
size: "icon",
|
|
101
101
|
variant: "ghost",
|
|
102
102
|
className: "h-6 w-6",
|
|
103
|
-
onClick: () => p(
|
|
103
|
+
onClick: () => p(l.id, "thumbs-down"),
|
|
104
104
|
children: /* @__PURE__ */ t(q, { className: "h-4 w-4" })
|
|
105
105
|
}
|
|
106
106
|
)
|
|
107
107
|
] }) : /* @__PURE__ */ t(
|
|
108
108
|
T,
|
|
109
109
|
{
|
|
110
|
-
content:
|
|
110
|
+
content: l.content,
|
|
111
111
|
copyMessage: "Copied response to clipboard!"
|
|
112
112
|
}
|
|
113
113
|
)
|
|
114
114
|
}),
|
|
115
115
|
[p]
|
|
116
116
|
);
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
-
A &&
|
|
117
|
+
return /* @__PURE__ */ x(S, { className: w, children: [
|
|
118
|
+
A && f && d ? /* @__PURE__ */ t(
|
|
119
119
|
E,
|
|
120
120
|
{
|
|
121
121
|
label: "Try these prompts ✨",
|
|
122
|
-
append:
|
|
123
|
-
suggestions:
|
|
122
|
+
append: f,
|
|
123
|
+
suggestions: d
|
|
124
124
|
}
|
|
125
125
|
) : null,
|
|
126
126
|
e.length > 0 ? /* @__PURE__ */ t(K, { messages: e, children: /* @__PURE__ */ t(
|
|
127
127
|
U,
|
|
128
128
|
{
|
|
129
129
|
messages: e,
|
|
130
|
-
isTyping:
|
|
130
|
+
isTyping: N,
|
|
131
131
|
messageOptions: _
|
|
132
132
|
}
|
|
133
133
|
) }) : null,
|
|
@@ -135,16 +135,16 @@ function J({
|
|
|
135
135
|
I,
|
|
136
136
|
{
|
|
137
137
|
className: "flex-shrink-0",
|
|
138
|
-
isPending: c ||
|
|
138
|
+
isPending: c || N,
|
|
139
139
|
handleSubmit: n,
|
|
140
|
-
children: ({ files:
|
|
140
|
+
children: ({ files: l, setFiles: r }) => /* @__PURE__ */ t(
|
|
141
141
|
P,
|
|
142
142
|
{
|
|
143
143
|
value: i,
|
|
144
144
|
onChange: u,
|
|
145
145
|
allowAttachments: !0,
|
|
146
|
-
files:
|
|
147
|
-
setFiles:
|
|
146
|
+
files: l,
|
|
147
|
+
setFiles: r,
|
|
148
148
|
stop: F,
|
|
149
149
|
isGenerating: c,
|
|
150
150
|
transcribeAudio: M
|
|
@@ -164,19 +164,19 @@ function K({
|
|
|
164
164
|
scrollToBottom: u,
|
|
165
165
|
handleScroll: s,
|
|
166
166
|
shouldAutoScroll: c,
|
|
167
|
-
handleTouchStart:
|
|
167
|
+
handleTouchStart: f
|
|
168
168
|
} = D([e]);
|
|
169
|
-
return /* @__PURE__ */
|
|
169
|
+
return /* @__PURE__ */ x(
|
|
170
170
|
"div",
|
|
171
171
|
{
|
|
172
172
|
className: "relative flex-1 overflow-y-auto pb-4",
|
|
173
173
|
ref: i,
|
|
174
174
|
onScroll: s,
|
|
175
|
-
onTouchStart:
|
|
175
|
+
onTouchStart: f,
|
|
176
176
|
children: [
|
|
177
177
|
/* @__PURE__ */ t("div", { className: "max-w-full", children: n }),
|
|
178
178
|
!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(
|
|
179
|
-
|
|
179
|
+
y,
|
|
180
180
|
{
|
|
181
181
|
onClick: u,
|
|
182
182
|
className: "animate-in fade-in-0 slide-in-from-bottom-1 pointer-events-auto h-8 w-8 rounded-full ease-in-out",
|
|
@@ -201,13 +201,13 @@ S.displayName = "ChatContainer";
|
|
|
201
201
|
const I = g(
|
|
202
202
|
({ children: e, handleSubmit: n, className: i }, u) => {
|
|
203
203
|
const [s, c] = z(null);
|
|
204
|
-
return /* @__PURE__ */ t("form", { ref: u, onSubmit: (
|
|
204
|
+
return /* @__PURE__ */ t("form", { ref: u, onSubmit: (d) => {
|
|
205
205
|
if (!s) {
|
|
206
|
-
n(
|
|
206
|
+
n(d);
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
209
|
const w = Q(s);
|
|
210
|
-
n(
|
|
210
|
+
n(d, { experimental_attachments: w }), c(null);
|
|
211
211
|
}, className: i, children: e({ files: s, setFiles: c }) });
|
|
212
212
|
}
|
|
213
213
|
);
|
|
@@ -73,7 +73,7 @@ function B({
|
|
|
73
73
|
{
|
|
74
74
|
"data-slot": "context-menu-sub-content",
|
|
75
75
|
className: a(
|
|
76
|
-
"bg-d-popover text-d-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2
|
|
76
|
+
"bg-d-popover text-d-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
77
77
|
t
|
|
78
78
|
),
|
|
79
79
|
...n
|
|
@@ -89,7 +89,7 @@ function D({
|
|
|
89
89
|
{
|
|
90
90
|
"data-slot": "context-menu-content",
|
|
91
91
|
className: a(
|
|
92
|
-
"bg-d-popover text-d-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2
|
|
92
|
+
"bg-d-popover text-d-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
93
93
|
t
|
|
94
94
|
),
|
|
95
95
|
...n
|