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

Update README.md File #294

Open
wants to merge 26 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f57965f
touchstart should be passive (#133)
Maronato Sep 20, 2020
c2ba3dd
Notice that `timeout` doesn't work with `cssFile: false` (#108)
hmaesta Sep 20, 2020
c71b172
v1.7.8
Maronato Sep 20, 2020
89b36f4
updated readme
Maronato Sep 20, 2020
0f6f453
Update README.md
Maronato Sep 21, 2020
2fc5431
Change analytics provider and enable EthicalAds on demo page (#143)
Maronato Oct 30, 2020
2936f3d
more ad placements
Maronato Oct 30, 2020
9fbabbe
fix ad sizing placement
Maronato Oct 30, 2020
53b4eea
Better analytics on demo page
Maronato Nov 10, 2020
84ee7dd
More show toast analytics
Maronato Nov 10, 2020
f024d81
use proper z-index on ad containers
Maronato Dec 27, 2020
cc1420e
fix: remove DOM-only object references (resolves #155)
Maronato Jan 13, 2021
39c9871
v1.7.10
Maronato Jan 13, 2021
838dc42
fix: disable runtime container prop validation
Maronato Jan 18, 2021
405499b
v1.7.11
Maronato Jan 18, 2021
193c4b7
Fix: Sass Slash as Division #243 (#264)
meirroth Oct 16, 2021
a8866e0
fix: add options for "toast" property in Nuxt Config (#263)
rchl Oct 16, 2021
11eed27
Minor updates to master (already in next) (#281)
Maronato Oct 16, 2021
51f06fc
v1.7.12
Maronato Oct 16, 2021
1ad2724
fix firefox rtl behavior. closes #179 (#286)
Maronato Oct 18, 2021
76c6188
fix Nuxt Composition API (#287)
Maronato Oct 18, 2021
9a39240
close #251 (#288)
Maronato Oct 18, 2021
5fd7629
Revert "close #251 (#288)" (#289)
Maronato Oct 18, 2021
e377708
v1.7.13
Maronato Oct 18, 2021
cd1bbc0
v1.7.14
Maronato Oct 18, 2021
391be52
clean readme
Maronato Oct 18, 2021
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
31 changes: 0 additions & 31 deletions .github/stale.yml

This file was deleted.

69 changes: 69 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master, main, next]
pull_request:
branches: [master, main, next]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Remove demo folder
run: rm -rdf demo

- name: Install Yarn
run: npm install -g yarn

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Install Codecov
run: yarn global add codecov

- name: Lint
run: yarn lint:no-fix

- name: Test
run: yarn test

- name: Upload to Codecov
uses: codecov/[email protected]
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Vue Toastification
[![NPM](https://flat.badgen.net/npm/v/vue-toastification)](https://www.npmjs.com/package/vue-toastification) [![Bundle](https://flat.badgen.net/bundlephobia/minzip/vue-toastification)](https://bundlephobia.com/result?p=vue-toastification@latest)

[![Build Status](https://travis-ci.com/Maronato/vue-toastification.svg?branch=master)](https://travis-ci.com/Maronato/vue-toastification) [![codecov](https://codecov.io/gh/Maronato/vue-toastification/branch/master/graph/badge.svg)](https://codecov.io/gh/Maronato/vue-toastification) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/d10315093b4c45a097ac10d1276015ce)](https://app.codacy.com/manual/Maronato/vue-toastification?utm_source=github.com&utm_medium=referral&utm_content=Maronato/vue-toastification&utm_campaign=Badge_Grade_Dashboard) [![Maintainability](https://api.codeclimate.com/v1/badges/8e2c16345047e8e03b58/maintainability)](https://codeclimate.com/github/Maronato/vue-toastification/maintainability)
**Are you using Vue 3?** Check out [Vue Toastification v2](https://github.com/Maronato/vue-toastification/tree/next)!

[![NPM](https://flat.badgen.net/npm/v/vue-toastification)](https://www.npmjs.com/package/vue-toastification) [![Bundle](https://flat.badgen.net/bundlephobia/minzip/vue-toastification)](https://bundlephobia.com/result?p=vue-toastification@latest) [![Vue 2](https://img.shields.io/badge/Vue-2-green)](https://img.shields.io/badge/Vue-2-green)

[![dependencies Status](https://david-dm.org/maronato/vue-toastification/status.svg)](https://david-dm.org/maronato/vue-toastification) [![devDependencies Status](https://david-dm.org/maronato/vue-toastification/dev-status.svg)](https://david-dm.org/maronato/vue-toastification?type=dev)
[![Build Status](https://travis-ci.com/Maronato/vue-toastification.svg?branch=master)](https://travis-ci.com/Maronato/vue-toastification) [![codecov](https://codecov.io/gh/Maronato/vue-toastification/branch/master/graph/badge.svg)](https://codecov.io/gh/Maronato/vue-toastification)

![vt](https://i.imgur.com/i2PMcTq.gif)

Expand All @@ -13,6 +13,10 @@ Light, easy and beautiful toasts!

Wanna try it out? Check out the [live demo](https://maronato.github.io/vue-toastification/)!

**Attention!** These are the docs for Vue Toastification v1, which is **only** compatible with Vue 2+

If you are using Vue 3, check out [Vue Toastification v2](https://github.com/Maronato/vue-toastification/tree/next)


- [Vue Toastification](#vue-toastification)
- [Features](#features)
Expand All @@ -21,6 +25,7 @@ Wanna try it out? Check out the [live demo](https://maronato.github.io/vue-toast
- [Usage](#usage)
- [Plugin registration](#plugin-registration)
- [Nuxt registration](#nuxt-registration)
- [Nuxt and Composition API](#nuxt-and-composition-api)
- [Injecting the Toast CSS](#injecting-the-toast-css)
- [Composition API registration](#composition-api-registration)
- [Generic registration](#generic-registration)
Expand Down Expand Up @@ -108,6 +113,7 @@ $ yarn add vue-toastification
$ npm install --save vue-toastification
```

> **Using Vue 3?** You should install [Vue Toastification v2](https://github.com/Maronato/vue-toastification/tree/next) instead.


## Usage
Expand Down Expand Up @@ -199,6 +205,22 @@ If you are using Typescript with Nuxt, you may need to add `"vue-toastification/
}
```

#### Nuxt and Composition API
Since Vue Toastification is auto installed with nuxt, we need not provide it a second time.

To access your `$toast` instance from within `setup()`, import from `vue-toastification/composition/nuxt` like so:
```ts
// MyComponent.vue

// Import from vue-toastification/composition/nuxt, not vue-toastification/composition
import { useToast } from "vue-toastification/composition/nuxt";

// Then, in the setup method
setup() {
const toast = useToast()
// Use it like you would use this.$toast
}
```

#### Injecting the Toast CSS
By default, when you register the module within Nuxt it automatically injects the CSS required to display the toasts using the default `vue-toastification/dist/index.css` file.
Expand All @@ -225,6 +247,8 @@ export default {

If your CSS file is actually an SCSS or SASS file, just make sure that you have the correct loaders installed. See [Nuxt docs](https://nuxtjs.org/api/configuration-css) on that.

If you set `cssFile: false` it's important to notice that `timeout` won't work. See [#107.](https://github.com/Maronato/vue-toastification/issues/107)

### Composition API registration
Vue Toastification comes with built-in support for the [Composition API](https://github.com/vuejs/composition-api). It is fully optional and won't interfere with your usage if you do not use composition.

Expand Down Expand Up @@ -390,6 +414,8 @@ this.$toast("Persistent toast", { timeout: false })
Vue.use(Toast, { timeout: 2000 });
```

It's important to notice that `timeout` won't work if you set `cssFile: false`. See [#107.](https://github.com/Maronato/vue-toastification/issues/107)

### Using a custom component
Passing strings as the toast content is not enough? You can render anything inside the toast using custom components! Vue Toastification accepts both Vue Components and JSX templates as parameters.

Expand Down
14 changes: 7 additions & 7 deletions composition/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import _Vue from "vue";
import { VueConstructor } from "vue/types/vue";
import { PluginOptions } from "vue-toastification/dist/types/src/types";
import ToastInterface from "vue-toastification/dist/types/src/ts/interface";
import _Vue from "vue"
import type { VueConstructor } from "vue/types/vue"
import type { PluginOptions } from "../src/types"
import type ToastInterface from "../src/ts/interface"

declare let provideToast: (options?: PluginOptions) => void;
declare let provideToast: (options?: PluginOptions) => void
declare let useToast: (
eventBus?: InstanceType<VueConstructor>
) => ReturnType<typeof ToastInterface>;
) => ReturnType<typeof ToastInterface>

export { provideToast, useToast };
export { provideToast, useToast }
5 changes: 5 additions & 0 deletions composition/nuxt/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type ToastInterface from "../../src/ts/interface";

declare let useToast: () => ReturnType<typeof ToastInterface>;

export { useToast };
5 changes: 5 additions & 0 deletions composition/nuxt/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const { useContext } = require("@nuxtjs/composition-api"); // eslint-disable-line @typescript-eslint/no-var-requires

export const useToast = () => useContext().app.$toast;

module.exports = { useToast };
4 changes: 3 additions & 1 deletion nuxt/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
declare const toastModule: import("@nuxt/types").Module<import("../src/types/index").NuxtModuleOptions>;
declare const toastModule: import("@nuxt/types").Module<
import("../src/types/index").NuxtModuleOptions
>;
export = toastModule;
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-toastification",
"version": "1.7.7",
"version": "1.7.14",
"private": false,
"description": "Toasts for Vue made easy!",
"author": "Gustavo Maronato",
Expand Down Expand Up @@ -56,19 +56,21 @@
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "^6.1.2",
"fibers": "^5.0.0",
"husky": "^4.3.0",
"jest-serializer-vue": "^2.0.2",
"lint-staged": "10.3.0",
"nuxt": "^2.12.2",
"plausible-tracker": "^0.3.1",
"prettier": "^2.0.5",
"prismjs": "^1.20.0",
"rollup": "^2.11.2",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-filesize": "^9.0.0",
"rollup-plugin-sass": "^1.2.2",
"rollup-plugin-sass": "^1.2.9",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.27.1",
"rollup-plugin-vue": "<6.0.0",
"sass": "^1.26.5",
"sass": "^1.43.2",
"sass-loader": "^10.0.2",
"typescript": "^4.0.2",
"vue": "^2.6.11",
Expand Down
Loading