@paprika/takeover 1.1.3 → 2.0.1-next.0

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 CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.1-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - fd0f43a: Allow pendo elements to steal focus from react-focus-lock.
8
+ - Updated dependencies [fd0f43a]
9
+ - @paprika/overlay@1.0.17-next.0
10
+
11
+ ## 2.0.0
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [d484734]
16
+ - @paprika/l10n@1.2.0
17
+
18
+ ## 2.0.0-next.0
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [d484734]
23
+ - @paprika/l10n@1.2.0-next.0
24
+
3
25
  ## 1.1.3
4
26
 
5
27
  ### Patch Changes
@@ -10,6 +10,8 @@ _Object$defineProperty(exports, "__esModule", {
10
10
 
11
11
  exports["default"] = void 0;
12
12
 
13
+ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/extends"));
14
+
13
15
  var _react = _interopRequireDefault(require("react"));
14
16
 
15
17
  var _reactFocusLock = _interopRequireDefault(require("react-focus-lock"));
@@ -22,7 +24,19 @@ var defaultProps = {
22
24
  };
23
25
 
24
26
  var FocusLock = function FocusLock(props) {
25
- return /*#__PURE__*/_react["default"].createElement(_reactFocusLock["default"], props);
27
+ // ignore any focusable elements in pendo container, react-focus-lock expects false to be able to ignore them
28
+ // https://github.com/theKashey/react-focus-lock#focus-fighting
29
+ function whiteList(node) {
30
+ var whiteListProp = props.whiteList;
31
+ var pendoContainer = document.getElementById("pendo-base");
32
+ var whiteListPropResult = whiteListProp ? whiteListProp(node) : true;
33
+ if (!pendoContainer) return whiteListPropResult;
34
+ return !pendoContainer.contains(node) && whiteListPropResult;
35
+ }
36
+
37
+ return /*#__PURE__*/_react["default"].createElement(_reactFocusLock["default"], (0, _extends2["default"])({
38
+ whiteList: whiteList
39
+ }, props));
26
40
  };
27
41
 
28
42
  FocusLock.propTypes = propTypes;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/FocusLock/FocusLock.js"],"names":["propTypes","FocusPropTypes","defaultProps","returnFocus","FocusLock","props","displayName"],"mappings":";;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,SAAS,GAAGC,uBAAlB;AAEA,IAAMC,YAAY,GAAG;AACnBC,EAAAA,WAAW,EAAE;AADM,CAArB;;AAIA,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAAAC,KAAK;AAAA,sBAAI,gCAAC,0BAAD,EAAsBA,KAAtB,CAAJ;AAAA,CAAvB;;AAEAD,SAAS,CAACJ,SAAV,GAAsBA,SAAtB;AACAI,SAAS,CAACF,YAAV,GAAyBA,YAAzB;AACAE,SAAS,CAACE,WAAV,GAAwB,oBAAxB;eAEeF,S","sourcesContent":["import React from \"react\";\nimport FocusLockLibrary from \"react-focus-lock\";\nimport { FocusPropTypes } from \"@paprika/helpers\";\n\nconst propTypes = FocusPropTypes;\n\nconst defaultProps = {\n returnFocus: true,\n};\n\nconst FocusLock = props => <FocusLockLibrary {...props} />;\n\nFocusLock.propTypes = propTypes;\nFocusLock.defaultProps = defaultProps;\nFocusLock.displayName = \"Takeover.FocusLock\";\n\nexport default FocusLock;\n"],"file":"FocusLock.js"}
1
+ {"version":3,"sources":["../../../src/components/FocusLock/FocusLock.js"],"names":["propTypes","FocusPropTypes","defaultProps","returnFocus","FocusLock","props","whiteList","node","whiteListProp","pendoContainer","document","getElementById","whiteListPropResult","contains","displayName"],"mappings":";;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,SAAS,GAAGC,uBAAlB;AAEA,IAAMC,YAAY,GAAG;AACnBC,EAAAA,WAAW,EAAE;AADM,CAArB;;AAIA,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAAAC,KAAK,EAAI;AACzB;AACA;AACA,WAASC,SAAT,CAAmBC,IAAnB,EAAyB;AACvB,QAAmBC,aAAnB,GAAqCH,KAArC,CAAQC,SAAR;AACA,QAAMG,cAAc,GAAGC,QAAQ,CAACC,cAAT,CAAwB,YAAxB,CAAvB;AACA,QAAMC,mBAAmB,GAAGJ,aAAa,GAAGA,aAAa,CAACD,IAAD,CAAhB,GAAyB,IAAlE;AAEA,QAAI,CAACE,cAAL,EAAqB,OAAOG,mBAAP;AAErB,WAAO,CAACH,cAAc,CAACI,QAAf,CAAwBN,IAAxB,CAAD,IAAkCK,mBAAzC;AACD;;AAED,sBAAO,gCAAC,0BAAD;AAAkB,IAAA,SAAS,EAAEN;AAA7B,KAA4CD,KAA5C,EAAP;AACD,CAdD;;AAgBAD,SAAS,CAACJ,SAAV,GAAsBA,SAAtB;AACAI,SAAS,CAACF,YAAV,GAAyBA,YAAzB;AACAE,SAAS,CAACU,WAAV,GAAwB,oBAAxB;eAEeV,S","sourcesContent":["import React from \"react\";\nimport FocusLockLibrary from \"react-focus-lock\";\nimport { FocusPropTypes } from \"@paprika/helpers\";\n\nconst propTypes = FocusPropTypes;\n\nconst defaultProps = {\n returnFocus: true,\n};\n\nconst FocusLock = props => {\n // ignore any focusable elements in pendo container, react-focus-lock expects false to be able to ignore them\n // https://github.com/theKashey/react-focus-lock#focus-fighting\n function whiteList(node) {\n const { whiteList: whiteListProp } = props;\n const pendoContainer = document.getElementById(\"pendo-base\");\n const whiteListPropResult = whiteListProp ? whiteListProp(node) : true;\n\n if (!pendoContainer) return whiteListPropResult;\n\n return !pendoContainer.contains(node) && whiteListPropResult;\n }\n\n return <FocusLockLibrary whiteList={whiteList} {...props} />;\n};\n\nFocusLock.propTypes = propTypes;\nFocusLock.defaultProps = defaultProps;\nFocusLock.displayName = \"Takeover.FocusLock\";\n\nexport default FocusLock;\n"],"file":"FocusLock.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paprika/takeover",
3
- "version": "1.1.3",
3
+ "version": "2.0.1-next.0",
4
4
  "description": "The Takeover component can toggle a full-screen view to help the user focus on complex UI tasks.",
5
5
  "author": "@paprika",
6
6
  "main": "lib/index.js",
@@ -20,7 +20,7 @@
20
20
  "@paprika/constants": "^1.0.0",
21
21
  "@paprika/heading": "^1.0.15",
22
22
  "@paprika/helpers": "^2.4.0",
23
- "@paprika/overlay": "^1.0.16",
23
+ "@paprika/overlay": "^1.0.17-next.0",
24
24
  "@paprika/stylers": "^1.1.7",
25
25
  "@paprika/tokens": "^2.0.0",
26
26
  "prop-types": "^15.7.2",
@@ -31,7 +31,7 @@
31
31
  "react": "^16.8.4",
32
32
  "react-dom": "^16.8.4",
33
33
  "styled-components": "^4.2.0",
34
- "@paprika/l10n": "^1.1.15"
34
+ "@paprika/l10n": "^1.2.0"
35
35
  },
36
36
  "paprikaDocs": {
37
37
  "subComponents": [