@@ -178,157 +178,9 @@ export default function TypeScriptPlayground({
178178 renderCharacters : false ,
179179 } ,
180180 } }
181- // path={activeFile.name}
182- // defaultLanguage={activeFile.language ?? "typescript"}
183- // defaultValue={activeFile.text}
184181 onMount = { afterMount }
185182 onChange = { onChange }
186183 />
187184 </ div >
188185 ) ;
189-
190- // const appRef = useRef<core.Application<core.CommandContext> | undefined>(void 0);
191- // const [lastLoaded, setLastLoaded] = useState<Date | undefined>();
192-
193- // const libraries = {
194- // "@stricli/core": StricliCoreTypes as unknown as string,
195- // };
196-
197- // const onTextChange = useCallback(
198- // (value: string | undefined) => {
199- // if (value) {
200- // appRef.current = loadApplication(value, rootExport, appName);
201- // setLastLoaded(new Date());
202- // } else {
203- // appRef.current = void 0;
204- // }
205- // },
206- // [appRef],
207- // );
208-
209- // const lastLoadedTimestamp = useMemo(() => {
210- // if (lastLoaded) {
211- // const time = lastLoaded.toLocaleTimeString();
212- // return (
213- // <span key="terminal-navbar-last-loaded" className="terminal-navbar-last-loaded">
214- // App reloaded at {time}
215- // </span>
216- // );
217- // }
218- // <span key="terminal-navbar-last-loaded" className="terminal-navbar-last-loaded">
219- // App not loaded
220- // </span>;
221- // }, [lastLoaded]);
222-
223- // return (
224- // <div className="stricli-playground">
225- // <h5>{title}</h5>
226- // <Editor
227- // key={filename}
228- // filename={filename}
229- // language="typescript"
230- // height={editorHeight}
231- // options={{
232- // tabSize: 2,
233- // lineNumbers: "off",
234- // scrollBeyondLastLine: false,
235- // folding: false,
236- // bracketPairColorization: { enabled: false },
237- // }}
238- // libraries={libraries}
239- // compilerOptions={{
240- // module: 1,
241- // strict: true,
242- // }}
243- // defaultValue={children}
244- // onChange={onTextChange}
245- // ></Editor>
246- // {/* <Terminal
247- // startCollapsed={collapsed}
248- // height={terminalHeight}
249- // commandPrefix={appName + " "}
250- // defaultValue={defaultInput}
251- // executeInput={async (input) => {
252- // const app = appRef.current;
253- // if (!app) {
254- // return [["Application not loaded, check for type errors above ^", "stderr"]];
255- // }
256- // const argv = parseArgv(input);
257- // if (argv[0] !== app.config.name) {
258- // return [[`${argv[0]}: command not found`, "stderr"]];
259- // }
260- // return runApplication(app, argv.slice(1));
261- // }}
262- // completeInput={async (input) => {
263- // const app = appRef.current;
264- // if (!app) {
265- // console.error("Application not loaded");
266- // return [];
267- // }
268- // const argv = parseArgv(input);
269- // if (argv[0] !== app.config.name) {
270- // return [];
271- // }
272- // const inputs = argv.slice(1);
273- // let finalInput = inputs.at(-1);
274- // if (input.endsWith(" ")) {
275- // finalInput = "";
276- // inputs.push("");
277- // }
278- // const completions = await proposeCompletions(app, inputs);
279- // if (finalInput === "") {
280- // return completions.map((completion) => `${input}${completion}`);
281- // }
282- // const finalInputIndex = input.lastIndexOf(finalInput);
283- // const inputWithoutFinal = input.slice(0, finalInputIndex);
284- // return completions.map((completion) => `${inputWithoutFinal}${completion}`);
285- // }}
286- // additionalNavbarElements={[lastLoadedTimestamp]}
287- // ></Terminal> */}
288- // </div>
289- // );
290186}
291-
292- // import { buildCommand, buildApplication } from "@stricli/core";
293-
294- // const command = buildCommand({
295- // loader: async () => {
296- // return (flags: {}) => {};
297- // },
298- // parameters: {},
299- // docs: {
300- // brief: "command",
301- // },
302- // });
303-
304- // const app = buildApplication(command, {
305- // name: "z"
306- // });
307- // export default app;
308-
309- // import { buildCommand, buildApplication } from "@stricli/core";
310-
311- // const command = buildCommand({
312- // loader: async () => {
313- // return function(flags: { name: string }) {
314- // this.process.stdout.write(`Hello, ${flags.name}!`);
315- // };
316- // },
317- // parameters: {
318- // flags: {
319- // name: {
320- // kind: "parsed",
321- // parse: String,
322- // brief: "Your name",
323- // },
324- // },
325- // },
326- // docs: {
327- // brief: "command",
328- // },
329- // });
330-
331- // const app = buildApplication(command, {
332- // name: "run"
333- // });
334- // export default app;
0 commit comments