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

feat: 🎸 SMastodon #570

Merged
merged 4 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ Browse [online documentation here](https://vue-socials.vercel.app/)

* <img src="https://raw.githubusercontent.com/webistomin/vue-socials/main/assets/icons/mailru.svg" width="16" height="16"/> [MailRu](#smailru)

* <img src="https://raw.githubusercontent.com/webistomin/vue-socials/main/assets/icons/mastodon.svg" width="16" height="16"/> [Mastodon](#smastodon)

* <img src="https://raw.githubusercontent.com/webistomin/vue-socials/main/assets/icons/microsoftteams.svg" width="16" height="16"/> [Microsoft Teams](#smicrosoftteams)

## O
Expand Down Expand Up @@ -2165,6 +2167,72 @@ This component uses `JSONP` so the content won't be available during `SSR`.

---

### SMastodon

**Usage**

```vue
<template>
<s-mastodon
:window-features="windowFeatures"
:share-options="shareOptions"
:use-native-behavior="useNativeBehavior"
@popup-close="onClose"
@popup-open="onOpen"
@popup-block="onBlock"
@popup-focus="onFocus"
></s-mastodon>
</template>

<script>
import { SMastodon } from 'vue-socials'

export default {
name: 'SSMastodonSharing',

components: { SMastodon },

data() {
return {
windowFeatures: {},
shareOptions: {
domain: 'https://mas.to',
url: 'https://github.com',
text: 'Hello, world!',
},
useNativeBehavior: false,
}
},

methods: {
onClose() {},
onOpen() {},
onBlock() {},
onFocus() {},
}
};
</script>
```

**Props**

| Prop | Type | Description | Default value |
| ------ | ------ |--------------------------------------------------------------------------------------------------------------------------------------------------------| ------ |
`windowFeatures` | `object` | Pass options to `window.open()`. [Requested features of the new window.](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#window_features) | `{ width: 600, height: 700, }`
`shareOptions` | `object` | Your share link parameters: <br /> **domain** – the mastodon domain <br /> **url** – the URL you want to share <br /> **text** – your text <br /> | `{}`
`useNativeBehavior` | `boolean` | Use native link behavior instead of `window.open()` or not | `false`

**Events**

| Event name | Usage |
| ------ | ------ |
`popup-open` | `window.open()` has been opened |
`popup-close` | `window.open()` has been closed |
`popup-block` | `window.open()` has been blocked |
`popup-focus` | `window.open()` has been focused |

---

### SMicrosoftTeams

**Usage**
Expand Down
4 changes: 4 additions & 0 deletions assets/icons/mastodon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading