astro-atmosphere-comments 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0 (4 November 2026)
4
+
5
+ - **Languages:** the wording now comes from language files (`locales/*.json`, i18next JSON) in English, French, German, Spanish, Portuguese, Italian, Dutch and Japanese, picked from the component's `locale` prop, the integration's `locale` option or Astro's locale for the page, then English. Dates and plurals ("1 like", "2 likes") follow the language. The translations are drafts for native speakers to check; translation is being set up on Weblate.
6
+ - **Your own wording:** a `messages` option (and prop) changes any line, by its key in `locales/en.json`.
7
+ - The `label` and `authorLabel` props still work, and win over `messages`.
8
+
9
+ ## 0.2.0 (4 November 2026)
10
+
11
+ - The sign-in form is shown straight away under each post: a handle box and a **Sign in with Atmosphere** button, both with the Atmosphere logo. The "Respond with your Atmosphere Account" button that opened it is gone.
12
+ - `label` is now the form's heading (default "Sign in to leave a comment, like or repost"). If you set it for the old button's small text, change or remove it.
13
+ - As readers type in the handle box, **matching accounts are suggested** with their avatar, name and handle, so they can see they've found the right one; picking one signs in with it. Enter still signs in with exactly what was typed.
14
+ - Under the sign-in form, **"Rather not sign in here? Reply on Bluesky instead →"** links to the announcement, for readers who'd rather reply in the Bluesky app (`blueskyLink={false}` hides it). If your page already says this in the `after-box` slot, remove one.
15
+ - Readers can **delete their own comments**: a Delete button under each of them, with a confirmation. Signing in no longer asks for permission to delete posts; the first delete asks the reader's account host for it (one more approval), then finishes. The server only ever deletes the reader's own replies under your announcements. Fires `atmosphere:deleted` (`detail`: `uri`).
16
+ - The site's OAuth client metadata moved to `/oauth-client-metadata.json` at the site's root (was `/atmosphere/client-metadata.json`), so Bluesky's approval page names the site by its address ("saltedlolly.com") instead of showing a file address. **Readers already signed in will need to sign in once more**, because their sign-in belonged to the old address. If your site already serves a file at that address, the two will clash.
17
+ - The handle box keeps `name="handle"` (the name most atproto apps use, so browsers can suggest handles typed elsewhere) and asks password managers to leave it alone: it isn't a login for your site, so they offered the wrong one. This follows the community's emerging convention and may change (see AGENTS.md).
18
+ - `--atmo-danger` sets the colour of the confirming Delete button.
19
+ - Pressing Reply, Like or Repost on a comment while signed out moves to the form and puts the cursor in the handle box.
20
+
3
21
  ## 0.1.1 (3 November 2026)
4
22
 
5
23
  - The credit link now goes to a permanent address, saltedlolly.com/atmosphere-comments-for-astro/.
package/README.md CHANGED
@@ -2,12 +2,13 @@
2
2
 
