diff --git a/.changeset/plenty-pears-sniff.md b/.changeset/plenty-pears-sniff.md new file mode 100644 index 000000000..1a4c9d73c --- /dev/null +++ b/.changeset/plenty-pears-sniff.md @@ -0,0 +1,5 @@ +--- +"@solid-primitives/share": minor +--- + +Added Bluesky and X networks diff --git a/packages/share/README.md b/packages/share/README.md index dab8a6aa0..3845f1121 100644 --- a/packages/share/README.md +++ b/packages/share/README.md @@ -29,14 +29,14 @@ pnpm add @solid-primitives/share ### How to use it ```ts -import { createSocialShare, TWITTER } from "@solid-primitives/share"; +import { createSocialShare, BLUESKY } from "@solid-primitives/share"; const [share, close] = createSocialShare(() => ({ title: "SolidJS.com", url: "https://www.solidjs.com", description: "Simple and well-behaved reactivity!", })); -share(TWITTER); +share(BLUESKY); ``` ### Definition @@ -67,6 +67,7 @@ The following are a list of supported networks that may be imported from the sha | ------------- | ------------------ | ------------------ | ------------------ | ----------------------------------------------------------------------------------------------------------- | | Baidu | :heavy_check_mark: | :heavy_check_mark: | :x: | | | Buffer | :heavy_check_mark: | :heavy_check_mark: | :x: | | +| Bluesky | :heavy_check_mark: | :heavy_check_mark: | :x: | | | Email | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | EverNote | :heavy_check_mark: | :heavy_check_mark: | :x: | | | Facebook | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | `hashtags` A list of comma-separated hashtags, only the first one will be used.
`quote` Facebook quote. | @@ -86,6 +87,7 @@ The following are a list of supported networks that may be imported from the sha | Telegram | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | Tumblr | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | Twitter | :heavy_check_mark: | :heavy_check_mark: | :x: | `hashtags` A list of comma-separated hashtags.
`twitter-user` Twitter user to mention. | +| X | :heavy_check_mark: | :heavy_check_mark: | :x: | `hashtags` A list of comma-separated hashtags.
`twitter-user` X user to mention. | | Viber | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | VK | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | `media` URL of an image describing the content. | | 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 | Xing | :heavy_check_mark: | :heavy_check_mark: | :x: | | | Yammer | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | -For the networks: `Line`, `Skype`, `SMS`, `Telegram`, `Viber`, `WhatsApp` and `Yammer`; the shared content is a string of the form: "`$title` `$url` `$description`" +For the networks: `Bluesky`, `Line`, `Skype`, `SMS`, `Telegram`, `Viber`, `WhatsApp` and `Yammer`; the shared content is a string of the form: "`$title` `$url` `$description`" 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: @@ -104,12 +106,12 @@ Note that you can also provide your own custom network by formatting the input s - `@q`: Quote - `@h`: Hashtags - `@m`: Media -- `@tu`: TwitterUser (Twitter specific) +- `@tu`: X User (X specific) -The following is an example of Twitter's share string: +The following is an example of X's share string: ```ts -const twitter: Network = "https://twitter.com/intent/tweet?text=@t&url=@u&hashtags=@h@tu"; +const x: Network = "https://www.x.com/intent/tweet?text=@t&url=@u&hashtags=@h@tu"; ``` ### Demo diff --git a/packages/share/src/networks.ts b/packages/share/src/networks.ts index cfbbb5afc..6e1b886da 100644 --- a/packages/share/src/networks.ts +++ b/packages/share/src/networks.ts @@ -16,6 +16,7 @@ export const BAIDU: Network = "http://cang.baidu.com/do/add?iu=@u&it=@t"; export const BUFFER: Network = "https://bufferapp.com/add?text=@t&url=@u"; export const EMAIL: Network = "mailto:?subject=@t&body=@u%0D%0A@d"; export const EVERNOTE: Network = "https://www.evernote.com/clip.action?url=@u&title=@t"; +export const BLUESKY: Network = "https://bsky.app/intent/compose?text=@t%0D%0A@u%0D%0A@d"; export const FACEBOOK: Network = "https://www.facebook.com/sharer/sharer.php?u=@u&title=@t&description=@d"e=@q&hashtag=@h"; export const FLIPBOARD: Network = @@ -38,6 +39,7 @@ export const STUMBLEUPON: Network = "https://www.stumbleupon.com/submit?url=@u&t export const TELEGRAM: Network = "https://t.me/share/url?url=@u&text=@t%0D%0A@d"; export const TUMBLR: Network = "https://www.tumblr.com/share/link?url=@u&name=@t&description=@d"; export const TWITTER: Network = "https://twitter.com/intent/tweet?text=@t&url=@u&hashtags=@h@tu"; +export const X: Network = "https://www.x.com/intent/tweet?text=@t&url=@u&hashtags=@h@tu"; export const VIBER: Network = "viber://forward?text=@t%0D%0A@u%0D%0A@d"; export const VK: Network = "https://vk.com/share.php?url=@u&title=@t&description=@d&image=@m&noparse=true";