Skip to content

Commit a4b5468

Browse files
authored
Adding Bluesky and X share package (#743)
2 parents 85171c6 + 220a8be commit a4b5468

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

.changeset/plenty-pears-sniff.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solid-primitives/share": minor
3+
---
4+
5+
Added Bluesky and X networks

packages/share/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ pnpm add @solid-primitives/share
2929
### How to use it
3030

3131
```ts
32-
import { createSocialShare, TWITTER } from "@solid-primitives/share";
32+
import { createSocialShare, BLUESKY } from "@solid-primitives/share";
3333

3434
const [share, close] = createSocialShare(() => ({
3535
title: "SolidJS.com",
3636
url: "https://www.solidjs.com",
3737
description: "Simple and well-behaved reactivity!",
3838
}));
39-
share(TWITTER);
39+
share(BLUESKY);
4040
```
4141

4242
### Definition
@@ -67,6 +67,7 @@ The following are a list of supported networks that may be imported from the sha
6767
| ------------- | ------------------ | ------------------ | ------------------ | ----------------------------------------------------------------------------------------------------------- |
6868
| Baidu | :heavy_check_mark: | :heavy_check_mark: | :x: | |
6969
| Buffer | :heavy_check_mark: | :heavy_check_mark: | :x: | |
70+
| Bluesky | :heavy_check_mark: | :heavy_check_mark: | :x: | |
7071
| Email | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | |
7172
| EverNote | :heavy_check_mark: | :heavy_check_mark: | :x: | |
7273
| Facebook | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | `hashtags` A list of comma-separated hashtags, only the first one will be used.<br/>`quote` Facebook quote. |
@@ -86,6 +87,7 @@ The following are a list of supported networks that may be imported from the sha
8687
| Telegram | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | |
8788
| Tumblr | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | |
8889
| Twitter | :heavy_check_mark: | :heavy_check_mark: | :x: | `hashtags` A list of comma-separated hashtags.<br/>`twitter-user` Twitter user to mention. |
90+
| X | :heavy_check_mark: | :heavy_check_mark: | :x: | `hashtags` A list of comma-separated hashtags.<br/>`twitter-user` X user to mention. |
8991
| Viber | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | |
9092
| VK | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | `media` URL of an image describing the content. |
9193
| Weibo | :heavy_check_mark: | :heavy_check_mark: | :x: | `media` URL of an image describing the content. |
@@ -94,7 +96,7 @@ The following are a list of supported networks that may be imported from the sha
9496
| Xing | :heavy_check_mark: | :heavy_check_mark: | :x: | |
9597
| Yammer | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | |
9698

97-
For the networks: `Line`, `Skype`, `SMS`, `Telegram`, `Viber`, `WhatsApp` and `Yammer`; the shared content is a string of the form: "`$title` `$url` `$description`"
99+
For the networks: `Bluesky`, `Line`, `Skype`, `SMS`, `Telegram`, `Viber`, `WhatsApp` and `Yammer`; the shared content is a string of the form: "`$title` `$url` `$description`"
98100

99101
Note that you can also provide your own custom network by formatting the input string into the share function. The following is a list of properties that will be replaced by the utility:
100102

@@ -104,12 +106,12 @@ Note that you can also provide your own custom network by formatting the input s
104106
- `@q`: Quote
105107
- `@h`: Hashtags
106108
- `@m`: Media
107-
- `@tu`: TwitterUser (Twitter specific)
109+
- `@tu`: X User (X specific)
108110

109-
The following is an example of Twitter's share string:
111+
The following is an example of X's share string:
110112

111113
```ts
112-
const twitter: Network = "https://twitter.com/intent/tweet?text=@t&url=@u&hashtags=@h@tu";
114+
const x: Network = "https://www.x.com/intent/tweet?text=@t&url=@u&hashtags=@h@tu";
113115
```
114116

115117
### Demo

packages/share/src/networks.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const BAIDU: Network = "http://cang.baidu.com/do/add?iu=@u&it=@t";
1616
export const BUFFER: Network = "https://bufferapp.com/add?text=@t&url=@u";
1717
export const EMAIL: Network = "mailto:?subject=@t&body=@u%0D%0A@d";
1818
export const EVERNOTE: Network = "https://www.evernote.com/clip.action?url=@u&title=@t";
19+
export const BLUESKY: Network = "https://bsky.app/intent/compose?text=@t%0D%0A@u%0D%0A@d";
1920
export const FACEBOOK: Network =
2021
"https://www.facebook.com/sharer/sharer.php?u=@u&title=@t&description=@d&quote=@q&hashtag=@h";
2122
export const FLIPBOARD: Network =
@@ -38,6 +39,7 @@ export const STUMBLEUPON: Network = "https://www.stumbleupon.com/submit?url=@u&t
3839
export const TELEGRAM: Network = "https://t.me/share/url?url=@u&text=@t%0D%0A@d";
3940
export const TUMBLR: Network = "https://www.tumblr.com/share/link?url=@u&name=@t&description=@d";
4041
export const TWITTER: Network = "https://twitter.com/intent/tweet?text=@t&url=@u&hashtags=@h@tu";
42+
export const X: Network = "https://www.x.com/intent/tweet?text=@t&url=@u&hashtags=@h@tu";
4143
export const VIBER: Network = "viber://forward?text=@t%0D%0A@u%0D%0A@d";
4244
export const VK: Network =
4345
"https://vk.com/share.php?url=@u&title=@t&description=@d&image=@m&noparse=true";

0 commit comments

Comments
 (0)