@epic-web/workshop-app 6.88.1 → 6.89.0
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/build/client/assets/{_exerciseNumber-BkoIHU4s.js → _exerciseNumber-BZvzAp9f.js} +2 -2
- package/build/client/assets/{_exerciseNumber-BkoIHU4s.js.map → _exerciseNumber-BZvzAp9f.js.map} +1 -1
- package/build/client/assets/{_exerciseNumber_.finished-BRspQYAo.js → _exerciseNumber_.finished-D5eMZ_ok.js} +2 -2
- package/build/client/assets/{_exerciseNumber_.finished-BRspQYAo.js.map → _exerciseNumber_.finished-D5eMZ_ok.js.map} +1 -1
- package/build/client/assets/{_extra-qH2jDBa4.js → _extra-Bd0-gThk.js} +2 -2
- package/build/client/assets/{_extra-qH2jDBa4.js.map → _extra-Bd0-gThk.js.map} +1 -1
- package/build/client/assets/{_layout-Bg1RFS9D.js → _layout-CbP-ZGKA.js} +2 -2
- package/build/client/assets/{_layout-Bg1RFS9D.js.map → _layout-CbP-ZGKA.js.map} +1 -1
- package/build/client/assets/{app-BH96aYJx.js → app-BTlBQWy_.js} +2 -2
- package/build/client/assets/{app-BH96aYJx.js.map → app-BTlBQWy_.js.map} +1 -1
- package/build/client/assets/{cache-5tXauWqp.js → cache-Cjjb4Th1.js} +2 -2
- package/build/client/assets/{cache-5tXauWqp.js.map → cache-Cjjb4Th1.js.map} +1 -1
- package/build/client/assets/{db-CPB2ZdAy.js → db-n83JPsm9.js} +2 -2
- package/build/client/assets/{db-CPB2ZdAy.js.map → db-n83JPsm9.js.map} +1 -1
- package/build/client/assets/{diff-BncP0Faq.js → diff-C4LoXlDb.js} +3 -3
- package/build/client/assets/diff-C4LoXlDb.js.map +1 -0
- package/build/client/assets/{diff-IVQnB3Pk.js → diff-Fut2J8f5.js} +2 -2
- package/build/client/assets/{diff-IVQnB3Pk.js.map → diff-Fut2J8f5.js.map} +1 -1
- package/build/client/assets/{finished-CYdLPdvJ.js → finished-CsRM8483.js} +2 -2
- package/build/client/assets/{finished-CYdLPdvJ.js.map → finished-CsRM8483.js.map} +1 -1
- package/build/client/assets/{index-n4CWCwSA.js → index-BnHkUMN_.js} +2 -2
- package/build/client/assets/{index-n4CWCwSA.js.map → index-BnHkUMN_.js.map} +1 -1
- package/build/client/assets/{index-CKhNevM7.js → index-Bo0DKzj5.js} +2 -2
- package/build/client/assets/{index-CKhNevM7.js.map → index-Bo0DKzj5.js.map} +1 -1
- package/build/client/assets/{index-Cb8U85TK.js → index-m9K7ACZe.js} +2 -2
- package/build/client/assets/{index-Cb8U85TK.js.map → index-m9K7ACZe.js.map} +1 -1
- package/build/client/assets/launch-editor-C-8ah8qM.js +2 -0
- package/build/client/assets/launch-editor-C-8ah8qM.js.map +1 -0
- package/build/client/assets/{manifest-d6d8ad00.js → manifest-72875289.js} +1 -1
- package/build/client/assets/{mdx-Bvb9XNyL.js → mdx-C3Jl4O5D.js} +2 -2
- package/build/client/assets/{mdx-Bvb9XNyL.js.map → mdx-C3Jl4O5D.js.map} +1 -1
- package/build/client/assets/{playground-CEUo0DCy.js → playground-BV2y1ifv.js} +2 -2
- package/build/client/assets/{playground-CEUo0DCy.js.map → playground-BV2y1ifv.js.map} +1 -1
- package/build/client/assets/{preview-BS9wGiJ3.js → preview-Dav9KrHN.js} +2 -2
- package/build/client/assets/{preview-BS9wGiJ3.js.map → preview-Dav9KrHN.js.map} +1 -1
- package/build/server/index.js +36 -4
- package/build/server/index.js.map +1 -1
- package/package.json +3 -3
- package/build/client/assets/diff-BncP0Faq.js.map +0 -1
- package/build/client/assets/launch-editor-C8OwTN5L.js +0 -2
- package/build/client/assets/launch-editor-C8OwTN5L.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{w as s,a as n,L as c}from"./chunk-JZWAC4HX-BuixXc9D.js";import{j as r}from"./jsx-runtime-C5WNSv3b.js";import{E as m}from"./index-3PqfcnMA.js";import{E as l}from"./epic-video-C9q0z-QM.js";import{G as p}from"./error-boundary-DCY9a5Cj.js";import{u as a}from"./revalidation-ws-JHvxsHsY.js";import{E as x}from"./launch-editor-
|
|
2
|
-
//# sourceMappingURL=_exerciseNumber-
|
|
1
|
+
import{w as s,a as n,L as c}from"./chunk-JZWAC4HX-BuixXc9D.js";import{j as r}from"./jsx-runtime-C5WNSv3b.js";import{E as m}from"./index-3PqfcnMA.js";import{E as l}from"./epic-video-C9q0z-QM.js";import{G as p}from"./error-boundary-DCY9a5Cj.js";import{u as a}from"./revalidation-ws-JHvxsHsY.js";import{E as x}from"./launch-editor-C-8ah8qM.js";import{P as u}from"./progress-BvO_W5nB.js";import{M as f}from"./mdx-C3Jl4O5D.js";import{g as d}from"./root-loader-DAxaiFMN.js";import{g as b}from"./seo-t5J-DRxw.js";import{E as h}from"./error-boundary-BS_yDJtr.js";import"./index-Bi6L2ga8.js";import"./loading-BjV0PtX2.js";import"./index-DSpM0ReJ.js";import"./misc-D9k_mI0z.js";import"./tooltip-H74tOFSr.js";import"./index-B2VNpNxJ.js";import"./pe-D585gnmh.js";import"./schemas-siASSt6b.js";import"./index-E_6kulJP.js";import"./online-x7UFobEJ.js";import"./format-CZ5n8p10.js";import"./user-DhjrtSbZ.js";import"./workshop-config-v_LiyFvY.js";import"./preload-helper-BXl3LOEh.js";import"./progress-bar-BCbq1CuC.js";import"./chunk-4LKRSAEJ-TFLSCavK.js";import"./coerce-f7UHRcUL.js";const K=({loaderData:t,matches:e})=>{const o=t?.exercise.exerciseNumber.toString().padStart(2,"0"),i=d(e);return!t||!i?[{title:"🦉 | Error"}]:b({title:`📝 | ${o}. ${t.exercise.title} | ${i?.workshopTitle}`,description:`Introduction for ${o}. ${t.exercise.title}`,ogTitle:t.exercise.title,ogDescription:`Introduction for exercise ${Number(o)}`,instructor:i.instructor,requestInfo:i.requestInfo})},g={h1:()=>null},U=s(function({loaderData:e}){a({watchPaths:[e.exerciseReadme.file]});const o=String(e.firstStep?.stepNumber??"01").padStart(2,"0");return r.jsxs("main",{className:"relative flex h-full w-full max-w-5xl flex-col justify-between border-r md:w-3/4 xl:w-2/3",children:[r.jsxs("article",{id:e.articleId,className:"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar flex w-full flex-1 flex-col gap-12 overflow-y-scroll px-3 py-4 pt-6 md:px-10 md:py-12 md:pt-16",children:[r.jsx("div",{children:r.jsx("h1",{className:"text-[clamp(3rem,6vw,7.5rem)] leading-none font-extrabold",children:e.exercise.title})}),r.jsx("div",{children:e.exercise.instructionsCode?r.jsx(l,{epicVideoInfosPromise:e.epicVideoInfosPromise,children:r.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:r.jsx(f,{code:e.exercise.instructionsCode,components:g})})}):"No instructions yet..."})]},e.articleId),r.jsx(m,{elementQuery:`#${e.articleId}`},`scroll-${e.articleId}`),r.jsx(u,{type:"instructions",exerciseNumber:e.exerciseNumber,className:"h-14 border-t px-6"}),r.jsxs("div",{className:"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0",children:[r.jsx("div",{}),r.jsx(x,{file:e.exerciseReadme.file,relativePath:e.exerciseReadme.relativePath}),r.jsx(c,{to:`${o}/${e.firstType}`,prefetch:"intent",className:"bg-foreground text-background flex h-full items-center justify-center px-7","data-keyboard-action":"g+n",children:"Start Learning"})]})]})}),X=n(function(){return r.jsx(p,{className:"container flex items-center justify-center",statusHandlers:{404:h}})});export{X as ErrorBoundary,U as default,K as meta};
|
|
2
|
+
//# sourceMappingURL=_exerciseNumber-BZvzAp9f.js.map
|
package/build/client/assets/{_exerciseNumber-BkoIHU4s.js.map → _exerciseNumber-BZvzAp9f.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_exerciseNumber-
|
|
1
|
+
{"version":3,"file":"_exerciseNumber-BZvzAp9f.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetExercises,\n\tgetWorkshopRoot,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n\ttime,\n} from '@epic-web/workshop-utils/timing.server'\nimport slugify from '@sindresorhus/slugify'\nimport { data, type HeadersFunction, Link } from 'react-router'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { GeneralErrorBoundary } from '#app/components/error-boundary.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { getRootMatchLoaderData } from '#app/utils/root-loader.ts'\nimport { getSeoMetaTags } from '#app/utils/seo.ts'\nimport { type Route } from './+types/$exerciseNumber.tsx'\nimport { getExercise404Data } from './__shared/error-boundary.server.ts'\nimport { Exercise404ErrorBoundary } from './__shared/error-boundary.tsx'\n\nexport const meta: Route.MetaFunction = ({ loaderData, matches }) => {\n\tconst number = loaderData?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = getRootMatchLoaderData(matches)\n\tif (!loaderData || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `📝 | ${number}. ${loaderData.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Introduction for ${number}. ${loaderData.exercise.title}`,\n\t\togTitle: loaderData.exercise.title,\n\t\togDescription: `Introduction for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: Route.LoaderArgs) {\n\tconst timings = makeTimings('exerciseNumberLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst { title: workshopTitle } = getWorkshopConfig()\n\tconst exercises = await time(() => getExercises({ request, timings }), {\n\t\ttimings,\n\t\ttype: 'getExercises',\n\t\tdesc: 'getExercises in $exerciseNumber.tsx',\n\t})\n\tconst exercise = exercises.find(\n\t\t(e) => e.exerciseNumber === Number(params.exerciseNumber),\n\t)\n\tif (!exercise) {\n\t\tthrow Response.json(getExercise404Data({ exercises }), { status: 404 })\n\t}\n\n\tconst readmeFilepath = path.join(\n\t\tgetWorkshopRoot(),\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'README.mdx',\n\t)\n\n\tconst firstStep = exercise.steps.find(Boolean)\n\n\tconst articleId = `workshop-${slugify(workshopTitle)}-${\n\t\texercise.exerciseNumber\n\t}-instructions`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\texercise,\n\t\t\texerciseNumber: exercise.exerciseNumber,\n\t\t\texerciseReadme: {\n\t\t\t\tfile: readmeFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}/README.mdx`,\n\t\t\t},\n\t\t\texerciseTitle: exercise.title,\n\t\t\tfirstStep,\n\t\t\tfirstType: firstStep?.problem ? 'problem' : 'solution',\n\t\t\ttitle: workshopTitle,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.instructionsEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\n// we'll render the title ourselves thank you\nconst mdxComponents = { h1: () => null }\n\nexport default function ExerciseNumberRoute({\n\tloaderData: data,\n}: Route.ComponentProps) {\n\tuseRevalidationWS({\n\t\twatchPaths: [data.exerciseReadme.file],\n\t})\n\n\tconst firstStepNumber = String(data.firstStep?.stepNumber ?? '01').padStart(\n\t\t2,\n\t\t'0',\n\t)\n\treturn (\n\t\t<main className=\"relative flex h-full w-full max-w-5xl flex-col justify-between border-r md:w-3/4 xl:w-2/3\">\n\t\t\t<article\n\t\t\t\tid={data.articleId}\n\t\t\t\tkey={data.articleId}\n\t\t\t\tclassName=\"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar flex w-full flex-1 flex-col gap-12 overflow-y-scroll px-3 py-4 pt-6 md:px-10 md:py-12 md:pt-16\"\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<h1 className=\"text-[clamp(3rem,6vw,7.5rem)] leading-none font-extrabold\">\n\t\t\t\t\t\t{data.exercise.title}\n\t\t\t\t\t</h1>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t{data.exercise.instructionsCode ? (\n\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\tcode={data.exercise.instructionsCode}\n\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t'No instructions yet...'\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</article>\n\t\t\t<ElementScrollRestoration\n\t\t\t\telementQuery={`#${data.articleId}`}\n\t\t\t\tkey={`scroll-${data.articleId}`}\n\t\t\t/>\n\t\t\t<ProgressToggle\n\t\t\t\ttype=\"instructions\"\n\t\t\t\texerciseNumber={data.exerciseNumber}\n\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t/>\n\t\t\t<div className=\"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0\">\n\t\t\t\t<div />\n\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\tfile={data.exerciseReadme.file}\n\t\t\t\t\trelativePath={data.exerciseReadme.relativePath}\n\t\t\t\t/>\n\t\t\t\t<Link\n\t\t\t\t\tto={`${firstStepNumber}/${data.firstType}`}\n\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\tclassName=\"bg-foreground text-background flex h-full items-center justify-center px-7\"\n\t\t\t\t\tdata-keyboard-action=\"g+n\"\n\t\t\t\t>\n\t\t\t\t\tStart Learning\n\t\t\t\t</Link>\n\t\t\t</div>\n\t\t</main>\n\t)\n}\n\nexport function ErrorBoundary() {\n\treturn (\n\t\t<GeneralErrorBoundary\n\t\t\tclassName=\"container flex items-center justify-center\"\n\t\t\tstatusHandlers={{\n\t\t\t\t404: Exercise404ErrorBoundary,\n\t\t\t}}\n\t\t/>\n\t)\n}\n"],"names":["meta","loaderData","matches","number","exercise","exerciseNumber","toString","padStart","rootData","getRootMatchLoaderData","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","$exerciseNumber","_UNSAFE_withComponentProps","data","useRevalidationWS","watchPaths","exerciseReadme","file","firstStepNumber","String","firstStep","stepNumber","jsxs","className","children","id","articleId","jsx","instructionsCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","relativePath","Link","to","firstType","prefetch","ErrorBoundary","_UNSAFE_withErrorBoundaryProps","GeneralErrorBoundary","statusHandlers","Exercise404ErrorBoundary"],"mappings":"8iCA6BO,MAAMA,EAA2BA,CAAC,CAAEC,WAAAA,EAAYC,QAAAA,CAAQ,IAAM,CACpE,MAAMC,EAASF,GAAYG,SAASC,eAAeC,WAAWC,SAAS,EAAG,GAAG,EAEvEC,EAAWC,EAAuBP,CAAO,EAC/C,MAAI,CAACD,GAA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AC,KAAK,eACL1C,eAAgBkB,EAAKlB,eACrB4B,UAAU,oBAAA,CACX,EACAD,EAAAA,KAAC,MAAA,CAAIC,UAAU,yEACdC,SAAA,CAAAG,EAAAA,IAAC,MAAA,CAAA,CAAI,EACLA,EAAAA,IAACW,EAAA,CACArB,KAAMJ,EAAKG,eAAeC,KAC1BsB,aAAc1B,EAAKG,eAAeuB,YAAA,CACnC,EACAZ,EAAAA,IAACa,EAAA,CACAC,GAAI,GAAGvB,CAAe,IAAIL,EAAK6B,SAAS,GACxCC,SAAS,SACTpB,UAAU,6EACV,uBAAqB,MACrBC,SAAA,gBAAA,CAED,CAAA,CAAA,CACD,CAAA,CAAA,CACD,CAEF,CAAA,EAEOoB,EAAAC,EAAA,UAAyB,CAC/B,OACClB,EAAAA,IAACmB,EAAA,CACAvB,UAAU,6CACVwB,eAAgB,CACf,IAAKC,CACN,CAAA,CACD,CAEF,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{w as n,L as l}from"./chunk-JZWAC4HX-BuixXc9D.js";import{j as e}from"./jsx-runtime-C5WNSv3b.js";import{E as c}from"./index-3PqfcnMA.js";import{r as m}from"./index-Bi6L2ga8.js";import{E as a}from"./epic-video-C9q0z-QM.js";import{I as x,c as d}from"./misc-D9k_mI0z.js";import{L as f}from"./loading-BjV0PtX2.js";import{N as p}from"./nav-chevrons-DUMNZcNc.js";import{R as h}from"./retrieval-practice-ZEACmMc2.js";import{u}from"./revalidation-ws-JHvxsHsY.js";import{E as b}from"./launch-editor-
|
|
2
|
-
//# sourceMappingURL=_exerciseNumber_.finished-
|
|
1
|
+
import{w as n,L as l}from"./chunk-JZWAC4HX-BuixXc9D.js";import{j as e}from"./jsx-runtime-C5WNSv3b.js";import{E as c}from"./index-3PqfcnMA.js";import{r as m}from"./index-Bi6L2ga8.js";import{E as a}from"./epic-video-C9q0z-QM.js";import{I as x,c as d}from"./misc-D9k_mI0z.js";import{L as f}from"./loading-BjV0PtX2.js";import{N as p}from"./nav-chevrons-DUMNZcNc.js";import{R as h}from"./retrieval-practice-ZEACmMc2.js";import{u}from"./revalidation-ws-JHvxsHsY.js";import{E as b}from"./launch-editor-C-8ah8qM.js";import{P as j}from"./progress-BvO_W5nB.js";import{u as g}from"./index-DSpM0ReJ.js";import{M as N}from"./mdx-C3Jl4O5D.js";import{u as v}from"./online-x7UFobEJ.js";import{g as w}from"./root-loader-DAxaiFMN.js";import{g as E}from"./seo-t5J-DRxw.js";import"./index-E_6kulJP.js";import"./index-B2VNpNxJ.js";import"./schemas-siASSt6b.js";import"./tooltip-H74tOFSr.js";import"./format-CZ5n8p10.js";import"./user-DhjrtSbZ.js";import"./workshop-config-v_LiyFvY.js";import"./progress-bar-BCbq1CuC.js";import"./pe-D585gnmh.js";import"./preload-helper-BXl3LOEh.js";const ee=({loaderData:s,matches:r})=>{const i=s?.exercise.exerciseNumber.toString().padStart(2,"0"),o=w(r);return!s||!o?[{title:"🦉 | Error"}]:E({title:`🦉 | ${i}. ${s.exercise.title} | ${o?.workshopTitle}`,description:`Elaboration for ${i}. ${s.exercise.title}`,ogTitle:`Finished: ${s.exercise.title}`,ogDescription:`Elaboration for exercise ${Number(i)}`,instructor:o.instructor,requestInfo:o.requestInfo})},y={h1:()=>null},re=n(function({loaderData:r}){const i=r.exercise.exerciseNumber.toString().padStart(2,"0");return u({watchPaths:[`./exercises/${i}/FINISHED.mdx`]}),e.jsx("div",{className:"flex max-w-full grow flex-col",children:e.jsxs("main",{className:"flex grow flex-col sm:grid sm:h-full sm:min-h-[800px] sm:grid-cols-1 sm:grid-rows-2 md:min-h-[unset] lg:grid-cols-2 lg:grid-rows-1",children:[e.jsxs("div",{className:"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r",children:[e.jsx("h1",{className:"h-14 border-b pr-5 pl-10 text-sm leading-tight font-medium",children:e.jsx("div",{className:"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2",children:e.jsxs("div",{className:"flex items-center justify-start gap-x-2",children:[e.jsx(l,{to:`/${i}`,className:"hover:underline",children:`${i}. ${r.exercise.title}`}),e.jsx("span",{children:"/"}),e.jsx("span",{children:"Elaboration"})]})})}),e.jsxs("article",{className:"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-2 sm:p-10 sm:pt-8",id:r.articleId,children:[r.exercise.finishedCode?e.jsx(a,{epicVideoInfosPromise:r.epicVideoInfosPromise,children:e.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:e.jsx(N,{code:r.exercise.finishedCode,components:y})})}):"No finished instructions yet...",e.jsx(h,{exerciseNumber:r.exercise.exerciseNumber})]}),e.jsx(c,{elementQuery:`#${r.articleId}`}),e.jsx(j,{type:"finished",exerciseNumber:r.exercise.exerciseNumber,className:"h-14 border-t px-6"}),e.jsxs("div",{className:"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0",children:[e.jsx("div",{}),e.jsx(b,{file:r.exerciseFinished.file,relativePath:r.exerciseFinished.relativePath}),e.jsx(p,{prev:r.prevStepLink,next:r.nextStepLink})]})]}),e.jsx($,{exerciseFormEmbedUrl:r.exerciseFormEmbedUrl,exerciseTitle:r.exercise.title})]})})});function $({exerciseFormEmbedUrl:s,exerciseTitle:r}){const i=g(),[o,t]=m.useState(!1);return v()?e.jsxs("div",{className:"relative min-h-full sm:min-h-[unset] sm:shrink-0",children:[o?null:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(f,{children:e.jsxs("span",{children:["Loading ",r," Elaboration form"]})})}),e.jsx("iframe",{onLoad:()=>t(!0),onError:()=>t(!0),title:"Elaboration",src:s,className:d("absolute inset-0 flex h-full w-full transition-opacity duration-300",o?"opacity-100":"opacity-0"),style:{colorScheme:i}})]}):e.jsx("div",{className:"relative shrink-0",children:e.jsx("div",{className:"text-body-md text-foreground-destructive absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(x,{name:"WifiNoConnection",size:"xl",children:e.jsxs("span",{children:["Unable to load the ",e.jsx("a",{href:s,className:"underline",children:`${r} feedback form`})," when offline"]})})})})}export{re as default,ee as meta};
|
|
2
|
+
//# sourceMappingURL=_exerciseNumber_.finished-D5eMZ_ok.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_exerciseNumber_.finished-BRspQYAo.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber_.finished.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetAppPageRoute,\n\tgetApps,\n\tgetExercise,\n\tgetWorkshopRoot,\n\tisExtraApp,\n\tisExerciseStepApp,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n} from '@epic-web/workshop-utils/timing.server'\nimport slugify from '@sindresorhus/slugify'\nimport * as React from 'react'\nimport { data, type HeadersFunction, Link } from 'react-router'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { Icon } from '#app/components/icons.tsx'\nimport { Loading } from '#app/components/loading.tsx'\nimport { NavChevrons } from '#app/components/nav-chevrons.tsx'\nimport { RetrievalPractice } from '#app/components/retrieval-practice.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { useTheme } from '#app/routes/theme/index.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { cn } from '#app/utils/misc.tsx'\nimport { useIsOnline } from '#app/utils/online.ts'\nimport { getRootMatchLoaderData } from '#app/utils/root-loader.ts'\nimport { getSeoMetaTags } from '#app/utils/seo.ts'\nimport { type Route } from './+types/$exerciseNumber_.finished.tsx'\n\nexport const meta: Route.MetaFunction = ({ loaderData, matches }) => {\n\tconst number = loaderData?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = getRootMatchLoaderData(matches)\n\tif (!loaderData || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `🦉 | ${number}. ${loaderData.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Elaboration for ${number}. ${loaderData.exercise.title}`,\n\t\togTitle: `Finished: ${loaderData.exercise.title}`,\n\t\togDescription: `Elaboration for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: Route.LoaderArgs) {\n\tconst timings = makeTimings('exerciseFinishedLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst exercise = await getExercise(params.exerciseNumber, {\n\t\ttimings,\n\t\trequest,\n\t})\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\tconst workshopConfig = getWorkshopConfig()\n\tconst exerciseFormTemplate = workshopConfig.forms.exercise\n\tconst exerciseFormEmbedUrl = exerciseFormTemplate\n\t\t.replace('{workshopTitle}', encodeURIComponent(workshopConfig.title))\n\t\t.replace('{exerciseTitle}', encodeURIComponent(exercise.title))\n\tconst nextExercise = await getExercise(exercise.exerciseNumber + 1, {\n\t\ttimings,\n\t\trequest,\n\t})\n\n\tconst finishedFilepath = path.join(\n\t\tgetWorkshopRoot(),\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'FINISHED.mdx',\n\t)\n\n\tconst apps = await getApps({ request, timings })\n\tconst hasExtras = apps.some(isExtraApp)\n\tconst exerciseApps = apps\n\t\t.filter(isExerciseStepApp)\n\t\t.filter((app) => app.exerciseNumber === exercise.exerciseNumber)\n\tconst prevApp = exerciseApps[exerciseApps.length - 1]\n\n\tconst articleId = `workshop-${slugify(workshopConfig.title)}-${\n\t\texercise.exerciseNumber\n\t}-finished`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\tworkshopTitle: workshopConfig.title,\n\t\t\texercise,\n\t\t\texerciseFormEmbedUrl,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.finishedEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t\texerciseFinished: {\n\t\t\t\tfile: finishedFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}/FINISHED.mdx`,\n\t\t\t},\n\t\t\tprevStepLink: prevApp\n\t\t\t\t? {\n\t\t\t\t\t\tto: getAppPageRoute(prevApp),\n\t\t\t\t\t\t'aria-label': `${prevApp.title} (${prevApp.type})`,\n\t\t\t\t\t}\n\t\t\t\t: null,\n\t\t\tnextStepLink: nextExercise\n\t\t\t\t? {\n\t\t\t\t\t\tto: `/exercise/${nextExercise.exerciseNumber.toString().padStart(2, '0')}`,\n\t\t\t\t\t\t'aria-label': `${nextExercise.title}`,\n\t\t\t\t\t}\n\t\t\t\t: hasExtras\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tto: '/extra',\n\t\t\t\t\t\t\t'aria-label': 'Extras',\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tto: '/finished',\n\t\t\t\t\t\t\t'aria-label': 'Finished! 🎉',\n\t\t\t\t\t\t},\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nconst mdxComponents = { h1: () => null }\nexport default function ExerciseFinished({\n\tloaderData: data,\n}: Route.ComponentProps) {\n\tconst exerciseNumber = data.exercise.exerciseNumber\n\t\t.toString()\n\t\t.padStart(2, '0')\n\n\tuseRevalidationWS({\n\t\twatchPaths: [`./exercises/${exerciseNumber}/FINISHED.mdx`],\n\t})\n\n\treturn (\n\t\t<div className=\"flex max-w-full grow flex-col\">\n\t\t\t<main className=\"flex grow flex-col sm:grid sm:h-full sm:min-h-[800px] sm:grid-cols-1 sm:grid-rows-2 md:min-h-[unset] lg:grid-cols-2 lg:grid-rows-1\">\n\t\t\t\t<div className=\"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r\">\n\t\t\t\t\t<h1 className=\"h-14 border-b pr-5 pl-10 text-sm leading-tight font-medium\">\n\t\t\t\t\t\t<div className=\"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2\">\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-start gap-x-2\">\n\t\t\t\t\t\t\t\t<Link to={`/${exerciseNumber}`} className=\"hover:underline\">\n\t\t\t\t\t\t\t\t\t{`${exerciseNumber}. ${data.exercise.title}`}\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t<span>/</span>\n\t\t\t\t\t\t\t\t<span>Elaboration</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</h1>\n\n\t\t\t\t\t<article\n\t\t\t\t\t\tclassName=\"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-2 sm:p-10 sm:pt-8\"\n\t\t\t\t\t\tid={data.articleId}\n\t\t\t\t\t>\n\t\t\t\t\t\t{data.exercise.finishedCode ? (\n\t\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\t\tcode={data.exercise.finishedCode}\n\t\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t// TODO: render a random dad joke...\n\t\t\t\t\t\t\t'No finished instructions yet...'\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<RetrievalPractice exerciseNumber={data.exercise.exerciseNumber} />\n\t\t\t\t\t</article>\n\t\t\t\t\t<ElementScrollRestoration elementQuery={`#${data.articleId}`} />\n\t\t\t\t\t<ProgressToggle\n\t\t\t\t\t\ttype=\"finished\"\n\t\t\t\t\t\texerciseNumber={data.exercise.exerciseNumber}\n\t\t\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0\">\n\t\t\t\t\t\t<div />\n\t\t\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\t\t\tfile={data.exerciseFinished.file}\n\t\t\t\t\t\t\trelativePath={data.exerciseFinished.relativePath}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NavChevrons prev={data.prevStepLink} next={data.nextStepLink} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<Survey\n\t\t\t\t\texerciseFormEmbedUrl={data.exerciseFormEmbedUrl}\n\t\t\t\t\texerciseTitle={data.exercise.title}\n\t\t\t\t/>\n\t\t\t</main>\n\t\t</div>\n\t)\n}\n\nfunction Survey({\n\texerciseFormEmbedUrl,\n\texerciseTitle,\n}: {\n\texerciseFormEmbedUrl: string\n\texerciseTitle: string\n}) {\n\tconst theme = useTheme()\n\tconst [iframeLoaded, setIframeLoaded] = React.useState(false)\n\tconst isOnline = useIsOnline()\n\tif (!isOnline) {\n\t\treturn (\n\t\t\t<div className=\"relative shrink-0\">\n\t\t\t\t<div className=\"text-body-md text-foreground-destructive absolute inset-0 z-10 flex items-center justify-center\">\n\t\t\t\t\t<Icon name=\"WifiNoConnection\" size=\"xl\">\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{'Unable to load the '}\n\t\t\t\t\t\t\t<a href={exerciseFormEmbedUrl} className=\"underline\">\n\t\t\t\t\t\t\t\t{`${exerciseTitle} feedback form`}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t{' when offline'}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Icon>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t)\n\t}\n\treturn (\n\t\t<div className=\"relative min-h-full sm:min-h-[unset] sm:shrink-0\">\n\t\t\t{!iframeLoaded ? (\n\t\t\t\t<div className=\"absolute inset-0 z-10 flex items-center justify-center\">\n\t\t\t\t\t<Loading>\n\t\t\t\t\t\t<span>Loading {exerciseTitle} Elaboration form</span>\n\t\t\t\t\t</Loading>\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t<iframe\n\t\t\t\tonLoad={() => setIframeLoaded(true)}\n\t\t\t\t// show what would have shown if there is an error\n\t\t\t\tonError={() => setIframeLoaded(true)}\n\t\t\t\ttitle=\"Elaboration\"\n\t\t\t\tsrc={exerciseFormEmbedUrl}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'absolute inset-0 flex h-full w-full transition-opacity duration-300',\n\t\t\t\t\tiframeLoaded ? 'opacity-100' : 'opacity-0',\n\t\t\t\t)}\n\t\t\t\tstyle={{ colorScheme: theme }}\n\t\t\t/>\n\t\t</div>\n\t)\n}\n"],"names":["meta","loaderData","matches","number","exercise","exerciseNumber","toString","padStart","rootData","getRootMatchLoaderData","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","$exerciseNumber__finished","_UNSAFE_withComponentProps","data","useRevalidationWS","watchPaths","className","children","jsxs","jsx","Link","to","id","articleId","finishedCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","RetrievalPractice","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","file","exerciseFinished","relativePath","NavChevrons","prev","prevStepLink","next","nextStepLink","Survey","exerciseFormEmbedUrl","exerciseTitle","theme","useTheme","iframeLoaded","setIframeLoaded","React","useIsOnline","Loading","onLoad","onError","src","cn","style","colorScheme","Icon","name","size","href"],"mappings":"qiCAqCO,MAAMA,GAA2BA,CAAC,CAAEC,WAAAA,EAAYC,QAAAA,CAAQ,IAAM,CACpE,MAAMC,EAASF,GAAYG,SAASC,eAAeC,WAAWC,SAAS,EAAG,GAAG,EAEvEC,EAAWC,EAAuBP,CAAO,EAC/C,MAAI,CAACD,GAAc,CAACO,EAAiB,CAAC,CAAEE,MAAO,YAAa,CAAC,EAEtDC,EAAe,CACrBD,MAAO,QAAQP,CAAM,KAAKF,EAAWG,SAASM,KAAK,MAAMF,GAAUI,aAAa,GAChFC,YAAa,mBAAmBV,CAAM,KAAKF,EAAWG,SAASM,KAAK,GACpEI,QAAS,aAAab,EAAWG,SAASM,KAAK,GAC/CK,cAAe,4BAA4BC,OAAOb,CAAM,CAAC,GACzDc,WAAYT,EAASS,WACrBC,YAAaV,EAASU,WACvB,CAAC,CACF,EA2FMC,EAAgB,CAAEC,GAAIA,IAAM,IAAK,EACvCC,GAAAC,EAAA,SAAyC,CACxCrB,WAAYsB,CACb,EAAyB,CACxB,MAAMlB,EAAiBkB,EAAKnB,SAASC,eACnCC,WACAC,SAAS,EAAG,GAAG,EAEjBiB,OAAAA,EAAkB,CACjBC,WAAY,CAAC,eAAepB,CAAc,eAAe,CAC1D,CAAC,QAGC,MAAA,CAAIqB,UAAU,gCACdC,SAAAC,EAAAA,KAAC,OAAA,CAAKF,UAAU,qIACfC,SAAA,CAAAC,EAAAA,KAAC,MAAA,CAAIF,UAAU,2EACdC,SAAA,CAAAE,EAAAA,IAAC,KAAA,CAAGH,UAAU,6DACbC,SAAAE,EAAAA,IAAC,MAAA,CAAIH,UAAU,gEACdC,SAAAC,EAAAA,KAAC,MAAA,CAAI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,CAAA,EACD,CAAA,CACD,CAEF,CAAA,EAEA,SAAS4C,EAAO,CACfC,qBAAAA,EACAC,cAAAA,CACD,EAGG,CACF,MAAMC,EAAQC,EAAA,EACR,CAACC,EAAcC,CAAe,EAAIC,EAAAA,SAAe,EAAK,EAE5D,OADiBC,EAAA,EAmBhBlC,EAAAA,KAAC,MAAA,CAAIF,UAAU,mDACbC,SAAA,CAACgC,EAME,WALF,MAAA,CAAIjC,UAAU,yDACdC,SAAAE,EAAAA,IAACkC,EAAA,CACApC,gBAAC,OAAA,CAAKA,SAAA,CAAA,WAAS6B,EAAc,mBAAA,EAAiB,EAC/C,EACD,EAED3B,EAAAA,IAAC,SAAA,CACAmC,OAAQA,IAAMJ,EAAgB,EAAI,EAElCK,QAASA,IAAML,EAAgB,EAAI,EACnClD,MAAM,cACNwD,IAAKX,EACL7B,UAAWyC,EACV,sEACAR,EAAe,cAAgB,WAChC,EACAS,MAAO,CAAEC,YAAaZ,CAAM,CAAA,CAC7B,CAAA,CAAA,CACD,EApCC5B,EAAAA,IAAC,MAAA,CAAIH,UAAU,oBACdC,eAAC,MAAA,CAAID,UAAU,kGACdC,SAAAE,EAAAA,IAACyC,GAAKC,KAAK,mBAAmBC,KAAK,KAClC7C,gBAAC,OAAA,CACCA,SAAA,CAAA,sBACDE,EAAAA,IAAC,KAAE4C,KAAMlB,EAAsB7B,UAAU,YACvCC,SAAA,GAAG6B,CAAa,iBAClB,EACC,eAAA,EACF,EACD,EACD,CAAA,CACD,CA0BH"}
|
|
1
|
+
{"version":3,"file":"_exerciseNumber_.finished-D5eMZ_ok.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber_.finished.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetAppPageRoute,\n\tgetApps,\n\tgetExercise,\n\tgetWorkshopRoot,\n\tisExtraApp,\n\tisExerciseStepApp,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n} from '@epic-web/workshop-utils/timing.server'\nimport slugify from '@sindresorhus/slugify'\nimport * as React from 'react'\nimport { data, type HeadersFunction, Link } from 'react-router'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { Icon } from '#app/components/icons.tsx'\nimport { Loading } from '#app/components/loading.tsx'\nimport { NavChevrons } from '#app/components/nav-chevrons.tsx'\nimport { RetrievalPractice } from '#app/components/retrieval-practice.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { useTheme } from '#app/routes/theme/index.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { cn } from '#app/utils/misc.tsx'\nimport { useIsOnline } from '#app/utils/online.ts'\nimport { getRootMatchLoaderData } from '#app/utils/root-loader.ts'\nimport { getSeoMetaTags } from '#app/utils/seo.ts'\nimport { type Route } from './+types/$exerciseNumber_.finished.tsx'\n\nexport const meta: Route.MetaFunction = ({ loaderData, matches }) => {\n\tconst number = loaderData?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = getRootMatchLoaderData(matches)\n\tif (!loaderData || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `🦉 | ${number}. ${loaderData.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Elaboration for ${number}. ${loaderData.exercise.title}`,\n\t\togTitle: `Finished: ${loaderData.exercise.title}`,\n\t\togDescription: `Elaboration for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: Route.LoaderArgs) {\n\tconst timings = makeTimings('exerciseFinishedLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst exercise = await getExercise(params.exerciseNumber, {\n\t\ttimings,\n\t\trequest,\n\t})\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\tconst workshopConfig = getWorkshopConfig()\n\tconst exerciseFormTemplate = workshopConfig.forms.exercise\n\tconst exerciseFormEmbedUrl = exerciseFormTemplate\n\t\t.replace('{workshopTitle}', encodeURIComponent(workshopConfig.title))\n\t\t.replace('{exerciseTitle}', encodeURIComponent(exercise.title))\n\tconst nextExercise = await getExercise(exercise.exerciseNumber + 1, {\n\t\ttimings,\n\t\trequest,\n\t})\n\n\tconst finishedFilepath = path.join(\n\t\tgetWorkshopRoot(),\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'FINISHED.mdx',\n\t)\n\n\tconst apps = await getApps({ request, timings })\n\tconst hasExtras = apps.some(isExtraApp)\n\tconst exerciseApps = apps\n\t\t.filter(isExerciseStepApp)\n\t\t.filter((app) => app.exerciseNumber === exercise.exerciseNumber)\n\tconst prevApp = exerciseApps[exerciseApps.length - 1]\n\n\tconst articleId = `workshop-${slugify(workshopConfig.title)}-${\n\t\texercise.exerciseNumber\n\t}-finished`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\tworkshopTitle: workshopConfig.title,\n\t\t\texercise,\n\t\t\texerciseFormEmbedUrl,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.finishedEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t\texerciseFinished: {\n\t\t\t\tfile: finishedFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}/FINISHED.mdx`,\n\t\t\t},\n\t\t\tprevStepLink: prevApp\n\t\t\t\t? {\n\t\t\t\t\t\tto: getAppPageRoute(prevApp),\n\t\t\t\t\t\t'aria-label': `${prevApp.title} (${prevApp.type})`,\n\t\t\t\t\t}\n\t\t\t\t: null,\n\t\t\tnextStepLink: nextExercise\n\t\t\t\t? {\n\t\t\t\t\t\tto: `/exercise/${nextExercise.exerciseNumber.toString().padStart(2, '0')}`,\n\t\t\t\t\t\t'aria-label': `${nextExercise.title}`,\n\t\t\t\t\t}\n\t\t\t\t: hasExtras\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tto: '/extra',\n\t\t\t\t\t\t\t'aria-label': 'Extras',\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tto: '/finished',\n\t\t\t\t\t\t\t'aria-label': 'Finished! 🎉',\n\t\t\t\t\t\t},\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nconst mdxComponents = { h1: () => null }\nexport default function ExerciseFinished({\n\tloaderData: data,\n}: Route.ComponentProps) {\n\tconst exerciseNumber = data.exercise.exerciseNumber\n\t\t.toString()\n\t\t.padStart(2, '0')\n\n\tuseRevalidationWS({\n\t\twatchPaths: [`./exercises/${exerciseNumber}/FINISHED.mdx`],\n\t})\n\n\treturn (\n\t\t<div className=\"flex max-w-full grow flex-col\">\n\t\t\t<main className=\"flex grow flex-col sm:grid sm:h-full sm:min-h-[800px] sm:grid-cols-1 sm:grid-rows-2 md:min-h-[unset] lg:grid-cols-2 lg:grid-rows-1\">\n\t\t\t\t<div className=\"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r\">\n\t\t\t\t\t<h1 className=\"h-14 border-b pr-5 pl-10 text-sm leading-tight font-medium\">\n\t\t\t\t\t\t<div className=\"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2\">\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-start gap-x-2\">\n\t\t\t\t\t\t\t\t<Link to={`/${exerciseNumber}`} className=\"hover:underline\">\n\t\t\t\t\t\t\t\t\t{`${exerciseNumber}. ${data.exercise.title}`}\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t<span>/</span>\n\t\t\t\t\t\t\t\t<span>Elaboration</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</h1>\n\n\t\t\t\t\t<article\n\t\t\t\t\t\tclassName=\"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-2 sm:p-10 sm:pt-8\"\n\t\t\t\t\t\tid={data.articleId}\n\t\t\t\t\t>\n\t\t\t\t\t\t{data.exercise.finishedCode ? (\n\t\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\t\tcode={data.exercise.finishedCode}\n\t\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t// TODO: render a random dad joke...\n\t\t\t\t\t\t\t'No finished instructions yet...'\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<RetrievalPractice exerciseNumber={data.exercise.exerciseNumber} />\n\t\t\t\t\t</article>\n\t\t\t\t\t<ElementScrollRestoration elementQuery={`#${data.articleId}`} />\n\t\t\t\t\t<ProgressToggle\n\t\t\t\t\t\ttype=\"finished\"\n\t\t\t\t\t\texerciseNumber={data.exercise.exerciseNumber}\n\t\t\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0\">\n\t\t\t\t\t\t<div />\n\t\t\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\t\t\tfile={data.exerciseFinished.file}\n\t\t\t\t\t\t\trelativePath={data.exerciseFinished.relativePath}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NavChevrons prev={data.prevStepLink} next={data.nextStepLink} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<Survey\n\t\t\t\t\texerciseFormEmbedUrl={data.exerciseFormEmbedUrl}\n\t\t\t\t\texerciseTitle={data.exercise.title}\n\t\t\t\t/>\n\t\t\t</main>\n\t\t</div>\n\t)\n}\n\nfunction Survey({\n\texerciseFormEmbedUrl,\n\texerciseTitle,\n}: {\n\texerciseFormEmbedUrl: string\n\texerciseTitle: string\n}) {\n\tconst theme = useTheme()\n\tconst [iframeLoaded, setIframeLoaded] = React.useState(false)\n\tconst isOnline = useIsOnline()\n\tif (!isOnline) {\n\t\treturn (\n\t\t\t<div className=\"relative shrink-0\">\n\t\t\t\t<div className=\"text-body-md text-foreground-destructive absolute inset-0 z-10 flex items-center justify-center\">\n\t\t\t\t\t<Icon name=\"WifiNoConnection\" size=\"xl\">\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{'Unable to load the '}\n\t\t\t\t\t\t\t<a href={exerciseFormEmbedUrl} className=\"underline\">\n\t\t\t\t\t\t\t\t{`${exerciseTitle} feedback form`}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t{' when offline'}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Icon>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t)\n\t}\n\treturn (\n\t\t<div className=\"relative min-h-full sm:min-h-[unset] sm:shrink-0\">\n\t\t\t{!iframeLoaded ? (\n\t\t\t\t<div className=\"absolute inset-0 z-10 flex items-center justify-center\">\n\t\t\t\t\t<Loading>\n\t\t\t\t\t\t<span>Loading {exerciseTitle} Elaboration form</span>\n\t\t\t\t\t</Loading>\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t<iframe\n\t\t\t\tonLoad={() => setIframeLoaded(true)}\n\t\t\t\t// show what would have shown if there is an error\n\t\t\t\tonError={() => setIframeLoaded(true)}\n\t\t\t\ttitle=\"Elaboration\"\n\t\t\t\tsrc={exerciseFormEmbedUrl}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'absolute inset-0 flex h-full w-full transition-opacity duration-300',\n\t\t\t\t\tiframeLoaded ? 'opacity-100' : 'opacity-0',\n\t\t\t\t)}\n\t\t\t\tstyle={{ colorScheme: theme }}\n\t\t\t/>\n\t\t</div>\n\t)\n}\n"],"names":["meta","loaderData","matches","number","exercise","exerciseNumber","toString","padStart","rootData","getRootMatchLoaderData","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","$exerciseNumber__finished","_UNSAFE_withComponentProps","data","useRevalidationWS","watchPaths","className","children","jsxs","jsx","Link","to","id","articleId","finishedCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","RetrievalPractice","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","file","exerciseFinished","relativePath","NavChevrons","prev","prevStepLink","next","nextStepLink","Survey","exerciseFormEmbedUrl","exerciseTitle","theme","useTheme","iframeLoaded","setIframeLoaded","React","useIsOnline","Loading","onLoad","onError","src","cn","style","colorScheme","Icon","name","size","href"],"mappings":"qiCAqCO,MAAMA,GAA2BA,CAAC,CAAEC,WAAAA,EAAYC,QAAAA,CAAQ,IAAM,CACpE,MAAMC,EAASF,GAAYG,SAASC,eAAeC,WAAWC,SAAS,EAAG,GAAG,EAEvEC,EAAWC,EAAuBP,CAAO,EAC/C,MAAI,CAACD,GAAc,CAACO,EAAiB,CAAC,CAAEE,MAAO,YAAa,CAAC,EAEtDC,EAAe,CACrBD,MAAO,QAAQP,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AAML,EAAgB,EAAI,EACnClD,MAAM,cACNwD,IAAKX,EACL7B,UAAWyC,EACV,sEACAR,EAAe,cAAgB,WAChC,EACAS,MAAO,CAAEC,YAAaZ,CAAM,CAAA,CAC7B,CAAA,CAAA,CACD,EApCC5B,EAAAA,IAAC,MAAA,CAAIH,UAAU,oBACdC,eAAC,MAAA,CAAID,UAAU,kGACdC,SAAAE,EAAAA,IAACyC,GAAKC,KAAK,mBAAmBC,KAAK,KAClC7C,gBAAC,OAAA,CACCA,SAAA,CAAA,sBACDE,EAAAA,IAAC,KAAE4C,KAAMlB,EAAsB7B,UAAU,YACvCC,SAAA,GAAG6B,CAAa,iBAClB,EACC,eAAA,EACF,EACD,EACD,CAAA,CACD,CA0BH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{w as T,a as k,b as A,d as $,L as l}from"./chunk-JZWAC4HX-BuixXc9D.js";import{j as r}from"./jsx-runtime-C5WNSv3b.js";import{E as B}from"./index-3PqfcnMA.js";import{g as L,R as M,P as H,C as n,a as O,D as U}from"./playground-
|
|
2
|
-
//# sourceMappingURL=_extra-
|
|
1
|
+
import{w as T,a as k,b as A,d as $,L as l}from"./chunk-JZWAC4HX-BuixXc9D.js";import{j as r}from"./jsx-runtime-C5WNSv3b.js";import{E as B}from"./index-3PqfcnMA.js";import{g as L,R as M,P as H,C as n,a as O,D as U}from"./playground-BV2y1ifv.js";import{r as o}from"./index-Bi6L2ga8.js";import{U as V}from"./diff-C4LoXlDb.js";import{E as z}from"./epic-video-C9q0z-QM.js";import{G as X}from"./error-boundary-DCY9a5Cj.js";import{N as F}from"./nav-chevrons-DUMNZcNc.js";import{u as G}from"./revalidation-ws-JHvxsHsY.js";import{u as W}from"./workshop-config-v_LiyFvY.js";import{P as q}from"./preview-Dav9KrHN.js";import{E as Y}from"./launch-editor-C-8ah8qM.js";import{S as _}from"./set-playground-CvYErpku.js";import{c as Q,M as J}from"./mdx-C3Jl4O5D.js";import{g as K,u as Z,a as ee}from"./root-loader-DAxaiFMN.js";import{g as re}from"./seo-t5J-DRxw.js";import{s as v,a as te}from"./split-layout-DnRER1bP.js";import"./misc-D9k_mI0z.js";import"./loading-BjV0PtX2.js";import"./index-DSpM0ReJ.js";import"./tooltip-H74tOFSr.js";import"./index-B2VNpNxJ.js";import"./pe-D585gnmh.js";import"./schemas-siASSt6b.js";import"./discord-CVgNwZp4.js";import"./user-DhjrtSbZ.js";import"./online-x7UFobEJ.js";import"./index-BvE6USCZ.js";import"./index-DosQrH9F.js";import"./status-indicator-C6DiLYL5.js";import"./index-E_6kulJP.js";import"./playground-window-BM8PCQz7.js";import"./react-error-boundary-DFNLMQmr.js";import"./preload-helper-BXl3LOEh.js";import"./format-CZ5n8p10.js";import"./popover-Dh41LPal.js";import"./index-ywSltzcE.js";import"./button-B_EAwzD_.js";import"./progress-bar-BCbq1CuC.js";import"./onboarding-indicator-Csno1yMz.js";import"./dialog-DXBBGJQ6.js";const Ge=i=>{const e=i.data,s=K(i.matches);return!e||!s?[{title:"🦉 | Error"}]:re({title:`📚 | ${e.extra.title} | ${s.workshopTitle}`,description:`Extra: ${e.extra.title}`,ogTitle:e.extra.title,ogDescription:`Extra: ${e.extra.title}`,instructor:s.instructor,requestInfo:s.requestInfo})},We=T(function(){const e=A(),s=Z(),w=ee(),h=o.useRef(null),c=o.useRef(null),y=o.useRef(null),[P,d]=o.useState(e.splitPercent),[g]=$(),b=W(),N=o.useMemo(()=>Promise.resolve(s.userHasAccess??!1),[s.userHasAccess]),j=e.playground?.appName!==e.extra.name,E=j||e.playground?.isUpToDate===!1,p=["playground","extra","diff","chat"],m=g.get("preview"),u=e.previousExtra?{to:`/extra/${e.previousExtra.dirName}`,"aria-label":"Previous Extra"}:{to:"/extra","aria-label":"Extras"},x=e.nextExtra?{to:`/extra/${e.nextExtra.dirName}`,"aria-label":"Next Extra"}:{to:"/finished","aria-label":"Workshop finished"};function D(t){return!!(t&&p.includes(t))}function f(t){if(t==="playground")return ENV.EPICSHOP_DEPLOYED;if(t==="extra"&&ENV.EPICSHOP_DEPLOYED){const a=e.extra.dev.type;return a!=="browser"&&a!=="export"&&!e.extra.stackBlitzUrl}return t==="chat"?!b.product.discordChannelId:!1}const C=D(m)&&!f(m)?m:p.find(t=>!f(t))??"playground",I=p.map(t=>{const a=f(t);return{id:t,label:t,hidden:a,to:`?${L(g,t,"playground")}`}}),S=o.useMemo(()=>{const t=Q(()=>e.playground?{name:e.playground.name,fullPath:e.playground.fullPath}:null,()=>!e.playground||e.playground.appName!==e.extra.name?"Set the playground to this extra before opening a file.":null);return{h1:()=>null,InlineFile:t}},[e.playground,e.extra.name]),R=w.find(t=>t.name===e.playground?.appName)?.fullPath;return G({watchPaths:[e.extraReadme.file,R].filter(t=>!!t)}),r.jsx("div",{className:"flex max-w-full grow flex-col",children:r.jsxs("main",{ref:c,className:"flex grow flex-col sm:h-full sm:min-h-[800px] md:min-h-[unset] lg:flex-row",children:[r.jsxs("div",{className:"relative flex min-w-0 flex-none basis-full flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:basis-(--split-pct)",style:{"--split-pct":`${P}%`},ref:y,children:[r.jsx("h1",{className:"@container h-14 border-b pr-5 pl-10 text-sm leading-tight font-medium",children:r.jsxs("div",{className:"flex h-14 items-center justify-between gap-x-2 py-2 whitespace-nowrap",children:[r.jsxs("div",{className:"flex items-center justify-start gap-x-2 uppercase",children:[r.jsx(l,{to:"/extra",className:"hover:underline",children:r.jsx("span",{children:"Extras"})}),r.jsx("span",{children:"/"}),r.jsx(l,{to:".",className:"hover:underline",children:r.jsx("span",{children:e.extra.title})})]}),E?r.jsx(_,{appName:e.extra.name,isOutdated:e.playground?.isUpToDate===!1,hideTextOnNarrow:!0,showOnboardingIndicator:j}):null]})}),r.jsxs("article",{id:e.articleId,className:"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar flex h-full w-full max-w-none flex-1 scroll-pt-6 flex-col justify-between space-y-6 overflow-y-auto p-2 sm:p-10 sm:pt-8",children:[e.extra.instructionsCode?r.jsx(z,{epicVideoInfosPromise:e.epicVideoInfosPromise,children:r.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:r.jsx(J,{code:e.extra.instructionsCode,components:S})})}):r.jsx("div",{className:"flex h-full items-center justify-center text-lg",children:r.jsx("p",{children:"No instructions yet..."})}),r.jsxs("div",{className:"mt-auto flex justify-between",children:[r.jsxs(l,{to:u.to,"aria-label":u["aria-label"],prefetch:"intent",children:[r.jsx("span",{"aria-hidden":!0,children:"←"}),r.jsx("span",{className:"hidden xl:inline",children:" Previous"})]}),r.jsxs(l,{to:x.to,"aria-label":x["aria-label"],prefetch:"intent",children:[r.jsx("span",{className:"hidden xl:inline",children:"Next "}),r.jsx("span",{"aria-hidden":!0,children:"→"})]})]})]},e.articleId),r.jsx(B,{elementQuery:`#${e.articleId}`},`scroll-${e.articleId}`),r.jsxs("div",{className:"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0",children:[r.jsx("div",{}),r.jsx(Y,{appName:e.extra.name,relativePath:e.extraReadme.relativePath}),r.jsx(F,{prev:u,next:x})]})]}),r.jsx("div",{role:"separator","aria-orientation":"vertical",title:"Drag to resize",className:"bg-border hover:bg-muted hidden w-1 cursor-col-resize lg:block",onMouseDown:t=>v({container:c.current,initialClientX:t.clientX,setSplitPercent:d}),onDoubleClick:()=>{d(te(50))},onTouchStart:t=>{const a=t.touches?.[0];a&&v({container:c.current,initialClientX:a.clientX,setSplitPercent:d})}}),r.jsxs(M,{className:"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",value:C,children:[r.jsx(H,{tabs:I}),r.jsxs("div",{className:"relative z-10 flex min-h-0 flex-1 flex-col overflow-hidden",children:[r.jsx(n,{value:"playground",className:"radix-state-inactive:hidden flex min-h-0 w-full grow basis-0 items-stretch justify-center self-start",forceMount:!0,children:r.jsx(O,{appInfo:e.playground,problemAppName:e.extra.name,allApps:e.allApps??[],isUpToDate:e.playground?.isUpToDate??!1,inBrowserBrowserRef:h})}),r.jsx(n,{value:"extra",className:"radix-state-inactive:hidden flex min-h-0 w-full grow basis-0 items-stretch justify-center self-start",forceMount:!0,children:r.jsx(q,{appInfo:e.extra,inBrowserBrowserRef:h})}),r.jsx(n,{value:"diff",className:"radix-state-inactive:hidden flex h-full min-h-0 w-full grow basis-0 items-stretch justify-center self-start",children:r.jsx(V,{diff:e.diff,allApps:e.allApps,userHasAccessPromise:N})}),r.jsx(n,{value:"chat",className:"radix-state-inactive:hidden flex h-full min-h-0 w-full grow basis-0 items-stretch justify-center self-start",children:r.jsx(U,{discordPostsPromise:e.discordPostsPromise})})]})]})]})})}),qe=k(function(){return r.jsx(X,{})});export{qe as ErrorBoundary,We as default,Ge as meta};
|
|
2
|
+
//# sourceMappingURL=_extra-Bd0-gThk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_extra-qH2jDBa4.js","sources":["../../../app/routes/_app+/extra+/$extra.tsx"],"sourcesContent":["import { type Route } from './+types/$extra'\nimport path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetAppByName,\n\tgetAppDisplayName,\n\tgetApps,\n\tisExtraApp,\n\tisPlaygroundApp,\n\ttype ExtraApp,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getDiffPatch } from '@epic-web/workshop-utils/diff.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n\ttime,\n} from '@epic-web/workshop-utils/timing.server'\nimport * as Tabs from '@radix-ui/react-tabs'\nimport slugify from '@sindresorhus/slugify'\nimport { useMemo, useRef, useState } from 'react'\nimport {\n\tLink,\n\tdata,\n\ttype HeadersFunction,\n\tuseLoaderData,\n\tuseSearchParams,\n} from 'react-router'\nimport { Diff } from '#app/components/diff.tsx'\nimport { DiscordChat } from '#app/components/discord-chat.tsx'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { GeneralErrorBoundary } from '#app/components/error-boundary.tsx'\nimport { type InBrowserBrowserRef } from '#app/components/in-browser-browser.tsx'\nimport { NavChevrons } from '#app/components/nav-chevrons.tsx'\nimport {\n\tgetPreviewSearchParams,\n\tPreviewTabsList,\n} from '#app/components/preview-tabs.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.tsx'\nimport { useWorkshopConfig } from '#app/components/workshop-config.tsx'\nimport { Playground } from '#app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/__shared/playground.tsx'\nimport { Preview } from '#app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/__shared/preview.tsx'\nimport { getAppRunningState } from '#app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/__shared/utils.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { SetAppToPlayground } from '#app/routes/set-playground.tsx'\nimport { fetchDiscordPosts } from '#app/utils/discord.server.ts'\nimport { createInlineFileComponent, Mdx } from '#app/utils/mdx.tsx'\nimport {\n\tgetRootMatchLoaderData,\n\tuseApps,\n\tuseRootLoaderData,\n} from '#app/utils/root-loader.ts'\nimport { getSeoMetaTags } from '#app/utils/seo.ts'\nimport {\n\tgetSplitPercentFromRequest,\n\tsetSplitPercentCookie,\n\tstartSplitDrag,\n} from '#app/utils/split-layout.ts'\n\nfunction sortExtras(extras: ExtraApp[]) {\n\treturn extras.sort((a, b) =>\n\t\ta.title.localeCompare(b.title, undefined, {\n\t\t\tnumeric: true,\n\t\t\tsensitivity: 'base',\n\t\t}),\n\t)\n}\n\nexport const meta: Route.MetaFunction = (args) => {\n\tconst loaderData = args.data\n\tconst rootData = getRootMatchLoaderData(args.matches)\n\tif (!loaderData || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `📚 | ${loaderData.extra.title} | ${rootData.workshopTitle}`,\n\t\tdescription: `Extra: ${loaderData.extra.title}`,\n\t\togTitle: loaderData.extra.title,\n\t\togDescription: `Extra: ${loaderData.extra.title}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: Route.LoaderArgs) {\n\tconst timings = makeTimings('extraLoader')\n\tinvariantResponse(params.extra, 'extra is required')\n\n\tconst { title: workshopTitle } = getWorkshopConfig()\n\tconst cacheOptions = { request, timings }\n\tconst apps = await time(() => getApps(cacheOptions), {\n\t\ttimings,\n\t\ttype: 'getApps',\n\t\tdesc: 'getApps in extra loader',\n\t})\n\tconst extras = sortExtras(apps.filter(isExtraApp))\n\tconst playgroundApp = apps.find(isPlaygroundApp)\n\tconst extraIndex = extras.findIndex((extra) => extra.dirName === params.extra)\n\tconst extra = extras[extraIndex]\n\tif (!extra) {\n\t\tthrow new Response('Extra not found', { status: 404 })\n\t}\n\n\tconst readmeFilepath = path.join(extra.fullPath, 'README.mdx')\n\tconst previousExtra = extras[extraIndex - 1]\n\tconst nextExtra = extras[extraIndex + 1]\n\tconst reqUrl = new URL(request.url)\n\tconst app1Name = reqUrl.searchParams.get('app1')\n\tconst app2Name = reqUrl.searchParams.get('app2')\n\tconst app1 = app1Name\n\t\t? await getAppByName(app1Name)\n\t\t: (playgroundApp ?? extra)\n\tconst app2 = app2Name ? await getAppByName(app2Name) : extra\n\tconst splitPercent = getSplitPercentFromRequest(request, 50)\n\n\tconst { isRunning, portIsAvailable } = await getAppRunningState(extra)\n\n\tasync function getDiffProp() {\n\t\tif (!app1 || !app2) {\n\t\t\treturn { app1: app1?.name, app2: app2?.name, diffPatch: null }\n\t\t}\n\t\tconst diffPatch = await getDiffPatch(app1, app2, {\n\t\t\t...cacheOptions,\n\t\t\tforceFresh: reqUrl.searchParams.get('forceFresh') === 'diff',\n\t\t}).catch((error) => {\n\t\t\tconsole.error(error)\n\t\t\treturn null\n\t\t})\n\t\treturn {\n\t\t\tapp1: app1.name,\n\t\t\tapp2: app2.name,\n\t\t\tdiffPatch,\n\t\t}\n\t}\n\n\tconst allApps = apps\n\t\t.filter(\n\t\t\t(app, index, list) =>\n\t\t\t\tlist.findIndex((item) => item.name === app.name) === index,\n\t\t)\n\t\t.map((app) => ({\n\t\t\tname: app.name,\n\t\t\tdisplayName: getAppDisplayName(app, apps),\n\t\t}))\n\t\t.sort((a, b) =>\n\t\t\ta.displayName.localeCompare(b.displayName, undefined, {\n\t\t\t\tnumeric: true,\n\t\t\t\tsensitivity: 'base',\n\t\t\t}),\n\t\t)\n\n\treturn data(\n\t\t{\n\t\t\tarticleId: `workshop-${slugify(workshopTitle)}-${slugify(\n\t\t\t\textra.title,\n\t\t\t)}-extra`,\n\t\t\tsplitPercent,\n\t\t\textra: {\n\t\t\t\ttype: 'extra',\n\t\t\t\tname: extra.name,\n\t\t\t\ttitle: extra.title,\n\t\t\t\tdirName: extra.dirName,\n\t\t\t\tfullPath: extra.fullPath,\n\t\t\t\trelativePath: extra.relativePath,\n\t\t\t\tdev: extra.dev,\n\t\t\t\ttest: extra.test,\n\t\t\t\tstackBlitzUrl: extra.stackBlitzUrl,\n\t\t\t\tisRunning,\n\t\t\t\tportIsAvailable,\n\t\t\t\tepicVideoEmbeds: extra.epicVideoEmbeds,\n\t\t\t\tinstructionsCode: extra.instructionsCode,\n\t\t\t},\n\t\t\textraReadme: {\n\t\t\t\tfile: readmeFilepath,\n\t\t\t\trelativePath: path.join(extra.relativePath, 'README.mdx'),\n\t\t\t},\n\t\t\tplayground: playgroundApp\n\t\t\t\t? ({\n\t\t\t\t\t\ttype: 'playground',\n\t\t\t\t\t\tappName: playgroundApp.appName,\n\t\t\t\t\t\tname: playgroundApp.name,\n\t\t\t\t\t\ttitle: playgroundApp.title,\n\t\t\t\t\t\tfullPath: playgroundApp.fullPath,\n\t\t\t\t\t\tdev: playgroundApp.dev,\n\t\t\t\t\t\ttest: playgroundApp.test,\n\t\t\t\t\t\tstackBlitzUrl: playgroundApp.stackBlitzUrl,\n\t\t\t\t\t\tisUpToDate: playgroundApp.isUpToDate,\n\t\t\t\t\t\t...(await getAppRunningState(playgroundApp)),\n\t\t\t\t\t} as const)\n\t\t\t\t: null,\n\t\t\tallApps,\n\t\t\tdiff: getDiffProp(),\n\t\t\tdiscordPostsPromise: fetchDiscordPosts({ request }),\n\t\t\tpreviousExtra: previousExtra\n\t\t\t\t? { dirName: previousExtra.dirName, title: previousExtra.title }\n\t\t\t\t: null,\n\t\t\tnextExtra: nextExtra\n\t\t\t\t? { dirName: nextExtra.dirName, title: nextExtra.title }\n\t\t\t\t: null,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(extra.epicVideoEmbeds, {\n\t\t\t\trequest,\n\t\t\t}),\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nexport default function ExtraRoute() {\n\tconst data = useLoaderData<typeof loader>()\n\tconst rootData = useRootLoaderData()\n\tconst apps = useApps()\n\tconst inBrowserBrowserRef = useRef<InBrowserBrowserRef>(null)\n\tconst containerRef = useRef<HTMLDivElement>(null)\n\tconst leftPaneRef = useRef<HTMLDivElement>(null)\n\tconst [splitPercent, setSplitPercent] = useState<number>(data.splitPercent)\n\tconst [searchParams] = useSearchParams()\n\tconst workshopConfig = useWorkshopConfig()\n\tconst userHasAccessPromise = useMemo(\n\t\t() => Promise.resolve(rootData.userHasAccess ?? false),\n\t\t[rootData.userHasAccess],\n\t)\n\tconst showPlaygroundIndicator = data.playground?.appName !== data.extra.name\n\tconst shouldShowSetPlayground =\n\t\tshowPlaygroundIndicator || data.playground?.isUpToDate === false\n\tconst tabs = ['playground', 'extra', 'diff', 'chat'] as const\n\tconst preview = searchParams.get('preview')\n\tconst previousExtraLink = data.previousExtra\n\t\t? {\n\t\t\t\tto: `/extra/${data.previousExtra.dirName}`,\n\t\t\t\t'aria-label': 'Previous Extra',\n\t\t\t}\n\t\t: {\n\t\t\t\tto: '/extra',\n\t\t\t\t'aria-label': 'Extras',\n\t\t\t}\n\tconst nextExtraLink = data.nextExtra\n\t\t? {\n\t\t\t\tto: `/extra/${data.nextExtra.dirName}`,\n\t\t\t\t'aria-label': 'Next Extra',\n\t\t\t}\n\t\t: {\n\t\t\t\tto: '/finished',\n\t\t\t\t'aria-label': 'Workshop finished',\n\t\t\t}\n\n\tfunction isValidPreview(\n\t\tvalue: string | null,\n\t): value is (typeof tabs)[number] {\n\t\treturn Boolean(value && tabs.includes(value as (typeof tabs)[number]))\n\t}\n\n\tfunction shouldHideTab(tab: (typeof tabs)[number]) {\n\t\tif (tab === 'playground') {\n\t\t\treturn ENV.EPICSHOP_DEPLOYED\n\t\t}\n\t\tif (tab === 'extra') {\n\t\t\tif (ENV.EPICSHOP_DEPLOYED) {\n\t\t\t\tconst devType = data.extra.dev.type\n\t\t\t\treturn (\n\t\t\t\t\tdevType !== 'browser' &&\n\t\t\t\t\tdevType !== 'export' &&\n\t\t\t\t\t!data.extra.stackBlitzUrl\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\tif (tab === 'chat') {\n\t\t\treturn !workshopConfig.product.discordChannelId\n\t\t}\n\t\treturn false\n\t}\n\n\tconst activeTab =\n\t\tisValidPreview(preview) && !shouldHideTab(preview)\n\t\t\t? preview\n\t\t\t: (tabs.find((tab) => !shouldHideTab(tab)) ?? 'playground')\n\n\tconst previewTabs = tabs.map((tab) => {\n\t\tconst hidden = shouldHideTab(tab)\n\t\treturn {\n\t\t\tid: tab,\n\t\t\tlabel: tab,\n\t\t\thidden,\n\t\t\tto: `?${getPreviewSearchParams(searchParams, tab, 'playground')}`,\n\t\t}\n\t})\n\n\t// Create MDX components with playground-specific InlineFile\n\tconst mdxComponents = useMemo(() => {\n\t\tconst InlineFile = createInlineFileComponent(\n\t\t\t() =>\n\t\t\t\tdata.playground\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tname: data.playground.name,\n\t\t\t\t\t\t\tfullPath: data.playground.fullPath,\n\t\t\t\t\t\t}\n\t\t\t\t\t: null,\n\t\t\t() =>\n\t\t\t\t!data.playground || data.playground.appName !== data.extra.name\n\t\t\t\t\t? 'Set the playground to this extra before opening a file.'\n\t\t\t\t\t: null,\n\t\t)\n\t\treturn {\n\t\t\t// we'll render the title ourselves thank you\n\t\t\th1: () => null,\n\t\t\tInlineFile,\n\t\t}\n\t}, [data.playground, data.extra.name])\n\n\tconst playgroundBasePath = apps.find(\n\t\t(app) => app.name === data.playground?.appName,\n\t)?.fullPath\n\n\tuseRevalidationWS({\n\t\twatchPaths: [data.extraReadme.file, playgroundBasePath].filter(\n\t\t\t(path): path is string => Boolean(path),\n\t\t),\n\t})\n\n\treturn (\n\t\t<div className=\"flex max-w-full grow flex-col\">\n\t\t\t<main\n\t\t\t\tref={containerRef}\n\t\t\t\tclassName=\"flex grow flex-col sm:h-full sm:min-h-[800px] md:min-h-[unset] lg:flex-row\"\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"relative flex min-w-0 flex-none basis-full flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:basis-(--split-pct)\"\n\t\t\t\t\tstyle={{ ['--split-pct' as any]: `${splitPercent}%` }}\n\t\t\t\t\tref={leftPaneRef}\n\t\t\t\t>\n\t\t\t\t\t<h1 className=\"@container h-14 border-b pr-5 pl-10 text-sm leading-tight font-medium\">\n\t\t\t\t\t\t<div className=\"flex h-14 items-center justify-between gap-x-2 py-2 whitespace-nowrap\">\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-start gap-x-2 uppercase\">\n\t\t\t\t\t\t\t\t<Link to=\"/extra\" className=\"hover:underline\">\n\t\t\t\t\t\t\t\t\t<span>Extras</span>\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t<span>/</span>\n\t\t\t\t\t\t\t\t<Link to=\".\" className=\"hover:underline\">\n\t\t\t\t\t\t\t\t\t<span>{data.extra.title}</span>\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{shouldShowSetPlayground ? (\n\t\t\t\t\t\t\t\t<SetAppToPlayground\n\t\t\t\t\t\t\t\t\tappName={data.extra.name}\n\t\t\t\t\t\t\t\t\tisOutdated={data.playground?.isUpToDate === false}\n\t\t\t\t\t\t\t\t\thideTextOnNarrow\n\t\t\t\t\t\t\t\t\tshowOnboardingIndicator={showPlaygroundIndicator}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</h1>\n\t\t\t\t\t<article\n\t\t\t\t\t\tid={data.articleId}\n\t\t\t\t\t\tkey={data.articleId}\n\t\t\t\t\t\tclassName=\"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar flex h-full w-full max-w-none flex-1 scroll-pt-6 flex-col justify-between space-y-6 overflow-y-auto p-2 sm:p-10 sm:pt-8\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{data.extra.instructionsCode ? (\n\t\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\t\tcode={data.extra.instructionsCode}\n\t\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className=\"flex h-full items-center justify-center text-lg\">\n\t\t\t\t\t\t\t\t<p>No instructions yet...</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<div className=\"mt-auto flex justify-between\">\n\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\tto={previousExtraLink.to}\n\t\t\t\t\t\t\t\taria-label={previousExtraLink['aria-label']}\n\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span aria-hidden>←</span>\n\t\t\t\t\t\t\t\t<span className=\"hidden xl:inline\"> Previous</span>\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\tto={nextExtraLink.to}\n\t\t\t\t\t\t\t\taria-label={nextExtraLink['aria-label']}\n\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span className=\"hidden xl:inline\">Next </span>\n\t\t\t\t\t\t\t\t<span aria-hidden>→</span>\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</article>\n\t\t\t\t\t<ElementScrollRestoration\n\t\t\t\t\t\telementQuery={`#${data.articleId}`}\n\t\t\t\t\t\tkey={`scroll-${data.articleId}`}\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0\">\n\t\t\t\t\t\t<div />\n\t\t\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\t\t\tappName={data.extra.name}\n\t\t\t\t\t\t\trelativePath={data.extraReadme.relativePath}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NavChevrons prev={previousExtraLink} next={nextExtraLink} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\trole=\"separator\"\n\t\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\t\ttitle=\"Drag to resize\"\n\t\t\t\t\tclassName=\"bg-border hover:bg-muted hidden w-1 cursor-col-resize lg:block\"\n\t\t\t\t\tonMouseDown={(event) =>\n\t\t\t\t\t\tstartSplitDrag({\n\t\t\t\t\t\t\tcontainer: containerRef.current,\n\t\t\t\t\t\t\tinitialClientX: event.clientX,\n\t\t\t\t\t\t\tsetSplitPercent,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tonDoubleClick={() => {\n\t\t\t\t\t\tsetSplitPercent(setSplitPercentCookie(50))\n\t\t\t\t\t}}\n\t\t\t\t\tonTouchStart={(event) => {\n\t\t\t\t\t\tconst firstTouch = event.touches?.[0]\n\t\t\t\t\t\tif (!firstTouch) return\n\t\t\t\t\t\tstartSplitDrag({\n\t\t\t\t\t\t\tcontainer: containerRef.current,\n\t\t\t\t\t\t\tinitialClientX: firstTouch.clientX,\n\t\t\t\t\t\t\tsetSplitPercent,\n\t\t\t\t\t\t})\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<Tabs.Root\n\t\t\t\t\tclassName=\"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden\"\n\t\t\t\t\tvalue={activeTab}\n\t\t\t\t>\n\t\t\t\t\t<PreviewTabsList tabs={previewTabs} />\n\t\t\t\t\t<div className=\"relative z-10 flex min-h-0 flex-1 flex-col overflow-hidden\">\n\t\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\t\tvalue=\"playground\"\n\t\t\t\t\t\t\tclassName=\"radix-state-inactive:hidden flex min-h-0 w-full grow basis-0 items-stretch justify-center self-start\"\n\t\t\t\t\t\t\tforceMount\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Playground\n\t\t\t\t\t\t\t\tappInfo={data.playground}\n\t\t\t\t\t\t\t\tproblemAppName={data.extra.name}\n\t\t\t\t\t\t\t\tallApps={data.allApps ?? []}\n\t\t\t\t\t\t\t\tisUpToDate={data.playground?.isUpToDate ?? false}\n\t\t\t\t\t\t\t\tinBrowserBrowserRef={inBrowserBrowserRef}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tabs.Content>\n\t\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\t\tvalue=\"extra\"\n\t\t\t\t\t\t\tclassName=\"radix-state-inactive:hidden flex min-h-0 w-full grow basis-0 items-stretch justify-center self-start\"\n\t\t\t\t\t\t\tforceMount\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Preview\n\t\t\t\t\t\t\t\tappInfo={data.extra}\n\t\t\t\t\t\t\t\tinBrowserBrowserRef={inBrowserBrowserRef}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tabs.Content>\n\t\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\t\tvalue=\"diff\"\n\t\t\t\t\t\t\tclassName=\"radix-state-inactive:hidden flex h-full min-h-0 w-full grow basis-0 items-stretch justify-center self-start\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Diff\n\t\t\t\t\t\t\t\tdiff={data.diff}\n\t\t\t\t\t\t\t\tallApps={data.allApps}\n\t\t\t\t\t\t\t\tuserHasAccessPromise={userHasAccessPromise}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tabs.Content>\n\t\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\t\tvalue=\"chat\"\n\t\t\t\t\t\t\tclassName=\"radix-state-inactive:hidden flex h-full min-h-0 w-full grow basis-0 items-stretch justify-center self-start\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DiscordChat discordPostsPromise={data.discordPostsPromise} />\n\t\t\t\t\t\t</Tabs.Content>\n\t\t\t\t\t</div>\n\t\t\t\t</Tabs.Root>\n\t\t\t</main>\n\t\t</div>\n\t)\n}\n\nexport function ErrorBoundary() {\n\treturn <GeneralErrorBoundary />\n}\n"],"names":["meta","args","loaderData","data","rootData","getRootMatchLoaderData","matches","title","getSeoMetaTags","extra","workshopTitle","description","ogTitle","ogDescription","instructor","requestInfo","$extra","_UNSAFE_withComponentProps","useLoaderData","useRootLoaderData","apps","useApps","inBrowserBrowserRef","useRef","containerRef","leftPaneRef","splitPercent","setSplitPercent","useState","searchParams","useSearchParams","workshopConfig","useWorkshopConfig","userHasAccessPromise","useMemo","Promise","resolve","userHasAccess","showPlaygroundIndicator","playground","appName","name","shouldShowSetPlayground","isUpToDate","tabs","preview","get","previousExtraLink","previousExtra","to","dirName","nextExtraLink","nextExtra","isValidPreview","value","Boolean","includes","shouldHideTab","tab","ENV","EPICSHOP_DEPLOYED","devType","dev","type","stackBlitzUrl","product","discordChannelId","activeTab","find","previewTabs","map","hidden","id","label","getPreviewSearchParams","mdxComponents","InlineFile","createInlineFileComponent","fullPath","h1","playgroundBasePath","app","useRevalidationWS","watchPaths","extraReadme","file","filter","path","jsx","className","children","jsxs","ref","style","Link","SetAppToPlayground","isOutdated","hideTextOnNarrow","showOnboardingIndicator","articleId","instructionsCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","prefetch","ElementScrollRestoration","elementQuery","EditFileOnGitHub","relativePath","NavChevrons","prev","next","role","onMouseDown","event","startSplitDrag","container","current","initialClientX","clientX","onDoubleClick","setSplitPercentCookie","onTouchStart","firstTouch","touches","Tabs","PreviewTabsList","forceMount","Playground","appInfo","problemAppName","allApps","Preview","Diff","diff","DiscordChat","discordPostsPromise","ErrorBoundary","_UNSAFE_withErrorBoundaryProps","GeneralErrorBoundary"],"mappings":"onDAuEO,MAAMA,GAA4BC,GAAS,CACjD,MAAMC,EAAaD,EAAKE,KAClBC,EAAWC,EAAuBJ,EAAKK,OAAO,EACpD,MAAI,CAACJ,GAAc,CAACE,EAAiB,CAAC,CAAEG,MAAO,YAAa,CAAC,EAEtDC,GAAe,CACrBD,MAAO,QAAQL,EAAWO,MAAMF,KAAK,MAAMH,EAASM,aAAa,GACjEC,YAAa,UAAUT,EAAWO,MAAMF,KAAK,GAC7CK,QAASV,EAAWO,MAAMF,MAC1BM,cAAe,UAAUX,EAAWO,MAAMF,KAAK,GAC/CO,WAAYV,EAASU,WACrBC,YAAaX,EAASW,WACvB,CAAC,CACF,E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UAAU,6DACdC,SAAA,CAAAF,EAAAA,IAACuC,EAAA,CACAzE,MAAM,aACNmC,UAAU,uGACVwC,WAAU,GAEVvC,SAAAF,EAAAA,IAAC0C,EAAA,CACAC,QAAShI,EAAKoC,WACd6F,eAAgBjI,EAAKM,MAAMgC,KAC3B4F,QAASlI,EAAKkI,SAAW,CAAA,EACzB1F,WAAYxC,EAAKoC,YAAYI,YAAc,GAC3CrB,oBAAAA,EACD,EACD,EACAkE,EAAAA,IAACuC,EAAA,CACAzE,MAAM,QACNmC,UAAU,uGACVwC,WAAU,GAEVvC,SAAAF,EAAAA,IAAC8C,EAAA,CACAH,QAAShI,EAAKM,MACda,oBAAAA,EACD,EACD,EACAkE,EAAAA,IAACuC,EAAA,CACAzE,MAAM,OACNmC,UAAU,8GAEVC,SAAAF,EAAAA,IAAC+C,EAAA,CACAC,KAAMrI,EAAKqI,KACXH,QAASlI,EAAKkI,QACdpG,qBAAAA,EACD,EACD,EACAuD,EAAAA,IAACuC,EAAA,CACAzE,MAAM,OACNmC,UAAU,8GAEVC,SAAAF,EAAAA,IAACiD,EAAA,CAAYC,oBAAqBvI,EAAKuI,oBAAqB,CAAA,CAC7D,CAAA,CAAA,CACD,CAAA,CAAA,CACD,CAAA,EACD,CAAA,CACD,CAEF,CAAA,EAEOC,GAAAC,EAAA,UAAyB,CAC/B,aAAQC,EAAA,EAAqB,CAC9B,CAAA"}
|
|
1
|
+
{"version":3,"file":"_extra-Bd0-gThk.js","sources":["../../../app/routes/_app+/extra+/$extra.tsx"],"sourcesContent":["import { type Route } from './+types/$extra'\nimport path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetAppByName,\n\tgetAppDisplayName,\n\tgetApps,\n\tisExtraApp,\n\tisPlaygroundApp,\n\ttype ExtraApp,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getDiffPatch } from '@epic-web/workshop-utils/diff.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n\ttime,\n} from '@epic-web/workshop-utils/timing.server'\nimport * as Tabs from '@radix-ui/react-tabs'\nimport slugify from '@sindresorhus/slugify'\nimport { useMemo, useRef, useState } from 'react'\nimport {\n\tLink,\n\tdata,\n\ttype HeadersFunction,\n\tuseLoaderData,\n\tuseSearchParams,\n} from 'react-router'\nimport { Diff } from '#app/components/diff.tsx'\nimport { DiscordChat } from '#app/components/discord-chat.tsx'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { GeneralErrorBoundary } from '#app/components/error-boundary.tsx'\nimport { type InBrowserBrowserRef } from '#app/components/in-browser-browser.tsx'\nimport { NavChevrons } from '#app/components/nav-chevrons.tsx'\nimport {\n\tgetPreviewSearchParams,\n\tPreviewTabsList,\n} from '#app/components/preview-tabs.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.tsx'\nimport { useWorkshopConfig } from '#app/components/workshop-config.tsx'\nimport { Playground } from '#app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/__shared/playground.tsx'\nimport { Preview } from '#app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/__shared/preview.tsx'\nimport { getAppRunningState } from '#app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/__shared/utils.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { SetAppToPlayground } from '#app/routes/set-playground.tsx'\nimport { fetchDiscordPosts } from '#app/utils/discord.server.ts'\nimport { createInlineFileComponent, Mdx } from '#app/utils/mdx.tsx'\nimport {\n\tgetRootMatchLoaderData,\n\tuseApps,\n\tuseRootLoaderData,\n} from '#app/utils/root-loader.ts'\nimport { getSeoMetaTags } from '#app/utils/seo.ts'\nimport {\n\tgetSplitPercentFromRequest,\n\tsetSplitPercentCookie,\n\tstartSplitDrag,\n} from '#app/utils/split-layout.ts'\n\nfunction sortExtras(extras: ExtraApp[]) {\n\treturn extras.sort((a, b) =>\n\t\ta.title.localeCompare(b.title, undefined, {\n\t\t\tnumeric: true,\n\t\t\tsensitivity: 'base',\n\t\t}),\n\t)\n}\n\nexport const meta: Route.MetaFunction = (args) => {\n\tconst loaderData = args.data\n\tconst rootData = getRootMatchLoaderData(args.matches)\n\tif (!loaderData || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `📚 | ${loaderData.extra.title} | ${rootData.workshopTitle}`,\n\t\tdescription: `Extra: ${loaderData.extra.title}`,\n\t\togTitle: loaderData.extra.title,\n\t\togDescription: `Extra: ${loaderData.extra.title}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: Route.LoaderArgs) {\n\tconst timings = makeTimings('extraLoader')\n\tinvariantResponse(params.extra, 'extra is required')\n\n\tconst { title: workshopTitle } = getWorkshopConfig()\n\tconst cacheOptions = { request, timings }\n\tconst apps = await time(() => getApps(cacheOptions), {\n\t\ttimings,\n\t\ttype: 'getApps',\n\t\tdesc: 'getApps in extra loader',\n\t})\n\tconst extras = sortExtras(apps.filter(isExtraApp))\n\tconst playgroundApp = apps.find(isPlaygroundApp)\n\tconst extraIndex = extras.findIndex((extra) => extra.dirName === params.extra)\n\tconst extra = extras[extraIndex]\n\tif (!extra) {\n\t\tthrow new Response('Extra not found', { status: 404 })\n\t}\n\n\tconst readmeFilepath = path.join(extra.fullPath, 'README.mdx')\n\tconst previousExtra = extras[extraIndex - 1]\n\tconst nextExtra = extras[extraIndex + 1]\n\tconst reqUrl = new URL(request.url)\n\tconst app1Name = reqUrl.searchParams.get('app1')\n\tconst app2Name = reqUrl.searchParams.get('app2')\n\tconst app1 = app1Name\n\t\t? await getAppByName(app1Name)\n\t\t: (playgroundApp ?? extra)\n\tconst app2 = app2Name ? await getAppByName(app2Name) : extra\n\tconst splitPercent = getSplitPercentFromRequest(request, 50)\n\n\tconst { isRunning, portIsAvailable } = await getAppRunningState(extra)\n\n\tasync function getDiffProp() {\n\t\tif (!app1 || !app2) {\n\t\t\treturn { app1: app1?.name, app2: app2?.name, diffPatch: null }\n\t\t}\n\t\tconst diffPatch = await getDiffPatch(app1, app2, {\n\t\t\t...cacheOptions,\n\t\t\tforceFresh: reqUrl.searchParams.get('forceFresh') === 'diff',\n\t\t}).catch((error) => {\n\t\t\tconsole.error(error)\n\t\t\treturn null\n\t\t})\n\t\treturn {\n\t\t\tapp1: app1.name,\n\t\t\tapp2: app2.name,\n\t\t\tdiffPatch,\n\t\t}\n\t}\n\n\tconst allApps = apps\n\t\t.filter(\n\t\t\t(app, index, list) =>\n\t\t\t\tlist.findIndex((item) => item.name === app.name) === index,\n\t\t)\n\t\t.map((app) => ({\n\t\t\tname: app.name,\n\t\t\tdisplayName: getAppDisplayName(app, apps),\n\t\t}))\n\t\t.sort((a, b) =>\n\t\t\ta.displayName.localeCompare(b.displayName, undefined, {\n\t\t\t\tnumeric: true,\n\t\t\t\tsensitivity: 'base',\n\t\t\t}),\n\t\t)\n\n\treturn data(\n\t\t{\n\t\t\tarticleId: `workshop-${slugify(workshopTitle)}-${slugify(\n\t\t\t\textra.title,\n\t\t\t)}-extra`,\n\t\t\tsplitPercent,\n\t\t\textra: {\n\t\t\t\ttype: 'extra',\n\t\t\t\tname: extra.name,\n\t\t\t\ttitle: extra.title,\n\t\t\t\tdirName: extra.dirName,\n\t\t\t\tfullPath: extra.fullPath,\n\t\t\t\trelativePath: extra.relativePath,\n\t\t\t\tdev: extra.dev,\n\t\t\t\ttest: extra.test,\n\t\t\t\tstackBlitzUrl: extra.stackBlitzUrl,\n\t\t\t\tisRunning,\n\t\t\t\tportIsAvailable,\n\t\t\t\tepicVideoEmbeds: extra.epicVideoEmbeds,\n\t\t\t\tinstructionsCode: extra.instructionsCode,\n\t\t\t},\n\t\t\textraReadme: {\n\t\t\t\tfile: readmeFilepath,\n\t\t\t\trelativePath: path.join(extra.relativePath, 'README.mdx'),\n\t\t\t},\n\t\t\tplayground: playgroundApp\n\t\t\t\t? ({\n\t\t\t\t\t\ttype: 'playground',\n\t\t\t\t\t\tappName: playgroundApp.appName,\n\t\t\t\t\t\tname: playgroundApp.name,\n\t\t\t\t\t\ttitle: playgroundApp.title,\n\t\t\t\t\t\tfullPath: playgroundApp.fullPath,\n\t\t\t\t\t\tdev: playgroundApp.dev,\n\t\t\t\t\t\ttest: playgroundApp.test,\n\t\t\t\t\t\tstackBlitzUrl: playgroundApp.stackBlitzUrl,\n\t\t\t\t\t\tisUpToDate: playgroundApp.isUpToDate,\n\t\t\t\t\t\t...(await getAppRunningState(playgroundApp)),\n\t\t\t\t\t} as const)\n\t\t\t\t: null,\n\t\t\tallApps,\n\t\t\tdiff: getDiffProp(),\n\t\t\tdiscordPostsPromise: fetchDiscordPosts({ request }),\n\t\t\tpreviousExtra: previousExtra\n\t\t\t\t? { dirName: previousExtra.dirName, title: previousExtra.title }\n\t\t\t\t: null,\n\t\t\tnextExtra: nextExtra\n\t\t\t\t? { dirName: nextExtra.dirName, title: nextExtra.title }\n\t\t\t\t: null,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(extra.epicVideoEmbeds, {\n\t\t\t\trequest,\n\t\t\t}),\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nexport default function ExtraRoute() {\n\tconst data = useLoaderData<typeof loader>()\n\tconst rootData = useRootLoaderData()\n\tconst apps = useApps()\n\tconst inBrowserBrowserRef = useRef<InBrowserBrowserRef>(null)\n\tconst containerRef = useRef<HTMLDivElement>(null)\n\tconst leftPaneRef = useRef<HTMLDivElement>(null)\n\tconst [splitPercent, setSplitPercent] = useState<number>(data.splitPercent)\n\tconst [searchParams] = useSearchParams()\n\tconst workshopConfig = useWorkshopConfig()\n\tconst userHasAccessPromise = useMemo(\n\t\t() => Promise.resolve(rootData.userHasAccess ?? false),\n\t\t[rootData.userHasAccess],\n\t)\n\tconst showPlaygroundIndicator = data.playground?.appName !== data.extra.name\n\tconst shouldShowSetPlayground =\n\t\tshowPlaygroundIndicator || data.playground?.isUpToDate === false\n\tconst tabs = ['playground', 'extra', 'diff', 'chat'] as const\n\tconst preview = searchParams.get('preview')\n\tconst previousExtraLink = data.previousExtra\n\t\t? {\n\t\t\t\tto: `/extra/${data.previousExtra.dirName}`,\n\t\t\t\t'aria-label': 'Previous Extra',\n\t\t\t}\n\t\t: {\n\t\t\t\tto: '/extra',\n\t\t\t\t'aria-label': 'Extras',\n\t\t\t}\n\tconst nextExtraLink = data.nextExtra\n\t\t? {\n\t\t\t\tto: `/extra/${data.nextExtra.dirName}`,\n\t\t\t\t'aria-label': 'Next Extra',\n\t\t\t}\n\t\t: {\n\t\t\t\tto: '/finished',\n\t\t\t\t'aria-label': 'Workshop finished',\n\t\t\t}\n\n\tfunction isValidPreview(\n\t\tvalue: string | null,\n\t): value is (typeof tabs)[number] {\n\t\treturn Boolean(value && tabs.includes(value as (typeof tabs)[number]))\n\t}\n\n\tfunction shouldHideTab(tab: (typeof tabs)[number]) {\n\t\tif (tab === 'playground') {\n\t\t\treturn ENV.EPICSHOP_DEPLOYED\n\t\t}\n\t\tif (tab === 'extra') {\n\t\t\tif (ENV.EPICSHOP_DEPLOYED) {\n\t\t\t\tconst devType = data.extra.dev.type\n\t\t\t\treturn (\n\t\t\t\t\tdevType !== 'browser' &&\n\t\t\t\t\tdevType !== 'export' &&\n\t\t\t\t\t!data.extra.stackBlitzUrl\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\tif (tab === 'chat') {\n\t\t\treturn !workshopConfig.product.discordChannelId\n\t\t}\n\t\treturn false\n\t}\n\n\tconst activeTab =\n\t\tisValidPreview(preview) && !shouldHideTab(preview)\n\t\t\t? preview\n\t\t\t: (tabs.find((tab) => !shouldHideTab(tab)) ?? 'playground')\n\n\tconst previewTabs = tabs.map((tab) => {\n\t\tconst hidden = shouldHideTab(tab)\n\t\treturn {\n\t\t\tid: tab,\n\t\t\tlabel: tab,\n\t\t\thidden,\n\t\t\tto: `?${getPreviewSearchParams(searchParams, tab, 'playground')}`,\n\t\t}\n\t})\n\n\t// Create MDX components with playground-specific InlineFile\n\tconst mdxComponents = useMemo(() => {\n\t\tconst InlineFile = createInlineFileComponent(\n\t\t\t() =>\n\t\t\t\tdata.playground\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tname: data.playground.name,\n\t\t\t\t\t\t\tfullPath: data.playground.fullPath,\n\t\t\t\t\t\t}\n\t\t\t\t\t: null,\n\t\t\t() =>\n\t\t\t\t!data.playground || data.playground.appName !== data.extra.name\n\t\t\t\t\t? 'Set the playground to this extra before opening a file.'\n\t\t\t\t\t: null,\n\t\t)\n\t\treturn {\n\t\t\t// we'll render the title ourselves thank you\n\t\t\th1: () => null,\n\t\t\tInlineFile,\n\t\t}\n\t}, [data.playground, data.extra.name])\n\n\tconst playgroundBasePath = apps.find(\n\t\t(app) => app.name === data.playground?.appName,\n\t)?.fullPath\n\n\tuseRevalidationWS({\n\t\twatchPaths: [data.extraReadme.file, playgroundBasePath].filter(\n\t\t\t(path): path is string => Boolean(path),\n\t\t),\n\t})\n\n\treturn (\n\t\t<div className=\"flex max-w-full grow flex-col\">\n\t\t\t<main\n\t\t\t\tref={containerRef}\n\t\t\t\tclassName=\"flex grow flex-col sm:h-full sm:min-h-[800px] md:min-h-[unset] lg:flex-row\"\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"relative flex min-w-0 flex-none basis-full flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:basis-(--split-pct)\"\n\t\t\t\t\tstyle={{ ['--split-pct' as any]: `${splitPercent}%` }}\n\t\t\t\t\tref={leftPaneRef}\n\t\t\t\t>\n\t\t\t\t\t<h1 className=\"@container h-14 border-b pr-5 pl-10 text-sm leading-tight font-medium\">\n\t\t\t\t\t\t<div className=\"flex h-14 items-center justify-between gap-x-2 py-2 whitespace-nowrap\">\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-start gap-x-2 uppercase\">\n\t\t\t\t\t\t\t\t<Link to=\"/extra\" className=\"hover:underline\">\n\t\t\t\t\t\t\t\t\t<span>Extras</span>\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t<span>/</span>\n\t\t\t\t\t\t\t\t<Link to=\".\" className=\"hover:underline\">\n\t\t\t\t\t\t\t\t\t<span>{data.extra.title}</span>\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{shouldShowSetPlayground ? (\n\t\t\t\t\t\t\t\t<SetAppToPlayground\n\t\t\t\t\t\t\t\t\tappName={data.extra.name}\n\t\t\t\t\t\t\t\t\tisOutdated={data.playground?.isUpToDate === false}\n\t\t\t\t\t\t\t\t\thideTextOnNarrow\n\t\t\t\t\t\t\t\t\tshowOnboardingIndicator={showPlaygroundIndicator}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</h1>\n\t\t\t\t\t<article\n\t\t\t\t\t\tid={data.articleId}\n\t\t\t\t\t\tkey={data.articleId}\n\t\t\t\t\t\tclassName=\"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar flex h-full w-full max-w-none flex-1 scroll-pt-6 flex-col justify-between space-y-6 overflow-y-auto p-2 sm:p-10 sm:pt-8\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{data.extra.instructionsCode ? (\n\t\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\t\tcode={data.extra.instructionsCode}\n\t\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className=\"flex h-full items-center justify-center text-lg\">\n\t\t\t\t\t\t\t\t<p>No instructions yet...</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<div className=\"mt-auto flex justify-between\">\n\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\tto={previousExtraLink.to}\n\t\t\t\t\t\t\t\taria-label={previousExtraLink['aria-label']}\n\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span aria-hidden>←</span>\n\t\t\t\t\t\t\t\t<span className=\"hidden xl:inline\"> Previous</span>\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\tto={nextExtraLink.to}\n\t\t\t\t\t\t\t\taria-label={nextExtraLink['aria-label']}\n\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span className=\"hidden xl:inline\">Next </span>\n\t\t\t\t\t\t\t\t<span aria-hidden>→</span>\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</article>\n\t\t\t\t\t<ElementScrollRestoration\n\t\t\t\t\t\telementQuery={`#${data.articleId}`}\n\t\t\t\t\t\tkey={`scroll-${data.articleId}`}\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0\">\n\t\t\t\t\t\t<div />\n\t\t\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\t\t\tappName={data.extra.name}\n\t\t\t\t\t\t\trelativePath={data.extraReadme.relativePath}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NavChevrons prev={previousExtraLink} next={nextExtraLink} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\trole=\"separator\"\n\t\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\t\ttitle=\"Drag to resize\"\n\t\t\t\t\tclassName=\"bg-border hover:bg-muted hidden w-1 cursor-col-resize lg:block\"\n\t\t\t\t\tonMouseDown={(event) =>\n\t\t\t\t\t\tstartSplitDrag({\n\t\t\t\t\t\t\tcontainer: containerRef.current,\n\t\t\t\t\t\t\tinitialClientX: event.clientX,\n\t\t\t\t\t\t\tsetSplitPercent,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tonDoubleClick={() => {\n\t\t\t\t\t\tsetSplitPercent(setSplitPercentCookie(50))\n\t\t\t\t\t}}\n\t\t\t\t\tonTouchStart={(event) => {\n\t\t\t\t\t\tconst firstTouch = event.touches?.[0]\n\t\t\t\t\t\tif (!firstTouch) return\n\t\t\t\t\t\tstartSplitDrag({\n\t\t\t\t\t\t\tcontainer: containerRef.current,\n\t\t\t\t\t\t\tinitialClientX: firstTouch.clientX,\n\t\t\t\t\t\t\tsetSplitPercent,\n\t\t\t\t\t\t})\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<Tabs.Root\n\t\t\t\t\tclassName=\"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden\"\n\t\t\t\t\tvalue={activeTab}\n\t\t\t\t>\n\t\t\t\t\t<PreviewTabsList tabs={previewTabs} />\n\t\t\t\t\t<div className=\"relative z-10 flex min-h-0 flex-1 flex-col overflow-hidden\">\n\t\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\t\tvalue=\"playground\"\n\t\t\t\t\t\t\tclassName=\"radix-state-inactive:hidden flex min-h-0 w-full grow basis-0 items-stretch justify-center self-start\"\n\t\t\t\t\t\t\tforceMount\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Playground\n\t\t\t\t\t\t\t\tappInfo={data.playground}\n\t\t\t\t\t\t\t\tproblemAppName={data.extra.name}\n\t\t\t\t\t\t\t\tallApps={data.allApps ?? []}\n\t\t\t\t\t\t\t\tisUpToDate={data.playground?.isUpToDate ?? false}\n\t\t\t\t\t\t\t\tinBrowserBrowserRef={inBrowserBrowserRef}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tabs.Content>\n\t\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\t\tvalue=\"extra\"\n\t\t\t\t\t\t\tclassName=\"radix-state-inactive:hidden flex min-h-0 w-full grow basis-0 items-stretch justify-center self-start\"\n\t\t\t\t\t\t\tforceMount\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Preview\n\t\t\t\t\t\t\t\tappInfo={data.extra}\n\t\t\t\t\t\t\t\tinBrowserBrowserRef={inBrowserBrowserRef}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tabs.Content>\n\t\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\t\tvalue=\"diff\"\n\t\t\t\t\t\t\tclassName=\"radix-state-inactive:hidden flex h-full min-h-0 w-full grow basis-0 items-stretch justify-center self-start\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Diff\n\t\t\t\t\t\t\t\tdiff={data.diff}\n\t\t\t\t\t\t\t\tallApps={data.allApps}\n\t\t\t\t\t\t\t\tuserHasAccessPromise={userHasAccessPromise}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tabs.Content>\n\t\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\t\tvalue=\"chat\"\n\t\t\t\t\t\t\tclassName=\"radix-state-inactive:hidden flex h-full min-h-0 w-full grow basis-0 items-stretch justify-center self-start\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DiscordChat discordPostsPromise={data.discordPostsPromise} />\n\t\t\t\t\t\t</Tabs.Content>\n\t\t\t\t\t</div>\n\t\t\t\t</Tabs.Root>\n\t\t\t</main>\n\t\t</div>\n\t)\n}\n\nexport function ErrorBoundary() {\n\treturn <GeneralErrorBoundary />\n}\n"],"names":["meta","args","loaderData","data","rootData","getRootMatchLoaderData","matches","title","getSeoMetaTags","extra","workshopTitle","description","ogTitle","ogDescription","instructor","requestInfo","$extra","_UNSAFE_withComponentProps","useLoaderData","useRootLoaderData","apps","useApps","inBrowserBrowserRef","useRef","containerRef","leftPaneRef","splitPercent","setSplitPercent","useState","searchParams","useSearchParams","workshopConfig","useWorkshopConfig","userHasAccessPromise","useMemo","Promise","resolve","userHasAccess","showPlaygroundIndicator","playground","appName","name","shouldShowSetPlayground","isUpToDate","tabs","preview","get","previousExtraLink","previousExtra","to","dirName","nextExtraLink","nextExtra","isValidPreview","value","Boolean","includes","shouldHideTab","tab","ENV","EPICSHOP_DEPLOYED","devType","dev","type","stackBlitzUrl","product","discordChannelId","activeTab","find","previewTabs","map","hidden","id","label","getPreviewSearchParams","mdxComponents","InlineFile","createInlineFileComponent","fullPath","h1","playgroundBasePath","app","useRevalidationWS","watchPaths","extraReadme","file","filter","path","jsx","className","children","jsxs","ref","style","Link","SetAppToPlayground","isOutdated","hideTextOnNarrow","showOnboardingIndicator","articleId","instructionsCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","prefetch","ElementScrollRestoration","elementQuery","EditFileOnGitHub","relativePath","NavChevrons","prev","next","role","onMouseDown","event","startSplitDrag","container","current","initialClientX","clientX","onDoubleClick","setSplitPercentCookie","onTouchStart","firstTouch","touches","Tabs","PreviewTabsList","forceMount","Playground","appInfo","problemAppName","allApps","Preview","Diff","diff","DiscordChat","discordPostsPromise","ErrorBoundary","_UNSAFE_withErrorBoundaryProps","GeneralErrorBoundary"],"mappings":"onDAuEO,MAAMA,GAA4BC,GAAS,CACjD,MAAMC,E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A"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as h,d as C,L as f,A as k,w as D,a as L,O}from"./chunk-JZWAC4HX-BuixXc9D.js";import{j as e}from"./jsx-runtime-C5WNSv3b.js";import{E as I}from"./index-3PqfcnMA.js";import{r as x}from"./index-Bi6L2ga8.js";import{G as R}from"./error-boundary-DCY9a5Cj.js";import{N as $}from"./nav-chevrons-DUMNZcNc.js";import{u as A}from"./revalidation-ws-JHvxsHsY.js";import{L as g,E as T}from"./launch-editor-C8OwTN5L.js";import{P as B}from"./progress-BvO_W5nB.js";import{S}from"./set-playground-CvYErpku.js";import{n as U,c as v,I as j,o as H,l as V}from"./misc-D9k_mI0z.js";import{b as _,g as F,a as Y}from"./root-loader-DAxaiFMN.js";import{g as M}from"./seo-t5J-DRxw.js";import{s as y,a as q}from"./split-layout-DnRER1bP.js";import{E as G}from"./error-boundary-BS_yDJtr.js";import{E as X}from"./epic-video-C9q0z-QM.js";import{S as b}from"./tooltip-H74tOFSr.js";import{M as z}from"./mdx-Bvb9XNyL.js";import{R as K,T as Q,P as W,C as J}from"./index-ywSltzcE.js";import{u as Z,O as ee}from"./onboarding-indicator-Csno1yMz.js";import"./preload-helper-BXl3LOEh.js";import"./schemas-siASSt6b.js";import"./progress-bar-BCbq1CuC.js";import"./pe-D585gnmh.js";import"./index-BvE6USCZ.js";import"./index-B2VNpNxJ.js";import"./index-DosQrH9F.js";import"./button-B_EAwzD_.js";import"./dialog-DXBBGJQ6.js";import"./chunk-4LKRSAEJ-TFLSCavK.js";import"./coerce-f7UHRcUL.js";import"./loading-BjV0PtX2.js";import"./index-DSpM0ReJ.js";import"./index-E_6kulJP.js";import"./online-x7UFobEJ.js";import"./format-CZ5n8p10.js";import"./user-DhjrtSbZ.js";import"./workshop-config-v_LiyFvY.js";const P=x.createContext(null);function ne(){const r=x.useContext(P);if(!r)throw new Error("useStepContext must be used within a StepContextProvider");return r}function re({children:r,inBrowserBrowserRef:n}){return e.jsx(P,{value:{inBrowserBrowserRef:n},children:r})}const te={DiffLink:N,PrevDiffLink:oe,NextDiffLink:ie,InlineFile:le,LinkToApp:ce};function se({inBrowserBrowserRef:r}){const n=h();return n.exerciseStepApp.instructionsCode?e.jsx(re,{inBrowserBrowserRef:r,children:e.jsx(X,{epicVideoInfosPromise:n.epicVideoInfosPromise,children:e.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:e.jsx(z,{code:n.exerciseStepApp.instructionsCode,components:te})})})}):null}function w(r,n,s){const i=new URLSearchParams(r);return s===null?i.delete(n):i.set(n,s),i}function ie({app:r=0,fullPage:n=!1,children:s}){return e.jsx(N,{app1:r,app2:r+1,fullPage:n,children:s})}function oe({app:r=-1,fullPage:n=!1,children:s}){return e.jsx(N,{app1:r,app2:r+1,fullPage:n,children:s})}function N({app1:r=0,app2:n=1,children:s,fullPage:i=!1,to:t}){const o=h();if(!t&&!r&&!n)return e.jsx("callout-danger",{className:"notification",children:e.jsx("div",{className:"title",children:"DiffLink Error: invalid input"})});function m(a){if(typeof a=="number"){const d=o.exerciseIndex+a;return o.allApps[d]?.name}if(!a)return null;for(const{name:d,stepName:c}of o.allApps)if(a===d||a===c)return d;return null}if(t){const a=new URLSearchParams(t);r=a.get("app1"),n=a.get("app2")}const p=m(r),l=m(n);if(!p||!l)return e.jsxs("callout-danger",{className:"notification",children:[e.jsx("div",{className:"title",children:"DiffLink Error: invalid input"}),!p&&e.jsxs("div",{children:['app1: "',r,'" is not a valid app name']}),!l&&e.jsxs("div",{children:['app2: "',n,'" is not a valid app name']})]});t||(t=`app1=${p}&app2=${l}`);const u=i?`/diff?${t}`:`?${decodeURIComponent(w(new URLSearchParams,"preview",`diff&${t}`).toString())}`;return s||(s=e.jsxs("span",{children:["Go to Diff ",i?"":"Preview"," from: ",e.jsx("code",{children:p})," to:"," ",e.jsx("code",{children:l})]})),e.jsx(f,{to:u,children:s})}function le({file:r,type:n="playground",children:s=e.jsx("code",{children:r}),...i}){const t=h(),o=t[n]||t[t.type],m=t.problem?.name??t[t.type]?.name,p=n!=="playground"||!!m&&t.playground?.appName===m,l=n==="playground"&&!p?"Set the playground to this step before opening a file.":null,u=e.jsxs("div",{className:"launch-editor-button-wrapper flex underline underline-offset-4",children:[s," ",e.jsx("svg",{height:24,width:24,children:e.jsx("use",{href:`${H}#Keyboard`})})]});return l?e.jsx(b,{content:l,children:e.jsx("div",{className:"inline-block grow cursor-not-allowed",children:u})}):ENV.EPICSHOP_DEPLOYED&&o?e.jsx("div",{className:"inline-block grow",children:e.jsx(g,{appFile:r,appName:o.name,...i,children:u})}):o?e.jsx("div",{className:"inline-block grow",children:e.jsx(g,{appFile:r,appName:o.name,...i,children:u})}):e.jsx(e.Fragment,{children:s})}function ae(r){return r==="problem"?"problem":r==="solution"?"solution":"playground"}function ce({to:r,children:n=e.jsx("code",{children:r.toString()}),...s}){const[i]=C(),t=`?${w(i,"pathname",r.toString()).toString()}`,o=h(),m=ae(i.get("preview")),p=_(),l=o[m],u=l?.dev.type==="script"?U({domain:p.domain,port:l.dev.portNumber}):o.playground?.dev.type==="browser"||o.playground?.dev.type==="export"?o.playground.dev.pathname:null,{inBrowserBrowserRef:a}=ne(),d=u?u.slice(0,-1)+r.toString():null;return e.jsxs("div",{className:"inline-flex items-center justify-between gap-1",children:[e.jsx(f,{to:t,...s,className:v(s.className,{"cursor-not-allowed":ENV.EPICSHOP_DEPLOYED}),title:ENV.EPICSHOP_DEPLOYED?"Cannot link to app in deployed version":void 0,onClick:c=>{ENV.EPICSHOP_DEPLOYED&&c.preventDefault(),s.onClick?.(c),a.current?.handleExtrnalNavigation(r.toString())},children:n}),d?e.jsx(b,{content:"Open in new tab",children:e.jsx("a",{href:d,target:"_blank",rel:"noreferrer",className:v("flex aspect-square items-center justify-center",{"cursor-not-allowed":ENV.EPICSHOP_DEPLOYED}),title:ENV.EPICSHOP_DEPLOYED?"Cannot link to app in deployed version":"Open in new tab",onClick:c=>{ENV.EPICSHOP_DEPLOYED&&c.preventDefault()},children:e.jsx(j,{name:"ExternalLink"})})}):null]})}function pe({diffFilesPromise:r}){const n=h(),[s,i]=Z("files-popover"),[t,o]=x.useState(!1),m=x.useRef(null);function p(a){o(a),a&&i()}function l(){o(!1)}const u=n.playground?.appName;return e.jsx(e.Fragment,{children:e.jsxs(K,{open:t,onOpenChange:p,children:[e.jsx(Q,{asChild:!0,children:e.jsxs("button",{className:"relative flex h-full items-center gap-1 border-r px-6 py-3 font-mono text-sm uppercase","aria-label":"Relevant Files",children:[e.jsx(j,{name:"Files"}),e.jsx("span",{className:"hidden @min-[640px]:inline",children:"Files"}),s?e.jsx(ee,{tooltip:"Click to see which files to edit!"}):null]})}),e.jsx(W,{children:e.jsx(J,{ref:m,className:"slideRightContent lg:slideUpContent invert-theme bg-background text-foreground z-10 rounded px-9 py-8 select-none",align:"start",sideOffset:5,children:e.jsxs("div",{className:"launch-editor-wrapper",children:[e.jsx("strong",{className:"inline-block px-2 pb-2 font-semibold uppercase",children:"Relevant Files"}),e.jsxs("p",{className:"text-muted-foreground mb-4 max-w-2xs px-2 text-sm",children:["These are the files you'll need to modify for this exercise. Click any file to open it directly in your editor at the right location."," ",e.jsx(f,{to:"/guide#file-links",className:"text-highlight underline",onClick:()=>o(!1),children:"Learn more →"})]}),n.problem&&n.playground?.appName!==n.problem.name?e.jsx("div",{className:"mb-2 rounded p-1 font-mono font-medium",children:e.jsx(S,{appName:n.problem.name})}):null,e.jsx("div",{id:"files",children:e.jsx(x.Suspense,{fallback:e.jsx(b,{content:"Loading diff",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(j,{name:"Refresh",className:"h-8 w-8 animate-spin"})})}),children:e.jsx(k,{resolve:r,errorElement:e.jsx("div",{className:"text-foreground-destructive",children:"Something went wrong."}),children:a=>{if(!a)return e.jsx("p",{className:"text-foreground-destructive",children:"Unable to determine diff"});if(typeof a=="string")return e.jsx("p",{className:"text-foreground-destructive",children:a});if(!a.length)return e.jsx("p",{children:"No files changed"});const d=u||ENV.EPICSHOP_GITHUB_ROOT?{}:{title:"You must 'Set to Playground' before opening a file",className:"not-allowed"};return e.jsxs("ul",{...d,children:[a.length>1&&!ENV.EPICSHOP_DEPLOYED?e.jsx("div",{className:"border-opacity-50 mb-2 border-b border-b-gray-50 pb-2 font-sans",children:e.jsx(g,{appFile:a.map(c=>`${c.path},${c.line},1`),appName:"playground",onUpdate:l,children:e.jsx("p",{children:"Open All Files"})})}):null,a.map(c=>e.jsx("li",{"data-state":c.status,children:e.jsx(g,{appFile:`${c.path},${c.line},1`,appName:ENV.EPICSHOP_DEPLOYED?n.problem?.name??"playground":"playground",onUpdate:l,children:e.jsx("code",{children:c.path})})},c.path))]})}})})})]})})})]})})}function E(r,n){const s=r?.exerciseStepApp.exerciseNumber.toString().padStart(2,"0")??"00",i=r?.exerciseStepApp.stepNumber.toString().padStart(2,"0")??"00",t={problem:"💪",solution:"🏁"}[r?.type??"problem"],o=r?.[r.type]?.title??"N/A";return{emoji:t,stepNumber:i,title:o,exerciseNumber:s,exerciseTitle:r?.exerciseTitle??"Unknown exercise",workshopTitle:n,type:r?.type??"problem"}}const Ke=({loaderData:r,matches:n,params:s})=>{const i=F(n);if(!r||!i)return[{title:"🦉 | Error"}];const{emoji:t,stepNumber:o,title:m,exerciseNumber:p,exerciseTitle:l}=E(r);return M({title:`${t} | ${o}. ${m} | ${p}. ${l} | ${i.workshopTitle}`,description:`${s.type} step for exercise ${p}. ${l}`,ogTitle:m,ogDescription:`${l} step ${Number(o)} ${s.type}`,instructor:i.instructor,requestInfo:i.requestInfo})},Qe=D(function({loaderData:n}){const s=Y(),i=x.useRef(null),t=x.useRef(null),o=x.useRef(null),[m,p]=x.useState(n.splitPercent),l=E(n),u=s.find(d=>d.name===n.playground?.appName)?.fullPath;A({watchPaths:[`${n.exerciseStepApp.relativePath}/README.mdx`,u].filter(d=>!!d)});const a=n.problem?n.playground?.appName!==n.problem.name:!1;return e.jsx("div",{className:"flex max-w-full grow flex-col",children:e.jsxs("main",{ref:t,className:"flex grow flex-col overflow-y-auto sm:h-full sm:min-h-[800px] md:min-h-[unset] lg:flex-row lg:overflow-y-hidden",children:[e.jsxs("div",{className:"relative flex min-w-0 flex-none basis-auto flex-col sm:col-span-1 sm:row-span-1 lg:h-full lg:basis-(--split-pct)",style:{"--split-pct":`${m}%`},ref:o,children:[e.jsx("h1",{className:"scrollbar-thin scrollbar-thumb-scrollbar @container h-14 max-w-full overflow-x-auto overflow-y-hidden border-b pr-5 pl-10 text-sm leading-tight font-medium",children:e.jsxs("div",{className:"flex h-14 items-center justify-between gap-x-2 py-2 whitespace-nowrap",children:[e.jsxs("div",{className:"flex items-center justify-start gap-x-2 uppercase",children:[e.jsxs(f,{to:V(n.exerciseStepApp.exerciseNumber),className:"hover:underline",children:[e.jsxs("span",{children:[l.exerciseNumber,"."]}),e.jsxs("span",{className:"hidden @min-[500px]:inline",children:[" ",l.exerciseTitle]})]}),e.jsx("span",{children:"/"}),e.jsxs(f,{to:".",className:"hover:underline",children:[e.jsxs("span",{children:[l.stepNumber,"."]}),e.jsxs("span",{className:"hidden @min-[300px]:inline",children:[" ",l.title]}),e.jsxs("span",{children:[" (",l.emoji]}),e.jsxs("span",{className:"hidden @min-[400px]:inline",children:[" ",l.type]}),e.jsx("span",{children:")"})]})]}),n.problem&&(n.playground?.appName!==n.problem.name||!n.playground?.isUpToDate)?e.jsx(S,{appName:n.problem.name,isOutdated:n.playground?.isUpToDate===!1,hideTextOnNarrow:!0,showOnboardingIndicator:a,"data-keyboard-action":"s+p"}):null]})}),e.jsxs("article",{id:n.articleId,className:"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar flex w-full max-w-none scroll-pt-6 flex-col justify-between space-y-6 p-2 sm:p-10 sm:pt-8 lg:h-full lg:flex-1 lg:overflow-y-auto",children:[n.exerciseStepApp.instructionsCode?e.jsx(se,{inBrowserBrowserRef:i}):e.jsx("div",{className:"flex h-full items-center justify-center text-lg",children:e.jsx("p",{children:"No instructions yet..."})}),e.jsxs("div",{className:"mt-auto flex justify-between",children:[n.prevStepLink?e.jsxs(f,{to:n.prevStepLink.to,"aria-label":"Previous Step","data-keyboard-action":"g+p",prefetch:"intent",children:[e.jsx("span",{"aria-hidden":!0,children:"←"}),e.jsx("span",{className:"hidden xl:inline",children:" Previous"})]}):e.jsx("span",{}),n.nextStepLink?e.jsxs(f,{to:n.nextStepLink.to,"aria-label":"Next Step","data-keyboard-action":"g+n",prefetch:"intent",children:[e.jsx("span",{className:"hidden xl:inline",children:"Next "}),e.jsx("span",{"aria-hidden":!0,children:"→"})]}):e.jsx("span",{})]})]},n.articleId),e.jsx(I,{elementQuery:`#${n.articleId}`},`scroll-${n.articleId}`),n.type==="solution"?e.jsx(B,{type:"step",exerciseNumber:n.exerciseStepApp.exerciseNumber,stepNumber:n.exerciseStepApp.stepNumber,className:"h-14 border-t px-6"}):null,e.jsxs("div",{className:"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0",children:[e.jsx("div",{children:e.jsx("div",{className:"h-full",children:e.jsx(pe,{diffFilesPromise:n.diffFiles})})}),e.jsx(T,{appName:n.exerciseStepApp.name,relativePath:`${n.exerciseStepApp.relativePath}/README.mdx`}),e.jsx($,{prev:n.prevStepLink?{to:n.prevStepLink.to,"aria-label":"Previous Step"}:null,next:n.nextStepLink?{to:n.nextStepLink.to,"aria-label":"Next Step"}:null})]})]}),e.jsx("div",{role:"separator","aria-orientation":"vertical",title:"Drag to resize",className:"bg-border hover:bg-accent hidden w-1 cursor-col-resize lg:block",onMouseDown:d=>y({container:t.current,initialClientX:d.clientX,setSplitPercent:p}),onDoubleClick:()=>{p(q(50))},onTouchStart:d=>{const c=d.touches?.[0];c&&y({container:t.current,initialClientX:c.clientX,setSplitPercent:p})}}),e.jsx("div",{className:"flex min-h-[50vh] min-w-0 flex-none lg:min-h-0 lg:flex-1",children:e.jsx(O,{context:{inBrowserBrowserRef:i}})})]})})}),We=L(function(){return e.jsx(R,{className:"container flex items-center justify-center",statusHandlers:{404:G}})});export{We as ErrorBoundary,Qe as default,Ke as meta};
|
|
2
|
-
//# sourceMappingURL=_layout-
|
|
1
|
+
import{b as h,d as C,L as f,A as k,w as D,a as L,O}from"./chunk-JZWAC4HX-BuixXc9D.js";import{j as e}from"./jsx-runtime-C5WNSv3b.js";import{E as I}from"./index-3PqfcnMA.js";import{r as x}from"./index-Bi6L2ga8.js";import{G as R}from"./error-boundary-DCY9a5Cj.js";import{N as $}from"./nav-chevrons-DUMNZcNc.js";import{u as A}from"./revalidation-ws-JHvxsHsY.js";import{L as g,E as T}from"./launch-editor-C-8ah8qM.js";import{P as B}from"./progress-BvO_W5nB.js";import{S}from"./set-playground-CvYErpku.js";import{n as U,c as v,I as j,o as H,l as V}from"./misc-D9k_mI0z.js";import{b as _,g as F,a as Y}from"./root-loader-DAxaiFMN.js";import{g as M}from"./seo-t5J-DRxw.js";import{s as y,a as q}from"./split-layout-DnRER1bP.js";import{E as G}from"./error-boundary-BS_yDJtr.js";import{E as X}from"./epic-video-C9q0z-QM.js";import{S as b}from"./tooltip-H74tOFSr.js";import{M as z}from"./mdx-C3Jl4O5D.js";import{R as K,T as Q,P as W,C as J}from"./index-ywSltzcE.js";import{u as Z,O as ee}from"./onboarding-indicator-Csno1yMz.js";import"./preload-helper-BXl3LOEh.js";import"./schemas-siASSt6b.js";import"./progress-bar-BCbq1CuC.js";import"./pe-D585gnmh.js";import"./index-BvE6USCZ.js";import"./index-B2VNpNxJ.js";import"./index-DosQrH9F.js";import"./button-B_EAwzD_.js";import"./dialog-DXBBGJQ6.js";import"./chunk-4LKRSAEJ-TFLSCavK.js";import"./coerce-f7UHRcUL.js";import"./loading-BjV0PtX2.js";import"./index-DSpM0ReJ.js";import"./index-E_6kulJP.js";import"./online-x7UFobEJ.js";import"./format-CZ5n8p10.js";import"./user-DhjrtSbZ.js";import"./workshop-config-v_LiyFvY.js";const P=x.createContext(null);function ne(){const r=x.useContext(P);if(!r)throw new Error("useStepContext must be used within a StepContextProvider");return r}function re({children:r,inBrowserBrowserRef:n}){return e.jsx(P,{value:{inBrowserBrowserRef:n},children:r})}const te={DiffLink:N,PrevDiffLink:oe,NextDiffLink:ie,InlineFile:le,LinkToApp:ce};function se({inBrowserBrowserRef:r}){const n=h();return n.exerciseStepApp.instructionsCode?e.jsx(re,{inBrowserBrowserRef:r,children:e.jsx(X,{epicVideoInfosPromise:n.epicVideoInfosPromise,children:e.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:e.jsx(z,{code:n.exerciseStepApp.instructionsCode,components:te})})})}):null}function w(r,n,s){const i=new URLSearchParams(r);return s===null?i.delete(n):i.set(n,s),i}function ie({app:r=0,fullPage:n=!1,children:s}){return e.jsx(N,{app1:r,app2:r+1,fullPage:n,children:s})}function oe({app:r=-1,fullPage:n=!1,children:s}){return e.jsx(N,{app1:r,app2:r+1,fullPage:n,children:s})}function N({app1:r=0,app2:n=1,children:s,fullPage:i=!1,to:t}){const o=h();if(!t&&!r&&!n)return e.jsx("callout-danger",{className:"notification",children:e.jsx("div",{className:"title",children:"DiffLink Error: invalid input"})});function m(a){if(typeof a=="number"){const d=o.exerciseIndex+a;return o.allApps[d]?.name}if(!a)return null;for(const{name:d,stepName:c}of o.allApps)if(a===d||a===c)return d;return null}if(t){const a=new URLSearchParams(t);r=a.get("app1"),n=a.get("app2")}const p=m(r),l=m(n);if(!p||!l)return e.jsxs("callout-danger",{className:"notification",children:[e.jsx("div",{className:"title",children:"DiffLink Error: invalid input"}),!p&&e.jsxs("div",{children:['app1: "',r,'" is not a valid app name']}),!l&&e.jsxs("div",{children:['app2: "',n,'" is not a valid app name']})]});t||(t=`app1=${p}&app2=${l}`);const u=i?`/diff?${t}`:`?${decodeURIComponent(w(new URLSearchParams,"preview",`diff&${t}`).toString())}`;return s||(s=e.jsxs("span",{children:["Go to Diff ",i?"":"Preview"," from: ",e.jsx("code",{children:p})," to:"," ",e.jsx("code",{children:l})]})),e.jsx(f,{to:u,children:s})}function le({file:r,type:n="playground",children:s=e.jsx("code",{children:r}),...i}){const t=h(),o=t[n]||t[t.type],m=t.problem?.name??t[t.type]?.name,p=n!=="playground"||!!m&&t.playground?.appName===m,l=n==="playground"&&!p?"Set the playground to this step before opening a file.":null,u=e.jsxs("div",{className:"launch-editor-button-wrapper flex underline underline-offset-4",children:[s," ",e.jsx("svg",{height:24,width:24,children:e.jsx("use",{href:`${H}#Keyboard`})})]});return l?e.jsx(b,{content:l,children:e.jsx("div",{className:"inline-block grow cursor-not-allowed",children:u})}):ENV.EPICSHOP_DEPLOYED&&o?e.jsx("div",{className:"inline-block grow",children:e.jsx(g,{appFile:r,appName:o.name,...i,children:u})}):o?e.jsx("div",{className:"inline-block grow",children:e.jsx(g,{appFile:r,appName:o.name,...i,children:u})}):e.jsx(e.Fragment,{children:s})}function ae(r){return r==="problem"?"problem":r==="solution"?"solution":"playground"}function ce({to:r,children:n=e.jsx("code",{children:r.toString()}),...s}){const[i]=C(),t=`?${w(i,"pathname",r.toString()).toString()}`,o=h(),m=ae(i.get("preview")),p=_(),l=o[m],u=l?.dev.type==="script"?U({domain:p.domain,port:l.dev.portNumber}):o.playground?.dev.type==="browser"||o.playground?.dev.type==="export"?o.playground.dev.pathname:null,{inBrowserBrowserRef:a}=ne(),d=u?u.slice(0,-1)+r.toString():null;return e.jsxs("div",{className:"inline-flex items-center justify-between gap-1",children:[e.jsx(f,{to:t,...s,className:v(s.className,{"cursor-not-allowed":ENV.EPICSHOP_DEPLOYED}),title:ENV.EPICSHOP_DEPLOYED?"Cannot link to app in deployed version":void 0,onClick:c=>{ENV.EPICSHOP_DEPLOYED&&c.preventDefault(),s.onClick?.(c),a.current?.handleExtrnalNavigation(r.toString())},children:n}),d?e.jsx(b,{content:"Open in new tab",children:e.jsx("a",{href:d,target:"_blank",rel:"noreferrer",className:v("flex aspect-square items-center justify-center",{"cursor-not-allowed":ENV.EPICSHOP_DEPLOYED}),title:ENV.EPICSHOP_DEPLOYED?"Cannot link to app in deployed version":"Open in new tab",onClick:c=>{ENV.EPICSHOP_DEPLOYED&&c.preventDefault()},children:e.jsx(j,{name:"ExternalLink"})})}):null]})}function pe({diffFilesPromise:r}){const n=h(),[s,i]=Z("files-popover"),[t,o]=x.useState(!1),m=x.useRef(null);function p(a){o(a),a&&i()}function l(){o(!1)}const u=n.playground?.appName;return e.jsx(e.Fragment,{children:e.jsxs(K,{open:t,onOpenChange:p,children:[e.jsx(Q,{asChild:!0,children:e.jsxs("button",{className:"relative flex h-full items-center gap-1 border-r px-6 py-3 font-mono text-sm uppercase","aria-label":"Relevant Files",children:[e.jsx(j,{name:"Files"}),e.jsx("span",{className:"hidden @min-[640px]:inline",children:"Files"}),s?e.jsx(ee,{tooltip:"Click to see which files to edit!"}):null]})}),e.jsx(W,{children:e.jsx(J,{ref:m,className:"slideRightContent lg:slideUpContent invert-theme bg-background text-foreground z-10 rounded px-9 py-8 select-none",align:"start",sideOffset:5,children:e.jsxs("div",{className:"launch-editor-wrapper",children:[e.jsx("strong",{className:"inline-block px-2 pb-2 font-semibold uppercase",children:"Relevant Files"}),e.jsxs("p",{className:"text-muted-foreground mb-4 max-w-2xs px-2 text-sm",children:["These are the files you'll need to modify for this exercise. Click any file to open it directly in your editor at the right location."," ",e.jsx(f,{to:"/guide#file-links",className:"text-highlight underline",onClick:()=>o(!1),children:"Learn more →"})]}),n.problem&&n.playground?.appName!==n.problem.name?e.jsx("div",{className:"mb-2 rounded p-1 font-mono font-medium",children:e.jsx(S,{appName:n.problem.name})}):null,e.jsx("div",{id:"files",children:e.jsx(x.Suspense,{fallback:e.jsx(b,{content:"Loading diff",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(j,{name:"Refresh",className:"h-8 w-8 animate-spin"})})}),children:e.jsx(k,{resolve:r,errorElement:e.jsx("div",{className:"text-foreground-destructive",children:"Something went wrong."}),children:a=>{if(!a)return e.jsx("p",{className:"text-foreground-destructive",children:"Unable to determine diff"});if(typeof a=="string")return e.jsx("p",{className:"text-foreground-destructive",children:a});if(!a.length)return e.jsx("p",{children:"No files changed"});const d=u||ENV.EPICSHOP_GITHUB_ROOT?{}:{title:"You must 'Set to Playground' before opening a file",className:"not-allowed"};return e.jsxs("ul",{...d,children:[a.length>1&&!ENV.EPICSHOP_DEPLOYED?e.jsx("div",{className:"border-opacity-50 mb-2 border-b border-b-gray-50 pb-2 font-sans",children:e.jsx(g,{appFile:a.map(c=>`${c.path},${c.line},1`),appName:"playground",onUpdate:l,children:e.jsx("p",{children:"Open All Files"})})}):null,a.map(c=>e.jsx("li",{"data-state":c.status,children:e.jsx(g,{appFile:`${c.path},${c.line},1`,appName:ENV.EPICSHOP_DEPLOYED?n.problem?.name??"playground":"playground",onUpdate:l,children:e.jsx("code",{children:c.path})})},c.path))]})}})})})]})})})]})})}function E(r,n){const s=r?.exerciseStepApp.exerciseNumber.toString().padStart(2,"0")??"00",i=r?.exerciseStepApp.stepNumber.toString().padStart(2,"0")??"00",t={problem:"💪",solution:"🏁"}[r?.type??"problem"],o=r?.[r.type]?.title??"N/A";return{emoji:t,stepNumber:i,title:o,exerciseNumber:s,exerciseTitle:r?.exerciseTitle??"Unknown exercise",workshopTitle:n,type:r?.type??"problem"}}const Ke=({loaderData:r,matches:n,params:s})=>{const i=F(n);if(!r||!i)return[{title:"🦉 | Error"}];const{emoji:t,stepNumber:o,title:m,exerciseNumber:p,exerciseTitle:l}=E(r);return M({title:`${t} | ${o}. ${m} | ${p}. ${l} | ${i.workshopTitle}`,description:`${s.type} step for exercise ${p}. ${l}`,ogTitle:m,ogDescription:`${l} step ${Number(o)} ${s.type}`,instructor:i.instructor,requestInfo:i.requestInfo})},Qe=D(function({loaderData:n}){const s=Y(),i=x.useRef(null),t=x.useRef(null),o=x.useRef(null),[m,p]=x.useState(n.splitPercent),l=E(n),u=s.find(d=>d.name===n.playground?.appName)?.fullPath;A({watchPaths:[`${n.exerciseStepApp.relativePath}/README.mdx`,u].filter(d=>!!d)});const a=n.problem?n.playground?.appName!==n.problem.name:!1;return e.jsx("div",{className:"flex max-w-full grow flex-col",children:e.jsxs("main",{ref:t,className:"flex grow flex-col overflow-y-auto sm:h-full sm:min-h-[800px] md:min-h-[unset] lg:flex-row lg:overflow-y-hidden",children:[e.jsxs("div",{className:"relative flex min-w-0 flex-none basis-auto flex-col sm:col-span-1 sm:row-span-1 lg:h-full lg:basis-(--split-pct)",style:{"--split-pct":`${m}%`},ref:o,children:[e.jsx("h1",{className:"scrollbar-thin scrollbar-thumb-scrollbar @container h-14 max-w-full overflow-x-auto overflow-y-hidden border-b pr-5 pl-10 text-sm leading-tight font-medium",children:e.jsxs("div",{className:"flex h-14 items-center justify-between gap-x-2 py-2 whitespace-nowrap",children:[e.jsxs("div",{className:"flex items-center justify-start gap-x-2 uppercase",children:[e.jsxs(f,{to:V(n.exerciseStepApp.exerciseNumber),className:"hover:underline",children:[e.jsxs("span",{children:[l.exerciseNumber,"."]}),e.jsxs("span",{className:"hidden @min-[500px]:inline",children:[" ",l.exerciseTitle]})]}),e.jsx("span",{children:"/"}),e.jsxs(f,{to:".",className:"hover:underline",children:[e.jsxs("span",{children:[l.stepNumber,"."]}),e.jsxs("span",{className:"hidden @min-[300px]:inline",children:[" ",l.title]}),e.jsxs("span",{children:[" (",l.emoji]}),e.jsxs("span",{className:"hidden @min-[400px]:inline",children:[" ",l.type]}),e.jsx("span",{children:")"})]})]}),n.problem&&(n.playground?.appName!==n.problem.name||!n.playground?.isUpToDate)?e.jsx(S,{appName:n.problem.name,isOutdated:n.playground?.isUpToDate===!1,hideTextOnNarrow:!0,showOnboardingIndicator:a,"data-keyboard-action":"s+p"}):null]})}),e.jsxs("article",{id:n.articleId,className:"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar flex w-full max-w-none scroll-pt-6 flex-col justify-between space-y-6 p-2 sm:p-10 sm:pt-8 lg:h-full lg:flex-1 lg:overflow-y-auto",children:[n.exerciseStepApp.instructionsCode?e.jsx(se,{inBrowserBrowserRef:i}):e.jsx("div",{className:"flex h-full items-center justify-center text-lg",children:e.jsx("p",{children:"No instructions yet..."})}),e.jsxs("div",{className:"mt-auto flex justify-between",children:[n.prevStepLink?e.jsxs(f,{to:n.prevStepLink.to,"aria-label":"Previous Step","data-keyboard-action":"g+p",prefetch:"intent",children:[e.jsx("span",{"aria-hidden":!0,children:"←"}),e.jsx("span",{className:"hidden xl:inline",children:" Previous"})]}):e.jsx("span",{}),n.nextStepLink?e.jsxs(f,{to:n.nextStepLink.to,"aria-label":"Next Step","data-keyboard-action":"g+n",prefetch:"intent",children:[e.jsx("span",{className:"hidden xl:inline",children:"Next "}),e.jsx("span",{"aria-hidden":!0,children:"→"})]}):e.jsx("span",{})]})]},n.articleId),e.jsx(I,{elementQuery:`#${n.articleId}`},`scroll-${n.articleId}`),n.type==="solution"?e.jsx(B,{type:"step",exerciseNumber:n.exerciseStepApp.exerciseNumber,stepNumber:n.exerciseStepApp.stepNumber,className:"h-14 border-t px-6"}):null,e.jsxs("div",{className:"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0",children:[e.jsx("div",{children:e.jsx("div",{className:"h-full",children:e.jsx(pe,{diffFilesPromise:n.diffFiles})})}),e.jsx(T,{appName:n.exerciseStepApp.name,relativePath:`${n.exerciseStepApp.relativePath}/README.mdx`}),e.jsx($,{prev:n.prevStepLink?{to:n.prevStepLink.to,"aria-label":"Previous Step"}:null,next:n.nextStepLink?{to:n.nextStepLink.to,"aria-label":"Next Step"}:null})]})]}),e.jsx("div",{role:"separator","aria-orientation":"vertical",title:"Drag to resize",className:"bg-border hover:bg-accent hidden w-1 cursor-col-resize lg:block",onMouseDown:d=>y({container:t.current,initialClientX:d.clientX,setSplitPercent:p}),onDoubleClick:()=>{p(q(50))},onTouchStart:d=>{const c=d.touches?.[0];c&&y({container:t.current,initialClientX:c.clientX,setSplitPercent:p})}}),e.jsx("div",{className:"flex min-h-[50vh] min-w-0 flex-none lg:min-h-0 lg:flex-1",children:e.jsx(O,{context:{inBrowserBrowserRef:i}})})]})})}),We=L(function(){return e.jsx(R,{className:"container flex items-center justify-center",statusHandlers:{404:G}})});export{We as ErrorBoundary,Qe as default,Ke as meta};
|
|
2
|
+
//# sourceMappingURL=_layout-CbP-ZGKA.js.map
|