@chaibuilder/sdk 4.0.0-beta.1 → 4.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -20
- package/dist/2SSKDMRQ-BnsZi3K3.cjs +1 -0
- package/dist/2SSKDMRQ-CnSDkQcy.js +42 -0
- package/dist/AP7HFJJL-B31839PG.cjs +1228 -0
- package/dist/AP7HFJJL-CymCmW14.js +9214 -0
- package/dist/IconPicker-B1rWC-Ex.js +59 -0
- package/dist/IconPicker-DREyo007.cjs +1 -0
- package/dist/WDYDFRGG-BUVnbAci.js +33 -0
- package/dist/WDYDFRGG-BxhOCHc3.cjs +1 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/_commonjsHelpers-DwGv2jUC.cjs +1 -0
- package/dist/actions-registery-CZ1w0NKa.js +15545 -0
- package/dist/actions-registery-YnFmU21O.cjs +418 -0
- package/dist/actions.cjs +1 -0
- package/dist/actions.d.ts +3202 -0
- package/dist/actions.js +216 -0
- package/dist/active-in-another-tab-B47YjQGN.cjs +1 -0
- package/dist/active-in-another-tab-CyjngVA6.js +34 -0
- package/dist/add-new-language-page-88xzrUy8.cjs +1 -0
- package/dist/add-new-language-page-WmlCnytQ.js +401 -0
- package/dist/add-new-page-VW2wAYZp.js +31 -0
- package/dist/add-new-page-soZ8GAkN.cjs +1 -0
- package/dist/ai-panel-content-7zCil042.cjs +1 -0
- package/dist/ai-panel-content-D_o7Q_A-.js +61 -0
- package/dist/ai-panel-default-lang-COYaxNwn.cjs +3 -0
- package/dist/ai-panel-default-lang-DnElspF0.js +341 -0
- package/dist/ai-panel-other-lang-CkynNlAU.cjs +1 -0
- package/dist/ai-panel-other-lang-Dp0E9_Hx.js +162 -0
- package/dist/ai-prompt-input-Bhc0ds7X.js +655 -0
- package/dist/ai-prompt-input-CThbVp0_.cjs +1 -0
- package/dist/ai-translation-prompt-C2kJQFDX.cjs +1 -0
- package/dist/ai-translation-prompt-CZ55HQmo.js +28 -0
- package/dist/apply-binding-6iwlED02.js +833 -0
- package/dist/apply-binding-KKp5PnpZ.cjs +1 -0
- package/dist/code-display-BnqzqzoP.cjs +1 -0
- package/dist/{code-display-337R7Dev.js → code-display-DhD_RBcg.js} +1 -1
- package/dist/code-editor-DRIAnNbb.js +50 -0
- package/dist/code-editor-o3___nu2.cjs +1 -0
- package/dist/common-functions-B3a4xKt_.cjs +1 -0
- package/dist/common-functions-D2lMFR6K.js +13 -0
- package/dist/continue-editing-in-this-client-CS2aQ7yY.js +24 -0
- package/dist/continue-editing-in-this-client-CtMYsk-A.cjs +1 -0
- package/dist/core-BoRDjj4h.cjs +1 -0
- package/dist/core-yvI6kCyw.js +56 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +51 -383
- package/dist/core.js +39 -106
- package/dist/{css-import-modal-DA2L6kwP.js → css-import-modal-Byg6wV0O.js} +36 -36
- package/dist/css-import-modal-CyqkXWCO.cjs +13 -0
- package/dist/delete-design-token-BRZZiWtQ.js +40 -0
- package/dist/delete-design-token-DkVs1oBf.cjs +1 -0
- package/dist/delete-page-BzyX9TN-.js +70 -0
- package/dist/delete-page-DxX7PFIE.cjs +1 -0
- package/dist/design-token-usage-CAHzEGgJ.cjs +1 -0
- package/dist/design-token-usage-xQs6SlaJ.js +113 -0
- package/dist/digital-asset-manager--uO8Agia.cjs +1 -0
- package/dist/digital-asset-manager-DbtwzxRz.js +876 -0
- package/dist/duplicate-page-BR7Dlo9d.js +133 -0
- package/dist/duplicate-page-CaNAbXwV.cjs +1 -0
- package/dist/dynamic-page-selector-Cb5r_W8s.js +85 -0
- package/dist/dynamic-page-selector-Cxk_gjni.cjs +1 -0
- package/dist/fonts-B-Xt29pe.cjs +1 -0
- package/dist/fonts-DRly3Wzd.js +78 -0
- package/dist/{get-chai-builder-tailwind-config-C6MHaUM0.cjs → get-chai-builder-tailwind-config-B9rCyiQo.cjs} +1 -1
- package/dist/{get-chai-builder-tailwind-config-BqaIvg8p.js → get-chai-builder-tailwind-config-DjoVOuAf.js} +13 -10
- package/dist/{get-chai-builder-theme-D0IsUvK4.js → get-chai-builder-theme-BYtp20KD.js} +4 -4
- package/dist/get-chai-builder-theme-Dl72X7cz.cjs +1 -0
- package/dist/get-seo-defaults-9zHebckY.js +65 -0
- package/dist/get-seo-defaults-Cw7vFt-B.cjs +1 -0
- package/dist/image-compression-DZ9WMmyn.cjs +1 -0
- package/dist/image-compression-DsZ1oqpb.js +37 -0
- package/dist/image-editor-DV8kUKhl.js +108 -0
- package/dist/image-editor-G-K28aTS.cjs +1 -0
- package/dist/index-B-rSiAp_.cjs +1 -0
- package/dist/index-Ct7ElCGK.js +19069 -0
- package/dist/index-DF5DEvqb.cjs +160 -0
- package/dist/index-Dxfyt4d4.js +39 -0
- package/dist/index-WQwzsC7A.cjs +5 -0
- package/dist/index-ZuacEL1j.js +4732 -0
- package/dist/json-diff-viewer-D7z4zNvv.cjs +8 -0
- package/dist/json-diff-viewer-krslPepD.js +258 -0
- package/dist/lang-panel-BwIewMyw.js +215 -0
- package/dist/lang-panel-DT96k1xg.cjs +1 -0
- package/dist/manage-design-tokens-Caz_20VK.js +240 -0
- package/dist/manage-design-tokens-CrmLe7UT.cjs +1 -0
- package/dist/mark-as-template-D295ZQtU.js +156 -0
- package/dist/mark-as-template-W3LmpiqN.cjs +1 -0
- package/dist/models-5gOsRC56.cjs +1 -0
- package/dist/models-D95ZYr_x.js +70 -0
- package/dist/nested-path-selector-content-CKYYK-C5.js +87 -0
- package/dist/nested-path-selector-content-CoS_d3dc.cjs +1 -0
- package/dist/no-language-page-content-BvqRBP6y.js +42 -0
- package/dist/no-language-page-content-DkfeMl90.cjs +1 -0
- package/dist/no-language-page-dialog-BcEoqyQB.cjs +1 -0
- package/dist/no-language-page-dialog-PjNqTUpl.js +10 -0
- package/dist/page-creator-C4gc5NSC.cjs +1 -0
- package/dist/page-creator-DiOITEMw.js +795 -0
- package/dist/page-lock-BdYmCks0.cjs +1 -0
- package/dist/page-lock-Bfbs6RgL.js +30 -0
- package/dist/page-locked-dialog-B1FAtK92.cjs +1 -0
- package/dist/page-locked-dialog-B6MKTRfY.js +133 -0
- package/dist/page-manager-new-CHDueBDk.cjs +1 -0
- package/dist/page-manager-new-CzX22g2n.js +394 -0
- package/dist/page-manager-search-and-filter-CM0UMb6U.js +201 -0
- package/dist/page-manager-search-and-filter-DkkRIH86.cjs +1 -0
- package/dist/page-revisions-content-ChY-4f2V.cjs +1 -0
- package/dist/page-revisions-content-NH9JK4Ey.js +445 -0
- package/dist/pages.cjs +1 -0
- package/dist/pages.d.ts +491 -0
- package/dist/pages.js +27 -0
- package/dist/plugin-3ZKK6RXm.js +245 -0
- package/dist/plugin-C6rgJDNQ.cjs +22 -0
- package/dist/publish-pages-content-D9aixMN5.js +178 -0
- package/dist/publish-pages-content-x-JuSFJ9.cjs +1 -0
- package/dist/register-partial-type-BjtdfKHE.js +36 -0
- package/dist/register-partial-type-ig9fUWIJ.cjs +1 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +26 -13
- package/dist/render.js +130 -124
- package/dist/rte-widget-modal-BaHIuEjF.cjs +1 -0
- package/dist/rte-widget-modal-DOJEXLIf.js +38 -0
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.ts +306 -7
- package/dist/runtime.js +44 -1
- package/dist/save-to-lib-Cgpxw8-g.cjs +1 -0
- package/dist/save-to-lib-eiOc_SSN.js +422 -0
- package/dist/sdk.css +1 -1
- package/dist/selected-block-display-BgRY82CT.cjs +16 -0
- package/dist/selected-block-display-CBFePS19.js +319 -0
- package/dist/seo-panel-C1-iMOR1.js +798 -0
- package/dist/seo-panel-DfAb8U7W.cjs +2 -0
- package/dist/shared-json-ld-B4PxAM_0.js +565 -0
- package/dist/shared-json-ld-DzG398hr.cjs +1 -0
- package/dist/slug-input-AwNJs9im.js +86 -0
- package/dist/slug-input-C_ijLQ_X.cjs +1 -0
- package/dist/supabase-actions.cjs +1 -0
- package/dist/supabase-actions.d.ts +284 -0
- package/dist/supabase-actions.js +524 -0
- package/dist/take-over-request-BNxcjY2j.cjs +1 -0
- package/dist/take-over-request-C4FeDtN_.js +63 -0
- package/dist/theme-panel-footer-Cq9pljro.cjs +1 -0
- package/dist/theme-panel-footer-uBQqSJXm.js +25 -0
- package/dist/translation-warning-modal-B64YqlbI.js +26 -0
- package/dist/translation-warning-modal-BZAcwM2_.cjs +1 -0
- package/dist/unmark-as-template-CZ9sQp_P.js +39 -0
- package/dist/unmark-as-template-EVvk0vmp.cjs +1 -0
- package/dist/unpublish-page-D4VwOlxc.js +27 -0
- package/dist/unpublish-page-bdSmwAVQ.cjs +1 -0
- package/dist/use-page-expand-manager-B6XTvk0E.cjs +1 -0
- package/dist/use-page-expand-manager-Cf4MUEJw.js +85 -0
- package/dist/{tailwind.cjs → utils.cjs} +1 -1
- package/dist/{tailwind.d.ts → utils.d.ts} +12 -11
- package/dist/utils.js +7 -0
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.d.ts +0 -6
- package/dist/web-blocks.js +248 -241
- package/dist/web-preview-Cio70gk5.cjs +1 -0
- package/dist/web-preview-Djy6WIyj.js +73 -0
- package/package.json +175 -105
- package/dist/IconPicker-CGWn9C4u.cjs +0 -1
- package/dist/IconPicker-QvxJ-4Ez.js +0 -64
- package/dist/apply-binding-DCno1xQL.js +0 -711
- package/dist/apply-binding-DvHNFLQD.cjs +0 -1
- package/dist/code-display-BZ1x7SqI.cjs +0 -1
- package/dist/code-editor-B28LoECM.cjs +0 -1
- package/dist/code-editor-CfG2FhJ-.js +0 -58
- package/dist/common-functions-BGzDsf1z.js +0 -14
- package/dist/common-functions-BZmyleS1.cjs +0 -1
- package/dist/css-import-modal-CENUYvcl.cjs +0 -13
- package/dist/get-chai-builder-theme-Ck_Z4Q-M.cjs +0 -1
- package/dist/index-CaGNHF7f.js +0 -12209
- package/dist/index-Gn6pJt2v.cjs +0 -166
- package/dist/mockServiceWorker.js +0 -307
- package/dist/plugin-B5627hMN.js +0 -195
- package/dist/plugin-UxTRfDum.cjs +0 -22
- package/dist/rte-widget-modal-DL739qeQ.cjs +0 -1
- package/dist/rte-widget-modal-Dte0od04.js +0 -41
- package/dist/tailwind.js +0 -7
- package/dist/tooltip-A4qGk781.cjs +0 -1
- package/dist/tooltip-tLiIOgjq.js +0 -1067
- package/dist/ui.cjs +0 -1
- package/dist/ui.d.ts +0 -415
- package/dist/ui.js +0 -129
- package/dist/vite.svg +0 -1
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { jsx as o, jsxs as l, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import { ag as r, B as E, as as O } from "./index-Ct7ElCGK.js";
|
|
3
|
+
import { ArrowDownIcon as D, BrainIcon as P, ChevronDownIcon as $, X as B } from "lucide-react";
|
|
4
|
+
import * as _ from "react";
|
|
5
|
+
import { useCallback as G, memo as d, createContext as S, useMemo as j, useState as C, useEffect as T, useContext as Q } from "react";
|
|
6
|
+
import { StickToBottom as R, useStickToBottomContext as F } from "use-stick-to-bottom";
|
|
7
|
+
import { Streamdown as y } from "streamdown";
|
|
8
|
+
import "@radix-ui/react-slot";
|
|
9
|
+
import { cva as K } from "class-variance-authority";
|
|
10
|
+
import "clsx";
|
|
11
|
+
import "tailwind-merge";
|
|
12
|
+
import * as A from "@radix-ui/react-tooltip";
|
|
13
|
+
import { useControllableState as w } from "@radix-ui/react-use-controllable-state";
|
|
14
|
+
import * as x from "@radix-ui/react-collapsible";
|
|
15
|
+
import { motion as V } from "framer-motion";
|
|
16
|
+
import { L as h } from "./index-ZuacEL1j.js";
|
|
17
|
+
import { useTranslation as Y } from "react-i18next";
|
|
18
|
+
const Ce = ({ className: e, ...t }) => /* @__PURE__ */ o(
|
|
19
|
+
R,
|
|
20
|
+
{
|
|
21
|
+
className: r("relative flex-1 overflow-y-hidden", e),
|
|
22
|
+
initial: "smooth",
|
|
23
|
+
resize: "smooth",
|
|
24
|
+
role: "log",
|
|
25
|
+
...t
|
|
26
|
+
}
|
|
27
|
+
), Te = ({ className: e, ...t }) => /* @__PURE__ */ o(R.Content, { className: r("flex flex-col gap-8 p-4", e), ...t }), we = ({
|
|
28
|
+
className: e,
|
|
29
|
+
title: t = "No messages yet",
|
|
30
|
+
description: s = "Start a conversation to see messages here",
|
|
31
|
+
icon: n,
|
|
32
|
+
children: a,
|
|
33
|
+
...i
|
|
34
|
+
}) => /* @__PURE__ */ o(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: r("flex size-full flex-col items-center justify-center gap-3 p-8 text-center", e),
|
|
38
|
+
...i,
|
|
39
|
+
children: a ?? /* @__PURE__ */ l(f, { children: [
|
|
40
|
+
n && /* @__PURE__ */ o("div", { className: "text-muted-foreground", children: n }),
|
|
41
|
+
/* @__PURE__ */ l("div", { className: "space-y-1", children: [
|
|
42
|
+
/* @__PURE__ */ o("h3", { className: "text-sm font-medium", children: t }),
|
|
43
|
+
s && /* @__PURE__ */ o("p", { className: "text-sm text-muted-foreground", children: s })
|
|
44
|
+
] })
|
|
45
|
+
] })
|
|
46
|
+
}
|
|
47
|
+
), Ee = ({ className: e, ...t }) => {
|
|
48
|
+
const { isAtBottom: s, scrollToBottom: n } = F(), a = G(() => {
|
|
49
|
+
n();
|
|
50
|
+
}, [n]);
|
|
51
|
+
return !s && /* @__PURE__ */ o(
|
|
52
|
+
E,
|
|
53
|
+
{
|
|
54
|
+
className: r("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full", e),
|
|
55
|
+
onClick: a,
|
|
56
|
+
size: "icon",
|
|
57
|
+
type: "button",
|
|
58
|
+
variant: "outline",
|
|
59
|
+
...t,
|
|
60
|
+
children: /* @__PURE__ */ o(D, { className: "size-4" })
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
K(
|
|
65
|
+
"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",
|
|
66
|
+
{
|
|
67
|
+
variants: {
|
|
68
|
+
orientation: {
|
|
69
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
70
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
defaultVariants: {
|
|
74
|
+
orientation: "horizontal"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
const J = _.forwardRef(({ className: e, sideOffset: t = 4, ...s }, n) => /* @__PURE__ */ o(
|
|
79
|
+
A.Content,
|
|
80
|
+
{
|
|
81
|
+
ref: n,
|
|
82
|
+
sideOffset: t,
|
|
83
|
+
className: r(
|
|
84
|
+
"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]",
|
|
85
|
+
e
|
|
86
|
+
),
|
|
87
|
+
...s
|
|
88
|
+
}
|
|
89
|
+
));
|
|
90
|
+
J.displayName = A.Content.displayName;
|
|
91
|
+
const Se = ({ className: e, from: t, ...s }) => /* @__PURE__ */ o(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
className: r(
|
|
95
|
+
"group flex w-full max-w-[80%] flex-col gap-2",
|
|
96
|
+
t === "user" ? "is-user ml-auto justify-end" : "is-assistant",
|
|
97
|
+
e
|
|
98
|
+
),
|
|
99
|
+
...s
|
|
100
|
+
}
|
|
101
|
+
), Re = ({ children: e, className: t, ...s }) => /* @__PURE__ */ o(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
className: r(
|
|
105
|
+
"is-user:dark flex w-fit flex-col gap-2 overflow-hidden text-sm",
|
|
106
|
+
"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",
|
|
107
|
+
"group-[.is-assistant]:text-foreground",
|
|
108
|
+
t
|
|
109
|
+
),
|
|
110
|
+
...s,
|
|
111
|
+
children: e
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
S(null);
|
|
115
|
+
const X = d(
|
|
116
|
+
({ className: e, ...t }) => /* @__PURE__ */ o(y, { className: r("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", e), ...t }),
|
|
117
|
+
(e, t) => e.children === t.children
|
|
118
|
+
);
|
|
119
|
+
X.displayName = "MessageResponse";
|
|
120
|
+
const q = x.Root, H = x.CollapsibleTrigger, W = x.CollapsibleContent, Z = ({
|
|
121
|
+
children: e,
|
|
122
|
+
as: t = "p",
|
|
123
|
+
className: s,
|
|
124
|
+
duration: n = 2,
|
|
125
|
+
spread: a = 2
|
|
126
|
+
}) => {
|
|
127
|
+
const i = V.create(
|
|
128
|
+
t
|
|
129
|
+
), g = j(
|
|
130
|
+
() => ((e == null ? void 0 : e.length) ?? 0) * a,
|
|
131
|
+
[e, a]
|
|
132
|
+
);
|
|
133
|
+
return /* @__PURE__ */ o(
|
|
134
|
+
i,
|
|
135
|
+
{
|
|
136
|
+
animate: { backgroundPosition: "0% center" },
|
|
137
|
+
className: r(
|
|
138
|
+
"relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent",
|
|
139
|
+
"[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",
|
|
140
|
+
s
|
|
141
|
+
),
|
|
142
|
+
initial: { backgroundPosition: "100% center" },
|
|
143
|
+
style: {
|
|
144
|
+
"--spread": `${g}px`,
|
|
145
|
+
backgroundImage: "var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"
|
|
146
|
+
},
|
|
147
|
+
transition: {
|
|
148
|
+
repeat: Number.POSITIVE_INFINITY,
|
|
149
|
+
duration: n,
|
|
150
|
+
ease: "linear"
|
|
151
|
+
},
|
|
152
|
+
children: e
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}, k = d(Z), U = S(null), ee = () => {
|
|
156
|
+
const e = Q(U);
|
|
157
|
+
if (!e)
|
|
158
|
+
throw new Error("Reasoning components must be used within Reasoning");
|
|
159
|
+
return e;
|
|
160
|
+
}, te = 1e3, oe = 1e3, se = d(
|
|
161
|
+
({
|
|
162
|
+
className: e,
|
|
163
|
+
isStreaming: t = !1,
|
|
164
|
+
open: s,
|
|
165
|
+
defaultOpen: n = !0,
|
|
166
|
+
onOpenChange: a,
|
|
167
|
+
duration: i,
|
|
168
|
+
children: g,
|
|
169
|
+
...z
|
|
170
|
+
}) => {
|
|
171
|
+
const [c, m] = w({
|
|
172
|
+
prop: s,
|
|
173
|
+
defaultProp: n,
|
|
174
|
+
onChange: a
|
|
175
|
+
}), [M, b] = w({
|
|
176
|
+
prop: i,
|
|
177
|
+
defaultProp: void 0
|
|
178
|
+
}), [N, I] = C(!1), [u, v] = C(null);
|
|
179
|
+
T(() => {
|
|
180
|
+
t ? u === null && v(Date.now()) : u !== null && (b(Math.ceil((Date.now() - u) / oe)), v(null));
|
|
181
|
+
}, [t, u, b]), T(() => {
|
|
182
|
+
if (n && !t && c && !N) {
|
|
183
|
+
const p = setTimeout(() => {
|
|
184
|
+
m(!1), I(!0);
|
|
185
|
+
}, te);
|
|
186
|
+
return () => clearTimeout(p);
|
|
187
|
+
}
|
|
188
|
+
}, [t, c, n, m, N]);
|
|
189
|
+
const L = (p) => {
|
|
190
|
+
m(p);
|
|
191
|
+
};
|
|
192
|
+
return /* @__PURE__ */ o(U.Provider, { value: { isStreaming: t, isOpen: c, setIsOpen: m, duration: M }, children: /* @__PURE__ */ o(
|
|
193
|
+
q,
|
|
194
|
+
{
|
|
195
|
+
className: r("not-prose mb-4", e),
|
|
196
|
+
onOpenChange: L,
|
|
197
|
+
open: c,
|
|
198
|
+
...z,
|
|
199
|
+
children: g
|
|
200
|
+
}
|
|
201
|
+
) });
|
|
202
|
+
}
|
|
203
|
+
), ne = (e, t) => e || t === 0 ? /* @__PURE__ */ o(k, { duration: 1, children: "Thinking..." }) : t === void 0 ? /* @__PURE__ */ o("p", { children: "Thought for a few seconds" }) : /* @__PURE__ */ l("p", { children: [
|
|
204
|
+
"Thought for ",
|
|
205
|
+
t,
|
|
206
|
+
" seconds"
|
|
207
|
+
] }), ae = d(({ className: e, children: t, ...s }) => {
|
|
208
|
+
const { isStreaming: n, isOpen: a, duration: i } = ee();
|
|
209
|
+
return /* @__PURE__ */ o(
|
|
210
|
+
H,
|
|
211
|
+
{
|
|
212
|
+
className: r(
|
|
213
|
+
"flex w-full items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground",
|
|
214
|
+
e
|
|
215
|
+
),
|
|
216
|
+
...s,
|
|
217
|
+
children: t ?? /* @__PURE__ */ l(f, { children: [
|
|
218
|
+
/* @__PURE__ */ o(P, { className: "size-4" }),
|
|
219
|
+
ne(n, i),
|
|
220
|
+
/* @__PURE__ */ o($, { className: r("size-4 transition-transform", a ? "rotate-180" : "rotate-0") })
|
|
221
|
+
] })
|
|
222
|
+
}
|
|
223
|
+
);
|
|
224
|
+
}), re = d(({ className: e, children: t, ...s }) => /* @__PURE__ */ o(
|
|
225
|
+
W,
|
|
226
|
+
{
|
|
227
|
+
className: r(
|
|
228
|
+
"mt-4 text-sm",
|
|
229
|
+
"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",
|
|
230
|
+
e
|
|
231
|
+
),
|
|
232
|
+
...s,
|
|
233
|
+
children: /* @__PURE__ */ o(y, { ...s, children: t })
|
|
234
|
+
}
|
|
235
|
+
));
|
|
236
|
+
se.displayName = "Reasoning";
|
|
237
|
+
ae.displayName = "ReasoningTrigger";
|
|
238
|
+
re.displayName = "ReasoningContent";
|
|
239
|
+
const ye = ({ className: e, content: t, isLoading: s = !1, ...n }) => /* @__PURE__ */ o("div", { className: r("is-assistant flex w-full max-w-[80%] flex-col gap-2", e), ...n, children: /* @__PURE__ */ o("div", { className: "flex w-fit flex-col gap-2 overflow-hidden text-sm", children: /* @__PURE__ */ o("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: [
|
|
240
|
+
s && /* @__PURE__ */ o(k, { duration: 1.5, children: t }),
|
|
241
|
+
!s && /* @__PURE__ */ o("div", { className: "text-xs text-muted-foreground", children: t })
|
|
242
|
+
] }) }) }) });
|
|
243
|
+
function Ae({
|
|
244
|
+
userInput: e,
|
|
245
|
+
language: t = "en",
|
|
246
|
+
currentHtml: s
|
|
247
|
+
}) {
|
|
248
|
+
const n = h[t] || "English";
|
|
249
|
+
return s && s.trim().length > 0 ? `
|
|
250
|
+
MODE: EDIT
|
|
251
|
+
CURRENT HTML:
|
|
252
|
+
${s}
|
|
253
|
+
|
|
254
|
+
USER REQUEST: ${e}
|
|
255
|
+
Use ${n} language.
|
|
256
|
+
`.trim() : `
|
|
257
|
+
USER REQUEST: ${e}
|
|
258
|
+
Use ${n} language.
|
|
259
|
+
`.trim();
|
|
260
|
+
}
|
|
261
|
+
function ke({
|
|
262
|
+
fallbackLang: e,
|
|
263
|
+
language: t,
|
|
264
|
+
blocks: s = [],
|
|
265
|
+
userInput: n
|
|
266
|
+
}) {
|
|
267
|
+
const a = h[t] || "English";
|
|
268
|
+
return `
|
|
269
|
+
USER REQUEST: ${n || "Translate the content"}
|
|
270
|
+
LANGUAGE TO TRANSLATE: ${a}
|
|
271
|
+
REQUESTED TRANSLATION LANGUAGE CODE: ${t}
|
|
272
|
+
FALLBACK LANGUAGE: ${h[e]}
|
|
273
|
+
BLOCKS: ${JSON.stringify(s)}`.trim();
|
|
274
|
+
}
|
|
275
|
+
const Ue = ({ onRemove: e, isLoading: t = !1 }) => {
|
|
276
|
+
const { t: s } = Y(), n = O(), a = (n == null ? void 0 : n._type) || "Unknown", i = (n == null ? void 0 : n._name) || a;
|
|
277
|
+
return /* @__PURE__ */ o(f, { 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: [
|
|
278
|
+
/* @__PURE__ */ l("div", { className: "flex items-center", children: [
|
|
279
|
+
/* @__PURE__ */ o("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: "@" }),
|
|
280
|
+
/* @__PURE__ */ o("div", { className: "flex w-[95%] flex-col", children: n ? /* @__PURE__ */ o(f, { children: /* @__PURE__ */ l("span", { className: "truncate text-xs font-medium text-blue-900", children: [
|
|
281
|
+
" ",
|
|
282
|
+
s("Context: "),
|
|
283
|
+
" ",
|
|
284
|
+
i
|
|
285
|
+
] }) }) : /* @__PURE__ */ l("span", { className: "text-xs font-medium text-blue-900", children: [
|
|
286
|
+
" ",
|
|
287
|
+
s("Context: Entire Page")
|
|
288
|
+
] }) })
|
|
289
|
+
] }),
|
|
290
|
+
n && /* @__PURE__ */ o(
|
|
291
|
+
E,
|
|
292
|
+
{
|
|
293
|
+
variant: "ghost",
|
|
294
|
+
size: "icon",
|
|
295
|
+
onClick: e,
|
|
296
|
+
disabled: t,
|
|
297
|
+
className: "h-6 w-6 text-blue-600 hover:bg-blue-100 hover:text-blue-800",
|
|
298
|
+
title: "Remove block from context",
|
|
299
|
+
children: /* @__PURE__ */ o(B, { size: 14 })
|
|
300
|
+
}
|
|
301
|
+
)
|
|
302
|
+
] }) });
|
|
303
|
+
};
|
|
304
|
+
export {
|
|
305
|
+
Ce as C,
|
|
306
|
+
Se as M,
|
|
307
|
+
se as R,
|
|
308
|
+
Ue as S,
|
|
309
|
+
ye as T,
|
|
310
|
+
Te as a,
|
|
311
|
+
we as b,
|
|
312
|
+
ae as c,
|
|
313
|
+
re as d,
|
|
314
|
+
Re as e,
|
|
315
|
+
X as f,
|
|
316
|
+
Ee as g,
|
|
317
|
+
Ae as h,
|
|
318
|
+
ke as i
|
|
319
|
+
};
|