repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 14.8 kB
JSON
{"ast":null,"code":"import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"initialMetrics\", \"initialSafeAreaInsets\", \"style\"],\n _excluded2 = [\"onChange\", \"style\", \"children\"];\nfunction _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nimport * as React from 'react';\nimport Dimensions from \"react-native-web/dist/exports/Dimensions\";\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport { NativeSafeAreaProvider } from \"./NativeSafeAreaProvider\";\nconst isDev = process.env.NODE_ENV !== 'production';\nexport const SafeAreaInsetsContext = React.createContext(null);\nif (isDev) {\n SafeAreaInsetsContext.displayName = 'SafeAreaInsetsContext';\n}\nexport const SafeAreaFrameContext = React.createContext(null);\nif (isDev) {\n SafeAreaFrameContext.displayName = 'SafeAreaFrameContext';\n}\nexport function SafeAreaProvider(_ref) {\n let {\n children,\n initialMetrics,\n initialSafeAreaInsets,\n style\n } = _ref,\n others = _objectWithoutPropertiesLoose(_ref, _excluded);\n const parentInsets = useParentSafeAreaInsets();\n const parentFrame = useParentSafeAreaFrame();\n const [insets, setInsets] = React.useState(initialMetrics?.insets ?? initialSafeAreaInsets ?? parentInsets ?? null);\n const [frame, setFrame] = React.useState(initialMetrics?.frame ?? parentFrame ?? {\n x: 0,\n y: 0,\n width: Dimensions.get('window').width,\n height: Dimensions.get('window').height\n });\n const onInsetsChange = React.useCallback(event => {\n const {\n nativeEvent: {\n frame: nextFrame,\n insets: nextInsets\n }\n } = event;\n setFrame(curFrame => {\n if (nextFrame && (nextFrame.height !== curFrame.height || nextFrame.width !== curFrame.width || nextFrame.x !== curFrame.x || nextFrame.y !== curFrame.y)) {\n return nextFrame;\n } else {\n return curFrame;\n }\n });\n setInsets(curInsets => {\n if (!curInsets || nextInsets.bottom !== curInsets.bottom || nextInsets.left !== curInsets.left || nextInsets.right !== curInsets.right || nextInsets.top !== curInsets.top) {\n return nextInsets;\n } else {\n return curInsets;\n }\n });\n }, []);\n return React.createElement(NativeSafeAreaProvider, _extends({\n style: [styles.fill, style],\n onInsetsChange: onInsetsChange\n }, others), insets != null ? React.createElement(SafeAreaFrameContext.Provider, {\n value: frame\n }, React.createElement(SafeAreaInsetsContext.Provider, {\n value: insets\n }, children)) : null);\n}\nexport function SafeAreaListener(_ref2) {\n let {\n onChange,\n style,\n children\n } = _ref2,\n others = _objectWithoutPropertiesLoose(_ref2, _excluded2);\n return React.createElement(NativeSafeAreaProvider, _extends({}, others, {\n style: [styles.fill, style],\n onInsetsChange: e => {\n onChange({\n insets: e.nativeEvent.insets,\n frame: e.nativeEvent.frame\n });\n }\n }), children);\n}\nconst styles = StyleSheet.create({\n fill: {\n flex: 1\n }\n});\nfunction useParentSafeAreaInsets() {\n return React.useContext(SafeAreaInsetsContext);\n}\nfunction useParentSafeAreaFrame() {\n return React.useContext(SafeAreaFrameContext);\n}\nconst NO_INSETS_ERROR = 'No safe area value available. Make sure you are rendering `<SafeAreaProvider>` at the top of your app.';\nexport function useSafeAreaInsets() {\n const insets = React.useContext(SafeAreaInsetsContext);\n if (insets == null) {\n throw new Error(NO_INSETS_ERROR);\n }\n return insets;\n}\nexport function useSafeAreaFrame() {\n const frame = React.useContext(SafeAreaFrameContext);\n if (frame == null) {\n throw new Error(NO_INSETS_ERROR);\n }\n return frame;\n}\nexport function withSafeAreaInsets(WrappedComponent) {\n return React.forwardRef((props, ref) => {\n const insets = useSafeAreaInsets();\n return React.createElement(WrappedComponent, _extends({}, props, {\n insets: insets,\n ref: ref\n }));\n });\n}\nexport function useSafeArea() {\n return useSafeAreaInsets();\n}\nexport const SafeAreaConsumer = SafeAreaInsetsContext.Consumer;\nexport const SafeAreaContext = SafeAreaInsetsContext;","map":{"version":3,"names":["React","Dimensions","StyleSheet","NativeSafeAreaProvider","isDev","process","env","NODE_ENV","SafeAreaInsetsContext","createContext","displayName","SafeAreaFrameContext","SafeAreaProvider","_ref","children","initialMetrics","initialSafeAreaInsets","style","others","_objectWithoutPropertiesLoose","_excluded","parentInsets","useParentSafeAreaInsets","parentFrame","useParentSafeAreaFrame","insets","setInsets","useState","frame","setFrame","x","y","width","get","height","onInsetsChange","useCallback","event","nativeEvent","nextFrame","nextInsets","curFrame","curInsets","bottom","left","right","top","createElement","_extends","styles","fill","Provider","value","SafeAreaListener","_ref2","onChange","_excluded2","e","create","flex","useContext","NO_INSETS_ERROR","useSafeAreaInsets","Error","useSafeAreaFrame","withSafeAreaInsets","WrappedComponent","forwardRef","props","ref","useSafeArea","SafeAreaConsumer","Consumer","SafeAreaContext"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-safe-area-context/src/SafeAreaContext.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Dimensions, StyleSheet, type ViewProps } from 'react-native';\nimport { NativeSafeAreaProvider } from './NativeSafeAreaProvider';\nimport type {\n EdgeInsets,\n InsetChangedEvent,\n Metrics,\n Rect,\n} from './SafeArea.types';\n\nconst isDev = process.env.NODE_ENV !== 'production';\n\nexport const SafeAreaInsetsContext = React.createContext<EdgeInsets | null>(\n null,\n);\nif (isDev) {\n SafeAreaInsetsContext.displayName = 'SafeAreaInsetsContext';\n}\n\nexport const SafeAreaFrameContext = React.createContext<Rect | null>(null);\nif (isDev) {\n SafeAreaFrameContext.displayName = 'SafeAreaFrameContext';\n}\n\nexport interface SafeAreaProviderProps extends ViewProps {\n children?: React.ReactNode;\n initialMetrics?: Metrics | null;\n /**\n * @deprecated\n */\n initialSafeAreaInsets?: EdgeInsets | null;\n}\n\nexport function SafeAreaProvider({\n children,\n initialMetrics,\n initialSafeAreaInsets,\n style,\n ...others\n}: SafeAreaProviderProps) {\n const parentInsets = useParentSafeAreaInsets();\n const parentFrame = useParentSafeAreaFrame();\n const [insets, setInsets] = React.useState<EdgeInsets | null>(\n initialMetrics?.insets ?? initialSafeAreaInsets ?? parentInsets ?? null,\n );\n const [frame, setFrame] = React.useState<Rect>(\n initialMetrics?.frame ??\n parentFrame ?? {\n // Backwards compat so we render anyway if we don't have frame.\n x: 0,\n y: 0,\n width: Dimensions.get('window').width,\n height: Dimensions.get('window').height,\n },\n );\n const onInsetsChange = React.useCallback((event: InsetChangedEvent) => {\n const {\n nativeEvent: { frame: nextFrame, insets: nextInsets },\n } = event;\n\n setFrame((curFrame) => {\n if (\n // Backwards compat with old native code that won't send frame.\n nextFrame &&\n (nextFrame.height !== curFrame.height ||\n nextFrame.width !== curFrame.width ||\n nextFrame.x !== curFrame.x ||\n nextFrame.y !== curFrame.y)\n ) {\n return nextFrame;\n } else {\n return curFrame;\n }\n });\n\n setInsets((curInsets) => {\n if (\n !curInsets ||\n nextInsets.bottom !== curInsets.bottom ||\n nextInsets.left !== curInsets.left ||\n nextInsets.right !== curInsets.right ||\n nextInsets.top !== curInsets.top\n ) {\n return nextInsets;\n } else {\n return curInsets;\n }\n });\n }, []);\n\n return (\n <NativeSafeAreaProvider\n style={[styles.fill, style]}\n onInsetsChange={onInsetsChange}\n {...others}\n >\n {insets != null ? (\n <SafeAreaFrameContext.Provider value={frame}>\n <SafeAreaInsetsContext.Provider value={insets}>\n {children}\n </SafeAreaInsetsContext.Provider>\n </SafeAreaFrameContext.Provider>\n ) : null}\n </NativeSafeAreaProvider>\n );\n}\n\nexport interface SafeAreaListenerProps extends ViewProps {\n onChange: (data: { insets: EdgeInsets; frame: Rect }) => void;\n}\n\nexport function SafeAreaListener({\n onChange,\n style,\n children,\n ...others\n}: SafeAreaListenerProps) {\n return (\n <NativeSafeAreaProvider\n {...others}\n style={[styles.fill, style]}\n onInsetsChange={(e) => {\n onChange({\n insets: e.nativeEvent.insets,\n frame: e.nativeEvent.frame,\n });\n }}\n >\n {children}\n </NativeSafeAreaProvider>\n );\n}\n\nconst styles = StyleSheet.create({\n fill: { flex: 1 },\n});\n\nfunction useParentSafeAreaInsets(): EdgeInsets | null {\n return React.useContext(SafeAreaInsetsContext);\n}\n\nfunction useParentSafeAreaFrame(): Rect | null {\n return React.useContext(SafeAreaFrameContext);\n}\n\nconst NO_INSETS_ERROR =\n 'No safe area value available. Make sure you are rendering `<SafeAreaProvider>` at the top of your app.';\n\nexport function useSafeAreaInsets(): EdgeInsets {\n const insets = React.useContext(SafeAreaInsetsContext);\n if (insets == null) {\n throw new Error(NO_INSETS_ERROR);\n }\n return insets;\n}\n\nexport function useSafeAreaFrame(): Rect {\n const frame = React.useContext(SafeAreaFrameContext);\n if (frame == null) {\n throw new Error(NO_INSETS_ERROR);\n }\n return frame;\n}\n\nexport type WithSafeAreaInsetsProps = {\n insets: EdgeInsets;\n};\n\nexport function withSafeAreaInsets<T>(\n WrappedComponent: React.ComponentType<\n (React.PropsWithoutRef<T> | T) & WithSafeAreaInsetsProps\n >,\n): React.ForwardRefExoticComponent<\n React.PropsWithoutRef<T> & React.RefAttributes<unknown>\n> {\n return React.forwardRef<unknown, T>((props, ref) => {\n const insets = useSafeAreaInsets();\n return <WrappedComponent {...props} insets={insets} ref={ref} />;\n });\n}\n\n/**\n * @deprecated\n */\nexport function useSafeArea(): EdgeInsets {\n return useSafeAreaInsets();\n}\n\n/**\n * @deprecated\n */\nexport const SafeAreaConsumer = SafeAreaInsetsContext.Consumer;\n\n/**\n * @deprecated\n */\nexport const SafeAreaContext = SafeAreaInsetsContext;\n"],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAA,OAAAC,UAAA;AAAA,OAAAC,UAAA;AAE9B,SAASC,sBAAsB;AAQ/B,MAAMC,KAAK,GAAGC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY;AAEnD,OAAO,MAAMC,qBAAqB,GAAGR,KAAK,CAACS,aAA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