@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.cjs CHANGED
@@ -33,6 +33,7 @@ const eastUiComponents = require("@elaraai/east-ui-components");
33
33
  const reactDom = require("react-dom");
34
34
  const internal$2 = require("@elaraai/east-ui/internal");
35
35
  const reactQuery = require("@tanstack/react-query");
36
+ const eastUi = require("@elaraai/east-ui");
36
37
  const reactVirtual = require("@tanstack/react-virtual");
37
38
  function _interopNamespaceDefault(e3) {
38
39
  const n2 = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -8939,7 +8940,7 @@ const ConflictRow = React.memo(function ConflictRow2({ row, depth, bindingPathSt
8939
8940
  react.Box,
8940
8941
  {
8941
8942
  display: "grid",
8942
- gridTemplateColumns: supportsManual ? "1fr 1fr 1fr" : "1fr 1fr",
8943
+ gridTemplateColumns: "repeat(auto-fit, minmax(180px, 1fr))",
8943
8944
  gap: "8px",
8944
8945
  mt: "10px",
8945
8946
  p: "12px",
@@ -20527,8 +20528,8 @@ const NODE_ICONS = {
20527
20528
  const HANDLE_BASE = {
20528
20529
  width: 8,
20529
20530
  height: 8,
20530
- background: "#ffffff",
20531
- border: "1.4px solid #6b8080",
20531
+ background: "var(--chakra-colors-bg-surface)",
20532
+ border: "1.4px solid var(--chakra-colors-gray-500)",
20532
20533
  boxSizing: "border-box",
20533
20534
  zIndex: 5
20534
20535
  };
@@ -57020,6 +57021,18 @@ function useBindingOntology(binding) {
57020
57021
  }, [handle]);
57021
57022
  return { ontology, pending, mutate, commit, discard };
57022
57023
  }
57024
+ function useIsDarkMode() {
57025
+ const [dark, setDark] = React.useState(() => typeof document !== "undefined" && document.documentElement.classList.contains("dark"));
57026
+ React.useEffect(() => {
57027
+ const el = document.documentElement;
57028
+ const update2 = () => setDark(el.classList.contains("dark"));
57029
+ update2();
57030
+ const observer = new MutationObserver(update2);
57031
+ observer.observe(el, { attributes: true, attributeFilter: ["class"] });
57032
+ return () => observer.disconnect();
57033
+ }, []);
57034
+ return dark;
57035
+ }
57023
57036
  let nodeIdSeq = 0;
57024
57037
  function freshNodeId() {
57025
57038
  nodeIdSeq += 1;
@@ -57049,6 +57062,7 @@ function OntologyEditorBody({
57049
57062
  handlers
57050
57063
  }) {
57051
57064
  const [searchQuery, setSearchQuery] = React.useState("");
57065
+ const isDark = useIsDarkMode();
57052
57066
  const [focusedNodeId, setFocusedNodeId] = React.useState(null);
57053
57067
  const [selectedNodeId, setSelectedNodeId] = React.useState(null);
57054
57068
  const [paneMenu, setPaneMenu] = React.useState(null);
@@ -57239,9 +57253,10 @@ function OntologyEditorBody({
57239
57253
  nodesConnectable: !readonly,
57240
57254
  elementsSelectable: true,
57241
57255
  fitView: true,
57256
+ colorMode: isDark ? "dark" : "light",
57242
57257
  children: [
57243
- /* @__PURE__ */ jsxRuntime.jsx(Background, { id: "ont-minor", variant: BackgroundVariant.Lines, gap: 24, lineWidth: 1, color: "rgba(226, 232, 232, 0.35)" }),
57244
- /* @__PURE__ */ jsxRuntime.jsx(Background, { id: "ont-major", variant: BackgroundVariant.Lines, gap: 120, lineWidth: 1, color: "rgba(226, 232, 232, 0.8)" }),
57258
+ /* @__PURE__ */ jsxRuntime.jsx(Background, { id: "ont-minor", variant: BackgroundVariant.Lines, gap: 24, lineWidth: 1, color: "color-mix(in srgb, var(--chakra-colors-border-subtle) 35%, transparent)" }),
57259
+ /* @__PURE__ */ jsxRuntime.jsx(Background, { id: "ont-major", variant: BackgroundVariant.Lines, gap: 120, lineWidth: 1, color: "color-mix(in srgb, var(--chakra-colors-border-subtle) 80%, transparent)" }),
57245
57260
  /* @__PURE__ */ jsxRuntime.jsx(Controls, {}),
57246
57261
  !hideMiniMap && /* @__PURE__ */ jsxRuntime.jsx(MiniMap, { nodeColor: miniMapNodeColor, maskColor: "rgba(17, 27, 34, 0.10)" })
57247
57262
  ]
@@ -61128,7 +61143,7 @@ function LoadingSkeleton() {
61128
61143
  /* @__PURE__ */ jsxRuntime.jsx(react.Box, { flex: "1" }),
61129
61144
  line2("72px", "16px")
61130
61145
  ] }),
61131
- /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: "grid", gridTemplateColumns: "304px minmax(0,1fr)", alignItems: "start", children: [
61146
+ /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: "grid", gridTemplateColumns: "304px minmax(0,1fr)", css: { "@media (max-width: 640px)": { gridTemplateColumns: "1fr" } }, alignItems: "start", children: [
61132
61147
  /* @__PURE__ */ jsxRuntime.jsx(react.Box, { borderRightWidth: "1px", borderColor: "border.subtle", p: "4.5", display: "flex", flexDirection: "column", gap: "5", children: [0, 1, 2, 3].map((n2) => /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: "flex", flexDirection: "column", gap: "2", children: [
61133
61148
  line2("150px", "12px"),
61134
61149
  block("40px")
@@ -61392,7 +61407,7 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
61392
61407
  canRun && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { button, variant: "solid", label: "Run", onClick: onRun, disabled: runDisabled, pulse: stale }),
61393
61408
  canCommit && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { button, variant: "ghost", label: "Commit", onClick: onCommit, disabled: commitDisabled })
61394
61409
  ] }),
61395
- /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: "grid", gridTemplateColumns: "304px minmax(0,1fr)", alignItems: "start", children: [
61410
+ /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: "grid", gridTemplateColumns: "304px minmax(0,1fr)", css: { "@media (max-width: 640px)": { gridTemplateColumns: "1fr" } }, alignItems: "start", children: [
61396
61411
  /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { borderRightWidth: "1px", borderColor: "border.subtle", children: [
61397
61412
  /* @__PURE__ */ jsxRuntime.jsxs(Step, { n: 1, title: "What did you change?", help: "step_treatment", children: [
61398
61413
  /* @__PURE__ */ jsxRuntime.jsx(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 }) }),
@@ -62577,7 +62592,7 @@ function LeverEditor({ leverCase, payload, onInject }) {
62577
62592
  )
62578
62593
  ] }, `${k2}.${field}`));
62579
62594
  }
62580
- return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { width: "180px", flexShrink: 0, children: primitiveInput(active, `${k2}.value`, () => valRef.current, (v3) => {
62595
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { width: "min(180px, 100%)", flexShrink: 0, children: primitiveInput(active, `${k2}.value`, () => valRef.current, (v3) => {
62581
62596
  valRef.current = v3;
62582
62597
  }) }, `${k2}.wrap`);
62583
62598
  }, [active, opTag, leverCase]);
@@ -62808,7 +62823,7 @@ const JudgementFacet = React.memo(function JudgementFacet2({ decision, handle, l
62808
62823
  var _a3;
62809
62824
  const current = (_a3 = judgement.answers.get(prompt.id)) == null ? void 0 : _a3.type;
62810
62825
  return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: "flex", alignItems: "center", gap: "12px", flexWrap: "wrap", children: [
62811
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "13px", fontWeight: "medium", flex: "1", minW: "180px", children: prompt.text }),
62826
+ /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "13px", fontWeight: "medium", flex: "1", minW: "min(180px, 100%)", children: prompt.text }),
62812
62827
  /* @__PURE__ */ jsxRuntime.jsx(react.Box, { display: "flex", gap: "6px", flexShrink: 0, children: ANSWERS.map((a2) => /* @__PURE__ */ jsxRuntime.jsx(
62813
62828
  react.chakra.button,
62814
62829
  {
@@ -62866,7 +62881,7 @@ const JudgementFacet = React.memo(function JudgementFacet2({ decision, handle, l
62866
62881
  }
62867
62882
  }
62868
62883
  ) }) : /* @__PURE__ */ jsxRuntime.jsx(react.Text, { ...caption, color: "fg", flexShrink: 0, children: activeLever.label }),
62869
- /* @__PURE__ */ jsxRuntime.jsx(react.Box, { flex: "1", minW: "260px", children: /* @__PURE__ */ jsxRuntime.jsx(
62884
+ /* @__PURE__ */ jsxRuntime.jsx(react.Box, { flex: "1", minW: "min(260px, 100%)", children: /* @__PURE__ */ jsxRuntime.jsx(
62870
62885
  LeverEditor,
62871
62886
  {
62872
62887
  leverCase: activeLever.case,
@@ -63175,18 +63190,7 @@ const EastChakraDecisionQueue = React.memo(function EastChakraDecisionQueue2({ v
63175
63190
  eastUiComponents.useSliceReactivity(sliceHandle == null ? void 0 : sliceHandle.key);
63176
63191
  const sliceState = sliceHandle !== null ? sliceHandle.read() : null;
63177
63192
  const rootRef = React.useRef(null);
63178
- const [narrow, setNarrow] = React.useState(false);
63179
- React.useLayoutEffect(() => {
63180
- const el = rootRef.current;
63181
- if (!el || typeof ResizeObserver === "undefined") return;
63182
- const ro = new ResizeObserver((entries) => {
63183
- var _a3;
63184
- const width2 = ((_a3 = entries[0]) == null ? void 0 : _a3.contentRect.width) ?? 0;
63185
- setNarrow(width2 > 0 && width2 < NARROW_PX);
63186
- });
63187
- ro.observe(el);
63188
- return () => ro.disconnect();
63189
- }, []);
63193
+ const narrow = eastUiComponents.useContainerBelow(rootRef, NARROW_PX);
63190
63194
  const [exiting, setExiting] = React.useState(/* @__PURE__ */ new Map());
63191
63195
  const prevRef = React.useRef(null);
63192
63196
  const reasonsRef = React.useRef(/* @__PURE__ */ new Map());
@@ -63871,33 +63875,35 @@ function getTaskMetadata(details) {
63871
63875
  return ((_a2 = details.metadata) == null ? void 0 : _a2.type) === "some" ? details.metadata.value : null;
63872
63876
  }
63873
63877
  const variantStyles = {
63878
+ // Mode-aware semantic tokens (the raw `red.50` / `gray.50` washes rendered
63879
+ // as bright light boxes in dark mode — #362).
63874
63880
  error: {
63875
- bg: "red.50",
63876
- titleColor: "red.600",
63877
- messageColor: "red.500",
63878
- detailsBg: "red.100",
63879
- detailsColor: "red.800"
63881
+ bg: "bg.danger.subtle",
63882
+ titleColor: "fg.danger",
63883
+ messageColor: "fg.muted",
63884
+ detailsBg: "bg.muted",
63885
+ detailsColor: "fg.default"
63880
63886
  },
63881
63887
  warning: {
63882
- bg: "yellow.50",
63883
- titleColor: "yellow.700",
63884
- messageColor: "yellow.600",
63885
- detailsBg: "yellow.100",
63886
- detailsColor: "yellow.800"
63888
+ bg: "bg.warning.subtle",
63889
+ titleColor: "fg.warning",
63890
+ messageColor: "fg.muted",
63891
+ detailsBg: "bg.muted",
63892
+ detailsColor: "fg.default"
63887
63893
  },
63888
63894
  info: {
63889
- bg: "gray.50",
63890
- titleColor: "gray.500",
63891
- messageColor: "gray.400",
63892
- detailsBg: "gray.100",
63893
- detailsColor: "gray.700"
63895
+ bg: "transparent",
63896
+ titleColor: "fg.muted",
63897
+ messageColor: "fg.subtle",
63898
+ detailsBg: "bg.muted",
63899
+ detailsColor: "fg.default"
63894
63900
  },
63895
63901
  loading: {
63896
- bg: "gray.50",
63897
- titleColor: "gray.500",
63898
- messageColor: "gray.400",
63899
- detailsBg: "gray.100",
63900
- detailsColor: "gray.700"
63902
+ bg: "transparent",
63903
+ titleColor: "fg.muted",
63904
+ messageColor: "fg.subtle",
63905
+ detailsBg: "bg.muted",
63906
+ detailsColor: "fg.default"
63901
63907
  }
63902
63908
  };
63903
63909
  function StatusDisplay({ variant, title, message, details }) {
@@ -63914,7 +63920,7 @@ function StatusDisplay({ variant, title, message, details }) {
63914
63920
  justifyContent: "center",
63915
63921
  bg: styles2.bg,
63916
63922
  children: /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { gap: 2, children: [
63917
- variant === "loading" && /* @__PURE__ */ jsxRuntime.jsx(react.Spinner, { size: "md" }),
63923
+ variant === "loading" && /* @__PURE__ */ jsxRuntime.jsx(eastUiComponents.LoadingIcon, { animate: true, size: "52px" }),
63918
63924
  /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: styles2.titleColor, fontSize: variant === "loading" ? "sm" : "lg", children: title }),
63919
63925
  message && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: styles2.messageColor, fontSize: "sm", children: message }),
63920
63926
  details && /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { position: "relative", mt: 2, width: "100%", children: [
@@ -63994,335 +64000,6 @@ class ErrorBoundary extends React.Component {
63994
64000
  return this.props.children;
63995
64001
  }
63996
64002
  }
63997
- function formatPrimitive(type, value) {
63998
- switch (type.type) {
63999
- case "Null":
64000
- return "null";
64001
- case "Boolean":
64002
- return value ? "true" : "false";
64003
- case "Integer":
64004
- return String(value);
64005
- case "Float": {
64006
- const num2 = value;
64007
- if (Number.isNaN(num2)) return "NaN";
64008
- if (!Number.isFinite(num2)) return num2 > 0 ? "Infinity" : "-Infinity";
64009
- return String(num2);
64010
- }
64011
- case "String":
64012
- return `"${value}"`;
64013
- case "DateTime":
64014
- return value.toISOString();
64015
- case "Blob":
64016
- return `Blob[${value.length} bytes]`;
64017
- default:
64018
- return String(value);
64019
- }
64020
- }
64021
- function isPrimitive(type) {
64022
- return ["Null", "Boolean", "Integer", "Float", "String", "DateTime", "Blob", "Never"].includes(type.type);
64023
- }
64024
- function getTypeLabel(type, value) {
64025
- switch (type.type) {
64026
- case "Array":
64027
- return `Array[${value.length}]`;
64028
- case "Set":
64029
- return `Set[${value.size}]`;
64030
- case "Dict":
64031
- return `Dict[${value.size}]`;
64032
- case "Struct":
64033
- return "Struct";
64034
- case "Variant":
64035
- return `Variant.${value.type}`;
64036
- case "Ref":
64037
- return "Ref";
64038
- default:
64039
- return type.type;
64040
- }
64041
- }
64042
- function ValueNode({
64043
- type,
64044
- value,
64045
- label,
64046
- depth
64047
- }) {
64048
- if (depth > 20) {
64049
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64050
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64051
- label,
64052
- ":"
64053
- ] }),
64054
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "[max depth reached]" })
64055
- ] });
64056
- }
64057
- if (isPrimitive(type)) {
64058
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64059
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64060
- label,
64061
- ":"
64062
- ] }),
64063
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: type.type === "String" ? "green.400" : type.type === "Integer" || type.type === "Float" ? "blue.400" : "gray.300", children: formatPrimitive(type, value) }),
64064
- /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "gray", variant: "subtle", children: type.type })
64065
- ] });
64066
- }
64067
- const typeLabel = getTypeLabel(type, value);
64068
- if (type.type === "Array") {
64069
- const items = value;
64070
- const elementType = type.value;
64071
- if (items.length === 0) {
64072
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64073
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64074
- label,
64075
- ":"
64076
- ] }),
64077
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "[]" }),
64078
- /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "blue", variant: "subtle", children: "Array[0]" })
64079
- ] });
64080
- }
64081
- return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
64082
- /* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64083
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64084
- label,
64085
- ":"
64086
- ] }),
64087
- /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "blue", variant: "subtle", children: typeLabel })
64088
- ] }),
64089
- /* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: items.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(
64090
- react.Box,
64091
- {
64092
- py: 1,
64093
- borderBottom: index2 < items.length - 1 ? "1px solid" : void 0,
64094
- borderColor: "gray.700",
64095
- children: /* @__PURE__ */ jsxRuntime.jsx(
64096
- ValueNode,
64097
- {
64098
- type: elementType,
64099
- value: item,
64100
- label: `[${index2}]`,
64101
- depth: depth + 1
64102
- }
64103
- )
64104
- },
64105
- index2
64106
- )) })
64107
- ] }) });
64108
- }
64109
- if (type.type === "Struct") {
64110
- const fields = type.value;
64111
- const obj = value;
64112
- if (fields.length === 0) {
64113
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64114
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64115
- label,
64116
- ":"
64117
- ] }),
64118
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "{}" }),
64119
- /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "orange", variant: "subtle", children: "Struct" })
64120
- ] });
64121
- }
64122
- return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
64123
- /* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64124
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64125
- label,
64126
- ":"
64127
- ] }),
64128
- /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "orange", variant: "subtle", children: typeLabel })
64129
- ] }),
64130
- /* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: fields.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
64131
- ValueNode,
64132
- {
64133
- type: field.type,
64134
- value: obj[field.name],
64135
- label: field.name,
64136
- depth: depth + 1
64137
- },
64138
- field.name
64139
- )) })
64140
- ] }) });
64141
- }
64142
- if (type.type === "Variant") {
64143
- const cases = type.value;
64144
- const variant = value;
64145
- const activeCase = cases.find((c2) => c2.name === variant.type);
64146
- if (!activeCase) {
64147
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64148
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64149
- label,
64150
- ":"
64151
- ] }),
64152
- /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "red.400", children: [
64153
- "Unknown variant: ",
64154
- variant.type
64155
- ] })
64156
- ] });
64157
- }
64158
- if (activeCase.type.type === "Null") {
64159
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64160
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64161
- label,
64162
- ":"
64163
- ] }),
64164
- /* @__PURE__ */ jsxRuntime.jsxs(react.Badge, { size: "xs", colorPalette: "purple", variant: "subtle", children: [
64165
- ".",
64166
- variant.type
64167
- ] })
64168
- ] });
64169
- }
64170
- return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
64171
- /* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64172
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64173
- label,
64174
- ":"
64175
- ] }),
64176
- /* @__PURE__ */ jsxRuntime.jsxs(react.Badge, { size: "xs", colorPalette: "purple", variant: "subtle", children: [
64177
- ".",
64178
- variant.type
64179
- ] })
64180
- ] }),
64181
- /* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
64182
- ValueNode,
64183
- {
64184
- type: activeCase.type,
64185
- value: variant.value,
64186
- depth: depth + 1
64187
- }
64188
- ) })
64189
- ] }) });
64190
- }
64191
- if (type.type === "Dict") {
64192
- const map3 = value;
64193
- const keyType = type.value.key;
64194
- const valueType = type.value.value;
64195
- if (map3.size === 0) {
64196
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64197
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64198
- label,
64199
- ":"
64200
- ] }),
64201
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "Map{}" }),
64202
- /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "teal", variant: "subtle", children: "Dict[0]" })
64203
- ] });
64204
- }
64205
- const entries = Array.from(map3.entries());
64206
- return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
64207
- /* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64208
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64209
- label,
64210
- ":"
64211
- ] }),
64212
- /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "teal", variant: "subtle", children: typeLabel })
64213
- ] }),
64214
- /* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: entries.map(([k2, v3], i) => /* @__PURE__ */ jsxRuntime.jsxs(
64215
- react.Box,
64216
- {
64217
- py: 2,
64218
- borderBottom: i < entries.length - 1 ? "1px solid" : void 0,
64219
- borderColor: "gray.700",
64220
- children: [
64221
- /* @__PURE__ */ jsxRuntime.jsx(ValueNode, { type: keyType, value: k2, depth: depth + 1 }),
64222
- /* @__PURE__ */ jsxRuntime.jsx(ValueNode, { type: valueType, value: v3, depth: depth + 1 })
64223
- ]
64224
- },
64225
- i
64226
- )) })
64227
- ] }) });
64228
- }
64229
- if (type.type === "Set") {
64230
- const set3 = value;
64231
- const elementType = type.value;
64232
- if (set3.size === 0) {
64233
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64234
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64235
- label,
64236
- ":"
64237
- ] }),
64238
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "Set{}" }),
64239
- /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "pink", variant: "subtle", children: "Set[0]" })
64240
- ] });
64241
- }
64242
- const items = Array.from(set3);
64243
- return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
64244
- /* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64245
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64246
- label,
64247
- ":"
64248
- ] }),
64249
- /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "pink", variant: "subtle", children: typeLabel })
64250
- ] }),
64251
- /* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsx(
64252
- react.Box,
64253
- {
64254
- py: 1,
64255
- borderBottom: i < items.length - 1 ? "1px solid" : void 0,
64256
- borderColor: "gray.700",
64257
- children: /* @__PURE__ */ jsxRuntime.jsx(
64258
- ValueNode,
64259
- {
64260
- type: elementType,
64261
- value: item,
64262
- depth: depth + 1
64263
- }
64264
- )
64265
- },
64266
- i
64267
- )) })
64268
- ] }) });
64269
- }
64270
- if (type.type === "Ref") {
64271
- const ref = value;
64272
- return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
64273
- /* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64274
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64275
- label,
64276
- ":"
64277
- ] }),
64278
- /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "red", variant: "subtle", children: "Ref" })
64279
- ] }),
64280
- /* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
64281
- ValueNode,
64282
- {
64283
- type: type.value,
64284
- value: ref.value,
64285
- depth: depth + 1
64286
- }
64287
- ) })
64288
- ] }) });
64289
- }
64290
- if (type.type === "Function" || type.type === "AsyncFunction") {
64291
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64292
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64293
- label,
64294
- ":"
64295
- ] }),
64296
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "[function]" }),
64297
- /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "gray", variant: "subtle", children: type.type })
64298
- ] });
64299
- }
64300
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64301
- label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64302
- label,
64303
- ":"
64304
- ] }),
64305
- /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "gray.500", children: [
64306
- "[",
64307
- type.type,
64308
- "]"
64309
- ] })
64310
- ] });
64311
- }
64312
- function EastValueViewer({ type, value }) {
64313
- return /* @__PURE__ */ jsxRuntime.jsx(
64314
- react.Box,
64315
- {
64316
- layerStyle: "surface.code.dark",
64317
- fontFamily: "mono",
64318
- fontSize: "sm",
64319
- p: 4,
64320
- overflow: "auto",
64321
- maxHeight: "100%",
64322
- children: /* @__PURE__ */ jsxRuntime.jsx(ValueNode, { type, value, depth: 0 })
64323
- }
64324
- );
64325
- }
64326
64003
  const DEFAULT_SIZE_LIMIT = 200 * 1024;
