@theorem/react
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -0,1 +1,6 @@ | ||
# 1.4.1 | ||
- smartOutline: works with pseudo-elements | ||
- smartOutline: does not crash in non-window env | ||
# 1.4.0 | ||
@@ -2,0 +7,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const lib_1 = require("./lib"); | ||
const globalWindow = typeof window === "undefined" ? undefined : window; | ||
function smartOutline(win) { | ||
const w = win || window; | ||
const w = win || globalWindow; | ||
if (!w) | ||
return; | ||
const doc = w.document; | ||
lib_1.globalCss(w, `body.pointer-interaction * { outline: 0 !important }`); | ||
lib_1.globalCss(w, ` | ||
body.pointer-interaction *, | ||
body.pointer-interaction *::before, | ||
body.pointer-interaction *::after { | ||
outline: 0 !important | ||
} | ||
`); | ||
window.addEventListener("keydown", (e) => { | ||
@@ -9,0 +18,0 @@ const body = doc.querySelector("body"); |
{ | ||
"name": "@theorem/react", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Theorem React tools", | ||
@@ -11,4 +11,4 @@ "peerDependencies": { | ||
"ci": "npm run verify", | ||
"format": "prettier --write '{docs,src,typings}/**/*.{json,md,ts,tsx}'", | ||
"format-verify": "prettier --check '{docs,src,typings}/**/*.{json,md,ts,tsx}'", | ||
"format": "prettier --write '{docs,src,typings}/**/*.{js,json,md,ts,tsx}' '*.{js,json,md,ts,tsx}'", | ||
"format-verify": "prettier --check '{docs,src,typings}/**/*.{js,json,md,ts,tsx}' '*.{js,json,md,ts,tsx}'", | ||
"lint": "eslint --ext js,jsx,ts,tsx src", | ||
@@ -27,11 +27,11 @@ "prepublishOnly": "npm run verify && npm run build", | ||
"devDependencies": { | ||
"@theorem/eslint-plugin": "^2.0.1", | ||
"@types/react": "^16.9.25", | ||
"@theorem/eslint-plugin": "^3.0.0", | ||
"@types/react": "^16.9.32", | ||
"@types/react-test-renderer": "^16.9.2", | ||
"ava": "^3.5.1", | ||
"ava": "^3.6.0", | ||
"eslint": "^6.8.0", | ||
"prettier": "^2.0.0", | ||
"prettier": "^2.0.4", | ||
"react": "^16.13.1", | ||
"react-test-renderer": "^16.13.1", | ||
"ts-node": "^8.8.1", | ||
"ts-node": "^8.8.2", | ||
"typescript": "~3.8.3" | ||
@@ -38,0 +38,0 @@ }, |
Sorry, the diff of this file is not supported yet
49382
704