From f57965f0b853def8ded1924a713d3a9ca7789c9d Mon Sep 17 00:00:00 2001 From: Gustavo Maronato Date: Sat, 19 Sep 2020 21:01:57 -0300 Subject: [PATCH 01/26] touchstart should be passive (#133) --- package.json | 1 + src/components/VtToast.vue | 4 +++- yarn.lock | 45 +++++++++++++++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5cf4719..b98d132 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "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", diff --git a/src/components/VtToast.vue b/src/components/VtToast.vue index 8c0a314..5b1894e 100644 --- a/src/components/VtToast.vue +++ b/src/components/VtToast.vue @@ -206,7 +206,9 @@ export default Vue.extend({ draggableSetup() { const element = this.$el as HTMLElement; - element.addEventListener("touchstart", this.onDragStart); + element.addEventListener("touchstart", this.onDragStart, { + passive: true, + }); element.addEventListener("mousedown", this.onDragStart); addEventListener("touchmove", this.onDragMove, { passive: false }); addEventListener("mousemove", this.onDragMove); diff --git a/yarn.lock b/yarn.lock index 721c60e..adf32a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4041,6 +4041,11 @@ commondir@^1.0.1: resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= +compare-versions@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62" + integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA== + component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" @@ -5878,6 +5883,13 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-versions@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-3.2.0.tgz#10297f98030a786829681690545ef659ed1d254e" + integrity sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww== + dependencies: + semver-regex "^2.0.0" + flat-cache@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" @@ -6743,6 +6755,22 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" +husky@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.0.tgz#0b2ec1d66424e9219d359e26a51c58ec5278f0de" + integrity sha512-tTMeLCLqSBqnflBZnlVDhpaIMucSGaYyX6855jM4AguGeWCeSzNdb1mfyWduTZ3pe3SJVvVWGL0jO1iKZVPfTA== + dependencies: + chalk "^4.0.0" + ci-info "^2.0.0" + compare-versions "^3.6.0" + cosmiconfig "^7.0.0" + find-versions "^3.2.0" + opencollective-postinstall "^2.0.2" + pkg-dir "^4.2.0" + please-upgrade-node "^3.2.0" + slash "^3.0.0" + which-pm-runs "^1.0.0" + iconv-lite@0.4.24, iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -9345,6 +9373,11 @@ open@^6.3.0: dependencies: is-wsl "^1.1.0" +opencollective-postinstall@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259" + integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q== + opener@1.5.2, opener@^1.5.1: version "1.5.2" resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" @@ -9804,7 +9837,7 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" -pkg-dir@^4.1.0: +pkg-dir@^4.1.0, pkg-dir@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== @@ -11565,6 +11598,11 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= +semver-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-2.0.0.tgz#a93c2c5844539a770233379107b38c7b4ac9d338" + integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw== + "semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -13512,6 +13550,11 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= +which-pm-runs@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" + integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= + which-typed-array@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.2.tgz#e5f98e56bda93e3dac196b01d47c1156679c00b2" From c2ba3dd17841e80334fe9ad0b727881112cb1319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Maest=C3=A1?= Date: Sat, 19 Sep 2020 21:21:02 -0300 Subject: [PATCH 02/26] Notice that `timeout` doesn't work with `cssFile: false` (#108) Co-authored-by: Gustavo Maronato --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 8962e46..c3dcb11 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,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. @@ -390,6 +392,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. From c71b17271206b5108dc7ba3e39dc9515153ca427 Mon Sep 17 00:00:00 2001 From: Maronato Date: Sat, 19 Sep 2020 21:22:15 -0300 Subject: [PATCH 03/26] v1.7.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b98d132..a5f4396 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-toastification", - "version": "1.7.7", + "version": "1.7.8", "private": false, "description": "Toasts for Vue made easy!", "author": "Gustavo Maronato", From 89b36f45bf580944c97db36e6be6b3c9bc48afde Mon Sep 17 00:00:00 2001 From: Maronato Date: Sat, 19 Sep 2020 21:31:41 -0300 Subject: [PATCH 04/26] updated readme --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c3dcb11..225cbfe 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ -# 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) +# Vue Toastification (for Vue 2) + +**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) [![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) @@ -14,7 +17,7 @@ Light, easy and beautiful toasts! Wanna try it out? Check out the [live demo](https://maronato.github.io/vue-toastification/)! -- [Vue Toastification](#vue-toastification) +- [Vue Toastification (for Vue 2)](#vue-toastification-for-vue-2) - [Features](#features) - [Demo](#demo) - [Installation](#installation) @@ -108,6 +111,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 From 0f6f453b55498d6ab0bbfcc374286af856b93ae8 Mon Sep 17 00:00:00 2001 From: Gustavo Maronato Date: Mon, 21 Sep 2020 18:40:24 -0300 Subject: [PATCH 05/26] Update README.md Added analytics tracking pixel to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 225cbfe..1f510d1 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ [![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) +![track](https://shrt.maronato.dev/z9Jg8/track) ![vt](https://i.imgur.com/i2PMcTq.gif) From 2fc5431d5dec174ee364515a825792f26e27dfa3 Mon Sep 17 00:00:00 2001 From: Gustavo Maronato Date: Fri, 30 Oct 2020 15:56:30 -0300 Subject: [PATCH 06/26] Change analytics provider and enable EthicalAds on demo page (#143) * added plausible analytics * remove google analytics * added ethical ads * added more tags * style fixes --- package.json | 1 + public/App.vue | 27 +++++++++++++++++++++------ public/index.html | 14 ++++---------- public/index.js | 5 ++++- public/plausible.js | 6 ++++++ yarn.lock | 5 +++++ 6 files changed, 41 insertions(+), 17 deletions(-) create mode 100644 public/plausible.js diff --git a/package.json b/package.json index a5f4396..61ead6d 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "jest-serializer-vue": "^2.0.2", "lint-staged": "10.3.0", "nuxt": "^2.12.2", + "plausible-tracker": "^0.2.2", "prettier": "^2.0.5", "prismjs": "^1.20.0", "rollup": "^2.11.2", diff --git a/public/App.vue b/public/App.vue index 90c2be3..6ac9568 100644 --- a/public/App.vue +++ b/public/App.vue @@ -231,23 +231,23 @@ - +

Preview the code

- + {{ pluginCode }} - + {{ toastCode }} @@ -261,6 +261,19 @@ >Show toast! + +
+ @@ -270,12 +283,13 @@ - - @@ -19,6 +9,7 @@ integrity="sha256-77qGXu2p8NpfcBpTjw4jsMeQnz0vyh74f5do0cWjQ/Q=" crossorigin="anonymous" /> + Vue-Toastification @@ -33,6 +24,9 @@ integrity="sha256-HWJnMZHGx7U1jmNfxe4yaQedmpo/mtxWSIXvcJkLIf4=" crossorigin="anonymous"> + + + diff --git a/public/index.js b/public/index.js index 18c1a8d..bb4d210 100644 --- a/public/index.js +++ b/public/index.js @@ -1,4 +1,5 @@ import Vue from "vue"; +import { enableAutoPageviews } from "./plausible"; import vuetify from "./vuetify"; import App from "./App.vue"; import Toast from "../src/index"; @@ -7,7 +8,9 @@ Vue.config.productionTip = false; Vue.use(Toast); +enableAutoPageviews(); + new Vue({ vuetify, - render: h => h(App) + render: (h) => h(App), }).$mount("#app"); diff --git a/public/plausible.js b/public/plausible.js new file mode 100644 index 0000000..88bc4d5 --- /dev/null +++ b/public/plausible.js @@ -0,0 +1,6 @@ +import Plausible from "plausible-tracker"; + +export const { enableAutoPageviews, trackEvent } = Plausible({ + domain: "maronato.github.io/vue-toastification", + apiHost: "https://plausible.maronato.dev", +}); diff --git a/yarn.lock b/yarn.lock index adf32a4..edb4c27 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9851,6 +9851,11 @@ pkg-up@^3.1.0: dependencies: find-up "^3.0.0" +plausible-tracker@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/plausible-tracker/-/plausible-tracker-0.2.2.tgz#bdbbad038816bac5b14b5b2216a48c5ddec59598" + integrity sha512-DxTszs9U2GAGg799TXL/w4uRRSoxcBt9v08zQgQVrs1SYlR0c+fPFXKuN1lv6RPTSIiQ7/UbXteR4GWz/bcLRA== + please-upgrade-node@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" From 2936f3de0a47cd5cc01832830c5fb21391fad04c Mon Sep 17 00:00:00 2001 From: Maronato Date: Fri, 30 Oct 2020 17:57:05 -0300 Subject: [PATCH 07/26] more ad placements --- public/App.vue | 209 +++++++++++++++++++++---------- public/components/EthicalAds.vue | 23 ++++ 2 files changed, 168 insertions(+), 64 deletions(-) create mode 100644 public/components/EthicalAds.vue diff --git a/public/App.vue b/public/App.vue index 6ac9568..8ebf9b7 100644 --- a/public/App.vue +++ b/public/App.vue @@ -1,5 +1,12 @@ diff --git a/public/index.js b/public/index.js index bb4d210..5620c4f 100644 --- a/public/index.js +++ b/public/index.js @@ -1,5 +1,5 @@ import Vue from "vue"; -import { enableAutoPageviews } from "./plausible"; +import { enableAutoPageviews, enableAutoOutboundTracking } from "./plausible"; import vuetify from "./vuetify"; import App from "./App.vue"; import Toast from "../src/index"; @@ -9,6 +9,7 @@ Vue.config.productionTip = false; Vue.use(Toast); enableAutoPageviews(); +enableAutoOutboundTracking(); new Vue({ vuetify, diff --git a/public/plausible.js b/public/plausible.js index 88bc4d5..01850f9 100644 --- a/public/plausible.js +++ b/public/plausible.js @@ -1,6 +1,10 @@ import Plausible from "plausible-tracker"; -export const { enableAutoPageviews, trackEvent } = Plausible({ +export const { + enableAutoPageviews, + trackEvent, + enableAutoOutboundTracking, +} = Plausible({ domain: "maronato.github.io/vue-toastification", apiHost: "https://plausible.maronato.dev", }); diff --git a/yarn.lock b/yarn.lock index edb4c27..9d11a17 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9851,10 +9851,10 @@ pkg-up@^3.1.0: dependencies: find-up "^3.0.0" -plausible-tracker@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/plausible-tracker/-/plausible-tracker-0.2.2.tgz#bdbbad038816bac5b14b5b2216a48c5ddec59598" - integrity sha512-DxTszs9U2GAGg799TXL/w4uRRSoxcBt9v08zQgQVrs1SYlR0c+fPFXKuN1lv6RPTSIiQ7/UbXteR4GWz/bcLRA== +plausible-tracker@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/plausible-tracker/-/plausible-tracker-0.3.1.tgz#dd4e1f59cafc7bf1b00e30890567287b3f204efd" + integrity sha512-oXnVyfTF2gzkfK3iOZCRZEnf8sH4gBASaJhY+clwWW1orIybfQpfbgg4U5Bwj5dW/4iNstM4tx4jMCVUfMCUbg== please-upgrade-node@^3.2.0: version "3.2.0" From 84ee7ddc23d9e2844ff7ff93b228cdd5dfcb569d Mon Sep 17 00:00:00 2001 From: Maronato Date: Mon, 9 Nov 2020 23:48:32 -0300 Subject: [PATCH 10/26] More show toast analytics --- public/App.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/App.vue b/public/App.vue index c095c0c..bb253be 100644 --- a/public/App.vue +++ b/public/App.vue @@ -840,7 +840,15 @@ Vue.use(Toast, { if (options.timeout === 0) { options.timeout = false; } - trackEvent("show toast"); + trackEvent("Show Toast", { + props: { + position: this.position, + type: this.type, + RTL: this.rtl ? "Yes" : "No", + transition: this.pluginOptions.transition, + content: this.contentType, + }, + }); this.$toast(content, { position: this.position, type: this.type, From f024d81b0a6fde36bcbd77190b6e19e3e41e7e6c Mon Sep 17 00:00:00 2001 From: Maronato Date: Sun, 27 Dec 2020 03:43:41 -0300 Subject: [PATCH 11/26] use proper z-index on ad containers --- public/components/EthicalAds.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/components/EthicalAds.vue b/public/components/EthicalAds.vue index f787059..8eb1248 100644 --- a/public/components/EthicalAds.vue +++ b/public/components/EthicalAds.vue @@ -2,6 +2,7 @@
+ From cc1420e64e4c73c5d29fe3558d7d403aa633b255 Mon Sep 17 00:00:00 2001 From: Maronato Date: Wed, 13 Jan 2021 15:05:10 -0500 Subject: [PATCH 12/26] fix: remove DOM-only object references (resolves #155) --- src/ts/propValidators.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/propValidators.ts b/src/ts/propValidators.ts index 2492da1..2778f0f 100644 --- a/src/ts/propValidators.ts +++ b/src/ts/propValidators.ts @@ -121,7 +121,7 @@ export type PluginOptionsType = Required< >; const CONTAINER: RecordPropsDefinition = { container: { - type: [HTMLElement, Function], + type: [(Object as unknown) as HTMLElement, Function], default: () => document.body, } as PropOptions>, newestOnTop: COMMON.trueBoolean, From 39c9871f2f96160f7fe5e5c4aeae4ab6ad48a891 Mon Sep 17 00:00:00 2001 From: Maronato Date: Wed, 13 Jan 2021 15:11:38 -0500 Subject: [PATCH 13/26] v1.7.10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9bb2bcd..69195c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-toastification", - "version": "1.7.8", + "version": "1.7.10", "private": false, "description": "Toasts for Vue made easy!", "author": "Gustavo Maronato", From 838dc4212063858b53bf53144188838e7a4c120a Mon Sep 17 00:00:00 2001 From: Maronato Date: Mon, 18 Jan 2021 14:52:04 -0500 Subject: [PATCH 14/26] fix: disable runtime container prop validation --- src/ts/propValidators.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/propValidators.ts b/src/ts/propValidators.ts index 2778f0f..226a54b 100644 --- a/src/ts/propValidators.ts +++ b/src/ts/propValidators.ts @@ -121,7 +121,7 @@ export type PluginOptionsType = Required< >; const CONTAINER: RecordPropsDefinition = { container: { - type: [(Object as unknown) as HTMLElement, Function], + type: undefined, default: () => document.body, } as PropOptions>, newestOnTop: COMMON.trueBoolean, From 405499bfd219eebf2b8c454e9dbabd2522c4c6b7 Mon Sep 17 00:00:00 2001 From: Maronato Date: Mon, 18 Jan 2021 14:56:40 -0500 Subject: [PATCH 15/26] v1.7.11 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 69195c8..48b8371 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-toastification", - "version": "1.7.10", + "version": "1.7.11", "private": false, "description": "Toasts for Vue made easy!", "author": "Gustavo Maronato", From 193c4b7790034800328cb35fcf2912215612bd13 Mon Sep 17 00:00:00 2001 From: Meir Roth <12494197+meirroth@users.noreply.github.com> Date: Sat, 16 Oct 2021 03:09:04 +0000 Subject: [PATCH 16/26] Fix: Sass Slash as Division #243 (#264) --- src/scss/_toastContainer.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scss/_toastContainer.scss b/src/scss/_toastContainer.scss index 724c161..9f8281d 100644 --- a/src/scss/_toastContainer.scss +++ b/src/scss/_toastContainer.scss @@ -1,3 +1,4 @@ +@use 'sass:math'; .#{$vt-namespace}__container { z-index: $vt-z-index; position: fixed; @@ -51,7 +52,7 @@ &.top-center, &.bottom-center { left: 50%; - margin-left: -($vt-toast-max-width / 2); + margin-left: -(math.div($vt-toast-max-width, 2)); .#{$vt-namespace}__toast { margin-left: auto; margin-right: auto; From a8866e0f91e46c8c6253028823be29b7123aa97d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ch=C5=82odnicki?= Date: Sat, 16 Oct 2021 06:24:40 +0200 Subject: [PATCH 17/26] fix: add options for "toast" property in Nuxt Config (#263) Fixes #262 --- src/types/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/types/index.ts b/src/types/index.ts index 57d5ce6..1e27d73 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -260,6 +260,10 @@ declare module "@nuxt/types" { interface NuxtAppOptions { $toast: ReturnType; } + + interface NuxtOptions { + toast?: NuxtModuleOptions; + } } declare module "vuex/types/index" { From 11eed27b19fde8cc815f0d45a2e75dbb86622a91 Mon Sep 17 00:00:00 2001 From: Gustavo Maronato Date: Sat, 16 Oct 2021 01:44:52 -0300 Subject: [PATCH 18/26] Minor updates to master (already in next) (#281) * update sass version * remove stalebot config * add github actions * remove duplicated animation * remove travis config --- .github/stale.yml | 31 --------- .github/workflows/test.yml | 69 ++++++++++++++++++++ .travis.yml | 26 -------- package.json | 4 +- src/scss/animations/_bounce.scss | 15 ----- yarn.lock | 108 +++++++++++++++++-------------- 6 files changed, 132 insertions(+), 121 deletions(-) delete mode 100644 .github/stale.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 14bb814..0000000 --- a/.github/stale.yml +++ /dev/null @@ -1,31 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 30 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 5 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - security -# Label to use when marking an issue as stale -staleLabel: stale -# Comment to post when marking an issue as stale. Set to `false` to disable -issues: - # Comment to post when marking Issues as stale. - markComment: > - This issue has been automatically marked as stale because it has not had any - recent activity. It will be closed in 5 days if no further activity occurs. - # Comment to post when closing a stale Issue. - closeComment: > - This issue has been automatically closed because it has not had any recent - activity. If you have a question or comment, please open a new issue. -pulls: - # Comment to post when marking Pull Request as stale. - markComment: > - This pull request has been automatically marked as stale because it has not - had any recent activity. It will be closed in 5 days if no further activity - occurs. - # Comment to post when closing a stale Pull Request. - closeComment: > - This pull request has been automatically closed because it has not had any - recent activity. If you have a question or comment, please open a new - issue. Thank you for your contribution! diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b9d36a4 --- /dev/null +++ b/.github/workflows/test.yml @@ -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/codecov-action@v2.1.0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e778cf5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: node_js -node_js: - - "12" - - "10" - -cache: - directories: - - node_modules - -script: - - yarn global add codecov - - yarn lint:no-fix - - yarn test - - yarn build:demo - -deploy: - provider: pages - local_dir: demo - skip_cleanup: true - github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable - keep_history: true - on: - branch: master - -after_success: - - codecov \ No newline at end of file diff --git a/package.json b/package.json index 48b8371..0eb4a5b 100644 --- a/package.json +++ b/package.json @@ -66,11 +66,11 @@ "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", diff --git a/src/scss/animations/_bounce.scss b/src/scss/animations/_bounce.scss index 6b18891..019da74 100644 --- a/src/scss/animations/_bounce.scss +++ b/src/scss/animations/_bounce.scss @@ -164,21 +164,6 @@ $trans-cubic-bezier: cubic-bezier(0.215, 0.61, 0.355, 1); } } -@keyframes bounceOutDown { - 20% { - transform: translate3d(0, 10px, 0); - } - 40%, - 45% { - opacity: 1; - transform: translate3d(0, -20px, 0); - } - to { - opacity: 0; - transform: translate3d(0, 2000px, 0); - } -} - .#{$vt-namespace}__bounce-enter-active { &.top-left, &.bottom-left { diff --git a/yarn.lock b/yarn.lock index 9d11a17..ac697ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2778,6 +2778,14 @@ anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" +anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + aproba@^1.0.3, aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -3094,7 +3102,7 @@ babel-preset-jest@^24.9.0: "@babel/plugin-syntax-object-rest-spread" "^7.0.0" babel-plugin-jest-hoist "^24.9.0" -babel-runtime@^6.22.0, babel-runtime@^6.23.0, babel-runtime@^6.26.0: +babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= @@ -3747,7 +3755,22 @@ check-types@^8.0.3: optionalDependencies: fsevents "~2.1.2" -chokidar@^2.0.0, chokidar@^2.1.8: +"chokidar@>=3.0.0 <4.0.0": + version "3.5.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +chokidar@^2.1.8: version "2.1.8" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== @@ -6016,17 +6039,6 @@ fs-extra@8.1.0, fs-extra@^8.1.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - path-is-absolute "^1.0.0" - rimraf "^2.2.8" - fs-extra@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" @@ -6098,6 +6110,11 @@ fsevents@~2.1.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -6222,6 +6239,13 @@ glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0: dependencies: is-glob "^4.0.1" +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + glob-to-regexp@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" @@ -6312,7 +6336,7 @@ good-listener@^1.2.2: dependencies: delegate "^3.1.2" -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.2: +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2: version "4.2.4" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== @@ -8007,13 +8031,6 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -jsonfile@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= - optionalDependencies: - graceful-fs "^4.1.6" - jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -8082,13 +8099,6 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== -klaw@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= - optionalDependencies: - graceful-fs "^4.1.9" - kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" @@ -11074,6 +11084,13 @@ readdirp@~3.4.0: dependencies: picomatch "^2.2.1" +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + realpath-native@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" @@ -11342,7 +11359,7 @@ rimraf@2.6.3: dependencies: glob "^7.1.3" -rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@^2.7.1: +rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@^2.7.1: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -11389,17 +11406,14 @@ rollup-plugin-filesize@^9.0.0: pacote "^11.1.10" terser "^4.8.0" -rollup-plugin-sass@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/rollup-plugin-sass/-/rollup-plugin-sass-1.2.2.tgz#f03cd2b1bee497dc2cc845fae2c5749611fc008f" - integrity sha512-yvHQPg1JS4d23gwHTwTbokH+FV/0bPBVf5QmlvCOzfAhXe0luY0pUgVaWC2qfnoKetp2Oqh5lK7oW/4CXGWs1Q== +rollup-plugin-sass@^1.2.9: + version "1.2.9" + resolved "https://registry.yarnpkg.com/rollup-plugin-sass/-/rollup-plugin-sass-1.2.9.tgz#0c2609d0f813d68b79d9f3ccda2b96d4f0dc1f39" + integrity sha512-ShI0T6tQxvM0B/njgZ35/1RuiNZTo9LtrUYFRupNokmXbresGb6RvYnkQvWbq4a5UBIp57VJ+cjPcsJKthXV8Q== dependencies: - babel-runtime "^6.23.0" - fs-extra "^0.30.0" - pify "^3.0.0" + "@rollup/pluginutils" "^3.1.0" resolve "^1.5.0" - rollup-pluginutils ">= 1.3.1" - sass "1.7.2" + sass "^1.7.2" rollup-plugin-terser@^7.0.2: version "7.0.2" @@ -11437,7 +11451,7 @@ rollup-plugin-vue@<6.0.0: source-map "0.7.3" vue-runtime-helpers "^1.1.2" -"rollup-pluginutils@>= 1.3.1", rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2: +rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2: version "2.8.2" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== @@ -11528,20 +11542,20 @@ sass-loader@^10.0.2: schema-utils "^2.7.1" semver "^7.3.2" -sass@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.7.2.tgz#a8ff878ad9dcba65e226c1ccb2c2f3c7a1009578" - integrity sha512-zUm2NXL77WtQDbp4MKgysAxH41Fzs5BnBUogEPi8IKNQ1M5rKoFe46YBXfxr0I+cQX+xbSc//psSdq5eyYhJsg== - dependencies: - chokidar "^2.0.0" - -sass@^1.18.0, sass@^1.26.5: +sass@^1.18.0: version "1.26.10" resolved "https://registry.yarnpkg.com/sass/-/sass-1.26.10.tgz#851d126021cdc93decbf201d1eca2a20ee434760" integrity sha512-bzN0uvmzfsTvjz0qwccN1sPm2HxxpNI/Xa+7PlUEMS+nQvbyuEK7Y0qFqxlPHhiNHb1Ze8WQJtU31olMObkAMw== dependencies: chokidar ">=2.0.0 <4.0.0" +sass@^1.43.2, sass@^1.7.2: + version "1.43.2" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.43.2.tgz#c02501520c624ad6622529a8b3724eb08da82d65" + integrity sha512-DncYhjl3wBaPMMJR0kIUaH3sF536rVrOcqqVGmTZHQRRzj7LQlyGV7Mb8aCKFyILMr5VsPHwRYtyKpnKYlmQSQ== + dependencies: + chokidar ">=3.0.0 <4.0.0" + sax@^1.2.4, sax@~1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" From 51f06fcb19dd5653684559df831834b642d47c91 Mon Sep 17 00:00:00 2001 From: Gustavo Maronato Date: Sat, 16 Oct 2021 01:49:56 -0300 Subject: [PATCH 19/26] v1.7.12 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0eb4a5b..f1ad664 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-toastification", - "version": "1.7.11", + "version": "1.7.12", "private": false, "description": "Toasts for Vue made easy!", "author": "Gustavo Maronato", From 1ad2724c5e7d114c6ea99643d0feb72984b5b189 Mon Sep 17 00:00:00 2001 From: Gustavo Maronato Date: Sun, 17 Oct 2021 23:14:34 -0300 Subject: [PATCH 20/26] fix firefox rtl behavior. closes #179 (#286) --- src/scss/_toastContainer.scss | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/scss/_toastContainer.scss b/src/scss/_toastContainer.scss index 9f8281d..2cd8eb8 100644 --- a/src/scss/_toastContainer.scss +++ b/src/scss/_toastContainer.scss @@ -31,9 +31,13 @@ .#{$vt-namespace}__toast { margin-right: auto; } - .#{$vt-namespace}__toast--rtl { - margin-right: unset; - margin-left: auto; + // Firefox does not apply rtl rules to containers and margins, it appears. + // See https://github.com/Maronato/vue-toastification/issues/179 + @supports not (-moz-appearance:none) { + .#{$vt-namespace}__toast--rtl { + margin-right: unset; + margin-left: auto; + } } } @@ -43,9 +47,13 @@ .#{$vt-namespace}__toast { margin-left: auto; } - .#{$vt-namespace}__toast--rtl { - margin-left: unset; - margin-right: auto; + // Firefox does not apply rtl rules to containers and margins, it appears. + // See https://github.com/Maronato/vue-toastification/issues/179 + @supports not (-moz-appearance:none) { + .#{$vt-namespace}__toast--rtl { + margin-left: unset; + margin-right: auto; + } } } From 76c6188260dfc5b743e206926c48df792536c2e9 Mon Sep 17 00:00:00 2001 From: Gustavo Maronato Date: Mon, 18 Oct 2021 01:57:34 -0300 Subject: [PATCH 21/26] fix Nuxt Composition API (#287) --- README.md | 17 +++++++++++++++++ composition/index.d.ts | 14 +++++++------- composition/nuxt/index.d.ts | 5 +++++ composition/nuxt/index.js | 5 +++++ nuxt/index.d.ts | 4 +++- 5 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 composition/nuxt/index.d.ts create mode 100644 composition/nuxt/index.js diff --git a/README.md b/README.md index 1f510d1..0322e59 100644 --- a/README.md +++ b/README.md @@ -25,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) @@ -204,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. diff --git a/composition/index.d.ts b/composition/index.d.ts index 901c399..6d19487 100644 --- a/composition/index.d.ts +++ b/composition/index.d.ts @@ -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 -) => ReturnType; +) => ReturnType -export { provideToast, useToast }; +export { provideToast, useToast } diff --git a/composition/nuxt/index.d.ts b/composition/nuxt/index.d.ts new file mode 100644 index 0000000..648ac09 --- /dev/null +++ b/composition/nuxt/index.d.ts @@ -0,0 +1,5 @@ +import type ToastInterface from "../../src/ts/interface"; + +declare let useToast: () => ReturnType; + +export { useToast }; diff --git a/composition/nuxt/index.js b/composition/nuxt/index.js new file mode 100644 index 0000000..8b04bea --- /dev/null +++ b/composition/nuxt/index.js @@ -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 }; diff --git a/nuxt/index.d.ts b/nuxt/index.d.ts index 8b9d222..c65daa6 100644 --- a/nuxt/index.d.ts +++ b/nuxt/index.d.ts @@ -1,2 +1,4 @@ -declare const toastModule: import("@nuxt/types").Module; +declare const toastModule: import("@nuxt/types").Module< + import("../src/types/index").NuxtModuleOptions +>; export = toastModule; From 9a39240922aeec16c6294b0224fd19f3346f1cb4 Mon Sep 17 00:00:00 2001 From: Gustavo Maronato Date: Mon, 18 Oct 2021 02:20:16 -0300 Subject: [PATCH 22/26] close #251 (#288) --- public/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/App.vue b/public/App.vue index bb253be..4788b63 100644 --- a/public/App.vue +++ b/public/App.vue @@ -714,7 +714,7 @@ export default { draggable: ${this.options.draggable}, draggablePercent: ${this.options.draggablePercent / 100}, showCloseButtonOnHover: ${this.options.showCloseButtonOnHover}, - hideProgressBar: ${!this.options.hideProgressBar}, + hideProgressBar: ${this.options.hideProgressBar}, closeButton: ${ this.options.closeButton ? `"${this.options.closeButton}"` : "false" }, From 5fd7629199c0d34f7eb487bdd33a00d4a966a931 Mon Sep 17 00:00:00 2001 From: Gustavo Maronato Date: Mon, 18 Oct 2021 02:25:35 -0300 Subject: [PATCH 23/26] Revert "close #251 (#288)" (#289) This reverts commit 9a39240922aeec16c6294b0224fd19f3346f1cb4. --- public/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/App.vue b/public/App.vue index 4788b63..bb253be 100644 --- a/public/App.vue +++ b/public/App.vue @@ -714,7 +714,7 @@ export default { draggable: ${this.options.draggable}, draggablePercent: ${this.options.draggablePercent / 100}, showCloseButtonOnHover: ${this.options.showCloseButtonOnHover}, - hideProgressBar: ${this.options.hideProgressBar}, + hideProgressBar: ${!this.options.hideProgressBar}, closeButton: ${ this.options.closeButton ? `"${this.options.closeButton}"` : "false" }, From e3777089ab5800e4ae70a2acde1076a6984f8ddc Mon Sep 17 00:00:00 2001 From: Gustavo Maronato Date: Mon, 18 Oct 2021 17:59:02 -0300 Subject: [PATCH 24/26] v1.7.13 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f1ad664..56f30e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-toastification", - "version": "1.7.12", + "version": "1.7.13", "private": false, "description": "Toasts for Vue made easy!", "author": "Gustavo Maronato", From cd1bbc067e327799052641465926bfb6a5124a5c Mon Sep 17 00:00:00 2001 From: Gustavo Maronato Date: Mon, 18 Oct 2021 18:13:47 -0300 Subject: [PATCH 25/26] v1.7.14 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 56f30e4..3728ce1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-toastification", - "version": "1.7.13", + "version": "1.7.14", "private": false, "description": "Toasts for Vue made easy!", "author": "Gustavo Maronato", From 391be528639bb45bfe778fbbe07b6f961333ada3 Mon Sep 17 00:00:00 2001 From: Gustavo Maronato Date: Mon, 18 Oct 2021 18:26:43 -0300 Subject: [PATCH 26/26] clean readme --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0322e59..c50e2bd 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,11 @@ -# Vue Toastification (for Vue 2) +# Vue Toastification **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) -[![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) +[![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) - -[![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) - -![track](https://shrt.maronato.dev/z9Jg8/track) ![vt](https://i.imgur.com/i2PMcTq.gif) @@ -17,8 +13,12 @@ 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 (for Vue 2)](#vue-toastification-for-vue-2) +- [Vue Toastification](#vue-toastification) - [Features](#features) - [Demo](#demo) - [Installation](#installation)