Comparing version 1.4.8 to 1.4.12
{ | ||
"name": "toast-me", | ||
"version": "1.4.8", | ||
"version": "1.4.12", | ||
"description": "Creates toast messages", | ||
@@ -9,3 +9,3 @@ "main": "lib/toast-me.min.js", | ||
"run-dev": "node scripts/dev-server", | ||
"watch": "webpack --colors --watch --env dev --config scripts/config/webpack.config.devLib.js", | ||
"watch": "webpack --watch --env dev --config scripts/config/webpack.config.devLib.js", | ||
"test-watch": "node scripts/test.js --env=jsdom --config jest.config.js", | ||
@@ -37,9 +37,11 @@ "test": "node scripts/test.js --env=jsdom --config jest.config.js --coverage --runInBand && flow" | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0-beta.51", | ||
"@babel/core": "^7.0.0-beta.51", | ||
"@babel/preset-env": "^7.0.0-beta.51", | ||
"@babel/preset-flow": "^7.0.0", | ||
"@babel/preset-react": "^7.16.0", | ||
"autoprefixer": "^9.5.1", | ||
"babel-eslint": "^8.0.3", | ||
"@babel/cli": "^7.20.7", | ||
"@babel/core": "^7.20.12", | ||
"@babel/eslint-parser": "^7.19.1", | ||
"@babel/plugin-syntax-flow": "^7.18.6", | ||
"@babel/plugin-transform-react-jsx": "^7.20.7", | ||
"@babel/preset-env": "^7.20.2", | ||
"@babel/preset-flow": "^7.18.6", | ||
"@babel/preset-react": "^7.18.6", | ||
"autoprefixer": "^10.4.13", | ||
"babel-jest": "^24.7.1", | ||
@@ -53,26 +55,28 @@ "babel-loader": "^8.0.0-beta.4", | ||
"cross-env": "^5.2.0", | ||
"css-loader": "^2.1.1", | ||
"cssnano": "^4.1.10", | ||
"eslint": "^5.0.1", | ||
"eslint-loader": "^2.0.0", | ||
"eslint-plugin-flowtype": "^3.6.1", | ||
"flow-bin": "^0.97.0", | ||
"css-loader": "^6.7.3", | ||
"cssnano": "^5.1.14", | ||
"eslint": "^8.31.0", | ||
"eslint-plugin-flowtype": "^8.0.3", | ||
"eslint-webpack-plugin": "^3.2.0", | ||
"flow-bin": "^0.196.0", | ||
"html-loader": "^0.5.5", | ||
"html-webpack-plugin": "^3.2.0", | ||
"html-webpack-plugin": "^5.5.0", | ||
"husky": "^3.0.9", | ||
"identity-obj-proxy": "^3.0.0", | ||
"jest": "^24.7.1", | ||
"jsdom": "11.11.0", | ||
"jsdom": "16.5.0", | ||
"jsdom-global": "3.0.2", | ||
"node-sass": "^4.11.0", | ||
"mini-css-extract-plugin": "^2.7.2", | ||
"nyc": "^13.1.0", | ||
"postcss-flexbugs-fixes": "^4.1.0", | ||
"postcss-loader": "^3.0.0", | ||
"postcss": "^8.4.21", | ||
"postcss-flexbugs-fixes": "^5.0.2", | ||
"postcss-loader": "^7.0.2", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"sass-loader": "^7.1.0", | ||
"style-loader": "^0.23.1", | ||
"webpack": "^4.12.2", | ||
"webpack-cli": "^3.0.8", | ||
"webpack-dev-server": "^3.3.1", | ||
"sass": "^1.57.1", | ||
"sass-loader": "^13.2.0", | ||
"style-loader": "^3.3.1", | ||
"webpack": "^5.75.0", | ||
"webpack-cli": "^5.0.1", | ||
"webpack-dev-server": "^4.11.1", | ||
"yargs": "^10.0.3" | ||
@@ -84,3 +88,2 @@ }, | ||
}, | ||
"dependencies": {}, | ||
"husky": { | ||
@@ -87,0 +90,0 @@ "hooks": { |
@@ -10,7 +10,14 @@ // @flow | ||
function splitClasses(classes: string | undefined): string[] { | ||
if (!classes) { | ||
return []; | ||
} | ||
return classes.split(' '); | ||
} | ||
export function setClass(node: Element, classes: string | Array<string>) { | ||
const arr = Array.isArray(classes) | ||
? arrayFlat(classes.map(el => el && el.split(' '))) | ||
: classes.split(' '); | ||
? arrayFlat(classes.map(splitClasses)) | ||
: splitClasses(classes); | ||
arr.forEach(cls => cls && node.classList.add(cls)); | ||
} |
@@ -5,3 +5,3 @@ // @flow | ||
import styles from './index.scss'; | ||
import styles from './ToastMe.scss'; | ||
@@ -8,0 +8,0 @@ import type { ToastOptionsType } from './types'; |
// @flow | ||
import ToastOptions, { DEFAULT_TIMEOUT_BEFORE_REMOVE, DEFAULT_SHOW_DURATION } from './optionsLib'; | ||
import { setClass } from './helper'; | ||
import styles from './index.scss'; | ||
import styles from './ToastMe.scss'; | ||
@@ -6,0 +6,0 @@ import type { ToastActionType, ToastOptionsType, ContainerOptionsType } from './types'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
249
27310
44
16