Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
achorein committed Jul 9, 2024
1 parent e00df59 commit b41a90a
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 21 deletions.
5 changes: 4 additions & 1 deletion example/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@
"postinstall": "patch-package"
},
"dependencies": {
"@expo/metro-runtime": "~3.2.1",
"expo": "~51.0.17",
"expo-dev-client": "~4.0.19",
"expo-splash-screen": "~0.27.5",
"expo-status-bar": "~1.12.1",
"expo-updates": "~0.25.18",
"patch-package": "^8.0.0",
"react": "18.2.0",
"react-native": "0.74.3"
"react-native": "0.74.3",
"react-dom": "18.2.0",
"react-native-web": "~0.19.10"
},
"devDependencies": {
"@babel/core": "^7.24.0",
Expand Down
85 changes: 83 additions & 2 deletions example/basic/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,13 @@
dependencies:
regenerator-runtime "^0.14.0"

"@babel/runtime@^7.18.6":
version "7.24.7"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.7.tgz#f4f0d5530e8dbdf59b3451b9b3e594b6ba082e12"
integrity sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==
dependencies:
regenerator-runtime "^0.14.0"

"@babel/template@^7.0.0", "@babel/template@^7.22.15", "@babel/template@^7.24.0":
version "7.24.0"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.24.0.tgz#c6a524aa93a4a05d66aaf31654258fae69d87d50"
Expand Down Expand Up @@ -1123,6 +1130,11 @@
postcss "~8.4.32"
resolve-from "^5.0.0"

"@expo/metro-runtime@~3.2.1":
version "3.2.1"
resolved "https://registry.yarnpkg.com/@expo/metro-runtime/-/metro-runtime-3.2.1.tgz#bbab2ca9d0c8d256172eb4688123af6be67c7674"
integrity sha512-L7xNo5SmK+rcuXDm/+VBBImpA7FZsVB+m/rNr3fNl5or+1+yrZe99ViF7LZ8DOoVqAqcb4aCAXvGrP2JNYo1/Q==

"@expo/osascript@^2.0.31":
version "2.1.2"
resolved "https://registry.yarnpkg.com/@expo/osascript/-/osascript-2.1.2.tgz#ceb7faf260e28a9cd84b834a42d81a18f429cf93"
Expand Down Expand Up @@ -1729,7 +1741,7 @@
resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.74.84.tgz#4764d59775c17a6ed193509cb01ae2f42dd5c045"
integrity sha512-Y5W6x8cC5RuakUcTVUFNAIhUZ/tYpuqHZlRBoAuakrTwVuoNHXfQki8lj1KsYU7rW6e3VWgdEx33AfOQpdNp6A==

"@react-native/[email protected]":
"@react-native/[email protected]", "@react-native/normalize-colors@^0.74.1":
version "0.74.85"
resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.74.85.tgz#62bcb9ab1b10b822ca0278fdfdf23d3b18e125da"
integrity sha512-pcE4i0X7y3hsAE0SpIl7t6dUc0B0NZLd1yv7ssm4FrLhWG+CGyIq4eFDXpmPU1XHmL5PPySxTAjEMiwv6tAmOw==
Expand Down Expand Up @@ -2914,6 +2926,13 @@ crypto-random-string@^2.0.0:
resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5"
integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==

css-in-js-utils@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/css-in-js-utils/-/css-in-js-utils-3.1.0.tgz#640ae6a33646d401fc720c54fc61c42cd76ae2bb"
integrity sha512-fJAcud6B3rRu+KHYk+Bwf+WFL2MDCJJ1XG9x137tJQ0xYxor7XziQtuGFbWNdqrvF4Tk26O3H73nfVqXt/fW1A==
dependencies:
hyphenate-style-name "^1.0.3"

csstype@^3.0.2:
version "3.1.3"
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81"
Expand Down Expand Up @@ -3786,6 +3805,11 @@ fast-levenshtein@^2.0.6:
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==

fast-loops@^1.1.3:
version "1.1.4"
resolved "https://registry.yarnpkg.com/fast-loops/-/fast-loops-1.1.4.tgz#61bc77d518c0af5073a638c6d9d5c7683f069ce2"
integrity sha512-8dbd3XWoKCTms18ize6JmQF1SFnnfj5s0B7rRry22EofgMu7B6LKHVh+XfFqFGsqnbH54xgeO83PzpKI+ODhlg==

fast-xml-parser@^4.0.12, fast-xml-parser@^4.2.4:
version "4.3.6"
resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.3.6.tgz#190f9d99097f0c8f2d3a0e681a10404afca052ff"
Expand Down Expand Up @@ -3819,7 +3843,7 @@ fbjs-css-vars@^1.0.0:
resolved "https://registry.yarnpkg.com/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz#216551136ae02fe255932c3ec8775f18e2c078b8"
integrity sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==

fbjs@^3.0.0:
fbjs@^3.0.0, fbjs@^3.0.4:
version "3.0.5"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-3.0.5.tgz#aa0edb7d5caa6340011790bd9249dbef8a81128d"
integrity sha512-ztsSx77JBtkuMrEypfhgc3cI0+0h+svqeie7xHbh1k/IKdcydnvadp/mUaGgjAOXQmQSxsqgaRhS3q9fy+1kxg==
Expand Down Expand Up @@ -4338,6 +4362,11 @@ human-signals@^2.1.0:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==

hyphenate-style-name@^1.0.3:
version "1.1.0"
resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.1.0.tgz#1797bf50369588b47b72ca6d5e65374607cf4436"
integrity sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw==

ieee754@^1.1.13:
version "1.2.1"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
Expand Down Expand Up @@ -4399,6 +4428,14 @@ ini@~1.3.0:
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==

inline-style-prefixer@^6.0.1:
version "6.0.4"
resolved "https://registry.yarnpkg.com/inline-style-prefixer/-/inline-style-prefixer-6.0.4.tgz#4290ed453ab0e4441583284ad86e41ad88384f44"
integrity sha512-FwXmZC2zbeeS7NzGjJ6pAiqRhXR0ugUShSNb6GApMl6da0/XGc4MOJsoWAywia52EEWbXNSy0pzkwz/+Y+swSg==
dependencies:
css-in-js-utils "^3.1.0"
fast-loops "^1.1.3"

[email protected]:
version "4.3.0"
resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-4.3.0.tgz#845452baad9d2ca3b69c635a137acb9a0dad0907"
Expand Down Expand Up @@ -5249,6 +5286,11 @@ memoize-one@^5.0.0:
resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.2.1.tgz#8337aa3c4335581839ec01c3d594090cebe8f00e"
integrity sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==

memoize-one@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-6.0.0.tgz#b2591b871ed82948aee4727dc6abceeeac8c1045"
integrity sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==

memory-cache@~0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/memory-cache/-/memory-cache-0.2.0.tgz#7890b01d52c00c8ebc9d533e1f8eb17e3034871a"
Expand Down Expand Up @@ -6149,6 +6191,11 @@ possible-typed-array-names@^1.0.0:
resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f"
integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==

postcss-value-parser@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514"
integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==

postcss@~8.4.32:
version "8.4.38"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.38.tgz#b387d533baf2054288e337066d81c6bee9db9e0e"
Expand Down Expand Up @@ -6308,6 +6355,14 @@ react-devtools-core@^5.0.0:
shell-quote "^1.6.1"
ws "^7"

[email protected]:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d"
integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==
dependencies:
loose-envify "^1.1.0"
scheduler "^0.23.0"

"react-is@^16.12.0 || ^17.0.0 || ^18.0.0", react-is@^18.0.0:
version "18.3.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e"
Expand All @@ -6323,6 +6378,20 @@ react-is@^17.0.1:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

react-native-web@~0.19.10:
version "0.19.12"
resolved "https://registry.yarnpkg.com/react-native-web/-/react-native-web-0.19.12.tgz#30d1fd70bdff7886f43c0c2698629d830fade6bc"
integrity sha512-o2T0oztoVDQjztt4YksO9S1XRjoH/AqcSvifgWLrPJgGVbMWsfhILgl6lfUdEamVZzZSVV/2gqDVMAk/qq7mZw==
dependencies:
"@babel/runtime" "^7.18.6"
"@react-native/normalize-colors" "^0.74.1"
fbjs "^3.0.4"
inline-style-prefixer "^6.0.1"
memoize-one "^6.0.0"
nullthrows "^1.1.1"
postcss-value-parser "^4.2.0"
styleq "^0.1.3"

[email protected]:
version "0.74.3"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.74.3.tgz#eef32cd10afb1f4b26f75b79eefd6b220c63953c"
Expand Down Expand Up @@ -6673,6 +6742,13 @@ [email protected]:
dependencies:
loose-envify "^1.1.0"

scheduler@^0.23.0:
version "0.23.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3"
integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==
dependencies:
loose-envify "^1.1.0"

selfsigned@^2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-2.4.1.tgz#560d90565442a3ed35b674034cec4e95dceb4ae0"
Expand Down Expand Up @@ -7092,6 +7168,11 @@ structured-headers@^0.4.1:
resolved "https://registry.yarnpkg.com/structured-headers/-/structured-headers-0.4.1.tgz#77abd9410622c6926261c09b9d16cf10592694d1"
integrity sha512-0MP/Cxx5SzeeZ10p/bZI0S6MpgD+yxAhi1BOQ34jgnMXsCq3j1t6tQnZu+KdlL7dvJTLT3g9xN8tl10TqgFMcg==

styleq@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/styleq/-/styleq-0.1.3.tgz#8efb2892debd51ce7b31dc09c227ad920decab71"
integrity sha512-3ZUifmCDCQanjeej1f6kyl/BeP/Vae5EYkQ9iJfUm/QwZvlgnZzyflqAsAWYURdtea8Vkvswu2GrC57h3qffcA==

[email protected]:
version "3.34.0"
resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.34.0.tgz#1e0e2d8fcf07f8b9c3569067d92fbd8690fb576f"
Expand Down
33 changes: 18 additions & 15 deletions src/ExpoShareIntentModule.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
requireNativeModule,
NativeModulesProxy,
requireOptionalNativeModule,
EventEmitter,
Subscription,
} from "expo-modules-core";
Expand All @@ -14,39 +13,43 @@ import { getShareExtensionKey } from "./utils";
// Import the native module. it will be resolved on native platforms to ExpoShareIntentModule.ts
// It loads the native module object from the JSI or falls back to
// the bridge module (from NativeModulesProxy) if the remote debugger is on.
const ExpoShareIntentModule = requireNativeModule("ExpoShareIntentModule");
const ExpoShareIntentModule = requireOptionalNativeModule(
"ExpoShareIntentModule",
);
export default ExpoShareIntentModule;

