add-to-calendar-button
Advanced tools
Comparing version 1.7.2 to 1.7.3
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
const atcbVersion = '1.7.2'; | ||
const atcbVersion = '1.7.3'; | ||
/* Creator: Jens Kuerschner (https://jenskuerschner.de) | ||
@@ -706,13 +706,15 @@ * Project: https://github.com/jekuer/add-to-calendar-button | ||
const isBrowser=new Function("try {return this===window;}catch(e){ return false;}"); | ||
if (isBrowser()) { | ||
// Global listener to ESC key to close dropdown | ||
document.addEventListener('keydown', evt => { | ||
if (evt.key === 'Escape') { | ||
atcb_close(); | ||
} | ||
}); | ||
} | ||
// Global listener to ESC key to close dropdown | ||
document.addEventListener('keydown', evt => { | ||
if (evt.key === 'Escape') { | ||
atcb_close(); | ||
} | ||
}); | ||
module.exports = { atcb_action, atcb_init }; |
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
const atcbVersion = '1.7.2'; | ||
const atcbVersion = '1.7.3'; | ||
/* Creator: Jens Kuerschner (https://jenskuerschner.de) | ||
@@ -706,13 +706,15 @@ * Project: https://github.com/jekuer/add-to-calendar-button | ||
const isBrowser=new Function("try {return this===window;}catch(e){ return false;}"); | ||
if (isBrowser()) { | ||
// Global listener to ESC key to close dropdown | ||
document.addEventListener('keydown', evt => { | ||
if (evt.key === 'Escape') { | ||
atcb_close(); | ||
} | ||
}); | ||
} | ||
// Global listener to ESC key to close dropdown | ||
document.addEventListener('keydown', evt => { | ||
if (evt.key === 'Escape') { | ||
atcb_close(); | ||
} | ||
}); | ||
export { atcb_action, atcb_init }; |
{ | ||
"name": "add-to-calendar-button", | ||
"version": "1.7.2", | ||
"version": "1.7.3", | ||
"description": "A convenient JavaScript snippet, which lets you create beautiful buttons, where people can add events to their calendars.", | ||
@@ -8,2 +8,3 @@ "main": "npm_dist/cjs/index.js", | ||
"exports": { | ||
"./assets/css/": "./assets/css/", | ||
".": { | ||
@@ -15,3 +16,3 @@ "import": "./npm_dist/mjs/index.js", | ||
"types": "index.d.ts", | ||
"style": "assets/css/atcb.css", | ||
"style": "assets/css/atcb.min.css", | ||
"repository": { | ||
@@ -52,3 +53,3 @@ "type": "git", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"test": "node test/server-side-rendering.js", | ||
"build": "grunt" | ||
@@ -55,0 +56,0 @@ }, |
@@ -176,3 +176,5 @@ # 📅 Your next Add-to-Calendar Button! | ||
### `atcb_action` example with React | ||
### React examples | ||
#### atcb_action | ||
@@ -187,3 +189,3 @@ If you can't or don't want to use `atcb_init`, you can use the `atcb_action` import with your own buttons or other elements/components. If you omit the second argument, the dropdown list will display as a modal in the middle of the viewport - in this case, add the "atcb_customTrigger" class to the submitting element for better keyboard support. | ||
const atcb_action = () => { | ||
const MyComponent = () => { | ||
const [name, setName] = React.useState('Some event') | ||
@@ -209,2 +211,4 @@ return ( | ||
#### atcb_init | ||
Alternatively, you could use `atcb_init` with a `useEffect` hook: | ||
@@ -211,0 +215,0 @@ |
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
108525
12
1648
0
294