@dynamic-labs/utils 2.5.3 → 2.6.1

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,4 +1,13 @@
1
1
 
2
+ ### [2.6.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.6.0...v2.6.1) (2024-09-11)
3
+
4
+ ## [2.6.0](https://github.com/dynamic-labs/DynamicAuth/compare/v2.5.3...v2.6.0) (2024-09-03)
5
+
6
+
7
+ ### Features
8
+
9
+ * adds social redirect option and improve apple id login ([#6717](https://github.com/dynamic-labs/DynamicAuth/issues/6717)) ([500e70c](https://github.com/dynamic-labs/DynamicAuth/commit/500e70cb446b75a6264b566c7adc7cd9a0c89264))
10
+
2
11
  ### [2.5.3](https://github.com/dynamic-labs/DynamicAuth/compare/v2.5.2...v2.5.3) (2024-09-02)
3
12
 
4
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/utils",
3
- "version": "2.5.3",
3
+ "version": "2.6.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -26,10 +26,10 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@dynamic-labs/sdk-api-core": "0.0.497",
29
+ "@dynamic-labs/sdk-api-core": "0.0.510",
30
30
  "tldts": "6.0.16",
31
- "@dynamic-labs/logger": "2.5.3",
32
- "@dynamic-labs/types": "2.5.3",
31
+ "@dynamic-labs/logger": "2.6.1",
32
+ "@dynamic-labs/types": "2.6.1",
33
33
  "buffer": "6.0.3",
34
34
  "stream": "0.0.2"
35
35
  },
package/src/index.cjs CHANGED
@@ -109,6 +109,7 @@ exports.isIPhone = isMobile.isIPhone;
109
109
  exports.isIPhone8OrEarlier = isMobile.isIPhone8OrEarlier;
110
110
  exports.isLegacySafari = isMobile.isLegacySafari;
111
111
  exports.isMobile = isMobile.isMobile;
112
+ exports.isSafariBrowser = isMobile.isSafariBrowser;
112
113
  exports.isSamsungBrowser = isMobile.isSamsungBrowser;
113
114
  exports.isWindows = isMobile.isWindows;
114
115
  exports.getItemAsync = localStorageAsync.getItemAsync;
package/src/index.js CHANGED
@@ -33,7 +33,7 @@ export { EmbeddedWalletException } from './errors/EmbeddedWalletException.js';
33
33
  export { MfaInvalidOtpError } from './errors/MfaInvalidOtpError.js';
34
34
  export { CancellablePromise } from './CancellablePromise/CancellablePromise.js';
35
35
  export { isFunction } from './isFunction/isFunction.js';
36
- export { getAndroidVersion, isAndroid, isIOS, isIPad, isIPhone, isIPhone8OrEarlier, isLegacySafari, isMobile, isSamsungBrowser, isWindows } from './isMobile.js';
36
+ export { getAndroidVersion, isAndroid, isIOS, isIPad, isIPhone, isIPhone8OrEarlier, isLegacySafari, isMobile, isSafariBrowser, isSamsungBrowser, isWindows } from './isMobile.js';
37
37
  export { getItemAsync, removeItemAsync, setItemAsync } from './localStorageAsync.js';
38
38
  export { bufferToBase64 } from './bufferToBase64.js';
39
39
  export { last } from './last.js';
package/src/isMobile.cjs CHANGED
@@ -59,6 +59,16 @@ const isLegacySafari = () => {
59
59
  const cssValue = 'aspect-ratio: 1 / 1';
60
60
  return !CSS.supports(cssValue);
61
61
  };
62
+ const isSafariBrowser = () => {
63
+ if (typeof window === 'undefined' || typeof navigator === 'undefined') {
64
+ return false;
65
+ }
66
+ const { userAgent } = navigator;
67
+ const isSafari = userAgent.includes('Safari') &&
68
+ !userAgent.includes('Chrome') &&
69
+ !userAgent.includes('Chromium');
70
+ return isSafari;
71
+ };
62
72
  const isSamsungBrowser = () => {
63
73
  if (typeof window === 'undefined' || typeof navigator === 'undefined') {
64
74
  return false;
@@ -142,5 +152,6 @@ exports.isIPhone = isIPhone;
142
152
  exports.isIPhone8OrEarlier = isIPhone8OrEarlier;
143
153
  exports.isLegacySafari = isLegacySafari;
144
154
  exports.isMobile = isMobile;
155
+ exports.isSafariBrowser = isSafariBrowser;
145
156
  exports.isSamsungBrowser = isSamsungBrowser;
146
157
  exports.isWindows = isWindows;
package/src/isMobile.d.ts CHANGED
@@ -13,6 +13,7 @@ export declare const isIPad: (maxTouchPointsOverride?: number) => boolean;
13
13
  export declare const isIOS: (maxTouchPointsOverride?: number) => boolean;
14
14
  export declare const isAndroid: () => boolean;
15
15
  export declare const isLegacySafari: () => boolean;
16
+ export declare const isSafariBrowser: () => boolean;
16
17
  export declare const isSamsungBrowser: () => boolean;
17
18
  export declare const isWindows: () => boolean;
18
19
  export declare const getAndroidVersion: () => number | undefined;
package/src/isMobile.js CHANGED
@@ -55,6 +55,16 @@ const isLegacySafari = () => {
55
55
  const cssValue = 'aspect-ratio: 1 / 1';
56
56
  return !CSS.supports(cssValue);
57
57
  };
58
+ const isSafariBrowser = () => {
59
+ if (typeof window === 'undefined' || typeof navigator === 'undefined') {
60
+ return false;
61
+ }
62
+ const { userAgent } = navigator;
63
+ const isSafari = userAgent.includes('Safari') &&
64
+ !userAgent.includes('Chrome') &&
65
+ !userAgent.includes('Chromium');
66
+ return isSafari;
67
+ };
58
68
  const isSamsungBrowser = () => {
59
69
  if (typeof window === 'undefined' || typeof navigator === 'undefined') {
60
70
  return false;
@@ -130,4 +140,4 @@ const getAndroidVersion = () => {
130
140
  return androidVersion;
131
141
  };
132
142
 
133
- export { getAndroidVersion, isAndroid, isIOS, isIPad, isIPhone, isIPhone8OrEarlier, isLegacySafari, isMobile, isSamsungBrowser, isWindows };
143
+ export { getAndroidVersion, isAndroid, isIOS, isIPad, isIPhone, isIPhone8OrEarlier, isLegacySafari, isMobile, isSafariBrowser, isSamsungBrowser, isWindows };