@react-navigation/native 6.0.12 → 6.0.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.
Files changed (51) hide show
  1. package/lib/commonjs/Link.js.map +1 -1
  2. package/lib/commonjs/LinkingContext.js.map +1 -1
  3. package/lib/commonjs/NavigationContainer.js +1 -1
  4. package/lib/commonjs/NavigationContainer.js.map +1 -1
  5. package/lib/commonjs/ServerContainer.js.map +1 -1
  6. package/lib/commonjs/ServerContext.js.map +1 -1
  7. package/lib/commonjs/createMemoryHistory.js.map +1 -1
  8. package/lib/commonjs/extractPathFromURL.js.map +1 -1
  9. package/lib/commonjs/index.js.map +1 -1
  10. package/lib/commonjs/theming/DarkTheme.js.map +1 -1
  11. package/lib/commonjs/theming/DefaultTheme.js.map +1 -1
  12. package/lib/commonjs/theming/ThemeContext.js.map +1 -1
  13. package/lib/commonjs/theming/ThemeProvider.js.map +1 -1
  14. package/lib/commonjs/theming/useTheme.js.map +1 -1
  15. package/lib/commonjs/types.js.map +1 -1
  16. package/lib/commonjs/useBackButton.js.map +1 -1
  17. package/lib/commonjs/useDocumentTitle.js.map +1 -1
  18. package/lib/commonjs/useDocumentTitle.native.js.map +1 -1
  19. package/lib/commonjs/useLinkBuilder.js.map +1 -1
  20. package/lib/commonjs/useLinkProps.js.map +1 -1
  21. package/lib/commonjs/useLinkTo.js.map +1 -1
  22. package/lib/commonjs/useLinking.js.map +1 -1
  23. package/lib/commonjs/useLinking.native.js.map +1 -1
  24. package/lib/commonjs/useScrollToTop.js.map +1 -1
  25. package/lib/commonjs/useThenable.js.map +1 -1
  26. package/lib/module/Link.js.map +1 -1
  27. package/lib/module/LinkingContext.js.map +1 -1
  28. package/lib/module/NavigationContainer.js +1 -1
  29. package/lib/module/NavigationContainer.js.map +1 -1
  30. package/lib/module/ServerContainer.js.map +1 -1
  31. package/lib/module/ServerContext.js.map +1 -1
  32. package/lib/module/createMemoryHistory.js.map +1 -1
  33. package/lib/module/extractPathFromURL.js.map +1 -1
  34. package/lib/module/index.js.map +1 -1
  35. package/lib/module/theming/DarkTheme.js.map +1 -1
  36. package/lib/module/theming/DefaultTheme.js.map +1 -1
  37. package/lib/module/theming/ThemeContext.js.map +1 -1
  38. package/lib/module/theming/ThemeProvider.js.map +1 -1
  39. package/lib/module/theming/useTheme.js.map +1 -1
  40. package/lib/module/types.js.map +1 -1
  41. package/lib/module/useBackButton.js.map +1 -1
  42. package/lib/module/useDocumentTitle.js.map +1 -1
  43. package/lib/module/useDocumentTitle.native.js.map +1 -1
  44. package/lib/module/useLinkBuilder.js.map +1 -1
  45. package/lib/module/useLinkProps.js.map +1 -1
  46. package/lib/module/useLinkTo.js.map +1 -1
  47. package/lib/module/useLinking.js.map +1 -1
  48. package/lib/module/useLinking.native.js.map +1 -1
  49. package/lib/module/useScrollToTop.js.map +1 -1
  50. package/lib/module/useThenable.js.map +1 -1
  51. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"sources":["useScrollToTop.tsx"],"names":["getScrollableNode","ref","current","getScrollResponder","getNode","useScrollToTop","navigation","route","React","useEffect","getState","type","getParent","unsubscribe","addListener","e","isFocused","isFirst","routes","key","requestAnimationFrame","scrollable","defaultPrevented","scrollToTop","scrollTo","x","y","animated","scrollToOffset","offset","scrollResponderScrollTo"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAeA,SAASA,iBAAT,CAA2BC,GAA3B,EAAoE;AAClE,MAAIA,GAAG,CAACC,OAAJ,IAAe,IAAnB,EAAyB;AACvB,WAAO,IAAP;AACD;;AAED,MACE,iBAAiBD,GAAG,CAACC,OAArB,IACA,cAAcD,GAAG,CAACC,OADlB,IAEA,oBAAoBD,GAAG,CAACC,OAFxB,IAGA,6BAA6BD,GAAG,CAACC,OAJnC,EAKE;AACA;AACA,WAAOD,GAAG,CAACC,OAAX;AACD,GARD,MAQO,IAAI,wBAAwBD,GAAG,CAACC,OAAhC,EAAyC;AAC9C;AACA;AACA,WAAOD,GAAG,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YAAAA,UAAU,CAACG,QAAX,CAAoB;AAAEC,cAAAA,CAAC,EAAE,CAAL;AAAQC,cAAAA,CAAC,EAAE,CAAX;AAAcC,cAAAA,QAAQ,EAAE;AAAxB,aAApB;AACD,WAFM,MAEA,IAAI,oBAAoBN,UAAxB,EAAoC;AACzCA,YAAAA,UAAU,CAACO,cAAX,CAA0B;AAAEC,cAAAA,MAAM,EAAE,CAAV;AAAaF,cAAAA,QAAQ,EAAE;AAAvB,aAA1B;AACD,WAFM,MAEA,IAAI,6BAA6BN,UAAjC,EAA6C;AAClDA,YAAAA,UAAU,CAACS,uBAAX,CAAmC;AAAEJ,cAAAA,CAAC,EAAE,CAAL;AAAQC,cAAAA,QAAQ,EAAE;AAAlB,aAAnC;AACD;AACF;AACF,OAdoB,CAArB;AAeD,KAhCiB,CAApB;AAmCA,WAAOd,WAAP;AACD,GAjDD,EAiDG,CAACP,UAAD,EAAaL,GAAb,EAAkBM,KAAK,CAACY,GAAxB,CAjDH;AAkDD","sourcesContent":["import { EventArg, useNavigation, useRoute } from '@react-navigation/core';\nimport * as React from 'react';\n\ntype ScrollOptions = { x?: number; y?: number; animated?: boolean };\n\ntype ScrollableView =\n | { scrollToTop(): void }\n | { scrollTo(options: ScrollOptions): void }\n | { scrollToOffset(options: { offset?: number; animated?: boolean }): void }\n | { scrollResponderScrollTo(options: ScrollOptions): void };\n\ntype ScrollableWrapper =\n | { getScrollResponder(): React.ReactNode }\n | { getNode(): ScrollableView }\n | ScrollableView;\n\nfunction getScrollableNode(ref: React.RefObject<ScrollableWrapper>) {\n if (ref.current == null) {\n return null;\n }\n\n if (\n 'scrollToTop' in ref.current ||\n 'scrollTo' in ref.current ||\n 'scrollToOffset' in ref.current ||\n 'scrollResponderScrollTo' in ref.current\n ) {\n // This is already a scrollable node.\n return ref.current;\n } else if ('getScrollResponder' in ref.current) {\n // If the view is a wrapper like FlatList, SectionList etc.\n // We need to use `getScrollResponder` to get access to the scroll responder\n return ref.current.getScrollResponder();\n } else if ('getNode' in ref.current) {\n // When a `ScrollView` is wraped in `Animated.createAnimatedComponent`\n // we need to use `getNode` to get the ref to the actual scrollview.\n // Note that `getNode` is deprecated in newer versions of react-native\n // this is why we check if we already have a scrollable node above.\n return ref.current.getNode();\n } else {\n return ref.current;\n }\n}\n\nexport default function useScrollToTop(\n ref: React.RefObject<ScrollableWrapper>\n) {\n const navigation = useNavigation();\n const route = useRoute();\n\n React.useEffect(() => {\n let current = navigation;\n\n // The screen might be inside another navigator such as stack nested in tabs\n // We need to find the closest tab navigator and add the listener there\n while (current && current.getState().type !== 'tab') {\n current = current.getParent();\n }\n\n if (!current) {\n return;\n }\n\n const unsubscribe = current.addListener(\n // We don't wanna import tab types here to avoid extra deps\n // in addition, there are multiple tab implementations\n // @ts-expect-error\n 'tabPress',\n (e: EventArg<'tabPress', true>) => {\n // We should scroll to top only when the screen is focused\n const isFocused = navigation.isFocused();\n\n // In a nested stack navigator, tab press resets the stack to first screen\n // So we should scroll to top only when we are on first screen\n const isFirst =\n navigation === current ||\n navigation.getState().routes[0].key === route.key;\n\n // Run the operation in the next frame so we're sure all listeners have been run\n // This is necessary to know if preventDefault() has been called\n requestAnimationFrame(() => {\n const scrollable = getScrollableNode(ref) as ScrollableWrapper;\n\n if (isFocused && isFirst && scrollable && !e.defaultPrevented) {\n if ('scrollToTop' in scrollable) {\n scrollable.scrollToTop();\n } else if ('scrollTo' in scrollable) {\n scrollable.scrollTo({ x: 0, y: 0, animated: true });\n } else if ('scrollToOffset' in scrollable) {\n scrollable.scrollToOffset({ offset: 0, animated: true });\n } else if ('scrollResponderScrollTo' in scrollable) {\n scrollable.scrollResponderScrollTo({ y: 0, animated: true });\n }\n }\n });\n }\n );\n\n return unsubscribe;\n }, [navigation, ref, route.key]);\n}\n"]}
1
+ {"version":3,"names":["getScrollableNode","ref","current","getScrollResponder","getNode","useScrollToTop","navigation","useNavigation","route","useRoute","React","useEffect","getState","type","getParent","unsubscribe","addListener","e","isFocused","isFirst","routes","key","requestAnimationFrame","scrollable","defaultPrevented","scrollToTop","scrollTo","x","y","animated","scrollToOffset","offset","scrollResponderScrollTo"],"sources":["useScrollToTop.tsx"],"sourcesContent":["import { EventArg, useNavigation, useRoute } from '@react-navigation/core';\nimport * as React from 'react';\n\ntype ScrollOptions = { x?: number; y?: number; animated?: boolean };\n\ntype ScrollableView =\n | { scrollToTop(): void }\n | { scrollTo(options: ScrollOptions): void }\n | { scrollToOffset(options: { offset?: number; animated?: boolean }): void }\n | { scrollResponderScrollTo(options: ScrollOptions): void };\n\ntype ScrollableWrapper =\n | { getScrollResponder(): React.ReactNode }\n | { getNode(): ScrollableView }\n | ScrollableView;\n\nfunction getScrollableNode(ref: React.RefObject<ScrollableWrapper>) {\n if (ref.current == null) {\n return null;\n }\n\n if (\n 'scrollToTop' in ref.current ||\n 'scrollTo' in ref.current ||\n 'scrollToOffset' in ref.current ||\n 'scrollResponderScrollTo' in ref.current\n ) {\n // This is already a scrollable node.\n return ref.current;\n } else if ('getScrollResponder' in ref.current) {\n // If the view is a wrapper like FlatList, SectionList etc.\n // We need to use `getScrollResponder` to get access to the scroll responder\n return ref.current.getScrollResponder();\n } else if ('getNode' in ref.current) {\n // When a `ScrollView` is wraped in `Animated.createAnimatedComponent`\n // we need to use `getNode` to get the ref to the actual scrollview.\n // Note that `getNode` is deprecated in newer versions of react-native\n // this is why we check if we already have a scrollable node above.\n return ref.current.getNode();\n } else {\n return ref.current;\n }\n}\n\nexport default function useScrollToTop(\n ref: React.RefObject<ScrollableWrapper>\n) {\n const navigation = useNavigation();\n const route = useRoute();\n\n React.useEffect(() => {\n let current = navigation;\n\n // The screen might be inside another navigator such as stack nested in tabs\n // We need to find the closest tab navigator and add the listener there\n while (current && current.getState().type !== 'tab') {\n current = current.getParent();\n }\n\n if (!current) {\n return;\n }\n\n const unsubscribe = current.addListener(\n // We don't wanna import tab types here to avoid extra deps\n // in addition, there are multiple tab implementations\n // @ts-expect-error\n 'tabPress',\n (e: EventArg<'tabPress', true>) => {\n // We should scroll to top only when the screen is focused\n const isFocused = navigation.isFocused();\n\n // In a nested stack navigator, tab press resets the stack to first screen\n // So we should scroll to top only when we are on first screen\n const isFirst =\n navigation === current ||\n navigation.getState().routes[0].key === route.key;\n\n // Run the operation in the next frame so we're sure all listeners have been run\n // This is necessary to know if preventDefault() has been called\n requestAnimationFrame(() => {\n const scrollable = getScrollableNode(ref) as ScrollableWrapper;\n\n if (isFocused && isFirst && scrollable && !e.defaultPrevented) {\n if ('scrollToTop' in scrollable) {\n scrollable.scrollToTop();\n } else if ('scrollTo' in scrollable) {\n scrollable.scrollTo({ x: 0, y: 0, animated: true });\n } else if ('scrollToOffset' in scrollable) {\n scrollable.scrollToOffset({ offset: 0, animated: true });\n } else if ('scrollResponderScrollTo' in scrollable) {\n scrollable.scrollResponderScrollTo({ y: 0, animated: true });\n }\n }\n });\n }\n );\n\n return unsubscribe;\n }, [navigation, ref, route.key]);\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAeA,SAASA,iBAAT,CAA2BC,GAA3B,EAAoE;EAClE,IAAIA,GAAG,CAACC,OAAJ,IAAe,IAAnB,EAAyB;IACvB,OAAO,IAAP;EACD;;EAED,IACE,iBAAiBD,GAAG,CAACC,OAArB,IACA,cAAcD,GAAG,CAACC,OADlB,IAEA,oBAAoBD,GAAG,CAACC,OAFxB,IAGA,6BAA6BD,GAAG,CAACC,OAJnC,EAKE;IACA;IACA,OAAOD,GAAG,CAACC,OAAX;EACD,CARD,MAQO,IAAI,wBAAwBD,GAAG,CAACC,OAAhC,EAAyC;IAC9C;IACA;IACA,OAAOD,GAAG,CAACC,OAAJ,CAAYC,kBAAZ,EAAP;EACD,CAJM,MAIA,IAAI,aAAaF,GAAG,CAACC,OAArB,EAA8B;IACnC;IACA;IACA;IACA;IACA,OAAOD,GAAG,CAACC,OAAJ,CAAYE,OAAZ,EAAP;EACD,CANM,MAMA;IACL,OAAOH,GAAG,CAACC,OAAX;EACD;AACF;;AAEc,SAASG,c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YAAvB,CAA1B;UACD,CAFM,MAEA,IAAI,6BAA6BN,UAAjC,EAA6C;YAClDA,UAAU,CAACS,uBAAX,CAAmC;cAAEJ,CAAC,EAAE,CAAL;cAAQC,QAAQ,EAAE;YAAlB,CAAnC;UACD;QACF;MACF,CAdoB,CAArB;IAeD,CAhCiB,CAApB;IAmCA,OAAOd,WAAP;EACD,CAjDD,EAiDG,CAACT,UAAD,EAAaL,GAAb,EAAkBO,KAAK,CAACa,GAAxB,CAjDH;AAkDD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useThenable.tsx"],"names":["useThenable","create","promise","React","useState","initialState","undefined","then","result","state","setState","resolved","useEffect","cancelled","resolve"],"mappings":";;;;;;;AAAA;;;;;;AAEe,SAASA,WAAT,CAAwBC,MAAxB,EAAsD;AACnE,QAAM,CAACC,OAAD,IAAYC,KAAK,CAACC,QAAN,CAAeH,MAAf,CAAlB;AAEA,MAAII,YAAsC,GAAG,CAAC,KAAD,EAAQC,SAAR,CAA7C,CAHmE,CAKnE;;AACAJ,EAAAA,OAAO,CAACK,IAAR,CAAcC,MAAD,IAAY;AACvBH,IAAAA,YAAY,GAAG,CAAC,IAAD,EAAOG,MAAP,CAAf;AACD,GAFD;AAIA,QAAM,CAACC,KAAD,EAAQC,QAAR,IAAoBP,KAAK,CAACC,QAAN,CAAeC,YAAf,CAA1B;AACA,QAAM,CAACM,QAAD,IAAaF,KAAnB;AAEAN,EAAAA,KAAK,CAACS,SAAN,CAAgB,MAAM;AACpB,QAAIC,SAAS,GAAG,KAAhB;;AAEA,UAAMC,OAAO,GAAG,YAAY;AAC1B,UAAIN,MAAJ;;AAEA,UAAI;AACFA,QAAAA,MAAM,GAAG,MAAMN,OAAf;AACD,OAFD,SAEU;AACR,YAAI,CAACW,SAAL,EAAgB;AACdH,UAAAA,QAAQ,CAAC,CAAC,IAAD,EAAOF,MAAP,CAAD,CAAR;AACD;AACF;AACF,KAVD;;AAYA,QAAI,CAACG,QAAL,EAAe;AACbG,MAAAA,OAAO;AACR;;AAED,WAAO,MAAM;AACXD,MAAAA,SAAS,GAAG,IAAZ;AACD,KAFD;AAGD,GAtBD,EAsBG,CAACX,OAAD,EAAUS,QAAV,CAtBH;AAwBA,SAAOF,KAAP;AACD","sourcesContent":["import * as React from 'react';\n\nexport default function useThenable<T>(create: () => PromiseLike<T>) {\n const [promise] = React.useState(create);\n\n let initialState: [boolean, T | undefined] = [false, undefined];\n\n // Check if our thenable is synchronous\n promise.then((result) => {\n initialState = [true, result];\n });\n\n const [state, setState] = React.useState(initialState);\n const [resolved] = state;\n\n React.useEffect(() => {\n let cancelled = false;\n\n const resolve = async () => {\n let result;\n\n try {\n result = await promise;\n } finally {\n if (!cancelled) {\n setState([true, result]);\n }\n }\n };\n\n if (!resolved) {\n resolve();\n }\n\n return () => {\n cancelled = true;\n };\n }, [promise, resolved]);\n\n return state;\n}\n"]}
1
+ {"version":3,"names":["useThenable","create","promise","React","useState","initialState","undefined","then","result","state","setState","resolved","useEffect","cancelled","resolve"],"sources":["useThenable.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport default function useThenable<T>(create: () => PromiseLike<T>) {\n const [promise] = React.useState(create);\n\n let initialState: [boolean, T | undefined] = [false, undefined];\n\n // Check if our thenable is synchronous\n promise.then((result) => {\n initialState = [true, result];\n });\n\n const [state, setState] = React.useState(initialState);\n const [resolved] = state;\n\n React.useEffect(() => {\n let cancelled = false;\n\n const resolve = async () => {\n let result;\n\n try {\n result = await promise;\n } finally {\n if (!cancelled) {\n setState([true, result]);\n }\n }\n };\n\n if (!resolved) {\n resolve();\n }\n\n return () => {\n cancelled = true;\n };\n }, [promise, resolved]);\n\n return state;\n}\n"],"mappings":";;;;;;;AAAA;;;;;;AAEe,SAASA,WAAT,CAAwBC,MAAxB,EAAsD;EACnE,MAAM,CAACC,OAAD,IAAYC,KAAK,CAACC,QAAN,CAAeH,MAAf,CAAlB;EAEA,IAAII,YAAsC,GAAG,CAAC,KAAD,EAAQC,SAAR,CAA7C,CAHmE,CAKnE;;EACAJ,OAAO,CAACK,IAAR,CAAcC,MAAD,IAAY;IACvBH,YAAY,GAAG,CAAC,IAAD,EAAOG,MAAP,CAAf;EACD,CAFD;EAIA,MAAM,CAACC,KAAD,EAAQC,QAAR,IAAoBP,KAAK,CAACC,QAAN,CAAeC,YAAf,CAA1B;EACA,MAAM,CAACM,QAAD,IAAaF,KAAnB;EAEAN,KAAK,CAACS,SAAN,CAAgB,MAAM;IACpB,IAAIC,SAAS,GAAG,KAAhB;;IAEA,MAAMC,OAAO,GAAG,YAAY;MAC1B,IAAIN,MAAJ;;MAEA,IAAI;QACFA,MAAM,GAAG,MAAMN,OAAf;MACD,CAFD,SAEU;QACR,IAAI,CAACW,SAAL,EAAgB;UACdH,QAAQ,CAAC,CAAC,IAAD,EAAOF,MAAP,CAAD,CAAR;QACD;MACF;IACF,CAVD;;IAYA,IAAI,CAACG,QAAL,EAAe;MACbG,OAAO;IACR;;IAED,OAAO,MAAM;MACXD,SAAS,GAAG,IAAZ;IACD,CAFD;EAGD,CAtBD,EAsBG,CAACX,OAAD,EAAUS,QAAV,CAtBH;EAwBA,OAAOF,KAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["Link.tsx"],"names":["React","Platform","Text","useLinkProps","Link","to","action","rest","props","onPress","e","createElement","select","web","onClick","default"],"mappings":"AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAAgCC,QAAhC,EAA0CC,IAA1C,QAAiE,cAAjE;AAEA,OAAOC,YAAP,MAAyB,gBAAzB;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,IAAT,OAIM;AAAA,MAJyD;AAC5EC,IAAAA,EAD4E;AAE5EC,IAAAA,MAF4E;AAG5E,OAAGC;AAHyE,GAIzD;AACnB,QAAMC,KAAK,GAAGL,YAAY,CAAY;AAAEE,IAAAA,EAAF;AAAMC,IAAAA;AAAN,GAAZ,CAA1B;;AAEA,QAAMG,OAAO,GACXC,CADc,IAEX;AACH,QAAI,aAAaH,IAAjB,EAAuB;AAAA;;AACrB,uBAAAA,IAAI,CAACE,OAAL,qEAAAF,IAAI,EAAWG,CAAX,CAAJ;AACD;;AAEDF,IAAAA,KAAK,CAACC,OAAN,CAAcC,CAAd;AACD,GARD;;AAUA,sBAAOV,KAAK,CAACW,aAAN,CAAoBT,IAApB,EAA0B,EAC/B,GAAGM,KAD4B;AAE/B,OAAGD,IAF4B;AAG/B,OAAGN,QAAQ,CAACW,MAAT,CAAgB;AACjBC,MAAAA,GAAG,EAAE;AAAEC,QAAAA,OAAO,EAAEL;AAAX,OADY;AAEjBM,MAAAA,OAAO,EAAE;AAAEN,QAAAA;AAAF;AAFQ,KAAhB;AAH4B,GAA1B,CAAP;AAQD","sourcesContent":["import type { NavigationAction } from '@react-navigation/core';\nimport * as React from 'react';\nimport { GestureResponderEvent, Platform, Text, TextProps } from 'react-native';\n\nimport useLinkProps from './useLinkProps';\nimport type { To } from './useLinkTo';\n\ntype Props<ParamList extends ReactNavigation.RootParamList> = {\n to: To<ParamList>;\n action?: NavigationAction;\n target?: string;\n onPress?: (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => void;\n} & (TextProps & { children: React.ReactNode });\n\n/**\n * Component to render link to another screen using a path.\n * Uses an anchor tag on the web.\n *\n * @param props.to Absolute path to screen (e.g. `/feeds/hot`).\n * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.\n * @param props.children Child elements to render the content.\n */\nexport default function Link<ParamList extends ReactNavigation.RootParamList>({\n to,\n action,\n ...rest\n}: Props<ParamList>) {\n const props = useLinkProps<ParamList>({ to, action });\n\n const onPress = (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => {\n if ('onPress' in rest) {\n rest.onPress?.(e);\n }\n\n props.onPress(e);\n };\n\n return React.createElement(Text, {\n ...props,\n ...rest,\n ...Platform.select({\n web: { onClick: onPress } as any,\n default: { onPress },\n }),\n });\n}\n"]}
1
+ {"version":3,"names":["React","Platform","Text","useLinkProps","Link","to","action","rest","props","onPress","e","createElement","select","web","onClick","default"],"sources":["Link.tsx"],"sourcesContent":["import type { NavigationAction } from '@react-navigation/core';\nimport * as React from 'react';\nimport { GestureResponderEvent, Platform, Text, TextProps } from 'react-native';\n\nimport useLinkProps from './useLinkProps';\nimport type { To } from './useLinkTo';\n\ntype Props<ParamList extends ReactNavigation.RootParamList> = {\n to: To<ParamList>;\n action?: NavigationAction;\n target?: string;\n onPress?: (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => void;\n} & (TextProps & { children: React.ReactNode });\n\n/**\n * Component to render link to another screen using a path.\n * Uses an anchor tag on the web.\n *\n * @param props.to Absolute path to screen (e.g. `/feeds/hot`).\n * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.\n * @param props.children Child elements to render the content.\n */\nexport default function Link<ParamList extends ReactNavigation.RootParamList>({\n to,\n action,\n ...rest\n}: Props<ParamList>) {\n const props = useLinkProps<ParamList>({ to, action });\n\n const onPress = (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => {\n if ('onPress' in rest) {\n rest.onPress?.(e);\n }\n\n props.onPress(e);\n };\n\n return React.createElement(Text, {\n ...props,\n ...rest,\n ...Platform.select({\n web: { onClick: onPress } as any,\n default: { onPress },\n }),\n });\n}\n"],"mappings":"AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAAgCC,QAAhC,EAA0CC,IAA1C,QAAiE,cAAjE;AAEA,OAAOC,YAAP,MAAyB,gBAAzB;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,IAAT,OAIM;EAAA,IAJyD;IAC5EC,EAD4E;IAE5EC,MAF4E;IAG5E,GAAGC;EAHyE,CAIzD;EACnB,MAAMC,KAAK,GAAGL,YAAY,CAAY;IAAEE,EAAF;IAAMC;EAAN,CAAZ,CAA1B;;EAEA,MAAMG,OAAO,GACXC,CADc,IAEX;IACH,IAAI,aAAaH,IAAjB,EAAuB;MAAA;;MACrB,iBAAAA,IAAI,CAACE,OAAL,qEAAAF,IAAI,EAAWG,CAAX,CAAJ;IACD;;IAEDF,KAAK,CAACC,OAAN,CAAcC,CAAd;EACD,CARD;;EAUA,oBAAOV,KAAK,CAACW,aAAN,CAAoBT,IAApB,EAA0B,EAC/B,GAAGM,KAD4B;IAE/B,GAAGD,IAF4B;IAG/B,GAAGN,QAAQ,CAACW,MAAT,CAAgB;MACjBC,GAAG,EAAE;QAAEC,OAAO,EAAEL;MAAX,CADY;MAEjBM,OAAO,EAAE;QAAEN;MAAF;IAFQ,CAAhB;EAH4B,CAA1B,CAAP;AAQD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["LinkingContext.tsx"],"names":["React","LinkingContext","createContext","options","undefined","displayName"],"mappings":"AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAIA,MAAMC,cAAc,gBAAGD,KAAK,CAACE,aAAN,CAEpB;AAAEC,EAAAA,OAAO,EAAEC;AAAX,CAFoB,CAAvB;AAIAH,cAAc,CAACI,WAAf,GAA6B,gBAA7B;AAEA,eAAeJ,cAAf","sourcesContent":["import type { ParamListBase } from '@react-navigation/core';\nimport * as React from 'react';\n\nimport type { LinkingOptions } from './types';\n\nconst LinkingContext = React.createContext<{\n options: LinkingOptions<ParamListBase> | undefined;\n}>({ options: undefined });\n\nLinkingContext.displayName = 'LinkingContext';\n\nexport default LinkingContext;\n"]}
1
+ {"version":3,"names":["React","LinkingContext","createContext","options","undefined","displayName"],"sources":["LinkingContext.tsx"],"sourcesContent":["import type { ParamListBase } from '@react-navigation/core';\nimport * as React from 'react';\n\nimport type { LinkingOptions } from './types';\n\nconst LinkingContext = React.createContext<{\n options: LinkingOptions<ParamListBase> | undefined;\n}>({ options: undefined });\n\nLinkingContext.displayName = 'LinkingContext';\n\nexport default LinkingContext;\n"],"mappings":"AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAIA,MAAMC,cAAc,gBAAGD,KAAK,CAACE,aAAN,CAEpB;EAAEC,OAAO,EAAEC;AAAX,CAFoB,CAAvB;AAIAH,cAAc,CAACI,WAAf,GAA6B,gBAA7B;AAEA,eAAeJ,cAAf"}
@@ -1,4 +1,4 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
3
  import { BaseNavigationContainer, getActionFromState, getPathFromState, getStateFromPath, validatePathConfig } from '@react-navigation/core';
4
4
  import * as React from 'react';
@@ -1 +1 @@
1
- {"version":3,"sources":["NavigationContainer.tsx"],"names":["BaseNavigationContainer","getActionFromState","getPathFromState","getStateFromPath","validatePathConfig","React","LinkingContext","DefaultTheme","ThemeProvider","useBackButton","useDocumentTitle","useLinking","useThenable","global","REACT_NAVIGATION_DEVTOOLS","WeakMap","NavigationContainerInner","ref","theme","linking","fallback","documentTitle","onReady","rest","isLinkingEnabled","enabled","config","refContainer","useRef","getInitialState","independent","prefixes","useEffect","current","set","isResolved","initialState","useImperativeHandle","linkingContext","useMemo","options","isReady","onReadyRef","NavigationContainer","forwardRef"],"mappings":";;AAAA,SACEA,uBADF,EAEEC,kBAFF,EAGEC,gBAHF,EAIEC,gBAJF,EAQEC,kBARF,QASO,wBATP;AAUA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,cAAP,MAA2B,kBAA3B;AACA,OAAOC,YAAP,MAAyB,wBAAzB;AACA,OAAOC,aAAP,MAA0B,yBAA1B;AAEA,OAAOC,aA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EAIG,CAACD,OAAD,CAJH;;AAMA,MAAI,CAACA,OAAL,EAAc;AACZ;AACA;AACA,WAAOrB,QAAP;AACD;;AAED,sBACE,oBAAC,cAAD,CAAgB,QAAhB;AAAyB,IAAA,KAAK,EAAEkB;AAAhC,kBACE,oBAAC,aAAD;AAAe,IAAA,KAAK,EAAEpB;AAAtB,kBACE,oBAAC,uBAAD,eACMK,IADN;AAEE,IAAA,YAAY,EACVA,IAAI,CAACa,YAAL,IAAqB,IAArB,GAA4BA,YAA5B,GAA2Cb,IAAI,CAACa,YAHpD;AAKE,IAAA,GAAG,EAAET;AALP,KADF,CADF,CADF;AAaD;;AAED,MAAMgB,mBAAmB,gBAAGtC,KAAK,CAACuC,UAAN,CAAiB5B,wBAAjB,CAA5B;AAQA,eAAe2B,mBAAf","sourcesContent":["import {\n BaseNavigationContainer,\n getActionFromState,\n getPathFromState,\n getStateFromPath,\n NavigationContainerProps,\n NavigationContainerRef,\n ParamListBase,\n validatePathConfig,\n} from '@react-navigation/core';\nimport * as React from 'react';\n\nimport LinkingContext from './LinkingContext';\nimport DefaultTheme from './theming/DefaultTheme';\nimport ThemeProvider from './theming/ThemeProvider';\nimport type { DocumentTitleOptions, LinkingOptions, Theme } from './types';\nimport useBackButton from './useBackButton';\nimport useDocumentTitle from './useDocumentTitle';\nimport useLinking from './useLinking';\nimport useThenable from './useThenable';\n\ndeclare global {\n var REACT_NAVIGATION_DEVTOOLS: WeakMap<\n NavigationContainerRef<any>,\n { readonly linking: LinkingOptions<any> }\n >;\n}\n\nglobal.REACT_NAVIGATION_DEVTOOLS = new WeakMap();\n\ntype Props<ParamList extends {}> = NavigationContainerProps & {\n theme?: Theme;\n linking?: LinkingOptions<ParamList>;\n fallback?: React.ReactNode;\n documentTitle?: DocumentTitleOptions;\n onReady?: () => void;\n};\n\n/**\n * Container component which holds the navigation state designed for React Native apps.\n * This should be rendered at the root wrapping the whole app.\n *\n * @param props.initialState Initial state object for the navigation tree. When deep link handling is enabled, this will override deep links when specified. Make sure that you don't specify an `initialState` when there's a deep link (`Linking.getInitialURL()`).\n * @param props.onReady Callback which is called after the navigation tree mounts.\n * @param props.onStateChange Callback which is called with the latest navigation state when it changes.\n * @param props.theme Theme object for the navigators.\n * @param props.linking Options for deep linking. Deep link handling is enabled when this prop is provided, unless `linking.enabled` is `false`.\n * @param props.fallback Fallback component to render until we have finished getting initial state when linking is enabled. Defaults to `null`.\n * @param props.documentTitle Options to configure the document title on Web. Updating document title is handled by default unless `documentTitle.enabled` is `false`.\n * @param props.children Child elements to render the content.\n * @param props.ref Ref object which refers to the navigation object containing helper methods.\n */\nfunction NavigationContainerInner(\n {\n theme = DefaultTheme,\n linking,\n fallback = null,\n documentTitle,\n onReady,\n ...rest\n }: Props<ParamListBase>,\n ref?: React.Ref<NavigationContainerRef<ParamListBase> | null>\n) {\n const isLinkingEnabled = linking ? linking.enabled !== false : false;\n\n if (linking?.config) {\n validatePathConfig(linking.config);\n }\n\n const refContainer =\n React.useRef<NavigationContainerRef<ParamListBase>>(null);\n\n useBackButton(refContainer);\n useDocumentTitle(refContainer, documentTitle);\n\n const { getInitialState } = useLinking(refContainer, {\n independent: rest.independent,\n enabled: isLinkingEnabled,\n prefixes: [],\n ...linking,\n });\n\n // Add additional linking related info to the ref\n // This will be used by the devtools\n React.useEffect(() => {\n if (refContainer.current) {\n REACT_NAVIGATION_DEVTOOLS.set(refContainer.current, {\n get linking() {\n return {\n ...linking,\n enabled: isLinkingEnabled,\n prefixes: linking?.prefixes ?? [],\n getStateFromPath: linking?.getStateFromPath ?? getStateFromPath,\n getPathFromState: linking?.getPathFromState ?? getPathFromState,\n getActionFromState:\n linking?.getActionFromState ?? getActionFromState,\n };\n },\n });\n }\n });\n\n const [isResolved, initialState] = useThenable(getInitialState);\n\n React.useImperativeHandle(ref, () => refContainer.current);\n\n const linkingContext = React.useMemo(() => ({ options: linking }), [linking]);\n\n const isReady = rest.initialState != null || !isLinkingEnabled || isResolved;\n\n const onReadyRef = React.useRef(onReady);\n\n React.useEffect(() => {\n onReadyRef.current = onReady;\n });\n\n React.useEffect(() => {\n if (isReady) {\n onReadyRef.current?.();\n }\n }, [isReady]);\n\n if (!isReady) {\n // This is temporary until we have Suspense for data-fetching\n // Then the fallback will be handled by a parent `Suspense` component\n return fallback as React.ReactElement;\n }\n\n return (\n <LinkingContext.Provider value={linkingContext}>\n <ThemeProvider value={theme}>\n <BaseNavigationContainer\n {...rest}\n initialState={\n rest.initialState == null ? initialState : rest.initialState\n }\n ref={refContainer}\n />\n </ThemeProvider>\n </LinkingContext.Provider>\n );\n}\n\nconst NavigationContainer = React.forwardRef(NavigationContainerInner) as <\n RootParamList extends {} = ReactNavigation.RootParamList\n>(\n props: Props<RootParamList> & {\n ref?: React.Ref<NavigationContainerRef<RootParamList>>;\n }\n) => React.ReactElement;\n\nexport default NavigationContainer;\n"]}
1
+ {"version":3,"names":["BaseNavigationContainer","getActionFromState","getPathFromState","getStateFromPath","validatePathConfig","React","LinkingContext","DefaultTheme","ThemeProvider","useBackButton","useDocumentTitle","useLinking","useThenable","global","REACT_NAVIGATION_DEVTOOLS","WeakMap","NavigationContainerInner","ref","theme","linking","fallback","documentTitle","onReady","rest","isLinkingEnabled","enabled","config","refContainer","useRef","getInitialState","independent","prefixes","useEffect","current","set","isResolved","initialState","useImperativeHandle","linkingContext","useMemo","options","isReady","onReadyRef","NavigationContainer","forwardRef"],"sources":["NavigationContainer.tsx"],"sourcesContent":["import {\n BaseNavigationContainer,\n getActionFromState,\n getPathFromState,\n getStateFromPath,\n NavigationContainerProps,\n NavigationContainerRef,\n ParamListBase,\n validatePathConfig,\n} from '@react-navigation/core';\nimport * as React from 'react';\n\nimport LinkingContext from './LinkingContext';\nimport DefaultTheme from './theming/DefaultTheme';\nimport ThemeProvider from './theming/ThemeProvider';\nimport type { DocumentTitleOptions, LinkingOptions, Theme } from './types';\nimport useBackButton from './useBackButton';\nimport useDocumentTitle from './useDocumentTitle';\nimport useLinking from './useLinking';\nimport useThenable from './useThenable';\n\ndeclare global {\n var REACT_NAVIGATION_DEVTOOLS: WeakMap<\n NavigationContainerRef<any>,\n { readonly linking: LinkingOptions<any> }\n >;\n}\n\nglobal.REACT_NAVIGATION_DEVTOOLS = new WeakMap();\n\ntype Props<ParamList extends {}> = NavigationContainerProps & {\n theme?: Theme;\n linking?: LinkingOptions<ParamList>;\n fallback?: React.ReactNode;\n documentTitle?: DocumentTitleOptions;\n onReady?: () => void;\n};\n\n/**\n * Container component which holds the navigation state designed for React Native apps.\n * This should be rendered at the root wrapping the whole app.\n *\n * @param props.initialState Initial state object for the navigation tree. When deep link handling is enabled, this will override deep links when specified. Make sure that you don't specify an `initialState` when there's a deep link (`Linking.getInitialURL()`).\n * @param props.onReady Callback which is called after the navigation tree mounts.\n * @param props.onStateChange Callback which is called with the latest navigation state when it changes.\n * @param props.theme Theme object for the navigators.\n * @param props.linking Options for deep linking. Deep link handling is enabled when this prop is provided, unless `linking.enabled` is `false`.\n * @param props.fallback Fallback component to render until we have finished getting initial state when linking is enabled. Defaults to `null`.\n * @param props.documentTitle Options to configure the document title on Web. Updating document title is handled by default unless `documentTitle.enabled` is `false`.\n * @param props.children Child elements to render the content.\n * @param props.ref Ref object which refers to the navigation object containing helper methods.\n */\nfunction NavigationContainerInner(\n {\n theme = DefaultTheme,\n linking,\n fallback = null,\n documentTitle,\n onReady,\n ...rest\n }: Props<ParamListBase>,\n ref?: React.Ref<NavigationContainerRef<ParamListBase> | null>\n) {\n const isLinkingEnabled = linking ? linking.enabled !== false : false;\n\n if (linking?.config) {\n validatePathConfig(linking.config);\n }\n\n const refContainer =\n React.useRef<NavigationContainerRef<ParamListBase>>(null);\n\n useBackButton(refContainer);\n useDocumentTitle(refContainer, documentTitle);\n\n const { getInitialState } = useLinking(refContainer, {\n independent: rest.independent,\n enabled: isLinkingEnabled,\n prefixes: [],\n ...linking,\n });\n\n // Add additional linking related info to the ref\n // This will be used by the devtools\n React.useEffect(() => {\n if (refContainer.current) {\n REACT_NAVIGATION_DEVTOOLS.set(refContainer.current, {\n get linking() {\n return {\n ...linking,\n enabled: isLinkingEnabled,\n prefixes: linking?.prefixes ?? [],\n getStateFromPath: linking?.getStateFromPath ?? getStateFromPath,\n getPathFromState: linking?.getPathFromState ?? getPathFromState,\n getActionFromState:\n linking?.getActionFromState ?? getActionFromState,\n };\n },\n });\n }\n });\n\n const [isResolved, initialState] = useThenable(getInitialState);\n\n React.useImperativeHandle(ref, () => refContainer.current);\n\n const linkingContext = React.useMemo(() => ({ options: linking }), [linking]);\n\n const isReady = rest.initialState != null || !isLinkingEnabled || isResolved;\n\n const onReadyRef = React.useRef(onReady);\n\n React.useEffect(() => {\n onReadyRef.current = onReady;\n });\n\n React.useEffect(() => {\n if (isReady) {\n onReadyRef.current?.();\n }\n }, [isReady]);\n\n if (!isReady) {\n // This is temporary until we have Suspense for data-fetching\n // Then the fallback will be handled by a parent `Suspense` component\n return fallback as React.ReactElement;\n }\n\n return (\n <LinkingContext.Provider value={linkingContext}>\n <ThemeProvider value={theme}>\n <BaseNavigationContainer\n {...rest}\n initialState={\n rest.initialState == null ? initialState : rest.initialState\n }\n ref={refContainer}\n />\n </ThemeProvider>\n </LinkingContext.Provider>\n );\n}\n\nconst NavigationContainer = React.forwardRef(NavigationContainerInner) as <\n RootParamList extends {} = ReactNavigation.RootParamList\n>(\n props: Props<RootParamList> & {\n ref?: React.Ref<NavigationContainerRef<RootParamList>>;\n }\n) => React.ReactElement;\n\nexport default NavigationContainer;\n"],"mappings":";;AAAA,SACEA,uBADF,EAEEC,kBAFF,EAGEC,gBAHF,EAIEC,gBAJF,EAQEC,kBARF,QASO,wBATP;AAUA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,cAAP,MAA2B,kBAA3B;AACA,OAAOC,YAAP,MAAyB,wBAAzB;AACA,OAAOC,aAAP,MAA0B,yBAA1B;AAEA,OAAOC,aAAP,MAA0B,iBAA1B;AACA,OAAOC,gBAAP,MAA6B,oBAA7B;AACA,OA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;IAEE,YAAY,EACVA,IAAI,CAACa,YAAL,IAAqB,IAArB,GAA4BA,YAA5B,GAA2Cb,IAAI,CAACa,YAHpD;IAKE,GAAG,EAAET;EALP,GADF,CADF,CADF;AAaD;;AAED,MAAMgB,mBAAmB,gBAAGtC,KAAK,CAACuC,UAAN,CAAiB5B,wBAAjB,CAA5B;AAQA,eAAe2B,mBAAf"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ServerContainer.tsx"],"names":["CurrentRenderContext","React","ServerContext","forwardRef","ServerContainer","ref","children","location","useEffect","console","error","current","value","getCurrentOptions","options"],"mappings":"AAAA,SAASA,oBAAT,QAAqC,wBAArC;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,aAAP,MAAiD,iBAAjD;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAAeD,KAAK,CAACE,UAAN,CAAiB,SAASC,eAAT,OAE9BC,GAF8B,EAG9B;AAAA,MAFA;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAEA;AACAN,EAAAA,KAAK,CAACO,SAAN,CAAgB,MAAM;AACpBC,IAAAA,OAAO,CAACC,KAAR,CACE,sFADF;AAGD,GAJD,EAIG,EAJH;AAMA,QAAMC,OAA6B,GAAG,EAAtC;;AAEA,MAAIN,GAAJ,EAAS;AACP,UAAMO,KAAK,GAAG;AACZC,MAAAA,iBAAiB,GAAG;AAClB,eAAOF,OAAO,CAACG,OAAf;AACD;;AAHW,KAAd,CADO,CAOP;AACA;AACA;AACA;;AACA,QAAI,OAAOT,GAAP,KAAe,UAAnB,EAA+B;AAC7BA,MAAAA,GAAG,CAACO,KAAD,CAAH;AACD,KAFD,MAEO;AACL;AACAP,MAAAA,GAAG,CAACM,OAAJ,GAAcC,KAAd;AACD;AACF;;AAED,sBACE,oBAAC,aAAD,CAAe,QAAf;AAAwB,IAAA,KAAK,EAAE;AAAEL,MAAAA;AAAF;AAA/B,kBACE,oBAAC,oBAAD,CAAsB,QAAtB;AAA+B,IAAA,KAAK,EAAEI;AAAtC,KACGL,QADH,CADF,CADF;AAOD,CAtCc,CAAf","sourcesContent":["import { CurrentRenderContext } from '@react-navigation/core';\nimport * as React from 'react';\n\nimport ServerContext, { ServerContextType } from './ServerContext';\nimport type { ServerContainerRef } from './types';\n\ntype Props = ServerContextType & {\n children: React.ReactNode;\n};\n\n/**\n * Container component for server rendering.\n *\n * @param props.location Location object to base the initial URL for SSR.\n * @param props.children Child elements to render the content.\n * @param props.ref Ref object which contains helper methods.\n */\nexport default React.forwardRef(function ServerContainer(\n { children, location }: Props,\n ref: React.Ref<ServerContainerRef>\n) {\n React.useEffect(() => {\n console.error(\n \"'ServerContainer' should only be used on the server with 'react-dom/server' for SSR.\"\n );\n }, []);\n\n const current: { options?: object } = {};\n\n if (ref) {\n const value = {\n getCurrentOptions() {\n return current.options;\n },\n };\n\n // We write to the `ref` during render instead of `React.useImperativeHandle`\n // This is because `useImperativeHandle` will update the ref after 'commit',\n // and there's no 'commit' phase during SSR.\n // Mutating ref during render is unsafe in concurrent mode, but we don't care about it for SSR.\n if (typeof ref === 'function') {\n ref(value);\n } else {\n // @ts-expect-error: the TS types are incorrect and say that ref.current is readonly\n ref.current = value;\n }\n }\n\n return (\n <ServerContext.Provider value={{ location }}>\n <CurrentRenderContext.Provider value={current}>\n {children}\n </CurrentRenderContext.Provider>\n </ServerContext.Provider>\n );\n});\n"]}
1
+ {"version":3,"names":["CurrentRenderContext","React","ServerContext","forwardRef","ServerContainer","ref","children","location","useEffect","console","error","current","value","getCurrentOptions","options"],"sources":["ServerContainer.tsx"],"sourcesContent":["import { CurrentRenderContext } from '@react-navigation/core';\nimport * as React from 'react';\n\nimport ServerContext, { ServerContextType } from './ServerContext';\nimport type { ServerContainerRef } from './types';\n\ntype Props = ServerContextType & {\n children: React.ReactNode;\n};\n\n/**\n * Container component for server rendering.\n *\n * @param props.location Location object to base the initial URL for SSR.\n * @param props.children Child elements to render the content.\n * @param props.ref Ref object which contains helper methods.\n */\nexport default React.forwardRef(function ServerContainer(\n { children, location }: Props,\n ref: React.Ref<ServerContainerRef>\n) {\n React.useEffect(() => {\n console.error(\n \"'ServerContainer' should only be used on the server with 'react-dom/server' for SSR.\"\n );\n }, []);\n\n const current: { options?: object } = {};\n\n if (ref) {\n const value = {\n getCurrentOptions() {\n return current.options;\n },\n };\n\n // We write to the `ref` during render instead of `React.useImperativeHandle`\n // This is because `useImperativeHandle` will update the ref after 'commit',\n // and there's no 'commit' phase during SSR.\n // Mutating ref during render is unsafe in concurrent mode, but we don't care about it for SSR.\n if (typeof ref === 'function') {\n ref(value);\n } else {\n // @ts-expect-error: the TS types are incorrect and say that ref.current is readonly\n ref.current = value;\n }\n }\n\n return (\n <ServerContext.Provider value={{ location }}>\n <CurrentRenderContext.Provider value={current}>\n {children}\n </CurrentRenderContext.Provider>\n </ServerContext.Provider>\n );\n});\n"],"mappings":"AAAA,SAASA,oBAAT,QAAqC,wBAArC;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,aAAP,MAAiD,iBAAjD;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAAeD,KAAK,CAACE,UAAN,CAAiB,SAASC,eAAT,OAE9BC,GAF8B,EAG9B;EAAA,IAFA;IAAEC,QAAF;IAAYC;EAAZ,CAEA;EACAN,KAAK,CAACO,SAAN,CAAgB,MAAM;IACpBC,OAAO,CAACC,KAAR,CACE,sFADF;EAGD,CAJD,EAIG,EAJH;EAMA,MAAMC,OAA6B,GAAG,EAAtC;;EAEA,IAAIN,GAAJ,EAAS;IACP,MAAMO,KAAK,GAAG;MACZC,iBAAiB,GAAG;QAClB,OAAOF,OAAO,CAACG,OAAf;MACD;;IAHW,CAAd,CADO,CAOP;IACA;IACA;IACA;;IACA,IAAI,OAAOT,GAAP,KAAe,UAAnB,EAA+B;MAC7BA,GAAG,CAACO,KAAD,CAAH;IACD,CAFD,MAEO;MACL;MACAP,GAAG,CAACM,OAAJ,GAAcC,KAAd;IACD;EACF;;EAED,oBACE,oBAAC,aAAD,CAAe,QAAf;IAAwB,KAAK,EAAE;MAAEL;IAAF;EAA/B,gBACE,oBAAC,oBAAD,CAAsB,QAAtB;IAA+B,KAAK,EAAEI;EAAtC,GACGL,QADH,CADF,CADF;AAOD,CAtCc,CAAf"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ServerContext.tsx"],"names":["React","ServerContext","createContext","undefined"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AASA,MAAMC,aAAa,gBAAGD,KAAK,CAACE,aAAN,CACpBC,SADoB,CAAtB;AAIA,eAAeF,aAAf","sourcesContent":["import * as React from 'react';\n\nexport type ServerContextType = {\n location?: {\n pathname: string;\n search: string;\n };\n};\n\nconst ServerContext = React.createContext<ServerContextType | undefined>(\n undefined\n);\n\nexport default ServerContext;\n"]}
1
+ {"version":3,"names":["React","ServerContext","createContext","undefined"],"sources":["ServerContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport type ServerContextType = {\n location?: {\n pathname: string;\n search: string;\n };\n};\n\nconst ServerContext = React.createContext<ServerContextType | undefined>(\n undefined\n);\n\nexport default ServerContext;\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AASA,MAAMC,aAAa,gBAAGD,KAAK,CAACE,aAAN,CACpBC,SADoB,CAAtB;AAIA,eAAeF,aAAf"}
@@ -1 +1 @@
1
- {"version":3,"sources":["createMemoryHistory.tsx"],"names":["nanoid","createMemoryHistory","index","items","pending","interrupt","forEach","it","cb","history","id","window","state","findIndex","item","get","backIndex","path","i","push","slice","length","pushState","replace","replaceState","go","n","nextIndex","lastItemIndex","Promise","resolve","reject","done","interrupted","clearTimeout","timer","Error","title","document","ref","setTimeout","splice","onPopState","currentIndex","Math","max","last","pop","removeEventListener","addEventListener","listen","listener"],"mappings":"AACA,SAASA,MAAT,QAAuB,mBAAvB;AAWA,eAAe,SAASC,mBAAT,GAA+B;AAC5C,MAAIC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,CAAP;AA0DD,KAnKa;;AAqKd;AACA;AACA;AACAwB,IAAAA,MAAM,CAACC,QAAD,EAAuB;AAC3B,YAAMT,UAAU,GAAG,MAAM;AACvB,YAAItC,OAAO,CAACiB,MAAZ,EAAoB;AAClB;AACA;AACD;;AAED8B,QAAAA,QAAQ;AACT,OAPD;;AASAxC,MAAAA,MAAM,CAACsC,gBAAP,CAAwB,UAAxB,EAAoCP,UAApC;AAEA,aAAO,MAAM/B,MAAM,CAACqC,mBAAP,CAA2B,UAA3B,EAAuCN,UAAvC,CAAb;AACD;;AArLa,GAAhB;AAwLA,SAAOjC,OAAP;AACD","sourcesContent":["import type { NavigationState } from '@react-navigation/core';\nimport { nanoid } from 'nanoid/non-secure';\n\ntype HistoryRecord = {\n // Unique identifier for this record to match it with window.history.state\n id: string;\n // Navigation state object for the history entry\n state: NavigationState;\n // Path of the history entry\n path: string;\n};\n\nexport default function createMemoryHistory() {\n let index = 0;\n let items: HistoryRecord[] = [];\n\n // Pending callbacks for `history.go(n)`\n // We might modify the callback stored if it was interrupted, so we have a ref to identify it\n const pending: { ref: unknown; cb: (interrupted?: boolean) => void }[] = [];\n\n const interrupt = () => {\n // If another history operation was performed we need to interrupt existing ones\n // This makes sure that calls such as `history.replace` after `history.go` don't happen\n // Since otherwise it won't be correct if something else has changed\n pending.forEach((it) => {\n const cb = it.cb;\n it.cb = () => cb(true);\n });\n };\n\n const history = {\n get index(): number {\n // We store an id in the state instead of an index\n // Index could get out of sync with in-memory values if page reloads\n const id = window.history.state?.id;\n\n if (id) {\n const index = items.findIndex((item) => item.id === id);\n\n return index > -1 ? index : 0;\n }\n\n return 0;\n },\n\n get(index: number) {\n return items[index];\n },\n\n backIndex({ path }: { path: string }) {\n // We need to find the index from the element before current to get closest path to go back to\n for (let i = index - 1; i >= 0; i--) {\n const item = items[i];\n\n if (item.path === path) {\n return i;\n }\n }\n\n return -1;\n },\n\n push({ path, state }: { path: string; state: NavigationState }) {\n interrupt();\n\n const id = nanoid();\n\n // When a new entry is pushed, all the existing entries after index will be inaccessible\n // So we remove any existing entries after the current index to clean them up\n items = items.slice(0, index + 1);\n\n items.push({ path, state, id });\n index = items.length - 1;\n\n // We pass empty string for title because it's ignored in all browsers except safari\n // We don't store state object in history.state because:\n // - browsers have limits on how big it can be, and we don't control the size\n // - while not recommended, there could be non-serializable data in state\n window.history.pushState({ id }, '', path);\n },\n\n replace({ path, state }: { path: string; state: NavigationState }) {\n interrupt();\n\n const id = window.history.state?.id ?? nanoid();\n\n if (!items.length || items.findIndex((item) => item.id === id) < 0) {\n // There are two scenarios for creating an array with only one history record:\n // - When loaded id not found in the items array, this function by default will replace\n // the first item. We need to keep only the new updated object, otherwise it will break\n // the page when navigating forward in history.\n // - This is the first time any state modifications are done\n // So we need to push the entry as there's nothing to replace\n items = [{ path, state, id }];\n index = 0;\n } else {\n items[index] = { path, state, id };\n }\n\n window.history.replaceState({ id }, '', path);\n },\n\n // `history.go(n)` is asynchronous, there are couple of things to keep in mind:\n // - it won't do anything if we can't go `n` steps, the `popstate` event won't fire.\n // - each `history.go(n)` call will trigger a separate `popstate` event with correct location.\n // - the `popstate` event fires before the next frame after calling `history.go(n)`.\n // This method differs from `history.go(n)` in the sense that it'll go back as many steps it can.\n go(n: number) {\n interrupt();\n\n // To guard against unexpected navigation out of the app we will assume that browser history is only as deep as the length of our memory\n // history. If we don't have an item to navigate to then update our index and navigate as far as we can without taking the user out of the app.\n const nextIndex = index + n;\n const lastItemIndex = items.length - 1;\n if (n < 0 && !items[nextIndex]) {\n // Attempted to navigate beyond the first index. Negating the current index will align the browser history with the first item.\n n = -index;\n index = 0;\n } else if (n > 0 && nextIndex > lastItemIndex) {\n // Attempted to navigate past the last index. Calculate how many indices away from the last index and go there.\n n = lastItemIndex - index;\n index = lastItemIndex;\n } else {\n index = nextIndex;\n }\n\n if (n === 0) {\n return;\n }\n\n // When we call `history.go`, `popstate` will fire when there's history to go back to\n // So we need to somehow handle following cases:\n // - There's history to go back, `history.go` is called, and `popstate` fires\n // - `history.go` is called multiple times, we need to resolve on respective `popstate`\n // - No history to go back, but `history.go` was called, browser has no API to detect it\n return new Promise<void>((resolve, reject) => {\n const done = (interrupted?: boolean) => {\n clearTimeout(timer);\n\n if (interrupted) {\n reject(new Error('History was changed during navigation.'));\n return;\n }\n\n // There seems to be a bug in Chrome regarding updating the title\n // If we set a title just before calling `history.go`, the title gets lost\n // However the value of `document.title` is still what we set it to\n // It's just not displayed in the tab bar\n // To update the tab bar, we need to reset the title to something else first (e.g. '')\n // And set the title to what it was before so it gets applied\n // It won't work without setting it to empty string coz otherwise title isn't changing\n // Which means that the browser won't do anything after setting the title\n const { title } = window.document;\n\n window.document.title = '';\n window.document.title = title;\n\n resolve();\n };\n\n pending.push({ ref: done, cb: done });\n\n // If navigation didn't happen within 100ms, assume that it won't happen\n // This may not be accurate, but hopefully it won't take so much time\n // In Chrome, navigation seems to happen instantly in next microtask\n // But on Firefox, it seems to take much longer, around 50ms from our testing\n // We're using a hacky timeout since there doesn't seem to be way to know for sure\n const timer = setTimeout(() => {\n const index = pending.findIndex((it) => it.ref === done);\n\n if (index > -1) {\n pending[index].cb();\n pending.splice(index, 1);\n }\n }, 100);\n\n const onPopState = () => {\n const id = window.history.state?.id;\n const currentIndex = items.findIndex((item) => item.id === id);\n\n // Fix createMemoryHistory.index variable's value\n // as it may go out of sync when navigating in the browser.\n index = Math.max(currentIndex, 0);\n\n const last = pending.pop();\n\n window.removeEventListener('popstate', onPopState);\n last?.cb();\n };\n\n window.addEventListener('popstate', onPopState);\n window.history.go(n);\n });\n },\n\n // The `popstate` event is triggered when history changes, except `pushState` and `replaceState`\n // If we call `history.go(n)` ourselves, we don't want it to trigger the listener\n // Here we normalize it so that only external changes (e.g. user pressing back/forward) trigger the listener\n listen(listener: () => void) {\n const onPopState = () => {\n if (pending.length) {\n // This was triggered by `history.go(n)`, we shouldn't call the listener\n return;\n }\n\n listener();\n };\n\n window.addEventListener('popstate', onPopState);\n\n return () => window.removeEventListener('popstate', onPopState);\n },\n };\n\n return history;\n}\n"]}
1
+ {"version":3,"names":["nanoid","createMemoryHistory","index","items","pending","interrupt","forEach","it","cb","history","id","window","state","findIndex","item","get","backIndex","path","i","push","slice","length","pushState","replace","replaceState","go","n","nextIndex","lastItemIndex","Promise","resolve","reject","done","interrupted","clearTimeout","timer","Error","title","document","ref","setTimeout","splice","onPopState","currentIndex","Math","max","last","pop","removeEventListener","addEventListener","listen","listener"],"sources":["createMemoryHistory.tsx"],"sourcesContent":["import type { NavigationState } from '@react-navigation/core';\nimport { nanoid } from 'nanoid/non-secure';\n\ntype HistoryRecord = {\n // Unique identifier for this record to match it with window.history.state\n id: string;\n // Navigation state object for the history entry\n state: NavigationState;\n // Path of the history entry\n path: string;\n};\n\nexport default function createMemoryHistory() {\n let index = 0;\n let items: HistoryRecord[] = [];\n\n // Pending callbacks for `history.go(n)`\n // We might modify the callback stored if it was interrupted, so we have a ref to identify it\n const pending: { ref: unknown; cb: (interrupted?: boolean) => void }[] = [];\n\n const interrupt = () => {\n // If another history operation was performed we need to interrupt existing ones\n // This makes sure that calls such as `history.replace` after `history.go` don't happen\n // Since otherwise it won't be correct if something else has changed\n pending.forEach((it) => {\n const cb = it.cb;\n it.cb = () => cb(true);\n });\n };\n\n const history = {\n get index(): number {\n // We store an id in the state instead of an index\n // Index could get out of sync with in-memory values if page reloads\n const id = window.history.state?.id;\n\n if (id) {\n const index = items.findIndex((item) => item.id === id);\n\n return index > -1 ? index : 0;\n }\n\n return 0;\n },\n\n get(index: number) {\n return items[index];\n },\n\n backIndex({ path }: { path: string }) {\n // We need to find the index from the element before current to get closest path to go back to\n for (let i = index - 1; i >= 0; i--) {\n const item = items[i];\n\n if (item.path === path) {\n return i;\n }\n }\n\n return -1;\n },\n\n push({ path, state }: { path: string; state: NavigationState }) {\n interrupt();\n\n const id = nanoid();\n\n // When a new entry is pushed, all the existing entries after index will be inaccessible\n // So we remove any existing entries after the current index to clean them up\n items = items.slice(0, index + 1);\n\n items.push({ path, state, id });\n index = items.length - 1;\n\n // We pass empty string for title because it's ignored in all browsers except safari\n // We don't store state object in history.state because:\n // - browsers have limits on how big it can be, and we don't control the size\n // - while not recommended, there could be non-serializable data in state\n window.history.pushState({ id }, '', path);\n },\n\n replace({ path, state }: { path: string; state: NavigationState }) {\n interrupt();\n\n const id = window.history.state?.id ?? nanoid();\n\n if (!items.length || items.findIndex((item) => item.id === id) < 0) {\n // There are two scenarios for creating an array with only one history record:\n // - When loaded id not found in the items array, this function by default will replace\n // the first item. We need to keep only the new updated object, otherwise it will break\n // the page when navigating forward in history.\n // - This is the first time any state modifications are done\n // So we need to push the entry as there's nothing to replace\n items = [{ path, state, id }];\n index = 0;\n } else {\n items[index] = { path, state, id };\n }\n\n window.history.replaceState({ id }, '', path);\n },\n\n // `history.go(n)` is asynchronous, there are couple of things to keep in mind:\n // - it won't do anything if we can't go `n` steps, the `popstate` event won't fire.\n // - each `history.go(n)` call will trigger a separate `popstate` event with correct location.\n // - the `popstate` event fires before the next frame after calling `history.go(n)`.\n // This method differs from `history.go(n)` in the sense that it'll go back as many steps it can.\n go(n: number) {\n interrupt();\n\n // To guard against unexpected navigation out of the app we will assume that browser history is only as deep as the length of our memory\n // history. If we don't have an item to navigate to then update our index and navigate as far as we can without taking the user out of the app.\n const nextIndex = index + n;\n const lastItemIndex = items.length - 1;\n if (n < 0 && !items[nextIndex]) {\n // Attempted to navigate beyond the first index. Negating the current index will align the browser history with the first item.\n n = -index;\n index = 0;\n } else if (n > 0 && nextIndex > lastItemIndex) {\n // Attempted to navigate past the last index. Calculate how many indices away from the last index and go there.\n n = lastItemIndex - index;\n index = lastItemIndex;\n } else {\n index = nextIndex;\n }\n\n if (n === 0) {\n return;\n }\n\n // When we call `history.go`, `popstate` will fire when there's history to go back to\n // So we need to somehow handle following cases:\n // - There's history to go back, `history.go` is called, and `popstate` fires\n // - `history.go` is called multiple times, we need to resolve on respective `popstate`\n // - No history to go back, but `history.go` was called, browser has no API to detect it\n return new Promise<void>((resolve, reject) => {\n const done = (interrupted?: boolean) => {\n clearTimeout(timer);\n\n if (interrupted) {\n reject(new Error('History was changed during navigation.'));\n return;\n }\n\n // There seems to be a bug in Chrome regarding updating the title\n // If we set a title just before calling `history.go`, the title gets lost\n // However the value of `document.title` is still what we set it to\n // It's just not displayed in the tab bar\n // To update the tab bar, we need to reset the title to something else first (e.g. '')\n // And set the title to what it was before so it gets applied\n // It won't work without setting it to empty string coz otherwise title isn't changing\n // Which means that the browser won't do anything after setting the title\n const { title } = window.document;\n\n window.document.title = '';\n window.document.title = title;\n\n resolve();\n };\n\n pending.push({ ref: done, cb: done });\n\n // If navigation didn't happen within 100ms, assume that it won't happen\n // This may not be accurate, but hopefully it won't take so much time\n // In Chrome, navigation seems to happen instantly in next microtask\n // But on Firefox, it seems to take much longer, around 50ms from our testing\n // We're using a hacky timeout since there doesn't seem to be way to know for sure\n const timer = setTimeout(() => {\n const index = pending.findIndex((it) => it.ref === done);\n\n if (index > -1) {\n pending[index].cb();\n pending.splice(index, 1);\n }\n }, 100);\n\n const onPopState = () => {\n const id = window.history.state?.id;\n const currentIndex = items.findIndex((item) => item.id === id);\n\n // Fix createMemoryHistory.index variable's value\n // as it may go out of sync when navigating in the browser.\n index = Math.max(currentIndex, 0);\n\n const last = pending.pop();\n\n window.removeEventListener('popstate', onPopState);\n last?.cb();\n };\n\n window.addEventListener('popstate', onPopState);\n window.history.go(n);\n });\n },\n\n // The `popstate` event is triggered when history changes, except `pushState` and `replaceState`\n // If we call `history.go(n)` ourselves, we don't want it to trigger the listener\n // Here we normalize it so that only external changes (e.g. user pressing back/forward) trigger the listener\n listen(listener: () => void) {\n const onPopState = () => {\n if (pending.length) {\n // This was triggered by `history.go(n)`, we shouldn't call the listener\n return;\n }\n\n listener();\n };\n\n window.addEventListener('popstate', onPopState);\n\n return () => window.removeEventListener('popstate', onPopState);\n },\n };\n\n return history;\n}\n"],"mappings":"AACA,SAASA,MAAT,QAAuB,mBAAvB;AAWA,eAAe,S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@ -1 +1 @@
1
- {"version":3,"sources":["extractPathFromURL.tsx"],"names":["escapeStringRegexp","extractPathFromURL","prefixes","url","prefix","protocol","match","host","replace","RegExp","prefixRegex","split","map","it","join","normalizedURL","test","undefined"],"mappings":"AAAA,OAAOA,kBAAP,MAA+B,sBAA/B;AAEA,eAAe,SAASC,kBAAT,CAA4BC,QAA5B,EAAgDC,GAAhD,EAA6D;AAC1E,OAAK,MAAMC,MAAX,IAAqBF,QAArB,EAA+B;AAAA;;AAC7B,UAAMG,QAAQ,sCAAGD,MAAM,CAACE,KAAP,CAAa,SAAb,CAAH,kDAAG,cAA0B,CAA1B,CAAH,2DAAmC,EAAjD;AACA,UAAMC,IAAI,GAAGH,MAAM,CAChBI,OADU,CACF,IAAIC,MAAJ,CAAY,IAAGT,kBAAkB,CAACK,QAAD,CAAW,EAA5C,CADE,EAC8C,EAD9C,EAEVG,OAFU,CAEF,MAFE,EAEM,GAFN,EAEW;AAFX,KAGVA,OAHU,CAGF,KAHE,EAGK,EAHL,CAAb,CAF6B,CAKN;;AAEvB,UAAME,WAAW,GAAG,IAAID,MAAJ,CACjB,IAAGT,kBAAkB,CAACK,QAAD,CAAW,OAAME,IAAI,CACxCI,KADoC,CAC9B,GAD8B,EAEpCC,GAFoC,CAE/BC,EAAD,IAASA,EAAE,KAAK,GAAP,GAAa,OAAb,GAAuBb,kBAAkB,CAACa,EAAD,CAFlB,EAGpCC,IAHoC,CAG/B,KAH+B,CAGxB,EAJG,CAApB;AAOA,UAAMC,aAAa,GAAGZ,GAAG,CAACK,OAAJ,CAAY,MAAZ,EAAoB,GAApB,CAAtB;;AAEA,QAAIE,WAAW,CAACM,IAAZ,CAAiBD,aAAjB,CAAJ,EAAqC;AACnC,aAAOA,aAAa,CAACP,OAAd,CAAsBE,WAAtB,EAAmC,EAAnC,CAAP;AACD;AACF;;AAED,SAAOO,SAAP;AACD","sourcesContent":["import escapeStringRegexp from 'escape-string-regexp';\n\nexport default function extractPathFromURL(prefixes: string[], url: string) {\n for (const prefix of prefixes) {\n const protocol = prefix.match(/^[^:]+:/)?.[0] ?? '';\n const host = prefix\n .replace(new RegExp(`^${escapeStringRegexp(protocol)}`), '')\n .replace(/\\/+/g, '/') // Replace multiple slash (//) with single ones\n .replace(/^\\//, ''); // Remove extra leading slash\n\n const prefixRegex = new RegExp(\n `^${escapeStringRegexp(protocol)}(/)*${host\n .split('.')\n .map((it) => (it === '*' ? '[^/]+' : escapeStringRegexp(it)))\n .join('\\\\.')}`\n );\n\n const normalizedURL = url.replace(/\\/+/g, '/');\n\n if (prefixRegex.test(normalizedURL)) {\n return normalizedURL.replace(prefixRegex, '');\n }\n }\n\n return undefined;\n}\n"]}
1
+ {"version":3,"names":["escapeStringRegexp","extractPathFromURL","prefixes","url","prefix","protocol","match","host","replace","RegExp","prefixRegex","split","map","it","join","normalizedURL","test","undefined"],"sources":["extractPathFromURL.tsx"],"sourcesContent":["import escapeStringRegexp from 'escape-string-regexp';\n\nexport default function extractPathFromURL(prefixes: string[], url: string) {\n for (const prefix of prefixes) {\n const protocol = prefix.match(/^[^:]+:/)?.[0] ?? '';\n const host = prefix\n .replace(new RegExp(`^${escapeStringRegexp(protocol)}`), '')\n .replace(/\\/+/g, '/') // Replace multiple slash (//) with single ones\n .replace(/^\\//, ''); // Remove extra leading slash\n\n const prefixRegex = new RegExp(\n `^${escapeStringRegexp(protocol)}(/)*${host\n .split('.')\n .map((it) => (it === '*' ? '[^/]+' : escapeStringRegexp(it)))\n .join('\\\\.')}`\n );\n\n const normalizedURL = url.replace(/\\/+/g, '/');\n\n if (prefixRegex.test(normalizedURL)) {\n return normalizedURL.replace(prefixRegex, '');\n }\n }\n\n return undefined;\n}\n"],"mappings":"AAAA,OAAOA,kBAAP,MAA+B,sBAA/B;AAEA,eAAe,SAASC,kBAAT,CAA4BC,QAA5B,EAAgDC,GAAhD,EAA6D;EAC1E,KAAK,MAAMC,MAAX,IAAqBF,QAArB,EAA+B;IAAA;;IAC7B,MAAMG,QAAQ,sCAAGD,MAAM,CAACE,KAAP,CAAa,SAAb,CAAH,kDAAG,cAA0B,CAA1B,CAAH,2DAAmC,EAAjD;IACA,MAAMC,IAAI,GAAGH,MAAM,CAChBI,OADU,CACF,IAAIC,MAAJ,CAAY,IAAGT,kBAAkB,CAACK,QAAD,CAAW,EAA5C,CADE,EAC8C,EAD9C,EAEVG,OAFU,CAEF,MAFE,EAEM,GAFN,EAEW;IAFX,CAGVA,OAHU,CAGF,KAHE,EAGK,EAHL,CAAb,CAF6B,CAKN;;IAEvB,MAAME,WAAW,GAAG,IAAID,MAAJ,CACjB,IAAGT,kBAAkB,CAACK,QAAD,CAAW,OAAME,IAAI,CACxCI,KADoC,CAC9B,GAD8B,EAEpCC,GAFoC,CAE/BC,EAAD,IAASA,EAAE,KAAK,GAAP,GAAa,OAAb,GAAuBb,kBAAkB,CAACa,EAAD,CAFlB,EAGpCC,IAHoC,CAG/B,KAH+B,CAGxB,EAJG,CAApB;IAOA,MAAMC,aAAa,GAAGZ,GAAG,CAACK,OAAJ,CAAY,MAAZ,EAAoB,GAApB,CAAtB;;IAEA,IAAIE,WAAW,CAACM,IAAZ,CAAiBD,aAAjB,CAAJ,EAAqC;MACnC,OAAOA,aAAa,CAACP,OAAd,CAAsBE,WAAtB,EAAmC,EAAnC,CAAP;IACD;EACF;;EAED,OAAOO,SAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":["default","Link","LinkingContext","NavigationContainer","ServerContainer","DarkTheme","DefaultTheme","ThemeProvider","useTheme","useLinkBuilder","useLinkProps","useLinkTo","useScrollToTop"],"mappings":"AAAA,SAASA,OAAO,IAAIC,IAApB,QAAgC,QAAhC;AACA,SAASD,OAAO,IAAIE,cAApB,QAA0C,kBAA1C;AACA,SAASF,OAAO,IAAIG,mBAApB,QAA+C,uBAA/C;AACA,SAASH,OAAO,IAAII,eAApB,QAA2C,mBAA3C;AACA,SAASJ,OAAO,IAAIK,SAApB,QAAqC,qBAArC;AACA,SAASL,OAAO,IAAIM,YAApB,QAAwC,wBAAxC;AACA,SAASN,OAAO,IAAIO,aAApB,QAAyC,yBAAzC;AACA,SAASP,OAAO,IAAIQ,QAApB,QAAoC,oBAApC;AACA,cAAc,SAAd;AACA,SAASR,OAAO,IAAIS,cAApB,QAA0C,kBAA1C;AACA,SAAST,OAAO,IAAIU,YAApB,QAAwC,gBAAxC;AACA,SAASV,OAAO,IAAIW,SAApB,QAAqC,aAArC;AACA,SAASX,OAAO,IAAIY,cAApB,QAA0C,kBAA1C;AACA,cAAc,wBAAd","sourcesContent":["export { default as Link } from './Link';\nexport { default as LinkingContext } from './LinkingContext';\nexport { default as NavigationContainer } from './NavigationContainer';\nexport { default as ServerContainer } from './ServerContainer';\nexport { default as DarkTheme } from './theming/DarkTheme';\nexport { default as DefaultTheme } from './theming/DefaultTheme';\nexport { default as ThemeProvider } from './theming/ThemeProvider';\nexport { default as useTheme } from './theming/useTheme';\nexport * from './types';\nexport { default as useLinkBuilder } from './useLinkBuilder';\nexport { default as useLinkProps } from './useLinkProps';\nexport { default as useLinkTo } from './useLinkTo';\nexport { default as useScrollToTop } from './useScrollToTop';\nexport * from '@react-navigation/core';\n"]}
1
+ {"version":3,"names":["default","Link","LinkingContext","NavigationContainer","ServerContainer","DarkTheme","DefaultTheme","ThemeProvider","useTheme","useLinkBuilder","useLinkProps","useLinkTo","useScrollToTop"],"sources":["index.tsx"],"sourcesContent":["export { default as Link } from './Link';\nexport { default as LinkingContext } from './LinkingContext';\nexport { default as NavigationContainer } from './NavigationContainer';\nexport { default as ServerContainer } from './ServerContainer';\nexport { default as DarkTheme } from './theming/DarkTheme';\nexport { default as DefaultTheme } from './theming/DefaultTheme';\nexport { default as ThemeProvider } from './theming/ThemeProvider';\nexport { default as useTheme } from './theming/useTheme';\nexport * from './types';\nexport { default as useLinkBuilder } from './useLinkBuilder';\nexport { default as useLinkProps } from './useLinkProps';\nexport { default as useLinkTo } from './useLinkTo';\nexport { default as useScrollToTop } from './useScrollToTop';\nexport * from '@react-navigation/core';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,IAApB,QAAgC,QAAhC;AACA,SAASD,OAAO,IAAIE,cAApB,QAA0C,kBAA1C;AACA,SAASF,OAAO,IAAIG,mBAApB,QAA+C,uBAA/C;AACA,SAASH,OAAO,IAAII,eAApB,QAA2C,mBAA3C;AACA,SAASJ,OAAO,IAAIK,SAApB,QAAqC,qBAArC;AACA,SAASL,OAAO,IAAIM,YAApB,QAAwC,wBAAxC;AACA,SAASN,OAAO,IAAIO,aAApB,QAAyC,yBAAzC;AACA,SAASP,OAAO,IAAIQ,QAApB,QAAoC,oBAApC;AACA,cAAc,SAAd;AACA,SAASR,OAAO,IAAIS,cAApB,QAA0C,kBAA1C;AACA,SAAST,OAAO,IAAIU,YAApB,QAAwC,gBAAxC;AACA,SAASV,OAAO,IAAIW,SAApB,QAAqC,aAArC;AACA,SAASX,OAAO,IAAIY,cAApB,QAA0C,kBAA1C;AACA,cAAc,wBAAd"}
@@ -1 +1 @@
1
- {"version":3,"sources":["DarkTheme.tsx"],"names":["DarkTheme","dark","colors","primary","background","card","text","border","notification"],"mappings":"AAEA,MAAMA,SAAgB,GAAG;AACvBC,EAAAA,IAAI,EAAE,IADiB;AAEvBC,EAAAA,MAAM,EAAE;AACNC,IAAAA,OAAO,EAAE,mBADH;AAENC,IAAAA,UAAU,EAAE,cAFN;AAGNC,IAAAA,IAAI,EAAE,iBAHA;AAINC,IAAAA,IAAI,EAAE,oBAJA;AAKNC,IAAAA,MAAM,EAAE,iBALF;AAMNC,IAAAA,YAAY,EAAE;AANR;AAFe,CAAzB;AAYA,eAAeR,SAAf","sourcesContent":["import type { Theme } from '../types';\n\nconst DarkTheme: Theme = {\n dark: true,\n colors: {\n primary: 'rgb(10, 132, 255)',\n background: 'rgb(1, 1, 1)',\n card: 'rgb(18, 18, 18)',\n text: 'rgb(229, 229, 231)',\n border: 'rgb(39, 39, 41)',\n notification: 'rgb(255, 69, 58)',\n },\n};\n\nexport default DarkTheme;\n"]}
1
+ {"version":3,"names":["DarkTheme","dark","colors","primary","background","card","text","border","notification"],"sources":["DarkTheme.tsx"],"sourcesContent":["import type { Theme } from '../types';\n\nconst DarkTheme: Theme = {\n dark: true,\n colors: {\n primary: 'rgb(10, 132, 255)',\n background: 'rgb(1, 1, 1)',\n card: 'rgb(18, 18, 18)',\n text: 'rgb(229, 229, 231)',\n border: 'rgb(39, 39, 41)',\n notification: 'rgb(255, 69, 58)',\n },\n};\n\nexport default DarkTheme;\n"],"mappings":"AAEA,MAAMA,SAAgB,GAAG;EACvBC,IAAI,EAAE,IADiB;EAEvBC,MAAM,EAAE;IACNC,OAAO,EAAE,mBADH;IAENC,UAAU,EAAE,cAFN;IAGNC,IAAI,EAAE,iBAHA;IAINC,IAAI,EAAE,oBAJA;IAKNC,MAAM,EAAE,iBALF;IAMNC,YAAY,EAAE;EANR;AAFe,CAAzB;AAYA,eAAeR,SAAf"}
@@ -1 +1 @@
1
- {"version":3,"sources":["DefaultTheme.tsx"],"names":["DefaultTheme","dark","colors","primary","background","card","text","border","notification"],"mappings":"AAEA,MAAMA,YAAmB,GAAG;AAC1BC,EAAAA,IAAI,EAAE,KADoB;AAE1BC,EAAAA,MAAM,EAAE;AACNC,IAAAA,OAAO,EAAE,kBADH;AAENC,IAAAA,UAAU,EAAE,oBAFN;AAGNC,IAAAA,IAAI,EAAE,oBAHA;AAINC,IAAAA,IAAI,EAAE,iBAJA;AAKNC,IAAAA,MAAM,EAAE,oBALF;AAMNC,IAAAA,YAAY,EAAE;AANR;AAFkB,CAA5B;AAYA,eAAeR,YAAf","sourcesContent":["import type { Theme } from '../types';\n\nconst DefaultTheme: Theme = {\n dark: false,\n colors: {\n primary: 'rgb(0, 122, 255)',\n background: 'rgb(242, 242, 242)',\n card: 'rgb(255, 255, 255)',\n text: 'rgb(28, 28, 30)',\n border: 'rgb(216, 216, 216)',\n notification: 'rgb(255, 59, 48)',\n },\n};\n\nexport default DefaultTheme;\n"]}
1
+ {"version":3,"names":["DefaultTheme","dark","colors","primary","background","card","text","border","notification"],"sources":["DefaultTheme.tsx"],"sourcesContent":["import type { Theme } from '../types';\n\nconst DefaultTheme: Theme = {\n dark: false,\n colors: {\n primary: 'rgb(0, 122, 255)',\n background: 'rgb(242, 242, 242)',\n card: 'rgb(255, 255, 255)',\n text: 'rgb(28, 28, 30)',\n border: 'rgb(216, 216, 216)',\n notification: 'rgb(255, 59, 48)',\n },\n};\n\nexport default DefaultTheme;\n"],"mappings":"AAEA,MAAMA,YAAmB,GAAG;EAC1BC,IAAI,EAAE,KADoB;EAE1BC,MAAM,EAAE;IACNC,OAAO,EAAE,kBADH;IAENC,UAAU,EAAE,oBAFN;IAGNC,IAAI,EAAE,oBAHA;IAINC,IAAI,EAAE,iBAJA;IAKNC,MAAM,EAAE,oBALF;IAMNC,YAAY,EAAE;EANR;AAFkB,CAA5B;AAYA,eAAeR,YAAf"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ThemeContext.tsx"],"names":["React","DefaultTheme","ThemeContext","createContext","displayName"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAGA,OAAOC,YAAP,MAAyB,gBAAzB;AAEA,MAAMC,YAAY,gBAAGF,KAAK,CAACG,aAAN,CAA2BF,YAA3B,CAArB;AAEAC,YAAY,CAACE,WAAb,GAA2B,cAA3B;AAEA,eAAeF,YAAf","sourcesContent":["import * as React from 'react';\n\nimport type { Theme } from '../types';\nimport DefaultTheme from './DefaultTheme';\n\nconst ThemeContext = React.createContext<Theme>(DefaultTheme);\n\nThemeContext.displayName = 'ThemeContext';\n\nexport default ThemeContext;\n"]}
1
+ {"version":3,"names":["React","DefaultTheme","ThemeContext","createContext","displayName"],"sources":["ThemeContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { Theme } from '../types';\nimport DefaultTheme from './DefaultTheme';\n\nconst ThemeContext = React.createContext<Theme>(DefaultTheme);\n\nThemeContext.displayName = 'ThemeContext';\n\nexport default ThemeContext;\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAGA,OAAOC,YAAP,MAAyB,gBAAzB;AAEA,MAAMC,YAAY,gBAAGF,KAAK,CAACG,aAAN,CAA2BF,YAA3B,CAArB;AAEAC,YAAY,CAACE,WAAb,GAA2B,cAA3B;AAEA,eAAeF,YAAf"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ThemeProvider.tsx"],"names":["React","ThemeContext","ThemeProvider","value","children"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAGA,OAAOC,YAAP,MAAyB,gBAAzB;AAOA,eAAe,SAASC,aAAT,OAAmD;AAAA,MAA5B;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAA4B;AAChE,sBACE,oBAAC,YAAD,CAAc,QAAd;AAAuB,IAAA,KAAK,EAAED;AAA9B,KAAsCC,QAAtC,CADF;AAGD","sourcesContent":["import * as React from 'react';\n\nimport type { Theme } from '../types';\nimport ThemeContext from './ThemeContext';\n\ntype Props = {\n value: Theme;\n children: React.ReactNode;\n};\n\nexport default function ThemeProvider({ value, children }: Props) {\n return (\n <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>\n );\n}\n"]}
1
+ {"version":3,"names":["React","ThemeContext","ThemeProvider","value","children"],"sources":["ThemeProvider.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { Theme } from '../types';\nimport ThemeContext from './ThemeContext';\n\ntype Props = {\n value: Theme;\n children: React.ReactNode;\n};\n\nexport default function ThemeProvider({ value, children }: Props) {\n return (\n <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>\n );\n}\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAGA,OAAOC,YAAP,MAAyB,gBAAzB;AAOA,eAAe,SAASC,aAAT,OAAmD;EAAA,IAA5B;IAAEC,KAAF;IAASC;EAAT,CAA4B;EAChE,oBACE,oBAAC,YAAD,CAAc,QAAd;IAAuB,KAAK,EAAED;EAA9B,GAAsCC,QAAtC,CADF;AAGD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useTheme.tsx"],"names":["React","ThemeContext","useTheme","theme","useContext"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,YAAP,MAAyB,gBAAzB;AAEA,eAAe,SAASC,QAAT,GAAoB;AACjC,QAAMC,KAAK,GAAGH,KAAK,CAACI,UAAN,CAAiBH,YAAjB,CAAd;AAEA,SAAOE,KAAP;AACD","sourcesContent":["import * as React from 'react';\n\nimport ThemeContext from './ThemeContext';\n\nexport default function useTheme() {\n const theme = React.useContext(ThemeContext);\n\n return theme;\n}\n"]}
1
+ {"version":3,"names":["React","ThemeContext","useTheme","theme","useContext"],"sources":["useTheme.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport ThemeContext from './ThemeContext';\n\nexport default function useTheme() {\n const theme = React.useContext(ThemeContext);\n\n return theme;\n}\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,YAAP,MAAyB,gBAAzB;AAEA,eAAe,SAASC,QAAT,GAAoB;EACjC,MAAMC,KAAK,GAAGH,KAAK,CAACI,UAAN,CAAiBH,YAAjB,CAAd;EAEA,OAAOE,KAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["types.tsx"],"sourcesContent":["import type {\n getActionFromState as getActionFromStateDefault,\n getPathFromState as getPathFromStateDefault,\n getStateFromPath as getStateFromPathDefault,\n PathConfigMap,\n Route,\n} from '@react-navigation/core';\n\nexport type Theme = {\n dark: boolean;\n colors: {\n primary: string;\n background: string;\n card: string;\n text: string;\n border: string;\n notification: string;\n };\n};\n\nexport type LinkingOptions<ParamList extends {}> = {\n /**\n * Whether deep link handling should be enabled.\n * Defaults to true.\n */\n enabled?: boolean;\n /**\n * The prefixes are stripped from the URL before parsing them.\n * Usually they are the `scheme` + `host` (e.g. `myapp://chat?user=jane`)\n *\n * This is not supported on Web.\n *\n * @example\n * ```js\n * {\n * prefixes: [\n * \"myapp://\", // App-specific scheme\n * \"https://example.com\", // Prefix for universal links\n * \"https://*.example.com\" // Prefix which matches any subdomain\n * ]\n * }\n * ```\n */\n prefixes: string[];\n /**\n * Optional function which takes an incoming URL returns a boolean\n * indicating whether React Navigation should handle it.\n *\n * This can be used to disable deep linking for specific URLs.\n * e.g. URLs used for authentication, and not for deep linking to screens.\n *\n * This is not supported on Web.\n *\n * @example\n * ```js\n * {\n * // Filter out URLs used by expo-auth-session\n * filter: (url) => !url.includes('+expo-auth-session')\n * }\n * ```\n */\n filter?: (url: string) => boolean;\n /**\n * Config to fine-tune how to parse the path.\n *\n * @example\n * ```js\n * {\n * Chat: {\n * path: 'chat/:author/:id',\n * parse: { id: Number }\n * }\n * }\n * ```\n */\n config?: {\n initialRouteName?: keyof ParamList;\n screens: PathConfigMap<ParamList>;\n };\n /**\n * Custom function to get the initial URL used for linking.\n * Uses `Linking.getInitialURL()` by default.\n *\n * This is not supported on Web.\n *\n * @example\n * ```js\n * {\n * getInitialURL () => Linking.getInitialURL(),\n * }\n * ```\n */\n getInitialURL?: () =>\n | string\n | null\n | undefined\n | Promise<string | null | undefined>;\n /**\n * Custom function to get subscribe to URL updates.\n * Uses `Linking.addEventListener('url', callback)` by default.\n *\n * This is not supported on Web.\n *\n * @example\n * ```js\n * {\n * subscribe: (listener) => {\n * const onReceiveURL = ({ url }) => listener(url);\n *\n * Linking.addEventListener('url', onReceiveURL);\n *\n * return () => Linking.removeEventListener('url', onReceiveURL);\n * }\n * }\n * ```\n */\n subscribe?: (\n listener: (url: string) => void\n ) => undefined | void | (() => void);\n /**\n * Custom function to parse the URL to a valid navigation state (advanced).\n */\n getStateFromPath?: typeof getStateFromPathDefault;\n /**\n * Custom function to convert the state object to a valid URL (advanced).\n * Only applicable on Web.\n */\n getPathFromState?: typeof getPathFromStateDefault;\n /**\n * Custom function to convert the state object to a valid action (advanced).\n */\n getActionFromState?: typeof getActionFromStateDefault;\n};\n\nexport type DocumentTitleOptions = {\n enabled?: boolean;\n formatter?: (\n options: Record<string, any> | undefined,\n route: Route<string> | undefined\n ) => string;\n};\n\nexport type ServerContainerRef = {\n getCurrentOptions(): Record<string, any> | undefined;\n};\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["useBackButton.tsx"],"names":["React","BackHandler","useBackButton","ref","useEffect","subscription","addEventListener","navigation","current","canGoBack","goBack","remove"],"mappings":"AAIA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,WAAT,QAA4B,cAA5B;AAEA,eAAe,SAASC,aAAT,CACbC,GADa,EAEb;AACAH,EAAAA,KAAK,CAACI,SAAN,CAAgB,MAAM;AACpB,UAAMC,YAAY,GAAGJ,WAAW,CAACK,gBAAZ,CACnB,mBADmB,EAEnB,MAAM;AACJ,YAAMC,UAAU,GAAGJ,GAAG,CAACK,OAAvB;;AAEA,UAAID,UAAU,IAAI,IAAlB,EAAwB;AACtB,eAAO,KAAP;AACD;;AAED,UAAIA,UAAU,CAACE,SAAX,EAAJ,EAA4B;AAC1BF,QAAAA,UAAU,CAACG,MAAX;AAEA,eAAO,IAAP;AACD;;AAED,aAAO,KAAP;AACD,KAhBkB,CAArB;AAmBA,WAAO,MAAML,YAAY,CAACM,MAAb,EAAb;AACD,GArBD,EAqBG,CAACR,GAAD,CArBH;AAsBD","sourcesContent":["import type {\n NavigationContainerRef,\n ParamListBase,\n} from '@react-navigation/core';\nimport * as React from 'react';\nimport { BackHandler } from 'react-native';\n\nexport default function useBackButton(\n ref: React.RefObject<NavigationContainerRef<ParamListBase>>\n) {\n React.useEffect(() => {\n const subscription = BackHandler.addEventListener(\n 'hardwareBackPress',\n () => {\n const navigation = ref.current;\n\n if (navigation == null) {\n return false;\n }\n\n if (navigation.canGoBack()) {\n navigation.goBack();\n\n return true;\n }\n\n return false;\n }\n );\n\n return () => subscription.remove();\n }, [ref]);\n}\n"]}
1
+ {"version":3,"names":["React","BackHandler","useBackButton","ref","useEffect","subscription","addEventListener","navigation","current","canGoBack","goBack","remove"],"sources":["useBackButton.tsx"],"sourcesContent":["import type {\n NavigationContainerRef,\n ParamListBase,\n} from '@react-navigation/core';\nimport * as React from 'react';\nimport { BackHandler } from 'react-native';\n\nexport default function useBackButton(\n ref: React.RefObject<NavigationContainerRef<ParamListBase>>\n) {\n React.useEffect(() => {\n const subscription = BackHandler.addEventListener(\n 'hardwareBackPress',\n () => {\n const navigation = ref.current;\n\n if (navigation == null) {\n return false;\n }\n\n if (navigation.canGoBack()) {\n navigation.goBack();\n\n return true;\n }\n\n return false;\n }\n );\n\n return () => subscription.remove();\n }, [ref]);\n}\n"],"mappings":"AAIA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,WAAT,QAA4B,cAA5B;AAEA,eAAe,SAASC,aAAT,CACbC,GADa,EAEb;EACAH,KAAK,CAACI,SAAN,CAAgB,MAAM;IACpB,MAAMC,YAAY,GAAGJ,WAAW,CAACK,gBAAZ,CACnB,mBADmB,EAEnB,MAAM;MACJ,MAAMC,UAAU,GAAGJ,GAAG,CAACK,OAAvB;;MAEA,IAAID,UAAU,IAAI,IAAlB,EAAwB;QACtB,OAAO,KAAP;MACD;;MAED,IAAIA,UAAU,CAACE,SAAX,EAAJ,EAA4B;QAC1BF,UAAU,CAACG,MAAX;QAEA,OAAO,IAAP;MACD;;MAED,OAAO,KAAP;IACD,CAhBkB,CAArB;IAmBA,OAAO,MAAML,YAAY,CAACM,MAAb,EAAb;EACD,CArBD,EAqBG,CAACR,GAAD,CArBH;AAsBD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useDocumentTitle.tsx"],"names":["React","useDocumentTitle","ref","enabled","formatter","options","route","title","name","useEffect","navigation","current","getCurrentOptions","getCurrentRoute","document","addListener","e","data"],"mappings":"AAIA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;;AAIA;AACA;AACA;AACA,eAAe,SAASC,gBAAT,CACbC,GADa,EAMb;AAAA,MAJA;AACEC,IAAAA,OAAO,GAAG,IADZ;AAEEC,IAAAA,SAAS,GAAG,CAACC,OAAD,EAAUC,KAAV;AAAA;;AAAA,+BAAoBD,OAApB,aAAoBA,OAApB,uBAAoBA,OAAO,CAAEE,KAA7B,2DAAsCD,KAAtC,aAAsCA,KAAtC,uBAAsCA,KAAK,CAAEE,IAA7C;AAAA;AAFd,GAIA,uEAD0B,EAC1B;AACAR,EAAAA,KAAK,CAACS,SAAN,CAAgB,MAAM;AACpB,QAAI,CAACN,OAAL,EAAc;AACZ;AACD;;AAED,UAAMO,UAAU,GAAGR,GAAG,CAACS,OAAvB;;AAEA,QAAID,UAAJ,EAAgB;AACd,YAAMH,KAAK,GAAGH,SAAS,CACrBM,UAAU,CAACE,iBAAX,EADqB,EAErBF,UAAU,CAACG,eAAX,EAFqB,CAAvB;AAKAC,MAAAA,QAAQ,CAACP,KAAT,GAAiBA,KAAjB;AACD;;AAED,WAAOG,UAAP,aAAOA,UAAP,uBAAOA,UAAU,CAAEK,WAAZ,CAAwB,SAAxB,EAAoCC,CAAD,IAAO;AAC/C,YAAMT,KAAK,GAAGH,SAAS,CAACY,CAAC,CAACC,IAAF,CAAOZ,OAAR,EAAiBK,UAAjB,aAAiBA,UAAjB,uBAAiBA,UAAU,CAAEG,eAAZ,EAAjB,CAAvB;AAEAC,MAAAA,QAAQ,CAACP,KAAT,GAAiBA,KAAjB;AACD,KAJM,CAAP;AAKD,GArBD;AAsBD","sourcesContent":["import type {\n NavigationContainerRef,\n ParamListBase,\n} from '@react-navigation/core';\nimport * as React from 'react';\n\nimport type { DocumentTitleOptions } from './types';\n\n/**\n * Set the document title for the active screen\n */\nexport default function useDocumentTitle(\n ref: React.RefObject<NavigationContainerRef<ParamListBase>>,\n {\n enabled = true,\n formatter = (options, route) => options?.title ?? route?.name,\n }: DocumentTitleOptions = {}\n) {\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n\n const navigation = ref.current;\n\n if (navigation) {\n const title = formatter(\n navigation.getCurrentOptions(),\n navigation.getCurrentRoute()\n );\n\n document.title = title;\n }\n\n return navigation?.addListener('options', (e) => {\n const title = formatter(e.data.options, navigation?.getCurrentRoute());\n\n document.title = title;\n });\n });\n}\n"]}
1
+ {"version":3,"names":["React","useDocumentTitle","ref","enabled","formatter","options","route","title","name","useEffect","navigation","current","getCurrentOptions","getCurrentRoute","document","addListener","e","data"],"sources":["useDocumentTitle.tsx"],"sourcesContent":["import type {\n NavigationContainerRef,\n ParamListBase,\n} from '@react-navigation/core';\nimport * as React from 'react';\n\nimport type { DocumentTitleOptions } from './types';\n\n/**\n * Set the document title for the active screen\n */\nexport default function useDocumentTitle(\n ref: React.RefObject<NavigationContainerRef<ParamListBase>>,\n {\n enabled = true,\n formatter = (options, route) => options?.title ?? route?.name,\n }: DocumentTitleOptions = {}\n) {\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n\n const navigation = ref.current;\n\n if (navigation) {\n const title = formatter(\n navigation.getCurrentOptions(),\n navigation.getCurrentRoute()\n );\n\n document.title = title;\n }\n\n return navigation?.addListener('options', (e) => {\n const title = formatter(e.data.options, navigation?.getCurrentRoute());\n\n document.title = title;\n });\n });\n}\n"],"mappings":"AAIA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;;AAIA;AACA;AACA;AACA,eAAe,SAASC,gBAAT,CACbC,GADa,EAMb;EAAA,IAJA;IACEC,OAAO,GAAG,IADZ;IAEEC,SAAS,GAAG,CAACC,OAAD,EAAUC,KAAV;MAAA;;MAAA,yBAAoBD,OAApB,aAAoBA,OAApB,uBAAoBA,OAAO,CAAEE,KAA7B,2DAAsCD,KAAtC,aAAsCA,KAAtC,uBAAsCA,KAAK,CAAEE,IAA7C;IAAA;EAFd,CAIA,uEAD0B,EAC1B;EACAR,KAAK,CAACS,SAAN,CAAgB,MAAM;IACpB,IAAI,CAACN,OAAL,EAAc;MACZ;IACD;;IAED,MAAMO,UAAU,GAAGR,GAAG,CAACS,OAAvB;;IAEA,IAAID,UAAJ,EAAgB;MACd,MAAMH,KAAK,GAAGH,SAAS,CACrBM,UAAU,CAACE,iBAAX,EADqB,EAErBF,UAAU,CAACG,eAAX,EAFqB,CAAvB;MAKAC,QAAQ,CAACP,KAAT,GAAiBA,KAAjB;IACD;;IAED,OAAOG,UAAP,aAAOA,UAAP,uBAAOA,UAAU,CAAEK,WAAZ,CAAwB,SAAxB,EAAoCC,CAAD,IAAO;MAC/C,MAAMT,KAAK,GAAGH,SAAS,CAACY,CAAC,CAACC,IAAF,CAAOZ,OAAR,EAAiBK,UAAjB,aAAiBA,UAAjB,uBAAiBA,UAAU,CAAEG,eAAZ,EAAjB,CAAvB;MAEAC,QAAQ,CAACP,KAAT,GAAiBA,KAAjB;IACD,CAJM,CAAP;EAKD,CArBD;AAsBD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useDocumentTitle.native.tsx"],"names":["useDocumentTitle"],"mappings":"AAAA,eAAe,SAASA,gBAAT,GAA4B,CACzC;AACD","sourcesContent":["export default function useDocumentTitle() {\n // Noop for React Native\n}\n"]}
1
+ {"version":3,"names":["useDocumentTitle"],"sources":["useDocumentTitle.native.tsx"],"sourcesContent":["export default function useDocumentTitle() {\n // Noop for React Native\n}\n"],"mappings":"AAAA,eAAe,SAASA,gBAAT,GAA4B,CACzC;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useLinkBuilder.tsx"],"names":["getPathFromState","NavigationHelpersContext","React","LinkingContext","getRootStateForNavigate","navigation","state","parent","getParent","parentState","getState","index","routes","useLinkBuilder","useContext","linking","buildLink","useCallback","name","params","options","enabled","undefined","path","config"],"mappings":"AAAA,SACEA,gBADF,EAGEC,wBAHF,QAMO,wBANP;AAOA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,cAAP,MAA2B,kBAA3B;;AAWA,MAAMC,uBAAuB,GAAG,CAC9BC,UAD8B,EAE9BC,KAF8B,KAGb;AACjB,Q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AEpB,gBAAT,GACToB,OAAO,CAACpB,gBAAR,CAAyBM,KAAzB,EAAgCc,OAAhC,aAAgCA,OAAhC,uBAAgCA,OAAO,CAAEI,MAAzC,CADS,GAETxB,gBAAgB,CAACM,KAAD,EAAQc,OAAR,aAAQA,OAAR,uBAAQA,OAAO,CAAEI,MAAjB,CAFpB;AAIA,WAAOD,IAAP;AACD,GAzBe,EA0BhB,CAACR,OAAD,EAAUV,UAAV,CA1BgB,CAAlB;AA6BA,SAAOW,SAAP;AACD","sourcesContent":["import {\n getPathFromState,\n NavigationHelpers,\n NavigationHelpersContext,\n NavigationProp,\n ParamListBase,\n} from '@react-navigation/core';\nimport * as React from 'react';\n\nimport LinkingContext from './LinkingContext';\n\ntype NavigationObject =\n | NavigationHelpers<ParamListBase>\n | NavigationProp<ParamListBase>;\n\ntype MinimalState = {\n index: number;\n routes: { name: string; params?: object; state?: MinimalState }[];\n};\n\nconst getRootStateForNavigate = (\n navigation: NavigationObject,\n state: MinimalState\n): MinimalState => {\n const parent = navigation.getParent();\n\n if (parent) {\n const parentState = parent.getState();\n\n return getRootStateForNavigate(parent, {\n index: 0,\n routes: [\n {\n ...parentState.routes[parentState.index],\n state: state,\n },\n ],\n });\n }\n\n return state;\n};\n\n/**\n * Build destination link for a navigate action.\n * Useful for showing anchor tags on the web for buttons that perform navigation.\n */\nexport default function useLinkBuilder() {\n const navigation = React.useContext(NavigationHelpersContext);\n const linking = React.useContext(LinkingContext);\n\n const buildLink = React.useCallback(\n (name: string, params?: object) => {\n const { options } = linking;\n\n if (options?.enabled === false) {\n return undefined;\n }\n\n const state = navigation\n ? getRootStateForNavigate(navigation, {\n index: 0,\n routes: [{ name, params }],\n })\n : // If we couldn't find a navigation object in context, we're at root\n // So we'll construct a basic state object to use\n {\n index: 0,\n routes: [{ name, params }],\n };\n\n const path = options?.getPathFromState\n ? options.getPathFromState(state, options?.config)\n : getPathFromState(state, options?.config);\n\n return path;\n },\n [linking, navigation]\n );\n\n return buildLink;\n}\n"]}
1
+ {"version":3,"names":["getPathFromState","NavigationHelpersContext","React","LinkingContext","getRootStateForNavigate","navigation","state","parent","getParent","parentState","getState","index","routes","useLinkBuilder","useContext","linking","buildLink","useCallback","name","params","options","enabled","undefined","path","config"],"sources":["useLinkBuilder.tsx"],"sourcesContent":["import {\n getPathFromState,\n NavigationHelpers,\n NavigationHelpersContext,\n NavigationProp,\n ParamListBase,\n} from '@react-navigation/core';\nimport * as React from 'react';\n\nimport LinkingContext from './LinkingContext';\n\ntype NavigationObject =\n | NavigationHelpers<ParamListBase>\n | NavigationProp<ParamListBase>;\n\ntype MinimalState = {\n index: number;\n routes: { name: string; params?: object; state?: MinimalState }[];\n};\n\nconst getRootStateForNavigate = (\n navigation: NavigationObject,\n state: MinimalState\n): MinimalState => {\n const parent = navigation.getParent();\n\n if (parent) {\n const parentState = parent.getState();\n\n return getRootStateForNavigate(parent, {\n index: 0,\n routes: [\n {\n ...parentState.routes[parentState.index],\n state: state,\n },\n ],\n });\n }\n\n return state;\n};\n\n/**\n * Build destination link for a navigate action.\n * Useful for showing anchor tags on the web for buttons that perform navigation.\n */\nexport default function useLinkBuilder() {\n const navigation = React.useContext(NavigationHelpersContext);\n const linking = React.useContext(LinkingContext);\n\n const buildLink = React.useCallback(\n (name: string, params?: object) => {\n const { options } = linking;\n\n if (options?.enabled === false) {\n return undefined;\n }\n\n const state = navigation\n ? getRootStateForNavigate(navigation, {\n index: 0,\n routes: [{ name, params }],\n })\n : // If we couldn't find a navigation object in context, we're at root\n // So we'll construct a basic state object to use\n {\n index: 0,\n routes: [{ name, params }],\n };\n\n const path = options?.getPathFromState\n ? options.getPathFromState(state, options?.config)\n : getPathFromState(state, options?.config);\n\n return path;\n },\n [linking, navigation]\n );\n\n return buildLink;\n}\n"],"mappings":"AAAA,SACEA,gBADF,EAGEC,wBAHF,QAMO,wBANP;AAOA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,cAAP,MAA2B,kBAA3B;;AAWA,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AAO,CAACpB,gBAAR,CAAyBM,KAAzB,EAAgCc,OAAhC,aAAgCA,OAAhC,uBAAgCA,OAAO,CAAEI,MAAzC,CADS,GAETxB,gBAAgB,CAACM,KAAD,EAAQc,OAAR,aAAQA,OAAR,uBAAQA,OAAO,CAAEI,MAAjB,CAFpB;IAIA,OAAOD,IAAP;EACD,CAzBe,EA0BhB,CAACR,OAAD,EAAUV,UAAV,CA1BgB,CAAlB;EA6BA,OAAOW,SAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useLinkProps.tsx"],"names":["getPathFromState","NavigationContainerRefContext","NavigationHelpersContext","React","Platform","LinkingContext","useLinkTo","getStateFromParams","params","state","screen","routes","name","undefined","useLinkProps","to","action","root","useContext","navigation","options","linkTo","onPress","e","shouldHandle","OS","defaultPrevented","metaKey","altKey","ctrlKey","shiftKey","button","includes","currentTarget","target","preventDefault","dispatch","Error","getPathFromStateHelper","href","config","accessibilityRole"],"mappings":"AAAA,SACEA,gBADF,EAGEC,6BAHF,EAIEC,wBAJF,QAOO,wBAPP;AASA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAAgCC,QAAhC,QAAgD,cAAhD;AAEA,OAAOC,cAAP,MAA2B,kBAA3B;AACA,OAAOC,SAAP,MAA8B,aAA9B;;AAOA,MAAMC,kBAAkB,GACtBC,MADyB,IAEuC;AAChE,MAAIA,MAAJ,aAAIA,MAAJ,eAAIA,MAAM,CAAEC,KAAZ,EAAmB;AACjB,WAAOD,MAAM,CAACC,KAAd;AACD;;AAED,MAAID,MAAJ,aAAIA,MAAJ,eAAIA,MAAM,CAAEE,MAAZ,EAAoB;AAClB,WAAO;AACLC,MAAAA,MAAM,EAAE,CACN;AACEC,QAAAA,IAAI,EAAEJ,MAAM,CAACE,MADf;AAEEF,QAAAA,MAAM,EAAEA,MAAM,CAACA,MAFjB;AAGE;AACAC,QAAAA,KAAK,EAAED,MAAM,CAACE,MAAP,GACHH,kBAAkB,CAChBC,MAAM,CAACA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IA,YAAJ,EAAkB;AAChB,UAAIR,MAAJ,EAAY;AACV,YAAIG,UAAJ,EAAgB;AACdA,UAAAA,UAAU,CAACiB,QAAX,CAAoBpB,MAApB;AACD,SAFD,MAEO,IAAIC,IAAJ,EAAU;AACfA,UAAAA,IAAI,CAACmB,QAAL,CAAcpB,MAAd;AACD,SAFM,MAEA;AACL,gBAAM,IAAIqB,KAAJ,CACJ,kFADI,CAAN;AAGD;AACF,OAVD,MAUO;AACLhB,QAAAA,MAAM,CAACN,EAAD,CAAN;AACD;AACF;AACF,GAnCD;;AAqCA,QAAMuB,sBAAsB,4BAAGlB,OAAH,aAAGA,OAAH,uBAAGA,OAAO,CAAEpB,gBAAZ,yEAAgCA,gBAA5D;AAEA,QAAMuC,IAAI,GACR,OAAOxB,EAAP,KAAc,QAAd,GACIA,EADJ,GAEIuB,sBAAsB,CACpB;AACE3B,IAAAA,MAAM,EAAE,CACN;AACEC,MAAAA,IAAI,EAAEG,EAAE,CAACL,MADX;AAEE;AACAF,MAAAA,MAAM,EAAEO,EAAE,CAACP,MAHb;AAIE;AACAC,MAAAA,KAAK,EAAEF,kBAAkB,CAACQ,EAAE,CAACP,MAAJ;AAL3B,KADM;AADV,GADoB,EAYpBY,OAZoB,aAYpBA,OAZoB,uBAYpBA,OAAO,CAAEoB,MAZW,CAH5B;AAkBA,SAAO;AACLD,IAAAA,IADK;AAELE,IAAAA,iBAAiB,EAAE,MAFd;AAGLnB,IAAAA;AAHK,GAAP;AAKD","sourcesContent":["import {\n getPathFromState,\n NavigationAction,\n NavigationContainerRefContext,\n NavigationHelpersContext,\n NavigatorScreenParams,\n ParamListBase,\n} from '@react-navigation/core';\nimport type { NavigationState, PartialState } from '@react-navigation/routers';\nimport * as React from 'react';\nimport { GestureResponderEvent, Platform } from 'react-native';\n\nimport LinkingContext from './LinkingContext';\nimport useLinkTo, { To } from './useLinkTo';\n\ntype Props<ParamList extends ReactNavigation.RootParamList> = {\n to: To<ParamList>;\n action?: NavigationAction;\n};\n\nconst getStateFromParams = (\n params: NavigatorScreenParams<ParamListBase, NavigationState> | undefined\n): PartialState<NavigationState> | NavigationState | undefined => {\n if (params?.state) {\n return params.state;\n }\n\n if (params?.screen) {\n return {\n routes: [\n {\n name: params.screen,\n params: params.params,\n // @ts-expect-error\n state: params.screen\n ? getStateFromParams(\n params.params as\n | NavigatorScreenParams<ParamListBase, NavigationState>\n | undefined\n )\n : undefined,\n },\n ],\n };\n }\n\n return undefined;\n};\n\n/**\n * Hook to get props for an anchor tag so it can work with in page navigation.\n *\n * @param props.to Absolute path to screen (e.g. `/feeds/hot`).\n * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.\n */\nexport default function useLinkProps<\n ParamList extends ReactNavigation.RootParamList\n>({ to, action }: Props<ParamList>) {\n const root = React.useContext(NavigationContainerRefContext);\n const navigation = React.useContext(NavigationHelpersContext);\n const { options } = React.useContext(LinkingContext);\n const linkTo = useLinkTo<ParamList>();\n\n const onPress = (\n e?: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => {\n let shouldHandle = false;\n\n if (Platform.OS !== 'web' || !e) {\n shouldHandle = e ? !e.defaultPrevented : true;\n } else if (\n !e.defaultPrevented && // onPress prevented default\n // @ts-expect-error: these properties exist on web, but not in React Native\n !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && // ignore clicks with modifier keys\n // @ts-expect-error: these properties exist on web, but not in React Native\n (e.button == null || e.button === 0) && // ignore everything but left clicks\n // @ts-expect-error: these properties exist on web, but not in React Native\n [undefined, null, '', 'self'].includes(e.currentTarget?.target) // let browser handle \"target=_blank\" etc.\n ) {\n e.preventDefault();\n shouldHandle = true;\n }\n\n if (shouldHandle) {\n if (action) {\n if (navigation) {\n navigation.dispatch(action);\n } else if (root) {\n root.dispatch(action);\n } else {\n throw new Error(\n \"Couldn't find a navigation object. Is your component inside NavigationContainer?\"\n );\n }\n } else {\n linkTo(to);\n }\n }\n };\n\n const getPathFromStateHelper = options?.getPathFromState ?? getPathFromState;\n\n const href =\n typeof to === 'string'\n ? to\n : getPathFromStateHelper(\n {\n routes: [\n {\n name: to.screen,\n // @ts-expect-error\n params: to.params,\n // @ts-expect-error\n state: getStateFromParams(to.params),\n },\n ],\n },\n options?.config\n );\n\n return {\n href,\n accessibilityRole: 'link' as const,\n onPress,\n };\n}\n"]}
1
+ {"version":3,"names":["getPathFromState","NavigationContainerRefContext","NavigationHelpersContext","React","Platform","LinkingContext","useLinkTo","getStateFromParams","params","state","screen","routes","name","undefined","useLinkProps","to","action","root","useContext","navigation","options","linkTo","onPress","e","shouldHandle","OS","defaultPrevented","metaKey","altKey","ctrlKey","shiftKey","button","includes","currentTarget","target","preventDefault","dispatch","Error","getPathFromStateHelper","href","config","accessibilityRole"],"sources":["useLinkProps.tsx"],"sourcesContent":["import {\n getPathFromState,\n NavigationAction,\n NavigationContainerRefContext,\n NavigationHelpersContext,\n NavigatorScreenParams,\n ParamListBase,\n} from '@react-navigation/core';\nimport type { NavigationState, PartialState } from '@react-navigation/routers';\nimport * as React from 'react';\nimport { GestureResponderEvent, Platform } from 'react-native';\n\nimport LinkingContext from './LinkingContext';\nimport useLinkTo, { To } from './useLinkTo';\n\ntype Props<ParamList extends ReactNavigation.RootParamList> = {\n to: To<ParamList>;\n action?: NavigationAction;\n};\n\nconst getStateFromParams = (\n params: NavigatorScreenParams<ParamListBase, NavigationState> | undefined\n): PartialState<NavigationState> | NavigationState | undefined => {\n if (params?.state) {\n return params.state;\n }\n\n if (params?.screen) {\n return {\n routes: [\n {\n name: params.screen,\n params: params.params,\n // @ts-expect-error\n state: params.screen\n ? getStateFromParams(\n params.params as\n | NavigatorScreenParams<ParamListBase, NavigationState>\n | undefined\n )\n : undefined,\n },\n ],\n };\n }\n\n return undefined;\n};\n\n/**\n * Hook to get props for an anchor tag so it can work with in page navigation.\n *\n * @param props.to Absolute path to screen (e.g. `/feeds/hot`).\n * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.\n */\nexport default function useLinkProps<\n ParamList extends ReactNavigation.RootParamList\n>({ to, action }: Props<ParamList>) {\n const root = React.useContext(NavigationContainerRefContext);\n const navigation = React.useContext(NavigationHelpersContext);\n const { options } = React.useContext(LinkingContext);\n const linkTo = useLinkTo<ParamList>();\n\n const onPress = (\n e?: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => {\n let shouldHandle = false;\n\n if (Platform.OS !== 'web' || !e) {\n shouldHandle = e ? !e.defaultPrevented : true;\n } else if (\n !e.defaultPrevented && // onPress prevented default\n // @ts-expect-error: these properties exist on web, but not in React Native\n !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && // ignore clicks with modifier keys\n // @ts-expect-error: these properties exist on web, but not in React Native\n (e.button == null || e.button === 0) && // ignore everything but left clicks\n // @ts-expect-error: these properties exist on web, but not in React Native\n [undefined, null, '', 'self'].includes(e.currentTarget?.target) // let browser handle \"target=_blank\" etc.\n ) {\n e.preventDefault();\n shouldHandle = true;\n }\n\n if (shouldHandle) {\n if (action) {\n if (navigation) {\n navigation.dispatch(action);\n } else if (root) {\n root.dispatch(action);\n } else {\n throw new Error(\n \"Couldn't find a navigation object. Is your component inside NavigationContainer?\"\n );\n }\n } else {\n linkTo(to);\n }\n }\n };\n\n const getPathFromStateHelper = options?.getPathFromState ?? getPathFromState;\n\n const href =\n typeof to === 'string'\n ? to\n : getPathFromStateHelper(\n {\n routes: [\n {\n name: to.screen,\n // @ts-expect-error\n params: to.params,\n // @ts-expect-error\n state: getStateFromParams(to.params),\n },\n ],\n },\n options?.config\n );\n\n return {\n href,\n accessibilityRole: 'link' as const,\n onPress,\n };\n}\n"],"mappings":"AAAA,SACEA,gBADF,EAGEC,6BAHF,EAIEC,wBAJF,QAOO,wBAPP;AASA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAAgCC,QAAhC,QAAgD,cAAhD;AAEA,OAAOC,cAAP,MAA2B,kBAA3B;AACA,OAAOC,SAAP,M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1
- {"version":3,"sources":["useLinkTo.tsx"],"names":["getActionFromState","getStateFromPath","NavigationContainerRefContext","React","LinkingContext","useLinkTo","navigation","useContext","linking","linkTo","useCallback","to","undefined","Error","navigate","screen","params","startsWith","options","state","config","action","dispatch","reset"],"mappings":"AAAA,SACEA,kBADF,EAEEC,gBAFF,EAGEC,6BAHF,QAIO,wBAJP;AAKA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,cAAP,MAA2B,kBAA3B;AAiBA,eAAe,SAASC,SAAT,GAEX;AACF,QAAMC,UAAU,GAAGH,KAAK,CAACI,UAAN,CAAiBL,6BAAjB,CAAnB;AACA,QAAMM,OAAO,GAAGL,KAAK,CAACI,UAAN,CAAiBH,cAAjB,CAAhB;AAEA,QAAMK,MAAM,GAAGN,KAAK,CAACO,WAAN,CACZC,EAAD,IAAuB;AACrB,QAAIL,UAAU,KAAKM,SAAnB,EAA8B;AAC5B,YAAM,IAAIC,KAAJ,CACJ,kFADI,CAAN;AAGD;;AAED,QAAI,OAAOF,EAAP,KAAc,QAAlB,EAA4B;AAC1B;AACAL,MAAAA,UAAU,CAACQ,QAAX,CAAoBH,EAAE,CAACI,MAAvB,EAA+BJ,EAAE,CAACK,MAAlC;AACA;AACD;;AAED,QAAI,CAACL,EAAE,CAACM,UAAH,CAAc,GAAd,CAAL,EAAyB;AACvB,YAAM,IAAIJ,KAAJ,CAAW,iCAAgCF,EAAG,IAA9C,CAAN;AACD;;AAED,UAAM;AAAEO,MAAAA;AAAF,QAAcV,OAApB;AAEA,UAAMW,KAAK,GAAGD,OAAO,SAAP,IAAAA,OAAO,WAAP,IAAAA,OAAO,CAAEjB,gBAAT,GACViB,OAAO,CAACjB,gBAAR,CAAyBU,EAAzB,EAA6BO,OAAO,CAACE,MAArC,CADU,GAEVnB,gBAAgB,CAACU,EAAD,EAAKO,OAAL,aAAKA,OAAL,uBAAKA,OAAO,CAAEE,MAAd,CAFpB;;AAIA,QAAID,KAAJ,EAAW;AACT,YAAME,MAAM,GAAGrB,kBAAkB,CAACmB,KAAD,EAAQD,OAAR,aAAQA,OAAR,uBAAQA,OAAO,CAAEE,MAAjB,CAAjC;;AAEA,UAAIC,MAAM,KAAKT,SAAf,EAA0B;AACxBN,QAAAA,UAAU,CAACgB,QAAX,CAAoBD,MAApB;AACD,OAFD,MAEO;AACLf,QAAAA,UAAU,CAACiB,KAAX,CAAiBJ,KAAjB;AACD;AACF,KARD,MAQO;AACL,YAAM,IAAIN,KAAJ,CAAU,iDAAV,CAAN;AACD;AACF,GAnCY,EAoCb,CAACL,OAAD,EAAUF,UAAV,CApCa,CAAf;AAuCA,SAAOG,MAAP;AACD","sourcesContent":["import {\n getActionFromState,\n getStateFromPath,\n NavigationContainerRefContext,\n} from '@react-navigation/core';\nimport * as React from 'react';\n\nimport LinkingContext from './LinkingContext';\n\nexport type To<\n ParamList extends ReactNavigation.RootParamList = ReactNavigation.RootParamList,\n RouteName extends keyof ParamList = keyof ParamList\n> =\n | string\n | (undefined extends ParamList[RouteName]\n ? {\n screen: Extract<RouteName, string>;\n params?: ParamList[RouteName];\n }\n : {\n screen: Extract<RouteName, string>;\n params: ParamList[RouteName];\n });\n\nexport default function useLinkTo<\n ParamList extends ReactNavigation.RootParamList\n>() {\n const navigation = React.useContext(NavigationContainerRefContext);\n const linking = React.useContext(LinkingContext);\n\n const linkTo = React.useCallback(\n (to: To<ParamList>) => {\n if (navigation === undefined) {\n throw new Error(\n \"Couldn't find a navigation object. Is your component inside NavigationContainer?\"\n );\n }\n\n if (typeof to !== 'string') {\n // @ts-expect-error: This is fine\n navigation.navigate(to.screen, to.params);\n return;\n }\n\n if (!to.startsWith('/')) {\n throw new Error(`The path must start with '/' (${to}).`);\n }\n\n const { options } = linking;\n\n const state = options?.getStateFromPath\n ? options.getStateFromPath(to, options.config)\n : getStateFromPath(to, options?.config);\n\n if (state) {\n const action = getActionFromState(state, options?.config);\n\n if (action !== undefined) {\n navigation.dispatch(action);\n } else {\n navigation.reset(state);\n }\n } else {\n throw new Error('Failed to parse the path to a navigation state.');\n }\n },\n [linking, navigation]\n );\n\n return linkTo;\n}\n"]}
1
+ {"version":3,"names":["getActionFromState","getStateFromPath","NavigationContainerRefContext","React","LinkingContext","useLinkTo","navigation","useContext","linking","linkTo","useCallback","to","undefined","Error","navigate","screen","params","startsWith","options","state","config","action","dispatch","reset"],"sources":["useLinkTo.tsx"],"sourcesContent":["import {\n getActionFromState,\n getStateFromPath,\n NavigationContainerRefContext,\n} from '@react-navigation/core';\nimport * as React from 'react';\n\nimport LinkingContext from './LinkingContext';\n\nexport type To<\n ParamList extends ReactNavigation.RootParamList = ReactNavigation.RootParamList,\n RouteName extends keyof ParamList = keyof ParamList\n> =\n | string\n | (undefined extends ParamList[RouteName]\n ? {\n screen: Extract<RouteName, string>;\n params?: ParamList[RouteName];\n }\n : {\n screen: Extract<RouteName, string>;\n params: ParamList[RouteName];\n });\n\nexport default function useLinkTo<\n ParamList extends ReactNavigation.RootParamList\n>() {\n const navigation = React.useContext(NavigationContainerRefContext);\n const linking = React.useContext(LinkingContext);\n\n const linkTo = React.useCallback(\n (to: To<ParamList>) => {\n if (navigation === undefined) {\n throw new Error(\n \"Couldn't find a navigation object. Is your component inside NavigationContainer?\"\n );\n }\n\n if (typeof to !== 'string') {\n // @ts-expect-error: This is fine\n navigation.navigate(to.screen, to.params);\n return;\n }\n\n if (!to.startsWith('/')) {\n throw new Error(`The path must start with '/' (${to}).`);\n }\n\n const { options } = linking;\n\n const state = options?.getStateFromPath\n ? options.getStateFromPath(to, options.config)\n : getStateFromPath(to, options?.config);\n\n if (state) {\n const action = getActionFromState(state, options?.config);\n\n if (action !== undefined) {\n navigation.dispatch(action);\n } else {\n navigation.reset(state);\n }\n } else {\n throw new Error('Failed to parse the path to a navigation state.');\n }\n },\n [linking, navigation]\n );\n\n return linkTo;\n}\n"],"mappings":"AAAA,SACEA,kBADF,EAEEC,gBAFF,EAGEC,6BAHF,QAIO,wBAJP;AAKA,OAAO,KAA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D,MAQO;MACL,MAAM,IAAIN,KAAJ,CAAU,iDAAV,CAAN;IACD;EACF,CAnCY,EAoCb,CAACL,OAAD,EAAUF,UAAV,CApCa,CAAf;EAuCA,OAAOG,MAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useLinking.tsx"],"names":["findFocusedRoute","getActionFromState","getActionFromStateDefault","getPathFromState","getPathFromStateDefault","getStateFromPath","getStateFromPathDefault","isEqual","React","createMemoryHistory","ServerContext","findMatchingState","a","b","undefined","key","aHistoryLength","history","length","routes","bHistoryLength","aRoute","index","bRoute","aChildState","state","bChildState","series","cb","handling","queue","callback","unshift","last","pop","linkingHandlers","useLinking","ref","independent","enabled","config","useEffect","process","env","NODE_ENV","console","error","join","trim","handler","Symbol","push","indexOf","splice","useState","enabledRef","useRef","configRef","getStateFromPathRef","getPathFromStateRef","getActionFromStateRef","current","server","useContext","getInitialState","useCallback","value","location","window","path","pathname","search","thenable","then","onfulfilled","Promise","resolve","catch","previousIndexRef","previousStateRef","pendingPopStatePathRef","listen","navigation","previousIndex","record","get","resetRoot","rootState","getRootState","some","r","routeNames","includes","name","warn","action","dispatch","e","message","getPathForRoute","route","stateForPath","focusedRoute","params","replace","onStateChange","previousState","pendingPath","previousFocusedState","focusedState","historyDelta","nextIndex","backIndex","currentIndex","go","addListener"],"mappings":"AAAA,SACEA,gBADF,EAEEC,kBAAkB,IAAIC,yBAFxB,EAGEC,gBAAgB,IAAIC,uBAHtB,EAIEC,gBAAgB,IAAIC,uBAJtB,QAQO,wBARP;AASA,OAAOC,OAAP,MAAoB,iBAApB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,mBAAP,MAAgC,uBAAhC;AACA,OAAOC,aAAP,MAA0B,iBAA1B;;AAKA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAG,CACxBC,CADwB,EAExBC,CAFwB,KAGW;AACnC,MAAID,CAAC,KAAKE,SAAN,IAAmBD,CAAC,KAAKC,SAAzB,I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,OAAO,CAACuF,OAAR,CAAgB;AAAEnC,UAAAA,IAAF;AAAQ5C,UAAAA;AAAR,SAAhB;AACD;AACF,KAjFD,CAlDoB,CAqIpB;AACA;AACA;;;AACA,2BAAOY,GAAG,CAACwB,OAAX,iDAAO,aAAasD,WAAb,CAAyB,OAAzB,EAAkCxF,MAAM,CAAC8E,aAAD,CAAxC,CAAP;AACD,GAzID;AA2IA,SAAO;AACLzC,IAAAA;AADK,GAAP;AAGD","sourcesContent":["import {\n findFocusedRoute,\n getActionFromState as getActionFromStateDefault,\n getPathFromState as getPathFromStateDefault,\n getStateFromPath as getStateFromPathDefault,\n NavigationContainerRef,\n NavigationState,\n ParamListBase,\n} from '@react-navigation/core';\nimport isEqual from 'fast-deep-equal';\nimport * as React from 'react';\n\nimport createMemoryHistory from './createMemoryHistory';\nimport ServerContext from './ServerContext';\nimport type { LinkingOptions } from './types';\n\ntype ResultState = ReturnType<typeof getStateFromPathDefault>;\n\n/**\n * Find the matching navigation state that changed between 2 navigation states\n * e.g.: a -> b -> c -> d and a -> b -> c -> e -> f, if history in b changed, b is the matching state\n */\nconst findMatchingState = <T extends NavigationState>(\n a: T | undefined,\n b: T | undefined\n): [T | undefined, T | undefined] => {\n if (a === undefined || b === undefined || a.key !== b.key) {\n return [undefined, undefined];\n }\n\n // Tab and drawer will have `history` property, but stack will have history in `routes`\n const aHistoryLength = a.history ? a.history.length : a.routes.length;\n const bHistoryLength = b.history ? b.history.length : b.routes.length;\n\n const aRoute = a.routes[a.index];\n const bRoute = b.routes[b.index];\n\n const aChildState = aRoute.state as T | undefined;\n const bChildState = bRoute.state as T | undefined;\n\n // Stop here if this is the state object that changed:\n // - history length is different\n // - focused routes are different\n // - one of them doesn't have child state\n // - child state keys are different\n if (\n aHistoryLength !== bHistoryLength ||\n aRoute.key !== bRoute.key ||\n aChildState === undefined ||\n bChildState === undefined ||\n aChildState.key !== bChildState.key\n ) {\n return [a, b];\n }\n\n return findMatchingState(aChildState, bChildState);\n};\n\n/**\n * Run async function in series as it's called.\n */\nconst series = (cb: () => Promise<void>) => {\n // Whether we're currently handling a callback\n let handling = false;\n let queue: (() => Promise<void>)[] = [];\n\n const callback = async () => {\n try {\n if (handling) {\n // If we're currently handling a previous event, wait before handling this one\n // Add the callback to the beginning of the queue\n queue.unshift(callback);\n return;\n }\n\n handling = true;\n\n await cb();\n } finally {\n handling = false;\n\n if (queue.length) {\n // If we have queued items, handle the last one\n const last = queue.pop();\n\n last?.();\n }\n }\n };\n\n return callback;\n};\n\nlet linkingHandlers: Symbol[] = [];\n\ntype Options = LinkingOptions<ParamListBase> & {\n independent?: boolean;\n};\n\nexport default function useLinking(\n ref: React.RefObject<NavigationContainerRef<ParamListBase>>,\n {\n independent,\n enabled = true,\n config,\n getStateFromPath = getStateFromPathDefault,\n getPathFromState = getPathFromStateDefault,\n getActionFromState = getActionFromStateDefault,\n }: Options\n) {\n React.useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return undefined;\n }\n\n if (independent) {\n return undefined;\n }\n\n if (enabled !== false && linkingHandlers.length) {\n console.error(\n [\n 'Looks like you have configured linking in multiple places. This is likely an error since deep links should only be handled in one place to avoid conflicts. Make sure that:',\n \"- You don't have multiple NavigationContainers in the app each with 'linking' enabled\",\n '- Only a single instance of the root component is rendered',\n ]\n .join('\\n')\n .trim()\n );\n }\n\n const handler = Symbol();\n\n if (enabled !== false) {\n linkingHandlers.push(handler);\n }\n\n return () => {\n const index = linkingHandlers.indexOf(handler);\n\n if (index > -1) {\n linkingHandlers.splice(index, 1);\n }\n };\n }, [enabled, independent]);\n\n const [history] = React.useState(createMemoryHistory);\n\n // We store these options in ref to avoid re-creating getInitialState and re-subscribing listeners\n // This lets user avoid wrapping the items in `React.useCallback` or `React.useMemo`\n // Not re-creating `getInitialState` is important coz it makes it easier for the user to use in an effect\n const enabledRef = React.useRef(enabled);\n const configRef = React.useRef(config);\n const getStateFromPathRef = React.useRef(getStateFromPath);\n const getPathFromStateRef = React.useRef(getPathFromState);\n const getActionFromStateRef = React.useRef(getActionFromState);\n\n React.useEffect(() => {\n enabledRef.current = enabled;\n configRef.current = config;\n getStateFromPathRef.current = getStateFromPath;\n getPathFromStateRef.current = getPathFromState;\n getActionFromStateRef.current = getActionFromState;\n });\n\n const server = React.useContext(ServerContext);\n\n const getInitialState = React.useCallback(() => {\n let value: ResultState | undefined;\n\n if (enabledRef.current) {\n const location =\n server?.location ??\n (typeof window !== 'undefined' ? window.location : undefined);\n\n const path = location ? location.pathname + location.search : undefined;\n\n if (path) {\n value = getStateFromPathRef.current(path, configRef.current);\n }\n }\n\n const thenable = {\n then(onfulfilled?: (state: ResultState | undefined) => void) {\n return Promise.resolve(onfulfilled ? onfulfilled(value) : value);\n },\n catch() {\n return thenable;\n },\n };\n\n return thenable as PromiseLike<ResultState | undefined>;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const previousIndexRef = React.useRef<number | undefined>(undefined);\n const previousStateRef = React.useRef<NavigationState | undefined>(undefined);\n const pendingPopStatePathRef = React.useRef<string | undefined>(undefined);\n\n React.useEffect(() => {\n previousIndexRef.current = history.index;\n\n return history.listen(() => {\n const navigation = ref.current;\n\n if (!navigation || !enabled) {\n return;\n }\n\n const path = location.pathname + location.search;\n const index = history.index;\n\n const previousIndex = previousIndexRef.current ?? 0;\n\n previousIndexRef.current = index;\n pendingPopStatePathRef.current = path;\n\n // When browser back/forward is clicked, we first need to check if state object for this index exists\n // If it does we'll reset to that state object\n // Otherwise, we'll handle it like a regular deep link\n const record = history.get(index);\n\n if (record?.path === path && record?.state) {\n navigation.resetRoot(record.state);\n return;\n }\n\n const state = getStateFromPathRef.current(path, configRef.current);\n\n // We should only dispatch an action when going forward\n // Otherwise the action will likely add items to history, which would mess things up\n if (state) {\n // Make sure that the routes in the state exist in the root navigator\n // Otherwise there's an error in the linking configuration\n const rootState = navigation.getRootState();\n\n if (state.routes.some((r) => !rootState?.routeNames.includes(r.name))) {\n console.warn(\n \"The navigation state parsed from the URL contains routes not present in the root navigator. This usually means that the linking configuration doesn't match the navigation structure. See https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration.\"\n );\n return;\n }\n\n if (index > previousIndex) {\n const action = getActionFromStateRef.current(\n state,\n configRef.current\n );\n\n if (action !== undefined) {\n try {\n navigation.dispatch(action);\n } catch (e) {\n // Ignore any errors from deep linking.\n // This could happen in case of malformed links, navigation object not being initialized etc.\n console.warn(\n `An error occurred when trying to handle the link '${path}': ${\n typeof e === 'object' && e != null && 'message' in e\n ? // @ts-expect-error: we're already checking for this\n e.message\n : e\n }`\n );\n }\n } else {\n navigation.resetRoot(state);\n }\n } else {\n navigation.resetRoot(state);\n }\n } else {\n // if current path didn't return any state, we should revert to initial state\n navigation.resetRoot(state);\n }\n });\n }, [enabled, history, ref]);\n\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n\n const getPathForRoute = (\n route: ReturnType<typeof findFocusedRoute>,\n state: NavigationState\n ): string => {\n // If the `route` object contains a `path`, use that path as long as `route.name` and `params` still match\n // This makes sure that we preserve the original URL for wildcard routes\n if (route?.path) {\n const stateForPath = getStateFromPathRef.current(\n route.path,\n configRef.current\n );\n\n if (stateForPath) {\n const focusedRoute = findFocusedRoute(stateForPath);\n\n if (\n focusedRoute &&\n focusedRoute.name === route.name &&\n isEqual(focusedRoute.params, route.params)\n ) {\n return route.path;\n }\n }\n }\n\n return getPathFromStateRef.current(state, configRef.current);\n };\n\n if (ref.current) {\n // We need to record the current metadata on the first render if they aren't set\n // This will allow the initial state to be in the history entry\n const state = ref.current.getRootState();\n\n if (state) {\n const route = findFocusedRoute(state);\n const path = getPathForRoute(route, state);\n\n if (previousStateRef.current === undefined) {\n previousStateRef.current = state;\n }\n\n history.replace({ path, state });\n }\n }\n\n const onStateChange = async () => {\n const navigation = ref.current;\n\n if (!navigation || !enabled) {\n return;\n }\n\n const previousState = previousStateRef.current;\n const state = navigation.getRootState();\n\n // root state may not available, for example when root navigators switch inside the container\n if (!state) {\n return;\n }\n\n const pendingPath = pendingPopStatePathRef.current;\n const route = findFocusedRoute(state);\n const path = getPathForRoute(route, state);\n\n previousStateRef.current = state;\n pendingPopStatePathRef.current = undefined;\n\n // To detect the kind of state change, we need to:\n // - Find the common focused navigation state in previous and current state\n // - If only the route keys changed, compare history/routes.length to check if we go back/forward/replace\n // - If no common focused navigation state found, it's a replace\n const [previousFocusedState, focusedState] = findMatchingState(\n previousState,\n state\n );\n\n if (\n previousFocusedState &&\n focusedState &&\n // We should only handle push/pop if path changed from what was in last `popstate`\n // Otherwise it's likely a change triggered by `popstate`\n path !== pendingPath\n ) {\n const historyDelta =\n (focusedState.history\n ? focusedState.history.length\n : focusedState.routes.length) -\n (previousFocusedState.history\n ? previousFocusedState.history.length\n : previousFocusedState.routes.length);\n\n if (historyDelta > 0) {\n // If history length is increased, we should pushState\n // Note that path might not actually change here, for example, drawer open should pushState\n history.push({ path, state });\n } else if (historyDelta < 0) {\n // If history length is decreased, i.e. entries were removed, we want to go back\n\n const nextIndex = history.backIndex({ path });\n const currentIndex = history.index;\n\n try {\n if (nextIndex !== -1 && nextIndex < currentIndex) {\n // An existing entry for this path exists and it's less than current index, go back to that\n await history.go(nextIndex - currentIndex);\n } else {\n // We couldn't find an existing entry to go back to, so we'll go back by the delta\n // This won't be correct if multiple routes were pushed in one go before\n // Usually this shouldn't happen and this is a fallback for that\n await history.go(historyDelta);\n }\n\n // Store the updated state as well as fix the path if incorrect\n history.replace({ path, state });\n } catch (e) {\n // The navigation was interrupted\n }\n } else {\n // If history length is unchanged, we want to replaceState\n history.replace({ path, state });\n }\n } else {\n // If no common navigation state was found, assume it's a replace\n // This would happen if the user did a reset/conditionally changed navigators\n history.replace({ path, state });\n }\n };\n\n // We debounce onStateChange coz we don't want multiple state changes to be handled at one time\n // This could happen since `history.go(n)` is asynchronous\n // If `pushState` or `replaceState` were called before `history.go(n)` completes, it'll mess stuff up\n return ref.current?.addListener('state', series(onStateChange));\n });\n\n return {\n getInitialState,\n };\n}\n"]}
1
+ {"version":3,"names":["findFocusedRoute","getActionFromState","getActionFromStateDefault","getPathFromState","getPathFromStateDefault","getStateFromPath","getStateFromPathDefault","isEqual","React","createMemoryHistory","ServerContext","findMatchingState","a","b","undefined","key","aHistoryLength","history","length","routes","bHistoryLength","aRoute","index","bRoute","aChildState","state","bChildState","series","cb","handling","queue","callback","unshift","last","pop","linkingHandlers","useLinking","ref","independent","enabled","config","useEffect","process","env","NODE_ENV","console","error","join","trim","handler","Symbol","push","indexOf","splice","useState","enabledRef","useRef","configRef","getStateFromPathRef","getPathFromStateRef","getActionFromStateRef","current","server","useContext","getInitialState","useCallback","value","location","window","path","pathname","search","thenable","then","onfulfilled","Promise","resolve","catch","previousIndexRef","previousStateRef","pendingPopStatePathRef","listen","navigation","previousIndex","record","get","resetRoot","rootState","getRootState","some","r","routeNames","includes","name","warn","action","dispatch","e","message","getPathForRoute","route","stateForPath","focusedRoute","params","replace","onStateChange","previousState","pendingPath","previousFocusedState","focusedState","historyDelta","nextIndex","backIndex","currentIndex","go","addListener"],"sources":["useLinking.tsx"],"sourcesContent":["import {\n findFocusedRoute,\n getActionFromState as getActionFromStateDefault,\n getPathFromState as getPathFromStateDefault,\n getStateFromPath as getStateFromPathDefault,\n NavigationContainerRef,\n NavigationState,\n ParamListBase,\n} from '@react-navigation/core';\nimport isEqual from 'fast-deep-equal';\nimport * as React from 'react';\n\nimport createMemoryHistory from './createMemoryHistory';\nimport ServerContext from './ServerContext';\nimport type { LinkingOptions } from './types';\n\ntype ResultState = ReturnType<typeof getStateFromPathDefault>;\n\n/**\n * Find the matching navigation state that changed between 2 navigation states\n * e.g.: a -> b -> c -> d and a -> b -> c -> e -> f, if history in b changed, b is the matching state\n */\nconst findMatchingState = <T extends NavigationState>(\n a: T | undefined,\n b: T | undefined\n): [T | undefined, T | undefined] => {\n if (a === undefined || b === undefined || a.key !== b.key) {\n return [undefined, undefined];\n }\n\n // Tab and drawer will have `history` property, but stack will have history in `routes`\n const aHistoryLength = a.history ? a.history.length : a.routes.length;\n const bHistoryLength = b.history ? b.history.length : b.routes.length;\n\n const aRoute = a.routes[a.index];\n const bRoute = b.routes[b.index];\n\n const aChildState = aRoute.state as T | undefined;\n const bChildState = bRoute.state as T | undefined;\n\n // Stop here if this is the state object that changed:\n // - history length is different\n // - focused routes are different\n // - one of them doesn't have child state\n // - child state keys are different\n if (\n aHistoryLength !== bHistoryLength ||\n aRoute.key !== bRoute.key ||\n aChildState === undefined ||\n bChildState === undefined ||\n aChildState.key !== bChildState.key\n ) {\n return [a, b];\n }\n\n return findMatchingState(aChildState, bChildState);\n};\n\n/**\n * Run async function in series as it's called.\n */\nconst series = (cb: () => Promise<void>) => {\n // Whether we're currently handling a callback\n let handling = false;\n let queue: (() => Promise<void>)[] = [];\n\n const callback = async () => {\n try {\n if (handling) {\n // If we're currently handling a previous event, wait before handling this one\n // Add the callback to the beginning of the queue\n queue.unshift(callback);\n return;\n }\n\n handling = true;\n\n await cb();\n } finally {\n handling = false;\n\n if (queue.length) {\n // If we have queued items, handle the last one\n const last = queue.pop();\n\n last?.();\n }\n }\n };\n\n return callback;\n};\n\nlet linkingHandlers: Symbol[] = [];\n\ntype Options = LinkingOptions<ParamListBase> & {\n independent?: boolean;\n};\n\nexport default function useLinking(\n ref: React.RefObject<NavigationContainerRef<ParamListBase>>,\n {\n independent,\n enabled = true,\n config,\n getStateFromPath = getStateFromPathDefault,\n getPathFromState = getPathFromStateDefault,\n getActionFromState = getActionFromStateDefault,\n }: Options\n) {\n React.useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return undefined;\n }\n\n if (independent) {\n return undefined;\n }\n\n if (enabled !== false && linkingHandlers.length) {\n console.error(\n [\n 'Looks like you have configured linking in multiple places. This is likely an error since deep links should only be handled in one place to avoid conflicts. Make sure that:',\n \"- You don't have multiple NavigationContainers in the app each with 'linking' enabled\",\n '- Only a single instance of the root component is rendered',\n ]\n .join('\\n')\n .trim()\n );\n }\n\n const handler = Symbol();\n\n if (enabled !== false) {\n linkingHandlers.push(handler);\n }\n\n return () => {\n const index = linkingHandlers.indexOf(handler);\n\n if (index > -1) {\n linkingHandlers.splice(index, 1);\n }\n };\n }, [enabled, independent]);\n\n const [history] = React.useState(createMemoryHistory);\n\n // We store these options in ref to avoid re-creating getInitialState and re-subscribing listeners\n // This lets user avoid wrapping the items in `React.useCallback` or `React.useMemo`\n // Not re-creating `getInitialState` is important coz it makes it easier for the user to use in an effect\n const enabledRef = React.useRef(enabled);\n const configRef = React.useRef(config);\n const getStateFromPathRef = React.useRef(getStateFromPath);\n const getPathFromStateRef = React.useRef(getPathFromState);\n const getActionFromStateRef = React.useRef(getActionFromState);\n\n React.useEffect(() => {\n enabledRef.current = enabled;\n configRef.current = config;\n getStateFromPathRef.current = getStateFromPath;\n getPathFromStateRef.current = getPathFromState;\n getActionFromStateRef.current = getActionFromState;\n });\n\n const server = React.useContext(ServerContext);\n\n const getInitialState = React.useCallback(() => {\n let value: ResultState | undefined;\n\n if (enabledRef.current) {\n const location =\n server?.location ??\n (typeof window !== 'undefined' ? window.location : undefined);\n\n const path = location ? location.pathname + location.search : undefined;\n\n if (path) {\n value = getStateFromPathRef.current(path, configRef.current);\n }\n }\n\n const thenable = {\n then(onfulfilled?: (state: ResultState | undefined) => void) {\n return Promise.resolve(onfulfilled ? onfulfilled(value) : value);\n },\n catch() {\n return thenable;\n },\n };\n\n return thenable as PromiseLike<ResultState | undefined>;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const previousIndexRef = React.useRef<number | undefined>(undefined);\n const previousStateRef = React.useRef<NavigationState | undefined>(undefined);\n const pendingPopStatePathRef = React.useRef<string | undefined>(undefined);\n\n React.useEffect(() => {\n previousIndexRef.current = history.index;\n\n return history.listen(() => {\n const navigation = ref.current;\n\n if (!navigation || !enabled) {\n return;\n }\n\n const path = location.pathname + location.search;\n const index = history.index;\n\n const previousIndex = previousIndexRef.current ?? 0;\n\n previousIndexRef.current = index;\n pendingPopStatePathRef.current = path;\n\n // When browser back/forward is clicked, we first need to check if state object for this index exists\n // If it does we'll reset to that state object\n // Otherwise, we'll handle it like a regular deep link\n const record = history.get(index);\n\n if (record?.path === path && record?.state) {\n navigation.resetRoot(record.state);\n return;\n }\n\n const state = getStateFromPathRef.current(path, configRef.current);\n\n // We should only dispatch an action when going forward\n // Otherwise the action will likely add items to history, which would mess things up\n if (state) {\n // Make sure that the routes in the state exist in the root navigator\n // Otherwise there's an error in the linking configuration\n const rootState = navigation.getRootState();\n\n if (state.routes.some((r) => !rootState?.routeNames.includes(r.name))) {\n console.warn(\n \"The navigation state parsed from the URL contains routes not present in the root navigator. This usually means that the linking configuration doesn't match the navigation structure. See https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration.\"\n );\n return;\n }\n\n if (index > previousIndex) {\n const action = getActionFromStateRef.current(\n state,\n configRef.current\n );\n\n if (action !== undefined) {\n try {\n navigation.dispatch(action);\n } catch (e) {\n // Ignore any errors from deep linking.\n // This could happen in case of malformed links, navigation object not being initialized etc.\n console.warn(\n `An error occurred when trying to handle the link '${path}': ${\n typeof e === 'object' && e != null && 'message' in e\n ? // @ts-expect-error: we're already checking for this\n e.message\n : e\n }`\n );\n }\n } else {\n navigation.resetRoot(state);\n }\n } else {\n navigation.resetRoot(state);\n }\n } else {\n // if current path didn't return any state, we should revert to initial state\n navigation.resetRoot(state);\n }\n });\n }, [enabled, history, ref]);\n\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n\n const getPathForRoute = (\n route: ReturnType<typeof findFocusedRoute>,\n state: NavigationState\n ): string => {\n // If the `route` object contains a `path`, use that path as long as `route.name` and `params` still match\n // This makes sure that we preserve the original URL for wildcard routes\n if (route?.path) {\n const stateForPath = getStateFromPathRef.current(\n route.path,\n configRef.current\n );\n\n if (stateForPath) {\n const focusedRoute = findFocusedRoute(stateForPath);\n\n if (\n focusedRoute &&\n focusedRoute.name === route.name &&\n isEqual(focusedRoute.params, route.params)\n ) {\n return route.path;\n }\n }\n }\n\n return getPathFromStateRef.current(state, configRef.current);\n };\n\n if (ref.current) {\n // We need to record the current metadata on the first render if they aren't set\n // This will allow the initial state to be in the history entry\n const state = ref.current.getRootState();\n\n if (state) {\n const route = findFocusedRoute(state);\n const path = getPathForRoute(route, state);\n\n if (previousStateRef.current === undefined) {\n previousStateRef.current = state;\n }\n\n history.replace({ path, state });\n }\n }\n\n const onStateChange = async () => {\n const navigation = ref.current;\n\n if (!navigation || !enabled) {\n return;\n }\n\n const previousState = previousStateRef.current;\n const state = navigation.getRootState();\n\n // root state may not available, for example when root navigators switch inside the container\n if (!state) {\n return;\n }\n\n const pendingPath = pendingPopStatePathRef.current;\n const route = findFocusedRoute(state);\n const path = getPathForRoute(route, state);\n\n previousStateRef.current = state;\n pendingPopStatePathRef.current = undefined;\n\n // To detect the kind of state change, we need to:\n // - Find the common focused navigation state in previous and current state\n // - If only the route keys changed, compare history/routes.length to check if we go back/forward/replace\n // - If no common focused navigation state found, it's a replace\n const [previousFocusedState, focusedState] = findMatchingState(\n previousState,\n state\n );\n\n if (\n previousFocusedState &&\n focusedState &&\n // We should only handle push/pop if path changed from what was in last `popstate`\n // Otherwise it's likely a change triggered by `popstate`\n path !== pendingPath\n ) {\n const historyDelta =\n (focusedState.history\n ? focusedState.history.length\n : focusedState.routes.length) -\n (previousFocusedState.history\n ? previousFocusedState.history.length\n : previousFocusedState.routes.length);\n\n if (historyDelta > 0) {\n // If history length is increased, we should pushState\n // Note that path might not actually change here, for example, drawer open should pushState\n history.push({ path, state });\n } else if (historyDelta < 0) {\n // If history length is decreased, i.e. entries were removed, we want to go back\n\n const nextIndex = history.backIndex({ path });\n const currentIndex = history.index;\n\n try {\n if (nextIndex !== -1 && nextIndex < currentIndex) {\n // An existing entry for this path exists and it's less than current index, go back to that\n await history.go(nextIndex - currentIndex);\n } else {\n // We couldn't find an existing entry to go back to, so we'll go back by the delta\n // This won't be correct if multiple routes were pushed in one go before\n // Usually this shouldn't happen and this is a fallback for that\n await history.go(historyDelta);\n }\n\n // Store the updated state as well as fix the path if incorrect\n history.replace({ path, state });\n } catch (e) {\n // The navigation was interrupted\n }\n } else {\n // If history length is unchanged, we want to replaceState\n history.replace({ path, state });\n }\n } else {\n // If no common navigation state was found, assume it's a replace\n // This would happen if the user did a reset/conditionally changed navigators\n history.replace({ path, state });\n }\n };\n\n // We debounce onStateChange coz we don't want multiple state changes to be handled at one time\n // This could happen since `history.go(n)` is asynchronous\n // If `pushState` or `replaceState` were called before `history.go(n)` completes, it'll mess stuff up\n return ref.current?.addListener('state', series(onStateChange));\n });\n\n return {\n getInitialState,\n };\n}\n"],"mappings":"AAAA,SACEA,gBADF,EAEEC,kBAAkB,IAAIC,yBAFxB,EAGEC,gBAAgB,IAAIC,uBAHtB,EAIEC,gBAAgB,IAAIC,uBAJtB,QAQO,wBARP;AASA,OAAOC,OAAP,MAAoB,iBAApB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,mBAAP,MAAgC,uBAAhC;AACA,OAAOC,aAAP,MAA0B,iBAA1B;;AAKA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAG,CACxBC,CADwB,EAExBC,CAFwB,KAGW;EACnC,IAAID,CAAC,KAAKE,SAAN,IAAmBD,CAAC,KAAKC,SAAzB,IAAsCF,CAAC,CAACG,GAAF,KAAUF,CAAC,CAACE,GAAtD,EAA2D;IACzD,OAAO,CAACD,SAAD,EAAYA,SAAZ,CAAP;EACD,CAHkC,CAKnC;;;EACA,MAAME,cAAc,GAAGJ,CAAC,CAACK,OAAF,GAAYL,CAAC,CAACK,OAAF,CAAUC,MAAtB,GAA+BN,CAAC,CAACO,MAAF,CAASD,MAA/D;EACA,MAAME,cAAc,GAAGP,CAAC,CAACI,OAAF,GAAYJ,CAAC,CAACI,OAAF,CAAUC,MAAtB,GAA+BL,CAAC,CAACM,MAAF,CAASD,MAA/D;EAEA,MAAMG,MAAM,GAAGT,CAAC,CAACO,MAAF,CAASP,CAAC,CAACU,KAAX,CAAf;EACA,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