@tangle-network/sandbox-ui 0.13.0 → 0.15.1

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.
Files changed (106) hide show
  1. package/dist/auth.d.ts +1 -74
  2. package/dist/auth.js +1 -4
  3. package/dist/chat.d.ts +1 -136
  4. package/dist/chat.js +2 -15
  5. package/dist/chunk-2BUPSB7O.js +0 -0
  6. package/dist/chunk-3J6FG3FJ.js +18 -0
  7. package/dist/chunk-76IQLPW2.js +206 -0
  8. package/dist/chunk-7ZA5SEK3.js +239 -0
  9. package/dist/{chunk-ESVYBDGA.js → chunk-AG7QDC2Q.js} +182 -2
  10. package/dist/chunk-AHBZCBDO.js +2960 -0
  11. package/dist/chunk-AZ3AWMTM.js +8 -0
  12. package/dist/chunk-CMY7W45U.js +380 -0
  13. package/dist/{chunk-QMU2PWOU.js → chunk-DNZ4DTNA.js} +71 -17
  14. package/dist/chunk-EI44GEQ5.js +6 -0
  15. package/dist/{chunk-5OQ27N57.js → chunk-GPT7VKK6.js} +34 -38
  16. package/dist/chunk-JBGKGLD7.js +16 -0
  17. package/dist/chunk-NJNME4J4.js +14 -0
  18. package/dist/chunk-QPAJR74X.js +20 -0
  19. package/dist/chunk-TK46XFLM.js +28 -0
  20. package/dist/chunk-WID73FPH.js +89 -0
  21. package/dist/chunk-YVXK4XRO.js +30 -0
  22. package/dist/dashboard.d.ts +538 -4
  23. package/dist/dashboard.js +15 -886
  24. package/dist/editor.d.ts +1 -120
  25. package/dist/editor.js +1 -5
  26. package/dist/files.d.ts +1 -129
  27. package/dist/files.js +2 -7
  28. package/dist/globals.css +5 -1265
  29. package/dist/hooks.d.ts +114 -11
  30. package/dist/hooks.js +17 -88
  31. package/dist/index.d.ts +24 -99
  32. package/dist/index.js +247 -252
  33. package/dist/markdown.d.ts +1 -29
  34. package/dist/markdown.js +2 -2
  35. package/dist/openui.d.ts +8 -115
  36. package/dist/openui.js +1 -6
  37. package/dist/pages.d.ts +1 -2
  38. package/dist/pages.js +68 -66
  39. package/dist/primitives.d.ts +14 -49
  40. package/dist/primitives.js +69 -77
  41. package/dist/run.d.ts +1 -14
  42. package/dist/run.js +2 -22
  43. package/dist/sdk-hooks.d.ts +3 -283
  44. package/dist/sdk-hooks.js +10 -14
  45. package/dist/stores.d.ts +2 -14
  46. package/dist/stores.js +11 -39
  47. package/dist/styles.css +5 -1265
  48. package/dist/{usage-chart-CPTcNlGs.d.ts → template-card-UhV3pmRC.d.ts} +16 -1
  49. package/dist/terminal.js +39 -2
  50. package/dist/types.d.ts +11 -8
  51. package/dist/types.js +1 -0
  52. package/dist/utils.d.ts +1 -44
  53. package/dist/utils.js +6 -12
  54. package/dist/workspace.d.ts +5 -10
  55. package/dist/workspace.js +3 -19
  56. package/package.json +23 -54
  57. package/dist/active-sessions-store-CeOmXgv5.d.ts +0 -85
  58. package/dist/artifact-pane-Bh45Ssco.d.ts +0 -24
  59. package/dist/branding-DCi5VEik.d.ts +0 -13
  60. package/dist/button-CMQuQEW_.d.ts +0 -17
  61. package/dist/chat-container-f4yEs6KN.d.ts +0 -106
  62. package/dist/chunk-34A66VBG.js +0 -214
  63. package/dist/chunk-34I7UFSX.js +0 -92
  64. package/dist/chunk-36QY2W5G.js +0 -802
  65. package/dist/chunk-4CLN43XT.js +0 -45
  66. package/dist/chunk-54SQQMMM.js +0 -156
  67. package/dist/chunk-66EZOYZR.js +0 -102
  68. package/dist/chunk-BX6AQMUS.js +0 -183
  69. package/dist/chunk-DI3NZ5ZX.js +0 -192
  70. package/dist/chunk-DPGIXDAI.js +0 -220
  71. package/dist/chunk-DXMIEK4K.js +0 -1426
  72. package/dist/chunk-GSZA3TSY.js +0 -79
  73. package/dist/chunk-HB5Y37YU.js +0 -54
  74. package/dist/chunk-LQNEZDRM.js +0 -109
  75. package/dist/chunk-MA7YKRUP.js +0 -131
  76. package/dist/chunk-MKTSMWVD.js +0 -109
  77. package/dist/chunk-MQXABZTB.js +0 -1348
  78. package/dist/chunk-MT5FJ3ZT.js +0 -186
  79. package/dist/chunk-NKUPJC34.js +0 -2070
  80. package/dist/chunk-OEX7NZE3.js +0 -321
  81. package/dist/chunk-OKLQVY3Y.js +0 -139
  82. package/dist/chunk-Q56BYXQF.js +0 -61
  83. package/dist/chunk-QD4QE5P5.js +0 -40
  84. package/dist/chunk-QDH5GEGY.js +0 -630
  85. package/dist/chunk-QID2OOMG.js +0 -133
  86. package/dist/chunk-RQHJBTEU.js +0 -10
  87. package/dist/chunk-T7HMZEVO.js +0 -216
  88. package/dist/chunk-U6QTHMY6.js +0 -1290
  89. package/dist/chunk-US6JKJKH.js +0 -124
  90. package/dist/chunk-VX3XOUEB.js +0 -63
  91. package/dist/chunk-XLG757B6.js +0 -933
  92. package/dist/chunk-ZMNSRDMH.js +0 -127
  93. package/dist/chunk-ZNCEM5CD.js +0 -316
  94. package/dist/document-editor-pane-A70-EhdQ.d.ts +0 -124
  95. package/dist/document-editor-pane-TLPVRBBU.js +0 -11
  96. package/dist/expanded-tool-detail-Dh99mcbY.d.ts +0 -63
  97. package/dist/file-tabs-BLfxfmAH.d.ts +0 -51
  98. package/dist/parts-CyGkM6Fp.d.ts +0 -50
  99. package/dist/run-CtFZ6s-D.d.ts +0 -41
  100. package/dist/sidebar-drop-zone-tDBsuOH5.d.ts +0 -301
  101. package/dist/sidecar-CFU2W9j1.d.ts +0 -8
  102. package/dist/template-card-BAtvcAkU.d.ts +0 -18
  103. package/dist/tool-call-feed-Bs3MyQMT.d.ts +0 -68
  104. package/dist/tool-display-Ct9nFAzJ.d.ts +0 -32
  105. package/dist/use-sandbox-metrics-B64diPqN.d.ts +0 -141
  106. package/dist/variant-list-BrHYcBCk.d.ts +0 -540