export function getShareIntent(url = ""): string {
return ExpoShareIntentModule.getShareIntent(url);
return ExpoShareIntentModule?.getShareIntent(url);
}

export function clearShareIntent(key: string) {
return ExpoShareIntentModule.clearShareIntent(key ?? getShareExtensionKey());
return ExpoShareIntentModule?.clearShareIntent(key ?? getShareExtensionKey());
}

export function hasShareIntent(key: string): boolean {
return ExpoShareIntentModule.hasShareIntent(key ?? getShareExtensionKey());
return ExpoShareIntentModule?.hasShareIntent(key ?? getShareExtensionKey());
}

const emitter = new EventEmitter(
ExpoShareIntentModule ?? NativeModulesProxy.ExpoShareIntentModule,
);
const emitter = ExpoShareIntentModule
? new EventEmitter(ExpoShareIntentModule)
: null;

export function addErrorListener(
listener: (event: ChangeEventPayload) => void,
): Subscription {
return emitter.addListener<ChangeEventPayload>("onError", listener);
): Subscription | null {
return emitter?.addListener<ChangeEventPayload>("onError", listener) || null;
}

export function addChangeListener(
listener: (event: ChangeEventPayload) => void,
): Subscription {
return emitter.addListener<ChangeEventPayload>("onChange", listener);
): Subscription | null {
return emitter?.addListener<ChangeEventPayload>("onChange", listener) || null;
}

export function addStateListener(
listener: (event: StateEventPayload) => void,
): Subscription {
return emitter.addListener<StateEventPayload>("onStateChange", listener);
): Subscription | null {
return (
emitter?.addListener<StateEventPayload>("onStateChange", listener) || null
);
}
6 changes: 3 additions & 3 deletions src/useShareIntent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const SHAREINTENT_DEFAULTVALUE: ShareIntent = {
export const SHAREINTENT_OPTIONS_DEFAULT: ShareIntentOptions = {
debug: false,
resetOnBackground: true,
disabled: false,
disabled: Platform.OS === "web",
};

// const IOS_SHARE_TYPE_MAPPING = {
Expand Down Expand Up @@ -202,8 +202,8 @@ export default function useShareIntent(
});
setIsReady(true);
return () => {
changeSubscription.remove();
errorSubscription.remove();
changeSubscription?.remove();
errorSubscription?.remove();
};
}, [options.disabled]);

Expand Down

0 comments on commit b41a90a

Please sign in to comment.