1// visits
2import { DataRequest } from "https://esm.town/v/jxnblk/reactstream/index.tsx";
3
4const API = "https://jxnblk-api.web.val.run/visits";
2
3// import data from "https://blog.jxnblk.com/api/all.json" with { type: "json" };
4import type { Middleware } from "https://esm.town/v/jxnblk/reactstream/index.tsx";
5
6function generateRSSFeed(posts) {
1/** @jsxImportSource https://esm.sh/react@18.3.1 */
2import { renderToStaticMarkup } from "https://esm.sh/react-dom@18.3.1/server";
3
4export const Vantom = ({
1/** @jsxImportSource npm:react@18.3.1 */
2import { render as renderPNG } from "https://deno.land/x/resvg_wasm@0.2.0/mod.ts";
3import { renderToStaticMarkup } from "npm:react-dom@18.3.1/server";
4
5type SVGComponentProps = {
10const cache = new Map();
11
12export function render(Component: React.ComponentType<SVGComponentProps>, headers: any = {}) {
13 return async function(req: Request): Promise<Response> {
14 const url = new URL(req.url);
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import { type Message } from "../shared/utils.ts";
4import { App } from "./components/App.tsx";
1/** @jsxImportSource npm:react@18.3.1 */
2import wrap from "npm:word-wrap";
3// make this a library
4import { render } from "./react-svg-to-png.tsx";
5import { Avatar } from "./avatar.tsx";
6import { Diagz, Tiled } from "./greebles.tsx";
1/** @jsxImportSource https://esm.sh/react@18.3.1 */
2import { type ReactNode, SVGProps } from "https://esm.sh/react@18.3.1";
3
4type IconProps = SVGProps<SVGSVGElement> & {
42
43type TiledProps = IconProps & {
44 children: ReactNode;
45 offset?: number | string;
46};
1// jxnblk avatar.
2/** @jsxImportSource https://esm.sh/react@18.3.1 */
3import { renderToStaticMarkup } from "https://esm.sh/react-dom@18.3.1/server";
4import { SVGProps } from "https://esm.sh/react@18.3.1";
5
6type AvatarProps = SVGProps<SVGSVGElement> & {
15 model: openai("gpt-4o-mini"),
16 system: "You are Chuck Norris, known for humorous and exaggerated responses.",
17 prompt: `Create a funny and morbid response as if Chuck Norris were reacting to the situation: ${situation}, involving the user: ${user_name}.`,
18 });
19 return Response.json({ response: chuckResponse });
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client?deps=react@18.2.0";
3import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter?deps=react@18.2.0,react-dom@18.2.0";
4import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
5import STARTER_PROMPTS from "./starter-prompts.js";
6
30}: {
31 prompt: string;
32 setPrompt: React.Dispatch<React.SetStateAction<string>>;
33 handleSubmit: (e: React.FormEvent) => void;
34 handleStarterPromptClick: (promptItem: PromptItem) => void;
35}) {
116
117function App() {
118 const previewRef = React.useRef<HTMLDivElement>(null);
119 const [prompt, setPrompt] = useState("");
120 const [projectId, setProjectId] = useState<number | null>(null);
174 }
175
176 async function handleSubmit(e: React.FormEvent | string) {
177 if (typeof e !== "string") {
178 e.preventDefault();
673 </div>
674 <div className="bg-white w-full h-full flex flex-col grow rounded-xl border-2 border-white overflow-hidden">
675 <React.Fragment key={iframeKey}>
676 <iframe
677 srcDoc={code}
679 className="w-full grow"
680 />
681 </React.Fragment>
682 </div>
683 </div>