@tangle-network/sandbox-ui 0.6.1 → 0.8.4
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/auth.d.ts +10 -6
- package/dist/auth.js +3 -3
- package/dist/{chat-container-Cg-GwyiK.d.ts → chat-container-f4yEs6KN.d.ts} +9 -1
- package/dist/chat.d.ts +12 -2
- package/dist/chat.js +10 -10
- package/dist/{chunk-TSE423UF.js → chunk-2QZ6G7NM.js} +6 -6
- package/dist/{chunk-WBQ7VULC.js → chunk-34A66VBG.js} +7 -7
- package/dist/{chunk-JP725R4W.js → chunk-34I7UFSX.js} +2 -2
- package/dist/{chunk-YS66Q3RC.js → chunk-3CJ2SOEI.js} +2 -2
- package/dist/{chunk-CNWVHQFY.js → chunk-54SQQMMM.js} +6 -24
- package/dist/{chunk-DLCFZDGX.js → chunk-5UM2XMEJ.js} +39 -14
- package/dist/{chunk-YYGECNZZ.js → chunk-66EZOYZR.js} +3 -3
- package/dist/chunk-7U2Z23NE.js +49 -0
- package/dist/{chunk-RKXIRRKQ.js → chunk-BUOQTBTO.js} +70 -66
- package/dist/{chunk-DCPYTL4W.js → chunk-D4CZWJCD.js} +72 -148
- package/dist/{chunk-MXRQ4MJE.js → chunk-DXMIEK4K.js} +34 -23
- package/dist/{chunk-ZMWWE5RF.js → chunk-EXSOPXIY.js} +141 -123
- package/dist/{chunk-GW4GRAWJ.js → chunk-GSZA3TSY.js} +18 -12
- package/dist/{chunk-W4LM3QYZ.js → chunk-HB5Y37YU.js} +8 -8
- package/dist/{chunk-E2XT3G52.js → chunk-HFMAXUHV.js} +136 -137
- package/dist/{chunk-BRBTD7RH.js → chunk-MA7YKRUP.js} +28 -18
- package/dist/{chunk-MJUDMVRU.js → chunk-MT5FJ3ZT.js} +17 -17
- package/dist/chunk-OKLQVY3Y.js +139 -0
- package/dist/{chunk-KH5UDAJ2.js → chunk-QDH5GEGY.js} +58 -54
- package/dist/{chunk-33W2TLUL.js → chunk-QID2OOMG.js} +12 -3
- package/dist/{chunk-FJSVPBKY.js → chunk-S7OXQTST.js} +17 -3
- package/dist/chunk-T7HMZEVO.js +216 -0
- package/dist/{chunk-FNYJFCGU.js → chunk-U6QTHMY6.js} +145 -256
- package/dist/{chunk-565V6JTN.js → chunk-UXQMIR3D.js} +60 -99
- package/dist/{chunk-XTPAWK7L.js → chunk-VOUV7GGB.js} +25 -47
- package/dist/{chunk-OVNLOE3Y.js → chunk-WXK43R62.js} +41 -41
- package/dist/{chunk-6V4XVKFY.js → chunk-XXDFEF72.js} +340 -335
- package/dist/{chunk-TDYQBLL5.js → chunk-ZMNSRDMH.js} +6 -6
- package/dist/dashboard.d.ts +135 -3
- package/dist/dashboard.js +848 -8
- package/dist/{document-editor-pane-DWWUTTTZ.js → document-editor-pane-TLPVRBBU.js} +3 -3
- package/dist/editor.d.ts +9 -8
- package/dist/editor.js +3 -3
- package/dist/files.js +3 -3
- package/dist/globals.css +5304 -68
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +7 -7
- package/dist/index.d.ts +4 -4
- package/dist/index.js +28 -28
- package/dist/markdown.js +1 -1
- package/dist/openui.js +5 -5
- package/dist/pages.d.ts +47 -3
- package/dist/pages.js +911 -357
- package/dist/primitives.d.ts +5 -2
- package/dist/primitives.js +10 -10
- package/dist/run.js +4 -4
- package/dist/sdk-hooks.d.ts +2 -3
- package/dist/sdk-hooks.js +5 -5
- package/dist/styles.css +5304 -68
- package/dist/template-card-BAtvcAkU.d.ts +18 -0
- package/dist/terminal.d.ts +3 -1
- package/dist/terminal.js +66 -32
- package/dist/tokens.css +701 -40
- package/dist/{usage-chart-XCoB_7Xu.d.ts → usage-chart-SSiOgeQI.d.ts} +3 -1
- package/dist/{use-pty-session-COzVkhtc.d.ts → use-pty-session-0AOuwXgq.d.ts} +2 -0
- package/dist/{index-BT_-ecpc.d.ts → variant-list-C8wx2TqF.d.ts} +17 -8
- package/dist/workspace.d.ts +1 -1
- package/dist/workspace.js +13 -13
- package/package.json +3 -1
- package/tailwind.config.cjs +3 -2
- package/dist/chunk-3HW53XTH.js +0 -228
- package/dist/chunk-OKCIKTXQ.js +0 -63
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
interface TemplateCardData {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
tags?: string[];
|
|
10
|
+
}
|
|
11
|
+
interface TemplateCardProps {
|
|
12
|
+
template: TemplateCardData;
|
|
13
|
+
onUseTemplate: (templateId: string) => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
declare function TemplateCard({ template, onUseTemplate, className }: TemplateCardProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { type TemplateCardData as T, TemplateCard as a, type TemplateCardProps as b };
|
package/dist/terminal.d.ts
CHANGED
|
@@ -37,8 +37,10 @@ interface TerminalViewProps {
|
|
|
37
37
|
subtitle?: string;
|
|
38
38
|
/** @deprecated No longer used — the PTY provides its own prompt. */
|
|
39
39
|
prompt?: string;
|
|
40
|
+
/** Whether the terminal tab is currently active and visible. */
|
|
41
|
+
isActive?: boolean;
|
|
40
42
|
}
|
|
41
43
|
declare const DEFAULT_TERMINAL_THEME: TerminalTheme;
|
|
42
|
-
declare function TerminalView({ apiUrl, token, theme, title, subtitle, }: TerminalViewProps): react_jsx_runtime.JSX.Element;
|
|
44
|
+
declare function TerminalView({ apiUrl, token, theme, title, subtitle, isActive, }: TerminalViewProps): react_jsx_runtime.JSX.Element;
|
|
43
45
|
|
|
44
46
|
export { DEFAULT_TERMINAL_THEME, type TerminalTheme, TerminalView, type TerminalViewProps };
|
package/dist/terminal.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePtySession
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5UM2XMEJ.js";
|
|
4
4
|
|
|
5
5
|
// src/terminal/terminal-view.tsx
|
|
6
6
|
import "@xterm/xterm/css/xterm.css";
|
|
7
|
-
import { useEffect, useRef, useCallback } from "react";
|
|
7
|
+
import { useEffect, useRef, useCallback, useMemo } from "react";
|
|
8
8
|
import { Terminal } from "@xterm/xterm";
|
|
9
9
|
import { FitAddon } from "@xterm/addon-fit";
|
|
10
10
|
import { WebLinksAddon } from "@xterm/addon-web-links";
|
|
@@ -38,16 +38,20 @@ function TerminalView({
|
|
|
38
38
|
token,
|
|
39
39
|
theme,
|
|
40
40
|
title = "Terminal",
|
|
41
|
-
subtitle = "Connected to PTY session"
|
|
41
|
+
subtitle = "Connected to PTY session",
|
|
42
|
+
isActive = true
|
|
42
43
|
}) {
|
|
43
|
-
const resolvedTheme =
|
|
44
|
+
const resolvedTheme = useMemo(
|
|
45
|
+
() => ({ ...DEFAULT_TERMINAL_THEME, ...theme }),
|
|
46
|
+
[theme]
|
|
47
|
+
);
|
|
44
48
|
const containerRef = useRef(null);
|
|
45
49
|
const termRef = useRef(null);
|
|
46
50
|
const fitAddonRef = useRef(null);
|
|
47
51
|
const onData = useCallback((data) => {
|
|
48
52
|
termRef.current?.write(data);
|
|
49
53
|
}, []);
|
|
50
|
-
const { isConnected, error, sendCommand, reconnect } = usePtySession({
|
|
54
|
+
const { isConnected, error, sendCommand, resizeTerminal, reconnect } = usePtySession({
|
|
51
55
|
apiUrl,
|
|
52
56
|
token,
|
|
53
57
|
onData
|
|
@@ -75,13 +79,12 @@ function TerminalView({
|
|
|
75
79
|
});
|
|
76
80
|
termRef.current = term;
|
|
77
81
|
fitAddonRef.current = fitAddon;
|
|
78
|
-
const padTitle = title.padEnd(37);
|
|
79
|
-
const padSubtitle = subtitle.padEnd(37);
|
|
80
|
-
term.writeln(`\x1B[38;5;48m\u256D${"\u2500".repeat(41)}\u256E\x1B[0m`);
|
|
81
|
-
term.writeln(`\x1B[38;5;48m\u2502\x1B[0m \x1B[1m${padTitle}\x1B[0m\x1B[38;5;48m\u2502\x1B[0m`);
|
|
82
|
-
term.writeln(`\x1B[38;5;48m\u2502\x1B[0m ${padSubtitle}\x1B[38;5;48m\u2502\x1B[0m`);
|
|
83
|
-
term.writeln(`\x1B[38;5;48m\u2570${"\u2500".repeat(41)}\u256F\x1B[0m`);
|
|
84
82
|
term.onData((data) => {
|
|
83
|
+
if (data === "\f") {
|
|
84
|
+
termRef.current?.clear();
|
|
85
|
+
sendCommand("\r").catch(console.error);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
85
88
|
sendCommand(data).catch((err) => {
|
|
86
89
|
termRef.current?.writeln(
|
|
87
90
|
`\r
|
|
@@ -89,6 +92,9 @@ function TerminalView({
|
|
|
89
92
|
);
|
|
90
93
|
});
|
|
91
94
|
});
|
|
95
|
+
term.onResize(({ cols, rows }) => {
|
|
96
|
+
resizeTerminal(cols, rows).catch(console.error);
|
|
97
|
+
});
|
|
92
98
|
const ro = new ResizeObserver(() => {
|
|
93
99
|
requestAnimationFrame(() => {
|
|
94
100
|
fitAddon.fit();
|
|
@@ -101,28 +107,56 @@ function TerminalView({
|
|
|
101
107
|
termRef.current = null;
|
|
102
108
|
fitAddonRef.current = null;
|
|
103
109
|
};
|
|
104
|
-
}, [sendCommand,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
}, [sendCommand, resizeTerminal, title, subtitle]);
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
if (termRef.current) {
|
|
113
|
+
termRef.current.options.theme = resolvedTheme;
|
|
114
|
+
}
|
|
115
|
+
}, [resolvedTheme]);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
if (isConnected && termRef.current) {
|
|
118
|
+
resizeTerminal(termRef.current.cols, termRef.current.rows).catch(console.error);
|
|
119
|
+
if (isActive) {
|
|
120
|
+
termRef.current.focus();
|
|
112
121
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
}
|
|
123
|
+
}, [isConnected, resizeTerminal, isActive]);
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
if (isActive && termRef.current && fitAddonRef.current) {
|
|
126
|
+
setTimeout(() => {
|
|
127
|
+
fitAddonRef.current?.fit();
|
|
128
|
+
termRef.current?.focus();
|
|
129
|
+
}, 50);
|
|
130
|
+
}
|
|
131
|
+
}, [isActive]);
|
|
132
|
+
return /* @__PURE__ */ jsxs(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
className: "relative h-full w-full group cursor-text",
|
|
136
|
+
onClick: () => termRef.current?.focus(),
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ jsx(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
ref: containerRef,
|
|
142
|
+
className: "h-full w-full overflow-hidden relative z-0",
|
|
143
|
+
style: { backgroundColor: resolvedTheme.background }
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
(!isConnected || error) && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-background", children: /* @__PURE__ */ jsx("div", { className: "text-center", children: error ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
147
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-[var(--surface-danger-text)] mb-3", children: error }),
|
|
148
|
+
/* @__PURE__ */ jsx(
|
|
149
|
+
"button",
|
|
150
|
+
{
|
|
151
|
+
onClick: reconnect,
|
|
152
|
+
className: "text-sm text-[var(--surface-success-text)] hover:opacity-80 underline cursor-pointer",
|
|
153
|
+
children: "Retry connection"
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
] }) : /* @__PURE__ */ jsx("p", { className: "text-[13px] text-muted-foreground", children: "Connecting to terminal..." }) }) })
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
);
|
|
126
160
|
}
|
|
127
161
|
export {
|
|
128
162
|
DEFAULT_TERMINAL_THEME,
|