@@ -1,321 +0,0 @@
1
- // src/stores/active-sessions-store.ts
2
- import { useStore } from "@nanostores/react";
3
- import { atom } from "nanostores";
4
- import { useMemo } from "react";
5
- var INITIAL_STATE = {
6
- sessions: {},
7
- lastUpdatedAt: 0
8
- };
9
- var STATUS_PRIORITY = {
10
- running: 0,
11
- error: 1,
12
- "attention-needed": 2,
13
- idle: 3
14
- };
15
- var DEFAULT_RECORD = {
16
- status: "idle",
17
- isRunning: false,
18
- isForeground: false,
19
- needsAttention: false,
20
- connectionState: "disconnected",
21
- reconnectState: "idle",
22
- transportMode: null,
23
- lastError: null,
24
- lastEventAt: null
25
- };
26
- var activeSessionsAtom = atom(INITIAL_STATE);
27
- var foregroundSessionId = null;
28
- function createRecord(options, now) {
29
- return {
30
- sessionId: options.sessionId,
31
- projectId: options.projectId ?? null,
32
- projectLabel: options.projectLabel,
33
- title: options.title,
34
- href: options.href,
35
- registeredAt: now,
36
- lastActivityAt: now,
37
- metadata: options.metadata,
38
- ...DEFAULT_RECORD,
39
- isForeground: options.sessionId === foregroundSessionId
40
- };
41
- }
42
- function resolveStatus(session) {
43
- if (session.isRunning) return "running";
44
- if (session.lastError || session.reconnectState === "failed") return "error";
45
- if (session.needsAttention) return "attention-needed";
46
- return "idle";
47
- }
48
- function normalizeSession(session) {
49
- return {
50
- ...session,
51
- status: resolveStatus(session)
52
- };
53
- }
54
- function updateSession(sessionId, updater) {
55
- const current = activeSessionsAtom.get();
56
- const existing = current.sessions[sessionId];
57
- if (!existing) return;
58
- const now = Date.now();
59
- activeSessionsAtom.set({
60
- sessions: {
61
- ...current.sessions,
62
- [sessionId]: normalizeSession(updater(existing, now))
63
- },
64
- lastUpdatedAt: now
65
- });
66
- }
67
- function registerActiveSession(options) {
68
- const now = Date.now();
69
- const current = activeSessionsAtom.get();
70
- const existing = current.sessions[options.sessionId];
71
- activeSessionsAtom.set({
72
- sessions: {
73
- ...current.sessions,
74
- [options.sessionId]: normalizeSession(
75
- existing ? {
76
- ...existing,
77
- projectId: existing.projectId ?? options.projectId ?? null,
78
- projectLabel: options.projectLabel ?? existing.projectLabel,
79
- title: options.title ?? existing.title,
80
- href: options.href ?? existing.href,
81
- metadata: options.metadata ?? existing.metadata,
82
- lastActivityAt: now,
83
- isForeground: options.sessionId === foregroundSessionId || existing.isForeground
84
- } : createRecord(options, now)
85
- )
86
- },
87
- lastUpdatedAt: now
88
- });
89
- }
90
- function unregisterActiveSession(sessionId) {
91
- const current = activeSessionsAtom.get();
92
- if (!current.sessions[sessionId]) return;
93
- const { [sessionId]: _removed, ...remaining } = current.sessions;
94
- if (foregroundSessionId === sessionId) {
95
- foregroundSessionId = null;
96
- }
97
- activeSessionsAtom.set({
98
- sessions: remaining,
99
- lastUpdatedAt: Date.now()
100
- });
101
- }
102
- function setForegroundActiveSession(sessionId) {
103
- foregroundSessionId = sessionId;
104
- const current = activeSessionsAtom.get();
105
- const now = Date.now();
106
- let changed = false;
107
- const sessions = Object.fromEntries(
108
- Object.entries(current.sessions).map(([id, session]) => {
109
- const isForeground = id === sessionId;
110
- if (session.isForeground !== isForeground) {
111
- changed = true;
112
- }
113
- return [
114
- id,
115
- {
116
- ...session,
117
- isForeground,
118
- lastActivityAt: isForeground ? now : session.lastActivityAt
119
- }
120
- ];
121
- })
122
- );
123
- if (!changed) return;
124
- activeSessionsAtom.set({
125
- sessions,
126
- lastUpdatedAt: now
127
- });
128
- }
129
- function updateActiveSessionMeta(sessionId, meta) {
130
- updateSession(sessionId, (session, now) => ({
131
- ...session,
132
- ...meta,
133
- lastActivityAt: now
134
- }));
135
- }
136
- function setActiveSessionConnection(sessionId, options) {
137
- updateSession(sessionId, (session, now) => ({
138
- ...session,
139
- connectionState: options.connectionState,
140
- reconnectState: options.reconnectState ?? session.reconnectState,
141
- transportMode: options.transportMode ?? session.transportMode,
142
- lastError: options.lastError === void 0 ? session.lastError : options.lastError,
143
- lastEventAt: options.lastEventAt ?? session.lastEventAt,
144
- lastActivityAt: now
145
- }));
146
- }
147
- function setActiveSessionRunning(sessionId, isRunning, options) {
148
- updateSession(sessionId, (session, now) => ({
149
- ...session,
150
- isRunning,
151
- needsAttention: isRunning ? false : session.needsAttention,
152
- lastError: isRunning ? null : session.lastError,
153
- lastEventAt: options?.lastEventAt ?? session.lastEventAt,
154
- lastActivityAt: now
155
- }));
156
- }
157
- function setActiveSessionAttention(sessionId, needsAttention, options) {
158
- updateSession(sessionId, (session, now) => ({
159
- ...session,
160
- needsAttention,
161
- isRunning: needsAttention ? false : session.isRunning,
162
- lastEventAt: options?.lastEventAt ?? session.lastEventAt,
163
- lastActivityAt: now
164
- }));
165
- }
166
- function setActiveSessionError(sessionId, error) {
167
- updateSession(sessionId, (session, now) => ({
168
- ...session,
169
- isRunning: false,
170
- needsAttention: false,
171
- lastError: error,
172
- reconnectState: error ? "failed" : "idle",
173
- connectionState: error ? "error" : session.connectionState,
174
- lastEventAt: now,
175
- lastActivityAt: now
176
- }));
177
- }
178
- function bumpActiveSessionActivity(sessionId, options) {
179
- updateSession(sessionId, (session, now) => ({
180
- ...session,
181
- lastEventAt: options?.lastEventAt ?? session.lastEventAt ?? now,
182
- lastActivityAt: now
183
- }));
184
- }
185
- function resetActiveSessions() {
186
- foregroundSessionId = null;
187
- activeSessionsAtom.set(INITIAL_STATE);
188
- }
189
- function getAllActiveSessions(state) {
190
- return Object.values(state.sessions);
191
- }
192
- function getActiveSession(state, sessionId) {
193
- return state.sessions[sessionId] ?? null;
194
- }
195
- function getSessionsForProject(state, projectId) {
196
- return Object.values(state.sessions).filter((session) => session.projectId === projectId);
197
- }
198
- function getSessionsForNavbar(state, projectId) {
199
- const sessions = projectId == null ? Object.values(state.sessions) : getSessionsForProject(state, projectId);
200
- return [...sessions].sort((left, right) => {
201
- if (left.isForeground !== right.isForeground) {
202
- return Number(right.isForeground) - Number(left.isForeground);
203
- }
204
- const statusDiff = STATUS_PRIORITY[left.status] - STATUS_PRIORITY[right.status];
205
- if (statusDiff !== 0) {
206
- return statusDiff;
207
- }
208
- return right.lastActivityAt - left.lastActivityAt;
209
- });
210
- }
211
- function getSessionsByActivity(state) {
212
- return [...Object.values(state.sessions)].sort(
213
- (left, right) => right.lastActivityAt - left.lastActivityAt
214
- );
215
- }
216
- function getTotalRunningSessionCount(state) {
217
- return Object.values(state.sessions).filter((session) => session.isRunning).length;
218
- }
219
- function hasBackgroundRunningSessions(state) {
220
- return Object.values(state.sessions).some(
221
- (session) => session.isRunning && !session.isForeground
222
- );
223
- }
224
- function getAllProjectActivity(state) {
225
- const grouped = /* @__PURE__ */ new Map();
226
- for (const session of Object.values(state.sessions)) {
227
- if (session.projectId == null) continue;
228
- const existing = grouped.get(session.projectId);
229
- if (existing) {
230
- existing.activeSessionCount += 1;
231
- existing.lastActivityAt = Math.max(existing.lastActivityAt, session.lastActivityAt);
232
- if (session.isRunning) {
233
- existing.runningSessionIds.push(session.sessionId);
234
- }
235
- if (!existing.projectLabel && session.projectLabel) {
236
- existing.projectLabel = session.projectLabel;
237
- }
238
- continue;
239
- }
240
- grouped.set(session.projectId, {
241
- projectId: session.projectId,
242
- projectLabel: session.projectLabel,
243
- activeSessionCount: 1,
244
- runningSessionIds: session.isRunning ? [session.sessionId] : [],
245
- lastActivityAt: session.lastActivityAt
246
- });
247
- }
248
- return [...grouped.values()].sort((left, right) => right.lastActivityAt - left.lastActivityAt);
249
- }
250
- function useActiveSessionsState() {
251
- return useStore(activeSessionsAtom);
252
- }
253
- function useActiveSessions() {
254
- const state = useStore(activeSessionsAtom);
255
- return useMemo(() => getAllActiveSessions(state), [state]);
256
- }
257
- function useActiveSession(sessionId) {
258
- const state = useStore(activeSessionsAtom);
259
- return useMemo(
260
- () => sessionId ? getActiveSession(state, sessionId) : null,
261
- [sessionId, state]
262
- );
263
- }
264
- function useProjectSessions(projectId) {
265
- const state = useStore(activeSessionsAtom);
266
- return useMemo(
267
- () => projectId == null ? [] : getSessionsForProject(state, projectId),
268
- [projectId, state]
269
- );
270
- }
271
- function useNavbarSessions(projectId) {
272
- const state = useStore(activeSessionsAtom);
273
- return useMemo(() => getSessionsForNavbar(state, projectId), [projectId, state]);
274
- }
275
- function useSessionsByActivity() {
276
- const state = useStore(activeSessionsAtom);
277
- return useMemo(() => getSessionsByActivity(state), [state]);
278
- }
279
- function useProjectActivity() {
280
- const state = useStore(activeSessionsAtom);
281
- return useMemo(() => getAllProjectActivity(state), [state]);
282
- }
283
- function useTotalRunningSessions() {
284
- const state = useStore(activeSessionsAtom);
285
- return useMemo(() => getTotalRunningSessionCount(state), [state]);
286
- }
287
- function useHasBackgroundRunningSessions() {
288
- const state = useStore(activeSessionsAtom);
289
- return useMemo(() => hasBackgroundRunningSessions(state), [state]);
290
- }
291
-
292
- export {
293
- activeSessionsAtom,
294
- registerActiveSession,
295
- unregisterActiveSession,
296
- setForegroundActiveSession,
297
- updateActiveSessionMeta,
298
- setActiveSessionConnection,
299
- setActiveSessionRunning,
300
- setActiveSessionAttention,
301
- setActiveSessionError,
302
- bumpActiveSessionActivity,
303
- resetActiveSessions,
304
- getAllActiveSessions,
305
- getActiveSession,
306
- getSessionsForProject,
307
- getSessionsForNavbar,
308
- getSessionsByActivity,
309
- getTotalRunningSessionCount,
310
- hasBackgroundRunningSessions,
311
- getAllProjectActivity,
312
- useActiveSessionsState,
313
- useActiveSessions,
314
- useActiveSession,
315
- useProjectSessions,
316
- useNavbarSessions,
317
- useSessionsByActivity,
318
- useProjectActivity,
319
- useTotalRunningSessions,
320
- useHasBackgroundRunningSessions
321
- };
@@ -1,139 +0,0 @@
1
- import {
2
- Card
3
- } from "./chunk-ZMNSRDMH.js";
4
- import {
5
- cn
6
- } from "./chunk-RQHJBTEU.js";
7
-
8
- // src/primitives/stat-card.tsx
9
- import * as React from "react";
10
- import { jsx, jsxs } from "react/jsx-runtime";
11
- var StatCard = React.forwardRef(
12
- ({
13
- className,
14
- variant = "default",
15
- title,
16
- value,
17
- subtitle,
18
- icon,
19
- trend,
20
- ...props
21
- }, ref) => {
22
- const iconColors = {
23
- default: "text-muted-foreground",
24
- sandbox: "text-[var(--accent-text)]"
25
- };
26
- const trendColors = {
27
- positive: "text-[var(--surface-success-text)]",
28
- negative: "text-[var(--surface-danger-text)]",
29
- neutral: "text-muted-foreground"
30
- };
31
- const trendStatus = trend ? trend.value > 0 ? "positive" : trend.value < 0 ? "negative" : "neutral" : null;
32
- return /* @__PURE__ */ jsx(
33
- Card,
34
- {
35
- ref,
36
- variant,
37
- className: cn("p-6", className),
38
- ...props,
39
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
40
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
41
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: title }),
42
- /* @__PURE__ */ jsx("p", { className: "font-bold text-3xl tracking-tight", children: value }),
43
- subtitle && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground opacity-70 text-xs", children: subtitle }),
44
- trend && trendStatus && /* @__PURE__ */ jsxs(
45
- "div",
46
- {
47
- className: cn(
48
- "flex items-center gap-1 text-sm",
49
- trendColors[trendStatus]
50
- ),
51
- children: [
52
- trend.value > 0 ? "\u2191" : trend.value < 0 ? "\u2193" : "\u2192",
53
- /* @__PURE__ */ jsxs("span", { children: [
54
- Math.abs(trend.value),
55
- "%"
56
- ] }),
57
- trend.label && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: trend.label })
58
- ]
59
- }
60
- )
61
- ] }),
62
- icon && /* @__PURE__ */ jsx(
63
- "div",
64
- {
65
- className: cn(
66
- "rounded-lg bg-muted/50 p-2",
67
- variant === "sandbox" && "bg-[var(--accent-surface-soft)]",
68
- iconColors[variant]
69
- ),
70
- children: icon
71
- }
72
- )
73
- ] })
74
- }
75
- );
76
- }
77
- );
78
- StatCard.displayName = "StatCard";
79
-
80
- // src/primitives/logo.tsx
81
- import * as React2 from "react";
82
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
83
- var sizeConfig = {
84
- sm: { icon: 24, text: "text-base", suffix: "text-xs", gap: "gap-1.5" },
85
- md: { icon: 28, text: "text-lg", suffix: "text-sm", gap: "gap-2" },
86
- lg: { icon: 36, text: "text-2xl", suffix: "text-base", gap: "gap-2.5" },
87
- xl: { icon: 48, text: "text-3xl", suffix: "text-lg", gap: "gap-3" }
88
- };
89
- function TangleKnot({ size, className }) {
90
- const uid = React2.useId();
91
- const g1 = `tk-a-${uid}`;
92
- const g2 = `tk-b-${uid}`;
93
- return /* @__PURE__ */ jsxs2(
94
- "svg",
95
- {
96
- width: size,
97
- height: size,
98
- viewBox: "20 45 156 140",
99
- fill: "none",
100
- xmlns: "http://www.w3.org/2000/svg",
101
- className,
102
- children: [
103
- /* @__PURE__ */ jsx2("title", { children: "Tangle" }),
104
- /* @__PURE__ */ jsxs2("defs", { children: [
105
- /* @__PURE__ */ jsxs2("linearGradient", { id: g1, x1: "36.79", y1: "58.78", x2: "145.99", y2: "183.59", gradientUnits: "userSpaceOnUse", children: [
106
- /* @__PURE__ */ jsx2("stop", { stopColor: "#8E59FF" }),
107
- /* @__PURE__ */ jsx2("stop", { offset: "1", stopColor: "#6888F9" })
108
- ] }),
109
- /* @__PURE__ */ jsxs2("linearGradient", { id: g2, x1: "36.78", y1: "169.38", x2: "145.99", y2: "44.57", gradientUnits: "userSpaceOnUse", children: [
110
- /* @__PURE__ */ jsx2("stop", { stopColor: "#8E59FF" }),
111
- /* @__PURE__ */ jsx2("stop", { offset: "1", stopColor: "#6888F9" })
112
- ] })
113
- ] }),
114
- /* @__PURE__ */ jsx2("path", { d: "M170.74 150.082C170.747 142.848 167.464 135.908 161.612 130.784C155.76 125.66 147.818 122.772 139.528 122.754L104.921 122.754C104.704 119.939 104.567 117.062 104.567 114.078C104.567 111.095 104.429 108.231 104.236 105.403L139.528 105.403C147.746 105.288 155.582 102.359 161.347 97.2467C167.112 92.135 170.343 85.2506 170.343 78.0787C170.343 70.9069 167.112 64.0225 161.347 58.9107C155.582 53.799 147.746 50.8696 139.528 50.7545L56.817 50.7545C48.5993 50.8696 40.7628 53.799 34.9981 58.9107C29.2334 64.0225 26.0025 70.9069 26.0025 78.0787C26.0025 85.2506 29.2334 92.135 34.9981 97.2467C40.7628 102.359 48.5993 105.288 56.817 105.403L89.3238 106.163C91.5854 106.163 91.7785 111.095 91.7785 114.078C91.7785 117.062 91.9156 119.925 92.1091 122.754L56.817 122.754C48.5993 122.869 40.7628 125.798 34.9981 130.91C29.2334 136.022 26.0025 142.906 26.0025 150.078C26.0025 157.25 29.2334 164.134 34.9981 169.246C40.7628 174.358 48.5993 177.287 56.817 177.402L139.528 177.402C147.816 177.384 155.757 174.497 161.609 169.374C167.461 164.252 170.745 157.314 170.74 150.082ZM157.952 78.0752C157.954 82.3443 156.016 86.4397 152.562 89.463C149.108 92.4863 144.42 94.1905 139.528 94.2017L102.881 94.2017C101.554 86.2073 99.0244 78.4005 95.3585 70.9829C93.7421 67.7691 91.6728 64.7438 89.1983 61.9769L139.528 61.9769C144.415 61.988 149.097 63.6884 152.55 66.7056C156.003 69.7228 157.946 73.811 157.952 78.0752ZM56.817 94.2017C51.9157 94.2017 47.2151 92.5027 43.7493 89.4784C40.2835 86.4541 38.3364 82.3522 38.3364 78.0752C38.3364 73.7982 40.2835 69.6964 43.7493 66.6721C47.2151 63.6478 51.9157 61.9487 56.817 61.9487L65.1139 61.9487C72.4433 61.9487 79.3856 67.0146 83.7074 75.5071C86.6658 81.491 88.77 87.7697 89.9724 94.2017L56.817 94.2017ZM38.3929 150.082C38.3907 145.812 40.3293 141.717 43.7834 138.694C47.2374 135.67 51.9248 133.966 56.817 133.955L93.4637 133.955C94.7912 141.949 97.3206 149.756 100.987 157.174C102.603 160.388 104.672 163.413 107.147 166.18L56.817 166.18C51.9304 166.169 47.2479 164.468 43.7948 161.451C40.3416 158.434 38.3993 154.346 38.3929 150.082ZM112.686 152.65C109.728 146.666 107.623 140.387 106.421 133.955L139.528 133.955C144.429 133.955 149.13 135.654 152.596 138.678C156.062 141.703 158.009 145.804 158.009 150.082C158.009 154.359 156.062 158.46 152.596 161.485C149.13 164.509 144.429 166.208 139.528 166.208L131.231 166.208C123.934 166.208 116.992 161.142 112.686 152.65Z", fill: `url(#${g1})` }),
115
- /* @__PURE__ */ jsx2("path", { opacity: "0.8", d: "M170.74 78.0752C170.747 85.3089 167.463 92.2492 161.612 97.3728C155.76 102.496 147.817 105.384 139.527 105.403L104.92 105.403C104.702 108.217 104.565 111.095 104.565 114.078C104.565 117.062 104.428 119.925 104.235 122.754L139.527 122.754C147.745 122.869 155.582 125.798 161.347 130.91C167.112 136.022 170.342 142.906 170.342 150.078C170.342 157.25 167.112 164.134 161.347 169.246C155.582 174.358 147.745 177.287 139.527 177.402L56.8149 177.402C48.597 177.287 40.7604 174.358 34.9956 169.246C29.2307 164.134 25.9998 157.25 25.9998 150.078C25.9998 142.906 29.2307 136.022 34.9956 130.91C40.7604 125.798 48.597 122.869 56.8149 122.754L89.3223 121.994C91.5839 121.994 91.777 117.062 91.777 114.078C91.777 111.095 91.9141 108.231 92.1076 105.403L56.8149 105.403C48.597 105.288 40.7604 102.359 34.9956 97.2468C29.2307 92.135 25.9998 85.2506 25.9998 78.0788C25.9998 70.9069 29.2307 64.0225 34.9956 58.9108C40.7604 53.799 48.597 50.8696 56.8149 50.7545L139.527 50.7545C147.816 50.7731 155.757 53.6602 161.609 58.7823C167.46 63.9043 170.744 70.8428 170.74 78.0752ZM157.952 150.082C157.954 145.812 156.015 141.717 152.561 138.694C149.107 135.67 144.42 133.966 139.527 133.955L102.88 133.955C101.552 141.949 99.023 149.756 95.3571 157.174C93.7406 160.388 91.6712 163.413 89.1968 166.18L139.527 166.18C144.414 166.169 149.097 164.468 152.55 161.451C156.003 158.434 157.945 154.346 157.952 150.082ZM56.8149 133.955C51.9134 133.955 47.2127 135.654 43.7469 138.678C40.2811 141.703 38.334 145.805 38.334 150.082C38.334 154.359 40.2811 158.46 43.7469 161.485C47.2127 164.509 51.9134 166.208 56.8149 166.208L65.1119 166.208C72.4414 166.208 79.3838 161.142 83.7057 152.65C86.6642 146.666 88.7684 140.387 89.9708 133.955L56.8149 133.955ZM38.3904 78.0752C38.3883 82.3443 40.3269 86.4398 43.781 89.4631C47.2351 92.4863 51.9226 94.1905 56.8149 94.2017L93.4622 94.2017C94.7898 86.2073 97.3192 78.4005 100.985 70.983C102.602 67.7692 104.671 64.7438 107.145 61.9769L56.8149 61.9769C51.9282 61.9881 47.2456 63.6884 43.7924 66.7056C40.3392 69.7228 38.3968 73.8111 38.3904 78.0752ZM112.685 75.5071C109.726 81.491 107.622 87.7697 106.42 94.2017L139.527 94.2017C144.429 94.2017 149.13 92.5027 152.595 89.4784C156.061 86.4541 158.008 82.3522 158.008 78.0752C158.008 73.7982 156.061 69.6964 152.595 66.6721C149.13 63.6478 144.429 61.9488 139.527 61.9488L131.23 61.9488C123.933 61.9488 116.991 67.0147 112.685 75.5071Z", fill: `url(#${g2})` })
116
- ]
117
- }
118
- );
119
- }
120
- function Logo({ variant = "sandbox", size = "md", className, iconOnly = false }) {
121
- const cfg = sizeConfig[size];
122
- if (iconOnly) {
123
- return /* @__PURE__ */ jsx2(TangleKnot, { size: cfg.icon, className });
124
- }
125
- return /* @__PURE__ */ jsxs2("div", { className: cn("flex items-center", cfg.gap, className), children: [
126
- /* @__PURE__ */ jsx2(TangleKnot, { size: cfg.icon, className: "shrink-0" }),
127
- /* @__PURE__ */ jsxs2("div", { className: "flex items-baseline gap-1", children: [
128
- /* @__PURE__ */ jsx2("span", { className: cn("font-bold tracking-tight", cfg.text), children: "Tangle" }),
129
- variant === "sandbox" && /* @__PURE__ */ jsx2("span", { className: cn("font-medium text-gradient-sandbox", cfg.suffix), children: "Sandbox" })
130
- ] })
131
- ] });
132
- }
133
- Logo.displayName = "Logo";
134
-
135
- export {
136
- StatCard,
137
- TangleKnot,
138
- Logo
139
- };
@@ -1,61 +0,0 @@
1
- import {
2
- cn
3
- } from "./chunk-RQHJBTEU.js";
4
-
5
- // src/primitives/tabs.tsx
6
- import * as TabsPrimitive from "@radix-ui/react-tabs";
7
- import * as React from "react";
8
- import { jsx } from "react/jsx-runtime";
9
- var Tabs = TabsPrimitive.Root;
10
- var TabsList = React.forwardRef(({ className, variant = "default", ...props }, ref) => {
11
- const variants = {
12
- default: "inline-flex h-10 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
13
- pills: "inline-flex items-center gap-2",
14
- underline: "inline-flex items-center gap-4 border-b border-border"
15
- };
16
- return /* @__PURE__ */ jsx(
17
- TabsPrimitive.List,
18
- {
19
- ref,
20
- className: cn(variants[variant], className),
21
- ...props
22
- }
23
- );
24
- });
25
- TabsList.displayName = TabsPrimitive.List.displayName;
26
- var TabsTrigger = React.forwardRef(({ className, variant = "default", ...props }, ref) => {
27
- const variants = {
28
- default: "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
29
- pills: "inline-flex items-center justify-center whitespace-nowrap rounded-full px-4 py-2 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=inactive]:text-muted-foreground data-[state=inactive]:hover:bg-muted",
30
- underline: "inline-flex items-center justify-center whitespace-nowrap pb-3 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground"
31
- };
32
- return /* @__PURE__ */ jsx(
33
- TabsPrimitive.Trigger,
34
- {
35
- ref,
36
- className: cn(variants[variant], className),
37
- ...props
38
- }
39
- );
40
- });
41
- TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
42
- var TabsContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
43
- TabsPrimitive.Content,
44
- {
45
- ref,
46
- className: cn(
47
- "mt-4 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
48
- "data-[state=active]:fade-in-0 data-[state=active]:slide-in-from-bottom-2 data-[state=active]:animate-in",
49
- className
50
- ),
51
- ...props
52
- }
53
- ));
54
- TabsContent.displayName = TabsPrimitive.Content.displayName;
55
-
56
- export {
57
- Tabs,
58
- TabsList,
59
- TabsTrigger,
60
- TabsContent
61
- };
@@ -1,40 +0,0 @@
1
- // src/utils/copy-text.ts
2
- async function copyText(text) {
3
- if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
4
- try {
5
- await navigator.clipboard.writeText(text);
6
- return true;
7
- } catch {
8
- }
9
- }
10
- if (typeof document === "undefined") return false;
11
- try {
12
- const textarea = document.createElement("textarea");
13
- textarea.value = text;
14
- textarea.style.position = "fixed";
15
- textarea.style.opacity = "0";
16
- document.body.appendChild(textarea);
17
- textarea.select();
18
- const copied = document.execCommand("copy");
19
- document.body.removeChild(textarea);
20
- return copied;
21
- } catch {
22
- return false;
23
- }
24
- }
25
-
26
- // src/utils/time-ago.ts
27
- function timeAgo(ts) {
28
- const secs = Math.floor((Date.now() - ts) / 1e3);
29
- if (secs < 5) return "just now";
30
- if (secs < 60) return `${secs}s ago`;
31
- const mins = Math.floor(secs / 60);
32
- if (mins < 60) return `${mins}m ago`;
33
- const hrs = Math.floor(mins / 60);
34
- return `${hrs}h ago`;
35
- }
36
-
37
- export {
38
- copyText,
39
- timeAgo
40
- };