├── demo
├── src
│ ├── env.d.ts
│ ├── pages
│ │ ├── mdx.mdx
│ │ ├── tweet
│ │ │ └── [id].astro
│ │ └── index.astro
│ ├── layouts
│ │ └── BaseLayout.astro
│ └── components
│ │ └── Header.astro
├── tsconfig.json
├── public
│ ├── social.png
│ └── favicon.svg
├── README.md
├── .gitignore
├── astro.config.mjs
├── tailwind.config.mjs
├── package.json
└── CHANGELOG.md
├── pnpm-workspace.yaml
├── packages
└── astro-tweet
│ ├── tsconfig.json
│ ├── index.ts
│ ├── src
│ ├── twitter-theme
│ │ ├── tweet-skeleton.module.css
│ │ ├── Skeleton.astro
│ │ ├── AvatarImg.astro
│ │ ├── MediaImg.astro
│ │ ├── quoted-tweet
│ │ │ ├── index.ts
│ │ │ ├── QuotedTweetContainer.astro
│ │ │ ├── QuotedTweetBody.astro
│ │ │ ├── quoted-tweet-body.module.css
│ │ │ ├── quoted-tweet-container.module.css
│ │ │ ├── QuotedTweet.astro
│ │ │ ├── quoted-tweet-header.module.css
│ │ │ └── QuotedTweetHeader.astro
│ │ ├── icons
│ │ │ ├── icons.module.css
│ │ │ ├── index.ts
│ │ │ ├── Verified.astro
│ │ │ ├── VerifiedGovernment.astro
│ │ │ └── VerifiedBusiness.astro
│ │ ├── tweet-not-found.module.css
│ │ ├── tweet-link.module.css
│ │ ├── TweetLink.astro
│ │ ├── tweet-body.module.css
│ │ ├── verified-badge.module.css
│ │ ├── tweet-info-created-at.module.css
│ │ ├── tweet-in-reply-to.module.css
│ │ ├── TweetNotFound.astro
│ │ ├── TweetContainer.astro
│ │ ├── TweetInReplyTo.astro
│ │ ├── skeleton.module.css
│ │ ├── TweetInfoCreatedAt.astro
│ │ ├── types.ts
│ │ ├── TweetSkeleton.astro
│ │ ├── TweetReplies.astro
│ │ ├── tweet-container.module.css
│ │ ├── TweetMediaVideo.astro
│ │ ├── components.ts
│ │ ├── tweet-replies.module.css
│ │ ├── tweet-info.module.css
│ │ ├── TweetBody.astro
│ │ ├── tweet-media.module.css
│ │ ├── VerifiedBadge.astro
│ │ ├── TweetInfo.astro
│ │ ├── EmbeddedTweet.astro
│ │ ├── tweet-media-video.module.css
│ │ ├── TweetActions.astro
│ │ ├── tweet-header.module.css
│ │ ├── tweet-actions.module.css
│ │ ├── TweetHeader.astro
│ │ ├── TweetMedia.astro
│ │ └── theme.css
│ ├── api
│ │ ├── index.ts
│ │ ├── types
│ │ │ ├── edit.ts
│ │ │ ├── index.ts
│ │ │ ├── photo.ts
│ │ │ ├── user.ts
│ │ │ ├── video.ts
│ │ │ ├── entities.ts
│ │ │ ├── media.ts
│ │ │ └── tweet.ts
│ │ ├── get-oembed.ts
│ │ └── get-tweet.ts
│ ├── AstroTweet.astro
│ ├── Tweet.astro
│ ├── TweetContent.astro
│ └── utils.ts
│ ├── CHANGELOG.md
│ ├── package.json
│ └── README.md
├── .vscode
├── settings.json
└── extensions.json
├── .changeset
├── config.json
└── README.md
├── .gitignore
├── .github
└── workflows
│ ├── changeset-version.js
│ └── release.yml
├── package.json
├── CONTRIBUTING.md
├── LICENSE
└── README.md
/demo/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
11 | {Astro.props.tweet.entities.map((item, i) => {item.text})} 12 |
13 | -------------------------------------------------------------------------------- /packages/astro-tweet/src/twitter-theme/quoted-tweet/quoted-tweet-body.module.css: -------------------------------------------------------------------------------- 1 | .root { 2 | font-size: var(--tweet-quoted-body-font-size); 3 | font-weight: var(--tweet-quoted-body-font-weight); 4 | line-height: var(--tweet-quoted-body-line-height); 5 | margin: var(--tweet-quoted-body-margin); 6 | overflow-wrap: break-word; 7 | white-space: pre-wrap; 8 | padding: 0 0.75rem; 9 | } 10 | -------------------------------------------------------------------------------- /packages/astro-tweet/src/Tweet.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import TweetContent from "./TweetContent.astro"; 3 | 4 | interface Props { 5 | id: string; 6 | // TODO: add support for custom components (do we need this though?) 7 | // components?: TwitterComponents; 8 | fetchOptions?: RequestInit; 9 | onError?: ((error: any) => any) | undefined; 10 | } 11 | --- 12 | 13 |The embedded tweet could not be found…
14 |
12 | {
13 | tweet.entities.map((item, i) => {
14 | switch (item.type) {
15 | case "hashtag":
16 | case "mention":
17 | case "url":
18 | case "symbol":
19 | return