@elaraai/e3-ui-components 1.0.39 → 1.0.41

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/index.js CHANGED
@@ -27,11 +27,12 @@ import { workspaceStatus, datasetListAt, datasetList, dataflowExecuteLaunch, dat
27
27
  import { jsx as jsx$1, Fragment, jsxs } from "react/jsx-runtime";
28
28
  import * as React from "react";
29
29
  import React__default, { useId, useMemo, useContext, createContext, useRef, useEffect, useState, useCallback, useSyncExternalStore, memo, forwardRef, useLayoutEffect, Fragment as Fragment$1, Component } from "react";
30
- import { Box, Flex, Text, HStack, Input, useSlotRecipe, useRecipe, VStack, useToken, Drawer, Portal, Field, NativeSelect, Textarea, chakra, Tooltip, SegmentGroup, Menu, HoverCard, useChakraContext, Spinner, Code, Clipboard, IconButton, Badge, Button, Tabs, useTabs } from "@chakra-ui/react";
31
- import { implementUIComponent, getSomeorUndefined, formatPredicate, SliceEditPopover, SlicePredicateBuilder, EastChakraSelect, EastChakraStringInput, EastChakraDateTimeInput, EastChakraFloatInput, EastChakraIntegerInput, formatTick, useSliceReactivity, usePersistedState, SliceRailCluster, EastChakraComponent, ClauseChip, StateImpl, NavImpl, SliceImpl, SliceApplyImpl, OverlayImpl, ClipboardImpl, DownloadImpl, ShareImpl, createUIStore, UIStoreProvider } from "@elaraai/east-ui-components";
30
+ import { Box, Flex, Text, HStack, Input, useSlotRecipe, useRecipe, VStack, useToken, Drawer, Portal, Field, NativeSelect, Textarea, chakra, Tooltip, SegmentGroup, Menu, HoverCard, useChakraContext, Spinner, Code, Clipboard, IconButton, Button, Tabs, Badge, useTabs } from "@chakra-ui/react";
31
+ import { implementUIComponent, getSomeorUndefined, formatPredicate, SliceEditPopover, SlicePredicateBuilder, EastChakraSelect, EastChakraStringInput, EastChakraDateTimeInput, EastChakraFloatInput, EastChakraIntegerInput, formatTick, useSliceReactivity, useContainerBelow, usePersistedState, SliceRailCluster, EastChakraComponent, ClauseChip, StateImpl, NavImpl, SliceImpl, SliceApplyImpl, OverlayImpl, ClipboardImpl, DownloadImpl, ShareImpl, LoadingIcon, EastChakraValueTree, createUIStore, UIStoreProvider } from "@elaraai/east-ui-components";
32
32
  import { createPortal } from "react-dom";
33
33
  import { sliceMatches } from "@elaraai/east-ui/internal";
34
- import { QueryClient as QueryClient$1, QueryClientProvider, useMutation, useQuery } from "@tanstack/react-query";
34
+ import { QueryClient as QueryClient$1, QueryClientProvider, useMutation, useQuery, useQueryClient, keepPreviousData } from "@tanstack/react-query";
35
+ import { ValueTree } from "@elaraai/east-ui";
35
36
  import { useVirtualizer } from "@tanstack/react-virtual";
36
37
  var Subscribable = class {
37
38
  constructor() {
@@ -8921,7 +8922,7 @@ const ConflictRow = memo(function ConflictRow2({ row, depth, bindingPathStr, ser
8921
8922
  Box,
8922
8923
  {
8923
8924
  display: "grid",
8924
- gridTemplateColumns: supportsManual ? "1fr 1fr 1fr" : "1fr 1fr",
8925
+ gridTemplateColumns: "repeat(auto-fit, minmax(180px, 1fr))",
8925
8926
  gap: "8px",
8926
8927
  mt: "10px",
8927
8928
  p: "12px",
@@ -20509,8 +20510,8 @@ const NODE_ICONS = {
20509
20510
  const HANDLE_BASE = {
20510
20511
  width: 8,
20511
20512
  height: 8,
20512
- background: "#ffffff",
20513
- border: "1.4px solid #6b8080",
20513
+ background: "var(--chakra-colors-bg-surface)",
20514
+ border: "1.4px solid var(--chakra-colors-gray-500)",
20514
20515
  boxSizing: "border-box",
20515
20516
  zIndex: 5
20516
20517
  };
@@ -57002,6 +57003,18 @@ function useBindingOntology(binding) {
57002
57003
  }, [handle]);
57003
57004
  return { ontology, pending, mutate, commit, discard };
57004
57005
  }
57006
+ function useIsDarkMode() {
57007
+ const [dark, setDark] = useState(() => typeof document !== "undefined" && document.documentElement.classList.contains("dark"));
57008
+ useEffect(() => {
57009
+ const el = document.documentElement;
57010
+ const update2 = () => setDark(el.classList.contains("dark"));
57011
+ update2();
57012
+ const observer = new MutationObserver(update2);
57013
+ observer.observe(el, { attributes: true, attributeFilter: ["class"] });
57014
+ return () => observer.disconnect();
57015
+ }, []);
57016
+ return dark;
57017
+ }
57005
57018
  let nodeIdSeq = 0;
57006
57019
  function freshNodeId() {
57007
57020
  nodeIdSeq += 1;
@@ -57031,6 +57044,7 @@ function OntologyEditorBody({
57031
57044
  handlers
57032
57045
  }) {
57033
57046
  const [searchQuery, setSearchQuery] = useState("");
57047
+ const isDark = useIsDarkMode();
57034
57048
  const [focusedNodeId, setFocusedNodeId] = useState(null);
57035
57049
  const [selectedNodeId, setSelectedNodeId] = useState(null);
57036
57050
  const [paneMenu, setPaneMenu] = useState(null);
@@ -57221,9 +57235,10 @@ function OntologyEditorBody({
57221
57235
  nodesConnectable: !readonly,
57222
57236
  elementsSelectable: true,
57223
57237
  fitView: true,
57238
+ colorMode: isDark ? "dark" : "light",
57224
57239
  children: [
57225
- /* @__PURE__ */ jsx$1(Background, { id: "ont-minor", variant: BackgroundVariant.Lines, gap: 24, lineWidth: 1, color: "rgba(226, 232, 232, 0.35)" }),
57226
- /* @__PURE__ */ jsx$1(Background, { id: "ont-major", variant: BackgroundVariant.Lines, gap: 120, lineWidth: 1, color: "rgba(226, 232, 232, 0.8)" }),
57240
+ /* @__PURE__ */ jsx$1(Background, { id: "ont-minor", variant: BackgroundVariant.Lines, gap: 24, lineWidth: 1, color: "color-mix(in srgb, var(--chakra-colors-border-subtle) 35%, transparent)" }),
57241
+ /* @__PURE__ */ jsx$1(Background, { id: "ont-major", variant: BackgroundVariant.Lines, gap: 120, lineWidth: 1, color: "color-mix(in srgb, var(--chakra-colors-border-subtle) 80%, transparent)" }),
57227
57242
  /* @__PURE__ */ jsx$1(Controls, {}),
57228
57243
  !hideMiniMap && /* @__PURE__ */ jsx$1(MiniMap, { nodeColor: miniMapNodeColor, maskColor: "rgba(17, 27, 34, 0.10)" })
57229
57244
  ]
@@ -61110,7 +61125,7 @@ function LoadingSkeleton() {
61110
61125
  /* @__PURE__ */ jsx$1(Box, { flex: "1" }),
61111
61126
  line2("72px", "16px")
61112
61127
  ] }),
61113
- /* @__PURE__ */ jsxs(Box, { display: "grid", gridTemplateColumns: "304px minmax(0,1fr)", alignItems: "start", children: [
61128
+ /* @__PURE__ */ jsxs(Box, { display: "grid", gridTemplateColumns: "304px minmax(0,1fr)", css: { "@media (max-width: 640px)": { gridTemplateColumns: "1fr" } }, alignItems: "start", children: [
61114
61129
  /* @__PURE__ */ jsx$1(Box, { borderRightWidth: "1px", borderColor: "border.subtle", p: "4.5", display: "flex", flexDirection: "column", gap: "5", children: [0, 1, 2, 3].map((n2) => /* @__PURE__ */ jsxs(Box, { display: "flex", flexDirection: "column", gap: "2", children: [
61115
61130
  line2("150px", "12px"),
61116
61131
  block("40px")
@@ -61374,7 +61389,7 @@ const EastChakraExperiment = memo(function EastChakraExperiment2({ value }) {
61374
61389
  canRun && /* @__PURE__ */ jsx$1(ActionButton, { button, variant: "solid", label: "Run", onClick: onRun, disabled: runDisabled, pulse: stale }),
61375
61390
  canCommit && /* @__PURE__ */ jsx$1(ActionButton, { button, variant: "ghost", label: "Commit", onClick: onCommit, disabled: commitDisabled })
61376
61391
  ] }),
61377
- /* @__PURE__ */ jsxs(Box, { display: "grid", gridTemplateColumns: "304px minmax(0,1fr)", alignItems: "start", children: [
61392
+ /* @__PURE__ */ jsxs(Box, { display: "grid", gridTemplateColumns: "304px minmax(0,1fr)", css: { "@media (max-width: 640px)": { gridTemplateColumns: "1fr" } }, alignItems: "start", children: [
61378
61393
  /* @__PURE__ */ jsxs(Box, { borderRightWidth: "1px", borderColor: "border.subtle", children: [
61379
61394
  /* @__PURE__ */ jsxs(Step, { n: 1, title: "What did you change?", help: "step_treatment", children: [
61380
61395
  /* @__PURE__ */ jsx$1(ColumnPick, { column: vs.treatment, kind: vs.treatmentKind, badge, button, readonly, choices: columns.filter((c2) => c2.kind === "boolean" || c2.kind === "integer").map((c2) => c2.name), onPick: (c2) => editConfig({ ...config2, treatment: c2 }) }),
@@ -62559,7 +62574,7 @@ function LeverEditor({ leverCase, payload, onInject }) {
62559
62574
  )
62560
62575
  ] }, `${k2}.${field}`));
62561
62576
  }
62562
- return /* @__PURE__ */ jsx$1(Box, { width: "180px", flexShrink: 0, children: primitiveInput(active, `${k2}.value`, () => valRef.current, (v3) => {
62577
+ return /* @__PURE__ */ jsx$1(Box, { width: "min(180px, 100%)", flexShrink: 0, children: primitiveInput(active, `${k2}.value`, () => valRef.current, (v3) => {
62563
62578
  valRef.current = v3;
62564
62579
  }) }, `${k2}.wrap`);
62565
62580
  }, [active, opTag, leverCase]);
@@ -62790,7 +62805,7 @@ const JudgementFacet = memo(function JudgementFacet2({ decision, handle, leverPa
62790
62805
  var _a3;
62791
62806
  const current = (_a3 = judgement.answers.get(prompt.id)) == null ? void 0 : _a3.type;
62792
62807
  return /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", gap: "12px", flexWrap: "wrap", children: [
62793
- /* @__PURE__ */ jsx$1(Text, { fontSize: "13px", fontWeight: "medium", flex: "1", minW: "180px", children: prompt.text }),
62808
+ /* @__PURE__ */ jsx$1(Text, { fontSize: "13px", fontWeight: "medium", flex: "1", minW: "min(180px, 100%)", children: prompt.text }),
62794
62809
  /* @__PURE__ */ jsx$1(Box, { display: "flex", gap: "6px", flexShrink: 0, children: ANSWERS.map((a2) => /* @__PURE__ */ jsx$1(
62795
62810
  chakra.button,
62796
62811
  {
@@ -62848,7 +62863,7 @@ const JudgementFacet = memo(function JudgementFacet2({ decision, handle, leverPa
62848
62863
  }
62849
62864
  }
62850
62865
  ) }) : /* @__PURE__ */ jsx$1(Text, { ...caption, color: "fg", flexShrink: 0, children: activeLever.label }),
62851
- /* @__PURE__ */ jsx$1(Box, { flex: "1", minW: "260px", children: /* @__PURE__ */ jsx$1(
62866
+ /* @__PURE__ */ jsx$1(Box, { flex: "1", minW: "min(260px, 100%)", children: /* @__PURE__ */ jsx$1(
62852
62867
  LeverEditor,
62853
62868
  {
62854
62869
  leverCase: activeLever.case,
@@ -63157,18 +63172,7 @@ const EastChakraDecisionQueue = memo(function EastChakraDecisionQueue2({ value,
63157
63172
  useSliceReactivity(sliceHandle == null ? void 0 : sliceHandle.key);
63158
63173
  const sliceState = sliceHandle !== null ? sliceHandle.read() : null;
63159
63174
  const rootRef = useRef(null);
63160
- const [narrow, setNarrow] = useState(false);
63161
- useLayoutEffect(() => {
63162
- const el = rootRef.current;
63163
- if (!el || typeof ResizeObserver === "undefined") return;
63164
- const ro = new ResizeObserver((entries) => {
63165
- var _a3;
63166
- const width2 = ((_a3 = entries[0]) == null ? void 0 : _a3.contentRect.width) ?? 0;
63167
- setNarrow(width2 > 0 && width2 < NARROW_PX);
63168
- });
63169
- ro.observe(el);
63170
- return () => ro.disconnect();
63171
- }, []);
63175
+ const narrow = useContainerBelow(rootRef, NARROW_PX);
63172
63176
  const [exiting, setExiting] = useState(/* @__PURE__ */ new Map());
63173
63177
  const prevRef = useRef(null);
63174
63178
  const reasonsRef = useRef(/* @__PURE__ */ new Map());
@@ -63853,33 +63857,35 @@ function getTaskMetadata(details) {
63853
63857
  return ((_a2 = details.metadata) == null ? void 0 : _a2.type) === "some" ? details.metadata.value : null;
63854
63858
  }
63855
63859
  const variantStyles = {
63860
+ // Mode-aware semantic tokens (the raw `red.50` / `gray.50` washes rendered
63861
+ // as bright light boxes in dark mode — #362).
63856
63862
  error: {
63857
- bg: "red.50",
63858
- titleColor: "red.600",
63859
- messageColor: "red.500",
63860
- detailsBg: "red.100",
63861
- detailsColor: "red.800"
63863
+ bg: "bg.danger.subtle",
63864
+ titleColor: "fg.danger",
63865
+ messageColor: "fg.muted",
63866
+ detailsBg: "bg.muted",
63867
+ detailsColor: "fg.default"
63862
63868
  },
63863
63869
  warning: {
63864
- bg: "yellow.50",
63865
- titleColor: "yellow.700",
63866
- messageColor: "yellow.600",
63867
- detailsBg: "yellow.100",
63868
- detailsColor: "yellow.800"
63870
+ bg: "bg.warning.subtle",
63871
+ titleColor: "fg.warning",
63872
+ messageColor: "fg.muted",
63873
+ detailsBg: "bg.muted",
63874
+ detailsColor: "fg.default"
63869
63875
  },
63870
63876
  info: {
63871
- bg: "gray.50",
63872
- titleColor: "gray.500",
63873
- messageColor: "gray.400",
63874
- detailsBg: "gray.100",
63875
- detailsColor: "gray.700"
63877
+ bg: "transparent",
63878
+ titleColor: "fg.muted",
63879
+ messageColor: "fg.subtle",
63880
+ detailsBg: "bg.muted",
63881
+ detailsColor: "fg.default"
63876
63882
  },
63877
63883
  loading: {
63878
- bg: "gray.50",
63879
- titleColor: "gray.500",
63880
- messageColor: "gray.400",
63881
- detailsBg: "gray.100",
63882
- detailsColor: "gray.700"
63884
+ bg: "transparent",
63885
+ titleColor: "fg.muted",
63886
+ messageColor: "fg.subtle",
63887
+ detailsBg: "bg.muted",
63888
+ detailsColor: "fg.default"
63883
63889
  }
63884
63890
  };
63885
63891
  function StatusDisplay({ variant: variant2, title, message, details }) {
@@ -63896,7 +63902,7 @@ function StatusDisplay({ variant: variant2, title, message, details }) {
63896
63902
  justifyContent: "center",
63897
63903
  bg: styles2.bg,
63898
63904
  children: /* @__PURE__ */ jsxs(VStack, { gap: 2, children: [
63899
- variant2 === "loading" && /* @__PURE__ */ jsx$1(Spinner, { size: "md" }),
63905
+ variant2 === "loading" && /* @__PURE__ */ jsx$1(LoadingIcon, { animate: true, size: "52px" }),
63900
63906
  /* @__PURE__ */ jsx$1(Text, { color: styles2.titleColor, fontSize: variant2 === "loading" ? "sm" : "lg", children: title }),
63901
63907
  message && /* @__PURE__ */ jsx$1(Text, { color: styles2.messageColor, fontSize: "sm", children: message }),
63902
63908
  details && /* @__PURE__ */ jsxs(Box, { position: "relative", mt: 2, width: "100%", children: [
@@ -63976,335 +63982,6 @@ class ErrorBoundary extends Component {
63976
63982
  return this.props.children;
63977
63983
  }
63978
63984
  }
63979
- function formatPrimitive(type, value) {
63980
- switch (type.type) {
63981
- case "Null":
63982
- return "null";
63983
- case "Boolean":
63984
- return value ? "true" : "false";
63985
- case "Integer":
63986
- return String(value);
63987
- case "Float": {
63988
- const num2 = value;
63989
- if (Number.isNaN(num2)) return "NaN";
63990
- if (!Number.isFinite(num2)) return num2 > 0 ? "Infinity" : "-Infinity";
63991
- return String(num2);
63992
- }
63993
- case "String":
63994
- return `"${value}"`;
63995
- case "DateTime":
63996
- return value.toISOString();
63997
- case "Blob":
63998
- return `Blob[${value.length} bytes]`;
63999
- default:
64000
- return String(value);
64001
- }
64002
- }
64003
- function isPrimitive(type) {
64004
- return ["Null", "Boolean", "Integer", "Float", "String", "DateTime", "Blob", "Never"].includes(type.type);
64005
- }
64006
- function getTypeLabel(type, value) {
64007
- switch (type.type) {
64008
- case "Array":
64009
- return `Array[${value.length}]`;
64010
- case "Set":
64011
- return `Set[${value.size}]`;
64012
- case "Dict":
64013
- return `Dict[${value.size}]`;
64014
- case "Struct":
64015
- return "Struct";
64016
- case "Variant":
64017
- return `Variant.${value.type}`;
64018
- case "Ref":
64019
- return "Ref";
64020
- default:
64021
- return type.type;
64022
- }
64023
- }
64024
- function ValueNode({
64025
- type,
64026
- value,
64027
- label,
64028
- depth
64029
- }) {
64030
- if (depth > 20) {
64031
- return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64032
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64033
- label,
64034
- ":"
64035
- ] }),
64036
- /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "[max depth reached]" })
64037
- ] });
64038
- }
64039
- if (isPrimitive(type)) {
64040
- return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64041
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64042
- label,
64043
- ":"
64044
- ] }),
64045
- /* @__PURE__ */ jsx$1(Text, { as: "span", color: type.type === "String" ? "green.400" : type.type === "Integer" || type.type === "Float" ? "blue.400" : "gray.300", children: formatPrimitive(type, value) }),
64046
- /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "gray", variant: "subtle", children: type.type })
64047
- ] });
64048
- }
64049
- const typeLabel = getTypeLabel(type, value);
64050
- if (type.type === "Array") {
64051
- const items = value;
64052
- const elementType = type.value;
64053
- if (items.length === 0) {
64054
- return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64055
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64056
- label,
64057
- ":"
64058
- ] }),
64059
- /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "[]" }),
64060
- /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "blue", variant: "subtle", children: "Array[0]" })
64061
- ] });
64062
- }
64063
- return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64064
- /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64065
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64066
- label,
64067
- ":"
64068
- ] }),
64069
- /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "blue", variant: "subtle", children: typeLabel })
64070
- ] }),
64071
- /* @__PURE__ */ jsx$1(Box, { pl: 4, children: items.map((item, index2) => /* @__PURE__ */ jsx$1(
64072
- Box,
64073
- {
64074
- py: 1,
64075
- borderBottom: index2 < items.length - 1 ? "1px solid" : void 0,
64076
- borderColor: "gray.700",
64077
- children: /* @__PURE__ */ jsx$1(
64078
- ValueNode,
64079
- {
64080
- type: elementType,
64081
- value: item,
64082
- label: `[${index2}]`,
64083
- depth: depth + 1
64084
- }
64085
- )
64086
- },
64087
- index2
64088
- )) })
64089
- ] }) });
64090
- }
64091
- if (type.type === "Struct") {
64092
- const fields = type.value;
64093
- const obj = value;
64094
- if (fields.length === 0) {
64095
- return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64096
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64097
- label,
64098
- ":"
64099
- ] }),
64100
- /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "{}" }),
64101
- /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "orange", variant: "subtle", children: "Struct" })
64102
- ] });
64103
- }
64104
- return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64105
- /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64106
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64107
- label,
64108
- ":"
64109
- ] }),
64110
- /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "orange", variant: "subtle", children: typeLabel })
64111
- ] }),
64112
- /* @__PURE__ */ jsx$1(Box, { pl: 4, children: fields.map((field) => /* @__PURE__ */ jsx$1(
64113
- ValueNode,
64114
- {
64115
- type: field.type,
64116
- value: obj[field.name],
64117
- label: field.name,
64118
- depth: depth + 1
64119
- },
64120
- field.name
64121
- )) })
64122
- ] }) });
64123
- }
64124
- if (type.type === "Variant") {
64125
- const cases = type.value;
64126
- const variant2 = value;
64127
- const activeCase = cases.find((c2) => c2.name === variant2.type);
64128
- if (!activeCase) {
64129
- return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64130
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64131
- label,
64132
- ":"
64133
- ] }),
64134
- /* @__PURE__ */ jsxs(Text, { as: "span", color: "red.400", children: [
64135
- "Unknown variant: ",
64136
- variant2.type
64137
- ] })
64138
- ] });
64139
- }
64140
- if (activeCase.type.type === "Null") {
64141
- return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64142
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64143
- label,
64144
- ":"
64145
- ] }),
64146
- /* @__PURE__ */ jsxs(Badge, { size: "xs", colorPalette: "purple", variant: "subtle", children: [
64147
- ".",
64148
- variant2.type
64149
- ] })
64150
- ] });
64151
- }
64152
- return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64153
- /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64154
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64155
- label,
64156
- ":"
64157
- ] }),
64158
- /* @__PURE__ */ jsxs(Badge, { size: "xs", colorPalette: "purple", variant: "subtle", children: [
64159
- ".",
64160
- variant2.type
64161
- ] })
64162
- ] }),
64163
- /* @__PURE__ */ jsx$1(Box, { pl: 4, children: /* @__PURE__ */ jsx$1(
64164
- ValueNode,
64165
- {
64166
- type: activeCase.type,
64167
- value: variant2.value,
64168
- depth: depth + 1
64169
- }
64170
- ) })
64171
- ] }) });
64172
- }
64173
- if (type.type === "Dict") {
64174
- const map3 = value;
64175
- const keyType = type.value.key;
64176
- const valueType = type.value.value;
64177
- if (map3.size === 0) {
64178
- return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64179
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64180
- label,
64181
- ":"
64182
- ] }),
64183
- /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "Map{}" }),
64184
- /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "teal", variant: "subtle", children: "Dict[0]" })
64185
- ] });
64186
- }
64187
- const entries = Array.from(map3.entries());
64188
- return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64189
- /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64190
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64191
- label,
64192
- ":"
64193
- ] }),
64194
- /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "teal", variant: "subtle", children: typeLabel })
64195
- ] }),
64196
- /* @__PURE__ */ jsx$1(Box, { pl: 4, children: entries.map(([k2, v3], i) => /* @__PURE__ */ jsxs(
64197
- Box,
64198
- {
64199
- py: 2,
64200
- borderBottom: i < entries.length - 1 ? "1px solid" : void 0,
64201
- borderColor: "gray.700",
64202
- children: [
64203
- /* @__PURE__ */ jsx$1(ValueNode, { type: keyType, value: k2, depth: depth + 1 }),
64204
- /* @__PURE__ */ jsx$1(ValueNode, { type: valueType, value: v3, depth: depth + 1 })
64205
- ]
64206
- },
64207
- i
64208
- )) })
64209
- ] }) });
64210
- }
64211
- if (type.type === "Set") {
64212
- const set3 = value;
64213
- const elementType = type.value;
64214
- if (set3.size === 0) {
64215
- return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64216
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64217
- label,
64218
- ":"
64219
- ] }),
64220
- /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "Set{}" }),
64221
- /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "pink", variant: "subtle", children: "Set[0]" })
64222
- ] });
64223
- }
64224
- const items = Array.from(set3);
64225
- return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64226
- /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64227
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64228
- label,
64229
- ":"
64230
- ] }),
64231
- /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "pink", variant: "subtle", children: typeLabel })
64232
- ] }),
64233
- /* @__PURE__ */ jsx$1(Box, { pl: 4, children: items.map((item, i) => /* @__PURE__ */ jsx$1(
64234
- Box,
64235
- {
64236
- py: 1,
64237
- borderBottom: i < items.length - 1 ? "1px solid" : void 0,
64238
- borderColor: "gray.700",
64239
- children: /* @__PURE__ */ jsx$1(
64240
- ValueNode,
64241
- {
64242
- type: elementType,
64243
- value: item,
64244
- depth: depth + 1
64245
- }
64246
- )
64247
- },
64248
- i
64249
- )) })
64250
- ] }) });
64251
- }
64252
- if (type.type === "Ref") {
64253
- const ref = value;
64254
- return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64255
- /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64256
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64257
- label,
64258
- ":"
64259
- ] }),
64260
- /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "red", variant: "subtle", children: "Ref" })
64261
- ] }),
64262
- /* @__PURE__ */ jsx$1(Box, { pl: 4, children: /* @__PURE__ */ jsx$1(
64263
- ValueNode,
64264
- {
64265
- type: type.value,
64266
- value: ref.value,
64267
- depth: depth + 1
64268
- }
64269
- ) })
64270
- ] }) });
64271
- }
64272
- if (type.type === "Function" || type.type === "AsyncFunction") {
64273
- return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64274
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64275
- label,
64276
- ":"
64277
- ] }),
64278
- /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "[function]" }),
64279
- /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "gray", variant: "subtle", children: type.type })
64280
- ] });
64281
- }
64282
- return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64283
- label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64284
- label,
64285
- ":"
64286
- ] }),
64287
- /* @__PURE__ */ jsxs(Text, { as: "span", color: "gray.500", children: [
64288
- "[",
64289
- type.type,
64290
- "]"
64291
- ] })
64292
- ] });
64293
- }
64294
- function EastValueViewer({ type, value }) {
64295
- return /* @__PURE__ */ jsx$1(
64296
- Box,
64297
- {
64298
- layerStyle: "surface.code.dark",
64299
- fontFamily: "mono",
64300
- fontSize: "sm",
64301
- p: 4,
64302
- overflow: "auto",
64303
- maxHeight: "100%",
64304
- children: /* @__PURE__ */ jsx$1(ValueNode, { type, value, depth: 0 })
64305
- }
64306
- );
64307
- }
64308
63985
  const DEFAULT_SIZE_LIMIT = 200 * 1024;
