focus-trap-react 10.1.1 → 10.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/focus-trap-react.js +13 -14
- package/package.json +22 -22
package/CHANGELOG.md
CHANGED
package/dist/focus-trap-react.js
CHANGED
|
@@ -27,6 +27,19 @@ var FocusTrap = /*#__PURE__*/function (_React$Component) {
|
|
|
27
27
|
var _this;
|
|
28
28
|
_classCallCheck(this, FocusTrap);
|
|
29
29
|
_this = _super.call(this, props);
|
|
30
|
+
/**
|
|
31
|
+
* Gets the node for the given option, which is expected to be an option that
|
|
32
|
+
* can be either a DOM node, a string that is a selector to get a node, `false`
|
|
33
|
+
* (if a node is explicitly NOT given), or a function that returns any of these
|
|
34
|
+
* values.
|
|
35
|
+
* @param {string} optionName
|
|
36
|
+
* @returns {undefined | false | HTMLElement | SVGElement} Returns
|
|
37
|
+
* `undefined` if the option is not specified; `false` if the option
|
|
38
|
+
* resolved to `false` (node explicitly not given); otherwise, the resolved
|
|
39
|
+
* DOM node.
|
|
40
|
+
* @throws {Error} If the option is set, not `false`, and is not, or does not
|
|
41
|
+
* resolve to a node.
|
|
42
|
+
*/
|
|
30
43
|
_defineProperty(_assertThisInitialized(_this), "getNodeForOption", function (optionName) {
|
|
31
44
|
var _this$internalOptions;
|
|
32
45
|
// use internal options first, falling back to original options
|
|
@@ -139,20 +152,6 @@ var FocusTrap = /*#__PURE__*/function (_React$Component) {
|
|
|
139
152
|
// SSR: careful to check if `document` exists before accessing it as a variable
|
|
140
153
|
return this.props.focusTrapOptions.document || (typeof document !== 'undefined' ? document : undefined);
|
|
141
154
|
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Gets the node for the given option, which is expected to be an option that
|
|
145
|
-
* can be either a DOM node, a string that is a selector to get a node, `false`
|
|
146
|
-
* (if a node is explicitly NOT given), or a function that returns any of these
|
|
147
|
-
* values.
|
|
148
|
-
* @param {string} optionName
|
|
149
|
-
* @returns {undefined | false | HTMLElement | SVGElement} Returns
|
|
150
|
-
* `undefined` if the option is not specified; `false` if the option
|
|
151
|
-
* resolved to `false` (node explicitly not given); otherwise, the resolved
|
|
152
|
-
* DOM node.
|
|
153
|
-
* @throws {Error} If the option is set, not `false`, and is not, or does not
|
|
154
|
-
* resolve to a node.
|
|
155
|
-
*/
|
|
156
155
|
}, {
|
|
157
156
|
key: "getReturnFocusNode",
|
|
158
157
|
value: function getReturnFocusNode() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "focus-trap-react",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.2",
|
|
4
4
|
"description": "A React component that traps focus.",
|
|
5
5
|
"main": "dist/focus-trap-react.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
17
|
"demo-bundle": "NODE_ENV=production browserify demo/js -t babelify --extension=.jsx -o demo/demo-bundle.js",
|
|
18
|
-
"start": "
|
|
18
|
+
"start": "npm run build && NODE_ENV=development budo demo/js/index.js:demo-bundle.js --dir demo --live -- -t babelify --extension=.jsx",
|
|
19
19
|
"lint": "eslint \"*.js\" \"src/**/*.js\" \"test/**/*.js\" \"demo/**/*.js\" \"cypress/**/*.js\"",
|
|
20
20
|
"format": "prettier --write \"{*,src/**/*,test/**/*,demo/js/**/*,.github/workflows/*,cypress/**/*}.+(js|yml)\"",
|
|
21
21
|
"format:check": "prettier --check \"{*,src/**/*,test/**/*,demo/js/**/*,.github/workflows/*,cypress/**/*}.+(js|yml)\"",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"test:unit": "jest",
|
|
26
26
|
"test:coverage": "jest --coverage",
|
|
27
27
|
"test:e2e": "ELECTRON_ENABLE_LOGGING=1 start-server-and-test start 9966 'cypress run --browser $CYPRESS_BROWSER --headless'",
|
|
28
|
-
"test:e2e:chrome": "CYPRESS_BROWSER=chrome
|
|
28
|
+
"test:e2e:chrome": "CYPRESS_BROWSER=chrome npm run test:e2e",
|
|
29
29
|
"test:e2e:dev": "ELECTRON_ENABLE_LOGGING=1 start-server-and-test start 9966 'cypress open'",
|
|
30
|
-
"test": "
|
|
31
|
-
"prepare": "
|
|
32
|
-
"prepublishOnly": "
|
|
33
|
-
"release": "
|
|
30
|
+
"test": "npm run format:check && npm run lint && npm run test:unit && npm run test:types && npm run test:e2e:chrome",
|
|
31
|
+
"prepare": "npm run build",
|
|
32
|
+
"prepublishOnly": "npm run test && npm run build",
|
|
33
|
+
"release": "npm run build && changeset publish"
|
|
34
34
|
},
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|
|
@@ -57,46 +57,46 @@
|
|
|
57
57
|
},
|
|
58
58
|
"homepage": "https://github.com/focus-trap/focus-trap-react#readme",
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@babel/cli": "^7.
|
|
61
|
-
"@babel/core": "^7.
|
|
62
|
-
"@babel/eslint-parser": "^7.
|
|
60
|
+
"@babel/cli": "^7.21.5",
|
|
61
|
+
"@babel/core": "^7.21.8",
|
|
62
|
+
"@babel/eslint-parser": "^7.21.8",
|
|
63
63
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
64
|
-
"@babel/preset-env": "^7.
|
|
64
|
+
"@babel/preset-env": "^7.21.5",
|
|
65
65
|
"@babel/preset-react": "^7.18.6",
|
|
66
|
-
"@changesets/cli": "^2.26.
|
|
66
|
+
"@changesets/cli": "^2.26.1",
|
|
67
67
|
"@testing-library/cypress": "^9.0.0",
|
|
68
|
-
"@testing-library/dom": "^9.
|
|
68
|
+
"@testing-library/dom": "^9.2.0",
|
|
69
69
|
"@testing-library/jest-dom": "^5.16.5",
|
|
70
70
|
"@testing-library/react": "^14.0.0",
|
|
71
71
|
"@testing-library/user-event": "^14.4.3",
|
|
72
72
|
"@types/jquery": "^3.5.16",
|
|
73
|
-
"all-contributors-cli": "^6.
|
|
73
|
+
"all-contributors-cli": "^6.25.0",
|
|
74
74
|
"babel-jest": "^29.5.0",
|
|
75
75
|
"babelify": "^10.0.0",
|
|
76
76
|
"browserify": "^17.0.0",
|
|
77
77
|
"budo": "^11.8.4",
|
|
78
|
-
"cypress": "^12.
|
|
78
|
+
"cypress": "^12.12.0",
|
|
79
79
|
"cypress-plugin-tab": "^1.0.5",
|
|
80
|
-
"eslint": "^8.
|
|
81
|
-
"eslint-config-prettier": "^8.
|
|
82
|
-
"eslint-plugin-cypress": "^2.
|
|
80
|
+
"eslint": "^8.40.0",
|
|
81
|
+
"eslint-config-prettier": "^8.8.0",
|
|
82
|
+
"eslint-plugin-cypress": "^2.13.3",
|
|
83
83
|
"eslint-plugin-jest": "^27.2.1",
|
|
84
84
|
"eslint-plugin-react": "^7.32.2",
|
|
85
85
|
"jest": "^29.5.0",
|
|
86
86
|
"jest-environment-jsdom": "^29.5.0",
|
|
87
87
|
"jest-watch-typeahead": "^2.2.2",
|
|
88
88
|
"onchange": "^7.1.0",
|
|
89
|
-
"prettier": "^2.8.
|
|
89
|
+
"prettier": "^2.8.8",
|
|
90
90
|
"prop-types": "^15.8.1",
|
|
91
91
|
"react": "^18.2.0",
|
|
92
92
|
"react-dom": "^18.2.0",
|
|
93
93
|
"regenerator-runtime": "^0.13.11",
|
|
94
94
|
"start-server-and-test": "^2.0.0",
|
|
95
|
-
"typescript": "^
|
|
95
|
+
"typescript": "^5.0.4"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"focus-trap": "^7.4.
|
|
99
|
-
"tabbable": "^6.1.
|
|
98
|
+
"focus-trap": "^7.4.1",
|
|
99
|
+
"tabbable": "^6.1.2"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
102
|
"prop-types": "^15.8.1",
|