3
3
  Bluesky comments for your Astro site, without the reader leaving the page. (On npm: [`astro-atmosphere-comments`](https://www.npmjs.com/package/astro-atmosphere-comments).)
4
4
 
5
- Readers press **Respond with your Atmosphere Account**, sign in with their Bluesky handle (or any other [Atmosphere account](https://atmosphereaccount.com)), and can then:
5
+ Under each post, readers type their Bluesky handle (or that of any other [Atmosphere account](https://atmosphereaccount.com)) into the **Sign in with Atmosphere** form, which suggests matching accounts with their avatars as they type, and can then:
6
6
 
7
7
  - **comment** on your post, and **reply** to other comments;
8
8
  - **like** and **repost** your post, or any comment under it;
9
9
  - **quote** your post on their own profile, with a Bluesky-style preview;
10
- - **@mention** people, with suggestions as they type.
10
+ - **@mention** people, with suggestions as they type;
11
+ - **delete** their own comments.
11
12
 
12
13
  Everything they post is written to **their own account**, as ordinary Bluesky posts, likes and reposts: comments are replies to your post's announcement on Bluesky. They can delete them in any Bluesky app, and people who prefer the app can reply there instead; it all shows up on your page the same way.
13
14
 
@@ -18,11 +19,13 @@ See it on [saltedlolly.com](https://saltedlolly.com/2005/07/13/summer-jam-party-
18
19
  ## How it works
19
20
 
20
21
  1. You announce each post on Bluesky (a post linking to it). That post's thread is the comment section.
21
- 2. A reader signs in with **AT Protocol OAuth, straight to their own account host** (Bluesky's, for most people). There is no third-party login service in between, and your site never sees a password.
22
- 3. Your site asks only for what commenting needs: to create and delete posts, likes and reposts, and to see which posts the reader has already liked or reposted. Readers can revoke it at any time in their Bluesky settings.
22
+ 2. A reader signs in with **AT Protocol OAuth, straight to their own account host** (Bluesky's, for most people), which asks them to approve your site, named by its address (example.com). There is no third-party login service in between, and your site never sees a password.
23
+ 3. Your site asks only for what commenting needs: to create posts, to create and delete likes and reposts, and to see which posts the reader has already liked or reposted. Permission to delete posts is asked for separately, only the first time a reader deletes one of their comments on your site, and the site only ever uses it on their own comments under your posts. Readers can revoke it all at any time in their Bluesky settings.
23
24
  4. Your server keeps each reader's sign-in (a random cookie in their browser; their tokens on your server), and posts on their behalf when they press a button.
24
25
 
25
- Images (avatars, link-card pictures) and @mention searches go through your server, so readers' browsers never contact Bluesky directly.
26
+ Readers who'd rather not sign in can use the **Reply on Bluesky instead** link under the form.
27
+
28
+ Images (avatars, link-card pictures) and account searches (the suggestions under the sign-in box and for @mentions) go through your server, so readers' browsers never contact Bluesky directly.
26
29
 
27
30
  ## Requirements
28
31
 
@@ -67,7 +70,7 @@ To find an account's DID: `https://bsky.social/xrpc/com.atproto.identity.resolve
67
70
  npx astro-atmosphere-comments keygen
68
71
  ```
69
72
 
70
- This adds `ATMOSPHERE_PRIVATE_JWK` to your `.env` without printing it. Your site signs its requests to readers' account hosts with it; the public half is published at `/atmosphere/jwks.json`. Set the same variable on your server, keep `.env` out of Git, and keep a backup: **a new key signs every reader out.**
73
+ This adds `ATMOSPHERE_PRIVATE_JWK` to your `.env` without printing it. Your site signs its requests to readers' account hosts with it; the public half is published at `/atmosphere/jwks.json`, and the site's details for account hosts (its name, logo and permissions) at `/oauth-client-metadata.json`. That second file has to be at your site's root: it's the conventional address, and only then does Bluesky's approval page name your site by its address alone. Set the same variable on your server, keep `.env` out of Git, and keep a backup: **a new key signs every reader out.**
71
74
 
72
75
  On the server, also set `ATMOSPHERE_DATA_DIR` to a folder **outside your deploy folder** (for example `/var/lib/example-com/atmosphere`), so deploys don't sign readers out. It defaults to `.data/atmosphere` in the project.
73
76
 
@@ -97,25 +100,45 @@ Locally the integration uses the protocol's development mode, so no key is neede
97
100
 
98
101
  | Option | Required | What it does |
99
102
  | --- | --- | --- |
100
- | `clientName` | yes | Your site's name on the reader's sign-in screen. |
103
+ | `clientName` | yes | Your site's name, given to readers' account hosts. (Bluesky's approval page shows your site's address instead, unless Bluesky has marked your site as trusted.) |
101
104
  | `allowedAuthors` | yes | DIDs of the accounts whose posts can be commented on through your site. Comments from these accounts get the Author badge. |
102
105
  | `logoUri` | | A square logo for the sign-in screen (absolute `https://` address). |
103
106
  | `policyUri`, `tosUri` | | Your privacy policy and terms, shown on the sign-in screen. |
104
107
  | `hidden` | | Comments never to show: bsky.app post or profile addresses, AT URIs, handles or DIDs. Replies you hide in the Bluesky app, and posts with Bluesky's moderation labels (spam and so on), are left out anyway. |
105
108
  | `base` | | Where the integration's routes live. Default `/atmosphere`. |
109
+ | `locale` | | The language of the wording, such as `"fr"` or `"pt-BR"` (see Languages). |
110
+ | `messages` | | Your own wording for any line, by its key in [`locales/en.json`](locales/en.json). |
106
111
 
107
112
  ## The component
108
113
 
109
114
  | Prop | What it does |
110
115
  | --- | --- |
111
116
  | `post` | The announcement: bsky.app address or AT URI. Optional with Standard.site (above). |
112
- | `label` | The small words on the button above "Atmosphere Account". Default "Respond with your". |
117
+ | `label` | The sign-in form's heading. Default "Sign in to leave a comment, like or repost". |
113
118
  | `authorLabel` | The badge on your own comments. Default "Author". |
119
+ | `blueskyLink` | "Rather not sign in here? Reply on Bluesky instead →" under the sign-in form, linking to the announcement (with `u-syndication`, so microformats readers learn it's the post's copy on Bluesky). Default `true`; `blueskyLink={false}` hides it. |
120
+ | `locale`, `messages` | The same as the integration's options, for this one component. |
114
121
  | `credit` | A small "Powered by Atmosphere Comments for Astro" link at the end. Default `true`; set `credit={false}` to hide it. |
115
122
 
116
123
  **Slots:** `after-box` goes between the comment box and the comments (a note about other ways to respond, say); the default slot goes after the comments (other responses, older comments).
117
124
 
118
- **Layout, top to bottom:** likes and reposts, the button (or, signed in, Like, Repost, Quote and the comment box), your `after-box` content, the comments, your default slot content.
125
+ **Layout, top to bottom:** likes and reposts, the sign-in form and the "Reply on Bluesky instead" line (or, signed in, Like, Repost, Quote and the comment box), your `after-box` content, the comments, your default slot content.
126
+
127
+ ## Languages
128
+
129
+ The wording comes in English, French, German, Spanish, Portuguese, Italian, Dutch and Japanese. The component uses, in order: its `locale` prop, the integration's `locale` option, Astro's own locale for the page (if you use [Astro's i18n routing](https://docs.astro.build/en/guides/internationalization/)), then English. A regional code falls back to its language (`pt-BR` uses `pt`), and any line a language lacks is shown in English. Dates follow the same language.
130
+
131
+ To change any line, give its key from [`locales/en.json`](locales/en.json):
132
+
133
+ ```js
134
+ atmosphereComments({
135
+ // …
136
+ locale: "fr",
137
+ messages: { "signIn.heading": "Connecte-toi pour rejoindre la conversation" },
138
+ }),
139
+ ```
140
+
141
+ The translations other than English started as drafts and need checking by native speakers. Translation is being set up on [Weblate](https://weblate.org), the open-source translation platform; until then, corrections and new languages are very welcome as [GitHub issues or pull requests](https://github.com/saltedlolly/astro-atmosphere-comments/issues). (Bluesky's own approval page is in the reader's language already.)
119
142
 
120
143
  ## Styling
121
144
 
@@ -130,8 +153,9 @@ It has a plain default look and takes your text colour. Colours come from CSS cu
130
153
  --atmo-border: #ddd;
131
154
  --atmo-field-bg: #f6f6f6; /* text boxes */
132
155
  --atmo-card-bg: #fafafa; /* comments */
133
- --atmo-menu-bg: #fff; /* @mention suggestions */
156
+ --atmo-menu-bg: #fff; /* account and @mention suggestions */
134
157
  --atmo-ring: #fff; /* the outline round faces */
158
+ --atmo-danger: #c0392b; /* Delete, when confirming */
135
159
  --atmo-radius: 10px;
136
160
  }
137
161
  ```
@@ -144,11 +168,12 @@ The component fires (bubbling):
144
168
 
145
169
  - `atmosphere:commented` after a comment, reply or quote is posted (`detail`: `uri`, `url`, `text`, `author`, `createdAt`, `quote`, `parent`);
146
170
  - `atmosphere:reacted` after a like or repost of the post, or undoing one (`detail`: `kind`, `on`, `author`).
171
+ - `atmosphere:deleted` after a reader deletes one of their comments (`detail`: `uri`).
147
172
 
148
173
  ## Security and privacy
149
174
 
150
- - **What your server stores:** for each signed-in reader, their DID and their OAuth tokens (which can only post, like and repost as described above), plus a random cookie value. Files are readable only by your site's user. Mention this in your privacy policy.
151
- - **What it refuses:** requests that change something must come from your own pages (checked by `Origin`); only your announcements and comments in their threads can be acted on; comments, likes and searches are rate-limited per account; the image route only passes on avatars and link pictures it has just shown.
175
+ - **What your server stores:** for each signed-in reader, their DID and their OAuth tokens (which can only post, like and repost as described above, and delete posts if the reader allowed it), plus a random cookie value. Files are readable only by your site's user. Mention this in your privacy policy.
176
+ - **What it refuses:** requests that change something must come from your own pages (checked by `Origin`); only your announcements and comments in their threads can be acted on; only a reader's own replies under your announcements can be deleted; comments, likes and searches are rate-limited per account, and searches by readers who aren't signed in per address and overall; the image route only passes on avatars and link pictures it has just shown.
152
177
  - **Moderation:** comments appear automatically. Hide one in the Bluesky app (it disappears here too), block the account, or add it to `hidden`.
153
178
  - Comments are plain text, as on Bluesky: links, @mentions and #hashtags become links.
154
179
 
@@ -156,7 +181,6 @@ The component fires (bubbling):
156
181
 
157
182
  - Needs a Node server with a lasting disk (no serverless or edge hosts yet).
158
183
  - Rate limits are kept in memory, so they apply per server process.
159
- - The wording is English only.
160
184
  - Quoting individual comments isn't supported.
161
185
 
162
186
  If you only want readers to sign in with their Atmosphere account, without comments, see [AuthProto](https://www.npmjs.com/package/@fujocoded/authproto).