@chaibuilder/pages 0.16.24 → 0.16.25
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/{2AITGKQY-UndKMj-X.cjs → 2AITGKQY-Be359164.cjs} +1 -1
- package/dist/{2AITGKQY-Ir_ZXu1s.js → 2AITGKQY-CoZaZMrf.js} +2 -2
- package/dist/{NCMVHL6D-B3xcD0Vz.js → NCMVHL6D-C2p_bwgN.js} +2 -2
- package/dist/{NCMVHL6D-taGMv4he.cjs → NCMVHL6D-CmKLw38-.cjs} +1 -1
- package/dist/{ZDWCUMSJ-Cot4ixKZ.cjs → ZDWCUMSJ-DDHOTUX8.cjs} +1 -1
- package/dist/{ZDWCUMSJ-B1vApR00.js → ZDWCUMSJ-DmZy2MGb.js} +1 -1
- package/dist/{active-in-another-tab-Kp8LaYW5.js → active-in-another-tab-At1yEu4g.js} +1 -1
- package/dist/{active-in-another-tab-DYU7aCUa.cjs → active-in-another-tab-B1PAoWFL.cjs} +1 -1
- package/dist/{add-new-language-page-CkyPkpzC.cjs → add-new-language-page-B7fKZbYT.cjs} +1 -1
- package/dist/{add-new-language-page-0J2KTKg6.js → add-new-language-page-BfPVFqO4.js} +2 -2
- package/dist/{add-new-page-DPtVHa8m.cjs → add-new-page-DBVt7xSO.cjs} +1 -1
- package/dist/{add-new-page-BjxHUGIo.js → add-new-page-GZdKxwCY.js} +1 -1
- package/dist/{ai-panel-content-CMfopU0G.js → ai-panel-content-CWw-2gPV.js} +2 -2
- package/dist/{ai-panel-content-nmbQV7rT.cjs → ai-panel-content-Cv67WLJd.cjs} +1 -1
- package/dist/{ai-panel-default-lang-7L9rURdC.js → ai-panel-default-lang-B1WScOB4.js} +3 -3
- package/dist/{ai-panel-default-lang-B5eNybL4.cjs → ai-panel-default-lang-BBk6sSyh.cjs} +2 -2
- package/dist/{ai-panel-other-lang-DLn89TFE.cjs → ai-panel-other-lang-BrVV9nKv.cjs} +1 -1
- package/dist/{ai-panel-other-lang-U5XRqxbF.js → ai-panel-other-lang-DgNon2GH.js} +3 -3
- package/dist/{ai-prompt-input-B24vn-LG.js → ai-prompt-input-B6KsNLgP.js} +2 -2
- package/dist/ai-prompt-input-DSmIbsS_.cjs +1 -0
- package/dist/{ai-translation-prompt-CB67Sqo9.cjs → ai-translation-prompt-BYTviKVU.cjs} +1 -1
- package/dist/{ai-translation-prompt-cym054ja.js → ai-translation-prompt-CfnXqyai.js} +1 -1
- package/dist/button-CMMN5Cp4.cjs +1 -0
- package/dist/button-CggatMM3.js +48 -0
- package/dist/{continue-editing-in-this-client-BYJaymOL.cjs → continue-editing-in-this-client--Fzos10u.cjs} +1 -1
- package/dist/{continue-editing-in-this-client-BDYiQrbE.js → continue-editing-in-this-client--RRixZUo.js} +1 -1
- package/dist/{delete-page-BXEQB0Si.cjs → delete-page-BOuq3v6x.cjs} +1 -1
- package/dist/{delete-page-CvSN4E4V.js → delete-page-CeJdK5hc.js} +1 -1
- package/dist/{digital-asset-manager-CF1Lyc5K.cjs → digital-asset-manager-BUEa7fSG.cjs} +1 -1
- package/dist/{digital-asset-manager-BxbX7ji1.js → digital-asset-manager-D6GbpYDo.js} +1 -1
- package/dist/{duplicate-page-BFnuk1nL.js → duplicate-page-C7FjAbqP.js} +2 -2
- package/dist/{duplicate-page-C32_9H41.cjs → duplicate-page-Ch9Fn-Gu.cjs} +1 -1
- package/dist/{dynamic-page-selector-CLxpglyO.cjs → dynamic-page-selector-CZNYCxbJ.cjs} +1 -1
- package/dist/{dynamic-page-selector-CSTuQhej.js → dynamic-page-selector-C_-ihnB7.js} +1 -1
- package/dist/{index-Bre43r-W.cjs → index-CJcS3b8n.cjs} +5 -5
- package/dist/{index-tgsBai_8.js → index-CtRx3Y3K.js} +1039 -1028
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -7
- package/dist/{json-diff-viewer-2gVCV5T-.js → json-diff-viewer-DX4sQltt.js} +1 -1
- package/dist/{json-diff-viewer-34Sqd4il.cjs → json-diff-viewer-DluaC8tY.cjs} +1 -1
- package/dist/{lang-panel-CXIcTGVk.cjs → lang-panel-DFe4DfU4.cjs} +1 -1
- package/dist/{lang-panel-Cj0axCpE.js → lang-panel-p7OYw-2c.js} +2 -2
- package/dist/{mark-as-template-DKBwTiMJ.cjs → mark-as-template-Biqpp8uM.cjs} +1 -1
- package/dist/{mark-as-template-1TuznHtx.js → mark-as-template-CuPKgc5N.js} +1 -1
- package/dist/{no-language-page-content-C265--no.js → no-language-page-content-B_zNVuVO.js} +1 -1
- package/dist/{no-language-page-content-B8udZsi2.cjs → no-language-page-content-oy4ZcH34.cjs} +1 -1
- package/dist/{no-language-page-dialog-CctilPnb.cjs → no-language-page-dialog-CTRG81hU.cjs} +1 -1
- package/dist/{no-language-page-dialog-DgaP74-Y.js → no-language-page-dialog-Q2rvsEP6.js} +2 -2
- package/dist/{page-creator-NkF29o0S.cjs → page-creator-CVrbjJa-.cjs} +1 -1
- package/dist/{page-creator-Cer7L7dg.js → page-creator-b6UTCFeu.js} +2 -2
- package/dist/{page-lock-0qEG4sLX.cjs → page-lock-DUwWdppB.cjs} +1 -1
- package/dist/{page-lock-DNrP3AhL.js → page-lock-Dl5CmUgk.js} +2 -2
- package/dist/{page-locked-dialog-B9p5gIGE.cjs → page-locked-dialog-DeUMR-pV.cjs} +1 -1
- package/dist/{page-locked-dialog-U5eDKeBc.js → page-locked-dialog-MJ3kA-oQ.js} +1 -1
- package/dist/page-manager-new-C3XuiDiM.cjs +1 -0
- package/dist/page-manager-new-C8PGR_4a.js +394 -0
- package/dist/{page-manager-search-and-filter-DKrQdcb0.cjs → page-manager-search-and-filter-BdfXZwwH.cjs} +1 -1
- package/dist/{page-manager-search-and-filter-DDdYtDF7.js → page-manager-search-and-filter-DIz68YHL.js} +1 -1
- package/dist/{page-revisions-content-CoVYI0hI.js → page-revisions-content-BvYTXKgT.js} +2 -2
- package/dist/{page-revisions-content-NE8Y5DrC.cjs → page-revisions-content-CwrPL9kp.cjs} +1 -1
- package/dist/pages.css +1 -1
- package/dist/{publish-pages-content-KgbEbRVV.js → publish-pages-content-9VBFj6LH.js} +2 -2
- package/dist/{publish-pages-content-CCUKnVTH.cjs → publish-pages-content-DTPjR33T.cjs} +1 -1
- package/dist/{save-to-lib-CQmcDI5w.js → save-to-lib-Bkou78G6.js} +1 -1
- package/dist/{save-to-lib-C06RQn4k.cjs → save-to-lib-ByoB0FW5.cjs} +1 -1
- package/dist/selected-block-display-Auur5nl7.cjs +16 -0
- package/dist/selected-block-display-D1L4e4Cb.js +355 -0
- package/dist/{seo-panel-C-dqg-1A.js → seo-panel-KjxjFcdp.js} +16 -16
- package/dist/{seo-panel-hwJUoGfJ.cjs → seo-panel-Mjkh_Urn.cjs} +1 -1
- package/dist/{shared-json-ld-BP2l89h2.cjs → shared-json-ld-DYD7q8ST.cjs} +1 -1
- package/dist/{shared-json-ld-BUPafGh_.js → shared-json-ld-S9OIaOTA.js} +1 -1
- package/dist/{slug-input-91_G-ww1.cjs → slug-input-C0BtQs2w.cjs} +1 -1
- package/dist/{slug-input-hcJHNszn.js → slug-input-CUTtvZQ9.js} +1 -1
- package/dist/{take-over-request-Dw2P9U_Q.js → take-over-request-CXED2804.js} +1 -1
- package/dist/{take-over-request-kRGwkXvv.cjs → take-over-request-Dh9HVZPO.cjs} +1 -1
- package/dist/{theme-panel-footer-2qsvp4AM.js → theme-panel-footer-CftO53LS.js} +1 -1
- package/dist/{theme-panel-footer-DmO4-lci.cjs → theme-panel-footer-tdNtbqZs.cjs} +1 -1
- package/dist/{unmark-as-template-DbXx3l6p.js → unmark-as-template-Dp6S9dY3.js} +1 -1
- package/dist/{unmark-as-template-BBzZqNJt.cjs → unmark-as-template-DyUqAa9Z.cjs} +1 -1
- package/dist/{unpublish-page-BKQqPk_e.js → unpublish-page-c382vh74.js} +1 -1
- package/dist/{unpublish-page-CHYNjTFU.cjs → unpublish-page-ch791au1.cjs} +1 -1
- package/dist/{web-preview-BKoPv6AO.js → web-preview-DiOChE4E.js} +1 -1
- package/dist/{web-preview-D4KdtUYp.cjs → web-preview-cls5-Dlv.cjs} +1 -1
- package/package.json +3 -3
- package/dist/ai-prompt-input-6LzuYu5L.cjs +0 -1
- package/dist/page-manager-new-BL5S9ccS.cjs +0 -1
- package/dist/page-manager-new-DGaBkeJp.js +0 -354
- package/dist/selected-block-display-7n8S3vf1.js +0 -394
- package/dist/selected-block-display-DDC1_UC8.cjs +0 -16
|
@@ -1,394 +0,0 @@
|
|
|
1
|
-
import { jsx as s, jsxs as l, Fragment as g } from "react/jsx-runtime";
|
|
2
|
-
import { ArrowDownIcon as P, BrainIcon as $, ChevronDownIcon as D, X as j } from "lucide-react";
|
|
3
|
-
import * as x from "react";
|
|
4
|
-
import { useCallback as G, createContext as E, memo as d, useMemo as Q, useState as w, useEffect as y, useContext as V } from "react";
|
|
5
|
-
import { StickToBottom as R, useStickToBottomContext as F } from "use-stick-to-bottom";
|
|
6
|
-
import { Slot as K } from "@radix-ui/react-slot";
|
|
7
|
-
import { cva as S } from "class-variance-authority";
|
|
8
|
-
import { clsx as Y } from "clsx";
|
|
9
|
-
import { twMerge as J } from "tailwind-merge";
|
|
10
|
-
import * as k from "@radix-ui/react-separator";
|
|
11
|
-
import * as z from "@radix-ui/react-tooltip";
|
|
12
|
-
import { Streamdown as A } from "streamdown";
|
|
13
|
-
import * as b from "@radix-ui/react-collapsible";
|
|
14
|
-
import { useControllableState as T } from "@radix-ui/react-use-controllable-state";
|
|
15
|
-
import { motion as X } from "motion/react";
|
|
16
|
-
import { L as h } from "./index-tgsBai_8.js";
|
|
17
|
-
import { useTranslation as q, useSelectedBlock as H } from "@chaibuilder/sdk";
|
|
18
|
-
import { Button as W } from "@chaibuilder/sdk/ui";
|
|
19
|
-
function a(...e) {
|
|
20
|
-
return J(Y(e));
|
|
21
|
-
}
|
|
22
|
-
const Z = S(
|
|
23
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
24
|
-
{
|
|
25
|
-
variants: {
|
|
26
|
-
variant: {
|
|
27
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
28
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
29
|
-
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
30
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
31
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
32
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
33
|
-
},
|
|
34
|
-
size: {
|
|
35
|
-
default: "h-10 px-4 py-2",
|
|
36
|
-
sm: "h-9 rounded-md px-3",
|
|
37
|
-
lg: "h-11 rounded-md px-8",
|
|
38
|
-
icon: "h-10 w-10"
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
defaultVariants: {
|
|
42
|
-
variant: "default",
|
|
43
|
-
size: "default"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
), U = x.forwardRef(
|
|
47
|
-
({ className: e, variant: t, size: o, asChild: n = !1, ...r }, i) => /* @__PURE__ */ s(
|
|
48
|
-
n ? K : "button",
|
|
49
|
-
{
|
|
50
|
-
className: a(Z({ variant: t, size: o, className: e })),
|
|
51
|
-
ref: i,
|
|
52
|
-
...r
|
|
53
|
-
}
|
|
54
|
-
)
|
|
55
|
-
);
|
|
56
|
-
U.displayName = "Button";
|
|
57
|
-
const ke = ({ className: e, ...t }) => /* @__PURE__ */ s(
|
|
58
|
-
R,
|
|
59
|
-
{
|
|
60
|
-
className: a("relative flex-1 overflow-y-hidden", e),
|
|
61
|
-
initial: "smooth",
|
|
62
|
-
resize: "smooth",
|
|
63
|
-
role: "log",
|
|
64
|
-
...t
|
|
65
|
-
}
|
|
66
|
-
), ze = ({
|
|
67
|
-
className: e,
|
|
68
|
-
...t
|
|
69
|
-
}) => /* @__PURE__ */ s(
|
|
70
|
-
R.Content,
|
|
71
|
-
{
|
|
72
|
-
className: a("flex flex-col gap-8 p-4", e),
|
|
73
|
-
...t
|
|
74
|
-
}
|
|
75
|
-
), Ae = ({
|
|
76
|
-
className: e,
|
|
77
|
-
title: t = "No messages yet",
|
|
78
|
-
description: o = "Start a conversation to see messages here",
|
|
79
|
-
icon: n,
|
|
80
|
-
children: r,
|
|
81
|
-
...i
|
|
82
|
-
}) => /* @__PURE__ */ s(
|
|
83
|
-
"div",
|
|
84
|
-
{
|
|
85
|
-
className: a(
|
|
86
|
-
"flex size-full flex-col items-center justify-center gap-3 p-8 text-center",
|
|
87
|
-
e
|
|
88
|
-
),
|
|
89
|
-
...i,
|
|
90
|
-
children: r ?? /* @__PURE__ */ l(g, { children: [
|
|
91
|
-
n && /* @__PURE__ */ s("div", { className: "text-muted-foreground", children: n }),
|
|
92
|
-
/* @__PURE__ */ l("div", { className: "space-y-1", children: [
|
|
93
|
-
/* @__PURE__ */ s("h3", { className: "font-medium text-sm", children: t }),
|
|
94
|
-
o && /* @__PURE__ */ s("p", { className: "text-muted-foreground text-sm", children: o })
|
|
95
|
-
] })
|
|
96
|
-
] })
|
|
97
|
-
}
|
|
98
|
-
), Ue = ({
|
|
99
|
-
className: e,
|
|
100
|
-
...t
|
|
101
|
-
}) => {
|
|
102
|
-
const { isAtBottom: o, scrollToBottom: n } = F(), r = G(() => {
|
|
103
|
-
n();
|
|
104
|
-
}, [n]);
|
|
105
|
-
return !o && /* @__PURE__ */ s(
|
|
106
|
-
U,
|
|
107
|
-
{
|
|
108
|
-
className: a(
|
|
109
|
-
"absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full",
|
|
110
|
-
e
|
|
111
|
-
),
|
|
112
|
-
onClick: r,
|
|
113
|
-
size: "icon",
|
|
114
|
-
type: "button",
|
|
115
|
-
variant: "outline",
|
|
116
|
-
...t,
|
|
117
|
-
children: /* @__PURE__ */ s(P, { className: "size-4" })
|
|
118
|
-
}
|
|
119
|
-
);
|
|
120
|
-
}, ee = x.forwardRef(
|
|
121
|
-
({ className: e, orientation: t = "horizontal", decorative: o = !0, ...n }, r) => /* @__PURE__ */ s(
|
|
122
|
-
k.Root,
|
|
123
|
-
{
|
|
124
|
-
ref: r,
|
|
125
|
-
decorative: o,
|
|
126
|
-
orientation: t,
|
|
127
|
-
className: a(
|
|
128
|
-
"shrink-0 bg-border",
|
|
129
|
-
t === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
130
|
-
e
|
|
131
|
-
),
|
|
132
|
-
...n
|
|
133
|
-
}
|
|
134
|
-
)
|
|
135
|
-
);
|
|
136
|
-
ee.displayName = k.Root.displayName;
|
|
137
|
-
S(
|
|
138
|
-
"flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
139
|
-
{
|
|
140
|
-
variants: {
|
|
141
|
-
orientation: {
|
|
142
|
-
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
143
|
-
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
defaultVariants: {
|
|
147
|
-
orientation: "horizontal"
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
);
|
|
151
|
-
const te = x.forwardRef(({ className: e, sideOffset: t = 4, ...o }, n) => /* @__PURE__ */ s(
|
|
152
|
-
z.Content,
|
|
153
|
-
{
|
|
154
|
-
ref: n,
|
|
155
|
-
sideOffset: t,
|
|
156
|
-
className: a(
|
|
157
|
-
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 origin-[--radix-tooltip-content-transform-origin]",
|
|
158
|
-
e
|
|
159
|
-
),
|
|
160
|
-
...o
|
|
161
|
-
}
|
|
162
|
-
));
|
|
163
|
-
te.displayName = z.Content.displayName;
|
|
164
|
-
const Me = ({ className: e, from: t, ...o }) => /* @__PURE__ */ s(
|
|
165
|
-
"div",
|
|
166
|
-
{
|
|
167
|
-
className: a(
|
|
168
|
-
"group flex w-full max-w-[80%] flex-col gap-2",
|
|
169
|
-
t === "user" ? "is-user ml-auto justify-end" : "is-assistant",
|
|
170
|
-
e
|
|
171
|
-
),
|
|
172
|
-
...o
|
|
173
|
-
}
|
|
174
|
-
), Be = ({ children: e, className: t, ...o }) => /* @__PURE__ */ s(
|
|
175
|
-
"div",
|
|
176
|
-
{
|
|
177
|
-
className: a(
|
|
178
|
-
"is-user:dark flex w-fit flex-col gap-2 overflow-hidden text-sm",
|
|
179
|
-
"group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground",
|
|
180
|
-
"group-[.is-assistant]:text-foreground",
|
|
181
|
-
t
|
|
182
|
-
),
|
|
183
|
-
...o,
|
|
184
|
-
children: e
|
|
185
|
-
}
|
|
186
|
-
);
|
|
187
|
-
E(null);
|
|
188
|
-
const oe = d(
|
|
189
|
-
({ className: e, ...t }) => /* @__PURE__ */ s(A, { className: a("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", e), ...t }),
|
|
190
|
-
(e, t) => e.children === t.children
|
|
191
|
-
);
|
|
192
|
-
oe.displayName = "MessageResponse";
|
|
193
|
-
const ne = b.Root, se = b.CollapsibleTrigger, re = b.CollapsibleContent, ae = ({
|
|
194
|
-
children: e,
|
|
195
|
-
as: t = "p",
|
|
196
|
-
className: o,
|
|
197
|
-
duration: n = 2,
|
|
198
|
-
spread: r = 2
|
|
199
|
-
}) => {
|
|
200
|
-
const i = X.create(
|
|
201
|
-
t
|
|
202
|
-
), c = Q(
|
|
203
|
-
() => ((e == null ? void 0 : e.length) ?? 0) * r,
|
|
204
|
-
[e, r]
|
|
205
|
-
);
|
|
206
|
-
return /* @__PURE__ */ s(
|
|
207
|
-
i,
|
|
208
|
-
{
|
|
209
|
-
animate: { backgroundPosition: "0% center" },
|
|
210
|
-
className: a(
|
|
211
|
-
"relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent",
|
|
212
|
-
"[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",
|
|
213
|
-
o
|
|
214
|
-
),
|
|
215
|
-
initial: { backgroundPosition: "100% center" },
|
|
216
|
-
style: {
|
|
217
|
-
"--spread": `${c}px`,
|
|
218
|
-
backgroundImage: "var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"
|
|
219
|
-
},
|
|
220
|
-
transition: {
|
|
221
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
222
|
-
duration: n,
|
|
223
|
-
ease: "linear"
|
|
224
|
-
},
|
|
225
|
-
children: e
|
|
226
|
-
}
|
|
227
|
-
);
|
|
228
|
-
}, M = d(ae), B = E(null), ie = () => {
|
|
229
|
-
const e = V(B);
|
|
230
|
-
if (!e)
|
|
231
|
-
throw new Error("Reasoning components must be used within Reasoning");
|
|
232
|
-
return e;
|
|
233
|
-
}, le = 1e3, de = 1e3, ce = d(
|
|
234
|
-
({
|
|
235
|
-
className: e,
|
|
236
|
-
isStreaming: t = !1,
|
|
237
|
-
open: o,
|
|
238
|
-
defaultOpen: n = !0,
|
|
239
|
-
onOpenChange: r,
|
|
240
|
-
duration: i,
|
|
241
|
-
children: c,
|
|
242
|
-
..._
|
|
243
|
-
}) => {
|
|
244
|
-
const [m, u] = T({
|
|
245
|
-
prop: o,
|
|
246
|
-
defaultProp: n,
|
|
247
|
-
onChange: r
|
|
248
|
-
}), [I, v] = T({
|
|
249
|
-
prop: i,
|
|
250
|
-
defaultProp: void 0
|
|
251
|
-
}), [N, L] = w(!1), [f, C] = w(null);
|
|
252
|
-
y(() => {
|
|
253
|
-
t ? f === null && C(Date.now()) : f !== null && (v(Math.ceil((Date.now() - f) / de)), C(null));
|
|
254
|
-
}, [t, f, v]), y(() => {
|
|
255
|
-
if (n && !t && m && !N) {
|
|
256
|
-
const p = setTimeout(() => {
|
|
257
|
-
u(!1), L(!0);
|
|
258
|
-
}, le);
|
|
259
|
-
return () => clearTimeout(p);
|
|
260
|
-
}
|
|
261
|
-
}, [t, m, n, u, N]);
|
|
262
|
-
const O = (p) => {
|
|
263
|
-
u(p);
|
|
264
|
-
};
|
|
265
|
-
return /* @__PURE__ */ s(B.Provider, { value: { isStreaming: t, isOpen: m, setIsOpen: u, duration: I }, children: /* @__PURE__ */ s(
|
|
266
|
-
ne,
|
|
267
|
-
{
|
|
268
|
-
className: a("not-prose mb-4", e),
|
|
269
|
-
onOpenChange: O,
|
|
270
|
-
open: m,
|
|
271
|
-
..._,
|
|
272
|
-
children: c
|
|
273
|
-
}
|
|
274
|
-
) });
|
|
275
|
-
}
|
|
276
|
-
), me = (e, t) => e || t === 0 ? /* @__PURE__ */ s(M, { duration: 1, children: "Thinking..." }) : t === void 0 ? /* @__PURE__ */ s("p", { children: "Thought for a few seconds" }) : /* @__PURE__ */ l("p", { children: [
|
|
277
|
-
"Thought for ",
|
|
278
|
-
t,
|
|
279
|
-
" seconds"
|
|
280
|
-
] }), ue = d(({ className: e, children: t, ...o }) => {
|
|
281
|
-
const { isStreaming: n, isOpen: r, duration: i } = ie();
|
|
282
|
-
return /* @__PURE__ */ s(
|
|
283
|
-
se,
|
|
284
|
-
{
|
|
285
|
-
className: a(
|
|
286
|
-
"flex w-full items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground",
|
|
287
|
-
e
|
|
288
|
-
),
|
|
289
|
-
...o,
|
|
290
|
-
children: t ?? /* @__PURE__ */ l(g, { children: [
|
|
291
|
-
/* @__PURE__ */ s($, { className: "size-4" }),
|
|
292
|
-
me(n, i),
|
|
293
|
-
/* @__PURE__ */ s(D, { className: a("size-4 transition-transform", r ? "rotate-180" : "rotate-0") })
|
|
294
|
-
] })
|
|
295
|
-
}
|
|
296
|
-
);
|
|
297
|
-
}), fe = d(({ className: e, children: t, ...o }) => /* @__PURE__ */ s(
|
|
298
|
-
re,
|
|
299
|
-
{
|
|
300
|
-
className: a(
|
|
301
|
-
"mt-4 text-sm",
|
|
302
|
-
"text-muted-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2",
|
|
303
|
-
e
|
|
304
|
-
),
|
|
305
|
-
...o,
|
|
306
|
-
children: /* @__PURE__ */ s(A, { ...o, children: t })
|
|
307
|
-
}
|
|
308
|
-
));
|
|
309
|
-
ce.displayName = "Reasoning";
|
|
310
|
-
ue.displayName = "ReasoningTrigger";
|
|
311
|
-
fe.displayName = "ReasoningContent";
|
|
312
|
-
const _e = ({ className: e, content: t, isLoading: o = !1, ...n }) => /* @__PURE__ */ s("div", { className: a("is-assistant flex w-full max-w-[80%] flex-col gap-2", e), ...n, children: /* @__PURE__ */ s("div", { className: "flex w-fit flex-col gap-2 overflow-hidden text-sm", children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2 rounded-lg border border-muted-foreground/20 bg-muted/50 p-3", children: /* @__PURE__ */ l("div", { className: "flex flex-1 items-center gap-2", children: [
|
|
313
|
-
o && /* @__PURE__ */ s(M, { duration: 1.5, children: t }),
|
|
314
|
-
!o && /* @__PURE__ */ s("div", { className: "text-xs text-muted-foreground", children: t })
|
|
315
|
-
] }) }) }) });
|
|
316
|
-
function Ie({
|
|
317
|
-
userInput: e,
|
|
318
|
-
language: t = "en",
|
|
319
|
-
currentHtml: o
|
|
320
|
-
}) {
|
|
321
|
-
const n = h[t] || "English";
|
|
322
|
-
return o && o.trim().length > 0 ? `
|
|
323
|
-
MODE: EDIT
|
|
324
|
-
CURRENT HTML:
|
|
325
|
-
${o}
|
|
326
|
-
|
|
327
|
-
USER REQUEST: ${e}
|
|
328
|
-
Use ${n} language.
|
|
329
|
-
`.trim() : `
|
|
330
|
-
USER REQUEST: ${e}
|
|
331
|
-
Use ${n} language.
|
|
332
|
-
`.trim();
|
|
333
|
-
}
|
|
334
|
-
function Le({
|
|
335
|
-
fallbackLang: e,
|
|
336
|
-
language: t,
|
|
337
|
-
blocks: o = [],
|
|
338
|
-
userInput: n
|
|
339
|
-
}) {
|
|
340
|
-
const r = h[t] || "English";
|
|
341
|
-
return `
|
|
342
|
-
USER REQUEST: ${n || "Translate the content"}
|
|
343
|
-
LANGUAGE TO TRANSLATE: ${r}
|
|
344
|
-
REQUESTED TRANSLATION LANGUAGE CODE: ${t}
|
|
345
|
-
FALLBACK LANGUAGE: ${h[e]}
|
|
346
|
-
BLOCKS: ${JSON.stringify(o)}`.trim();
|
|
347
|
-
}
|
|
348
|
-
const Oe = ({ onRemove: e, isLoading: t = !1 }) => {
|
|
349
|
-
const { t: o } = q(), n = H(), r = (n == null ? void 0 : n._type) || "Unknown", i = (n == null ? void 0 : n._name) || r;
|
|
350
|
-
return /* @__PURE__ */ s(g, { children: /* @__PURE__ */ l("div", { className: "mx-auto flex w-[95%] items-center justify-between rounded-t-md border border-b-0 border-blue-200 bg-blue-50", children: [
|
|
351
|
-
/* @__PURE__ */ l("div", { className: "flex items-center", children: [
|
|
352
|
-
/* @__PURE__ */ s("div", { className: "flex h-6 w-6 items-center justify-center rounded-l rounded-bl-none bg-blue-500 text-xs font-semibold text-white", children: "@" }),
|
|
353
|
-
/* @__PURE__ */ s("div", { className: "flex w-[95%] flex-col", children: n ? /* @__PURE__ */ s(g, { children: /* @__PURE__ */ l("span", { className: "truncate text-xs font-medium text-blue-900", children: [
|
|
354
|
-
" ",
|
|
355
|
-
o("Context: "),
|
|
356
|
-
" ",
|
|
357
|
-
i
|
|
358
|
-
] }) }) : /* @__PURE__ */ l("span", { className: "text-xs font-medium text-blue-900", children: [
|
|
359
|
-
" ",
|
|
360
|
-
o("Context: Entire Page")
|
|
361
|
-
] }) })
|
|
362
|
-
] }),
|
|
363
|
-
n && /* @__PURE__ */ s(
|
|
364
|
-
W,
|
|
365
|
-
{
|
|
366
|
-
variant: "ghost",
|
|
367
|
-
size: "icon",
|
|
368
|
-
onClick: e,
|
|
369
|
-
disabled: t,
|
|
370
|
-
className: "h-6 w-6 text-blue-600 hover:bg-blue-100 hover:text-blue-800",
|
|
371
|
-
title: "Remove block from context",
|
|
372
|
-
children: /* @__PURE__ */ s(j, { size: 14 })
|
|
373
|
-
}
|
|
374
|
-
)
|
|
375
|
-
] }) });
|
|
376
|
-
};
|
|
377
|
-
export {
|
|
378
|
-
U as B,
|
|
379
|
-
ke as C,
|
|
380
|
-
Me as M,
|
|
381
|
-
ce as R,
|
|
382
|
-
Oe as S,
|
|
383
|
-
_e as T,
|
|
384
|
-
ze as a,
|
|
385
|
-
Ae as b,
|
|
386
|
-
ue as c,
|
|
387
|
-
fe as d,
|
|
388
|
-
Be as e,
|
|
389
|
-
oe as f,
|
|
390
|
-
Le as g,
|
|
391
|
-
Ue as h,
|
|
392
|
-
Ie as i,
|
|
393
|
-
a as j
|
|
394
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";const o=require("react/jsx-runtime"),g=require("lucide-react"),i=require("react"),h=require("use-stick-to-bottom"),L=require("@radix-ui/react-slot"),T=require("class-variance-authority"),G=require("clsx"),I=require("tailwind-merge"),$=require("@radix-ui/react-separator"),F=require("@radix-ui/react-tooltip"),R=require("streamdown"),V=require("@radix-ui/react-collapsible"),w=require("@radix-ui/react-use-controllable-state"),Q=require("motion/react"),p=require("./index-Bre43r-W.cjs"),y=require("@chaibuilder/sdk"),K=require("@chaibuilder/sdk/ui");function f(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const b=f(i),E=f($),k=f(F),v=f(V);function a(...e){return I.twMerge(G.clsx(e))}const Y=T.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),N=b.forwardRef(({className:e,variant:t,size:s,asChild:n=!1,...r},l)=>{const c=n?L.Slot:"button";return o.jsx(c,{className:a(Y({variant:t,size:s,className:e})),ref:l,...r})});N.displayName="Button";const J=({className:e,...t})=>o.jsx(h.StickToBottom,{className:a("relative flex-1 overflow-y-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),X=({className:e,...t})=>o.jsx(h.StickToBottom.Content,{className:a("flex flex-col gap-8 p-4",e),...t}),H=({className:e,title:t="No messages yet",description:s="Start a conversation to see messages here",icon:n,children:r,...l})=>o.jsx("div",{className:a("flex size-full flex-col items-center justify-center gap-3 p-8 text-center",e),...l,children:r??o.jsxs(o.Fragment,{children:[n&&o.jsx("div",{className:"text-muted-foreground",children:n}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("h3",{className:"font-medium text-sm",children:t}),s&&o.jsx("p",{className:"text-muted-foreground text-sm",children:s})]})]})}),W=({className:e,...t})=>{const{isAtBottom:s,scrollToBottom:n}=h.useStickToBottomContext(),r=i.useCallback(()=>{n()},[n]);return!s&&o.jsx(N,{className:a("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full",e),onClick:r,size:"icon",type:"button",variant:"outline",...t,children:o.jsx(g.ArrowDownIcon,{className:"size-4"})})},Z=b.forwardRef(({className:e,orientation:t="horizontal",decorative:s=!0,...n},r)=>o.jsx(E.Root,{ref:r,decorative:s,orientation:t,className:a("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Z.displayName=E.Root.displayName;T.cva("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});const ee=b.forwardRef(({className:e,sideOffset:t=4,...s},n)=>o.jsx(k.Content,{ref:n,sideOffset:t,className:a("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 origin-[--radix-tooltip-content-transform-origin]",e),...s}));ee.displayName=k.Content.displayName;const te=({className:e,from:t,...s})=>o.jsx("div",{className:a("group flex w-full max-w-[80%] flex-col gap-2",t==="user"?"is-user ml-auto justify-end":"is-assistant",e),...s}),oe=({children:e,className:t,...s})=>o.jsx("div",{className:a("is-user:dark flex w-fit flex-col gap-2 overflow-hidden text-sm","group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground",t),...s,children:e});i.createContext(null);const A=i.memo(({className:e,...t})=>o.jsx(R.Streamdown,{className:a("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);A.displayName="MessageResponse";const se=v.Root,ne=v.CollapsibleTrigger,re=v.CollapsibleContent,ae=({children:e,as:t="p",className:s,duration:n=2,spread:r=2})=>{const l=Q.motion.create(t),c=i.useMemo(()=>((e==null?void 0:e.length)??0)*r,[e,r]);return o.jsx(l,{animate:{backgroundPosition:"0% center"},className:a("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent","[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",s),initial:{backgroundPosition:"100% center"},style:{"--spread":`${c}px`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"},transition:{repeat:Number.POSITIVE_INFINITY,duration:n,ease:"linear"},children:e})},U=i.memo(ae),_=i.createContext(null),ie=()=>{const e=i.useContext(_);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},le=1e3,ce=1e3,z=i.memo(({className:e,isStreaming:t=!1,open:s,defaultOpen:n=!0,onOpenChange:r,duration:l,children:c,...q})=>{const[d,u]=w.useControllableState({prop:s,defaultProp:n,onChange:r}),[O,C]=w.useControllableState({prop:l,defaultProp:void 0}),[j,B]=i.useState(!1),[m,S]=i.useState(null);i.useEffect(()=>{t?m===null&&S(Date.now()):m!==null&&(C(Math.ceil((Date.now()-m)/ce)),S(null))},[t,m,C]),i.useEffect(()=>{if(n&&!t&&d&&!j){const x=setTimeout(()=>{u(!1),B(!0)},le);return()=>clearTimeout(x)}},[t,d,n,u,j]);const D=x=>{u(x)};return o.jsx(_.Provider,{value:{isStreaming:t,isOpen:d,setIsOpen:u,duration:O},children:o.jsx(se,{className:a("not-prose mb-4",e),onOpenChange:D,open:d,...q,children:c})})}),de=(e,t)=>e||t===0?o.jsx(U,{duration:1,children:"Thinking..."}):t===void 0?o.jsx("p",{children:"Thought for a few seconds"}):o.jsxs("p",{children:["Thought for ",t," seconds"]}),M=i.memo(({className:e,children:t,...s})=>{const{isStreaming:n,isOpen:r,duration:l}=ie();return o.jsx(ne,{className:a("flex w-full items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground",e),...s,children:t??o.jsxs(o.Fragment,{children:[o.jsx(g.BrainIcon,{className:"size-4"}),de(n,l),o.jsx(g.ChevronDownIcon,{className:a("size-4 transition-transform",r?"rotate-180":"rotate-0")})]})})}),P=i.memo(({className:e,children:t,...s})=>o.jsx(re,{className:a("mt-4 text-sm","text-muted-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2",e),...s,children:o.jsx(R.Streamdown,{...s,children:t})}));z.displayName="Reasoning";M.displayName="ReasoningTrigger";P.displayName="ReasoningContent";const ue=({className:e,content:t,isLoading:s=!1,...n})=>o.jsx("div",{className:a("is-assistant flex w-full max-w-[80%] flex-col gap-2",e),...n,children:o.jsx("div",{className:"flex w-fit flex-col gap-2 overflow-hidden text-sm",children:o.jsx("div",{className:"flex items-center gap-2 rounded-lg border border-muted-foreground/20 bg-muted/50 p-3",children:o.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[s&&o.jsx(U,{duration:1.5,children:t}),!s&&o.jsx("div",{className:"text-xs text-muted-foreground",children:t})]})})})});function me({userInput:e,language:t="en",currentHtml:s}){const n=p.LANGUAGES[t]||"English";return s&&s.trim().length>0?`
|
|
2
|
-
MODE: EDIT
|
|
3
|
-
CURRENT HTML:
|
|
4
|
-
${s}
|
|
5
|
-
|
|
6
|
-
USER REQUEST: ${e}
|
|
7
|
-
Use ${n} language.
|
|
8
|
-
`.trim():`
|
|
9
|
-
USER REQUEST: ${e}
|
|
10
|
-
Use ${n} language.
|
|
11
|
-
`.trim()}function ge({fallbackLang:e,language:t,blocks:s=[],userInput:n}){const r=p.LANGUAGES[t]||"English";return`
|
|
12
|
-
USER REQUEST: ${n||"Translate the content"}
|
|
13
|
-
LANGUAGE TO TRANSLATE: ${r}
|
|
14
|
-
REQUESTED TRANSLATION LANGUAGE CODE: ${t}
|
|
15
|
-
FALLBACK LANGUAGE: ${p.LANGUAGES[e]}
|
|
16
|
-
BLOCKS: ${JSON.stringify(s)}`.trim()}const fe=({onRemove:e,isLoading:t=!1})=>{const{t:s}=y.useTranslation(),n=y.useSelectedBlock(),r=(n==null?void 0:n._type)||"Unknown",l=(n==null?void 0:n._name)||r;return o.jsx(o.Fragment,{children:o.jsxs("div",{className:"mx-auto flex w-[95%] items-center justify-between rounded-t-md border border-b-0 border-blue-200 bg-blue-50",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-l rounded-bl-none bg-blue-500 text-xs font-semibold text-white",children:"@"}),o.jsx("div",{className:"flex w-[95%] flex-col",children:n?o.jsx(o.Fragment,{children:o.jsxs("span",{className:"truncate text-xs font-medium text-blue-900",children:[" ",s("Context: ")," ",l]})}):o.jsxs("span",{className:"text-xs font-medium text-blue-900",children:[" ",s("Context: Entire Page")]})})]}),n&&o.jsx(K.Button,{variant:"ghost",size:"icon",onClick:e,disabled:t,className:"h-6 w-6 text-blue-600 hover:bg-blue-100 hover:text-blue-800",title:"Remove block from context",children:o.jsx(g.X,{size:14})})]})})};exports.Button=N;exports.Conversation=J;exports.ConversationContent=X;exports.ConversationEmptyState=H;exports.ConversationScrollButton=W;exports.Message=te;exports.MessageContent=oe;exports.MessageResponse=A;exports.Reasoning=z;exports.ReasoningContent=P;exports.ReasoningTrigger=M;exports.SelectedBlockDisplay=fe;exports.TaskMessage=ue;exports.cn=a;exports.getTranslationUserPrompt=ge;exports.getUserPrompt=me;
|