mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-04-29 18:27:58 +00:00
1 line
11 KiB
Plaintext
1 line
11 KiB
Plaintext
{"dependencies":[{"name":"react","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":3,"column":0,"index":15},"end":{"line":3,"column":31,"index":46}}],"key":"RtGiGa+/H7VrI7GDQDLhO1UbpU8=","exportNames":["*"]}},{"name":"./NavigationContext.js","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":4,"column":0,"index":47},"end":{"line":4,"column":59,"index":106}}],"key":"RM0XoJ1uy5+hqq85ZlLNt6FYuco=","exportNames":["*"]}}],"output":[{"data":{"code":"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.useFocusEvents = useFocusEvents;\n var React = _interopRequireWildcard(require(_dependencyMap[0], \"react\"));\n var _NavigationContext = require(_dependencyMap[1], \"./NavigationContext.js\");\n function _interopRequireWildcard(e, t) { if (\"function\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \"default\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }\n /**\n * Hook to take care of emitting `focus` and `blur` events.\n */\n function useFocusEvents({\n state,\n emitter\n }) {\n const navigation = React.useContext(_NavigationContext.NavigationContext);\n const lastFocusedKeyRef = React.useRef(undefined);\n const currentFocusedKey = state.routes[state.index].key;\n\n // When the parent screen changes its focus state, we also need to change child's focus\n // Coz the child screen can't be focused if the parent screen is out of focus\n React.useEffect(() => navigation?.addListener('focus', () => {\n lastFocusedKeyRef.current = currentFocusedKey;\n emitter.emit({\n type: 'focus',\n target: currentFocusedKey\n });\n }), [currentFocusedKey, emitter, navigation]);\n React.useEffect(() => navigation?.addListener('blur', () => {\n lastFocusedKeyRef.current = undefined;\n emitter.emit({\n type: 'blur',\n target: currentFocusedKey\n });\n }), [currentFocusedKey, emitter, navigation]);\n React.useEffect(() => {\n const lastFocusedKey = lastFocusedKeyRef.current;\n lastFocusedKeyRef.current = currentFocusedKey;\n\n // We wouldn't have `lastFocusedKey` on initial mount\n // Fire focus event for the current route on mount if there's no parent navigator\n if (lastFocusedKey === undefined && !navigation) {\n emitter.emit({\n type: 'focus',\n target: currentFocusedKey\n });\n }\n\n // We should only emit events when the focused key changed and navigator is focused\n // When navigator is not focused, screens inside shouldn't receive focused status either\n if (lastFocusedKey === currentFocusedKey || !(navigation ? navigation.isFocused() : true)) {\n return;\n }\n if (lastFocusedKey === undefined) {\n // Only fire events after initial mount\n return;\n }\n emitter.emit({\n type: 'blur',\n target: lastFocusedKey\n });\n emitter.emit({\n type: 'focus',\n target: currentFocusedKey\n });\n }, [currentFocusedKey, emitter, navigation]);\n }\n});","lineCount":70,"map":[[2,2,1,0],[2,14,1,12],[4,2,1,13,"Object"],[4,8,1,13],[4,9,1,13,"defineProperty"],[4,23,1,13],[4,24,1,13,"exports"],[4,31,1,13],[5,4,1,13,"value"],[5,9,1,13],[6,2,1,13],[7,2,1,13,"exports"],[7,9,1,13],[7,10,1,13,"useFocusEvents"],[7,24,1,13],[7,27,1,13,"useFocusEvents"],[7,41,1,13],[8,2,3,0],[8,6,3,0,"React"],[8,11,3,0],[8,14,3,0,"_interopRequireWildcard"],[8,37,3,0],[8,38,3,0,"require"],[8,45,3,0],[8,46,3,0,"_dependencyMap"],[8,60,3,0],[9,2,4,0],[9,6,4,0,"_NavigationContext"],[9,24,4,0],[9,27,4,0,"require"],[9,34,4,0],[9,35,4,0,"_dependencyMap"],[9,49,4,0],[10,2,4,59],[10,11,4,59,"_interopRequireWildcard"],[10,35,4,59,"e"],[10,36,4,59],[10,38,4,59,"t"],[10,39,4,59],[10,68,4,59,"WeakMap"],[10,75,4,59],[10,81,4,59,"r"],[10,82,4,59],[10,89,4,59,"WeakMap"],[10,96,4,59],[10,100,4,59,"n"],[10,101,4,59],[10,108,4,59,"WeakMap"],[10,115,4,59],[10,127,4,59,"_interopRequireWildcard"],[10,150,4,59],[10,162,4,59,"_interopRequireWildcard"],[10,163,4,59,"e"],[10,164,4,59],[10,166,4,59,"t"],[10,167,4,59],[10,176,4,59,"t"],[10,177,4,59],[10,181,4,59,"e"],[10,182,4,59],[10,186,4,59,"e"],[10,187,4,59],[10,188,4,59,"__esModule"],[10,198,4,59],[10,207,4,59,"e"],[10,208,4,59],[10,214,4,59,"o"],[10,215,4,59],[10,217,4,59,"i"],[10,218,4,59],[10,220,4,59,"f"],[10,221,4,59],[10,226,4,59,"__proto__"],[10,235,4,59],[10,243,4,59,"default"],[10,250,4,59],[10,252,4,59,"e"],[10,253,4,59],[10,270,4,59,"e"],[10,271,4,59],[10,294,4,59,"e"],[10,295,4,59],[10,320,4,59,"e"],[10,321,4,59],[10,330,4,59,"f"],[10,331,4,59],[10,337,4,59,"o"],[10,338,4,59],[10,341,4,59,"t"],[10,342,4,59],[10,345,4,59,"n"],[10,346,4,59],[10,349,4,59,"r"],[10,350,4,59],[10,358,4,59,"o"],[10,359,4,59],[10,360,4,59,"has"],[10,363,4,59],[10,364,4,59,"e"],[10,365,4,59],[10,375,4,59,"o"],[10,376,4,59],[10,377,4,59,"get"],[10,380,4,59],[10,381,4,59,"e"],[10,382,4,59],[10,385,4,59,"o"],[10,386,4,59],[10,387,4,59,"set"],[10,390,4,59],[10,391,4,59,"e"],[10,392,4,59],[10,394,4,59,"f"],[10,395,4,59],[10,411,4,59,"t"],[10,412,4,59],[10,416,4,59,"e"],[10,417,4,59],[10,433,4,59,"t"],[10,434,4,59],[10,441,4,59,"hasOwnProperty"],[10,455,4,59],[10,456,4,59,"call"],[10,460,4,59],[10,461,4,59,"e"],[10,462,4,59],[10,464,4,59,"t"],[10,465,4,59],[10,472,4,59,"i"],[10,473,4,59],[10,477,4,59,"o"],[10,478,4,59],[10,481,4,59,"Object"],[10,487,4,59],[10,488,4,59,"defineProperty"],[10,502,4,59],[10,507,4,59,"Object"],[10,513,4,59],[10,514,4,59,"getOwnPropertyDescriptor"],[10,538,4,59],[10,539,4,59,"e"],[10,540,4,59],[10,542,4,59,"t"],[10,543,4,59],[10,550,4,59,"i"],[10,551,4,59],[10,552,4,59,"get"],[10,555,4,59],[10,559,4,59,"i"],[10,560,4,59],[10,561,4,59,"set"],[10,564,4,59],[10,568,4,59,"o"],[10,569,4,59],[10,570,4,59,"f"],[10,571,4,59],[10,573,4,59,"t"],[10,574,4,59],[10,576,4,59,"i"],[10,577,4,59],[10,581,4,59,"f"],[10,582,4,59],[10,583,4,59,"t"],[10,584,4,59],[10,588,4,59,"e"],[10,589,4,59],[10,590,4,59,"t"],[10,591,4,59],[10,602,4,59,"f"],[10,603,4,59],[10,608,4,59,"e"],[10,609,4,59],[10,611,4,59,"t"],[10,612,4,59],[11,2,5,0],[12,0,6,0],[13,0,7,0],[14,2,8,7],[14,11,8,16,"useFocusEvents"],[14,25,8,30,"useFocusEvents"],[14,26,8,31],[15,4,9,2,"state"],[15,9,9,7],[16,4,10,2,"emitter"],[17,2,11,0],[17,3,11,1],[17,5,11,3],[18,4,12,2],[18,10,12,8,"navigation"],[18,20,12,18],[18,23,12,21,"React"],[18,28,12,26],[18,29,12,27,"useContext"],[18,39,12,37],[18,40,12,38,"NavigationContext"],[18,76,12,55],[18,77,12,56],[19,4,13,2],[19,10,13,8,"lastFocusedKeyRef"],[19,27,13,25],[19,30,13,28,"React"],[19,35,13,33],[19,36,13,34,"useRef"],[19,42,13,40],[19,43,13,41,"undefined"],[19,52,13,50],[19,53,13,51],[20,4,14,2],[20,10,14,8,"currentFocusedKey"],[20,27,14,25],[20,30,14,28,"state"],[20,35,14,33],[20,36,14,34,"routes"],[20,42,14,40],[20,43,14,41,"state"],[20,48,14,46],[20,49,14,47,"index"],[20,54,14,52],[20,55,14,53],[20,56,14,54,"key"],[20,59,14,57],[22,4,16,2],[23,4,17,2],[24,4,18,2,"React"],[24,9,18,7],[24,10,18,8,"useEffect"],[24,19,18,17],[24,20,18,18],[24,26,18,24,"navigation"],[24,36,18,34],[24,38,18,36,"addListener"],[24,49,18,47],[24,50,18,48],[24,57,18,55],[24,59,18,57],[24,65,18,63],[25,6,19,4,"lastFocusedKeyRef"],[25,23,19,21],[25,24,19,22,"current"],[25,31,19,29],[25,34,19,32,"currentFocusedKey"],[25,51,19,49],[26,6,20,4,"emitter"],[26,13,20,11],[26,14,20,12,"emit"],[26,18,20,16],[26,19,20,17],[27,8,21,6,"type"],[27,12,21,10],[27,14,21,12],[27,21,21,19],[28,8,22,6,"target"],[28,14,22,12],[28,16,22,14,"currentFocusedKey"],[29,6,23,4],[29,7,23,5],[29,8,23,6],[30,4,24,2],[30,5,24,3],[30,6,24,4],[30,8,24,6],[30,9,24,7,"currentFocusedKey"],[30,26,24,24],[30,28,24,26,"emitter"],[30,35,24,33],[30,37,24,35,"navigation"],[30,47,24,45],[30,48,24,46],[30,49,24,47],[31,4,25,2,"React"],[31,9,25,7],[31,10,25,8,"useEffect"],[31,19,25,17],[31,20,25,18],[31,26,25,24,"navigation"],[31,36,25,34],[31,38,25,36,"addListener"],[31,49,25,47],[31,50,25,48],[31,56,25,54],[31,58,25,56],[31,64,25,62],[32,6,26,4,"lastFocusedKeyRef"],[32,23,26,21],[32,24,26,22,"current"],[32,31,26,29],[32,34,26,32,"undefined"],[32,43,26,41],[33,6,27,4,"emitter"],[33,13,27,11],[33,14,27,12,"emit"],[33,18,27,16],[33,19,27,17],[34,8,28,6,"type"],[34,12,28,10],[34,14,28,12],[34,20,28,18],[35,8,29,6,"target"],[35,14,29,12],[35,16,29,14,"currentFocusedKey"],[36,6,30,4],[36,7,30,5],[36,8,30,6],[37,4,31,2],[37,5,31,3],[37,6,31,4],[37,8,31,6],[37,9,31,7,"currentFocusedKey"],[37,26,31,24],[37,28,31,26,"emitter"],[37,35,31,33],[37,37,31,35,"navigation"],[37,47,31,45],[37,48,31,46],[37,49,31,47],[38,4,32,2,"React"],[38,9,32,7],[38,10,32,8,"useEffect"],[38,19,32,17],[38,20,32,18],[38,26,32,24],[39,6,33,4],[39,12,33,10,"lastFocusedKey"],[39,26,33,24],[39,29,33,27,"lastFocusedKeyRef"],[39,46,33,44],[39,47,33,45,"current"],[39,54,33,52],[40,6,34,4,"lastFocusedKeyRef"],[40,23,34,21],[40,24,34,22,"current"],[40,31,34,29],[40,34,34,32,"currentFocusedKey"],[40,51,34,49],[42,6,36,4],[43,6,37,4],[44,6,38,4],[44,10,38,8,"lastFocusedKey"],[44,24,38,22],[44,29,38,27,"undefined"],[44,38,38,36],[44,42,38,40],[44,43,38,41,"navigation"],[44,53,38,51],[44,55,38,53],[45,8,39,6,"emitter"],[45,15,39,13],[45,16,39,14,"emit"],[45,20,39,18],[45,21,39,19],[46,10,40,8,"type"],[46,14,40,12],[46,16,40,14],[46,23,40,21],[47,10,41,8,"target"],[47,16,41,14],[47,18,41,16,"currentFocusedKey"],[48,8,42,6],[48,9,42,7],[48,10,42,8],[49,6,43,4],[51,6,45,4],[52,6,46,4],[53,6,47,4],[53,10,47,8,"lastFocusedKey"],[53,24,47,22],[53,29,47,27,"currentFocusedKey"],[53,46,47,44],[53,50,47,48],[53,52,47,50,"navigation"],[53,62,47,60],[53,65,47,63,"navigation"],[53,75,47,73],[53,76,47,74,"isFocused"],[53,85,47,83],[53,86,47,84],[53,87,47,85],[53,90,47,88],[53,94,47,92],[53,95,47,93],[53,97,47,95],[54,8,48,6],[55,6,49,4],[56,6,50,4],[56,10,50,8,"lastFocusedKey"],[56,24,50,22],[56,29,50,27,"undefined"],[56,38,50,36],[56,40,50,38],[57,8,51,6],[58,8,52,6],[59,6,53,4],[60,6,54,4,"emitter"],[60,13,54,11],[60,14,54,12,"emit"],[60,18,54,16],[60,19,54,17],[61,8,55,6,"type"],[61,12,55,10],[61,14,55,12],[61,20,55,18],[62,8,56,6,"target"],[62,14,56,12],[62,16,56,14,"lastFocusedKey"],[63,6,57,4],[63,7,57,5],[63,8,57,6],[64,6,58,4,"emitter"],[64,13,58,11],[64,14,58,12,"emit"],[64,18,58,16],[64,19,58,17],[65,8,59,6,"type"],[65,12,59,10],[65,14,59,12],[65,21,59,19],[66,8,60,6,"target"],[66,14,60,12],[66,16,60,14,"currentFocusedKey"],[67,6,61,4],[67,7,61,5],[67,8,61,6],[68,4,62,2],[68,5,62,3],[68,7,62,5],[68,8,62,6,"currentFocusedKey"],[68,25,62,23],[68,27,62,25,"emitter"],[68,34,62,32],[68,36,62,34,"navigation"],[68,46,62,44],[68,47,62,45],[68,48,62,46],[69,2,63,0],[70,0,63,1],[70,3]],"functionMap":{"names":["<global>","useFocusEvents","React.useEffect$argument_0","navigation.addListener$argument_1"],"mappings":"AAA;OCO;kBCU,uCC;GDM,CD;kBCC,sCC;GDM,CD;kBCC;GD8B;CDC"}},"type":"js/module"}]} |