These files should not be added

This commit is contained in:
Gabe Kangas
2020-10-19 22:22:33 -07:00
parent 226242f07b
commit 205ef8926e
6368 changed files with 0 additions and 603959 deletions

View File

@@ -1,104 +0,0 @@
# Changelog
## 5.1.0
- Add `setReturnFocus` option that allows you to set which element receives focus when the trap closes.
## 5.0.2
- Add `allowOutsideClick` option that allows you to pass a click event through, even when `clickOutsideDeactivates` is `false`.
## 5.0.0
- Update Tabbable to improve performance (see [Tabbable's changelog](https://github.com/davidtheclark/tabbable/blob/master/CHANGELOG.md)).
- **Breaking (kind of):** if the `onActivate` callback changes the list of tabbable nodes and the `initialFocus` option is not used, the initial focus will still go to the first element present before the callback.
- Improve performance of activating a trap.
- Register document-level event listeners as active (`passive: false`).
## 4.0.2
- Fix reference to root element that caused errors within Shadow DOM.
(Release 4.0.1 was a mistake, containing no changes.)
## 4.0.0
- **Breaking (kind of):** Focus trap now manages a queue of traps, so when a trap is paused because another trap activates, it will be unpaused when that other trap deactivates. If Trap A was automatically *paused* because Trap B activated (existing behavior), when Trap B is deactivated Trap A will be automatically *unpaused* (new behavior).
## 3.0.0
- **Breaking (kind of):** Update Tabbable to detect more elements and be more careful with radio buttons (see [Tabbable's changelog](https://github.com/davidtheclark/tabbable/blob/master/CHANGELOG.md)).
- **Breaking (kind of):** If `clickOutsideDeactivates` and `returnFocusOnDeactivate` are both `true`, focus will be returned to the pre-trap element only if the clicked element is not focusable.
## 2.4.6
- Add slight delay before moving focus to the first element in the trap.
This should prevent an occasional bug caused when the first element in the trap will close the trap if it picks up on the event that triggered the trap's opening.
## 2.4.5
- Fix `"main"` field in `package.json`.
## 2.4.4
- Publish UMD build so people can download it from `unpkg.com`.
## 2.4.3
- Fixed: TypeScript signature for `activate` function.
## 2.4.2
- Added: TypeScript declaration file.
## 2.3.1
- Fixed: Activation does not re-focus already-focused node.
- Fixed: Tabbing works as expected when initially focused Node has a negative `tabindex` and is in the middle of other tabbable elements.
## 2.3.0
- Added: `initialFocus` and `fallbackFocus` options can take functions that return DOM nodes.
- Fixed: `pause` and `unpause` cannot accidentally add extra event listeners.
## 2.2.0
- Added/fixed, depending on your perspective: If focus is already inside the focus trap when it is activated, leave focus where it is instead of forcing it to the first tabbable node or `initialFocus`.
## 2.1.0
- Added: `fallbackFocus` option.
## 2.0.2
- Fixed: `clickOutsideDeactivates` no longer triggers deactivation when you click *inside* the trap.
## 2.0.1
- Fix bug when activating multiple focus traps.
## 2.0.0
- Rewrote the thing, altering the API. Read the new docs please.
- Update `tabbable` to fix handling of traps with changing contents.
## 1.1.1
- Improve `clickOutsideDeactivates` functionality.
## 1.1.0
- Add `clickOutsideDeactivates` option.
- Add `escapeDeactivates` option.
## 1.0.2
- Make sure to `select()` `<input>` elements when they receive focus via tab.
## 1.0.1
- Fix buggy attempts to focus nodes that don't exist.
## 1.0.0
- Initial release.

View File

@@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2015-2016 David Clark
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,180 +0,0 @@
# focus-trap
---
**SEEKING CO-MAINTAINERS!** Continued development of this project is going to require the work of one or more dedicated co-maintainers (or forkers). If you're interested, please comment in [this issue](https://github.com/davidtheclark/focus-trap/issues/85).
---
Trap focus within a DOM node.
There may come a time when you find it important to trap focus within a DOM node — so that when a user hits `Tab` or `Shift+Tab` or clicks around, she can't escape a certain cycle of focusable elements.
You will definitely face this challenge when you are trying to build **accessible modals**.
This module is a little, modular **vanilla JS** solution to that problem.
Use it in your higher-level components. For example, if you are using React check out [focus-trap-react](https://github.com/davidtheclark/focus-trap-react), a light wrapper around this library. If you are not a React user, consider creating light wrappers in your framework-of-choice.
## What it does
When a focus trap is activated, this is what should happen:
- Some element within the focus trap receives focus. By default, this will be the first element in the focus trap's tab order (as determined by [tabbable](https://github.com/davidtheclark/tabbable)). Alternately, you can specify an element that should receive this initial focus.
- The `Tab` and `Shift+Tab` keys will cycle through the focus trap's tabbable elements *but will not leave the focus trap*.
- Clicks within the focus trap behave normally; but clicks *outside* the focus trap are blocked.
- The `Escape` key will deactivate the focus trap.
When the focus trap is deactivated, this is what should happen:
- Focus is passed to *whichever element had focus when the trap was activated* (e.g. the button that opened the modal or menu).
- Tabbing and clicking behave normally everywhere.
[Check out the demos.](http://davidtheclark.github.io/focus-trap/demo/)
For more advanced usage (e.g. focus traps within focus traps), you can also pause a focus trap's behavior without deactivating it entirely, then unpause at will.
## Installation
```
npm install focus-trap
```
You can also use a UMD version published to `unpkg.com` as `dist/focus-trap.js` and `dist/focus-trap.min.js`.
## Browser Support
IE9+
Why?
Because this module uses [`EventTarget.addEventListener()`](document.createElement('button')).
And its only dependency, tabbable, uses [a couple of IE9+ functions](https://github.com/davidtheclark/tabbable#browser-support).
## Usage
### focusTrap = createFocusTrap(element[, createOptions]);
Returns a new focus trap on `element`.
`element` can be
- a DOM node (the focus trap itself) or
- a selector string (which will be pass to `document.querySelector()` to find the DOM node).
`createOptions`:
- **onActivate** {function}: A function that will be called when the focus trap activates.
- **onDeactivate** {function}: A function that will be called when the focus trap deactivates,
- **initialFocus** {element|string|function}: By default, when a focus trap is activated the first element in the focus trap's tab order will receive focus. With this option you can specify a different element to receive that initial focus. Can be a DOM node, or a selector string (which will be passed to `document.querySelector()` to find the DOM node), or a function that returns a DOM node.
- **fallbackFocus** {element|string|function}: By default, an error will be thrown if the focus trap contains no elements in its tab order. With this option you can specify a fallback element to programmatically receive focus if no other tabbable elements are found. For example, you may want a popover's `<div>` to receive focus if the popover's content includes no tabbable elements. *Make sure the fallback element has a negative `tabindex` so it can be programmatically focused.* The option value can be a DOM node, a selector string (which will be passed to `document.querySelector()` to find the DOM node), or a function that returns a DOM node.
- **escapeDeactivates** {boolean}: Default: `true`. If `false`, the `Escape` key will not trigger deactivation of the focus trap. This can be useful if you want to force the user to make a decision instead of allowing an easy way out.
- **clickOutsideDeactivates** {boolean}: Default: `false`. If `true`, a click outside the focus trap will deactivate the focus trap and allow the click event to do its thing.
- **returnFocusOnDeactivate** {boolean}: Default: `true`. If `false`, when the trap is deactivated, focus will *not* return to the element that had focus before activation.
- **setReturnFocus** {element|string|function}: By default, focus trap on deactivation will return to the element that was focused before activation. With this option you can specify another element to programmatically receive focus after deactivation. Can be a DOM node, or a selector string (which will be passed to `document.querySelector()` to find the DOM node), or a function that returns a DOM node.
- **allowOutsideClick** {function}: If set and returns `true`, a click outside the focus trap will not be prevented, even when `clickOutsideDeactivates` is `false`.
### focusTrap.activate([activateOptions])
Activates the focus trap, adding various event listeners to the document.
If focus is already within it the trap, it remains unaffected. Otherwise, focus-trap will try to focus the following nodes, in order:
- `createOptions.initialFocus`
- The first tabbable node in the trap
- `createOptions.fallbackFocus`
If none of the above exist, an error will be thrown. You cannot have a focus trap that lacks focus.
Returns the `focusTrap`.
`activateOptions`:
These options are used to override the focus trap's default behavior for this particular activation.
- **onActivate** {function | null | false}: Default: whatever you chose for `createOptions.onActivate`. `null` or `false` are the equivalent of a `noop`.
### focusTrap.deactivate([deactivateOptions])
Deactivates the focus trap.
Returns the `focusTrap`.
`deactivateOptions`:
These options are used to override the focus trap's default behavior for this particular deactivation.
- **returnFocus** {boolean}: Default: whatever you chose for `createOptions.returnFocusOnDeactivate`.
- **onDeactivate** {function | null | false}: Default: whatever you chose for `createOptions.onDeactivate`. `null` or `false` are the equivalent of a `noop`.
### focusTrap.pause()
Pause an active focus trap's event listening without deactivating the trap.
If the focus trap has not been activated, nothing happens.
Returns the `focusTrap`.
Any `onDeactivate` callback will not be called, and focus will not return to the element that was focused before the trap's activation. But the trap's behavior will be paused.
This is useful in various cases, one of which is when you want one focus trap within another. `demo-six` exemplifies how you can implement this.
### focusTrap.unpause()
Unpause an active focus trap. (See `pause()`, above.)
Focus is forced into the trap just as described for `focusTrap.activate()`.
If the focus trap has not been activated or has not been paused, nothing happens.
Returns the `focusTrap`.
## Examples
Read code in `demo/` and [see how it works](http://davidtheclark.github.io/focus-trap/demo/).
Here's what happens in `demo-one.js`:
```js
var createFocusTrap = require('../../');
var containerOne = document.getElementById('demo-one');
var focusTrapOne = createFocusTrap('#demo-one', {
onDeactivate: function () {
containerOne.className = 'trap';
},
});
document.getElementById('activate-one').addEventListener('click', function () {
focusTrapOne.activate();
containerOne.className = 'trap is-active';
});
document.getElementById('deactivate-one').addEventListener('click', function () {
focusTrapOne.deactivate();
});
```
## Other details
### One at a time
*Only one focus trap can be listening at a time.* If a second focus trap is activated the first will automatically pause. The first trap is unpaused and again traps focus when the second is deactivated.
Focus trap manages a queue of traps: if A activates; then B activates, pausing A; then C activates, pausing B; when C then deactivates, B is unpaused; and when B then deactivates, A is unpaused.
### Use predictable elements for the first and last tabbable elements in your trap
The focus trap will work best if the *first* and *last* focusable elements in your trap are simple elements that all browsers treat the same, like buttons and inputs.**
Tabbing will work as expected with trickier, less predictable elements — like iframes, shadow trees, audio and video elements, etc. — as long as they are *between* more predictable elements (that is, if they are not the first or last tabbable element in the trap).
This limitation is ultimately rooted in browser inconsistencies and inadequacies, but it comes to focus-trap through its dependency [Tabbable](https://github.com/davidtheclark/tabbable). You can read about more details [in the Tabbable documentation](https://github.com/davidtheclark/tabbable#more-details).
### Your trap should include a tabbable element or a focusable container
You can't have a focus trap without focus, so an error will be thrown if you try to initialize focus-trap with an element that contains no tabbable nodes.
If you find yourself in this situation, you should give you container `tabindex="-1"` and set it as `initialFocus` or `fallbackFocus`. A couple of demos illustrate this.
## Development
Because of the nature of the functionality, involving keyboard and click and (especially) focus events, JavaScript unit tests didn't make sense. (If you disagree and can help out, please PR!) So the demo is also the test: run it in browsers and see how it works, checking the documented requirements.

View File

@@ -1,91 +0,0 @@
declare module "focus-trap" {
/**
* A DOM node, a selector string (which will be passed to
* `document.querySelector()` to find the DOM node), or a function that
* returns a DOM node.
*/
export type FocusTarget = HTMLElement | string | { (): HTMLElement };
export interface Options {
/**
* A function that will be called when the focus trap activates.
*/
onActivate?: () => void;
/**
* A function that will be called when the focus trap deactivates.
*/
onDeactivate?: () => void;
/**
* By default, when a focus trap is activated the first element in the
* focus trap's tab order will receive focus. With this option you can
* specify a different element to receive that initial focus.
*/
initialFocus?: FocusTarget;
/**
* By default, an error will be thrown if the focus trap contains no
* elements in its tab order. With this option you can specify a
* fallback element to programmatically receive focus if no other
* tabbable elements are found. For example, you may want a popover's
* `<div>` to receive focus if the popover's content includes no
* tabbable elements. *Make sure the fallback element has a negative
* `tabindex` so it can be programmatically focused.*
*/
fallbackFocus?: FocusTarget;
/**
* Default: `true`. If `false`, when the trap is deactivated,
* focus will *not* return to the element that had focus before activation.
*/
returnFocusOnDeactivate?: boolean;
/**
* By default, focus trap on deactivation will return to the element
* that was focused before activation.
*/
setReturnFocus?: FocusTarget;
/**
* Default: `true`. If `false`, the `Escape` key will not trigger
* deactivation of the focus trap. This can be useful if you want
* to force the user to make a decision instead of allowing an easy
* way out.
*/
escapeDeactivates?: boolean;
/**
* Default: `false`. If `true`, a click outside the focus trap will
* deactivate the focus trap and allow the click event to do its thing.
*/
clickOutsideDeactivates?: boolean;
allowOutsideClick?: (event: MouseEvent) => boolean;
}
type ActivateOptions = Pick<Options, "onActivate">;
interface DeactivateOptions extends Pick<Options, "onDeactivate"> {
returnFocus?: boolean;
}
export interface FocusTrap {
activate(activateOptions?: ActivateOptions): void;
deactivate(deactivateOptions?: DeactivateOptions): void;
pause(): void;
unpause(): void;
}
/**
* Returns a new focus trap on `element`.
*
* @param element
* The element to be the focus trap, or a selector that will be used to
* find the element.
*/
export default function focusTrap(
element: HTMLElement | string,
userOptions?: Options
): FocusTrap;
}

View File

@@ -1,337 +0,0 @@
var tabbable = require('tabbable');
var xtend = require('xtend');
var activeFocusDelay;
var activeFocusTraps = (function() {
var trapQueue = [];
return {
activateTrap: function(trap) {
if (trapQueue.length > 0) {
var activeTrap = trapQueue[trapQueue.length - 1];
if (activeTrap !== trap) {
activeTrap.pause();
}
}
var trapIndex = trapQueue.indexOf(trap);
if (trapIndex === -1) {
trapQueue.push(trap);
} else {
// move this existing trap to the front of the queue
trapQueue.splice(trapIndex, 1);
trapQueue.push(trap);
}
},
deactivateTrap: function(trap) {
var trapIndex = trapQueue.indexOf(trap);
if (trapIndex !== -1) {
trapQueue.splice(trapIndex, 1);
}
if (trapQueue.length > 0) {
trapQueue[trapQueue.length - 1].unpause();
}
}
};
})();
function focusTrap(element, userOptions) {
var doc = document;
var container =
typeof element === 'string' ? doc.querySelector(element) : element;
var config = xtend(
{
returnFocusOnDeactivate: true,
escapeDeactivates: true
},
userOptions
);
var state = {
firstTabbableNode: null,
lastTabbableNode: null,
nodeFocusedBeforeActivation: null,
mostRecentlyFocusedNode: null,
active: false,
paused: false
};
var trap = {
activate: activate,
deactivate: deactivate,
pause: pause,
unpause: unpause
};
return trap;
function activate(activateOptions) {
if (state.active) return;
updateTabbableNodes();
state.active = true;
state.paused = false;
state.nodeFocusedBeforeActivation = doc.activeElement;
var onActivate =
activateOptions && activateOptions.onActivate
? activateOptions.onActivate
: config.onActivate;
if (onActivate) {
onActivate();
}
addListeners();
return trap;
}
function deactivate(deactivateOptions) {
if (!state.active) return;
clearTimeout(activeFocusDelay);
removeListeners();
state.active = false;
state.paused = false;
activeFocusTraps.deactivateTrap(trap);
var onDeactivate =
deactivateOptions && deactivateOptions.onDeactivate !== undefined
? deactivateOptions.onDeactivate
: config.onDeactivate;
if (onDeactivate) {
onDeactivate();
}
var returnFocus =
deactivateOptions && deactivateOptions.returnFocus !== undefined
? deactivateOptions.returnFocus
: config.returnFocusOnDeactivate;
if (returnFocus) {
delay(function() {
tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
});
}
return trap;
}
function pause() {
if (state.paused || !state.active) return;
state.paused = true;
removeListeners();
}
function unpause() {
if (!state.paused || !state.active) return;
state.paused = false;
updateTabbableNodes();
addListeners();
}
function addListeners() {
if (!state.active) return;
// There can be only one listening focus trap at a time
activeFocusTraps.activateTrap(trap);
// Delay ensures that the focused element doesn't capture the event
// that caused the focus trap activation.
activeFocusDelay = delay(function() {
tryFocus(getInitialFocusNode());
});
doc.addEventListener('focusin', checkFocusIn, true);
doc.addEventListener('mousedown', checkPointerDown, {
capture: true,
passive: false
});
doc.addEventListener('touchstart', checkPointerDown, {
capture: true,
passive: false
});
doc.addEventListener('click', checkClick, {
capture: true,
passive: false
});
doc.addEventListener('keydown', checkKey, {
capture: true,
passive: false
});
return trap;
}
function removeListeners() {
if (!state.active) return;
doc.removeEventListener('focusin', checkFocusIn, true);
doc.removeEventListener('mousedown', checkPointerDown, true);
doc.removeEventListener('touchstart', checkPointerDown, true);
doc.removeEventListener('click', checkClick, true);
doc.removeEventListener('keydown', checkKey, true);
return trap;
}
function getNodeForOption(optionName) {
var optionValue = config[optionName];
var node = optionValue;
if (!optionValue) {
return null;
}
if (typeof optionValue === 'string') {
node = doc.querySelector(optionValue);
if (!node) {
throw new Error('`' + optionName + '` refers to no known node');
}
}
if (typeof optionValue === 'function') {
node = optionValue();
if (!node) {
throw new Error('`' + optionName + '` did not return a node');
}
}
return node;
}
function getInitialFocusNode() {
var node;
if (getNodeForOption('initialFocus') !== null) {
node = getNodeForOption('initialFocus');
} else if (container.contains(doc.activeElement)) {
node = doc.activeElement;
} else {
node = state.firstTabbableNode || getNodeForOption('fallbackFocus');
}
if (!node) {
throw new Error(
'Your focus-trap needs to have at least one focusable element'
);
}
return node;
}
function getReturnFocusNode(previousActiveElement) {
var node = getNodeForOption('setReturnFocus');
return node ? node : previousActiveElement;
}
// This needs to be done on mousedown and touchstart instead of click
// so that it precedes the focus event.
function checkPointerDown(e) {
if (container.contains(e.target)) return;
if (config.clickOutsideDeactivates) {
deactivate({
returnFocus: !tabbable.isFocusable(e.target)
});
return;
}
// This is needed for mobile devices.
// (If we'll only let `click` events through,
// then on mobile they will be blocked anyways if `touchstart` is blocked.)
if (config.allowOutsideClick && config.allowOutsideClick(e)) {
return;
}
e.preventDefault();
}
// In case focus escapes the trap for some strange reason, pull it back in.
function checkFocusIn(e) {
// In Firefox when you Tab out of an iframe the Document is briefly focused.
if (container.contains(e.target) || e.target instanceof Document) {
return;
}
e.stopImmediatePropagation();
tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
}
function checkKey(e) {
if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
e.preventDefault();
deactivate();
return;
}
if (isTabEvent(e)) {
checkTab(e);
return;
}
}
// Hijack Tab events on the first and last focusable nodes of the trap,
// in order to prevent focus from escaping. If it escapes for even a
// moment it can end up scrolling the page and causing confusion so we
// kind of need to capture the action at the keydown phase.
function checkTab(e) {
updateTabbableNodes();
if (e.shiftKey && e.target === state.firstTabbableNode) {
e.preventDefault();
tryFocus(state.lastTabbableNode);
return;
}
if (!e.shiftKey && e.target === state.lastTabbableNode) {
e.preventDefault();
tryFocus(state.firstTabbableNode);
return;
}
}
function checkClick(e) {
if (config.clickOutsideDeactivates) return;
if (container.contains(e.target)) return;
if (config.allowOutsideClick && config.allowOutsideClick(e)) {
return;
}
e.preventDefault();
e.stopImmediatePropagation();
}
function updateTabbableNodes() {
var tabbableNodes = tabbable(container);
state.firstTabbableNode = tabbableNodes[0] || getInitialFocusNode();
state.lastTabbableNode =
tabbableNodes[tabbableNodes.length - 1] || getInitialFocusNode();
}
function tryFocus(node) {
if (node === doc.activeElement) return;
if (!node || !node.focus) {
tryFocus(getInitialFocusNode());
return;
}
node.focus();
state.mostRecentlyFocusedNode = node;
if (isSelectableInput(node)) {
node.select();
}
}
}
function isSelectableInput(node) {
return (
node.tagName &&
node.tagName.toLowerCase() === 'input' &&
typeof node.select === 'function'
);
}
function isEscapeEvent(e) {
return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
}
function isTabEvent(e) {
return e.key === 'Tab' || e.keyCode === 9;
}
function delay(fn) {
return setTimeout(fn, 0);
}
module.exports = focusTrap;

View File

@@ -1,88 +0,0 @@
{
"_args": [
[
"focus-trap@5.1.0",
"/home/runner/work/owncast/owncast/build/javascript"
]
],
"_from": "focus-trap@5.1.0",
"_id": "focus-trap@5.1.0",
"_inBundle": false,
"_integrity": "sha512-CkB/nrO55069QAUjWFBpX6oc+9V90Qhgpe6fBWApzruMq5gnlh90Oo7iSSDK7pKiV5ugG6OY2AXM5mxcmL3lwQ==",
"_location": "/focus-trap",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "focus-trap@5.1.0",
"name": "focus-trap",
"escapedName": "focus-trap",
"rawSpec": "5.1.0",
"saveSpec": null,
"fetchSpec": "5.1.0"
},
"_requiredBy": [
"/@joeattardi/emoji-button"
],
"_resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-5.1.0.tgz",
"_spec": "5.1.0",
"_where": "/home/runner/work/owncast/owncast/build/javascript",
"author": {
"name": "David Clark"
},
"bugs": {
"url": "https://github.com/davidtheclark/focus-trap/issues"
},
"dependencies": {
"tabbable": "^4.0.0",
"xtend": "^4.0.1"
},
"description": "Trap focus within a DOM node.",
"devDependencies": {
"browserify": "^13.3.0",
"budo": "^9.4.1",
"del-cli": "^1.1.0",
"eslint": "^3.13.1",
"husky": "^0.14.3",
"lint-staged": "^7.2.0",
"make-dir-cli": "^1.0.0",
"prettier": "^1.14.0",
"uglify-js": "^3.3.22"
},
"files": [
"dist",
"index.js",
"index.d.ts"
],
"homepage": "https://github.com/davidtheclark/focus-trap#readme",
"keywords": [
"focus",
"accessibility",
"trap",
"capture",
"keyboard",
"modal"
],
"license": "MIT",
"main": "index.js",
"name": "focus-trap",
"repository": {
"type": "git",
"url": "git+https://github.com/davidtheclark/focus-trap.git"
},
"scripts": {
"build": "npm run build-dev && npm run minify",
"build-dev": "npm run clean && browserify index.js -s focusTrap > dist/focus-trap.js",
"clean": "del-cli dist && make-dir dist",
"demo-bundle": "browserify demo/js/index.js -o demo/demo-bundle.js",
"format": "prettier --write '**/*.{js,json}'",
"lint": "eslint .",
"minify": "uglifyjs dist/focus-trap.js > dist/focus-trap.min.js",
"precommit": "lint-staged",
"prepublishOnly": "npm run build",
"start": "budo demo/js/index.js:demo-bundle.js --dir demo --live",
"test": "npm run lint"
},
"types": "index.d.ts",
"version": "5.1.0"
}