Skip to content

Commit

Permalink
chore: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Feb 8, 2024
1 parent 81d10ed commit bdf74cc
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .changeset/nice-apples-bake.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@wevm/framework": patch
"farc": patch
---

Initial release.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# 𝑭𝒓𝒂𝒎𝒆work
# 𝑭𝒂𝒓𝒄

A Framework for Farcaster Frames.
The Framework for Farcaster Frames.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dev": "bun run --hot src/index.tsx"
},
"dependencies": {
"@wevm/framework": "workspace:*",
"farc": "workspace:*",
"hono": "^3.12.8"
},
"devDependencies": {
Expand Down
16 changes: 8 additions & 8 deletions example/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/** @jsxImportSource hono/jsx */
/** @jsxFrag */

import { Button, Framework } from '@wevm/framework'
import { Button, Framework } from 'farc'

const app = new Framework()

Expand All @@ -12,27 +12,27 @@ app.frame('/', ({ untrustedData }) => {
image: (
<div
style={{
alignItems: 'center',
background: 'linear-gradient(to right, #432889, #17101F)',
backgroundSize: '100% 100%',
height: '100%',
width: '100%',
display: 'flex',
textAlign: 'center',
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'column',
flexWrap: 'nowrap',
height: '100%',
justifyContent: 'center',
textAlign: 'center',
width: '100%',
}}
>
<div
style={{
color: 'white',
fontSize: 60,
fontStyle: 'normal',
letterSpacing: '-0.025em',
color: 'white',
lineHeight: 1.4,
marginTop: 30,
padding: '0 120px',
lineHeight: 1.4,
whiteSpace: 'pre-wrap',
}}
>
Expand Down
56 changes: 20 additions & 36 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const renderer = jsxRenderer(
return (
<html lang="en">
<head>
<title>𝑭𝒓𝒂𝒎𝒆work Preview</title>
<title>𝑭𝒂𝒓𝒄 Preview</title>
<style>{getGlobalStyles()}</style>
</head>
<body style={{ padding: '1rem' }}>{children}</body>
Expand Down Expand Up @@ -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 <meta property="fc:frame:button" content={children} />
}

type FramePreviewProps = {
baseUrl: string
Expand Down Expand Up @@ -331,16 +341,9 @@ function FramePreview({ baseUrl, frame }: FramePreviewProps) {
)
}

export type ButtonProps = {
children: string
}

export function Button({ children }: ButtonProps) {
return <meta property="fc:frame:button" content={children} />
}

////////////////////////////////////////////////////////////////////////
// Utilities
////////////////////////////////////////////////////////////////////////

type Counter = { button: number }

Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -527,10 +531,7 @@ function getGlobalStyles() {
}
button,
input,
optgroup,
select,
textarea {
input {
font-family: inherit;
font-feature-settings: inherit;
font-variation-settings: inherit;
Expand All @@ -543,10 +544,7 @@ function getGlobalStyles() {
}
button,
input,
optgroup,
select,
textarea {
input {
font-family: inherit;
font-feature-settings: inherit;
font-variation-settings: inherit;
Expand All @@ -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;
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@wevm/framework",
"name": "farc",
"version": "0.0.0",
"type": "module",
"module": "_lib/index.js",
Expand Down

0 comments on commit bdf74cc

Please sign in to comment.