Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Embeds] Embed for single post #3450

Merged
merged 28 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
095fe02
add bskyembed vite app
mozzius Apr 8, 2024
6933e1e
create build script (temp until embedr is ready)
mozzius Apr 12, 2024
42a38a8
add build output to web build
mozzius Apr 8, 2024
c44a3a3
simplify post-build step by copying everything at once
mozzius Apr 8, 2024
a8423e5
add simple post viewer
mozzius Apr 8, 2024
56da454
add butterfly logo
mozzius Apr 8, 2024
44ba12f
add vite plugin legacy
mozzius Apr 9, 2024
bb6b836
proper error screen
mozzius Apr 9, 2024
2c8708c
add image embed
mozzius Apr 9, 2024
73fd585
add url embed
mozzius Apr 9, 2024
7b66f5e
record embed + embedwithmedia
mozzius Apr 9, 2024
244f9da
add list+feed embeds
mozzius Apr 9, 2024
60e43f3
add labeller embed (just to be safe)
mozzius Apr 9, 2024
a205c2e
fix curatelist and modlist being the wrong way around
mozzius Apr 9, 2024
40bb382
Add PWI opt-out
mozzius Apr 9, 2024
12dd2f2
add favicon
mozzius Apr 9, 2024
0e8ef25
improve wording of PWI
mozzius Apr 9, 2024
ab68be3
remove padding I used for screenshots
mozzius Apr 9, 2024
49776e0
add disabled state to embed
mozzius Apr 9, 2024
268820c
improve PWI styles by adding an icon
mozzius Apr 9, 2024
846abf9
remove unused prop
mozzius Apr 9, 2024
c2fe2c8
rm open proxy
mozzius Apr 9, 2024
4fe2904
[Embeds] Add CTA and add general polish - input needed! (#3454)
mozzius Apr 10, 2024
ae8e019
more responsive + preserve whitespace
mozzius Apr 11, 2024
b596393
add trailing newsline to deploy script
mozzius Apr 12, 2024
e841906
add repost indicator
mozzius Apr 12, 2024
1b92366
Make butterfly link to content
gaearon Apr 13, 2024
af706b6
More consistent error text wording
gaearon Apr 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/icons/bubble_filled_stroke2_corner2_rounded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/bubble_stroke2_corner2_rounded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/repost_stroke2_corner2_rounded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions bskyembed/assets/bubble_filled_stroke2_corner2_rounded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions bskyembed/assets/circleInfo_stroke2_corner0_rounded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions bskyembed/assets/heart2_filled_stroke2_corner0_rounded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions bskyembed/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions bskyembed/assets/repost_stroke2_corner2_rounded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion bskyembed/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
<title>Bluesky Embed</title>
<link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="mask-icon" href="/static/safari-pinned-tab.svg" color="#1185fe">
<meta name="theme-color">
<meta name="application-name" content="Bluesky">
<meta name="generator" content="bskyweb">
</head>
<body>
<div id="app"></div>
Expand Down
13 changes: 10 additions & 3 deletions bskyembed/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
{
"name": "bskyembed",
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx src"
},
"dependencies": {
"preact": "^10.4.8"
"@atproto/api": "^0.12.2",
"@preact/preset-vite": "^2.8.2",
"@vitejs/plugin-legacy": "^5.3.2",
"preact": "^10.4.8",
"terser": "^5.30.3"
},
"devDependencies": {
"@prefresh/vite": "^1.2.1",
"autoprefixer": "^10.4.19",
"eslint": "^8.19.0",
"eslint-config-preact": "^1.3.0",
"eslint-plugin-simple-import-sort": "^12.0.0",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"typescript": "^4.0.5",
"vite": "^1.0.0-rc.13",
"vite": "^5.2.8",
"vite-tsconfig-paths": "^4.3.2"
}
}
6 changes: 6 additions & 0 deletions bskyembed/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
18 changes: 0 additions & 18 deletions bskyembed/src/app.tsx

This file was deleted.

32 changes: 32 additions & 0 deletions bskyembed/src/container.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import {ComponentChildren, h} from 'preact'
import {useRef} from 'preact/hooks'

import {Link} from './link'

export function Container({
children,
href,
}: {
children: ComponentChildren
href: string
}) {
const ref = useRef<HTMLDivElement>(null)
return (
<div
ref={ref}
className="w-full bg-white hover:bg-neutral-50 relative transition-colors max-w-[550px] min-w-[300px] flex border rounded-xl px-4 pt-3 pb-2.5"
onClick={() => {
if (ref.current) {
// forwardRef requires preact/compat - let's keep it simple
// to keep the bundle size down
const anchor = ref.current.querySelector('a')
if (anchor) {
anchor.click()
}
}
}}>
<Link href={href} />
{children}
</div>
)
}
Loading
Loading