@elaraai/e3-ui-components 1.0.40 → 1.0.42

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
  ) })
@@ -64409,7 +64115,8 @@ function treePathToString$1(path2) {
64409
64115
  const UITaskPreview = memo(function UITaskPreview2({
64410
64116
  task,
64411
64117
  config: config2,
64412
- pollInterval = 1e3
64118
+ pollInterval = 1e3,
64119
+ bare = false
64413
64120
  }) {
64414
64121
  var _a2, _b2;
64415
64122
  const e3 = useE3ConfigOptional();
@@ -64485,7 +64192,7 @@ const UITaskPreview = memo(function UITaskPreview2({
64485
64192
  if (statusQuery.data.refType !== "value") return /* @__PURE__ */ jsx$1(StatusDisplay, { variant: "info", title: "No output yet", message: "Task has not produced a value" });
64486
64193
  if (valueQuery.isLoading || !valueQuery.data) return /* @__PURE__ */ jsx$1(StatusDisplay, { variant: "loading", title: "Loading..." });
64487
64194
  if (valueQuery.error) return /* @__PURE__ */ jsx$1(StatusDisplay, { variant: "error", title: "Decode failed", message: valueQuery.error.message });
64488
- return /* @__PURE__ */ jsx$1(UIStoreProvider, { store, children: /* @__PURE__ */ jsx$1(ErrorBoundary, { children: /* @__PURE__ */ jsx$1(Box, { height: "100%", overflow: "auto", p: "4", children: /* @__PURE__ */ jsx$1(
64195
+ return /* @__PURE__ */ jsx$1(UIStoreProvider, { store, children: /* @__PURE__ */ jsx$1(ErrorBoundary, { children: /* @__PURE__ */ jsx$1(Box, { height: "100%", overflow: bare ? void 0 : "auto", p: bare ? void 0 : "4", minH: bare ? 0 : void 0, children: /* @__PURE__ */ jsx$1(
64489
64196
  EastChakraComponent,
64490
64197
  {
64491
64198
  value: valueQuery.data.decoded,
@@ -64697,7 +64404,7 @@ function VirtualizedLogViewer({ content, tabs }) {
64697
64404
  border: "none",
64698
64405
  color: "white",
64699
64406
  _placeholder: { color: "gray.400" },
64700
- width: "150px"
64407
+ width: "min(150px, 40vw)"
64701
64408
  }
64702
64409
  ),
64703
64410
  searchQuery && /* @__PURE__ */ jsx$1(Text, { fontSize: "xs", color: "gray.400", minWidth: "50px", textAlign: "center", children: matches33.length > 0 ? `${currentMatchIndex + 1}/${matches33.length}` : "0/0" }),
@@ -65002,18 +64709,20 @@ const TaskPreview = memo(function TaskPreview2({
65002
64709
  repo,
65003
64710
  workspace,
65004
64711
  task,
65005
- requestOptions
64712
+ requestOptions,
64713
+ bare = false
65006
64714
  }) {
65007
64715
  const detailsQuery = useTaskDetails(apiUrl, repo, workspace, task, {
65008
64716
  ...requestOptions != null && { requestOptions }
65009
64717
  });
65010
64718
  const kind = detailsQuery.data ? getTaskKind(detailsQuery.data) : null;
65011
64719
  return /* @__PURE__ */ jsxs(Box, { height: "100%", display: "flex", flexDirection: "column", overflow: "hidden", children: [
65012
- /* @__PURE__ */ jsx$1(Flex, { px: 4, py: 2, borderBottom: "1px solid", borderColor: "border.subtle", bg: "bg.surface", align: "center", flexShrink: 0, children: /* @__PURE__ */ jsx$1(Text, { fontSize: "sm", fontWeight: "medium", color: "fg", children: task }) }),
64720
+ !bare && /* @__PURE__ */ jsx$1(Flex, { px: 4, py: 2, borderBottom: "1px solid", borderColor: "border.subtle", bg: "bg.surface", align: "center", flexShrink: 0, children: /* @__PURE__ */ jsx$1(Text, { fontSize: "sm", fontWeight: "medium", color: "fg", children: task }) }),
65013
64721
  /* @__PURE__ */ jsx$1(Box, { flex: 1, overflow: "hidden", minHeight: 0, children: detailsQuery.isLoading ? /* @__PURE__ */ jsx$1(StatusDisplay, { variant: "loading", title: "Loading task..." }) : detailsQuery.error ? /* @__PURE__ */ jsx$1(StatusDisplay, { variant: "error", title: "Error", message: detailsQuery.error.message }) : kind === "ui" ? /* @__PURE__ */ jsx$1(
65014
64722
  UITaskPreview,
65015
64723
  {
65016
64724
  task,
64725
+ bare,
65017
64726
  config: { apiUrl, repo, workspace, token: (requestOptions == null ? void 0 : requestOptions.token) ?? null }
65018
64727
  }
65019
64728
  ) : /* @__PURE__ */ jsx$1(
@@ -65027,7 +64736,336 @@ const TaskPreview = memo(function TaskPreview2({
65027
64736
  }
65028
64737
  ) })
65029
64738
  ] });
65030
- }, (prev2, next2) => prev2.task === next2.task && prev2.repo === next2.repo && prev2.workspace === next2.workspace);
64739
+ }, (prev2, next2) => prev2.task === next2.task && prev2.repo === next2.repo && prev2.workspace === next2.workspace && prev2.bare === next2.bare);
64740
+ function formatPrimitive(type, value) {
64741
+ switch (type.type) {
64742
+ case "Null":
64743
+ return "null";
64744
+ case "Boolean":
64745
+ return value ? "true" : "false";
64746
+ case "Integer":
64747
+ return String(value);
64748
+ case "Float": {
64749
+ const num2 = value;
64750
+ if (Number.isNaN(num2)) return "NaN";
64751
+ if (!Number.isFinite(num2)) return num2 > 0 ? "Infinity" : "-Infinity";
64752
+ return String(num2);
64753
+ }
64754
+ case "String":
64755
+ return `"${value}"`;
64756
+ case "DateTime":
64757
+ return value.toISOString();
64758
+ case "Blob":
64759
+ return `Blob[${value.length} bytes]`;
64760
+ default:
64761
+ return String(value);
64762
+ }
64763
+ }
64764
+ function isPrimitive(type) {
64765
+ return ["Null", "Boolean", "Integer", "Float", "String", "DateTime", "Blob", "Never"].includes(type.type);
64766
+ }
64767
+ function getTypeLabel(type, value) {
64768
+ switch (type.type) {
64769
+ case "Array":
64770
+ return `Array[${value.length}]`;
64771
+ case "Set":
64772
+ return `Set[${value.size}]`;
64773
+ case "Dict":
64774
+ return `Dict[${value.size}]`;
64775
+ case "Struct":
64776
+ return "Struct";
64777
+ case "Variant":
64778
+ return `Variant.${value.type}`;
64779
+ case "Ref":
64780
+ return "Ref";
64781
+ default:
64782
+ return type.type;
64783
+ }
64784
+ }
64785
+ function ValueNode({
64786
+ type,
64787
+ value,
64788
+ label,
64789
+ depth
64790
+ }) {
64791
+ if (depth > 20) {
64792
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64793
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64794
+ label,
64795
+ ":"
64796
+ ] }),
64797
+ /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "[max depth reached]" })
64798
+ ] });
64799
+ }
64800
+ if (isPrimitive(type)) {
64801
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64802
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64803
+ label,
64804
+ ":"
64805
+ ] }),
64806
+ /* @__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) }),
64807
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "gray", variant: "subtle", children: type.type })
64808
+ ] });
64809
+ }
64810
+ const typeLabel = getTypeLabel(type, value);
64811
+ if (type.type === "Array") {
64812
+ const items = value;
64813
+ const elementType = type.value;
64814
+ if (items.length === 0) {
64815
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64816
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64817
+ label,
64818
+ ":"
64819
+ ] }),
64820
+ /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "[]" }),
64821
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "blue", variant: "subtle", children: "Array[0]" })
64822
+ ] });
64823
+ }
64824
+ return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64825
+ /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64826
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64827
+ label,
64828
+ ":"
64829
+ ] }),
64830
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "blue", variant: "subtle", children: typeLabel })
64831
+ ] }),
64832
+ /* @__PURE__ */ jsx$1(Box, { pl: 4, children: items.map((item, index2) => /* @__PURE__ */ jsx$1(
64833
+ Box,
64834
+ {
64835
+ py: 1,
64836
+ borderBottom: index2 < items.length - 1 ? "1px solid" : void 0,
64837
+ borderColor: "gray.700",
64838
+ children: /* @__PURE__ */ jsx$1(
64839
+ ValueNode,
64840
+ {
64841
+ type: elementType,
64842
+ value: item,
64843
+ label: `[${index2}]`,
64844
+ depth: depth + 1
64845
+ }
64846
+ )
64847
+ },
64848
+ index2
64849
+ )) })
64850
+ ] }) });
64851
+ }
64852
+ if (type.type === "Struct") {
64853
+ const fields = type.value;
64854
+ const obj = value;
64855
+ if (fields.length === 0) {
64856
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64857
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64858
+ label,
64859
+ ":"
64860
+ ] }),
64861
+ /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "{}" }),
64862
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "orange", variant: "subtle", children: "Struct" })
64863
+ ] });
64864
+ }
64865
+ return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64866
+ /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64867
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64868
+ label,
64869
+ ":"
64870
+ ] }),
64871
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "orange", variant: "subtle", children: typeLabel })
64872
+ ] }),
64873
+ /* @__PURE__ */ jsx$1(Box, { pl: 4, children: fields.map((field) => /* @__PURE__ */ jsx$1(
64874
+ ValueNode,
64875
+ {
64876
+ type: field.type,
64877
+ value: obj[field.name],
64878
+ label: field.name,
64879
+ depth: depth + 1
64880
+ },
64881
+ field.name
64882
+ )) })
64883
+ ] }) });
64884
+ }
64885
+ if (type.type === "Variant") {
64886
+ const cases = type.value;
64887
+ const variant2 = value;
64888
+ const activeCase = cases.find((c2) => c2.name === variant2.type);
64889
+ if (!activeCase) {
64890
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64891
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64892
+ label,
64893
+ ":"
64894
+ ] }),
64895
+ /* @__PURE__ */ jsxs(Text, { as: "span", color: "red.400", children: [
64896
+ "Unknown variant: ",
64897
+ variant2.type
64898
+ ] })
64899
+ ] });
64900
+ }
64901
+ if (activeCase.type.type === "Null") {
64902
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64903
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64904
+ label,
64905
+ ":"
64906
+ ] }),
64907
+ /* @__PURE__ */ jsxs(Badge, { size: "xs", colorPalette: "purple", variant: "subtle", children: [
64908
+ ".",
64909
+ variant2.type
64910
+ ] })
64911
+ ] });
64912
+ }
64913
+ return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64914
+ /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64915
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64916
+ label,
64917
+ ":"
64918
+ ] }),
64919
+ /* @__PURE__ */ jsxs(Badge, { size: "xs", colorPalette: "purple", variant: "subtle", children: [
64920
+ ".",
64921
+ variant2.type
64922
+ ] })
64923
+ ] }),
64924
+ /* @__PURE__ */ jsx$1(Box, { pl: 4, children: /* @__PURE__ */ jsx$1(
64925
+ ValueNode,
64926
+ {
64927
+ type: activeCase.type,
64928
+ value: variant2.value,
64929
+ depth: depth + 1
64930
+ }
64931
+ ) })
64932
+ ] }) });
64933
+ }
64934
+ if (type.type === "Dict") {
64935
+ const map3 = value;
64936
+ const keyType = type.value.key;
64937
+ const valueType = type.value.value;
64938
+ if (map3.size === 0) {
64939
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64940
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64941
+ label,
64942
+ ":"
64943
+ ] }),
64944
+ /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "Map{}" }),
64945
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "teal", variant: "subtle", children: "Dict[0]" })
64946
+ ] });
64947
+ }
64948
+ const entries = Array.from(map3.entries());
64949
+ return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64950
+ /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64951
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64952
+ label,
64953
+ ":"
64954
+ ] }),
64955
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "teal", variant: "subtle", children: typeLabel })
64956
+ ] }),
64957
+ /* @__PURE__ */ jsx$1(Box, { pl: 4, children: entries.map(([k2, v3], i) => /* @__PURE__ */ jsxs(
64958
+ Box,
64959
+ {
64960
+ py: 2,
64961
+ borderBottom: i < entries.length - 1 ? "1px solid" : void 0,
64962
+ borderColor: "gray.700",
64963
+ children: [
64964
+ /* @__PURE__ */ jsx$1(ValueNode, { type: keyType, value: k2, depth: depth + 1 }),
64965
+ /* @__PURE__ */ jsx$1(ValueNode, { type: valueType, value: v3, depth: depth + 1 })
64966
+ ]
64967
+ },
64968
+ i
64969
+ )) })
64970
+ ] }) });
64971
+ }
64972
+ if (type.type === "Set") {
64973
+ const set3 = value;
64974
+ const elementType = type.value;
64975
+ if (set3.size === 0) {
64976
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64977
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64978
+ label,
64979
+ ":"
64980
+ ] }),
64981
+ /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "Set{}" }),
64982
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "pink", variant: "subtle", children: "Set[0]" })
64983
+ ] });
64984
+ }
64985
+ const items = Array.from(set3);
64986
+ return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
64987
+ /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64988
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64989
+ label,
64990
+ ":"
64991
+ ] }),
64992
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "pink", variant: "subtle", children: typeLabel })
64993
+ ] }),
64994
+ /* @__PURE__ */ jsx$1(Box, { pl: 4, children: items.map((item, i) => /* @__PURE__ */ jsx$1(
64995
+ Box,
64996
+ {
64997
+ py: 1,
64998
+ borderBottom: i < items.length - 1 ? "1px solid" : void 0,
64999
+ borderColor: "gray.700",
65000
+ children: /* @__PURE__ */ jsx$1(
65001
+ ValueNode,
65002
+ {
65003
+ type: elementType,
65004
+ value: item,
65005
+ depth: depth + 1
65006
+ }
65007
+ )
65008
+ },
65009
+ i
65010
+ )) })
65011
+ ] }) });
65012
+ }
65013
+ if (type.type === "Ref") {
65014
+ const ref = value;
65015
+ return /* @__PURE__ */ jsx$1(Box, { children: /* @__PURE__ */ jsxs("details", { children: [
65016
+ /* @__PURE__ */ jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
65017
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
65018
+ label,
65019
+ ":"
65020
+ ] }),
65021
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "red", variant: "subtle", children: "Ref" })
65022
+ ] }),
65023
+ /* @__PURE__ */ jsx$1(Box, { pl: 4, children: /* @__PURE__ */ jsx$1(
65024
+ ValueNode,
65025
+ {
65026
+ type: type.value,
65027
+ value: ref.value,
65028
+ depth: depth + 1
65029
+ }
65030
+ ) })
65031
+ ] }) });
65032
+ }
65033
+ if (type.type === "Function" || type.type === "AsyncFunction") {
65034
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
65035
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
65036
+ label,
65037
+ ":"
65038
+ ] }),
65039
+ /* @__PURE__ */ jsx$1(Text, { as: "span", color: "gray.500", children: "[function]" }),
65040
+ /* @__PURE__ */ jsx$1(Badge, { size: "xs", colorPalette: "gray", variant: "subtle", children: type.type })
65041
+ ] });
65042
+ }
65043
+ return /* @__PURE__ */ jsxs(Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
65044
+ label && /* @__PURE__ */ jsxs(Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
65045
+ label,
65046
+ ":"
65047
+ ] }),
65048
+ /* @__PURE__ */ jsxs(Text, { as: "span", color: "gray.500", children: [
65049
+ "[",
65050
+ type.type,
65051
+ "]"
65052
+ ] })
65053
+ ] });
65054
+ }
65055
+ function EastValueViewer({ type, value }) {
65056
+ return /* @__PURE__ */ jsx$1(
65057
+ Box,
65058
+ {
65059
+ layerStyle: "surface.code.dark",
65060
+ fontFamily: "mono",
65061
+ fontSize: "sm",
65062
+ p: 4,
65063
+ overflow: "auto",
65064
+ maxHeight: "100%",
65065
+ children: /* @__PURE__ */ jsx$1(ValueNode, { type, value, depth: 0 })
65066
+ }
65067
+ );
65068
+ }
65031
65069
  export {
65032
65070
  BindPlatform,
65033
65071
  BindRuntime,