@qredence/fleet 0.7.4 → 0.8.0
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/CHANGELOG.md +17 -0
- package/README.md +5 -4
- package/bin/fleet-prime.mjs +33 -6
- package/bin/prime-runtime.mjs +79 -0
- package/dist/runtime-manifest.json +32 -0
- package/dist/web/client/assets/DialogTitle-RY2UDuCY.js +1 -0
- package/dist/web/client/assets/FloatingPortal-XC0MCNnD.js +1 -0
- package/dist/web/client/assets/action-swap-BWRUNKQA.js +1 -0
- package/dist/web/client/assets/{alert-dialog-DtXvVhsF.js → alert-dialog-DGNvg0B1.js} +1 -1
- package/dist/web/client/assets/arrow-up-right-CG9RNk4p.js +1 -0
- package/dist/web/client/assets/{artifacts-panel-Bseg97yQ.js → artifacts-panel-BGXpKRJ7.js} +1 -1
- package/dist/web/client/assets/{badge-C--lf3bb.js → badge-DM06QVqB.js} +6 -6
- package/dist/web/client/assets/button-CWYjn8Zk.js +1 -0
- package/dist/web/client/assets/{card-Hngi3HGC.js → card-Dj1SnGUU.js} +1 -1
- package/dist/web/client/assets/{chat-command-palette-D_rm1r9d.js → chat-command-palette-PenyaZBw.js} +1 -1
- package/dist/web/client/assets/code-block-pKKmFZ5w.js +3 -0
- package/dist/web/client/assets/collapsible-Bk6zCsRX.js +1 -0
- package/dist/web/client/assets/{command-CmtCIDdH.js → command-imgUMV3r.js} +1 -1
- package/dist/web/client/assets/{create-project-dialog-m-9aoobN.js → create-project-dialog-C00d5yCq.js} +1 -1
- package/dist/web/client/assets/createBaseUIEventDetails-DIxvaz-Y.js +1 -0
- package/dist/web/client/assets/{dialog-Ddouieuu.js → dialog-zCNOQI63.js} +1 -1
- package/dist/web/client/assets/eye-iNSvs0UA.js +1 -0
- package/dist/web/client/assets/file-code-corner-BkDULqko.js +1 -0
- package/dist/web/client/assets/{fork-picker-dialog-DfGlB17w.js → fork-picker-dialog-Cgi48NnT.js} +1 -1
- package/dist/web/client/assets/globals-BuMuB_ea.css +2 -0
- package/dist/web/client/assets/{index-Bz5W4EOn.js → index-BqBdQGWs.js} +3 -3
- package/dist/web/client/assets/input-7g8_nw-Z.js +1 -0
- package/dist/web/client/assets/{input-group-EPMGh55u.js → input-group-Nq03Qums.js} +1 -1
- package/dist/web/client/assets/{ipython-tool-CMhnRVrC.js → ipython-tool-bieUhw9K.js} +1 -1
- package/dist/web/client/assets/markdown-CvBfbPCn.js +2 -0
- package/dist/web/client/assets/markdown-code-rFOkzN5N.js +4 -0
- package/dist/web/client/assets/{message-queue-Bg2MiJHM.js → message-queue-sSljtjYz.js} +1 -1
- package/dist/web/client/assets/{model-selector-list-BiU_7ivt.js → model-selector-list-Cp687pdm.js} +1 -1
- package/dist/web/client/assets/{notify-DhtmUPfE.js → notify-Cqdu6EV8.js} +1 -1
- package/dist/web/client/assets/{openui-renderer-MIB3JKYa.js → openui-renderer-BdYTcn-_.js} +50 -50
- package/dist/web/client/assets/{prompt-input-Dy-DSPqF.js → prompt-input-CoV1gTUQ.js} +1 -1
- package/dist/web/client/assets/{prompt-suggestions-CrpAiKeB.js → prompt-suggestions-CAY5JI-C.js} +1 -1
- package/dist/web/client/assets/provider-label-QrVOwKBO.js +1 -0
- package/dist/web/client/assets/reasoning-line-DGdPUMwT.js +1 -0
- package/dist/web/client/assets/rehype-katex-DITkIpVl.js +259 -0
- package/dist/web/client/assets/{repl-panel-DN5kZAcB.js → repl-panel-5xgkDXO5.js} +1 -1
- package/dist/web/client/assets/{resources-panel-DD6iWOF3.js → resources-panel-aJCKt9eF.js} +1 -1
- package/dist/web/client/assets/right-panel-registry-BaLZiKny.js +2 -0
- package/dist/web/client/assets/routes-BkFkhfO3.js +16 -0
- package/dist/web/client/assets/select-BhV4ikeN.js +1 -0
- package/dist/web/client/assets/session-activity-panel-Bc4-HSfb.js +1 -0
- package/dist/web/client/assets/session-reasoning-panel-CjJJK_bq.js +1 -0
- package/dist/web/client/assets/session-tool-renderer-C7mYeUOs.js +166 -0
- package/dist/web/client/assets/{session-tree-panel-BBwP_EK2.js → session-tree-panel-By9m9tGB.js} +1 -1
- package/dist/web/client/assets/settings-dialog-Dpt4Ha_m.js +2 -0
- package/dist/web/client/assets/shield-check-7HDd-2Fn.js +1 -0
- package/dist/web/client/assets/{skeleton-DNAr5ULI.js → skeleton-B_Lq2XFl.js} +1 -1
- package/dist/web/client/assets/{skeleton-loaders-B28mF4tJ.js → skeleton-loaders-DWc1eDL3.js} +1 -1
- package/dist/web/client/assets/sparkles-BwVa9zQJ.js +1 -0
- package/dist/web/client/assets/{spinner-CSBXk3Lo.js → spinner-B5TaKP7k.js} +1 -1
- package/dist/web/client/assets/{subagent-chat-panel-DhvBO4dQ.js → subagent-chat-panel-DsPmLZSf.js} +1 -1
- package/dist/web/client/assets/subagent-transcript-CNQ9wGk2.js +1 -0
- package/dist/web/client/assets/{subagents-panel-DRo8Xs6j.js → subagents-panel-gQ9BLfV3.js} +1 -1
- package/dist/web/client/assets/surfaces-BUjUJTyD.js +1 -0
- package/dist/web/client/assets/switch-C7Myu-Dt.js +1 -0
- package/dist/web/client/assets/toast-DlbKi6K-.js +1 -0
- package/dist/web/client/assets/tool-output-normalizer-CADgEiI4.js +4 -0
- package/dist/web/client/assets/tool-part-normalizer-CYK62WZM.js +4 -0
- package/dist/web/client/assets/tool-result-bjAGZ2qm.js +5 -0
- package/dist/web/client/assets/tool-timeline-eNqH1zj7.js +2 -0
- package/dist/web/client/assets/trace-IsV5RRvM.js +1 -0
- package/dist/web/client/assets/ui-preferences-B-PNDkyY.js +1 -0
- package/dist/web/client/assets/use-hover-capable-CLq8BADD.js +1 -0
- package/dist/web/client/assets/useBaseUiId-lKfDDIcw.js +1 -0
- package/dist/web/client/assets/useButton-CvcmqA2s.js +1 -0
- package/dist/web/client/assets/useRender-Bbk_fl72.js +1 -0
- package/dist/web/client/assets/{utils-CFDGLzf6.js → utils-oBThwhjm.js} +1 -1
- package/dist/web/client/assets/{workspace-panel-DdZutYnd.js → workspace-panel-Da5I4p_t.js} +1 -1
- package/dist/web/client/assets/workspace-path-nav-D-77sJ_A.js +2 -0
- package/dist/web/client/assets/wrench-BXX_Ah2s.js +1 -0
- package/dist/web/client/bundle-budget.json +6 -6
- package/dist/web/server/{_tanstack-start-manifest_v-YlngJGUa-YTWBGR7L.js → _tanstack-start-manifest_v-BiNPG4xt-BZTMSM2I.js} +33 -28
- package/dist/web/server/{artifacts-panel-COSC8o7j-GKW2HH2G.js → artifacts-panel-CqGBNU4q-UHNMC7PK.js} +23 -27
- package/dist/web/server/{chat-command-palette-CuOWdzkk-PKZQ5EZP.js → chat-command-palette-B94-zIEz-ES2ZB4ZF.js} +8 -10
- package/dist/web/server/{chunk-GLSR4ZI2.js → chunk-2FHYWKDN.js} +669 -833
- package/dist/web/server/{chunk-EBC7QORX.js → chunk-5GUEYYYO.js} +3680 -2098
- package/dist/web/server/{chunk-GLH2GWMG.js → chunk-7L5PCCYR.js} +411 -306
- package/dist/web/server/{chunk-KHHXJZK7.js → chunk-ABMGW6QH.js} +2784 -1662
- package/dist/web/server/{chunk-36CAMOVG.js → chunk-BAHZXA4D.js} +6 -6
- package/dist/web/server/{chunk-IN2ATSEG.js → chunk-CZLGB3NE.js} +2 -2
- package/dist/web/server/{chunk-WCKKN5BR.js → chunk-E6T36NM5.js} +347 -583
- package/dist/web/server/{chunk-ORCOCCER.js → chunk-EAKPTSWR.js} +4 -4
- package/dist/web/server/chunk-EL2JCDAM.js +270 -0
- package/dist/web/server/{chunk-6GTTTYSE.js → chunk-FB2QLQTN.js} +67 -73
- package/dist/web/server/{chunk-LLO4MNGE.js → chunk-K67IDUAI.js} +24 -26
- package/dist/web/server/{chunk-YU6RHHK6.js → chunk-LQM6QR7S.js} +10 -12
- package/dist/web/server/chunk-LTTBT3J7.js +129 -0
- package/dist/web/server/{chunk-TMQ3MT3D.js → chunk-OAYEN3JV.js} +2 -0
- package/dist/web/server/{chunk-ZUZPJNLY.js → chunk-OSPDNT7S.js} +829 -642
- package/dist/web/server/{chunk-XA7EOCHM.js → chunk-SGAQVAYL.js} +2 -2
- package/dist/web/server/chunk-SI5IQSG4.js +206 -0
- package/dist/web/server/{chunk-AKSDWYJY.js → chunk-SYS5FDNA.js} +5 -5
- package/dist/web/server/{chunk-QSM3BRMA.js → chunk-WSK55TKE.js} +169 -156
- package/dist/web/server/{chunk-BUKOEXE7.js → chunk-YQO36OP6.js} +2 -2
- package/dist/web/server/{create-project-dialog-0-arQpsX-ZELQKHS5.js → create-project-dialog-CFPX6Ihl-EO4XTINS.js} +12 -14
- package/dist/web/server/{dist-7G2NZPF4.js → dist-GQUZLXN5.js} +2 -2
- package/dist/web/server/{dist-E5637ZAY.js → dist-MN5NWCX6.js} +1 -1
- package/dist/web/server/{fork-picker-dialog-fj9p33Mq-I5SA3GLJ.js → fork-picker-dialog-B2RBFzoZ-R6GXPSPL.js} +6 -8
- package/dist/web/server/{markdown-CShfYRVO-RBTK7TRB.js → markdown-BvCfOB26-VDH4YOQD.js} +9 -6
- package/dist/web/server/{markdown-code-BDV_2b2T-6JYA5FWZ.js → markdown-code-SYc-BQvp-MR4FXT5C.js} +48 -9
- package/dist/web/server/{message-queue-BBC843IU-GY4ZIMM4.js → message-queue-D32rLiJo-HEBRGH5B.js} +6 -8
- package/dist/web/server/{model-selector-list-DE6aLNXt-LJZMCYOI.js → model-selector-list-DKzt_xEN-5ZPU6XDY.js} +8 -10
- package/dist/web/server/{openui-renderer-C3aqSKuS-PWLWJFYO.js → openui-renderer-CeVtOdYl-PY37PCJI.js} +12 -14
- package/dist/web/server/{prompt-suggestions-CpTK_fHV-UKJDTLVM.js → prompt-suggestions-CpTK_fHV-Q4ILLZKC.js} +1 -1
- package/dist/web/server/{rehype-katex-IDPYWU6M.js → rehype-katex-CYHGKI6Q.js} +490 -843
- package/dist/web/server/{repl-panel-1kSS1UGd-U64BPA7X.js → repl-panel-1kSS1UGd-DDM5ADGZ.js} +3 -3
- package/dist/web/server/{resources-panel-DWb0eGKa-K4EM3H7Y.js → resources-panel-S4NHlpz7-NF7WYYSR.js} +7 -9
- package/dist/web/server/{router-DZYr-9uT-AEXHEFXF.js → router-DVKxZik_-254GZAJW.js} +5 -6
- package/dist/web/server/{routes-vYxWRhis-AAZ73SNP.js → routes-BTxAklRp-UM7ZTLLP.js} +50 -30
- package/dist/web/server/server.js +2 -2
- package/dist/web/server/session-activity-panel-Bz2GrdMk-PCOXG46X.js +173 -0
- package/dist/web/server/session-reasoning-panel-CpiTdyQz-O3B5CDKS.js +62 -0
- package/dist/web/server/{session-tool-renderer-Dtt74Mts-7YYNSWRV.js → session-tool-renderer-BZiOxtt1-T3ZGAQKX.js} +10 -13
- package/dist/web/server/{session-tree-panel-HNl6R9VZ-4JUF34M7.js → session-tree-panel-CzkE0RFB-P4KWA7S2.js} +7 -9
- package/dist/web/server/{settings-dialog-DGZBA5Z_-6HYFMPNZ.js → settings-dialog-BUgVNpr1-THSYIOZL.js} +18 -21
- package/dist/web/server/{subagent-chat-panel-DuB4hqUk-LDCAJOCL.js → subagent-chat-panel-mw3kEFfK-CDYX7LST.js} +13 -16
- package/dist/web/server/{subagents-panel-wAvx3-Rs-L6UTDFUX.js → subagents-panel-2ZJfYrXG-NDJKHJHD.js} +15 -18
- package/dist/web/server/{workspace-panel-CPzJZwgv-YS7PTI5C.js → workspace-panel-xznrPDLt-QCJRZOF3.js} +7 -9
- package/package.json +2 -2
- package/dist/web/client/assets/DialogTitle-D-zqaHvF.js +0 -1
- package/dist/web/client/assets/FloatingPortal-73ZRZeD9.js +0 -1
- package/dist/web/client/assets/action-swap-BcFwS6is.js +0 -1
- package/dist/web/client/assets/button-BJZe4vNJ.js +0 -1
- package/dist/web/client/assets/chevron-up-CqeJYyZO.js +0 -1
- package/dist/web/client/assets/collapsible-DauSnbYp.js +0 -1
- package/dist/web/client/assets/createBaseUIEventDetails-DklXWq23.js +0 -1
- package/dist/web/client/assets/eye-Cs0lNChA.js +0 -1
- package/dist/web/client/assets/globals-C961mr-b.css +0 -2
- package/dist/web/client/assets/input-Def1xOZz.js +0 -1
- package/dist/web/client/assets/markdown-Big27m-v.js +0 -2
- package/dist/web/client/assets/markdown-code-7L4RiS50.js +0 -3
- package/dist/web/client/assets/provider-label-B_vy60P0.js +0 -1
- package/dist/web/client/assets/rehype-katex-A4PtQgTX.js +0 -259
- package/dist/web/client/assets/right-panel-registry-hKJN__3l.js +0 -2
- package/dist/web/client/assets/routes-C3h32Lj_.js +0 -16
- package/dist/web/client/assets/select-Buvv1tIo.js +0 -1
- package/dist/web/client/assets/session-reasoning-panel-DmEbXOrR.js +0 -1
- package/dist/web/client/assets/session-tool-renderer-Daol5fJw.js +0 -169
- package/dist/web/client/assets/settings-dialog-DYbx3xuq.js +0 -2
- package/dist/web/client/assets/sparkles-D_ANe-HY.js +0 -1
- package/dist/web/client/assets/subagent-transcript-Bx-rHni-.js +0 -1
- package/dist/web/client/assets/surfaces-B8xTOFeK.js +0 -1
- package/dist/web/client/assets/switch-CDfAwEvs.js +0 -1
- package/dist/web/client/assets/terminal-Ceucj7us.js +0 -1
- package/dist/web/client/assets/toast-9zXN-yVk.js +0 -1
- package/dist/web/client/assets/tool-part-normalizer-NbPs9kd1.js +0 -4
- package/dist/web/client/assets/tool-result-BccnO34D.js +0 -4
- package/dist/web/client/assets/tool-timeline-DlBZyd4j.js +0 -1
- package/dist/web/client/assets/ui-preferences-1YaENqef.js +0 -1
- package/dist/web/client/assets/use-hover-capable-MwFjBLZQ.js +0 -1
- package/dist/web/client/assets/workspace-path-nav-BRwuLsFl.js +0 -2
- package/dist/web/client/assets/wrench-BYnD147U.js +0 -1
- package/dist/web/server/chunk-CHSKEU3V.js +0 -166
- package/dist/web/server/chunk-OO7NBFQQ.js +0 -15
- package/dist/web/server/chunk-OXEAXEWD.js +0 -13
- package/dist/web/server/chunk-SIJVVYQT.js +0 -234
- package/dist/web/server/chunk-UQV2NU63.js +0 -163
- package/dist/web/server/chunk-VUBITQ5X.js +0 -653
- package/dist/web/server/session-reasoning-panel-XXU2yIOW-XXCKHISS.js +0 -192
- package/dist/web/server/tool-timeline-BKWsrZHK-3LGCOTPH.js +0 -12
|
@@ -2,43 +2,41 @@ import {
|
|
|
2
2
|
Label,
|
|
3
3
|
fieldValidityMapping,
|
|
4
4
|
useAriaLabelledBy,
|
|
5
|
+
useBaseUiId,
|
|
6
|
+
useControlled,
|
|
5
7
|
useFieldRootContext,
|
|
6
8
|
useFormContext,
|
|
7
9
|
useLabelableContext,
|
|
8
10
|
useLabelableId,
|
|
9
11
|
useRegisterFieldControl,
|
|
10
12
|
useValueChanged
|
|
11
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5GUEYYYO.js";
|
|
12
14
|
import {
|
|
15
|
+
createChangeEventDetails,
|
|
16
|
+
reason_parts_exports,
|
|
13
17
|
visuallyHidden,
|
|
14
18
|
visuallyHiddenInput
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
useBaseUiId,
|
|
18
|
-
useControlled
|
|
19
|
-
} from "./chunk-SIJVVYQT.js";
|
|
19
|
+
} from "./chunk-OSPDNT7S.js";
|
|
20
20
|
import {
|
|
21
21
|
EMPTY_OBJECT,
|
|
22
|
-
createChangeEventDetails,
|
|
23
22
|
dispatchClickWithModifiers,
|
|
24
23
|
formatErrorMessage_default,
|
|
25
|
-
reason_parts_exports,
|
|
26
24
|
useButton,
|
|
27
25
|
useIsoLayoutEffect,
|
|
28
26
|
useMergedRefs,
|
|
29
27
|
useRenderElement
|
|
30
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-2FHYWKDN.js";
|
|
31
29
|
import {
|
|
32
30
|
cva
|
|
33
31
|
} from "./chunk-FB3UHLLN.js";
|
|
34
32
|
import {
|
|
35
33
|
cn
|
|
36
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-OAYEN3JV.js";
|
|
37
35
|
import {
|
|
38
36
|
__export
|
|
39
37
|
} from "./chunk-CZ7CSFO4.js";
|
|
40
38
|
|
|
41
|
-
// web/app/dist/server/assets/switch-
|
|
39
|
+
// web/app/dist/server/assets/switch-N_lbAD5n.js
|
|
42
40
|
import { jsx } from "react/jsx-runtime";
|
|
43
41
|
|
|
44
42
|
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/switch/index.parts.mjs
|
|
@@ -280,7 +278,7 @@ var SwitchThumb = /* @__PURE__ */ React3.forwardRef(function SwitchThumb2(compon
|
|
|
280
278
|
});
|
|
281
279
|
if (process.env.NODE_ENV !== "production") SwitchThumb.displayName = "SwitchThumb";
|
|
282
280
|
|
|
283
|
-
// web/app/dist/server/assets/switch-
|
|
281
|
+
// web/app/dist/server/assets/switch-N_lbAD5n.js
|
|
284
282
|
var alertVariants = cva("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4", {
|
|
285
283
|
variants: { variant: {
|
|
286
284
|
default: "bg-card text-card-foreground",
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button$1
|
|
3
|
+
} from "./chunk-2FHYWKDN.js";
|
|
4
|
+
import {
|
|
5
|
+
cva
|
|
6
|
+
} from "./chunk-FB3UHLLN.js";
|
|
7
|
+
import {
|
|
8
|
+
Check,
|
|
9
|
+
Copy
|
|
10
|
+
} from "./chunk-7L5PCCYR.js";
|
|
11
|
+
import {
|
|
12
|
+
cn
|
|
13
|
+
} from "./chunk-OAYEN3JV.js";
|
|
14
|
+
|
|
15
|
+
// web/app/dist/server/assets/code-block-D_DUnpxV.js
|
|
16
|
+
import { useEffect, useState } from "react";
|
|
17
|
+
import { jsx } from "react/jsx-runtime";
|
|
18
|
+
var codeBlockVariants = cva("group/code-block relative flex w-full min-w-0 flex-col overflow-hidden rounded-lg text-sm", {
|
|
19
|
+
variants: { variant: {
|
|
20
|
+
default: "border border-input text-foreground dark:bg-input/30",
|
|
21
|
+
destructive: "border border-destructive/30 text-destructive dark:border-destructive/40"
|
|
22
|
+
} },
|
|
23
|
+
defaultVariants: { variant: "default" }
|
|
24
|
+
});
|
|
25
|
+
function CodeBlock({ className, variant = "default", size = "default", ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx("div", {
|
|
27
|
+
"data-slot": "code-block",
|
|
28
|
+
"data-variant": variant,
|
|
29
|
+
"data-size": size,
|
|
30
|
+
className: cn(codeBlockVariants({ variant }), size === "sm" && "text-xs", className),
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function CodeBlockHeader({ className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx("div", {
|
|
36
|
+
"data-slot": "code-block-header",
|
|
37
|
+
className: cn("flex min-w-0 shrink-0 items-center gap-2 px-3 pt-3 text-muted-foreground", className),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function CodeBlockTitle({ className, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx("div", {
|
|
43
|
+
"data-slot": "code-block-title",
|
|
44
|
+
className: cn("min-w-0 truncate font-sans text-sm font-medium text-foreground", className),
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function CodeBlockActions({ className, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ jsx("div", {
|
|
50
|
+
"data-slot": "code-block-actions",
|
|
51
|
+
className: cn("ms-auto flex shrink-0 items-center gap-1", className),
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function CodeBlockCopyButton({ value, className, onClick, ...props }) {
|
|
56
|
+
const [copied, setCopied] = useState(false);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (!copied) return;
|
|
59
|
+
const timeout = window.setTimeout(() => setCopied(false), 1600);
|
|
60
|
+
return () => window.clearTimeout(timeout);
|
|
61
|
+
}, [copied]);
|
|
62
|
+
return /* @__PURE__ */ jsx(Button$1, {
|
|
63
|
+
"data-slot": "code-block-copy-button",
|
|
64
|
+
"data-copied": copied || void 0,
|
|
65
|
+
variant: "ghost",
|
|
66
|
+
size: "icon-xs",
|
|
67
|
+
"aria-label": copied ? "Copied" : "Copy code",
|
|
68
|
+
className,
|
|
69
|
+
onClick: (event) => {
|
|
70
|
+
onClick?.(event);
|
|
71
|
+
navigator.clipboard?.writeText(value).then(() => setCopied(true)).catch(() => {
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
...props,
|
|
75
|
+
children: copied ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(Copy, {})
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function CodeBlockContent({ className, children, style, wrap = false, lineNumbers = false, startLine = 1, ...props }) {
|
|
79
|
+
return /* @__PURE__ */ jsx("pre", {
|
|
80
|
+
"data-slot": "code-block-content",
|
|
81
|
+
"data-wrap": wrap || void 0,
|
|
82
|
+
"data-numbered": lineNumbers || void 0,
|
|
83
|
+
dir: "ltr",
|
|
84
|
+
tabIndex: 0,
|
|
85
|
+
style: {
|
|
86
|
+
counterReset: `line ${startLine - 1}`,
|
|
87
|
+
...style
|
|
88
|
+
},
|
|
89
|
+
className: cn("min-h-0 min-w-0 overflow-auto px-3 py-3 text-start font-mono leading-relaxed outline-none data-wrap:break-words data-wrap:whitespace-pre-wrap", className),
|
|
90
|
+
...props,
|
|
91
|
+
children: /* @__PURE__ */ jsx("code", {
|
|
92
|
+
"data-slot": "code-block-code",
|
|
93
|
+
className: "grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0",
|
|
94
|
+
children: lineNumbers && typeof children === "string" ? children.replace(/\n$/, "").split("\n").map((line, index) => /* @__PURE__ */ jsx(CodeBlockLine, { children: line }, index)) : children
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
var codeBlockLineVariants = cva("relative -mx-3 block min-h-lh px-3 before:min-w-6 before:text-end before:text-muted-foreground after:absolute after:start-1 after:top-0 after:text-muted-foreground after:select-none in-data-numbered:col-span-2 in-data-numbered:grid in-data-numbered:grid-cols-subgrid in-data-numbered:gap-x-3 in-data-numbered:[counter-increment:line] in-data-numbered:before:content-[counter(line)] in-data-numbered:before:select-none", {
|
|
99
|
+
variants: { variant: {
|
|
100
|
+
default: "",
|
|
101
|
+
added: "bg-muted after:content-['+']",
|
|
102
|
+
removed: "bg-destructive/10 after:text-destructive after:content-['\u2212']",
|
|
103
|
+
highlighted: "bg-muted"
|
|
104
|
+
} },
|
|
105
|
+
defaultVariants: { variant: "default" }
|
|
106
|
+
});
|
|
107
|
+
function CodeBlockLine({ className, variant = "default", children, ...props }) {
|
|
108
|
+
const empty = children === void 0 || children === null || children === "" || Array.isArray(children) && children.length === 0;
|
|
109
|
+
return /* @__PURE__ */ jsx("span", {
|
|
110
|
+
"data-slot": "code-block-line",
|
|
111
|
+
"data-variant": variant,
|
|
112
|
+
className: cn(codeBlockLineVariants({ variant }), className),
|
|
113
|
+
...props,
|
|
114
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
115
|
+
"data-slot": "code-block-line-content",
|
|
116
|
+
className: "min-w-0",
|
|
117
|
+
children: empty ? "\n" : children
|
|
118
|
+
})
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export {
|
|
123
|
+
CodeBlock,
|
|
124
|
+
CodeBlockHeader,
|
|
125
|
+
CodeBlockTitle,
|
|
126
|
+
CodeBlockActions,
|
|
127
|
+
CodeBlockCopyButton,
|
|
128
|
+
CodeBlockContent
|
|
129
|
+
};
|