@elliemae/ds-hooks-is-mobile 3.36.0-next.0 → 3.36.0-next.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.
|
@@ -38,8 +38,7 @@ var import_pui_theme = require("@elliemae/pui-theme");
|
|
|
38
38
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
39
39
|
const theme = (0, import_pui_theme.getDefaultTheme)();
|
|
40
40
|
const isMobile = () => {
|
|
41
|
-
if (!window)
|
|
42
|
-
return false;
|
|
41
|
+
if (!window) return false;
|
|
43
42
|
return Number(theme.breakpoints.medium.split("px")[0]) - window.innerWidth >= 0;
|
|
44
43
|
};
|
|
45
44
|
const useIsMobile = () => {
|
|
@@ -53,8 +52,7 @@ const useIsMobile = () => {
|
|
|
53
52
|
window?.removeEventListener("resize", handleResize);
|
|
54
53
|
};
|
|
55
54
|
}, []);
|
|
56
|
-
if (!window)
|
|
57
|
-
return false;
|
|
55
|
+
if (!window) return false;
|
|
58
56
|
return mobile;
|
|
59
57
|
};
|
|
60
58
|
const returnType = {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSHookIsMobile.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { useState, useEffect } from 'react';\nimport { getDefaultTheme } from '@elliemae/pui-theme';\nimport type { Theme } from '@elliemae/pui-theme';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\n\nconst theme = getDefaultTheme() as Theme;\n\nconst isMobile = (): boolean => {\n if (!window) return false;\n return Number(theme.breakpoints.medium.split('px')[0]) - window.innerWidth >= 0;\n};\n\nconst useIsMobile = (): boolean => {\n const [mobile, setMobile] = useState<boolean>(isMobile());\n\n useEffect(() => {\n function handleResize() {\n setMobile(isMobile());\n }\n window?.addEventListener('resize', handleResize);\n return () => {\n window?.removeEventListener('resize', handleResize);\n };\n }, []);\n\n if (!window) return false;\n return mobile;\n};\n\nconst returnType = {\n isMobile: PropTypes.bool.description('Whether the current view is Mobile or Desktop.'),\n};\n\nuseIsMobile.displayName = 'useIsMobile';\nconst UseIsMobileWithSchema = describe(useIsMobile);\n\nUseIsMobileWithSchema.returnType = returnType;\n\nexport { useIsMobile, UseIsMobileWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AACpC,uBAAgC;AAEhC,8BAAoC;AAEpC,MAAM,YAAQ,kCAAgB;AAE9B,MAAM,WAAW,MAAe;AAC9B,MAAI,CAAC
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AACpC,uBAAgC;AAEhC,8BAAoC;AAEpC,MAAM,YAAQ,kCAAgB;AAE9B,MAAM,WAAW,MAAe;AAC9B,MAAI,CAAC,OAAQ,QAAO;AACpB,SAAO,OAAO,MAAM,YAAY,OAAO,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,OAAO,cAAc;AAChF;AAEA,MAAM,cAAc,MAAe;AACjC,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAkB,SAAS,CAAC;AAExD,8BAAU,MAAM;AACd,aAAS,eAAe;AACtB,gBAAU,SAAS,CAAC;AAAA,IACtB;AACA,YAAQ,iBAAiB,UAAU,YAAY;AAC/C,WAAO,MAAM;AACX,cAAQ,oBAAoB,UAAU,YAAY;AAAA,IACpD;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,MAAI,CAAC,OAAQ,QAAO;AACpB,SAAO;AACT;AAEA,MAAM,aAAa;AAAA,EACjB,UAAU,kCAAU,KAAK,YAAY,gDAAgD;AACvF;AAEA,YAAY,cAAc;AAC1B,MAAM,4BAAwB,kCAAS,WAAW;AAElD,sBAAsB,aAAa;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,8 +4,7 @@ import { getDefaultTheme } from "@elliemae/pui-theme";
|
|
|
4
4
|
import { PropTypes, describe } from "@elliemae/ds-props-helpers";
|
|
5
5
|
const theme = getDefaultTheme();
|
|
6
6
|
const isMobile = () => {
|
|
7
|
-
if (!window)
|
|
8
|
-
return false;
|
|
7
|
+
if (!window) return false;
|
|
9
8
|
return Number(theme.breakpoints.medium.split("px")[0]) - window.innerWidth >= 0;
|
|
10
9
|
};
|
|
11
10
|
const useIsMobile = () => {
|
|
@@ -19,8 +18,7 @@ const useIsMobile = () => {
|
|
|
19
18
|
window?.removeEventListener("resize", handleResize);
|
|
20
19
|
};
|
|
21
20
|
}, []);
|
|
22
|
-
if (!window)
|
|
23
|
-
return false;
|
|
21
|
+
if (!window) return false;
|
|
24
22
|
return mobile;
|
|
25
23
|
};
|
|
26
24
|
const returnType = {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSHookIsMobile.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useState, useEffect } from 'react';\nimport { getDefaultTheme } from '@elliemae/pui-theme';\nimport type { Theme } from '@elliemae/pui-theme';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\n\nconst theme = getDefaultTheme() as Theme;\n\nconst isMobile = (): boolean => {\n if (!window) return false;\n return Number(theme.breakpoints.medium.split('px')[0]) - window.innerWidth >= 0;\n};\n\nconst useIsMobile = (): boolean => {\n const [mobile, setMobile] = useState<boolean>(isMobile());\n\n useEffect(() => {\n function handleResize() {\n setMobile(isMobile());\n }\n window?.addEventListener('resize', handleResize);\n return () => {\n window?.removeEventListener('resize', handleResize);\n };\n }, []);\n\n if (!window) return false;\n return mobile;\n};\n\nconst returnType = {\n isMobile: PropTypes.bool.description('Whether the current view is Mobile or Desktop.'),\n};\n\nuseIsMobile.displayName = 'useIsMobile';\nconst UseIsMobileWithSchema = describe(useIsMobile);\n\nUseIsMobileWithSchema.returnType = returnType;\n\nexport { useIsMobile, UseIsMobileWithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,UAAU,iBAAiB;AACpC,SAAS,uBAAuB;AAEhC,SAAS,WAAW,gBAAgB;AAEpC,MAAM,QAAQ,gBAAgB;AAE9B,MAAM,WAAW,MAAe;AAC9B,MAAI,CAAC
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,UAAU,iBAAiB;AACpC,SAAS,uBAAuB;AAEhC,SAAS,WAAW,gBAAgB;AAEpC,MAAM,QAAQ,gBAAgB;AAE9B,MAAM,WAAW,MAAe;AAC9B,MAAI,CAAC,OAAQ,QAAO;AACpB,SAAO,OAAO,MAAM,YAAY,OAAO,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,OAAO,cAAc;AAChF;AAEA,MAAM,cAAc,MAAe;AACjC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAkB,SAAS,CAAC;AAExD,YAAU,MAAM;AACd,aAAS,eAAe;AACtB,gBAAU,SAAS,CAAC;AAAA,IACtB;AACA,YAAQ,iBAAiB,UAAU,YAAY;AAC/C,WAAO,MAAM;AACX,cAAQ,oBAAoB,UAAU,YAAY;AAAA,IACpD;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,MAAI,CAAC,OAAQ,QAAO;AACpB,SAAO;AACT;AAEA,MAAM,aAAa;AAAA,EACjB,UAAU,UAAU,KAAK,YAAY,gDAAgD;AACvF;AAEA,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW;AAElD,sBAAsB,aAAa;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-hooks-is-mobile",
|
|
3
|
-
"version": "3.36.0-next.
|
|
3
|
+
"version": "3.36.0-next.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Hooks Is Mobile",
|
|
6
6
|
"files": [
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"indent": 4
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@elliemae/ds-props-helpers": "3.36.0-next.
|
|
39
|
+
"@elliemae/ds-props-helpers": "3.36.0-next.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
43
|
-
"@elliemae/ds-monorepo-devops": "3.36.0-next.
|
|
43
|
+
"@elliemae/ds-monorepo-devops": "3.36.0-next.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"lodash": "^4.17.21",
|