@elaraai/e3-ui-components 1.0.40 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DatasetPreview.d.ts +3 -0
- package/dist/components/DatasetPreview.d.ts.map +1 -1
- package/dist/components/InputPreview.d.ts.map +1 -1
- package/dist/components/StatusDisplay.d.ts.map +1 -1
- package/dist/decision/queue.d.ts.map +1 -1
- package/dist/diff/index.d.ts.map +1 -1
- package/dist/index.cjs +411 -376
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +414 -379
- package/dist/index.js.map +1 -1
- package/dist/ontology/OntologyNode.d.ts.map +1 -1
- package/dist/ontology/index.d.ts.map +1 -1
- package/dist/ontology/use-color-mode.d.ts +7 -0
- package/dist/ontology/use-color-mode.d.ts.map +1 -0
- package/package.json +13 -13
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:
|
|
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: "
|
|
20531
|
-
border: "1.4px solid
|
|
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: "
|
|
57244
|
-
/* @__PURE__ */ jsxRuntime.jsx(Background, { id: "ont-major", variant: BackgroundVariant.Lines, gap: 120, lineWidth: 1, color: "
|
|
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
|
|
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: "
|
|
63876
|
-
titleColor: "
|
|
63877
|
-
messageColor: "
|
|
63878
|
-
detailsBg: "
|
|
63879
|
-
detailsColor: "
|
|
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: "
|
|
63883
|
-
titleColor: "
|
|
63884
|
-
messageColor: "
|
|
63885
|
-
detailsBg: "
|
|
63886
|
-
detailsColor: "
|
|
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: "
|
|
63890
|
-
titleColor: "
|
|
63891
|
-
messageColor: "
|
|
63892
|
-
detailsBg: "
|
|
63893
|
-
detailsColor: "
|
|
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: "
|
|
63897
|
-
titleColor: "
|
|
63898
|
-
messageColor: "
|
|
63899
|
-
detailsBg: "
|
|
63900
|
-
detailsColor: "
|
|
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(
|
|
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,
|
|
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
|
) })
|
|
@@ -64715,7 +64421,7 @@ function VirtualizedLogViewer({ content, tabs }) {
|
|
|
64715
64421
|
border: "none",
|
|
64716
64422
|
color: "white",
|
|
64717
64423
|
_placeholder: { color: "gray.400" },
|
|
64718
|
-
width: "150px"
|
|
64424
|
+
width: "min(150px, 40vw)"
|
|
64719
64425
|
}
|
|
64720
64426
|
),
|
|
64721
64427
|
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" }),
|
|
@@ -65046,6 +64752,335 @@ const TaskPreview = React.memo(function TaskPreview2({
|
|
|
65046
64752
|
) })
|
|
65047
64753
|
] });
|
|
65048
64754
|
}, (prev2, next2) => prev2.task === next2.task && prev2.repo === next2.repo && prev2.workspace === next2.workspace);
|
|
64755
|
+
function formatPrimitive(type, value) {
|
|
64756
|
+
switch (type.type) {
|
|
64757
|
+
case "Null":
|
|
64758
|
+
return "null";
|
|
64759
|
+
case "Boolean":
|
|
64760
|
+
return value ? "true" : "false";
|
|
64761
|
+
case "Integer":
|
|
64762
|
+
return String(value);
|
|
64763
|
+
case "Float": {
|
|
64764
|
+
const num2 = value;
|
|
64765
|
+
if (Number.isNaN(num2)) return "NaN";
|
|
64766
|
+
if (!Number.isFinite(num2)) return num2 > 0 ? "Infinity" : "-Infinity";
|
|
64767
|
+
return String(num2);
|
|
64768
|
+
}
|
|
64769
|
+
case "String":
|
|
64770
|
+
return `"${value}"`;
|
|
64771
|
+
case "DateTime":
|
|
64772
|
+
return value.toISOString();
|
|
64773
|
+
case "Blob":
|
|
64774
|
+
return `Blob[${value.length} bytes]`;
|
|
64775
|
+
default:
|
|
64776
|
+
return String(value);
|
|
64777
|
+
}
|
|
64778
|
+
}
|
|
64779
|
+
function isPrimitive(type) {
|
|
64780
|
+
return ["Null", "Boolean", "Integer", "Float", "String", "DateTime", "Blob", "Never"].includes(type.type);
|
|
64781
|
+
}
|
|
64782
|
+
function getTypeLabel(type, value) {
|
|
64783
|
+
switch (type.type) {
|
|
64784
|
+
case "Array":
|
|
64785
|
+
return `Array[${value.length}]`;
|
|
64786
|
+
case "Set":
|
|
64787
|
+
return `Set[${value.size}]`;
|
|
64788
|
+
case "Dict":
|
|
64789
|
+
return `Dict[${value.size}]`;
|
|
64790
|
+
case "Struct":
|
|
64791
|
+
return "Struct";
|
|
64792
|
+
case "Variant":
|
|
64793
|
+
return `Variant.${value.type}`;
|
|
64794
|
+
case "Ref":
|
|
64795
|
+
return "Ref";
|
|
64796
|
+
default:
|
|
64797
|
+
return type.type;
|
|
64798
|
+
}
|
|
64799
|
+
}
|
|
64800
|
+
function ValueNode({
|
|
64801
|
+
type,
|
|
64802
|
+
value,
|
|
64803
|
+
label,
|
|
64804
|
+
depth
|
|
64805
|
+
}) {
|
|
64806
|
+
if (depth > 20) {
|
|
64807
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
|
|
64808
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
64809
|
+
label,
|
|
64810
|
+
":"
|
|
64811
|
+
] }),
|
|
64812
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "[max depth reached]" })
|
|
64813
|
+
] });
|
|
64814
|
+
}
|
|
64815
|
+
if (isPrimitive(type)) {
|
|
64816
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
|
|
64817
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
64818
|
+
label,
|
|
64819
|
+
":"
|
|
64820
|
+
] }),
|
|
64821
|
+
/* @__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) }),
|
|
64822
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "gray", variant: "subtle", children: type.type })
|
|
64823
|
+
] });
|
|
64824
|
+
}
|
|
64825
|
+
const typeLabel = getTypeLabel(type, value);
|
|
64826
|
+
if (type.type === "Array") {
|
|
64827
|
+
const items = value;
|
|
64828
|
+
const elementType = type.value;
|
|
64829
|
+
if (items.length === 0) {
|
|
64830
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
|
|
64831
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
64832
|
+
label,
|
|
64833
|
+
":"
|
|
64834
|
+
] }),
|
|
64835
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "[]" }),
|
|
64836
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "blue", variant: "subtle", children: "Array[0]" })
|
|
64837
|
+
] });
|
|
64838
|
+
}
|
|
64839
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
|
|
64840
|
+
/* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
64841
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
64842
|
+
label,
|
|
64843
|
+
":"
|
|
64844
|
+
] }),
|
|
64845
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "blue", variant: "subtle", children: typeLabel })
|
|
64846
|
+
] }),
|
|
64847
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: items.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
64848
|
+
react.Box,
|
|
64849
|
+
{
|
|
64850
|
+
py: 1,
|
|
64851
|
+
borderBottom: index2 < items.length - 1 ? "1px solid" : void 0,
|
|
64852
|
+
borderColor: "gray.700",
|
|
64853
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
64854
|
+
ValueNode,
|
|
64855
|
+
{
|
|
64856
|
+
type: elementType,
|
|
64857
|
+
value: item,
|
|
64858
|
+
label: `[${index2}]`,
|
|
64859
|
+
depth: depth + 1
|
|
64860
|
+
}
|
|
64861
|
+
)
|
|
64862
|
+
},
|
|
64863
|
+
index2
|
|
64864
|
+
)) })
|
|
64865
|
+
] }) });
|
|
64866
|
+
}
|
|
64867
|
+
if (type.type === "Struct") {
|
|
64868
|
+
const fields = type.value;
|
|
64869
|
+
const obj = value;
|
|
64870
|
+
if (fields.length === 0) {
|
|
64871
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
|
|
64872
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
64873
|
+
label,
|
|
64874
|
+
":"
|
|
64875
|
+
] }),
|
|
64876
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "{}" }),
|
|
64877
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "orange", variant: "subtle", children: "Struct" })
|
|
64878
|
+
] });
|
|
64879
|
+
}
|
|
64880
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
|
|
64881
|
+
/* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
64882
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
64883
|
+
label,
|
|
64884
|
+
":"
|
|
64885
|
+
] }),
|
|
64886
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "orange", variant: "subtle", children: typeLabel })
|
|
64887
|
+
] }),
|
|
64888
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: fields.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
64889
|
+
ValueNode,
|
|
64890
|
+
{
|
|
64891
|
+
type: field.type,
|
|
64892
|
+
value: obj[field.name],
|
|
64893
|
+
label: field.name,
|
|
64894
|
+
depth: depth + 1
|
|
64895
|
+
},
|
|
64896
|
+
field.name
|
|
64897
|
+
)) })
|
|
64898
|
+
] }) });
|
|
64899
|
+
}
|
|
64900
|
+
if (type.type === "Variant") {
|
|
64901
|
+
const cases = type.value;
|
|
64902
|
+
const variant = value;
|
|
64903
|
+
const activeCase = cases.find((c2) => c2.name === variant.type);
|
|
64904
|
+
if (!activeCase) {
|
|
64905
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
|
|
64906
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
64907
|
+
label,
|
|
64908
|
+
":"
|
|
64909
|
+
] }),
|
|
64910
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "red.400", children: [
|
|
64911
|
+
"Unknown variant: ",
|
|
64912
|
+
variant.type
|
|
64913
|
+
] })
|
|
64914
|
+
] });
|
|
64915
|
+
}
|
|
64916
|
+
if (activeCase.type.type === "Null") {
|
|
64917
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
|
|
64918
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
64919
|
+
label,
|
|
64920
|
+
":"
|
|
64921
|
+
] }),
|
|
64922
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.Badge, { size: "xs", colorPalette: "purple", variant: "subtle", children: [
|
|
64923
|
+
".",
|
|
64924
|
+
variant.type
|
|
64925
|
+
] })
|
|
64926
|
+
] });
|
|
64927
|
+
}
|
|
64928
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
|
|
64929
|
+
/* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
64930
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
64931
|
+
label,
|
|
64932
|
+
":"
|
|
64933
|
+
] }),
|
|
64934
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.Badge, { size: "xs", colorPalette: "purple", variant: "subtle", children: [
|
|
64935
|
+
".",
|
|
64936
|
+
variant.type
|
|
64937
|
+
] })
|
|
64938
|
+
] }),
|
|
64939
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
64940
|
+
ValueNode,
|
|
64941
|
+
{
|
|
64942
|
+
type: activeCase.type,
|
|
64943
|
+
value: variant.value,
|
|
64944
|
+
depth: depth + 1
|
|
64945
|
+
}
|
|
64946
|
+
) })
|
|
64947
|
+
] }) });
|
|
64948
|
+
}
|
|
64949
|
+
if (type.type === "Dict") {
|
|
64950
|
+
const map3 = value;
|
|
64951
|
+
const keyType = type.value.key;
|
|
64952
|
+
const valueType = type.value.value;
|
|
64953
|
+
if (map3.size === 0) {
|
|
64954
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
|
|
64955
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
64956
|
+
label,
|
|
64957
|
+
":"
|
|
64958
|
+
] }),
|
|
64959
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "Map{}" }),
|
|
64960
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "teal", variant: "subtle", children: "Dict[0]" })
|
|
64961
|
+
] });
|
|
64962
|
+
}
|
|
64963
|
+
const entries = Array.from(map3.entries());
|
|
64964
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
|
|
64965
|
+
/* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
64966
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
64967
|
+
label,
|
|
64968
|
+
":"
|
|
64969
|
+
] }),
|
|
64970
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "teal", variant: "subtle", children: typeLabel })
|
|
64971
|
+
] }),
|
|
64972
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: entries.map(([k2, v3], i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
64973
|
+
react.Box,
|
|
64974
|
+
{
|
|
64975
|
+
py: 2,
|
|
64976
|
+
borderBottom: i < entries.length - 1 ? "1px solid" : void 0,
|
|
64977
|
+
borderColor: "gray.700",
|
|
64978
|
+
children: [
|
|
64979
|
+
/* @__PURE__ */ jsxRuntime.jsx(ValueNode, { type: keyType, value: k2, depth: depth + 1 }),
|
|
64980
|
+
/* @__PURE__ */ jsxRuntime.jsx(ValueNode, { type: valueType, value: v3, depth: depth + 1 })
|
|
64981
|
+
]
|
|
64982
|
+
},
|
|
64983
|
+
i
|
|
64984
|
+
)) })
|
|
64985
|
+
] }) });
|
|
64986
|
+
}
|
|
64987
|
+
if (type.type === "Set") {
|
|
64988
|
+
const set3 = value;
|
|
64989
|
+
const elementType = type.value;
|
|
64990
|
+
if (set3.size === 0) {
|
|
64991
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
|
|
64992
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
64993
|
+
label,
|
|
64994
|
+
":"
|
|
64995
|
+
] }),
|
|
64996
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "Set{}" }),
|
|
64997
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "pink", variant: "subtle", children: "Set[0]" })
|
|
64998
|
+
] });
|
|
64999
|
+
}
|
|
65000
|
+
const items = Array.from(set3);
|
|
65001
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
|
|
65002
|
+
/* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
65003
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
65004
|
+
label,
|
|
65005
|
+
":"
|
|
65006
|
+
] }),
|
|
65007
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "pink", variant: "subtle", children: typeLabel })
|
|
65008
|
+
] }),
|
|
65009
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
65010
|
+
react.Box,
|
|
65011
|
+
{
|
|
65012
|
+
py: 1,
|
|
65013
|
+
borderBottom: i < items.length - 1 ? "1px solid" : void 0,
|
|
65014
|
+
borderColor: "gray.700",
|
|
65015
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
65016
|
+
ValueNode,
|
|
65017
|
+
{
|
|
65018
|
+
type: elementType,
|
|
65019
|
+
value: item,
|
|
65020
|
+
depth: depth + 1
|
|
65021
|
+
}
|
|
65022
|
+
)
|
|
65023
|
+
},
|
|
65024
|
+
i
|
|
65025
|
+
)) })
|
|
65026
|
+
] }) });
|
|
65027
|
+
}
|
|
65028
|
+
if (type.type === "Ref") {
|
|
65029
|
+
const ref = value;
|
|
65030
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
|
|
65031
|
+
/* @__PURE__ */ jsxRuntime.jsxs("summary", { style: { cursor: "pointer", padding: "2px 0", display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
65032
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
65033
|
+
label,
|
|
65034
|
+
":"
|
|
65035
|
+
] }),
|
|
65036
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "red", variant: "subtle", children: "Ref" })
|
|
65037
|
+
] }),
|
|
65038
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { pl: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
65039
|
+
ValueNode,
|
|
65040
|
+
{
|
|
65041
|
+
type: type.value,
|
|
65042
|
+
value: ref.value,
|
|
65043
|
+
depth: depth + 1
|
|
65044
|
+
}
|
|
65045
|
+
) })
|
|
65046
|
+
] }) });
|
|
65047
|
+
}
|
|
65048
|
+
if (type.type === "Function" || type.type === "AsyncFunction") {
|
|
65049
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
|
|
65050
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
65051
|
+
label,
|
|
65052
|
+
":"
|
|
65053
|
+
] }),
|
|
65054
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: "[function]" }),
|
|
65055
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Badge, { size: "xs", colorPalette: "gray", variant: "subtle", children: type.type })
|
|
65056
|
+
] });
|
|
65057
|
+
}
|
|
65058
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { py: 0.5, display: "flex", alignItems: "center", gap: 2, children: [
|
|
65059
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "purple.400", fontWeight: "medium", children: [
|
|
65060
|
+
label,
|
|
65061
|
+
":"
|
|
65062
|
+
] }),
|
|
65063
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", color: "gray.500", children: [
|
|
65064
|
+
"[",
|
|
65065
|
+
type.type,
|
|
65066
|
+
"]"
|
|
65067
|
+
] })
|
|
65068
|
+
] });
|
|
65069
|
+
}
|
|
65070
|
+
function EastValueViewer({ type, value }) {
|
|
65071
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
65072
|
+
react.Box,
|
|
65073
|
+
{
|
|
65074
|
+
layerStyle: "surface.code.dark",
|
|
65075
|
+
fontFamily: "mono",
|
|
65076
|
+
fontSize: "sm",
|
|
65077
|
+
p: 4,
|
|
65078
|
+
overflow: "auto",
|
|
65079
|
+
maxHeight: "100%",
|
|
65080
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ValueNode, { type, value, depth: 0 })
|
|
65081
|
+
}
|
|
65082
|
+
);
|
|
65083
|
+
}
|
|
65049
65084
|
exports.BindPlatform = BindPlatform;
|
|
65050
65085
|
exports.BindRuntime = BindRuntime;
|
|
65051
65086
|
exports.DataTaskPreview = DataTaskPreview;
|