# wsm-toast

> This module adds alerts and notification capabilities to web apps built with [Webstudio](https://webstudio.so)

Latest version **1.0.14** (published 2023-04-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install wsm-toast
pnpm add wsm-toast
yarn add wsm-toast
bun add wsm-toast
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.14 |
| Published | 2023-04-28 |
| First published | 2023-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 31 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Webstudio |
| Maintainers | gianksp |

## Links

- npm: https://www.npmjs.com/package/wsm-toast
- Repository: https://github.com/webstudioso/wsm-toast
- Homepage: https://github.com/webstudioso/wsm-toast#readme
- Issues: https://github.com/webstudioso/wsm-toast/issues
- npm.io page: https://npm.io/package/wsm-toast

## Recent versions

- 1.0.14 (latest) — 2023-04-28
- 1.0.12 — 2023-04-28
- 1.0.11 — 2023-04-28
- 1.0.9 — 2023-04-27
- 1.0.8 — 2023-04-27
- 1.0.6 — 2023-04-27
- 1.0.5 — 2023-04-27
- 1.0.4 — 2023-02-21
- 1.0.2 — 2023-02-21
- 1.0.1 — 2023-02-21
- 1.0.0 — 2023-02-21

## README

# Webstudio Toast Module

This module adds alerts and notification capabilities to web apps built with [Webstudio](https://webstudio.so)

 ![Webstudio Module Toast](https://github.com/webstudioso/wsm-toast/actions/workflows/production.yml/badge.svg)

### Testing and Building Module
```
npm i
npm run test
npm run build
```

### Publish to NPMJS
```
npm publish
```

### Importing Dependency in Webstudio
Add it to the project, this is compatible with `grapesjs` as well.
```shell
npm i --save wsm-toast@latest
```
To import in the editor add the file and include it as a Plugin
```js
import PluginToast from "wsm-toast"

const editor = grapesjs.init({
    container: "#gjs",
    plugins: [
        PluginToast
    ],
})
```

### Dispatch Toast Event From Other Modules In Webstudio
```js
const event = new CustomEvent('onToast', { 
    detail: { 
        alertSeverity: "info", // info, success or error
        message: 'Message to display in toast', 
        link: 'https://google.com', // Optional link
        timeout: 5000 // Milliseconds of visibility
    }
})
 document.dispatchEvent(event)
```

---
_Source: https://npm.io/package/wsm-toast · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