64309
63986
  function formatSize(bytes) {
64310
63987
  if (bytes < 1024) return `${bytes} B`;
@@ -64333,8 +64010,10 @@ const DatasetPreview = memo(function DatasetPreview2({
64333
64010
  path: path2,
64334
64011
  requestOptions,
64335
64012
  sizeLimit = DEFAULT_SIZE_LIMIT,
64336
- pollInterval
64013
+ pollInterval,
64014
+ editable = false
64337
64015
  }) {
64016
+ var _a2;
64338
64017
  const statusQuery = useDatasetStatus(apiUrl, repo, workspace, path2, {
64339
64018
  ...requestOptions != null && { requestOptions },
64340
64019
  ...pollInterval !== void 0 && { pollInterval }
@@ -64348,9 +64027,35 @@ const DatasetPreview = memo(function DatasetPreview2({
64348
64027
  ...requestOptions != null && { requestOptions },
64349
64028
  type: status == null ? void 0 : status.type,
64350
64029
  hash: (status == null ? void 0 : status.hash) ?? null,
64351
- enabled: shouldFetch
64030
+ enabled: shouldFetch,
64031
+ // An edit changes the value's content hash → a new query key. Keep the
64032
+ // current value on screen while the new one loads so an edit doesn't
64033
+ // flash the loading state (only the FIRST load has no previous value).
64034
+ queryOverrides: { placeholderData: keepPreviousData }
64352
64035
  });
64353
64036
  const download = useDatasetDownload(apiUrl, repo, workspace, path2, requestOptions);
64037
+ const setMutation = useDatasetSet(apiUrl, repo, workspace, requestOptions);
64038
+ const queryClient = useQueryClient();
64039
+ const type = status == null ? void 0 : status.type;
64040
+ const decoded = (_a2 = valueQuery.data) == null ? void 0 : _a2.decoded;
64041
+ const write = useCallback(async (next2) => {
64042
+ if (workspace == null || path2 == null || type === void 0) return;
64043
+ const treePath = path2.split(".").filter(Boolean).map((p2) => variant("field", p2));
64044
+ const data4 = encodeBeast2For(type)(next2);
64045
+ await setMutation.mutateAsync({ path: treePath, data: data4 });
64046
+ await queryClient.invalidateQueries({ queryKey: ["datasetStatus", apiUrl, repo, workspace, path2] });
64047
+ }, [apiUrl, repo, workspace, path2, type, setMutation, queryClient]);
64048
+ const treeValue = useMemo(() => {
64049
+ if (type === void 0 || decoded === void 0) return null;
64050
+ const root2 = ValueTree.materialize(type, decoded);
64051
+ const wire = editable ? {
64052
+ onEdit: some((p2, leaf) => write(ValueTree.applyEdit(type, decoded, p2, { kind: "edit", leaf }))),
64053
+ onInsert: some((p2) => write(ValueTree.applyEdit(type, decoded, p2, { kind: "insert" }))),
64054
+ onRemove: some((p2) => write(ValueTree.applyEdit(type, decoded, p2, { kind: "remove" }))),
64055
+ onTag: some((p2, tag) => write(ValueTree.applyEdit(type, decoded, p2, { kind: "tag", tag })))
64056
+ } : { onEdit: none$1, onInsert: none$1, onRemove: none$1, onTag: none$1 };
64057
+ return { root: root2, ...wire, style: some({ height: some("100%"), maxHeight: none$1 }) };
64058
+ }, [type, decoded, editable, write]);
64354
64059
  if (statusQuery.isLoading) return /* @__PURE__ */ jsx$1(StatusDisplay, { variant: "loading", title: "Loading..." });
64355
64060
  if (statusQuery.error) {
64356
64061
  const { message, details } = formatApiError(statusQuery.error);
@@ -64378,7 +64083,7 @@ const DatasetPreview = memo(function DatasetPreview2({
64378
64083
  /* @__PURE__ */ jsx$1(Text, { fontSize: "xs", color: "fg.muted", mr: 2, alignSelf: "center", children: formatSize(sizeBytes) }),
64379
64084
  /* @__PURE__ */ jsx$1(DownloadButton, { onClick: download })
64380
64085
  ] }),
64381
- /* @__PURE__ */ jsx$1(Box, { flex: 1, overflow: "auto", p: "4", minHeight: 0, children: /* @__PURE__ */ jsx$1(EastValueViewer, { type: status.type, value: valueQuery.data.decoded }) })
64086
+ /* @__PURE__ */ jsx$1(Box, { flex: 1, minHeight: 0, overflow: "hidden", children: treeValue !== null && /* @__PURE__ */ jsx$1(EastChakraValueTree, { value: treeValue, storageKey: path2 ?? "value" }) })
64382
64087
  ] });
64383
64088
  });
64384
64089
  const InputPreview = memo(function InputPreview2({
@@ -64398,6 +64103,7 @@ const InputPreview = memo(function InputPreview2({
64398
64103
  repo,
64399
64104
  workspace,
64400
64105
  path: path2,
64106
+ editable: true,
64401
64107
  ...requestOptions != null && { requestOptions }
64402
64108
  }
64403
64109
  ) })
@@ -64697,7 +64403,7 @@ function VirtualizedLogViewer({ content, tabs }) {
64697
64403
  border: "none",
64698
64404
  color: "white",
64699
64405
  _placeholder: { color: "gray.400" },
64700
- width: "150px"
64406
+ width: "min(150px, 40vw)"
64701
64407
  }
64702
64408
  ),
64703
64409
  searchQuery && /* @__PURE__ */ jsx$1(Text, { fontSize: "xs", color: "gray.400", minWidth: "50px", textAlign: "center", children: matches33.length > 0 ? `${currentMatchIndex + 1}/${matches33.length}` : "0/0" }),
@@ -65028,6 +64734,335 @@ const TaskPreview = memo(function TaskPreview2({
65028
64734
  ) })
65029
64735
  ] });
