@tangle-network/sandbox-ui 0.117.3 → 0.119.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { r as modelBrandFor, t as ModelBrandStack } from "./model-brand-hMyDTUqB
2
2
  import { a as buildWorkflowGraph, c as triggerNodeIndex, d as providerLabel, f as shortModel, g as fmtTokens, h as fmtDuration, l as wfEdgeId, m as fmtCost, o as isStructuralKind, p as clampPreview, t as COMPACT_NODE_SIZE, u as worstSeverity } from "./model-I-NIxeM-.js";
3
3
  import { t as ProviderIcon } from "./provider-logo-BiuiO_c2.js";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
- import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
5
+ import { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
6
6
  import { AlertTriangle, Bell, Box, Cable, Camera, Circle, Clock, Code, GitBranch, Maximize2, Minimize2, Plus, Repeat, ScanSearch, Sparkles, UserCheck, Webhook, X, Zap } from "lucide-react";
7
7
  import { Background, BaseEdge, Controls, EdgeLabelRenderer, Handle, MarkerType, Panel, Position, ReactFlow, getSmoothStepPath, getViewportForBounds, useEdgesState, useNodesState } from "@xyflow/react";
8
8
  import "@xyflow/react/dist/style.css";
@@ -949,21 +949,34 @@ const lerp = (a, b, t) => a + (b - a) * t;
949
949
  /** The layout tween's easing — gentle into and out of the motion, so neither
950
950
  * end of the morph reads as a snap. */
951
951
  const easeInOutCubic = (t) => t < .5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;
952
- /** Tracks the app's dark/light class so React Flow's chrome (edges, controls,
953
- * background) themes with the rest of the app. */
954
- function useColorMode() {
955
- const [mode, setMode] = useState(() => typeof document !== "undefined" && document.documentElement.classList.contains("dark") ? "dark" : "light");
956
- useEffect(() => {
957
- const el = document.documentElement;
958
- const update = () => setMode(el.classList.contains("dark") ? "dark" : "light");
952
+ /** React Flow adds its own .light/.dark class below the graph wrapper. Read
953
+ * that wrapper's inherited scheme so a nested WorkspaceLayout theme wins over
954
+ * the page root without React Flow's class influencing the answer. */
955
+ function currentColorMode(anchor) {
956
+ if (typeof document === "undefined" || typeof window === "undefined") return "light";
957
+ const scheme = window.getComputedStyle(anchor ?? document.documentElement).colorScheme;
958
+ if (scheme.startsWith("dark")) return "dark";
959
+ if (scheme.startsWith("light")) return "light";
960
+ return (anchor ?? document.documentElement).closest(".dark") ? "dark" : "light";
961
+ }
962
+ function useColorMode(wrapperRef, hasGraph) {
963
+ const [mode, setMode] = useState(() => currentColorMode(null));
964
+ useLayoutEffect(() => {
965
+ const anchor = hasGraph ? wrapperRef.current : null;
966
+ const update = () => setMode(currentColorMode(anchor));
959
967
  update();
960
968
  const observer = new MutationObserver(update);
961
- observer.observe(el, {
969
+ for (let el = anchor ?? document.documentElement; el; el = el.parentElement) observer.observe(el, {
962
970
  attributes: true,
963
- attributeFilter: ["class"]
971
+ attributeFilter: [
972
+ "class",
973
+ "data-theme",
974
+ "data-sandbox-theme",
975
+ "style"
976
+ ]
964
977
  });
965
978
  return () => observer.disconnect();
966
- }, []);
979
+ }, [wrapperRef, hasGraph]);
967
980
  return mode;
968
981
  }
969
982
  /** Flow direction for the current graph, so the node component can place its
@@ -1608,7 +1621,6 @@ function WorkflowGraph({ yaml, variant = "full", direction = "LR", defaultCompac
1608
1621
  const insertAtNode = editable ? onNodeInsert : void 0;
1609
1622
  const addTrigger = editable ? onTriggerAdd : void 0;
1610
1623
  const deleteTrigger = editable ? onTriggerDelete : void 0;
1611
- const colorMode = useColorMode();
1612
1624
  const isPreview = variant === "preview";
1613
1625
  const [userCompact, setUserCompact] = useState(defaultCompact ?? nodeState === void 0);
1614
1626
  /**
@@ -1646,6 +1658,7 @@ function WorkflowGraph({ yaml, variant = "full", direction = "LR", defaultCompac
1646
1658
  insertArmed,
1647
1659
  declaredEdges
1648
1660
  ]);
1661
+ const colorMode = useColorMode(wrapperRef, !structural.error && structural.nodes.length > 0);
1649
1662
  const nodeBoxes = useMemo(() => structural.nodes.map((node) => ({
1650
1663
  x: node.position.x,
1651
1664
  y: node.position.y,
package/dist/chat.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as ThinkingIndicator, c as createFetchTransport, d as AgentProfilePicker, f as DEFAULT_REASONING_LEVEL_OPTIONS, i as MessageList, l as modelProvider, m as ReasoningLevelPicker, n as ChatContainer, o as UserMessage, p as HARNESS_REASONING_OPTIONS, r as ChatMessage, s as ArtifactAgentDock, t as AgentTimeline, u as snapHarnessToModel } from "./chat-Ci6Xi1rd.js";
1
+ import { a as ThinkingIndicator, c as createFetchTransport, d as AgentProfilePicker, f as DEFAULT_REASONING_LEVEL_OPTIONS, i as MessageList, l as modelProvider, m as ReasoningLevelPicker, n as ChatContainer, o as UserMessage, p as HARNESS_REASONING_OPTIONS, r as ChatMessage, s as ArtifactAgentDock, t as AgentTimeline, u as snapHarnessToModel } from "./chat-Xqhcoxmw.js";
2
2
  export { AgentProfilePicker, AgentTimeline, ArtifactAgentDock, ChatContainer, ChatMessage, DEFAULT_REASONING_LEVEL_OPTIONS, HARNESS_REASONING_OPTIONS, MessageList, ReasoningLevelPicker, ThinkingIndicator, UserMessage, createFetchTransport, modelProvider, snapHarnessToModel };
@@ -1,2 +1,2 @@
1
- import { t as AgentMessagingConnection } from "./connections-DDRGYDvF.js";
1
+ import { t as AgentMessagingConnection } from "./connections-C5DxYxvz.js";
2
2
  export { AgentMessagingConnection };
@@ -2,8 +2,8 @@ import { t as cn$1 } from "./utils-DzWbktWG.js";
2
2
  import { Badge, Button, EmptyState, Input } from "@tangle-network/ui/primitives";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { useEffect, useMemo, useRef, useState } from "react";
5
- import { focusField } from "@tangle-network/ui/utils";
6
5
  import { Blocks, Check, ChevronDown, ChevronRight, Copy, Search } from "lucide-react";
6
+ import { focusField } from "@tangle-network/ui/utils";
7
7
  //#region src/connectors/integration-step-yaml.ts
8
8
  function asSchemaObject(value) {
9
9
  return typeof value === "object" && value !== null ? value : null;
@@ -1,4 +1,4 @@
1
- import { Wt as Logo, o as Button$1 } from "./primitives-BnVvXgcl.js";
1
+ import { Wt as Logo, o as Button$1 } from "./primitives-BQGtwZX3.js";
2
2
  import { t as cn$1 } from "./utils-DzWbktWG.js";
3
3
  import { n as MOTION_SURFACE, r as MOTION_TRAVEL, t as MOTION_CONTROL } from "./motion-DkyBRJb9.js";
4
4
  import { i as moonshot_default } from "./model-brand-hMyDTUqB.js";
@@ -7,9 +7,9 @@ import { Avatar, AvatarFallback, AvatarImage, Badge, Button, DropdownMenu, Dropd
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  import * as React$1 from "react";
9
9
  import { useEffect, useRef, useState } from "react";
10
- import { focusField, focusFieldWithin, focusRing, focusRingInset, timeAgo } from "@tangle-network/ui/utils";
11
10
  import { createPortal } from "react-dom";
12
11
  import { Activity, BarChart2, Bell, Bot, Box, Camera, Check, CheckCircle2, ChevronDown, ChevronLeft, ChevronRight, Clock, Code2, Copy, Cpu, DollarSign, Download, ExternalLink, File, FileEdit, FilePlus, FileText, GitBranch, GitCommit, Globe, HardDrive, Key, Layers, Loader2, MemoryStick, MessageSquare, Monitor, MoreHorizontal, MoreVertical, Network, PanelLeft, Play, Plug, Plus, Power, PowerOff, RefreshCw, RotateCcw, Server, Settings, ShieldAlert, Skull, Terminal, Timer, Trash2, User, Users, Wrench, X, XCircle } from "lucide-react";
12
+ import { focusField, focusFieldWithin, focusRing, focusRingInset, timeAgo } from "@tangle-network/ui/utils";
13
13
  import * as Select$1 from "@radix-ui/react-select";
14
14
  //#region src/dashboard/sidebar-context.tsx
15
15
  const PANEL_OPEN_KEY = "sandbox-sidebar-panel-open";
package/dist/dashboard.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as SidebarRailNav, A as ResourceMeter, B as RailFlyout, C as InvoiceTable, D as canAdminSandbox, E as SandboxCard, F as CreditBalance, G as Sidebar, H as RailModeButton, I as ProfileAvatar, J as SidebarPanelContent, K as SidebarContent, L as RailButton, M as INSUFFICIENT_BALANCE_CODE, N as OutOfCreditsModal, O as ActivityFeed, P as parseInsufficientBalance, Q as SidebarRailHeader, R as RailCollapseToggle, S as PlanCards, T as NewSandboxCard, U as RailSeparator, V as RailHeader, W as RailThemeToggle, X as SidebarRail, Y as SidebarPanelHeader, Z as SidebarRailFooter, _ as HarnessPicker, a as ProcessList, at as SIDEBAR_TOTAL_WIDTH, b as HarnessLogo, c as UsageSummary, d as MetricAreaChart, et as RailTooltip, f as ProfileComparison, g as HARNESS_OPTIONS, h as DashboardLayout, i as NetworkConfig, it as SIDEBAR_RAIL_WIDTH, j as ClusterStatusBar, k as ResourceSnapshot, l as SystemLogsViewer, m as SidebarLayout, n as SnapshotList, nt as SIDEBAR_PANEL_WIDTH, o as PortsList, ot as SidebarProvider, p as ProfileSelector, q as SidebarPanel, r as BackendConfig, rt as SIDEBAR_RAIL_LABELED_WIDTH, s as GitPanel, st as useSidebar, t as PromoBanner, tt as SIDEBAR_MOBILE_WIDTH, u as VariantList, v as chatCapableHarnesses, w as SandboxTable, x as BackendSelector, y as HARNESS_BRAND, z as RailExpandable } from "./dashboard-DdUTq0so.js";
1
+ import { $ as SidebarRailNav, A as ResourceMeter, B as RailFlyout, C as InvoiceTable, D as canAdminSandbox, E as SandboxCard, F as CreditBalance, G as Sidebar, H as RailModeButton, I as ProfileAvatar, J as SidebarPanelContent, K as SidebarContent, L as RailButton, M as INSUFFICIENT_BALANCE_CODE, N as OutOfCreditsModal, O as ActivityFeed, P as parseInsufficientBalance, Q as SidebarRailHeader, R as RailCollapseToggle, S as PlanCards, T as NewSandboxCard, U as RailSeparator, V as RailHeader, W as RailThemeToggle, X as SidebarRail, Y as SidebarPanelHeader, Z as SidebarRailFooter, _ as HarnessPicker, a as ProcessList, at as SIDEBAR_TOTAL_WIDTH, b as HarnessLogo, c as UsageSummary, d as MetricAreaChart, et as RailTooltip, f as ProfileComparison, g as HARNESS_OPTIONS, h as DashboardLayout, i as NetworkConfig, it as SIDEBAR_RAIL_WIDTH, j as ClusterStatusBar, k as ResourceSnapshot, l as SystemLogsViewer, m as SidebarLayout, n as SnapshotList, nt as SIDEBAR_PANEL_WIDTH, o as PortsList, ot as SidebarProvider, p as ProfileSelector, q as SidebarPanel, r as BackendConfig, rt as SIDEBAR_RAIL_LABELED_WIDTH, s as GitPanel, st as useSidebar, t as PromoBanner, tt as SIDEBAR_MOBILE_WIDTH, u as VariantList, v as chatCapableHarnesses, w as SandboxTable, x as BackendSelector, y as HARNESS_BRAND, z as RailExpandable } from "./dashboard-CnGK2S3A.js";
2
2
  import { n as canonicalModelId, r as modelBrandFor, t as ModelBrandStack } from "./model-brand-hMyDTUqB.js";
3
3
  import { a as formatPrice, i as PricingPage, n as TemplateCard, o as BillingDashboard, r as UsageChart, t as InfoPanel } from "./info-panel-C9cqDzOL.js";
4
4
  export { ActivityFeed, BackendConfig, BackendSelector, BillingDashboard, ClusterStatusBar, CreditBalance, DashboardLayout, GitPanel, HARNESS_BRAND, HARNESS_OPTIONS, HarnessLogo, HarnessPicker, INSUFFICIENT_BALANCE_CODE, InfoPanel, InvoiceTable, MetricAreaChart, ModelBrandStack, NetworkConfig, NewSandboxCard, OutOfCreditsModal, PlanCards, PortsList, PricingPage, ProcessList, ProfileAvatar, ProfileComparison, ProfileSelector, PromoBanner, RailButton, RailCollapseToggle, RailExpandable, RailFlyout, RailHeader, RailModeButton, RailSeparator, RailThemeToggle, RailTooltip, ResourceMeter, ResourceSnapshot, SIDEBAR_MOBILE_WIDTH, SIDEBAR_PANEL_WIDTH, SIDEBAR_RAIL_LABELED_WIDTH, SIDEBAR_RAIL_WIDTH, SIDEBAR_TOTAL_WIDTH, SandboxCard, SandboxTable, Sidebar, SidebarContent, SidebarLayout, SidebarPanel, SidebarPanelContent, SidebarPanelHeader, SidebarProvider, SidebarRail, SidebarRailFooter, SidebarRailHeader, SidebarRailNav, SnapshotList, SystemLogsViewer, TemplateCard, UsageChart, UsageSummary, VariantList, canAdminSandbox, canonicalModelId, chatCapableHarnesses, formatPrice, modelBrandFor, parseInsufficientBalance, useSidebar };