diff --git a/.changeset/nice-apples-bake.md b/.changeset/nice-apples-bake.md index 45b054e5..7d1416b8 100644 --- a/.changeset/nice-apples-bake.md +++ b/.changeset/nice-apples-bake.md @@ -1,5 +1,5 @@ --- -"@wevm/framework": patch +"farc": patch --- Initial release. diff --git a/README.md b/README.md index 9a6bbc2e..7ccccb85 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# π‘­π’“π’‚π’Žπ’†work +# 𝑭𝒂𝒓𝒄 -A Framework for Farcaster Frames. \ No newline at end of file +The Framework for Farcaster Frames. diff --git a/bun.lockb b/bun.lockb index 9051b453..a413818b 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/example/package.json b/example/package.json index ccc53cab..8d0f98ab 100644 --- a/example/package.json +++ b/example/package.json @@ -5,7 +5,7 @@ "dev": "bun run --hot src/index.tsx" }, "dependencies": { - "@wevm/framework": "workspace:*", + "farc": "workspace:*", "hono": "^3.12.8" }, "devDependencies": { diff --git a/example/src/index.tsx b/example/src/index.tsx index d81ce1fb..1c279d67 100644 --- a/example/src/index.tsx +++ b/example/src/index.tsx @@ -2,7 +2,7 @@ /** @jsxImportSource hono/jsx */ /** @jsxFrag */ -import { Button, Framework } from '@wevm/framework' +import { Button, Framework } from 'farc' const app = new Framework() @@ -12,27 +12,27 @@ app.frame('/', ({ untrustedData }) => { image: (
diff --git a/src/index.tsx b/src/index.tsx index 14bfc0a3..9c4afba3 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -43,7 +43,7 @@ const renderer = jsxRenderer( return ( - π‘­π’“π’‚π’Žπ’†work Preview + 𝑭𝒂𝒓𝒄 Preview {children} @@ -228,6 +228,16 @@ export class Framework extends Hono { //////////////////////////////////////////////////////////////////////// // Components +//////////////////////////////////////////////////////////////////////// + +export type ButtonProps = { + children: string +} + +// TODO: `fc:frame:button:$idx:action` and `fc:frame:button:$idx:target` +export function Button({ children }: ButtonProps) { + return +} type FramePreviewProps = { baseUrl: string @@ -331,16 +341,9 @@ function FramePreview({ baseUrl, frame }: FramePreviewProps) { ) } -export type ButtonProps = { - children: string -} - -export function Button({ children }: ButtonProps) { - return -} - //////////////////////////////////////////////////////////////////////// // Utilities +//////////////////////////////////////////////////////////////////////// type Counter = { button: number } @@ -443,6 +446,7 @@ function htmlToFrame(html: string) { const title = properties['og:title'] ?? '' const version = (properties['fc:frame'] as FrameVersion) ?? 'vNext' + // TODO: Validate `fc:frame:button:$idx:action="link"` has corresponding `fc:frame:button:$idx:target` let buttons = [] as FrameButton[] for (const [index, button] of buttonMap) { buttons.push({ @@ -527,10 +531,7 @@ function getGlobalStyles() { } button, - input, - optgroup, - select, - textarea { + input { font-family: inherit; font-feature-settings: inherit; font-variation-settings: inherit; @@ -543,10 +544,7 @@ function getGlobalStyles() { } button, - input, - optgroup, - select, - textarea { + input { font-family: inherit; font-feature-settings: inherit; font-variation-settings: inherit; @@ -558,15 +556,12 @@ function getGlobalStyles() { padding: 0; } - button, - select { + button { + cursor: pointer; text-transform: none; } - button, - [type='button'], - [type='reset'], - [type='submit'] { + button[type='submit'] { -webkit-appearance: button; background-color: transparent; background-image: none; @@ -576,29 +571,18 @@ function getGlobalStyles() { outline: auto; } - input::placeholder, - textarea::placeholder { + input::placeholder { opacity: 1; color: #9ca3af; } - button, - [role="button"] { - cursor: pointer; - } - :disabled { cursor: default; } img, svg, - video, - canvas, - audio, - iframe, - embed, - object { + video { display: block; vertical-align: middle; } diff --git a/src/package.json b/src/package.json index 0e307db8..cf3c41de 100644 --- a/src/package.json +++ b/src/package.json @@ -1,5 +1,5 @@ { - "name": "@wevm/framework", + "name": "farc", "version": "0.0.0", "type": "module", "module": "_lib/index.js",