65030
64736
  }, (prev2, next2) => prev2.task === next2.task && prev2.repo === next2.repo && prev2.workspace === next2.workspace);
64737
+ function formatPrimitive(type, value) {
64738
+ switch (type.type) {
64739
+ case "Null":
64740
+ return "null";
64741
+ case "Boolean":
64742
+ return value ? "true" : "false";
64743
+ case "Integer":
64744
+ return String(value);
64745
+ case "Float": {
64746
+ const num2 = value;
64747
+ if (Number.isNaN(num2)) return "NaN";
64748
+ if (!Number.isFinite(num2)) return num2 > 0 ? "Infinity" : "-Infinity";
64749
+ return String(num2);
64750
+ }
64751
+ case "String":
64752
+ return `"${value}"`;
64753
+ case "DateTime":
64754
+ return value.toISOString();
64755
+ case "Blob":
64756
+ return `Blob[${value.length} bytes]`;
64757
+ default:
64758
+ return String(value);
64759
+ }
64760
+ }
64761
+ function isPrimitive(type) {
64762
+ return ["Null", "Boolean", "Integer", "Float", "String", "DateTime", "Blob", "Never"].includes(type.type);
64763
+ }
64764
+ function getTypeLabel(type, value) {
64765
+ switch (type.type) {
64766
+ case "Array":
64767
+ return `Array[${value.length}]`;
64768
+ case "Set":
64769
+ return `Set[${value.size}]`;
64770
+ case "Dict":
64771
+ return `Dict[${value.size}]`;
64772
+ case "Struct":
64773
+ return "Struct";
64774
+ case "Variant":
64775
+ return `Variant.${value.type}`;
64776
+ case "Ref":
64777
+ return "Ref";
64778
+ default:
64779
+ return type.type;
64780
+ }
64781
+ }
64782
+ function ValueNode({
64783
+ type,
64784
+ value,
64785
+ label,
64786
+ depth
64787
+ }) {
64788
+ if (depth > 20) {
64789
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64790
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64791
+ label,
64792
+ ":"
64793
+ ] }),
64794
+ /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "[max depth reached]" })
64795
+ ] });
64796
+ }
64797
+ if (isPrimitive(type)) {
64798
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64799
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64800
+ label,
64801
+ ":"
64802
+ ] }),
64803
+ /* @__PURE__ */ jsx$1(Text, { as: "span", color: type.type === "String" ? "green.400" : type.type === "Integer" || type.type === "Float" ? "blue.400" : "gray.300", children: formatPrimitive(type, value) }),
64804
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "gray", variant: "subtle", children: type.type })
64805
+ ] });
64806
+ }
64807
+ const typeLabel = getTypeLabel(type, value);
64808
+ if (type.type === "Array") {
64809
+ const items = value;
64810
+ const elementType = type.value;
64811
+ if (items.length === 0) {
64812
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64813
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64814
+ label,
64815
+ ":"
64816
+ ] }),
64817
+ /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "[]" }),
64818
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "blue", variant: "subtle", children: "Array[0]" })
64819
+ ] });
64820
+ }
64821
+ return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64822
+ /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64823
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64824
+ label,
64825
+ ":"
64826
+ ] }),
64827
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "blue", variant: "subtle", children: typeLabel })
64828
+ ] }),
64829
+ /* @__PURE__ */ jsx$1(Box, { pl: 4, children: items.map((item, index2) => /* @__PURE__ */ jsx$1(
64830
+ Box,
64831
+ {
64832
+ py: 1,
64833
+ borderBottom: index2 < items.length - 1 ? "1px solid" : void 0,
64834
+ borderColor: "gray.700",
64835
+ children: /* @__PURE__ */ jsx$1(
64836
+ ValueNode,
64837
+ {
64838
+ type: elementType,
64839
+ value: item,
64840
+ label: `[${index2}]`,
64841
+ depth: depth + 1
64842
+ }
64843
+ )
64844
+ },
64845
+ index2
64846
+ )) })
64847
+ ] }) });
64848
+ }
64849
+ if (type.type === "Struct") {
64850
+ const fields = type.value;
64851
+ const obj = value;
64852
+ if (fields.length === 0) {
64853
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64854
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64855
+ label,
64856
+ ":"
64857
+ ] }),
64858
+ /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "{}" }),
64859
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "orange", variant: "subtle", children: "Struct" })
64860
+ ] });
64861
+ }
64862
+ return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64863
+ /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64864
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64865
+ label,
64866
+ ":"
64867
+ ] }),
64868
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "orange", variant: "subtle", children: typeLabel })
64869
+ ] }),
64870
+ /* @__PURE__ */ jsx$1(Box, { pl: 4, children: fields.map((field) => /* @__PURE__ */ jsx$1(
64871
+ ValueNode,
64872
+ {
64873
+ type: field.type,
64874
+ value: obj[field.name],
64875
+ label: field.name,
64876
+ depth: depth + 1
64877
+ },
64878
+ field.name
64879
+ )) })
64880
+ ] }) });
64881
+ }
64882
+ if (type.type === "Variant") {
64883
+ const cases = type.value;
64884
+ const variant2 = value;
64885
+ const activeCase = cases.find((c2) => c2.name === variant2.type);
64886
+ if (!activeCase) {
64887
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64888
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64889
+ label,
64890
+ ":"
64891
+ ] }),
64892
+ /* @__PURE__ */ jsxs(Text, { as: "span", color: "red.400", children: [
64893
+ "Unknown variant: ",
64894
+ variant2.type
64895
+ ] })
64896
+ ] });
64897
+ }
64898
+ if (activeCase.type.type === "Null") {
64899
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64900
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64901
+ label,
64902
+ ":"
64903
+ ] }),
64904
+ /* @__PURE__ */ jsxs(Badge, { size: "xs", colorPalette: "purple", variant: "subtle", children: [
64905
+ ".",
64906
+ variant2.type
64907
+ ] })
64908
+ ] });
64909
+ }
64910
+ return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64911
+ /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64912
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64913
+ label,
64914
+ ":"
64915
+ ] }),
64916
+ /* @__PURE__ */ jsxs(Badge, { size: "xs", colorPalette: "purple", variant: "subtle", children: [
64917
+ ".",
64918
+ variant2.type
64919
+ ] })
64920
+ ] }),
64921
+ /* @__PURE__ */ jsx$1(Box, { pl: 4, children: /* @__PURE__ */ jsx$1(
64922
+ ValueNode,
64923
+ {
64924
+ type: activeCase.type,
64925
+ value: variant2.value,
64926
+ depth: depth + 1
64927
+ }
64928
+ ) })
64929
+ ] }) });
64930
+ }
64931
+ if (type.type === "Dict") {
64932
+ const map3 = value;
64933
+ const keyType = type.value.key;
64934
+ const valueType = type.value.value;
64935
+ if (map3.size === 0) {
64936
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64937
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64938
+ label,
64939
+ ":"
64940
+ ] }),
64941
+ /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "Map{}" }),
64942
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "teal", variant: "subtle", children: "Dict[0]" })
64943
+ ] });
64944
+ }
64945
+ const entries = Array.from(map3.entries());
64946
+ return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64947
+ /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64948
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64949
+ label,
64950
+ ":"
64951
+ ] }),
64952
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "teal", variant: "subtle", children: typeLabel })
64953
+ ] }),
64954
+ /* @__PURE__ */ jsx$1(Box, { pl: 4, children: entries.map(([k2, v3], i) => /* @__PURE__ */ jsxs(
64955
+ Box,
64956
+ {
64957
+ py: 2,
64958
+ borderBottom: i < entries.length - 1 ? "1px solid" : void 0,
64959
+ borderColor: "gray.700",
64960
+ children: [
64961
+ /* @__PURE__ */ jsx$1(ValueNode, { type: keyType, value: k2, depth: depth + 1 }),
64962
+ /* @__PURE__ */ jsx$1(ValueNode, { type: valueType, value: v3, depth: depth + 1 })
64963
+ ]
64964
+ },
64965
+ i
64966
+ )) })
64967
+ ] }) });
64968
+ }
64969
+ if (type.type === "Set") {
64970
+ const set3 = value;
64971
+ const elementType = type.value;
64972
+ if (set3.size === 0) {
64973
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64974
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64975
+ label,
64976
+ ":"
64977
+ ] }),
64978
+ /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "Set{}" }),
64979
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "pink", variant: "subtle", children: "Set[0]" })
64980
+ ] });
64981
+ }
64982
+ const items = Array.from(set3);
64983
+ return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64984
+ /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64985
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64986
+ label,
64987
+ ":"
64988
+ ] }),
64989
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "pink", variant: "subtle", children: typeLabel })
64990
+ ] }),
64991
+ /* @__PURE__ */ jsx$1(Box, { pl: 4, children: items.map((item, i) => /* @__PURE__ */ jsx$1(
64992
+ Box,
64993
+ {
64994
+ py: 1,
64995
+ borderBottom: i < items.length - 1 ? "1px solid" : void 0,
64996
+ borderColor: "gray.700",
64997
+ children: /* @__PURE__ */ jsx$1(
64998
+ ValueNode,
64999
+ {
65000
+ type: elementType,
65001
+ value: item,
65002
+ depth: depth + 1
65003
+ }
65004
+ )
65005
+ },
65006
+ i
65007
+ )) })
65008
+ ] }) });
65009
+ }
65010
+ if (type.type === "Ref") {
65011
+ const ref = value;
65012
+ return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
65013
+ /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
65014
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
65015
+ label,
65016
+ ":"
65017
+ ] }),
65018
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "red", variant: "subtle", children: "Ref" })
65019
+ ] }),
65020
+ /* @__PURE__ */ jsx$1(Box, { pl: 4, children: /* @__PURE__ */ jsx$1(
65021
+ ValueNode,
65022
+ {
65023
+ type: type.value,
65024
+ value: ref.value,
65025
+ depth: depth + 1
65026
+ }
65027
+ ) })
65028
+ ] }) });
65029
+ }
65030
+ if (type.type === "Function" || type.type === "AsyncFunction") {
65031
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
65032
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
65033
+ label,
65034
+ ":"
65035
+ ] }),
65036
+ /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "[function]" }),
65037
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "gray", variant: "subtle", children: type.type })
65038
+ ] });
65039
+ }
65040
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
65041
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
65042
+ label,
65043
+ ":"
65044
+ ] }),
65045
+ /* @__PURE__ */ jsxs(Text, { as: "span", color: "gray.500", children: [
65046
+ "[",
65047
+ type.type,
65048
+ "]"
65049
+ ] })
65050
+ ] });
65051
+ }
65052
+ function EastValueViewer({ type, value }) {
65053
+ return /* @__PURE__ */ jsx$1(
65054
+ Box,
65055
+ {
65056
+ layerStyle: "surface.code.dark",
65057
+ fontFamily: "mono",
65058
+ fontSize: "sm",
65059
+ p: 4,
65060
+ overflow: "auto",
65061
+ maxHeight: "100%",
65062
+ children: /* @__PURE__ */ jsx$1(ValueNode, { type, value, depth: 0 })
65063
+ }
65064
+ );
65065
+ }
65031
65066
  export {
65032
65067
  BindPlatform,
65033
65068
  BindRuntime,