@capsitech/react-utilities 0.1.12 → 0.1.14

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.
@@ -48,7 +48,7 @@ declare class ApiUtilityBase {
48
48
  * @param config Configuration object
49
49
  */
50
50
  configure(config: IApiUtilityConfig): void;
51
- getResponse: <T = any>(endpoint: string, params?: any, options?: IAxiosRequestConfigWithoutParams) => Promise<AxiosResponse<T, any>>;
51
+ getResponse: <T = any>(endpoint: string, params?: any, options?: IAxiosRequestConfigWithoutParams) => Promise<AxiosResponse<T, any, {}>>;
52
52
  get: <T = IApiResponse>(endpoint: string, params?: any, throwErrorOn401?: boolean, options?: IAxiosRequestConfigWithoutParams) => Promise<T>;
53
53
  getResult: <T = any>(endpoint: string, params?: any, throwErrorOn401?: boolean, options?: IAxiosRequestConfigWithoutParams) => Promise<T | null>;
54
54
  post: <T = IApiResponse>(endpoint: string, body: any, contentType?: string, options?: IAxiosRequestConfigWithoutParams) => Promise<T>;
@@ -124,19 +124,13 @@ export const getScreenColorDepth = () => validateAndGetScreenDetail(screen.color
124
124
  * If it fails validation, it returns null
125
125
  * @returns {number | null} validated value of window's innerWidth
126
126
  */
127
- export const getWindowWidth = () => {
128
- const pixelRatio = window.devicePixelRatio || 1;
129
- return validateAndGetScreenDetail(Math.floor(window.innerWidth * pixelRatio));
130
- };
127
+ export const getWindowWidth = () => validateAndGetScreenDetail(window.outerWidth);
131
128
  /**
132
129
  * Function that validates the user's window's interior height in pixels, and then returns it.
133
130
  * If it fails validation, it returns null
134
131
  * @returns {number | null} validated value of window's innerHeight
135
132
  */
136
- export const getWindowHeight = () => {
137
- const pixelRatio = window.devicePixelRatio || 1;
138
- return validateAndGetScreenDetail(Math.floor(window.innerHeight * pixelRatio));
139
- };
133
+ export const getWindowHeight = () => validateAndGetScreenDetail(window.outerHeight);
140
134
  /**
141
135
  * The function returns users browser's do not track setting by checking the navigator
142
136
  * and window object for the same
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capsitech/react-utilities",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "A set of javascript utility methods",
5
5
  "main": "lib/index.js",
6
6
  "jsnext:main": "lib/index.js",
@@ -37,12 +37,12 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "dayjs": "^1.11.19",
40
- "lodash": "^4.17.21"
40
+ "lodash": "^4.17.23"
41
41
  },
42
42
  "peerDependencies": {
43
- "axios": "^1.13.2",
43
+ "axios": "^1.13.3",
44
44
  "file-saver": "^2.0.5",
45
- "qs": "^6.14.0",
45
+ "qs": "^6.14.1",
46
46
  "react": ">=18",
47
47
  "react-dom": ">=18"
48
48
  },
@@ -54,16 +54,16 @@
54
54
  "@storybook/addon-webpack5-compiler-babel": "^4.0.0",
55
55
  "@storybook/react-webpack5": "^10.1.11",
56
56
  "@types/file-saver": "^2.0.7",
57
- "@types/lodash": "4.17.20",
57
+ "@types/lodash": "4.17.23",
58
58
  "@types/qs": "^6",
59
59
  "@types/react": "^18.3.12",
60
- "axios": "^1.11.0",
60
+ "axios": "^1.13.3",
61
61
  "file-saver": "^2.0.5",
62
- "qs": "^6.14.0",
62
+ "qs": "^6.14.1",
63
63
  "react": "^18.3.1",
64
64
  "react-dom": "^18.3.1",
65
65
  "react-router-dom": "^7.8.1",
66
- "rimraf": "6.0.1",
66
+ "rimraf": "6.1.2",
67
67
  "storybook": "^10.1.11",
68
68
  "typescript": "5.8.3"
69
69
  },
@@ -79,5 +79,5 @@
79
79
  "last 1 safari version"
80
80
  ]
81
81
  },
82
- "packageManager": "yarn@4.11.0"
82
+ "packageManager": "yarn@4.12.0"
83
83
  }