mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 18:01:02 +00:00
1 line
10 KiB
Plaintext
1 line
10 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":["*"],"imports":1}},{"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":["*"],"imports":1}}],"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 function _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = {};\n if (e) Object.keys(e).forEach(function (k) {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n });\n n.default = e;\n return n;\n }\n exports.useFocusEvents = useFocusEvents;\n var _react = require(_dependencyMap[0], \"react\");\n var React = _interopNamespace(_react);\n var _NavigationContextJs = require(_dependencyMap[1], \"./NavigationContext.js\");\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(_NavigationContextJs.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":85,"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],[7,11,1,13,"_interopNamespace"],[7,29,1,13,"e"],[7,30,1,13],[8,4,1,13],[8,8,1,13,"e"],[8,9,1,13],[8,13,1,13,"e"],[8,14,1,13],[8,15,1,13,"__esModule"],[8,25,1,13],[8,34,1,13,"e"],[8,35,1,13],[9,4,1,13],[9,8,1,13,"n"],[9,9,1,13],[10,4,1,13],[10,8,1,13,"e"],[10,9,1,13],[10,11,1,13,"Object"],[10,17,1,13],[10,18,1,13,"keys"],[10,22,1,13],[10,23,1,13,"e"],[10,24,1,13],[10,26,1,13,"forEach"],[10,33,1,13],[10,44,1,13,"k"],[10,45,1,13],[11,6,1,13],[11,10,1,13,"d"],[11,11,1,13],[11,14,1,13,"Object"],[11,20,1,13],[11,21,1,13,"getOwnPropertyDescriptor"],[11,45,1,13],[11,46,1,13,"e"],[11,47,1,13],[11,49,1,13,"k"],[11,50,1,13],[12,6,1,13,"Object"],[12,12,1,13],[12,13,1,13,"defineProperty"],[12,27,1,13],[12,28,1,13,"n"],[12,29,1,13],[12,31,1,13,"k"],[12,32,1,13],[12,34,1,13,"d"],[12,35,1,13],[12,36,1,13,"get"],[12,39,1,13],[12,42,1,13,"d"],[12,43,1,13],[13,8,1,13,"enumerable"],[13,18,1,13],[14,8,1,13,"get"],[14,11,1,13],[14,22,1,13,"get"],[14,23,1,13],[15,10,1,13],[15,17,1,13,"e"],[15,18,1,13],[15,19,1,13,"k"],[15,20,1,13],[16,8,1,13],[17,6,1,13],[18,4,1,13],[19,4,1,13,"n"],[19,5,1,13],[19,6,1,13,"default"],[19,13,1,13],[19,16,1,13,"e"],[19,17,1,13],[20,4,1,13],[20,11,1,13,"n"],[20,12,1,13],[21,2,1,13],[22,2,8,0,"exports"],[22,9,8,0],[22,10,8,0,"useFocusEvents"],[22,24,8,0],[22,27,8,0,"useFocusEvents"],[22,41,8,0],[23,2,3,0],[23,6,3,0,"_react"],[23,12,3,0],[23,15,3,0,"require"],[23,22,3,0],[23,23,3,0,"_dependencyMap"],[23,37,3,0],[24,2,3,0],[24,6,3,0,"React"],[24,11,3,0],[24,14,3,0,"_interopNamespace"],[24,31,3,0],[24,32,3,0,"_react"],[24,38,3,0],[25,2,4,0],[25,6,4,0,"_NavigationContextJs"],[25,26,4,0],[25,29,4,0,"require"],[25,36,4,0],[25,37,4,0,"_dependencyMap"],[25,51,4,0],[26,2,5,0],[27,0,6,0],[28,0,7,0],[29,2,8,7],[29,11,8,16,"useFocusEvents"],[29,25,8,30,"useFocusEvents"],[29,26,8,31],[30,4,9,2,"state"],[30,9,9,7],[31,4,10,2,"emitter"],[32,2,11,0],[32,3,11,1],[32,5,11,3],[33,4,12,2],[33,10,12,8,"navigation"],[33,20,12,18],[33,23,12,21,"React"],[33,28,12,26],[33,29,12,27,"useContext"],[33,39,12,37],[33,40,12,38,"NavigationContext"],[33,60,12,55],[33,61,12,55,"NavigationContext"],[33,78,12,55],[33,79,12,56],[34,4,13,2],[34,10,13,8,"lastFocusedKeyRef"],[34,27,13,25],[34,30,13,28,"React"],[34,35,13,33],[34,36,13,34,"useRef"],[34,42,13,40],[34,43,13,41,"undefined"],[34,52,13,50],[34,53,13,51],[35,4,14,2],[35,10,14,8,"currentFocusedKey"],[35,27,14,25],[35,30,14,28,"state"],[35,35,14,33],[35,36,14,34,"routes"],[35,42,14,40],[35,43,14,41,"state"],[35,48,14,46],[35,49,14,47,"index"],[35,54,14,52],[35,55,14,53],[35,56,14,54,"key"],[35,59,14,57],[37,4,16,2],[38,4,17,2],[39,4,18,2,"React"],[39,9,18,7],[39,10,18,8,"useEffect"],[39,19,18,17],[39,20,18,18],[39,26,18,24,"navigation"],[39,36,18,34],[39,38,18,36,"addListener"],[39,49,18,47],[39,50,18,48],[39,57,18,55],[39,59,18,57],[39,65,18,63],[40,6,19,4,"lastFocusedKeyRef"],[40,23,19,21],[40,24,19,22,"current"],[40,31,19,29],[40,34,19,32,"currentFocusedKey"],[40,51,19,49],[41,6,20,4,"emitter"],[41,13,20,11],[41,14,20,12,"emit"],[41,18,20,16],[41,19,20,17],[42,8,21,6,"type"],[42,12,21,10],[42,14,21,12],[42,21,21,19],[43,8,22,6,"target"],[43,14,22,12],[43,16,22,14,"currentFocusedKey"],[44,6,23,4],[44,7,23,5],[44,8,23,6],[45,4,24,2],[45,5,24,3],[45,6,24,4],[45,8,24,6],[45,9,24,7,"currentFocusedKey"],[45,26,24,24],[45,28,24,26,"emitter"],[45,35,24,33],[45,37,24,35,"navigation"],[45,47,24,45],[45,48,24,46],[45,49,24,47],[46,4,25,2,"React"],[46,9,25,7],[46,10,25,8,"useEffect"],[46,19,25,17],[46,20,25,18],[46,26,25,24,"navigation"],[46,36,25,34],[46,38,25,36,"addListener"],[46,49,25,47],[46,50,25,48],[46,56,25,54],[46,58,25,56],[46,64,25,62],[47,6,26,4,"lastFocusedKeyRef"],[47,23,26,21],[47,24,26,22,"current"],[47,31,26,29],[47,34,26,32,"undefined"],[47,43,26,41],[48,6,27,4,"emitter"],[48,13,27,11],[48,14,27,12,"emit"],[48,18,27,16],[48,19,27,17],[49,8,28,6,"type"],[49,12,28,10],[49,14,28,12],[49,20,28,18],[50,8,29,6,"target"],[50,14,29,12],[50,16,29,14,"currentFocusedKey"],[51,6,30,4],[51,7,30,5],[51,8,30,6],[52,4,31,2],[52,5,31,3],[52,6,31,4],[52,8,31,6],[52,9,31,7,"currentFocusedKey"],[52,26,31,24],[52,28,31,26,"emitter"],[52,35,31,33],[52,37,31,35,"navigation"],[52,47,31,45],[52,48,31,46],[52,49,31,47],[53,4,32,2,"React"],[53,9,32,7],[53,10,32,8,"useEffect"],[53,19,32,17],[53,20,32,18],[53,26,32,24],[54,6,33,4],[54,12,33,10,"lastFocusedKey"],[54,26,33,24],[54,29,33,27,"lastFocusedKeyRef"],[54,46,33,44],[54,47,33,45,"current"],[54,54,33,52],[55,6,34,4,"lastFocusedKeyRef"],[55,23,34,21],[55,24,34,22,"current"],[55,31,34,29],[55,34,34,32,"currentFocusedKey"],[55,51,34,49],[57,6,36,4],[58,6,37,4],[59,6,38,4],[59,10,38,8,"lastFocusedKey"],[59,24,38,22],[59,29,38,27,"undefined"],[59,38,38,36],[59,42,38,40],[59,43,38,41,"navigation"],[59,53,38,51],[59,55,38,53],[60,8,39,6,"emitter"],[60,15,39,13],[60,16,39,14,"emit"],[60,20,39,18],[60,21,39,19],[61,10,40,8,"type"],[61,14,40,12],[61,16,40,14],[61,23,40,21],[62,10,41,8,"target"],[62,16,41,14],[62,18,41,16,"currentFocusedKey"],[63,8,42,6],[63,9,42,7],[63,10,42,8],[64,6,43,4],[66,6,45,4],[67,6,46,4],[68,6,47,4],[68,10,47,8,"lastFocusedKey"],[68,24,47,22],[68,29,47,27,"currentFocusedKey"],[68,46,47,44],[68,50,47,48],[68,52,47,50,"navigation"],[68,62,47,60],[68,65,47,63,"navigation"],[68,75,47,73],[68,76,47,74,"isFocused"],[68,85,47,83],[68,86,47,84],[68,87,47,85],[68,90,47,88],[68,94,47,92],[68,95,47,93],[68,97,47,95],[69,8,48,6],[70,6,49,4],[71,6,50,4],[71,10,50,8,"lastFocusedKey"],[71,24,50,22],[71,29,50,27,"undefined"],[71,38,50,36],[71,40,50,38],[72,8,51,6],[73,8,52,6],[74,6,53,4],[75,6,54,4,"emitter"],[75,13,54,11],[75,14,54,12,"emit"],[75,18,54,16],[75,19,54,17],[76,8,55,6,"type"],[76,12,55,10],[76,14,55,12],[76,20,55,18],[77,8,56,6,"target"],[77,14,56,12],[77,16,56,14,"lastFocusedKey"],[78,6,57,4],[78,7,57,5],[78,8,57,6],[79,6,58,4,"emitter"],[79,13,58,11],[79,14,58,12,"emit"],[79,18,58,16],[79,19,58,17],[80,8,59,6,"type"],[80,12,59,10],[80,14,59,12],[80,21,59,19],[81,8,60,6,"target"],[81,14,60,12],[81,16,60,14,"currentFocusedKey"],[82,6,61,4],[82,7,61,5],[82,8,61,6],[83,4,62,2],[83,5,62,3],[83,7,62,5],[83,8,62,6,"currentFocusedKey"],[83,25,62,23],[83,27,62,25,"emitter"],[83,34,62,32],[83,36,62,34,"navigation"],[83,46,62,44],[83,47,62,45],[83,48,62,46],[84,2,63,0],[85,0,63,1],[85,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"},"hasCjsExports":false},"type":"js/module"}]} |