@tutorialkit-rb/react 0.1.5 → 0.1.6
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/Panels/TerminalPanel.js +10 -5
- package/package.json +4 -4
|
@@ -9,6 +9,7 @@ const ICON_MAP = new Map([
|
|
|
9
9
|
]);
|
|
10
10
|
export function TerminalPanel({ theme, tutorialStore }) {
|
|
11
11
|
const terminalConfig = useStore(tutorialStore.terminalConfig);
|
|
12
|
+
const isPreparing = useStore(tutorialStore.isPreparing);
|
|
12
13
|
const terminalRefs = useRef({});
|
|
13
14
|
const [domLoaded, setDomLoaded] = useState(false);
|
|
14
15
|
// select the terminal tab by default
|
|
@@ -37,9 +38,13 @@ export function TerminalPanel({ theme, tutorialStore }) {
|
|
|
37
38
|
'group-hover:text-tk-elements-panel-headerTab-iconColorHover': !selected,
|
|
38
39
|
'text-tk-elements-panel-headerTab-iconColorActive': selected,
|
|
39
40
|
}) }), title] }) }, index));
|
|
40
|
-
}) }) }) }), _jsx("div", { className: "h-full overflow-hidden", children: domLoaded && (_jsx(Suspense, { children: terminalConfig.panels.map(({ id, type }, index) =>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
}) }) }) }), _jsx("div", { className: "h-full overflow-hidden relative", children: domLoaded && (_jsx(Suspense, { children: terminalConfig.panels.map(({ id, type }, index) => {
|
|
42
|
+
const isTerminalPanel = type === 'terminal';
|
|
43
|
+
const showPreparingMessage = isTerminalPanel && isPreparing;
|
|
44
|
+
return (_jsx("div", { role: "tabpanel", id: `tk-terminal-tapbanel-${index}`, "aria-labelledby": `tk-terminal-tab-${index}`, className: tabIndex !== index ? 'hidden h-full' : 'h-full', children: showPreparingMessage ? (_jsx("div", { className: "h-full bg-tk-elements-terminal-backgroundColor text-tk-elements-terminal-textColor px-4 py-2", style: { fontFamily: 'Menlo, courier-new, courier, monospace', fontSize: '13px' }, children: "Preparing runtime..." })) : (_jsx(Terminal, { className: "h-full", theme: theme, readonly: type === 'output', ref: (ref) => (terminalRefs.current[index] = ref), onTerminalReady: (terminal) => {
|
|
45
|
+
tutorialStore.attachTerminal(id, terminal);
|
|
46
|
+
}, onTerminalResize: (cols, rows) => {
|
|
47
|
+
tutorialStore.onTerminalResize(cols, rows);
|
|
48
|
+
} })) }, id));
|
|
49
|
+
}) })) })] }));
|
|
45
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tutorialkit-rb/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "TutorialKit's React components and utilities",
|
|
5
5
|
"author": "StackBlitz Inc.",
|
|
6
6
|
"type": "module",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"picomatch": "^4.0.2",
|
|
91
91
|
"react": "^18.3.1",
|
|
92
92
|
"react-resizable-panels": "^2.0.19",
|
|
93
|
-
"@tutorialkit-rb/
|
|
94
|
-
"@tutorialkit-rb/
|
|
93
|
+
"@tutorialkit-rb/theme": "0.1.6",
|
|
94
|
+
"@tutorialkit-rb/runtime": "0.1.6"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"@codemirror/search": "^6.5.6",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"execa": "^9.2.0",
|
|
102
102
|
"typescript": "^5.4.5",
|
|
103
103
|
"vitest": "^3.0.5",
|
|
104
|
-
"@tutorialkit-rb/types": "0.1.
|
|
104
|
+
"@tutorialkit-rb/types": "0.1.6"
|
|
105
105
|
},
|
|
106
106
|
"scripts": {
|
|
107
107
|
"build": "node ./scripts/build.js",
|