@paprika/takeover 2.0.1-next.0 → 2.0.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 CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [7fbad8a]
8
+ - @paprika/helpers@2.4.1
9
+ - @paprika/button@1.1.15
10
+ - @paprika/overlay@1.0.18
11
+
12
+ ## 2.0.2-next.0
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [7fbad8a]
17
+ - @paprika/helpers@2.4.1-next.0
18
+ - @paprika/button@1.1.15-next.0
19
+ - @paprika/overlay@1.0.18-next.0
20
+
21
+ ## 2.0.1
22
+
23
+ ### Patch Changes
24
+
25
+ - fd0f43a: Allow pendo elements to steal focus from react-focus-lock.
26
+ - Updated dependencies [fd0f43a]
27
+ - @paprika/overlay@1.0.17
28
+
3
29
  ## 2.0.1-next.0
4
30
 
5
31
  ### Patch Changes
@@ -24,15 +24,9 @@ var defaultProps = {
24
24
  };
25
25
 
26
26
  var FocusLock = function FocusLock(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
- }
27
+ var whiteList = _react["default"].useMemo(function () {
28
+ return (0, _helpers.focusLockWhiteList)(props.whiteList);
29
+ }, [props.whiteList]);
36
30
 
37
31
  return /*#__PURE__*/_react["default"].createElement(_reactFocusLock["default"], (0, _extends2["default"])({
38
32
  whiteList: whiteList
@@ -1 +1 @@
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"}
1
+ {"version":3,"sources":["../../../src/components/FocusLock/FocusLock.js"],"names":["propTypes","FocusPropTypes","defaultProps","returnFocus","FocusLock","props","whiteList","React","useMemo","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,MAAMC,SAAS,GAAGC,kBAAMC,OAAN,CAAc;AAAA,WAAM,iCAAmBH,KAAK,CAACC,SAAzB,CAAN;AAAA,GAAd,EAAyD,CAACD,KAAK,CAACC,SAAP,CAAzD,CAAlB;;AAEA,sBAAO,gCAAC,0BAAD;AAAkB,IAAA,SAAS,EAAEA;AAA7B,KAA4CD,KAA5C,EAAP;AACD,CAJD;;AAMAD,SAAS,CAACJ,SAAV,GAAsBA,SAAtB;AACAI,SAAS,CAACF,YAAV,GAAyBA,YAAzB;AACAE,SAAS,CAACK,WAAV,GAAwB,oBAAxB;eAEeL,S","sourcesContent":["import React from \"react\";\nimport FocusLockLibrary from \"react-focus-lock\";\nimport { FocusPropTypes, focusLockWhiteList } from \"@paprika/helpers\";\n\nconst propTypes = FocusPropTypes;\n\nconst defaultProps = {\n returnFocus: true,\n};\n\nconst FocusLock = props => {\n const whiteList = React.useMemo(() => focusLockWhiteList(props.whiteList), [props.whiteList]);\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": "2.0.1-next.0",
3
+ "version": "2.0.2",
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",
@@ -16,11 +16,11 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@babel/runtime-corejs2": "^7.3.1",
19
- "@paprika/button": "^1.1.14",
19
+ "@paprika/button": "^1.1.15",
20
20
  "@paprika/constants": "^1.0.0",
21
21
  "@paprika/heading": "^1.0.15",
22
- "@paprika/helpers": "^2.4.0",
23
- "@paprika/overlay": "^1.0.17-next.0",
22
+ "@paprika/helpers": "^2.4.1",
23
+ "@paprika/overlay": "^1.0.18",
24
24
  "@paprika/stylers": "^1.1.7",
25
25
  "@paprika/tokens": "^2.0.0",
26
26
  "prop-types": "^15.7.2",