@marimo-team/islands 0.23.10-dev3 → 0.23.10-dev30
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/{ConnectedDataExplorerComponent-CyV83R2m.js → ConnectedDataExplorerComponent-DmBropAy.js} +31 -31
- package/dist/{ErrorBoundary-rULOrC_p.js → ErrorBoundary-DpbaKVv7.js} +1 -1
- package/dist/{any-language-editor-DfdpyDv_.js → any-language-editor-DNmoSiWL.js} +20 -20
- package/dist/assets/__vite-browser-external-eshhtsgZ.js +1 -0
- package/dist/assets/worker-CC0Oul9k.js +73 -0
- package/dist/{chat-ui-C1tL1pML.js → chat-ui-D6oraHT2.js} +76 -76
- package/dist/{check-DTbrK0zt.js → check-BCaJeT-J.js} +1 -1
- package/dist/{code-visibility-DfnO0DcH.js → code-visibility-wR7WSQ4c.js} +2166 -1292
- package/dist/{copy-BuQpJEzp.js → copy-UqRYxiOg.js} +33 -33
- package/dist/dist-7QfXoMdB.js +5 -0
- package/dist/{dist-DgnE8F-r.js → dist-A2846XWO.js} +1 -1
- package/dist/dist-BEXXyZig.js +5 -0
- package/dist/{dist-B3pZ0Ab6.js → dist-BR_gyG9L.js} +3 -3
- package/dist/{dist-CcXxepx6.js → dist-BSAt6RhH.js} +27 -27
- package/dist/{dist-Bde4a2kU.js → dist-BY018Paw.js} +8 -8
- package/dist/dist-BYj57OV4.js +5 -0
- package/dist/{dist-CUCNs1ja.js → dist-BaoDKvdy.js} +2 -2
- package/dist/{dist-Cy1WxgBD.js → dist-Bf7SHuNp.js} +5 -5
- package/dist/{dist-Bz_sYWbr.js → dist-Bk75fBZA.js} +2 -2
- package/dist/dist-BlSvQzNr.js +5 -0
- package/dist/{dist-C5VC_yzu.js → dist-BzEzfugY.js} +1 -1
- package/dist/dist-CCBlxAgS.js +8 -0
- package/dist/dist-CIDTVIUf.js +5 -0
- package/dist/{dist-CLUtPrdy.js → dist-CIYBwstr.js} +1 -1
- package/dist/{dist-BotSqB48.js → dist-C_Y3oV3C.js} +12 -12
- package/dist/{dist-BTfv03uy.js → dist-CcWX6tmx.js} +2 -2
- package/dist/{dist-BhM8gdSO.js → dist-CoXAujgg.js} +4 -4
- package/dist/{dist-4j4c7bjm.js → dist-CpxNdDkw.js} +3 -3
- package/dist/dist-CqQyhAM8.js +8 -0
- package/dist/dist-CwRu2Xzh.js +5 -0
- package/dist/{dist-BcuoonNH.js → dist-CxJDU6Bh.js} +9 -9
- package/dist/{dist-DxvORzUR.js → dist-D-W5ny5a.js} +8 -8
- package/dist/dist-D8CDTVgf.js +6 -0
- package/dist/dist-D8DNB0nO.js +8 -0
- package/dist/dist-DL6N_q-A.js +5 -0
- package/dist/{dist-BbbIBDiQ.js → dist-DMjWuVs8.js} +1 -1
- package/dist/dist-DOFbNV_b.js +8 -0
- package/dist/dist-DPrYzMY0.js +6 -0
- package/dist/{dist-h2c8sZvT.js → dist-DZORgqKY.js} +1 -1
- package/dist/{dist-B3P2fFpz.js → dist-DZo4nSS0.js} +14 -14
- package/dist/{dist-D4CewLk6.js → dist-Dax--nl9.js} +1 -1
- package/dist/{dist-DRfcqpxJ.js → dist-DgGbNavJ.js} +2 -2
- package/dist/{dist-C1BYNeCR.js → dist-Dk6PV_d3.js} +10 -10
- package/dist/{dist-fQ0ViXGs.js → dist-Dv_Y15yk.js} +107 -107
- package/dist/{dist-Bfwsv11D.js → dist-DyyjKEYf.js} +2 -2
- package/dist/{dist-p2qyWijU.js → dist-GZXUmt0b.js} +2 -2
- package/dist/{dist-CLJWPTX2.js → dist-LTU8Hdvn.js} +3 -3
- package/dist/{dist-DqAWR3CS.js → dist-M9Vag9Y0.js} +20 -20
- package/dist/{dist-DNdhYsgW.js → dist-U4F-tbMs.js} +79 -62
- package/dist/{dist-RqXTaiir.js → dist-abid3KgM.js} +11 -11
- package/dist/dist-cdmMjgsn.js +5 -0
- package/dist/dist-hT4QzYX-.js +1247 -0
- package/dist/{dist-luvabDEB.js → dist-t9Kf7xqC.js} +2 -2
- package/dist/{error-banner-5bz0L9hS.js → error-banner-Cc0I3C9e.js} +1 -1
- package/dist/esm-BaH2eg5-.js +1171 -0
- package/dist/{esm-Duie8iU-.js → esm-ga2Bf3O2.js} +43 -43
- package/dist/{extends-BgdxCfYu.js → extends-D_hDsj6R.js} +4 -4
- package/dist/{formats-DHxc-FdY.js → formats-C4wO47tk.js} +1 -1
- package/dist/{glide-data-editor-BOmK9ETQ.js → glide-data-editor-Qhu8oCX-.js} +12 -12
- package/dist/{html-to-image-CNa5ok96.js → html-to-image-UEH5lFDZ.js} +2318 -2275
- package/dist/{input-_2sjvfne.js → input-CMYy4hzj.js} +187 -185
- package/dist/{label-LWtdw5i8.js → label-CC4ytI1X.js} +1 -1
- package/dist/main.js +6941 -6913
- package/dist/{mermaid-lXOw5Py9.js → mermaid-zuLgJ8J8.js} +4 -4
- package/dist/{process-output-DKr4f1di.js → process-output-CyMLTogj.js} +3 -3
- package/dist/{reveal-component-UdMnCK5U.js → reveal-component-BjnkUAZ9.js} +697 -619
- package/dist/{spec-B96zNUEA.js → spec-X7FwLJni.js} +4 -4
- package/dist/{strings-Bu3vlb6W.js → strings-J57tzLr3.js} +47 -46
- package/dist/style.css +1 -1
- package/dist/{toDate-x-WRDCH7.js → toDate-d8RCRrRd.js} +2 -2
- package/dist/{tooltip-C5FYOpQc.js → tooltip-DpcyNkQ2.js} +2 -2
- package/dist/{types-CVvp1fKr.js → types-ChtMFmZ2.js} +1 -1
- package/dist/{useAsyncData-iRgKDT5s.js → useAsyncData-PonK__yh.js} +1 -1
- package/dist/{useDateFormatter-BA4FCquG.js → useDateFormatter-QB-3MpYr.js} +2 -2
- package/dist/{useDeepCompareMemoize-CkQ57VS2.js → useDeepCompareMemoize-D3NGWke6.js} +1 -1
- package/dist/{useLifecycle-BBO9PIph.js → useLifecycle-00mO3OSS.js} +2 -2
- package/dist/{useTheme-DHIrRQOe.js → useTheme-DEhDzATN.js} +1 -1
- package/dist/{vega-component-Dq-SH463.js → vega-component-9h1ACS78.js} +8 -8
- package/dist/{zod-CoBiJ5v4.js → zod-aLSua2NL.js} +24 -23
- package/package.json +3 -3
- package/src/components/data-table/TableBottomBar.tsx +1 -15
- package/src/components/data-table/TableTopBar.tsx +8 -13
- package/src/components/data-table/__tests__/TableBottomBar.test.tsx +6 -12
- package/src/components/data-table/__tests__/column-visibility-dropdown.test.tsx +227 -0
- package/src/components/data-table/__tests__/data-table.test.tsx +154 -12
- package/src/components/data-table/column-visibility-dropdown.tsx +204 -0
- package/src/components/data-table/data-table.tsx +1 -1
- package/src/components/data-table/filter-by-values-picker.tsx +39 -17
- package/src/components/data-table/filter-pills.tsx +1 -1
- package/src/components/data-table/hover-tooltip/__tests__/content.test.ts +60 -0
- package/src/components/data-table/hover-tooltip/content.ts +44 -0
- package/src/components/data-table/hover-tooltip/hover-tooltip.tsx +55 -0
- package/src/components/data-table/hover-tooltip/use-table-hover-tooltip.ts +159 -0
- package/src/components/data-table/renderers.tsx +27 -43
- package/src/components/datasources/__tests__/filter-empty.test.ts +183 -0
- package/src/components/datasources/datasources.tsx +92 -3
- package/src/components/editor/cell/cell-context-menu.tsx +15 -2
- package/src/components/editor/cell/code/language-toggle.tsx +7 -1
- package/src/components/editor/chrome/wrapper/app-chrome.tsx +97 -52
- package/src/components/editor/chrome/wrapper/lazy-panels.ts +91 -0
- package/src/components/editor/chrome/wrapper/sidebar.tsx +2 -0
- package/src/components/editor/documentation.css +35 -0
- package/src/components/editor/file-tree/file-explorer.tsx +8 -18
- package/src/components/editor/file-tree/tree-actions.tsx +46 -1
- package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +20 -0
- package/src/components/editor/renderers/slides-layout/types.ts +1 -0
- package/src/components/slides/__tests__/minimap-actions.test.tsx +166 -0
- package/src/components/slides/__tests__/reveal-component.test.ts +425 -0
- package/src/components/slides/minimap.tsx +127 -10
- package/src/components/slides/reveal-component.tsx +287 -61
- package/src/components/slides/slide-cell-view.tsx +26 -2
- package/src/components/slides/slide-form.tsx +26 -4
- package/src/components/storage/__tests__/storage-inspector.test.ts +53 -0
- package/src/components/storage/storage-inspector.tsx +68 -48
- package/src/components/ui/__tests__/use-toast.test.ts +75 -0
- package/src/components/ui/combobox.tsx +51 -32
- package/src/components/ui/reorderable-list.tsx +13 -0
- package/src/components/ui/select-core/__tests__/use-select-list.test.ts +294 -0
- package/src/components/ui/select-core/__tests__/utils.test.ts +222 -0
- package/src/components/ui/select-core/index.ts +16 -0
- package/src/components/ui/select-core/option-row.tsx +33 -0
- package/src/components/ui/select-core/render-slot.ts +20 -0
- package/src/components/ui/select-core/select-list.tsx +248 -0
- package/src/components/ui/select-core/types.ts +44 -0
- package/src/components/ui/select-core/use-select-list.ts +347 -0
- package/src/components/ui/select-core/utils.ts +121 -0
- package/src/components/ui/use-toast.ts +33 -13
- package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +0 -28
- package/src/core/cells/__tests__/cell.test.ts +29 -2
- package/src/core/cells/cell.ts +5 -1
- package/src/core/codemirror/go-to-definition/commands.ts +4 -3
- package/src/core/codemirror/language/languages/python.ts +2 -0
- package/src/core/codemirror/language/languages/sql/utils.ts +3 -1
- package/src/core/codemirror/lsp/__tests__/markdown-renderer.test.ts +41 -0
- package/src/core/codemirror/lsp/markdown-renderer.ts +59 -0
- package/src/core/datasets/data-source-connections.ts +2 -0
- package/src/core/network/__tests__/requests-static.test.ts +30 -0
- package/src/core/network/requests-static.ts +14 -10
- package/src/core/wasm/worker/bootstrap.ts +12 -4
- package/src/plugins/impl/MultiselectPlugin.tsx +19 -142
- package/src/plugins/impl/SearchableSelect.tsx +16 -97
- package/src/plugins/impl/__tests__/DropdownPlugin.test.tsx +5 -2
- package/src/plugins/impl/__tests__/MultiSelectPlugin.test.ts +1 -1
- package/src/plugins/layout/DownloadPlugin.tsx +1 -1
- package/src/utils/lazy.ts +6 -1
- package/dist/assets/__vite-browser-external-Ci2ZQfXU.js +0 -1
- package/dist/assets/worker-ip3AI_sN.js +0 -73
- package/dist/dist-0Fif7jnk.js +0 -5
- package/dist/dist-B5h_9sHB.js +0 -6
- package/dist/dist-B9M6R5ye.js +0 -5
- package/dist/dist-BCt3tnck.js +0 -8
- package/dist/dist-BUIJwMwn.js +0 -8
- package/dist/dist-BpquMd3k.js +0 -5
- package/dist/dist-BzJsqYfz.js +0 -5
- package/dist/dist-CA5ELXAf.js +0 -6
- package/dist/dist-CLBRs6Uv.js +0 -5
- package/dist/dist-CStVCMbq.js +0 -5
- package/dist/dist-CZRIEY3Y.js +0 -8
- package/dist/dist-CuUHbFD0.js +0 -5
- package/dist/dist-DV7Iabxb.js +0 -8
- package/dist/dist-DhHh0jLg.js +0 -1247
- package/dist/dist-DuEeHMvL.js +0 -5
- package/dist/esm-BfhQmZjp.js +0 -1171
- package/src/plugins/impl/multiselectFilterFn.tsx +0 -22
- /package/src/components/{data-table → ui}/value-chips.tsx +0 -0
|
@@ -5,34 +5,34 @@ import { s as __toESM, t as __commonJSMin } from "./chunk-BNovOVIE.js";
|
|
|
5
5
|
import { _ as Logger, c as Objects, g as cn, l as useEventListener, t as Button } from "./button-C5K9fIPF.js";
|
|
6
6
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
7
7
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
8
|
-
import { r as toast } from "./copy-
|
|
9
|
-
import {
|
|
8
|
+
import { r as toast } from "./copy-UqRYxiOg.js";
|
|
9
|
+
import { C as AccordionContent, D as ChatBubbleIcon, En as Trash2, Et as createVariableInfoElement, G as cellErrorsAtom, Gt as getTableType, In as ExternalLink, It as jotaiJsonStorage, Lt as variablesAtom, Mt as generateUUID, Nn as Info, P as base64ToDataURL, Pn as FileText, Rt as PluralWord, S as Accordion, T as AccordionTrigger, Tn as Wrench, Ut as allTablesAtom, V as renderHTML, Wt as dataSourceConnectionsAtom, X as notebookAtom, Zt as singleFacet, _ as Boosts, _n as atomWithStorage, b as AIContextProvider, c as Popover, d as PopoverTrigger, f as isOutputEmpty, h as DatasourceContextProvider, jn as LoaderCircle, kt as moveToEndOfEditor, n as Spinner, nn as ZodLocalStorage, qt as getRequestClient, r as MarkdownRenderer, sn as CellOutputId, t as toPng, u as PopoverContent, v as Sections, w as AccordionItem, x as AIContextRegistry, y as contextToXml, yn as Anchor2, yt as displayCellName, zn as CircleX } from "./html-to-image-UEH5lFDZ.js";
|
|
10
10
|
import "./chunk-5FQGJX7Z-BNjes6Yx.js";
|
|
11
|
-
import { u as createLucideIcon } from "./dist-
|
|
12
|
-
import {
|
|
13
|
-
import { a as NumberField,
|
|
14
|
-
import { p as isUrl, v as CircleQuestionMark } from "./toDate-
|
|
15
|
-
import { a as MarimoIncomingMessageEvent, d as Square, f as File$1, n as blobToString, t as processOutput, u as deserializeBlob } from "./process-output-
|
|
11
|
+
import { u as createLucideIcon } from "./dist-Dk6PV_d3.js";
|
|
12
|
+
import { C as logNever, I as X, R as ChevronDown, t as Strings } from "./strings-J57tzLr3.js";
|
|
13
|
+
import { a as NumberField, d as DropdownMenuContent, p as DropdownMenuItem, r as Input, u as DropdownMenu, x as DropdownMenuTrigger } from "./input-CMYy4hzj.js";
|
|
14
|
+
import { p as isUrl, v as CircleQuestionMark } from "./toDate-d8RCRrRd.js";
|
|
15
|
+
import { a as MarimoIncomingMessageEvent, d as Square, f as File$1, n as blobToString, t as processOutput, u as deserializeBlob } from "./process-output-CyMLTogj.js";
|
|
16
16
|
import "./react-dom-BTJzcVJ9.js";
|
|
17
17
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
18
|
-
import { A as looseObject, B as union, C as any, D as discriminatedUnion, E as custom, H as safeParseAsync, I as record, L as strictObject, M as never, N as number, O as lazy, P as object$1, R as string, S as _null, T as boolean, V as unknown, W as toJSONSchema, b as _enum, k as literal, w as array$1, x as _instanceof } from "./zod-
|
|
19
|
-
import { n as ErrorBanner } from "./error-banner-
|
|
20
|
-
import { t as Label } from "./label-
|
|
21
|
-
import { t as Tooltip } from "./tooltip-
|
|
22
|
-
import { f as CopyClipboardIcon } from "./extends-
|
|
18
|
+
import { A as looseObject, B as union, C as any, D as discriminatedUnion, E as custom, H as safeParseAsync, I as record, L as strictObject, M as never, N as number, O as lazy, P as object$1, R as string, S as _null, T as boolean, V as unknown, W as toJSONSchema, b as _enum, k as literal, w as array$1, x as _instanceof } from "./zod-aLSua2NL.js";
|
|
19
|
+
import { n as ErrorBanner } from "./error-banner-Cc0I3C9e.js";
|
|
20
|
+
import { t as Label } from "./label-CC4ytI1X.js";
|
|
21
|
+
import { t as Tooltip } from "./tooltip-DpcyNkQ2.js";
|
|
22
|
+
import { f as CopyClipboardIcon } from "./extends-D_hDsj6R.js";
|
|
23
23
|
import { t as isEmpty_default } from "./isEmpty-CJJMn-QP.js";
|
|
24
|
-
import { T as useEvent_default, n as useTheme, y as useStore } from "./useTheme-
|
|
25
|
-
import { $ as
|
|
26
|
-
import { n as acceptCompletion, o as closeCompletion, r as autocompletion } from "./dist-
|
|
24
|
+
import { T as useEvent_default, n as useTheme, y as useStore } from "./useTheme-DEhDzATN.js";
|
|
25
|
+
import { $ as EditorView, At as Facet, It as StateEffect, Lt as StateField, Mt as Prec, Z as Decoration, ft as hoverTooltip, kt as EditorState, nt as WidgetType, pt as keymap, tt as ViewPlugin, zt as Transaction } from "./dist-U4F-tbMs.js";
|
|
26
|
+
import { n as acceptCompletion, o as closeCompletion, r as autocompletion } from "./dist-hT4QzYX-.js";
|
|
27
27
|
import "./main-Tj_-QTyF.js";
|
|
28
|
-
import { a as markdown } from "./dist-
|
|
29
|
-
import "./dist-
|
|
30
|
-
import "./dist-
|
|
31
|
-
import "./dist-
|
|
32
|
-
import "./dist-
|
|
33
|
-
import { n as minimalSetup, t as esm_default } from "./esm-
|
|
28
|
+
import { a as markdown } from "./dist-Dv_Y15yk.js";
|
|
29
|
+
import "./dist-BSAt6RhH.js";
|
|
30
|
+
import "./dist-D-W5ny5a.js";
|
|
31
|
+
import "./dist-M9Vag9Y0.js";
|
|
32
|
+
import "./dist-C_Y3oV3C.js";
|
|
33
|
+
import { n as minimalSetup, t as esm_default } from "./esm-BaH2eg5-.js";
|
|
34
34
|
import "./purify.es-H92eMd9-.js";
|
|
35
|
-
import { t as useAsyncData } from "./useAsyncData-
|
|
35
|
+
import { t as useAsyncData } from "./useAsyncData-PonK__yh.js";
|
|
36
36
|
var Ban = createLucideIcon("ban", [["path", {
|
|
37
37
|
d: "M4.929 4.929 19.07 19.071",
|
|
38
38
|
key: "196cmz"
|
|
@@ -6504,15 +6504,15 @@ var import_compiler_runtime$8 = require_compiler_runtime();
|
|
|
6504
6504
|
const ReasoningAccordion = (e18) => {
|
|
6505
6505
|
let m = (0, import_compiler_runtime$8.c)(13), { reasoning: h, index: g, isStreaming: _ } = e18, v = g === void 0 ? 0 : g, y = _ === void 0 ? false : _, [b, x] = import_react.useState("");
|
|
6506
6506
|
if (!h && !y) return null;
|
|
6507
|
-
let S = y ? "reasoning" : b,
|
|
6508
|
-
m[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
6507
|
+
let S = y ? "reasoning" : b, w;
|
|
6508
|
+
m[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BotMessageSquare, { className: "h-3 w-3" }), m[0] = w) : w = m[0];
|
|
6509
6509
|
let T = y ? "Thinking" : "View reasoning", E = h.length > 0 && ` (${h.length} chars)`, D;
|
|
6510
6510
|
m[1] !== T || m[2] !== E ? (D = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionTrigger, {
|
|
6511
6511
|
className: "text-xs text-muted-foreground hover:bg-muted/50 px-2 py-1 h-auto rounded-sm [&[data-state=open]>svg]:rotate-180",
|
|
6512
6512
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
6513
6513
|
className: "flex items-center gap-2",
|
|
6514
6514
|
children: [
|
|
6515
|
-
|
|
6515
|
+
w,
|
|
6516
6516
|
T,
|
|
6517
6517
|
E
|
|
6518
6518
|
]
|
|
@@ -6694,11 +6694,11 @@ const ToolErrorCard = (e18) => {
|
|
|
6694
6694
|
children: v
|
|
6695
6695
|
})] })]
|
|
6696
6696
|
}), m[20] = v, m[21] = g, m[22] = x, m[23] = I) : I = m[23];
|
|
6697
|
-
let
|
|
6698
|
-
return m[24] !== F || m[25] !== I || m[26] !== E ? (
|
|
6697
|
+
let L;
|
|
6698
|
+
return m[24] !== F || m[25] !== I || m[26] !== E ? (L = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6699
6699
|
className: E,
|
|
6700
6700
|
children: [F, I]
|
|
6701
|
-
}), m[24] = F, m[25] = I, m[26] = E, m[27] =
|
|
6701
|
+
}), m[24] = F, m[25] = I, m[26] = E, m[27] = L) : L = m[27], L;
|
|
6702
6702
|
};
|
|
6703
6703
|
function _temp$2(e18) {
|
|
6704
6704
|
return !e18;
|
|
@@ -6835,7 +6835,7 @@ function getTriggerToneClass(e18) {
|
|
|
6835
6835
|
}
|
|
6836
6836
|
}
|
|
6837
6837
|
const ToolHistoryRow = (e18) => {
|
|
6838
|
-
let m = (0, import_compiler_runtime$3.c)(29), { toolName: h, state: g, input: v, result: y, approval: b, index: x, className: S } = e18,
|
|
6838
|
+
let m = (0, import_compiler_runtime$3.c)(29), { toolName: h, state: g, input: v, result: y, approval: b, index: x, className: S } = e18, w = `tool-${x === void 0 ? 0 : x}`, T;
|
|
6839
6839
|
m[0] === S ? T = m[1] : (T = cn("w-full", S), m[0] = S, m[1] = T);
|
|
6840
6840
|
let E;
|
|
6841
6841
|
m[2] === g ? E = m[3] : (E = cn("h-6 text-xs border-border shadow-none! ring-0! bg-muted/60 hover:bg-muted py-0 px-2 gap-1 rounded-sm [&[data-state=open]>svg]:rotate-180 hover:no-underline", getTriggerToneClass(g)), m[2] = g, m[3] = E);
|
|
@@ -6880,12 +6880,12 @@ const ToolHistoryRow = (e18) => {
|
|
|
6880
6880
|
children: [M, N]
|
|
6881
6881
|
}), m[22] = M, m[23] = N, m[24] = P) : P = m[24];
|
|
6882
6882
|
let F;
|
|
6883
|
-
return m[25] !== P || m[26] !==
|
|
6883
|
+
return m[25] !== P || m[26] !== w || m[27] !== T ? (F = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Accordion, {
|
|
6884
6884
|
type: "single",
|
|
6885
6885
|
collapsible: true,
|
|
6886
6886
|
className: T,
|
|
6887
6887
|
children: P
|
|
6888
|
-
},
|
|
6888
|
+
}, w), m[25] = P, m[26] = w, m[27] = T, m[28] = F) : F = m[28], F;
|
|
6889
6889
|
};
|
|
6890
6890
|
var HistoryContent = (e18) => {
|
|
6891
6891
|
let m = (0, import_compiler_runtime$3.c)(16), { state: h, input: g, result: _, approval: v } = e18;
|
|
@@ -7584,22 +7584,22 @@ function routeIncomingChatChunk(e18, m) {
|
|
|
7584
7584
|
}
|
|
7585
7585
|
const Chatbot = (e18) => {
|
|
7586
7586
|
var _a;
|
|
7587
|
-
let [m, g] = (0, import_react.useState)(""), [b, x] = (0, import_react.useState)(e18.config), [S, C] = (0, import_react.useState)(e18.config), [w,
|
|
7587
|
+
let [m, g] = (0, import_react.useState)(""), [b, x] = (0, import_react.useState)(e18.config), [S, C] = (0, import_react.useState)(e18.config), [w, E] = (0, import_react.useState)(void 0), D = (0, import_react.useRef)(null), O = (0, import_react.useRef)(null), k = (0, import_react.useRef)(null), A = (0, import_react.useRef)(null);
|
|
7588
7588
|
Object.keys(e18.config).some((m2) => e18.config[m2] !== S[m2]) && (x(e18.config), C(e18.config));
|
|
7589
|
-
let
|
|
7590
|
-
|
|
7591
|
-
let
|
|
7589
|
+
let j = (0, import_react.useRef)(b);
|
|
7590
|
+
j.current = b;
|
|
7591
|
+
let N = (0, import_react.useRef)(null), P = (0, import_react.useRef)(null), { data: F } = useAsyncData(async () => (await e18.get_chat_history({})).messages, []), I = e18.value.length > 0 ? e18.value : F, { messages: L, sendMessage: R, setMessages: z, status: B, stop: V, error: H, regenerate: U, clearError: W, addToolApprovalResponse: G } = useChat({
|
|
7592
7592
|
sendAutomaticallyWhen: ({ messages: e19 }) => hasPendingToolCalls(e19),
|
|
7593
7593
|
transport: new DefaultChatTransport({ fetch: async (m2, g2) => {
|
|
7594
7594
|
var _a2;
|
|
7595
7595
|
if (g2 === void 0) return fetch(m2);
|
|
7596
7596
|
let _ = JSON.parse(g2.body), v = g2.signal, y = {
|
|
7597
|
-
max_tokens:
|
|
7598
|
-
temperature:
|
|
7599
|
-
top_p:
|
|
7600
|
-
top_k:
|
|
7601
|
-
frequency_penalty:
|
|
7602
|
-
presence_penalty:
|
|
7597
|
+
max_tokens: j.current.max_tokens,
|
|
7598
|
+
temperature: j.current.temperature,
|
|
7599
|
+
top_p: j.current.top_p,
|
|
7600
|
+
top_k: j.current.top_k,
|
|
7601
|
+
frequency_penalty: j.current.frequency_penalty,
|
|
7602
|
+
presence_penalty: j.current.presence_penalty
|
|
7603
7603
|
};
|
|
7604
7604
|
try {
|
|
7605
7605
|
let m3 = _.messages.map((e19) => {
|
|
@@ -7610,14 +7610,14 @@ const Chatbot = (e18) => {
|
|
|
7610
7610
|
};
|
|
7611
7611
|
}), g3 = generateUUID(), b2 = new ReadableStream({
|
|
7612
7612
|
start(m4) {
|
|
7613
|
-
|
|
7613
|
+
N.current = m4, P.current = g3;
|
|
7614
7614
|
let _2 = () => {
|
|
7615
7615
|
try {
|
|
7616
7616
|
m4.close();
|
|
7617
7617
|
} catch (e19) {
|
|
7618
7618
|
Logger.debug("Controller may already be closed", { error: e19 });
|
|
7619
7619
|
}
|
|
7620
|
-
|
|
7620
|
+
N.current = null, P.current = null, e18.cancel_prompt({ request_id: g3 }).catch((e19) => {
|
|
7621
7621
|
Logger.debug("cancel_prompt failed", { error: e19 });
|
|
7622
7622
|
});
|
|
7623
7623
|
};
|
|
@@ -7626,7 +7626,7 @@ const Chatbot = (e18) => {
|
|
|
7626
7626
|
};
|
|
7627
7627
|
},
|
|
7628
7628
|
cancel() {
|
|
7629
|
-
|
|
7629
|
+
N.current = null, P.current = null;
|
|
7630
7630
|
}
|
|
7631
7631
|
});
|
|
7632
7632
|
return e18.send_prompt({
|
|
@@ -7635,7 +7635,7 @@ const Chatbot = (e18) => {
|
|
|
7635
7635
|
config: y
|
|
7636
7636
|
}).catch((e19) => {
|
|
7637
7637
|
var _a3;
|
|
7638
|
-
(_a3 =
|
|
7638
|
+
(_a3 = N.current) == null ? void 0 : _a3.error(e19), N.current = null, P.current = null;
|
|
7639
7639
|
}), createUIMessageStreamResponse({ stream: b2 });
|
|
7640
7640
|
} catch (e19) {
|
|
7641
7641
|
if (e19 instanceof Error && e19.name === "AbortError") return new Response("Aborted", { status: 499 });
|
|
@@ -7643,9 +7643,9 @@ const Chatbot = (e18) => {
|
|
|
7643
7643
|
return new Response(m3, { status: 400 });
|
|
7644
7644
|
}
|
|
7645
7645
|
} }),
|
|
7646
|
-
messages:
|
|
7646
|
+
messages: I,
|
|
7647
7647
|
onFinish: (m2) => {
|
|
7648
|
-
|
|
7648
|
+
E(void 0), D.current && (D.current.value = ""), Logger.debug("Finished streaming message:", m2), e18.setValue(m2.messages);
|
|
7649
7649
|
},
|
|
7650
7650
|
onError: (e19) => {
|
|
7651
7651
|
Logger.error("An error occurred:", e19);
|
|
@@ -7654,15 +7654,15 @@ const Chatbot = (e18) => {
|
|
|
7654
7654
|
useEventListener(e18.host, MarimoIncomingMessageEvent.TYPE, (e19) => {
|
|
7655
7655
|
let m2 = ChatMessageIncomingSchema.safeParse(e19.detail.message);
|
|
7656
7656
|
m2.success && routeIncomingChatChunk(m2.data, {
|
|
7657
|
-
controllerRef:
|
|
7658
|
-
activeRequestIdRef:
|
|
7657
|
+
controllerRef: N,
|
|
7658
|
+
activeRequestIdRef: P
|
|
7659
7659
|
});
|
|
7660
7660
|
});
|
|
7661
|
-
let K =
|
|
7662
|
-
let h =
|
|
7661
|
+
let K = B === "submitted" || B === "streaming", q = (m2) => {
|
|
7662
|
+
let h = L.findIndex((e19) => e19.id === m2);
|
|
7663
7663
|
if (h !== -1) {
|
|
7664
|
-
let g2 =
|
|
7665
|
-
e18.delete_chat_message({ index: h }),
|
|
7664
|
+
let g2 = L.filter((e19) => e19.id !== m2);
|
|
7665
|
+
e18.delete_chat_message({ index: h }), z(g2), e18.setValue(g2);
|
|
7666
7666
|
}
|
|
7667
7667
|
}, J = Array.isArray(e18.allowAttachments) && e18.allowAttachments.length > 0 || e18.allowAttachments === true, Y = {
|
|
7668
7668
|
triggerCompletionRegex: /^\/(\w+)?/,
|
|
@@ -7674,12 +7674,12 @@ const Chatbot = (e18) => {
|
|
|
7674
7674
|
}, Z = e18.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
|
|
7675
7675
|
(0, import_react.useEffect)(() => {
|
|
7676
7676
|
var _a2;
|
|
7677
|
-
(_a2 =
|
|
7678
|
-
top:
|
|
7677
|
+
(_a2 = A.current) == null ? void 0 : _a2.scrollTo({
|
|
7678
|
+
top: A.current.scrollHeight,
|
|
7679
7679
|
behavior: "smooth"
|
|
7680
7680
|
});
|
|
7681
|
-
}, [
|
|
7682
|
-
let Q = (_a =
|
|
7681
|
+
}, [L.length, A]);
|
|
7682
|
+
let Q = (_a = k.current) == null ? void 0 : _a.view, $ = () => {
|
|
7683
7683
|
if (Q) {
|
|
7684
7684
|
let e19 = Q.state.doc.length;
|
|
7685
7685
|
Q.dispatch({ changes: {
|
|
@@ -7699,18 +7699,18 @@ const Chatbot = (e18) => {
|
|
|
7699
7699
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, {
|
|
7700
7700
|
variant: "text",
|
|
7701
7701
|
size: "icon",
|
|
7702
|
-
disabled:
|
|
7702
|
+
disabled: L.length === 0,
|
|
7703
7703
|
onClick: () => {
|
|
7704
|
-
|
|
7704
|
+
z([]), e18.setValue([]), e18.delete_chat_history({}), W();
|
|
7705
7705
|
},
|
|
7706
7706
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RotateCw, { className: "h-3 w-3" })
|
|
7707
7707
|
})
|
|
7708
7708
|
}),
|
|
7709
7709
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
7710
7710
|
className: "grow overflow-y-auto gap-4 pt-8 pb-4 px-2 flex flex-col",
|
|
7711
|
-
ref:
|
|
7711
|
+
ref: A,
|
|
7712
7712
|
children: [
|
|
7713
|
-
|
|
7713
|
+
L.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
7714
7714
|
className: "flex flex-col items-center justify-center h-full text-muted-foreground text-center p-4",
|
|
7715
7715
|
children: [
|
|
7716
7716
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BotMessageSquare, { className: "h-12 w-12 mb-4" }),
|
|
@@ -7724,16 +7724,16 @@ const Chatbot = (e18) => {
|
|
|
7724
7724
|
})
|
|
7725
7725
|
]
|
|
7726
7726
|
}),
|
|
7727
|
-
|
|
7727
|
+
L.map((e19, m2) => {
|
|
7728
7728
|
var _a2;
|
|
7729
|
-
let h = (_a2 = e19.parts) == null ? void 0 : _a2.filter((e20) => e20.type === "text").map((e20) => e20.text).join("\n"), g2 = m2 ===
|
|
7729
|
+
let h = (_a2 = e19.parts) == null ? void 0 : _a2.filter((e20) => e20.type === "text").map((e20) => e20.text).join("\n"), g2 = m2 === L.length - 1;
|
|
7730
7730
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
7731
7731
|
className: cn("flex flex-col group gap-2", e19.role === "user" ? "items-end" : "items-start"),
|
|
7732
7732
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
7733
7733
|
className: `max-w-[80%] p-3 rounded-lg ${e19.role === "user" ? "bg-(--sky-11) text-(--slate-1) whitespace-pre-wrap" : "bg-(--slate-4) text-(--slate-12)"}`,
|
|
7734
7734
|
children: renderUIMessage({
|
|
7735
7735
|
message: e19,
|
|
7736
|
-
isStreamingReasoning:
|
|
7736
|
+
isStreamingReasoning: B === "streaming",
|
|
7737
7737
|
isLast: g2,
|
|
7738
7738
|
addToolApprovalResponse: g2 ? G : void 0
|
|
7739
7739
|
})
|
|
@@ -7771,7 +7771,7 @@ const Chatbot = (e18) => {
|
|
|
7771
7771
|
onSubmit: async (h) => {
|
|
7772
7772
|
if (h.preventDefault(), e18.disabled) return;
|
|
7773
7773
|
let g2 = w ? await convertToFileUIPart(w) : void 0;
|
|
7774
|
-
|
|
7774
|
+
R({
|
|
7775
7775
|
role: "user",
|
|
7776
7776
|
parts: [{
|
|
7777
7777
|
type: "text",
|
|
@@ -7779,7 +7779,7 @@ const Chatbot = (e18) => {
|
|
|
7779
7779
|
}, ...g2 ?? []]
|
|
7780
7780
|
}), $();
|
|
7781
7781
|
},
|
|
7782
|
-
ref:
|
|
7782
|
+
ref: O,
|
|
7783
7783
|
inert: e18.disabled || void 0,
|
|
7784
7784
|
className: cn("flex w-full border-t border-(--slate-6) px-2 py-1 items-center", e18.disabled && "opacity-50 cursor-not-allowed"),
|
|
7785
7785
|
children: [
|
|
@@ -7799,12 +7799,12 @@ const Chatbot = (e18) => {
|
|
|
7799
7799
|
className: "rounded-sm mr-2",
|
|
7800
7800
|
placeholder: Z,
|
|
7801
7801
|
value: m,
|
|
7802
|
-
inputRef:
|
|
7802
|
+
inputRef: k,
|
|
7803
7803
|
maxHeight: e18.maxHeight ? `${e18.maxHeight / 2}px` : void 0,
|
|
7804
7804
|
onChange: g,
|
|
7805
7805
|
onSubmit: (e19, m2) => {
|
|
7806
7806
|
var _a2;
|
|
7807
|
-
m2.trim() && ((_a2 =
|
|
7807
|
+
m2.trim() && ((_a2 = O.current) == null ? void 0 : _a2.requestSubmit());
|
|
7808
7808
|
},
|
|
7809
7809
|
onClose: () => {
|
|
7810
7810
|
},
|
|
@@ -7825,7 +7825,7 @@ const Chatbot = (e18) => {
|
|
|
7825
7825
|
variant: "text",
|
|
7826
7826
|
size: "sm",
|
|
7827
7827
|
onClick: () => {
|
|
7828
|
-
|
|
7828
|
+
E(void 0), D.current && (D.current.value = "");
|
|
7829
7829
|
},
|
|
7830
7830
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(X, { className: "size-3" })
|
|
7831
7831
|
}),
|
|
@@ -7835,17 +7835,17 @@ const Chatbot = (e18) => {
|
|
|
7835
7835
|
size: "sm",
|
|
7836
7836
|
onClick: () => {
|
|
7837
7837
|
var _a2;
|
|
7838
|
-
return (_a2 =
|
|
7838
|
+
return (_a2 = D.current) == null ? void 0 : _a2.click();
|
|
7839
7839
|
},
|
|
7840
7840
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Paperclip, { className: "h-4" })
|
|
7841
7841
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
|
|
7842
7842
|
type: "file",
|
|
7843
|
-
ref:
|
|
7843
|
+
ref: D,
|
|
7844
7844
|
className: "hidden",
|
|
7845
7845
|
multiple: true,
|
|
7846
7846
|
accept: Array.isArray(e18.allowAttachments) ? e18.allowAttachments.join(",") : void 0,
|
|
7847
7847
|
onChange: (e19) => {
|
|
7848
|
-
e19.target.files &&
|
|
7848
|
+
e19.target.files && E([...e19.target.files]);
|
|
7849
7849
|
}
|
|
7850
7850
|
})] }),
|
|
7851
7851
|
K ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tooltip, {
|
|
@@ -7993,8 +7993,8 @@ var configDescriptions = {
|
|
|
7993
7993
|
m[0] === g ? S = m[1] : (S = (e19) => {
|
|
7994
7994
|
[...e19.matchAll(/{{(\w+)}}/g)].length > 0 ? (x(e19), v(true)) : g(e19);
|
|
7995
7995
|
}, m[0] = g, m[1] = S);
|
|
7996
|
-
let C = S,
|
|
7997
|
-
m[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
7996
|
+
let C = S, T;
|
|
7997
|
+
m[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tooltip, {
|
|
7998
7998
|
content: "Select a prompt",
|
|
7999
7999
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuTrigger, {
|
|
8000
8000
|
asChild: true,
|
|
@@ -8005,7 +8005,7 @@ var configDescriptions = {
|
|
|
8005
8005
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChatBubbleIcon, { className: "h-3 w-3" })
|
|
8006
8006
|
})
|
|
8007
8007
|
})
|
|
8008
|
-
}), m[2] =
|
|
8008
|
+
}), m[2] = T) : T = m[2];
|
|
8009
8009
|
let E;
|
|
8010
8010
|
if (m[3] !== C || m[4] !== h) {
|
|
8011
8011
|
let e19;
|
|
@@ -8016,7 +8016,7 @@ var configDescriptions = {
|
|
|
8016
8016
|
}, m2), m[6] = C, m[7] = e19), E = h.map(e19), m[3] = C, m[4] = h, m[5] = E;
|
|
8017
8017
|
} else E = m[5];
|
|
8018
8018
|
let D;
|
|
8019
|
-
m[8] === E ? D = m[9] : (D = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverAnchor, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DropdownMenu, { children: [
|
|
8019
|
+
m[8] === E ? D = m[9] : (D = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverAnchor, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DropdownMenu, { children: [T, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuContent, {
|
|
8020
8020
|
side: "right",
|
|
8021
8021
|
align: "end",
|
|
8022
8022
|
onCloseAutoFocus: _temp,
|