@@ -3,7 +3,6 @@ import type { ComponentProps, Contexts } from "@seqflow/seqflow";
33import * as Prism from "prismjs" ;
44import { ArrowSVG } from "../components/Arrow" ;
55import classes from "./Home.module.css" ;
6- import { title } from "process" ;
76
87export async function Home (
98 _ : ComponentProps < unknown > ,
@@ -18,49 +17,53 @@ ${setupArrow.name}();
1817
1918 const liveExampleLinks = [
2019 {
21- id : ' counter' ,
22- title : ' Live example - Counter' ,
23- href : ' https://stackblitz.com/edit/seqflow-counter?file=src%2Findex.tsx' ,
24- bottom : ' 5px' ,
20+ id : " counter" ,
21+ title : " Live example - Counter" ,
22+ href : " https://stackblitz.com/edit/seqflow-counter?file=src%2Findex.tsx" ,
23+ bottom : " 5px" ,
2524 } ,
2625 {
27- id : ' fetch-random-quote' ,
28- title : ' Live example - Fetch Random Quote' ,
29- href : ' https://stackblitz.com/edit/seqflow-fetch-random-quote?file=src%2Findex.tsx' ,
30- bottom : ' 5px' ,
26+ id : " fetch-random-quote" ,
27+ title : " Live example - Fetch Random Quote" ,
28+ href : " https://stackblitz.com/edit/seqflow-fetch-random-quote?file=src%2Findex.tsx" ,
29+ bottom : " 5px" ,
3130 } ,
3231 {
33- id : ' async-component' ,
34- title : ' Live example - Async client components' ,
35- href : ' https://stackblitz.com/edit/seqflow-async-component?file=src%2Findex.tsx' ,
36- bottom : ' 13px' ,
32+ id : " async-component" ,
33+ title : " Live example - Async client components" ,
34+ href : " https://stackblitz.com/edit/seqflow-async-component?file=src%2Findex.tsx" ,
35+ bottom : " 13px" ,
3736 } ,
3837 {
39- id : ' event-stream' ,
40- title : ' Live example - Event as event stream' ,
41- href : ' https://stackblitz.com/edit/seqflow-event-stream?file=src%2Findex.tsx' ,
42- bottom : ' 13px' ,
38+ id : " event-stream" ,
39+ title : " Live example - Event as event stream" ,
40+ href : " https://stackblitz.com/edit/seqflow-event-stream?file=src%2Findex.tsx" ,
41+ bottom : " 13px" ,
4342 } ,
4443 {
45- id : ' state' ,
46- title : ' Live example - Javascript variable as state' ,
47- href : ' https://stackblitz.com/edit/seqflow-state?file=src%2Findex.tsx' ,
48- bottom : ' 13px' ,
44+ id : " state" ,
45+ title : " Live example - Javascript variable as state" ,
46+ href : " https://stackblitz.com/edit/seqflow-state?file=src%2Findex.tsx" ,
47+ bottom : " 13px" ,
4948 } ,
5049 {
51- id : 'update-ui' ,
52- title : 'Live example - Explicit updates' ,
53- href : 'https://stackblitz.com/edit/seqflow-update-ui?file=src%2Findex.tsx' ,
54- bottom : '13px' ,
55- }
56- ]
57- const addStackBlitzLinksScriptContent = liveExampleLinks . map ( ( { id, title, href, bottom } , i ) => {
58- return `
50+ id : "update-ui" ,
51+ title : "Live example - Explicit updates" ,
52+ href : "https://stackblitz.com/edit/seqflow-update-ui?file=src%2Findex.tsx" ,
53+ bottom : "13px" ,
54+ } ,
55+ ] ;
56+ const addStackBlitzLinksScriptContent = liveExampleLinks
57+ . map ( ( { id, title, href, bottom } , i ) => {
58+ return `
5959 const code${ i } = document.getElementById('${ id } ');
6060 code${ i } .innerHTML += '<a target="_blank" href="${ href } " title="${ title } " style="position: absolute; bottom: ${ bottom } ; right: 5px; z-index: 99; background: #060606; padding: 5px; border-radius: 15px;">See live example</a>';
61- `
62- } ) . join ( '\n' ) ;
63- const addStackBlitzLinksScript = createScript ( addStackBlitzLinksScriptContent ) ;
61+ ` ;
62+ } )
63+ . join ( "\n" ) ;
64+ const addStackBlitzLinksScript = createScript (
65+ addStackBlitzLinksScriptContent ,
66+ ) ;
6467
6568 component . renderSync ( [
6669 < div id = "first-screen" >
@@ -303,11 +306,15 @@ function handleFeatureOver() {
303306}
304307
305308function Code (
306- { code, id } : ComponentProps < { code : string , id ?: string } > ,
309+ { code, id } : ComponentProps < { code : string ; id ?: string } > ,
307310 { component } : Contexts ,
308311) {
309312 component . _el . classList . add ( "language-tsx" , "!text-xs" , classes . code ) ;
310- component . renderSync ( < code id = { id } className = "language-tsx" > { code } </ code > ) ;
313+ component . renderSync (
314+ < code id = { id } className = "language-tsx" >
315+ { code }
316+ </ code > ,
317+ ) ;
311318}
312319Code . tagName = ( ) => "pre" ;
313320
0 commit comments