64327
64004
  function formatSize(bytes) {
64328
64005
  if (bytes < 1024) return `${bytes} B`;
@@ -64351,8 +64028,10 @@ const DatasetPreview = React.memo(function DatasetPreview2({
64351
64028
  path: path2,
64352
64029
  requestOptions,
64353
64030
  sizeLimit = DEFAULT_SIZE_LIMIT,
64354
- pollInterval
64031
+ pollInterval,
64032
+ editable = false
64355
64033
  }) {
64034
+ var _a2;
64356
64035
  const statusQuery = useDatasetStatus(apiUrl, repo, workspace, path2, {
64357
64036
  ...requestOptions != null && { requestOptions },
64358
64037
  ...pollInterval !== void 0 && { pollInterval }
@@ -64366,9 +64045,35 @@ const DatasetPreview = React.memo(function DatasetPreview2({
64366
64045
  ...requestOptions != null && { requestOptions },
64367
64046
  type: status == null ? void 0 : status.type,
64368
64047
  hash: (status == null ? void 0 : status.hash) ?? null,
64369
- enabled: shouldFetch
64048
+ enabled: shouldFetch,
64049
+ // An edit changes the value's content hash → a new query key. Keep the
64050
+ // current value on screen while the new one loads so an edit doesn't
64051
+ // flash the loading state (only the FIRST load has no previous value).
64052
+ queryOverrides: { placeholderData: reactQuery.keepPreviousData }
64370
64053
  });
64371
64054
  const download = useDatasetDownload(apiUrl, repo, workspace, path2, requestOptions);
64055
+ const setMutation = useDatasetSet(apiUrl, repo, workspace, requestOptions);
64056
+ const queryClient = reactQuery.useQueryClient();
64057
+ const type = status == null ? void 0 : status.type;
64058
+ const decoded = (_a2 = valueQuery.data) == null ? void 0 : _a2.decoded;
64059
+ const write = React.useCallback(async (next2) => {
64060
+ if (workspace == null || path2 == null || type === void 0) return;
64061
+ const treePath = path2.split(".").filter(Boolean).map((p2) => east.variant("field", p2));
64062
+ const data4 = east.encodeBeast2For(type)(next2);
64063
+ await setMutation.mutateAsync({ path: treePath, data: data4 });
64064
+ await queryClient.invalidateQueries({ queryKey: ["datasetStatus", apiUrl, repo, workspace, path2] });
64065
+ }, [apiUrl, repo, workspace, path2, type, setMutation, queryClient]);
64066
+ const treeValue = React.useMemo(() => {
64067
+ if (type === void 0 || decoded === void 0) return null;
64068
+ const root2 = eastUi.ValueTree.materialize(type, decoded);
64069
+ const wire = editable ? {
64070
+ onEdit: east.some((p2, leaf) => write(eastUi.ValueTree.applyEdit(type, decoded, p2, { kind: "edit", leaf }))),
64071
+ onInsert: east.some((p2) => write(eastUi.ValueTree.applyEdit(type, decoded, p2, { kind: "insert" }))),
64072
+ onRemove: east.some((p2) => write(eastUi.ValueTree.applyEdit(type, decoded, p2, { kind: "remove" }))),
64073
+ onTag: east.some((p2, tag) => write(eastUi.ValueTree.applyEdit(type, decoded, p2, { kind: "tag", tag })))
64074
+ } : { onEdit: east.none, onInsert: east.none, onRemove: east.none, onTag: east.none };
64075
+ return { root: root2, ...wire, style: east.some({ height: east.some("100%"), maxHeight: east.none }) };
64076
+ }, [type, decoded, editable, write]);
64372
64077
  if (statusQuery.isLoading) return /* @__PURE__ */ jsxRuntime.jsx(StatusDisplay, { variant: "loading", title: "Loading..." });
64373
64078
  if (statusQuery.error) {
64374
64079
  const { message, details } = formatApiError(statusQuery.error);
@@ -64396,7 +64101,7 @@ const DatasetPreview = React.memo(function DatasetPreview2({
64396
64101
  /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "xs", color: "fg.muted", mr: 2, alignSelf: "center", children: formatSize(sizeBytes) }),
64397
64102
  /* @__PURE__ */ jsxRuntime.jsx(DownloadButton, { onClick: download })
64398
64103
  ] }),
64399
- /* @__PURE__ */ jsxRuntime.jsx(react.Box, { flex: 1, overflow: "auto", p: "4", minHeight: 0, children: /* @__PURE__ */ jsxRuntime.jsx(EastValueViewer, { type: status.type, value: valueQuery.data.decoded }) })
64104
+ /* @__PURE__ */ jsxRuntime.jsx(react.Box, { flex: 1, minHeight: 0, overflow: "hidden", children: treeValue !== null && /* @__PURE__ */ jsxRuntime.jsx(eastUiComponents.EastChakraValueTree, { value: treeValue, storageKey: path2 ?? "value" }) })
64400
64105
  ] });
64401
64106
  });
64402
64107
  const InputPreview = React.memo(function InputPreview2({
@@ -64416,6 +64121,7 @@ const InputPreview = React.memo(function InputPreview2({
64416
64121
  repo,
64417
64122
  workspace,
64418
64123
  path: path2,
64124
+ editable: true,
64419
64125
  ...requestOptions != null && { requestOptions }
64420
64126
  }
64421
64127
  ) })
@@ -64427,7 +64133,8 @@ function treePathToString$1(path2) {
64427
64133
  const UITaskPreview = React.memo(function UITaskPreview2({
64428
64134
  task,
64429
64135
  config: config2,
64430
- pollInterval = 1e3
64136
+ pollInterval = 1e3,
64137
+ bare = false
64431
64138
  }) {
64432
64139
  var _a2, _b2;
64433
64140
  const e3 = useE3ConfigOptional();
@@ -64503,7 +64210,7 @@ const UITaskPreview = React.memo(function UITaskPreview2({
64503
64210
  if (statusQuery.data.refType !== "value") return /* @__PURE__ */ jsxRuntime.jsx(StatusDisplay, { variant: "info", title: "No output yet", message: "Task has not produced a value" });
64504
64211
  if (valueQuery.isLoading || !valueQuery.data) return /* @__PURE__ */ jsxRuntime.jsx(StatusDisplay, { variant: "loading", title: "Loading..." });
64505
64212
  if (valueQuery.error) return /* @__PURE__ */ jsxRuntime.jsx(StatusDisplay, { variant: "error", title: "Decode failed", message: valueQuery.error.message });
64506
- return /* @__PURE__ */ jsxRuntime.jsx(eastUiComponents.UIStoreProvider, { store, children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { height: "100%", overflow: "auto", p: "4", children: /* @__PURE__ */ jsxRuntime.jsx(
64213
+ return /* @__PURE__ */ jsxRuntime.jsx(eastUiComponents.UIStoreProvider, { store, children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { height: "100%", overflow: bare ? void 0 : "auto", p: bare ? void 0 : "4", minH: bare ? 0 : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
64507
64214
  eastUiComponents.EastChakraComponent,
64508
64215
  {
64509
64216
  value: valueQuery.data.decoded,
@@ -64715,7 +64422,7 @@ function VirtualizedLogViewer({ content, tabs }) {
64715
64422
  border: "none",
64716
64423
  color: "white",
64717
64424
  _placeholder: { color: "gray.400" },
64718
- width: "150px"
64425
+ width: "min(150px, 40vw)"
64719
64426
  }
64720
64427
  ),
64721
64428
  searchQuery && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "xs", color: "gray.400", minWidth: "50px", textAlign: "center", children: matches33.length > 0 ? `${currentMatchIndex + 1}/${matches33.length}` : "0/0" }),
@@ -65020,18 +64727,20 @@ const TaskPreview = React.memo(function TaskPreview2({
65020
64727
  repo,
65021
64728
  workspace,
65022
64729
  task,
65023
- requestOptions
64730
+ requestOptions,
64731
+ bare = false
65024
64732
  }) {
65025
64733
  const detailsQuery = useTaskDetails(apiUrl, repo, workspace, task, {
65026
64734
  ...requestOptions != null && { requestOptions }
65027
64735
  });
65028
64736
  const kind = detailsQuery.data ? getTaskKind(detailsQuery.data) : null;
65029
64737
  return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { height: "100%", display: "flex", flexDirection: "column", overflow: "hidden", children: [
65030
- /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { px: 4, py: 2, borderBottom: "1px solid", borderColor: "border.subtle", bg: "bg.surface", align: "center", flexShrink: 0, children: /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "sm", fontWeight: "medium", color: "fg", children: task }) }),
64738
+ !bare && /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { px: 4, py: 2, borderBottom: "1px solid", borderColor: "border.subtle", bg: "bg.surface", align: "center", flexShrink: 0, children: /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "sm", fontWeight: "medium", color: "fg", children: task }) }),
65031
64739
  /* @__PURE__ */ jsxRuntime.jsx(react.Box, { flex: 1, overflow: "hidden", minHeight: 0, children: detailsQuery.isLoading ? /* @__PURE__ */ jsxRuntime.jsx(StatusDisplay, { variant: "loading", title: "Loading task..." }) : detailsQuery.error ? /* @__PURE__ */ jsxRuntime.jsx(StatusDisplay, { variant: "error", title: "Error", message: detailsQuery.error.message }) : kind === "ui" ? /* @__PURE__ */ jsxRuntime.jsx(
65032
64740
  UITaskPreview,
65033
64741
  {
65034
64742
  task,
64743
+ bare,
65035
64744
  config: { apiUrl, repo, workspace, token: (requestOptions == null ? void 0 : requestOptions.token) ?? null }
65036
64745
  }
65037
64746
  ) : /* @__PURE__ */ jsxRuntime.jsx(
@@ -65045,7 +64754,336 @@ const TaskPreview = React.memo(function TaskPreview2({
65045
64754
  }
65046
64755
  ) })
65047
64756
  ] });
65048
- }, (prev2, next2) => prev2.task === next2.task && prev2.repo === next2.repo && prev2.workspace === next2.workspace);
64757
+ }, (prev2, next2) => prev2.task === next2.task && prev2.repo === next2.repo && prev2.workspace === next2.workspace && prev2.bare === next2.bare);
64758
+ function formatPrimitive(type, value) {
64759
+ switch (type.type) {
64760
+ case "Null":
64761
+ return "null";
64762
+ case "Boolean":
64763
+ return value ? "true" : "false";
64764
+ case "Integer":
64765
+ return String(value);
64766
+ case "Float": {
64767
+ const num2 = value;
64768
+ if (Number.isNaN(num2)) return "NaN";
64769
+ if (!Number.isFinite(num2)) return num2 > 0 ? "Infinity" : "-Infinity";
64770
+ return String(num2);
64771
+ }
64772
+ case "String":
64773
+ return `"${value}"`;
64774
+ case "DateTime":
64775
+ return value.toISOString();
64776
+ case "Blob":
64777
+ return `Blob[${value.length} bytes]`;
64778
+ default:
64779
+ return String(value);
64780
+ }
64781
+ }
64782
+ function isPrimitive(type) {
64783
+ return ["Null", "Boolean", "Integer", "Float", "String", "DateTime", "Blob", "Never"].includes(type.type);
64784
+ }
64785
+ function getTypeLabel(type, value) {
64786
+ switch (type.type) {
64787
+ case "Array":
64788
+ return `Array[${value.length}]`;
64789
+ case "Set":
64790
+ return `Set[${value.size}]`;
64791
+ case "Dict":
64792
+ return `Dict[${value.size}]`;
64793
+ case "Struct":
64794
+ return "Struct";
64795
+ case "Variant":
64796
+ return `Variant.${value.type}`;
64797
+ case "Ref":
64798
+ return "Ref";
64799
+ default:
64800
+ return type.type;
64801
+ }
64802
+ }
64803
+ function ValueNode({
64804
+ type,
64805
+ value,
64806
+ label,
64807
+ depth
64808
+ }) {
64809
+ if (depth > 20) {
64810
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64811
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64812
+ label,
64813
+ ":"
64814
+ ] }),
64815
+ /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "[max depth reached]" })
64816
+ ] });
64817
+ }
64818
+ if (isPrimitive(type)) {
64819
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64820
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64821
+ label,
64822
+ ":"
64823
+ ] }),
64824
+ /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: type.type === "String" ? "green.400" : type.type === "Integer" || type.type === "Float" ? "blue.400" : "gray.300", children: formatPrimitive(type, value) }),
64825
+ /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "gray", variant: "subtle", children: type.type })
64826
+ ] });
64827
+ }
64828
+ const typeLabel = getTypeLabel(type, value);
64829
+ if (type.type === "Array") {
64830
+ const items = value;
64831
+ const elementType = type.value;
64832
+ if (items.length === 0) {
64833
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64834
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64835
+ label,
64836
+ ":"
64837
+ ] }),
64838
+ /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "[]" }),
64839
+ /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "blue", variant: "subtle", children: "Array[0]" })
64840
+ ] });
64841
+ }
64842
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
64843
+ /* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64844
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64845
+ label,
64846
+ ":"
64847
+ ] }),
64848
+ /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "blue", variant: "subtle", children: typeLabel })
64849
+ ] }),
64850
+ /* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: items.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(
64851
+ react.Box,
64852
+ {
64853
+ py: 1,
64854
+ borderBottom: index2 < items.length - 1 ? "1px solid" : void 0,
64855
+ borderColor: "gray.700",
64856
+ children: /* @__PURE__ */ jsxRuntime.jsx(
64857
+ ValueNode,
64858
+ {
64859
+ type: elementType,
64860
+ value: item,
64861
+ label: `[${index2}]`,
64862
+ depth: depth + 1
64863
+ }
64864
+ )
64865
+ },
64866
+ index2
64867
+ )) })
64868
+ ] }) });
64869
+ }
64870
+ if (type.type === "Struct") {
64871
+ const fields = type.value;
64872
+ const obj = value;
64873
+ if (fields.length === 0) {
64874
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64875
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64876
+ label,
64877
+ ":"
64878
+ ] }),
64879
+ /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "{}" }),
64880
+ /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "orange", variant: "subtle", children: "Struct" })
64881
+ ] });
64882
+ }
64883
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
64884
+ /* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64885
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64886
+ label,
64887
+ ":"
64888
+ ] }),
64889
+ /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "orange", variant: "subtle", children: typeLabel })
64890
+ ] }),
64891
+ /* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: fields.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
64892
+ ValueNode,
64893
+ {
64894
+ type: field.type,
64895
+ value: obj[field.name],
64896
+ label: field.name,
64897
+ depth: depth + 1
64898
+ },
64899
+ field.name
64900
+ )) })
64901
+ ] }) });
64902
+ }
64903
+ if (type.type === "Variant") {
64904
+ const cases = type.value;
64905
+ const variant = value;
64906
+ const activeCase = cases.find((c2) => c2.name === variant.type);
64907
+ if (!activeCase) {
64908
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64909
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64910
+ label,
64911
+ ":"
64912
+ ] }),
64913
+ /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "red.400", children: [
64914
+ "Unknown variant: ",
64915
+ variant.type
64916
+ ] })
64917
+ ] });
64918
+ }
64919
+ if (activeCase.type.type === "Null") {
64920
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64921
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64922
+ label,
64923
+ ":"
64924
+ ] }),
64925
+ /* @__PURE__ */ jsxRuntime.jsxs(react.Badge, { size: "xs", colorPalette: "purple", variant: "subtle", children: [
64926
+ ".",
64927
+ variant.type
64928
+ ] })
64929
+ ] });
64930
+ }
64931
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
64932
+ /* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64933
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64934
+ label,
64935
+ ":"
64936
+ ] }),
64937
+ /* @__PURE__ */ jsxRuntime.jsxs(react.Badge, { size: "xs", colorPalette: "purple", variant: "subtle", children: [
64938
+ ".",
64939
+ variant.type
64940
+ ] })
64941
+ ] }),
64942
+ /* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
64943
+ ValueNode,
64944
+ {
64945
+ type: activeCase.type,
64946
+ value: variant.value,
64947
+ depth: depth + 1
64948
+ }
64949
+ ) })
64950
+ ] }) });
64951
+ }
64952
+ if (type.type === "Dict") {
64953
+ const map3 = value;
64954
+ const keyType = type.value.key;
64955
+ const valueType = type.value.value;
64956
+ if (map3.size === 0) {
64957
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64958
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64959
+ label,
64960
+ ":"
64961
+ ] }),
64962
+ /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "Map{}" }),
64963
+ /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "teal", variant: "subtle", children: "Dict[0]" })
64964
+ ] });
64965
+ }
64966
+ const entries = Array.from(map3.entries());
64967
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
64968
+ /* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
64969
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64970
+ label,
64971
+ ":"
64972
+ ] }),
64973
+ /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "teal", variant: "subtle", children: typeLabel })
64974
+ ] }),
64975
+ /* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: entries.map(([k2, v3], i) => /* @__PURE__ */ jsxRuntime.jsxs(
64976
+ react.Box,
64977
+ {
64978
+ py: 2,
64979
+ borderBottom: i < entries.length - 1 ? "1px solid" : void 0,
64980
+ borderColor: "gray.700",
64981
+ children: [
64982
+ /* @__PURE__ */ jsxRuntime.jsx(ValueNode, { type: keyType, value: k2, depth: depth + 1 }),
64983
+ /* @__PURE__ */ jsxRuntime.jsx(ValueNode, { type: valueType, value: v3, depth: depth + 1 })
64984
+ ]
64985
+ },
64986
+ i
64987
+ )) })
64988
+ ] }) });
64989
+ }
64990
+ if (type.type === "Set") {
64991
+ const set3 = value;
64992
+ const elementType = type.value;
64993
+ if (set3.size === 0) {
64994
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
64995
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
64996
+ label,
64997
+ ":"
64998
+ ] }),
64999
+ /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "Set{}" }),
65000
+ /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "pink", variant: "subtle", children: "Set[0]" })
65001
+ ] });
65002
+ }
65003
+ const items = Array.from(set3);
65004
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
65005
+ /* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
65006
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
65007
+ label,
65008
+ ":"
65009
+ ] }),
65010
+ /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "pink", variant: "subtle", children: typeLabel })
65011
+ ] }),
65012
+ /* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsx(
65013
+ react.Box,
65014
+ {
65015
+ py: 1,
65016
+ borderBottom: i < items.length - 1 ? "1px solid" : void 0,
65017
+ borderColor: "gray.700",
65018
+ children: /* @__PURE__ */ jsxRuntime.jsx(
65019
+ ValueNode,
65020
+ {
65021
+ type: elementType,
65022
+ value: item,
65023
+ depth: depth + 1
65024
+ }
65025
+ )
65026
+ },
65027
+ i
65028
+ )) })
65029
+ ] }) });
65030
+ }
65031
+ if (type.type === "Ref") {
65032
+ const ref = value;
65033
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
65034
+ /* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
65035
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
65036
+ label,
65037
+ ":"
65038
+ ] }),
65039
+ /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "red", variant: "subtle", children: "Ref" })
65040
+ ] }),
65041
+ /* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
65042
+ ValueNode,
65043
+ {
65044
+ type: type.value,
65045
+ value: ref.value,
65046
+ depth: depth + 1
65047
+ }
65048
+ ) })
65049
+ ] }) });
65050
+ }
65051
+ if (type.type === "Function" || type.type === "AsyncFunction") {
65052
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
65053
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
65054
+ label,
65055
+ ":"
65056
+ ] }),
65057
+ /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "[function]" }),
65058
+ /* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "gray", variant: "subtle", children: type.type })
65059
+ ] });
65060
+ }
65061
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
65062
+ label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
65063
+ label,
65064
+ ":"
65065
+ ] }),
65066
+ /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "gray.500", children: [
65067
+ "[",
65068
+ type.type,
65069
+ "]"
65070
+ ] })
65071
+ ] });
65072
+ }
65073
+ function EastValueViewer({ type, value }) {
65074
+ return /* @__PURE__ */ jsxRuntime.jsx(
65075
+ react.Box,
65076
+ {
65077
+ layerStyle: "surface.code.dark",
65078
+ fontFamily: "mono",
65079
+ fontSize: "sm",
65080
+ p: 4,
65081
+ overflow: "auto",
65082
+ maxHeight: "100%",
65083
+ children: /* @__PURE__ */ jsxRuntime.jsx(ValueNode, { type, value, depth: 0 })
65084
+ }
65085
+ );
65086
+ }
65049
65087
  exports.BindPlatform = BindPlatform;
65050
65088
  exports.BindRuntime = BindRuntime;
65051
65089
  exports.DataTaskPreview = DataTaskPreview;