@wavemaker/app-rn-runtime 11.14.1-32.647748 → 11.14.1-33.647787

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 (184) hide show
  1. package/components/advanced/carousel/carousel.component.js +1 -1
  2. package/components/advanced/carousel/carousel.component.js.map +1 -1
  3. package/components/advanced/webview/webview.component.js +1 -1
  4. package/components/advanced/webview/webview.component.js.map +1 -1
  5. package/components/basic/bottomsheet/bottomsheet.component.js +240 -33
  6. package/components/basic/bottomsheet/bottomsheet.component.js.map +1 -1
  7. package/components/basic/bottomsheet/bottomsheet.styles.js +0 -3
  8. package/components/basic/bottomsheet/bottomsheet.styles.js.map +1 -1
  9. package/components/basic/label/label.component.js +13 -24
  10. package/components/basic/label/label.component.js.map +1 -1
  11. package/components/basic/label/label.props.js +1 -0
  12. package/components/basic/label/label.props.js.map +1 -1
  13. package/components/basic/progress-circle/progress-circle.component.js +3 -3
  14. package/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  15. package/components/chart/area-chart/area-chart.component.js +27 -10
  16. package/components/chart/area-chart/area-chart.component.js.map +1 -1
  17. package/components/chart/bar-chart/bar-chart.component.js +39 -7
  18. package/components/chart/bar-chart/bar-chart.component.js.map +1 -1
  19. package/components/chart/bar-chart/bar-chart.props.js +1 -0
  20. package/components/chart/bar-chart/bar-chart.props.js.map +1 -1
  21. package/components/chart/basechart.component.js +8 -15
  22. package/components/chart/basechart.component.js.map +1 -1
  23. package/components/chart/basechart.props.js +1 -0
  24. package/components/chart/basechart.props.js.map +1 -1
  25. package/components/chart/bubble-chart/bubble-chart.component.js +23 -6
  26. package/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  27. package/components/chart/line-chart/line-chart.component.js +22 -5
  28. package/components/chart/line-chart/line-chart.component.js.map +1 -1
  29. package/components/chart/pie-chart/pie-chart.component.js +15 -4
  30. package/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  31. package/components/chart/stack-chart/stack-chart.component.js +1 -1
  32. package/components/chart/stack-chart/stack-chart.component.js.map +1 -1
  33. package/components/container/accordion/accordionpane/accordionpane.component.js +6 -4
  34. package/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
  35. package/components/container/container.component.js +207 -14
  36. package/components/container/container.component.js.map +1 -1
  37. package/components/container/container.props.js +6 -0
  38. package/components/container/container.props.js.map +1 -1
  39. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +32 -4
  40. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
  41. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js +1 -0
  42. package/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js.map +1 -1
  43. package/components/container/panel/panel.component.js +1 -1
  44. package/components/container/panel/panel.component.js.map +1 -1
  45. package/components/container/tabs/tabpane/tabpane.component.js +1 -1
  46. package/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  47. package/components/container/tabs/tabs.component.js +62 -29
  48. package/components/container/tabs/tabs.component.js.map +1 -1
  49. package/components/container/tabs/tabs.props.js +1 -0
  50. package/components/container/tabs/tabs.props.js.map +1 -1
  51. package/components/container/wizard/wizard.component.js +3 -5
  52. package/components/container/wizard/wizard.component.js.map +1 -1
  53. package/components/container/wizard/wizard.props.js +0 -1
  54. package/components/container/wizard/wizard.props.js.map +1 -1
  55. package/components/container/wizard/wizard.styles.js +3 -1
  56. package/components/container/wizard/wizard.styles.js.map +1 -1
  57. package/components/container/wizard/wizardstep/wizardstep.component.js +4 -23
  58. package/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  59. package/components/container/wizard/wizardstep/wizardstep.props.js +0 -2
  60. package/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
  61. package/components/data/form/form-field/form-field.component.js +26 -1
  62. package/components/data/form/form-field/form-field.component.js.map +1 -1
  63. package/components/data/form/form-field/form-field.props.js +3 -0
  64. package/components/data/form/form-field/form-field.props.js.map +1 -1
  65. package/components/data/form/form.component.js +11 -3
  66. package/components/data/form/form.component.js.map +1 -1
  67. package/components/data/form/form.props.js +1 -0
  68. package/components/data/form/form.props.js.map +1 -1
  69. package/components/data/list/list.component.js +6 -3
  70. package/components/data/list/list.component.js.map +1 -1
  71. package/components/dialogs/dialog/dialog.component.js +1 -1
  72. package/components/dialogs/dialog/dialog.component.js.map +1 -1
  73. package/components/dialogs/dialogcontent/dialogcontent.component.js +1 -2
  74. package/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
  75. package/components/input/baseinput/baseinput.component.js +30 -3
  76. package/components/input/baseinput/baseinput.component.js.map +1 -1
  77. package/components/input/baseinput/baseinput.props.js +1 -0
  78. package/components/input/baseinput/baseinput.props.js.map +1 -1
  79. package/components/input/basenumber/basenumber.component.js +18 -3
  80. package/components/input/basenumber/basenumber.component.js.map +1 -1
  81. package/components/input/basenumber/basenumber.props.js +2 -0
  82. package/components/input/basenumber/basenumber.props.js.map +1 -1
  83. package/components/input/calendar/calendar.component.js +5 -1
  84. package/components/input/calendar/calendar.component.js.map +1 -1
  85. package/components/input/calendar/views/month-view.js +8 -1
  86. package/components/input/calendar/views/month-view.js.map +1 -1
  87. package/components/input/checkboxset/checkboxset.component.js +2 -2
  88. package/components/input/checkboxset/checkboxset.component.js.map +1 -1
  89. package/components/input/currency/currency.component.js +2 -0
  90. package/components/input/currency/currency.component.js.map +1 -1
  91. package/components/input/currency/currency.styles.js +10 -1
  92. package/components/input/currency/currency.styles.js.map +1 -1
  93. package/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +6 -1
  94. package/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
  95. package/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js +6 -1
  96. package/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js.map +1 -1
  97. package/components/input/number/number.component.js +2 -0
  98. package/components/input/number/number.component.js.map +1 -1
  99. package/components/input/number/number.styles.js +4 -0
  100. package/components/input/number/number.styles.js.map +1 -1
  101. package/components/input/radioset/radioset.component.js +4 -6
  102. package/components/input/radioset/radioset.component.js.map +1 -1
  103. package/components/input/text/text.component.js +13 -2
  104. package/components/input/text/text.component.js.map +1 -1
  105. package/components/input/text/text.props.js +1 -1
  106. package/components/input/text/text.props.js.map +1 -1
  107. package/components/input/text/text.styles.js +17 -0
  108. package/components/input/text/text.styles.js.map +1 -1
  109. package/components/input/textarea/textarea.component.js +3 -2
  110. package/components/input/textarea/textarea.component.js.map +1 -1
  111. package/components/input/textarea/textarea.styles.js +4 -0
  112. package/components/input/textarea/textarea.styles.js.map +1 -1
  113. package/components/page/left-panel/left-panel.component.js +1 -1
  114. package/components/page/left-panel/left-panel.component.js.map +1 -1
  115. package/components/page/page-content/page-content.component.js +157 -17
  116. package/components/page/page-content/page-content.component.js.map +1 -1
  117. package/components/page/page-content/page-content.props.js +4 -0
  118. package/components/page/page-content/page-content.props.js.map +1 -1
  119. package/components/page/page-content/pull-to-refresh.component.js +288 -0
  120. package/components/page/page-content/pull-to-refresh.component.js.map +1 -0
  121. package/core/AppConfig.js.map +1 -1
  122. package/core/base.component.js +37 -5
  123. package/core/base.component.js.map +1 -1
  124. package/core/components/error-fallback/error-fallback.component.js +18 -50
  125. package/core/components/error-fallback/error-fallback.component.js.map +1 -1
  126. package/core/components/error-fallback/error-fallback.styles.js +1 -4
  127. package/core/components/error-fallback/error-fallback.styles.js.map +1 -1
  128. package/core/components/textinput.component.js +27 -8
  129. package/core/components/textinput.component.js.map +1 -1
  130. package/core/environment.js +25 -0
  131. package/core/environment.js.map +1 -0
  132. package/core/error-boundary.component.js +2 -46
  133. package/core/error-boundary.component.js.map +1 -1
  134. package/core/fixed-view.component.js +19 -2
  135. package/core/fixed-view.component.js.map +1 -1
  136. package/core/sticky-wrapper.js +37 -34
  137. package/core/sticky-wrapper.js.map +1 -1
  138. package/core/tappable.component.js +110 -16
  139. package/core/tappable.component.js.map +1 -1
  140. package/core/viewport.js +13 -8
  141. package/core/viewport.js.map +1 -1
  142. package/gestures/carousel-swipe.animation.js +1 -1
  143. package/gestures/carousel-swipe.animation.js.map +1 -1
  144. package/npm-shrinkwrap.json +383 -219
  145. package/package-lock.json +383 -219
  146. package/package.json +5 -6
  147. package/runtime/App.js +31 -181
  148. package/runtime/App.js.map +1 -1
  149. package/runtime/App.navigator.js +1 -4
  150. package/runtime/App.navigator.js.map +1 -1
  151. package/runtime/base-fragment.component.js +29 -5
  152. package/runtime/base-fragment.component.js.map +1 -1
  153. package/runtime/base-page.component.js +4 -12
  154. package/runtime/base-page.component.js.map +1 -1
  155. package/runtime/navigator/drawer.navigator.js +2 -0
  156. package/runtime/navigator/drawer.navigator.js.map +1 -1
  157. package/runtime/navigator/stack.navigator.js +17 -2
  158. package/runtime/navigator/stack.navigator.js.map +1 -1
  159. package/runtime/services/app-security.service.js +19 -40
  160. package/runtime/services/app-security.service.js.map +1 -1
  161. package/runtime/services/device/scan-service.js +12 -34
  162. package/runtime/services/device/scan-service.js.map +1 -1
  163. package/runtime/services/webprocess.service.js +3 -8
  164. package/runtime/services/webprocess.service.js.map +1 -1
  165. package/styles/background.component.js +61 -2
  166. package/styles/background.component.js.map +1 -1
  167. package/styles/style-prop.validator.js +4 -0
  168. package/styles/style-prop.validator.js.map +1 -1
  169. package/styles/style-props.js +2 -0
  170. package/styles/style-props.js.map +1 -1
  171. package/styles/theme.js +27 -2
  172. package/styles/theme.js.map +1 -1
  173. package/styles/theme.variables.js +2 -0
  174. package/styles/theme.variables.js.map +1 -1
  175. package/core/advanced-promise-rejection-tracker.js +0 -207
  176. package/core/advanced-promise-rejection-tracker.js.map +0 -1
  177. package/core/global-error-handler.service.js +0 -177
  178. package/core/global-error-handler.service.js.map +0 -1
  179. package/runtime/services/browser.constants.js +0 -3
  180. package/runtime/services/browser.constants.js.map +0 -1
  181. package/runtime/services/browser.service.js +0 -321
  182. package/runtime/services/browser.service.js.map +0 -1
  183. package/runtime/services/external-auth-callback.service.js +0 -44
  184. package/runtime/services/external-auth-callback.service.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","useCallback","useEffect","useRef","useState","Animated","Platform","Text","TextInput","View","isArray","IMask","FloatingLabel","WmCursor","memo","props","opacityAnimation","Value","current","runAnimation","timing","toValue","duration","useNativeDriver","start","createElement","testID","style","backgroundColor","color","width","marginHorizontal","height","opacity","WMTextInput","forwardRef","ref","_props$customDisplayV","_props$floatingLabel","selectRange","setSelectRange","iMask","setIMask","displayCursor","setDisplayCursor","value","x","forceUpdate","displayValue","setDisplayValue","element","displayformat","MaskedPattern","mask","skipInvalid","lazy","definitions","typedValue","defaultValue","onChangeText","setTimeout","OS","maskchar","_element$current","setSelectionRange","length","onSelectionChange","e","_e$nativeEvent","selection","nativeEvent","allowContentSelection","end","text","_value","substring","slice","formattedValue","replace","valueExpr","opts","customDisplayValue","textStyle","Object","assign","hideInput","Fragment","background","floatingLabel","moveUp","isInputFocused","label","placeholder","floatingLabelStyle","activeFloatingLabelStyle","editable","_extends","borderColor","zIndex","autoCapitalize","textTransform","placeholderTextColor","selectable","disabled","multiline","numberOfLines","onFocus","_props$onFocus","call","target","onBlur","_props$onBlur","caretHidden","toUpperCase","selectionColor","cursorColor","onChange","contextMenuHidden","onLayout","handleLayout","display","flexDirection","alignItems","marginTop","minHeight","undefined","padding","fontFamily","fontSize","fontWeight"],"sources":["textinput.component.tsx"],"sourcesContent":["import React, { ForwardedRef, useCallback, useEffect, useRef, useState } from 'react';\nimport { Animated, Platform, Text, TextInput, TextInputProps, TextStyle, View, ViewStyle } from 'react-native';\nimport { isArray } from 'lodash';\nimport IMask from 'imask';\nimport { FloatingLabel } from './floatinglabel.component';\n\ninterface SelectRange {\n start: number,\n end: number\n}\n\nconst WmCursor = React.memo((props: {\n color: string,\n height: number\n}) => {\n const opacityAnimation = useRef(new Animated.Value(0.5)).current;\n const runAnimation = useCallback(() => {\n Animated.timing(opacityAnimation, {\n toValue: 0.2,\n duration: 500,\n useNativeDriver: true\n }).start(() => {\n Animated.timing(opacityAnimation, {\n toValue: 0.6,\n duration: 500,\n useNativeDriver: true\n }).start(runAnimation);\n });\n }, []);\n useEffect(() => {\n runAnimation();\n }, []);\n return (\n <Animated.View \n testID=\"wm-custom-cursor\"\n style={{\n backgroundColor: props.color,\n width: 2,\n marginHorizontal: 1,\n height: props.height,\n opacity: opacityAnimation\n }}></Animated.View>\n );\n});\n\nexport const WMTextInput = React.forwardRef((props: (TextInputProps & \n {allowContentSelection: boolean,\n displayformat: string,\n maskchar: string,\n floatingLabel: string\n floatingLabelStyle: TextStyle & ViewStyle,\n activeFloatingLabelStyle: TextStyle & ViewStyle,\n customDisplayValue?: string,\n isInputFocused: boolean,\n autoCapitalize?: string,\n background?: React.ReactNode,\n handleLayout?: any,\n style?: ViewStyle\n }), \n ref: ForwardedRef<TextInput>) => {\n const [selectRange, setSelectRange] = useState<SelectRange>(null as any);\n const [iMask, setIMask] = useState(null as any);\n const [displayCursor, setDisplayCursor] = useState(false);\n const value = useRef(props.value || '');\n const [x, forceUpdate] = useState(1);\n const [displayValue, setDisplayValue] = useState('');\n const element = useRef(null as any);\n // iMask initialization\n useEffect(() => {\n const iMask: any = props.displayformat ? new IMask.MaskedPattern({\n mask: props.displayformat,\n skipInvalid: true,\n lazy: false,\n definitions: {\n '9': /\\d/,\n 'A': /[a-zA-Z]/,\n 'a': /[a-z]/,\n '*': /\\w/\n }\n }) : null;\n if (iMask) {\n iMask.typedValue = value;\n setDisplayValue(iMask.displayValue)\n setIMask(iMask);\n }\n },[props.displayformat]);\n // set default value\n useEffect(() => {\n const defaultValue = props.defaultValue || props.value || '';\n if (defaultValue && !value.current) {\n value.current = defaultValue;\n onChangeText(defaultValue);\n }\n },[props.defaultValue, props.value]);\n // set cursor position in windows\n useEffect(() => {\n setTimeout(() => {\n if (Platform.OS === 'web' && (props.displayformat || props.maskchar)) {\n element?.current?.setSelectionRange(value.current.length, value.current.length);\n }\n }, 100);\n }, [value.current, props]);\n const onSelectionChange = useCallback((e: any) => {\n if (Platform.OS !== 'android') {\n return;\n }\n const selection = e?.nativeEvent?.selection;\n if (!props.allowContentSelection\n && selection\n && selection.end - selection.start > 0) {\n setSelectRange({\n start: value.current.length + 2,\n end: value.current.length + 2\n });\n } else if (selectRange && selectRange.end > 0){\n setSelectRange(null as any);\n }\n }, [props.allowContentSelection, value]);\n // when text changes\n const onChangeText = useCallback((text: string) => {\n if (!(iMask || props.maskchar)) {\n value.current = text;\n props.onChangeText && props.onChangeText(text);\n return;\n }\n let _value = value.current || '';\n if (value.current.length - text.length > 0) {\n _value = _value.substring(0, _value.length - (value.current.length - text.length));\n } else if (text.length - value.current.length > 0) {\n _value += text.slice(-1 * (text.length - value.current.length));\n }\n let formattedValue = _value;\n if(props.maskchar) {\n formattedValue = (_value.replace(/./g, props.maskchar));\n }\n if (iMask) {\n iMask.typedValue = _value;\n formattedValue = iMask.displayValue;\n }\n if (formattedValue !== displayValue) {\n value.current = _value;\n props.onChangeText && props.onChangeText(_value);\n }\n forceUpdate(x+ 1);\n setDisplayValue(formattedValue);\n }, [iMask, value, displayValue, props.onChangeText]);\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n const opts = {} as any;\n opts[valueExpr] = props.customDisplayValue ?? value.current;\n const textStyle = Object.assign({}, ...isArray(props.style) ? props.style: [props.style]);\n const hideInput = props.displayformat || props.maskchar;\n return (\n <>\n {props.background}\n {props.floatingLabel ? (\n <FloatingLabel\n moveUp={!!(value.current || props.isInputFocused || displayValue)}\n label={props.floatingLabel ?? props.placeholder} \n style={{\n ...(props.floatingLabelStyle || []),\n ...(props.isInputFocused ? (props.activeFloatingLabelStyle || {}) : {})\n }}/>\n ) : null}\n {(Platform.OS === 'android' && !props.editable) ? (\n <Text \n style={[\n props.style, hideInput ? {\n color: 'transparent', \n backgroundColor: 'transparent',\n borderColor: 'transparent',\n zIndex: 1\n } : {},\n props.autoCapitalize ? {textTransform: 'capitalize'} : {},\n (!props.defaultValue && props.placeholder) ? { color: props.placeholderTextColor} : {}\n ]}\n selectable={false}\n disabled={true}\n {...(props.multiline) ? {numberOfLines: props.numberOfLines} : {}}\n >{props.defaultValue || props.placeholder}</Text>\n ) :\n (<TextInput\n {...props}\n {...hideInput || props.customDisplayValue ? opts: {}}\n placeholder={props.floatingLabel || displayValue ? '' : props.placeholder }\n style={[props.style, hideInput ? {\n color: 'transparent', \n ...(Platform.OS === 'android' && {\n opacity: 0,\n }),\n backgroundColor: 'transparent',\n borderColor: 'transparent',\n zIndex: 1\n } : {}]}\n onFocus={(e) => {\n props.onFocus?.(e);\n setDisplayCursor(true);\n element.current = e.target;\n }}\n onBlur={(e) => {\n props?.onBlur?.(e);\n setDisplayCursor(false);\n }}\n ref={ref}\n selection={selectRange}\n onSelectionChange={onSelectionChange}\n caretHidden={!!selectRange?.end}\n onChangeText={(text) => {\n if(props.autoCapitalize && props.autoCapitalize === 'characters') {\n onChangeText(text.toUpperCase());\n return;\n }\n onChangeText(text);\n }}\n {...hideInput ? {\n selectionColor: 'transparent',\n cursorColor: 'transparent',\n onChange : () => {}\n }: {}}\n contextMenuHidden={!props.allowContentSelection}\n autoCapitalize={props.autoCapitalize}\n onLayout={props.handleLayout}\n numberOfLines={1}\n >\n </TextInput>)\n }\n {\n hideInput ? (\n <View style={[props.style, {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n marginTop: -1 * (textStyle.height || textStyle.minHeight || 0)\n + (textStyle.marginTop || 0)}]}>\n <Text style={{ \n width: undefined,\n backgroundColor: 'transparent', \n borderColor: 'transparent',\n padding: 0,\n display: 'flex',\n color: textStyle.color,\n fontFamily: textStyle.fontFamily,\n fontSize: textStyle.fontSize,\n fontWeight: textStyle.fontWeight\n }}>\n {displayValue}\n </Text>\n {\n (displayCursor && !props.displayformat) ? React.createElement(WmCursor, {\n color: textStyle.color || '#000000',\n height: textStyle.fontSize || 14\n }) : null\n }\n </View>\n ) : null\n }\n </>\n );\n});\n"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,WAAW,EAAEC,SAAS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I,CAAC5B,KAAK,CAACoC,aAAa,gBAAInD,KAAK,CAACyB,aAAa,CAACZ,QAAQ,EAAE;IACtEgB,KAAK,EAAEqD,SAAS,CAACrD,KAAK,IAAI,SAAS;IACnCG,MAAM,EAAEkD,SAAS,CAAC8C,QAAQ,IAAI;EAChC,CAAC,CAAC,GAAG,IAEH,CAAC,GACL,IAEN,CAAC;AAET,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useCallback","useEffect","useRef","useState","Animated","Platform","Text","TextInput","View","isArray","IMask","FloatingLabel","WmCursor","memo","props","opacityAnimation","Value","current","runAnimation","timing","toValue","duration","useNativeDriver","start","createElement","testID","style","backgroundColor","color","width","marginHorizontal","height","opacity","applyAutoCapitalize","text","mode","toUpperCase","replace","c","WMTextInput","forwardRef","ref","_props$customDisplayV","_props$floatingLabel","selectRange","setSelectRange","iMask","setIMask","displayCursor","setDisplayCursor","value","x","forceUpdate","displayValue","setDisplayValue","element","displayformat","MaskedPattern","mask","skipInvalid","lazy","definitions","typedValue","defaultValue","onChangeText","setTimeout","OS","maskchar","_element$current","setSelectionRange","length","onSelectionChange","e","_e$nativeEvent","selection","nativeEvent","allowContentSelection","end","_value","substring","slice","formattedValue","valueExpr","opts","customDisplayValue","textStyle","Object","assign","hideInput","Fragment","background","floatingLabel","moveUp","isInputFocused","label","placeholder","floatingLabelStyle","activeFloatingLabelStyle","inactiveFloatingLabelStyle","editable","_extends","borderColor","zIndex","autoCapitalize","textTransform","placeholderTextColor","selectable","disabled","multiline","numberOfLines","maxLength","undefined","onFocus","_props$onFocus","call","target","onBlur","_props$onBlur","caretHidden","selectionColor","cursorColor","onChange","contextMenuHidden","onLayout","handleLayout","onSubmitEditing","display","flexDirection","alignItems","marginTop","minHeight","padding","fontFamily","fontSize","fontWeight"],"sources":["textinput.component.tsx"],"sourcesContent":["import React, { ForwardedRef, useCallback, useEffect, useRef, useState } from 'react';\nimport { Animated, Platform, Text, TextInput, TextInputProps, TextStyle, View, ViewStyle } from 'react-native';\nimport { isArray } from 'lodash';\nimport IMask from 'imask';\nimport { FloatingLabel } from './floatinglabel.component';\n\ninterface SelectRange {\n start: number,\n end: number\n}\n\nconst WmCursor = React.memo((props: {\n color: string,\n height: number\n}) => {\n const opacityAnimation = useRef(new Animated.Value(0.5)).current;\n const runAnimation = useCallback(() => {\n Animated.timing(opacityAnimation, {\n toValue: 0.2,\n duration: 500,\n useNativeDriver: true\n }).start(() => {\n Animated.timing(opacityAnimation, {\n toValue: 0.6,\n duration: 500,\n useNativeDriver: true\n }).start(runAnimation);\n });\n }, []);\n useEffect(() => {\n runAnimation();\n }, []);\n return (\n <Animated.View \n testID=\"wm-custom-cursor\"\n style={{\n backgroundColor: props.color,\n width: 2,\n marginHorizontal: 1,\n height: props.height,\n opacity: opacityAnimation\n }}></Animated.View>\n );\n});\n\n// TODO: Monika WMS-31071 - Consider these improvements:\n// 1. 'words' mode: Use full Title Case regex: text.replace(/\\b\\w+/g, word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n// 2. 'sentences' mode: Add newline handling with regex: /(^|\\.\\s+|\\!\\s+|\\?\\s+|\\n\\s*)(\\w)/g\n// 3. Add TypeScript type for mode: type AutoCapitalizeMode = 'none' | 'sentences' | 'words' | 'characters'\nconst applyAutoCapitalize = (text: string, mode: string): string => {\n switch (mode) {\n case 'characters':\n return text.toUpperCase();\n case 'words':\n return text.replace(/\\b\\w/g, c => c.toUpperCase());\n case 'sentences':\n return text.replace(/(^\\w|[.!?]\\s+\\w)/g, c => c.toUpperCase());\n default:\n return text;\n }\n};\n\nexport const WMTextInput = React.forwardRef((props: (TextInputProps & \n {allowContentSelection: boolean,\n displayformat: string,\n maskchar: string,\n floatingLabel: string\n floatingLabelStyle: TextStyle & ViewStyle,\n activeFloatingLabelStyle: TextStyle & ViewStyle,\n inactiveFloatingLabelStyle?: TextStyle & ViewStyle,\n customDisplayValue?: string,\n isInputFocused: boolean,\n autoCapitalize?: string,\n background?: React.ReactNode,\n handleLayout?: any,\n style?: ViewStyle\n }), \n ref: ForwardedRef<TextInput>) => {\n const [selectRange, setSelectRange] = useState<SelectRange>(null as any);\n const [iMask, setIMask] = useState(null as any);\n const [displayCursor, setDisplayCursor] = useState(false);\n const value = useRef(props.value || '');\n const [x, forceUpdate] = useState(1);\n const [displayValue, setDisplayValue] = useState('');\n const element = useRef(null as any);\n // iMask initialization\n useEffect(() => {\n const iMask: any = props.displayformat ? new IMask.MaskedPattern({\n mask: props.displayformat,\n skipInvalid: true,\n lazy: false,\n definitions: {\n '9': /\\d/,\n 'A': /[a-zA-Z]/,\n 'a': /[a-z]/,\n '*': /\\w/\n }\n }) : null;\n if (iMask) {\n iMask.typedValue = value;\n setDisplayValue(iMask.displayValue)\n setIMask(iMask);\n }\n },[props.displayformat]);\n // set default value\n useEffect(() => {\n const defaultValue = props.defaultValue || props.value || '';\n if (defaultValue && !value.current) {\n value.current = defaultValue;\n onChangeText(defaultValue);\n }\n },[props.defaultValue, props.value]);\n // set cursor position in windows\n useEffect(() => {\n setTimeout(() => {\n if (Platform.OS === 'web' && (props.displayformat || props.maskchar)) {\n element?.current?.setSelectionRange(value.current.length, value.current.length);\n }\n }, 100);\n }, [value.current, props]);\n const onSelectionChange = useCallback((e: any) => {\n if (Platform.OS !== 'android') {\n return;\n }\n const selection = e?.nativeEvent?.selection;\n if (!props.allowContentSelection\n && selection\n && selection.end - selection.start > 0) {\n setSelectRange({\n start: value.current.length + 2,\n end: value.current.length + 2\n });\n } else if (selectRange && selectRange.end > 0){\n setSelectRange(null as any);\n }\n }, [props.allowContentSelection, value]);\n // when text changes\n const onChangeText = useCallback((text: string) => {\n if (!(iMask || props.maskchar)) {\n value.current = text;\n props.onChangeText && props.onChangeText(text);\n return;\n }\n let _value = value.current || '';\n if (value.current.length - text.length > 0) {\n _value = _value.substring(0, _value.length - (value.current.length - text.length));\n } else if (text.length - value.current.length > 0) {\n _value += text.slice(-1 * (text.length - value.current.length));\n }\n let formattedValue = _value;\n if(props.maskchar) {\n formattedValue = (_value.replace(/./g, props.maskchar));\n }\n if (iMask) {\n iMask.typedValue = _value;\n formattedValue = iMask.displayValue;\n }\n if (formattedValue !== displayValue) {\n value.current = _value;\n props.onChangeText && props.onChangeText(_value);\n }\n forceUpdate(x+ 1);\n setDisplayValue(formattedValue);\n }, [iMask, value, displayValue, props.onChangeText]);\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n const opts = {} as any;\n opts[valueExpr] = props.customDisplayValue ?? value.current;\n const textStyle = Object.assign({}, ...isArray(props.style) ? props.style: [props.style]);\n const hideInput = props.displayformat || props.maskchar;\n return (\n <>\n {props.background}\n {props.floatingLabel ? (\n <FloatingLabel\n moveUp={!!(value.current || props.isInputFocused || displayValue)}\n label={props.floatingLabel ?? props.placeholder} \n style={{\n ...(props.floatingLabelStyle || []),\n ...(props.isInputFocused \n ? (props.activeFloatingLabelStyle || {}) \n : (value.current || displayValue) \n ? (props.inactiveFloatingLabelStyle || {}) \n : {}\n )\n }}/>\n ) : null}\n {(Platform.OS === 'android' && !props.editable) ? (\n <Text \n style={[\n props.style, hideInput ? {\n color: 'transparent', \n backgroundColor: 'transparent',\n borderColor: 'transparent',\n zIndex: 1\n } : {},\n props.autoCapitalize ? {textTransform: 'capitalize'} : {},\n (!props.defaultValue && props.placeholder) ? { color: props.placeholderTextColor} : {}\n ]}\n selectable={false}\n disabled={true}\n {...(props.multiline) ? {numberOfLines: props.numberOfLines} : {}}\n >{props.defaultValue || props.placeholder}</Text>\n ) :\n (<TextInput\n {...props}\n {...hideInput || props.customDisplayValue ? opts: {}}\n {...((props.maxLength !== null) ? { maxLength: props.maxLength } : { maxLength: undefined })}\n placeholder={props.floatingLabel || displayValue ? '' : props.placeholder }\n style={[props.style, hideInput ? {\n color: 'transparent', \n backgroundColor: 'transparent',\n borderColor: 'transparent',\n zIndex: 1\n } : {}]}\n onFocus={(e) => {\n props.onFocus?.(e);\n setDisplayCursor(true);\n element.current = e.target;\n }}\n onBlur={(e) => {\n props?.onBlur?.(e);\n setDisplayCursor(false);\n }}\n ref={ref}\n selection={selectRange}\n onSelectionChange={onSelectionChange}\n caretHidden={!!selectRange?.end}\n onChangeText={(text) => {\n if(Platform.OS === 'web' && props.autoCapitalize && props.autoCapitalize !== 'none') {\n onChangeText(applyAutoCapitalize(text, props.autoCapitalize));\n return;\n }\n onChangeText(text);\n }}\n {...hideInput ? {\n selectionColor: 'transparent',\n cursorColor: 'transparent',\n onChange : () => {}\n }: {}}\n contextMenuHidden={!props.allowContentSelection}\n autoCapitalize={props.autoCapitalize}\n onLayout={props.handleLayout}\n numberOfLines={1}\n onSubmitEditing={props.onSubmitEditing}\n >\n </TextInput>)\n }\n {\n hideInput ? (\n <View style={[props.style, {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n marginTop: -1 * (textStyle.height || textStyle.minHeight || 0)\n + (textStyle.marginTop || 0)}]}>\n <Text style={{ \n width: undefined,\n backgroundColor: 'transparent', \n borderColor: 'transparent',\n padding: 0,\n display: 'flex',\n color: textStyle.color,\n fontFamily: textStyle.fontFamily,\n fontSize: textStyle.fontSize,\n fontWeight: textStyle.fontWeight\n }}>\n {displayValue}\n </Text>\n {\n (displayCursor && !props.displayformat) ? React.createElement(WmCursor, {\n color: textStyle.color || '#000000',\n height: textStyle.fontSize || 14\n }) : null\n }\n </View>\n ) : null\n }\n </>\n );\n});\n"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrF,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,SAAS,EAA6BC,IAAI,QAAmB,cAAc;AAC9G,SAASC,OAAO,QAAQ,QAAQ;AAChC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,2BAA2B;AAOzD,MAAMC,QAAQ,gBAAGb,KAAK,CAACc,IAAI,CAAEC,KAG5B,IAAK;EACJ,MAAMC,gBAAgB,GA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AK,EAAE;MACXG,KAAK,EAAEkF,SAAS;MAChBpF,eAAe,EAAE,aAAa;MAC9B0E,WAAW,EAAE,aAAa;MAC1B8B,OAAO,EAAE,CAAC;MACVL,OAAO,EAAE,MAAM;MACflG,KAAK,EAAEyD,SAAS,CAACzD,KAAK;MACtBwG,UAAU,EAAE/C,SAAS,CAAC+C,UAAU;MAChCC,QAAQ,EAAEhD,SAAS,CAACgD,QAAQ;MAC5BC,UAAU,EAAEjD,SAAS,CAACiD;IACtB;EAAE,GACDjF,YACG,CAAC,EAEJL,aAAa,IAAI,CAAClC,KAAK,CAAC0C,aAAa,gBAAIzD,KAAK,CAACyB,aAAa,CAACZ,QAAQ,EAAE;IACtEgB,KAAK,EAAEyD,SAAS,CAACzD,KAAK,IAAI,SAAS;IACnCG,MAAM,EAAEsD,SAAS,CAACgD,QAAQ,IAAI;EAChC,CAAC,CAAC,GAAG,IAEH,CAAC,GACL,IAEN,CAAC;AAET,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
+ import StorageService from "./storage.service";
5
+ export const CURRENT_ENVIRONMENT = 'currentEnvironment';
6
+ class Environment {
7
+ constructor() {
8
+ _defineProperty(this, "_loadProfileCallback", null);
9
+ }
10
+ /** Persist profile name and run the registered loadenv callback. Does not restart. */
11
+ setCurrent(env) {
12
+ return StorageService.setItem(CURRENT_ENVIRONMENT, env).then(() => {
13
+ var _this$_loadProfileCal;
14
+ (_this$_loadProfileCal = this._loadProfileCallback) === null || _this$_loadProfileCal === void 0 || _this$_loadProfileCal.call(this, env);
15
+ });
16
+ }
17
+ getCurrentAsync() {
18
+ return StorageService.getItem(CURRENT_ENVIRONMENT);
19
+ }
20
+ registerLoadCallback(fn) {
21
+ this._loadProfileCallback = fn;
22
+ }
23
+ }
24
+ export default new Environment();
25
+ //# sourceMappingURL=environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StorageService","CURRENT_ENVIRONMENT","Environment","constructor","_defineProperty","setCurrent","env","setItem","then","_this$_loadProfileCal","_loadProfileCallback","call","getCurrentAsync","getItem","registerLoadCallback","fn"],"sources":["environment.ts"],"sourcesContent":["import StorageService from \"./storage.service\";\n\nexport const CURRENT_ENVIRONMENT = 'currentEnvironment'\n\nclass Environment {\n private _loadProfileCallback: ((profileName: string) => void) | null = null;\n\n /** Persist profile name and run the registered loadenv callback. Does not restart. */\n setCurrent(env: string): Promise<void> {\n return StorageService.setItem(CURRENT_ENVIRONMENT, env).then(() => {\n this._loadProfileCallback?.(env);\n });\n }\n\n getCurrentAsync() {\n return StorageService.getItem(CURRENT_ENVIRONMENT);\n }\n\n registerLoadCallback(fn: (profileName: string) => void) {\n this._loadProfileCallback = fn;\n }\n}\n\nexport default new Environment();\n"],"mappings":";;;AAAA,OAAOA,cAAc,MAAM,mBAAmB;AAE9C,OAAO,MAAMC,mBAAmB,GAAG,oBAAoB;AAEvD,MAAMC,WAAW,CAAC;EAAAC,YAAA;IAAAC,eAAA,+BACyD,IAAI;EAAA;EAE3E;EACAC,UAAUA,CAACC,GAAW,EAAiB;IACnC,OAAON,cAAc,CAACO,OAAO,CAACN,mBAAmB,EAAEK,GAAG,CAAC,CAACE,IAAI,CAAC,MAAM;MAAA,IAAAC,qBAAA;MAC/D,CAAAA,qBAAA,OAAI,CAACC,oBAAoB,cAAAD,qBAAA,eAAzBA,qBAAA,CAAAE,IAAA,KAAI,EAAwBL,GAAG,CAAC;IACpC,CAAC,CAAC;EACN;EAEAM,eAAeA,CAAA,EAAG;IACd,OAAOZ,cAAc,CAACa,OAAO,CAACZ,mBAAmB,CAAC;EACtD;EAEAa,oBAAoBA,CAACC,EAAiC,EAAE;IACpD,IAAI,CAACL,oBAAoB,GAAGK,EAAE;EAClC;AACJ;AAEA,eAAe,IAAIb,WAAW,CAAC,CAAC","ignoreList":[]}
@@ -4,7 +4,6 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
4
4
  import * as React from 'react';
5
5
  import Fallback from './components/error-fallback/error-fallback.component';
6
6
  import appModalService from '@wavemaker/app-rn-runtime/runtime/services/app-modal.service';
7
- import injector from '@wavemaker/app-rn-runtime/core/injector';
8
7
  export default class ErrorBoundary extends React.Component {
9
8
  constructor(props) {
10
9
  super(props);
@@ -20,48 +19,11 @@ export default class ErrorBoundary extends React.Component {
20
19
  };
21
20
  }
22
21
  static getDerivedStateFromError(error) {
23
- // Check preferences before setting error state
24
- const appConfig = injector.get('APP_CONFIG');
25
- const prefs = appConfig === null || appConfig === void 0 ? void 0 : appConfig.preferences;
26
- const globalEnabled = (prefs === null || prefs === void 0 ? void 0 : prefs.enableGlobalErrorHandler) === true;
27
- const renderEnabled = (prefs === null || prefs === void 0 ? void 0 : prefs.enableRenderErrors) !== false;
28
-
29
- // Only set hasError if error handling is enabled
30
- if (!globalEnabled || !renderEnabled) {
31
- return {
32
- hasError: false
33
- };
34
- }
35
22
  return {
36
23
  hasError: true
37
24
  };
38
25
  }
39
26
  componentDidCatch(error, info) {
40
- // Check if error handling is enabled
41
- const appConfig = injector.get('APP_CONFIG');
42
- const prefs = appConfig === null || appConfig === void 0 ? void 0 : appConfig.preferences;
43
- const globalEnabled = (prefs === null || prefs === void 0 ? void 0 : prefs.enableGlobalErrorHandler) === true;
44
- const renderEnabled = (prefs === null || prefs === void 0 ? void 0 : prefs.enableRenderErrors) !== false;
45
-
46
- // Only catch if both master switch and render errors are enabled
47
- if (!globalEnabled || !renderEnabled) {
48
- return;
49
- }
50
-
51
- // Trigger user error callback if app instance is available
52
- let appInstance = this.props.app;
53
-
54
- // Fallback: try to get app instance from injector if prop is not available
55
- if (!appInstance) {
56
- appInstance = injector.get('APP_INSTANCE');
57
- }
58
- if (appInstance && appInstance.triggerOnError) {
59
- try {
60
- appInstance.triggerOnError(error, info, 'render');
61
- } catch (e) {
62
- console.error('Error calling triggerOnError:', e);
63
- }
64
- }
65
27
  if (error && appModalService.modalsOpened.length > 0) {
66
28
  appModalService.modalsOpened.pop();
67
29
  appModalService.showLastModal();
@@ -73,17 +35,11 @@ export default class ErrorBoundary extends React.Component {
73
35
  }
74
36
  render() {
75
37
  if (this.state.hasError) {
76
- var _appConfig$preference, _this$state, _this$state2;
77
- const appConfig = injector.get('APP_CONFIG');
78
- const showFallback = (appConfig === null || appConfig === void 0 || (_appConfig$preference = appConfig.preferences) === null || _appConfig$preference === void 0 ? void 0 : _appConfig$preference.showDefaultErrorFallback) !== false;
79
- if (!showFallback) {
80
- return null;
81
- }
38
+ var _this$state, _this$state2;
82
39
  return /*#__PURE__*/React.createElement(Fallback, {
83
40
  error: (_this$state = this.state) === null || _this$state === void 0 ? void 0 : _this$state.error,
84
41
  info: (_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.info,
85
- resetErrorBoundary: this.resetErrorBoundary,
86
- errorType: this.props.errorType || 'render'
42
+ resetErrorBoundary: this.resetErrorBoundary
87
43
  });
88
44
  }
89
45
  return this.props.children;
@@ -1 +1 @@
1
- {"version":3,"names":["React","Fallback","appModalService","injector","ErrorBoundary","Component","constructor","props","_defineProperty","setState","hasError","error","undefined","info","state","getDerivedStateFromError","appConfig","get","prefs","preferences","globalEnabled","enableGlobalErrorHandler","renderEnabled","enableRenderErrors","componentDidCatch","appInstance","app","triggerOnError","e","console","modalsOpened","length","pop","showLastModal","render","_appConfig$preference","_this$state","_this$state2","showFallback","showDefaultErrorFallback","createElement","resetErrorBoundary","errorType","children"],"sources":["error-boundary.component.tsx"],"sourcesContent":["import * as React from 'react';\nimport Fallback from './components/error-fallback/error-fallback.component';\nimport appModalService from '@wavemaker/app-rn-runtime/runtime/services/app-modal.service';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n info?: any;\n error?: any;\n}\n\ninterface ErrorBoundaryProps {\n currentPage?: any;\n children: React.ReactNode;\n errorType?: 'render' | 'javascript';\n app?: any;\n}\n\nexport default class ErrorBoundary extends React.Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n \n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n // Check preferences before setting error state\n const appConfig = injector.get<any>('APP_CONFIG');\n const prefs = appConfig?.preferences;\n const globalEnabled = prefs?.enableGlobalErrorHandler === true;\n const renderEnabled = prefs?.enableRenderErrors !== false;\n \n // Only set hasError if error handling is enabled\n if (!globalEnabled || !renderEnabled) {\n return { hasError: false };\n }\n \n return { hasError: true };\n }\n\n resetErrorBoundary = () => {\n this.setState({ hasError: false, error: undefined, info: undefined });\n };\n\n componentDidCatch(error: any, info: any) {\n // Check if error handling is enabled\n const appConfig = injector.get<any>('APP_CONFIG');\n const prefs = appConfig?.preferences;\n const globalEnabled = prefs?.enableGlobalErrorHandler === true;\n const renderEnabled = prefs?.enableRenderErrors !== false;\n \n // Only catch if both master switch and render errors are enabled\n if (!globalEnabled || !renderEnabled) {\n return;\n }\n \n // Trigger user error callback if app instance is available\n let appInstance = this.props.app;\n \n // Fallback: try to get app instance from injector if prop is not available\n if (!appInstance) {\n appInstance = injector.get('APP_INSTANCE');\n }\n \n if (appInstance && appInstance.triggerOnError) {\n try {\n appInstance.triggerOnError(error, info, 'render');\n } catch (e) {\n console.error('Error calling triggerOnError:', e);\n }\n }\n \n if(error && appModalService.modalsOpened.length > 0){\n appModalService.modalsOpened.pop();\n (appModalService as any).showLastModal();\n }\n this.setState({ error, info });\n }\n\n render() {\n if (this.state.hasError) {\n const appConfig = injector.get<any>('APP_CONFIG');\n const showFallback = appConfig?.preferences?.showDefaultErrorFallback !== false;\n \n if (!showFallback) {\n return null;\n }\n \n return <Fallback \n error={this.state?.error} \n info={this.state?.info} \n resetErrorBoundary={this.resetErrorBoundary}\n errorType={this.props.errorType || 'render'}\n />;\n }\n\n return this.props.children;\n }\n}\n"],"mappings":";;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,QAAQ,MAAM,sDAAsD;AAC3E,OAAOC,eAAe,MAAM,8DAA8D;AAC1F,OAAOC,QAAQ,MAAM,yCAAyC;AAe9D,eAAe,MAAMC,aAAa,SAASJ,KAAK,CAACK,SAAS,CAGxD;EAEAC,WAAWA,CAACC,KAAU,EAAE;IACtB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,6BAmBM,MAAM;MACzB,IAAI,CAACC,QAAQ,CAAC;QAAEC,QAAQ,EAAE,KAAK;QAAEC,KAAK,EAAEC,SAAS;QAAEC,IAAI,EAAED;MAAU,CAAC,CAAC;IACvE,CAAC;IApBC,IAAI,CAACE,KAAK,GAAG;MAAEJ,QAAQ,EAAE;IAAM,CAAC;EAClC;EAEA,OAAOK,wBAAwBA,CAACJ,KAAU,EAAE;IAC1C;IACA,MAAMK,SAAS,GAAGb,QAAQ,CAACc,GAAG,CAAM,YAAY,CAAC;IACjD,MAAMC,KAAK,GAAGF,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEG,WAAW;IACpC,MAAMC,aAAa,GAAG,CAAAF,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEG,wBAAwB,MAAK,IAAI;IAC9D,MAAMC,aAAa,GAAG,CAAAJ,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEK,kBAAkB,MAAK,KAAK;;IAEzD;IACA,IAAI,CAACH,aAAa,IAAI,CAACE,aAAa,EAAE;MACpC,OAAO;QAAEZ,QAAQ,EAAE;MAAM,CAAC;IAC5B;IAEA,OAAO;MAAEA,QAAQ,EAAE;IAAK,CAAC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YAAA;MACvB,MAAMrB,SAAS,GAAGb,QAAQ,CAACc,GAAG,CAAM,YAAY,CAAC;MACjD,MAAMqB,YAAY,GAAG,CAAAtB,SAAS,aAATA,SAAS,gBAAAmB,qBAAA,GAATnB,SAAS,CAAEG,WAAW,cAAAgB,qBAAA,uBAAtBA,qBAAA,CAAwBI,wBAAwB,MAAK,KAAK;MAE/E,IAAI,CAACD,YAAY,EAAE;QACjB,OAAO,IAAI;MACb;MAEA,oBAAOtC,KAAA,CAAAwC,aAAA,CAACvC,QAAQ;QACdU,KAAK,GAAAyB,WAAA,GAAE,IAAI,CAACtB,KAAK,cAAAsB,WAAA,uBAAVA,WAAA,CAAYzB,KAAM;QACzBE,IAAI,GAAAwB,YAAA,GAAE,IAAI,CAACvB,KAAK,cAAAuB,YAAA,uBAAVA,YAAA,CAAYxB,IAAK;QACvB4B,kBAAkB,EAAE,IAAI,CAACA,kBAAmB;QAC5CC,SAAS,EAAE,IAAI,CAACnC,KAAK,CAACmC,SAAS,IAAI;MAAS,CAC7C,CAAC;IACJ;IAEA,OAAO,IAAI,CAACnC,KAAK,CAACoC,QAAQ;EAC5B;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Fallback","appModalService","ErrorBoundary","Component","constructor","props","_defineProperty","setState","hasError","error","undefined","info","state","getDerivedStateFromError","componentDidCatch","modalsOpened","length","pop","showLastModal","render","_this$state","_this$state2","createElement","resetErrorBoundary","children"],"sources":["error-boundary.component.tsx"],"sourcesContent":["import * as React from 'react';\nimport Fallback from './components/error-fallback/error-fallback.component';\nimport appModalService from '@wavemaker/app-rn-runtime/runtime/services/app-modal.service';\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n info?: any;\n error?: any;\n}\n\ninterface ErrorBoundaryProps {\n currentPage?: any;\n children: React.ReactNode;\n}\n\nexport default class ErrorBoundary extends React.Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n \n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n return { hasError: true };\n }\n\n resetErrorBoundary = () => {\n this.setState({ hasError: false, error: undefined, info: undefined });\n };\n\n componentDidCatch(error: any, info: any) {\n if(error && appModalService.modalsOpened.length > 0){\n appModalService.modalsOpened.pop();\n (appModalService as any).showLastModal();\n }\n this.setState({ error, info });\n }\n\n render() {\n if (this.state.hasError) {\n return <Fallback error={this.state?.error} info={this.state?.info} resetErrorBoundary={this.resetErrorBoundary} />;\n }\n\n return this.props.children;\n }\n}\n"],"mappings":";;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,QAAQ,MAAM,sDAAsD;AAC3E,OAAOC,eAAe,MAAM,8DAA8D;AAa1F,eAAe,MAAMC,aAAa,SAASH,KAAK,CAACI,SAAS,CAGxD;EAEAC,WAAWA,CAACC,KAAU,EAAE;IACtB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,6BAQM,MAAM;MACzB,IAAI,CAACC,QAAQ,CAAC;QAAEC,QAAQ,EAAE,KAAK;QAAEC,KAAK,EAAEC,SAAS;QAAEC,IAAI,EAAED;MAAU,CAAC,CAAC;IACvE,CAAC;IATC,IAAI,CAACE,KAAK,GAAG;MAAEJ,QAAQ,EAAE;IAAM,CAAC;EAClC;EAEA,OAAOK,wBAAwBA,CAACJ,KAAU,EAAE;IAC1C,OAAO;MAAED,QAAQ,EAAE;IAAK,CAAC;EAC3B;EAMAM,iBAAiBA,CAACL,KAAU,EAAEE,IAAS,EAAE;IACvC,IAAGF,KAAK,IAAIR,eAAe,CAACc,YAAY,CAACC,MAAM,GAAG,CAAC,EAAC;MAClDf,eAAe,CAACc,YAAY,CAACE,GAAG,CAAC,CAAC;MACjChB,eAAe,CAASiB,aAAa,CAAC,CAAC;IAC1C;IACA,IAAI,CAACX,QAAQ,CAAC;MAAEE,KAAK;MAAEE;IAAK,CAAC,CAAC;EAChC;EAEAQ,MAAMA,CAAA,EAAG;IACP,IAAI,IAAI,CAACP,KAAK,CAACJ,QAAQ,EAAE;MAAA,IAAAY,WAAA,EAAAC,YAAA;MACvB,oBAAOtB,KAAA,CAAAuB,aAAA,CAACtB,QAAQ;QAACS,KAAK,GAAAW,WAAA,GAAE,IAAI,CAACR,KAAK,cAAAQ,WAAA,uBAAVA,WAAA,CAAYX,KAAM;QAACE,IAAI,GAAAU,YAAA,GAAE,IAAI,CAACT,KAAK,cAAAS,YAAA,uBAAVA,YAAA,CAAYV,IAAK;QAACY,kBAAkB,EAAE,IAAI,CAACA;MAAmB,CAAE,CAAC;IACpH;IAEA,OAAO,IAAI,CAAClB,KAAK,CAACmB,QAAQ;EAC5B;AACF","ignoreList":[]}
@@ -2,7 +2,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  import React from "react";
5
- import { View, Animated } from "react-native";
5
+ import { View, Animated, Keyboard, TextInput, findNodeHandle } from "react-native";
6
6
  import { ThemeProvider } from "../styles/theme";
7
7
  const FixedViewContext = /*#__PURE__*/React.createContext(null);
8
8
  export class FixedView extends React.Component {
@@ -11,6 +11,22 @@ export class FixedView extends React.Component {
11
11
  _defineProperty(this, "container", null);
12
12
  _defineProperty(this, "cachedComponent", void 0);
13
13
  _defineProperty(this, "id", FixedView.counter++);
14
+ /**
15
+ *
16
+ * Capture the touch before it reaches child Touchables
17
+ */
18
+ _defineProperty(this, "handleStartShouldSetResponderCapture", event => {
19
+ var _event$nativeEvent;
20
+ const textInputState = TextInput.State;
21
+ const focusedInput = textInputState !== null && textInputState !== void 0 && textInputState.currentlyFocusedInput ? textInputState.currentlyFocusedInput() : null;
22
+ const focusedHandle = focusedInput ? findNodeHandle(focusedInput) : textInputState !== null && textInputState !== void 0 && textInputState.currentlyFocusedInput ? textInputState.currentlyFocusedInput() : null;
23
+ if (focusedHandle && (event === null || event === void 0 || (_event$nativeEvent = event.nativeEvent) === null || _event$nativeEvent === void 0 ? void 0 : _event$nativeEvent.target) === focusedHandle) {
24
+ // Should not dismiss keyboard if the user presses on the same text input that is already focused
25
+ return false;
26
+ }
27
+ Keyboard.dismiss();
28
+ return false; // let the touch reach the child Touchables
29
+ });
14
30
  }
15
31
  componentWillUnmount() {
16
32
  this.container.remove(this);
@@ -27,7 +43,8 @@ export class FixedView extends React.Component {
27
43
  style: [{
28
44
  position: 'absolute'
29
45
  }, this.props.style],
30
- testID: `${this.props.name}-fixed-view`
46
+ testID: `${this.props.name}-fixed-view`,
47
+ onStartShouldSetResponderCapture: this.handleStartShouldSetResponderCapture
31
48
  }, this.props.children)));
32
49
  } else {
33
50
  container.remove(this);
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Animated","ThemeProvider","FixedViewContext","createContext","FixedView","Component","constructor","props","_defineProperty","counter","componentWillUnmount","container","remove","render","WrapperView","animated","cachedComponent","usememo","createElement","Consumer","show","add","value","theme","key","id","style","position","testID","name","children","Fragment","Date","now","FixedViewContainer","args","Map","c","n","set","setTimeout","setState","delete","Provider","Array","from","values"],"sources":["fixed-view.component.tsx"],"sourcesContent":["\nimport React from \"react\";\nimport { View, ViewStyle, Animated } from \"react-native\";\nimport { Theme, ThemeProvider } from \"../styles/theme\";\n\nconst FixedViewContext = React.createContext<FixedViewContainer>(null as any);\n\nexport interface FixedViewProps {\n name?: string;\n style?: ViewStyle,\n show?: boolean;\n theme: Theme;\n usememo?: boolean;\n children?: any;\n animated?: boolean;\n}\n\nexport class FixedView extends React.Component<FixedViewProps> {\n static defaultProps = {\n show: true, \n animated: false\n };\n static counter = Date.now();\n container: FixedViewContainer = null as any;\n cachedComponent: React.ReactNode;\n id = FixedView.counter++;\n\n constructor(props: FixedViewProps) {\n super(props);\n }\n\n componentWillUnmount() {\n this.container.remove(this);\n }\n\n render() {\n const WrapperView = this.props.animated ? Animated.View : View\n this.cachedComponent = (this.props.usememo === true && this.cachedComponent ) || (<FixedViewContext.Consumer>\n {(container) => {\n this.container = container;\n if (this.props.show) {\n container.add(this, (\n <ThemeProvider value={this.props.theme} key={this.id}>\n <WrapperView style={[\n {position: 'absolute'},\n this.props.style]}\n testID={`${this.props.name}-fixed-view`}\n >\n {this.props.children}\n </WrapperView>\n </ThemeProvider>\n ));\n } else {\n container.remove(this);\n }\n return <></>;\n }}\n </FixedViewContext.Consumer>);\n return this.cachedComponent;\n }\n}\n\nexport class FixedViewContainer extends React.Component {\n children: Map<FixedView, React.ReactNode> = new Map();\n id = 0;\n\n add(c: FixedView, n : React.ReactNode) {\n this.children.set(c, n);\n setTimeout(() => this.setState({id: ++this.id}));\n }\n\n remove(c: FixedView) {\n this.children.delete(c);\n setTimeout(() => this.setState({id: ++this.id}));\n }\n\n render() {\n return (\n <FixedViewContext.Provider value={this}>\n {(this.props as any).children}\n {Array.from(this.children.values())}\n </FixedViewContext.Provider>\n ) ;\n }\n};"],"mappings":";;;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAaC,QAAQ,QAAQ,cAAc;AACxD,SAAgBC,aAAa,QAAQ,iBAAiB;AAEtD,MAAMC,gBAAgB,gBAAGJ,KAAK,CAACK,aAAa,CAAqB,IAAW,CAAC;AAY7E,OAAO,MAAMC,SAAS,SAASN,KAAK,CAACO,SAAS,CAAiB;EAU3DC,WAAWA,CAACC,KAAqB,EAAE;IAC/B,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,oBALe,IAAI;IAAAA,eAAA;IAAAA,eAAA,aAE/BJ,SAAS,CAACK,OAAO,EAAE;EAIxB;EAEAC,oBAAoBA,CAAA,EAAG;IACnB,IAAI,CAACC,SAAS,CAACC,MAAM,CAAC,IAAI,CAAC;EAC/B;EAEAC,MAAMA,CAAA,EAAG;IACL,MAAMC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,SAAAA,IAAA;IAAA3B,eAAA,mBACR,IAAI4B,GAAG,CAAC,CAAC;IAAA5B,eAAA,aAChD,CAAC;EAAA;EAENa,GAAGA,CAACgB,CAAY,EAAEC,CAAmB,EAAE;IACnC,IAAI,CAACR,QAAQ,CAACS,GAAG,CAACF,CAAC,EAAEC,CAAC,CAAC;IACvBE,UAAU,CAAC,MAAM,IAAI,CAACC,QAAQ,CAAC;MAAChB,EAAE,EAAE,EAAE,IAAI,CAACA;IAAE,CAAC,CAAC,CAAC;EACpD;EAEAb,MAAMA,CAACyB,CAAY,EAAE;IACjB,IAAI,CAACP,QAAQ,CAACY,MAAM,CAACL,CAAC,CAAC;IACvBG,UAAU,CAAC,MAAM,IAAI,CAACC,QAAQ,CAAC;MAAChB,EAAE,EAAE,EAAE,IAAI,CAACA;IAAE,CAAC,CAAC,CAAC;EACpD;EAEAZ,MAAMA,CAAA,EAAG;IACL,oBACIf,KAAA,CAAAoB,aAAA,CAAChB,gBAAgB,CAACyC,QAAQ;MAACrB,KAAK,EAAE;IAAK,GACjC,IAAI,CAACf,KAAK,CAASuB,QAAQ,EAC5Bc,KAAK,CAACC,IAAI,CAAC,IAAI,CAACf,QAAQ,CAACgB,MAAM,CAAC,CAAC,CACX,CAAC;EAEpC;AACJ;AAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","View","Animated","Keyboard","TextInput","findNodeHandle","ThemeProvider","FixedViewContext","createContext","FixedView","Component","constructor","props","_defineProperty","counter","event","_event$nativeEvent","textInputState","State","focusedInput","currentlyFocusedInput","focusedHandle","nativeEvent","target","dismiss","componentWillUnmount","container","remove","render","WrapperView","animated","cachedComponent","usememo","createElement","Consumer","show","add","value","theme","key","id","style","position","testID","name","onStartShouldSetResponderCapture","handleStartShouldSetResponderCapture","children","Fragment","Date","now","FixedViewContainer","args","Map","c","n","set","setTimeout","setState","delete","Provider","Array","from","values"],"sources":["fixed-view.component.tsx"],"sourcesContent":["\nimport React from \"react\";\nimport { View, ViewStyle, Animated, Keyboard, TextInput, findNodeHandle, GestureResponderEvent } from \"react-native\";\nimport { Theme, ThemeProvider } from \"../styles/theme\";\n\nconst FixedViewContext = React.createContext<FixedViewContainer>(null as any);\n\nexport interface FixedViewProps {\n name?: string;\n style?: ViewStyle,\n show?: boolean;\n theme: Theme;\n usememo?: boolean;\n children?: any;\n animated?: boolean;\n}\n\nexport class FixedView extends React.Component<FixedViewProps> {\n static defaultProps = {\n show: true, \n animated: false\n };\n static counter = Date.now();\n container: FixedViewContainer = null as any;\n cachedComponent: React.ReactNode;\n id = FixedView.counter++;\n\n constructor(props: FixedViewProps) {\n super(props);\n }\n\n /**\n * \n * Capture the touch before it reaches child Touchables\n */\n handleStartShouldSetResponderCapture = (event: GestureResponderEvent) => {\n const textInputState = TextInput.State as any;\n const focusedInput = textInputState?.currentlyFocusedInput ? textInputState.currentlyFocusedInput() : null;\n const focusedHandle = focusedInput\n ? findNodeHandle(focusedInput)\n : textInputState?.currentlyFocusedInput\n ? textInputState.currentlyFocusedInput()\n : null;\n\n if (focusedHandle && event?.nativeEvent?.target === focusedHandle) {\n // Should not dismiss keyboard if the user presses on the same text input that is already focused\n return false;\n }\n\n Keyboard.dismiss();\n return false; // let the touch reach the child Touchables\n };\n\n componentWillUnmount() {\n this.container.remove(this);\n }\n\n render() {\n const WrapperView = this.props.animated ? Animated.View : View\n this.cachedComponent = (this.props.usememo === true && this.cachedComponent ) || (<FixedViewContext.Consumer>\n {(container) => {\n this.container = container;\n if (this.props.show) {\n container.add(this, (\n <ThemeProvider value={this.props.theme} key={this.id}>\n <WrapperView style={[\n {position: 'absolute'},\n this.props.style]}\n testID={`${this.props.name}-fixed-view`}\n onStartShouldSetResponderCapture={this.handleStartShouldSetResponderCapture}\n >\n {this.props.children}\n </WrapperView>\n </ThemeProvider>\n ));\n } else {\n container.remove(this);\n }\n return <></>;\n }}\n </FixedViewContext.Consumer>);\n return this.cachedComponent;\n }\n}\n\nexport class FixedViewContainer extends React.Component {\n children: Map<FixedView, React.ReactNode> = new Map();\n id = 0;\n\n add(c: FixedView, n : React.ReactNode) {\n this.children.set(c, n);\n setTimeout(() => this.setState({id: ++this.id}));\n }\n\n remove(c: FixedView) {\n this.children.delete(c);\n setTimeout(() => this.setState({id: ++this.id}));\n }\n\n render() {\n return (\n <FixedViewContext.Provider value={this}>\n {(this.props as any).children}\n {Array.from(this.children.values())}\n </FixedViewContext.Provider>\n ) ;\n }\n};"],"mappings":";;;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAaC,QAAQ,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,cAAc,QAA+B,cAAc;AACpH,SAAgBC,aAAa,QAAQ,iBAAiB;AAEtD,MAAMC,gBAAgB,gBAAGP,KAAK,CAACQ,aAAa,CAAqB,IAAW,CAAC;AAY7E,OAAO,MAAMC,SAAS,SAAST,KAAK,CAACU,SAAS,CAAiB;EAU3DC,WAAWA,CAACC,KAAqB,EAAE;IAC/B,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,oBALe,IAAI;IAAAA,eAAA;IAAAA,eAAA,aAE/BJ,SAAS,CAACK,OAAO,EAAE;IAMxB;AACJ;AACA;AACA;IAHID,eAAA,+CAIwCE,KAA4B,IAAK;MAAA,IAAAC,kBAAA;MACrE,MAAMC,cAAc,GAAGb,SAAS,CAACc,KAAY;MAC7C,MAAMC,YAAY,GAAGF,cAAc,aAAdA,cAAc,eAAdA,cAAc,CAAEG,qBAAqB,GAAGH,cAAc,CAACG,qBAAqB,CAAC,CAAC,GAAG,IAAI;MAC1G,MAAMC,aAAa,GAAGF,YAAY,GAC5Bd,cAAc,CAACc,YAAY,CAAC,GAC5BF,cAAc,aAAdA,cAAc,eAAdA,cAAc,CAAEG,qBAAqB,GACjCH,cAAc,CAACG,qBAAqB,CAAC,CAAC,GACtC,IAAI;MAEd,IAAIC,aAAa,IAAI,CAAAN,KAAK,aAALA,KAAK,gBAAAC,kBAAA,GAALD,KAAK,CAAEO,WAAW,cAAAN,kB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
  }
59
59
  };
60
- const onScroll = useAnimatedScrollHandler({
61
- onScroll: event => {
62
- 'worklet';
60
+ const onScrollWorklet = event => {
61
+ 'worklet';
63
62
 
64
- var _event$contentOffset;
65
- const y = (_event$contentOffset = event.contentOffset) === null || _event$contentOffset === void 0 ? void 0 : _event$contentOffset.y;
66
- const currentScrollTime = Date.now();
67
- const delta = y - prevScrollY.value;
68
- const delaTime = currentScrollTime - prevScrollTime.value;
69
- if (delta != 0) scrollDirection.value = delta > 0 ? -1 : 1;
70
- if (Math.abs(delta) >= 0.1) {
71
- prevScrollY.value = y;
72
- scrollY.value = Math.max(0, y);
73
- stickyNavTranslateY.value = Math.max(Math.min(stickyNavTranslateY.value + delta, navHeight.value), 0);
74
- scrollVelocity.value = Math.abs(delta) / delaTime;
75
- prevScrollTime.value = currentScrollTime;
76
- }
77
- if (currentScrollTime - lastNotifyTime.value >= 100) {
78
- var _event$contentOffset$, _event$contentOffset2, _event$contentSize$he, _event$contentSize, _event$layoutMeasurem, _event$layoutMeasurem2;
79
- lastNotifyTime.value = currentScrollTime;
80
- const safeEvent = {
81
- contentOffset: {
82
- y: (_event$contentOffset$ = (_event$contentOffset2 = event.contentOffset) === null || _event$contentOffset2 === void 0 ? void 0 : _event$contentOffset2.y) !== null && _event$contentOffset$ !== void 0 ? _event$contentOffset$ : 0
83
- },
84
- contentSize: {
85
- height: (_event$contentSize$he = (_event$contentSize = event.contentSize) === null || _event$contentSize === void 0 ? void 0 : _event$contentSize.height) !== null && _event$contentSize$he !== void 0 ? _event$contentSize$he : 0
86
- },
87
- layoutMeasurement: {
88
- height: (_event$layoutMeasurem = (_event$layoutMeasurem2 = event.layoutMeasurement) === null || _event$layoutMeasurem2 === void 0 ? void 0 : _event$layoutMeasurem2.height) !== null && _event$layoutMeasurem !== void 0 ? _event$layoutMeasurem : 0
89
- },
90
- scrollDirection: scrollDirection.value,
91
- scrollDelta: delta
92
- };
93
- runOnJS(notifyEvent)(safeEvent);
94
- }
63
+ // iOS bounce reports negative offsets, which would push the sticky nav off-screen.
64
+ var _event$contentOffset$, _event$contentOffset;
65
+ const y = Math.max(0, (_event$contentOffset$ = (_event$contentOffset = event.contentOffset) === null || _event$contentOffset === void 0 ? void 0 : _event$contentOffset.y) !== null && _event$contentOffset$ !== void 0 ? _event$contentOffset$ : 0);
66
+ const currentScrollTime = Date.now();
67
+ const delta = y - prevScrollY.value;
68
+ const delaTime = currentScrollTime - prevScrollTime.value;
69
+ if (delta != 0) scrollDirection.value = delta > 0 ? -1 : 1;
70
+ if (Math.abs(delta) >= 0.1) {
71
+ prevScrollY.value = y;
72
+ scrollY.value = Math.max(0, y);
73
+ stickyNavTranslateY.value = Math.max(Math.min(stickyNavTranslateY.value + delta, navHeight.value), 0);
74
+ scrollVelocity.value = Math.abs(delta) / delaTime;
75
+ prevScrollTime.value = currentScrollTime;
95
76
  }
77
+ if (currentScrollTime - lastNotifyTime.value >= 100) {
78
+ var _event$contentOffset$2, _event$contentOffset2, _event$contentSize$he, _event$contentSize, _event$layoutMeasurem, _event$layoutMeasurem2;
79
+ lastNotifyTime.value = currentScrollTime;
80
+ const safeEvent = {
81
+ contentOffset: {
82
+ y: (_event$contentOffset$2 = (_event$contentOffset2 = event.contentOffset) === null || _event$contentOffset2 === void 0 ? void 0 : _event$contentOffset2.y) !== null && _event$contentOffset$2 !== void 0 ? _event$contentOffset$2 : 0
83
+ },
84
+ contentSize: {
85
+ height: (_event$contentSize$he = (_event$contentSize = event.contentSize) === null || _event$contentSize === void 0 ? void 0 : _event$contentSize.height) !== null && _event$contentSize$he !== void 0 ? _event$contentSize$he : 0
86
+ },
87
+ layoutMeasurement: {
88
+ height: (_event$layoutMeasurem = (_event$layoutMeasurem2 = event.layoutMeasurement) === null || _event$layoutMeasurem2 === void 0 ? void 0 : _event$layoutMeasurem2.height) !== null && _event$layoutMeasurem !== void 0 ? _event$layoutMeasurem : 0
89
+ },
90
+ scrollDirection: scrollDirection.value,
91
+ scrollDelta: delta
92
+ };
93
+ runOnJS(notifyEvent)(safeEvent);
94
+ }
95
+ };
96
+ const onScroll = useAnimatedScrollHandler({
97
+ onScroll: onScrollWorklet
96
98
  });
97
99
  const onScrollEndDrag = scrollRef => {
98
100
  'worklet';
@@ -124,6 +126,7 @@ export const StickyWrapper = ({
124
126
  navHeight,
125
127
  bottomTabHeight,
126
128
  onScroll,
129
+ onScrollWorklet,
127
130
  onScrollEndDrag
128
131
  };
129
132
  return /*#__PURE__*/React.createElement(StickyWrapperContext.Provider, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","runOnJS","useAnimatedScrollHandler","useAnimatedStyle","useSharedValue","injector","useSafeAreaInsets","StickyWrapperContext","createContext","undefined","StickyWrapper","children","hasAppnavbar","onscroll","notifier","_appConfig$edgeToEdge","appConfig","get","scrollY","prevScrollY","scrollVelocity","scrollDirection","stickyContainerTranslateY","stickyNavTranslateY","insets","insetsVal","edgeToEdgeConfig","isEdgeToEdgeApp","top","navHeight","bottomTabHeight","lastNotifyTime","prevScrollTime","stickyNavAnimateStyle","transform","translateY","value","stickyContainerAnimateStyle","stickyNav","Math","max","notifyEvent","event","notify","nativeEvent","onScroll","_event$contentOffset","y","contentOffset","currentScrollTime","Date","now","delta","delaTime","abs","min","_event$contentOffset$","_event$contentOffset2","_event$contentSize$he","_event$contentSize","_event$layoutMeasurem","_event$layoutMeasurem2","safeEvent","contentSize","height","layoutMeasurement","scrollDelta","onScrollEndDrag","scrollRef","_scrollRef$current","current","scrollTo","animated","_scrollRef$current2","contextValue","createElement","Provider"],"sources":["sticky-wrapper.tsx"],"sourcesContent":["import React, { RefObject } from \"react\";\nimport { NativeScrollEvent, NativeSyntheticEvent } from \"react-native\";\nimport Animated, { AnimatedStyle, ReanimatedEvent, runOnJS, ScrollEvent, SharedValue, useAnimatedScrollHandler, useAnimatedStyle, useSharedValue } from \"react-native-reanimated\";\nimport { StickyViewComponentsProps } from \"./sticky-view.component\";\nimport injector from \"./injector\";\nimport AppConfig from \"./AppConfig\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\n\n// StickyWrapperContext is used for the usage & passing of hooks in StickyWrapper(functional component) to childrens.\nexport const StickyWrapperContext = React.createContext<StickyWrapperContextType | undefined>(undefined);\n\nexport type CustomJsScrollEvent = {\n contentOffset: { y: number };\n contentSize: { height: number};\n layoutMeasurement: { height: number};\n scrollDirection: number;\n scrollDelta: number;\n};\n\n\nexport type StickyWrapperContextType = {\n stickyNavTranslateY?: SharedValue<number>;\n stickyContainerTranslateY: SharedValue<number>;\n\n stickyNavAnimateStyle: AnimatedStyle;\n stickyContainerAnimateStyle: AnimatedStyle;\n\n navHeight: SharedValue<number>;\n bottomTabHeight: SharedValue<number>;\n scrollDirection: SharedValue<number>;\n\n onScroll: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;\n onScrollEndDrag: (scrollRef: RefObject<Animated.ScrollView>) => void;\n};\n\nexport const StickyWrapper = ({ children, hasAppnavbar, onscroll, notifier }: StickyViewComponentsProps) => {\n const appConfig = injector.get<AppConfig>('APP_CONFIG');\n const scrollY = useSharedValue<number>(0);\n const prevScrollY = useSharedValue<number>(0);\n const scrollVelocity = useSharedValue<number>(0);\n const scrollDirection = useSharedValue<number>(0);\n\n const stickyContainerTranslateY = useSharedValue<number>(0);\n const stickyNavTranslateY = useSharedValue<number>(0);\n\n // Default navbar height from appnavbar styles is 80, maintaining this to minimize the navHeight immediate flicker (in page-content paddingTop)\n const insets = useSafeAreaInsets();\n const insetsVal = appConfig?.edgeToEdgeConfig?.isEdgeToEdgeApp ? insets?.top : 0;\n const navHeight = useSharedValue<number>(hasAppnavbar && (onscroll == 'topnav' || onscroll == 'topnav-bottomnav') ? (80 + insetsVal) : 0);\n const bottomTabHeight = useSharedValue<number>(0);\n\n const lastNotifyTime = useSharedValue<number>(0);\n const prevScrollTime = useSharedValue<number>(0);\n\n const stickyNavAnimateStyle = useAnimatedStyle(() => {\n return {\n transform: [{ translateY: -stickyNavTranslateY.value }]\n };\n }, [stickyNavTranslateY]);\n\n const stickyContainerAnimateStyle = useAnimatedStyle(() => {\n const stickyNav = onscroll == 'topnav' || onscroll == 'topnav-bottomnav';\n if(stickyNav){\n return {\n transform: [{ translateY: \n Math.max(\n Math.max(stickyContainerTranslateY.value - navHeight.value - scrollY.value, - navHeight.value), \n - stickyNavTranslateY.value\n )\n }],\n }\n }else{\n return {\n transform: [{ translateY: Math.max(stickyContainerTranslateY.value - scrollY.value, navHeight.value)}]\n }\n }\n }, [scrollY, stickyContainerTranslateY, navHeight, stickyNavTranslateY]);\n\n const notifyEvent = (event: CustomJsScrollEvent)=>{\n if(notifier) {\n notifier.notify('scroll', [{nativeEvent: event}]);\n }\n }\n\n const onScroll = useAnimatedScrollHandler({\n onScroll: (event: ReanimatedEvent<ScrollEvent>): void => {\n 'worklet';\n const y = event.contentOffset?.y;\n const currentScrollTime = Date.now();\n\n const delta = y - prevScrollY.value;\n const delaTime = currentScrollTime - prevScrollTime.value;\n if(delta != 0) scrollDirection.value = delta > 0 ? -1 : 1;\n\n if (Math.abs(delta) >= 0.1){\n prevScrollY.value = y;\n scrollY.value = Math.max(0, y);\n\n stickyNavTranslateY.value = Math.max(Math.min(stickyNavTranslateY.value + delta, navHeight.value), 0);\n\n scrollVelocity.value = Math.abs(delta) / delaTime;\n prevScrollTime.value = currentScrollTime;\n }\n\n if(currentScrollTime - lastNotifyTime.value >= 100){\n lastNotifyTime.value = currentScrollTime;\n const safeEvent = {\n contentOffset: {\n y: event.contentOffset?.y ?? 0,\n },\n contentSize: {\n height: event.contentSize?.height ?? 0,\n },\n layoutMeasurement: {\n height: event.layoutMeasurement?.height ?? 0,\n },\n scrollDirection: scrollDirection.value,\n scrollDelta: delta,\n };\n runOnJS(notifyEvent)(safeEvent);\n }\n }\n });\n\n const onScrollEndDrag = (scrollRef: RefObject<Animated.ScrollView>): void =>{\n 'worklet';\n const y = scrollY.value;\n if(scrollVelocity.value < 0.3){\n if(scrollDirection.value < 0 && stickyNavTranslateY.value >= (navHeight.value / 9.9)){ // bottom visible\n scrollRef?.current?.scrollTo({ y: y + (navHeight.value - stickyNavTranslateY.value), animated: true })\n } else if( scrollDirection.value > 0 && stickyNavTranslateY.value <= (navHeight.value / 1.1)) { // top content visible\n scrollRef?.current?.scrollTo({ y: y - stickyNavTranslateY.value, animated: true })\n }\n }\n }\n\n const contextValue = {\n scrollDirection,\n stickyNavAnimateStyle,\n stickyContainerAnimateStyle,\n stickyContainerTranslateY,\n navHeight,\n bottomTabHeight, \n onScroll,\n onScrollEndDrag\n };\n\n return (\n <StickyWrapperContext.Provider value={contextValue}>\n {children}\n </StickyWrapperContext.Provider>\n );\n};"],"mappings":"AAAA,OAAOA,KAAK,MAAqB,OAAO;AAExC,SAAmDC,OAAO,EAA4BC,wBAAwB,EAAEC,gBAAgB,EAAEC,cAAc,QAAQ,yBAAyB;AAEjL,OAAOC,QAAQ,MAAM,YAAY;AAEjC,SAASC,iBAAiB,QAAQ,gCAAgC;;AAElE;AACA,OAAO,MAAMC,oBAAoB,gBAAGP,KAAK,CAACQ,aAAa,CAAuCC,SAAS,CAAC;AA0BxG,OAAO,MAAMC,aAAa,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,YAAY;EAAEC,QAAQ;EAAEC;AAAoC,CAAC,KAAK;EAAA,IAAAC,qBAAA;EAC1G,MAAMC,SAAS,GAAGX,QAAQ,CAACY,GAAG,CAAY,YAAY,CAAC;EACvD,MAAMC,OAAO,GAAGd,cAAc,CAAS,CAAC,CAAC;EACzC,MAAMe,WAAW,GAAGf,cAAc,CAAS,CAAC,CAAC;EAC7C,MAAMgB,cAAc,GAAGhB,cAAc,CAAS,CAAC,CAAC;EAChD,MAAMiB,eAAe,GAAGjB,cAAc,CAAS,CAAC,CAAC;EAEjD,MAAMkB,yBAAyB,GAAGlB,cAAc,CAAS,CAAC,CAAC;EAC3D,MAAMmB,mBAAmB,GAAGnB,cAAc,CAAS,CAAC,CAAC;;EAErD;EACA,MAAMoB,MAAM,GAAGlB,iBAAiB,CAAC,CAAC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,EAAC;MAC5B,IAAGf,eAAe,CAACe,KAAK,GAAG,CAAC,IAAIb,mBAAmB,CAACa,KAAK,IAAKP,SAAS,CAACO,KAAK,GAAG,GAAI,EAAC;QAAA,IAAAiC,kBAAA;QAAE;QACrFD,SAAS,aAATA,SAAS,gBAAAC,kBAAA,GAATD,SAAS,CAAEE,OAAO,cAAAD,kBAAA,eAAlBA,kBAAA,CAAoBE,QAAQ,CAAC;UAAExB,CAAC,EAAEA,CAAC,IAAIlB,SAAS,CAACO,KAAK,GAAGb,mBAAmB,CAACa,KAAK,CAAC;UAAEoC,QAAQ,EAAE;QAAK,CAAC,CAAC;MACxG,CAAC,MAAM,IAAInD,eAAe,CAACe,KAAK,GAAG,CAAC,IAAKb,mBAAmB,CAACa,KAAK,IAAKP,SAAS,CAACO,KAAK,GAAG,GAAI,EAAE;QAAA,IAAAqC,mBAAA;QAAE;QAC/FL,SAAS,aAATA,SAAS,gBAAAK,mBAAA,GAATL,SAAS,CAAEE,OAAO,cAAAG,mBAAA,eAAlBA,mBAAA,CAAoBF,QAAQ,CAAC;UAAExB,CAAC,EAAEA,CAAC,GAAGxB,mBAAmB,CAACa,KAAK;UAAEoC,QAAQ,EAAE;QAAK,CAAC,CAAC;MACpF;IACF;EACF,CAAC;EAED,MAAME,YAAY,GAAG;IACnBrD,eAAe;IACfY,qBAAqB;IACrBI,2BAA2B;IAC3Bf,yBAAyB;IACzBO,SAAS;IACTC,eAAe;IACfe,QAAQ;IACRsB;EACF,CAAC;EAED,oBACEnE,KAAA,CAAA2E,aAAA,CAACpE,oBAAoB,CAACqE,QAAQ;IAACxC,KAAK,EAAEsC;EAAa,GAChD/D,QAC4B,CAAC;AAEpC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","runOnJS","useAnimatedScrollHandler","useAnimatedStyle","useSharedValue","injector","useSafeAreaInsets","StickyWrapperContext","createContext","undefined","StickyWrapper","children","hasAppnavbar","onscroll","notifier","_appConfig$edgeToEdge","appConfig","get","scrollY","prevScrollY","scrollVelocity","scrollDirection","stickyContainerTranslateY","stickyNavTranslateY","insets","insetsVal","edgeToEdgeConfig","isEdgeToEdgeApp","top","navHeight","bottomTabHeight","lastNotifyTime","prevScrollTime","stickyNavAnimateStyle","transform","translateY","value","stickyContainerAnimateStyle","stickyNav","Math","max","notifyEvent","event","notify","nativeEvent","onScrollWorklet","_event$contentOffset$","_event$contentOffset","y","contentOffset","currentScrollTime","Date","now","delta","delaTime","abs","min","_event$contentOffset$2","_event$contentOffset2","_event$contentSize$he","_event$contentSize","_event$layoutMeasurem","_event$layoutMeasurem2","safeEvent","contentSize","height","layoutMeasurement","scrollDelta","onScroll","onScrollEndDrag","scrollRef","_scrollRef$current","current","scrollTo","animated","_scrollRef$current2","contextValue","createElement","Provider"],"sources":["sticky-wrapper.tsx"],"sourcesContent":["import React, { RefObject } from \"react\";\nimport { NativeScrollEvent, NativeSyntheticEvent } from \"react-native\";\nimport Animated, { AnimatedStyle, ReanimatedEvent, runOnJS, ScrollEvent, SharedValue, useAnimatedScrollHandler, useAnimatedStyle, useSharedValue } from \"react-native-reanimated\";\nimport { StickyViewComponentsProps } from \"./sticky-view.component\";\nimport injector from \"./injector\";\nimport AppConfig from \"./AppConfig\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\n\n// StickyWrapperContext is used for the usage & passing of hooks in StickyWrapper(functional component) to childrens.\nexport const StickyWrapperContext = React.createContext<StickyWrapperContextType | undefined>(undefined);\n\nexport type CustomJsScrollEvent = {\n contentOffset: { y: number };\n contentSize: { height: number};\n layoutMeasurement: { height: number};\n scrollDirection: number;\n scrollDelta: number;\n};\n\n\nexport type StickyWrapperContextType = {\n stickyNavTranslateY?: SharedValue<number>;\n stickyContainerTranslateY: SharedValue<number>;\n\n stickyNavAnimateStyle: AnimatedStyle;\n stickyContainerAnimateStyle: AnimatedStyle;\n\n navHeight: SharedValue<number>;\n bottomTabHeight: SharedValue<number>;\n scrollDirection: SharedValue<number>;\n\n onScroll: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;\n onScrollWorklet: (event: ReanimatedEvent<ScrollEvent>) => void;\n onScrollEndDrag: (scrollRef: RefObject<Animated.ScrollView>) => void;\n};\n\nexport const StickyWrapper = ({ children, hasAppnavbar, onscroll, notifier }: StickyViewComponentsProps) => {\n const appConfig = injector.get<AppConfig>('APP_CONFIG');\n const scrollY = useSharedValue<number>(0);\n const prevScrollY = useSharedValue<number>(0);\n const scrollVelocity = useSharedValue<number>(0);\n const scrollDirection = useSharedValue<number>(0);\n\n const stickyContainerTranslateY = useSharedValue<number>(0);\n const stickyNavTranslateY = useSharedValue<number>(0);\n\n // Default navbar height from appnavbar styles is 80, maintaining this to minimize the navHeight immediate flicker (in page-content paddingTop)\n const insets = useSafeAreaInsets();\n const insetsVal = appConfig?.edgeToEdgeConfig?.isEdgeToEdgeApp ? insets?.top : 0;\n const navHeight = useSharedValue<number>(hasAppnavbar && (onscroll == 'topnav' || onscroll == 'topnav-bottomnav') ? (80 + insetsVal) : 0);\n const bottomTabHeight = useSharedValue<number>(0);\n\n const lastNotifyTime = useSharedValue<number>(0);\n const prevScrollTime = useSharedValue<number>(0);\n\n const stickyNavAnimateStyle = useAnimatedStyle(() => {\n return {\n transform: [{ translateY: -stickyNavTranslateY.value }]\n };\n }, [stickyNavTranslateY]);\n\n const stickyContainerAnimateStyle = useAnimatedStyle(() => {\n const stickyNav = onscroll == 'topnav' || onscroll == 'topnav-bottomnav';\n if(stickyNav){\n return {\n transform: [{ translateY: \n Math.max(\n Math.max(stickyContainerTranslateY.value - navHeight.value - scrollY.value, - navHeight.value), \n - stickyNavTranslateY.value\n )\n }],\n }\n }else{\n return {\n transform: [{ translateY: Math.max(stickyContainerTranslateY.value - scrollY.value, navHeight.value)}]\n }\n }\n }, [scrollY, stickyContainerTranslateY, navHeight, stickyNavTranslateY]);\n\n const notifyEvent = (event: CustomJsScrollEvent)=>{\n if(notifier) {\n notifier.notify('scroll', [{nativeEvent: event}]);\n }\n }\n\n const onScrollWorklet = (event: ReanimatedEvent<ScrollEvent>): void => {\n 'worklet';\n // iOS bounce reports negative offsets, which would push the sticky nav off-screen.\n const y = Math.max(0, event.contentOffset?.y ?? 0);\n const currentScrollTime = Date.now();\n\n const delta = y - prevScrollY.value;\n const delaTime = currentScrollTime - prevScrollTime.value;\n if(delta != 0) scrollDirection.value = delta > 0 ? -1 : 1;\n\n if (Math.abs(delta) >= 0.1){\n prevScrollY.value = y;\n scrollY.value = Math.max(0, y);\n\n stickyNavTranslateY.value = Math.max(Math.min(stickyNavTranslateY.value + delta, navHeight.value), 0);\n\n scrollVelocity.value = Math.abs(delta) / delaTime;\n prevScrollTime.value = currentScrollTime;\n }\n\n if(currentScrollTime - lastNotifyTime.value >= 100){\n lastNotifyTime.value = currentScrollTime;\n const safeEvent = {\n contentOffset: {\n y: event.contentOffset?.y ?? 0,\n },\n contentSize: {\n height: event.contentSize?.height ?? 0,\n },\n layoutMeasurement: {\n height: event.layoutMeasurement?.height ?? 0,\n },\n scrollDirection: scrollDirection.value,\n scrollDelta: delta,\n };\n runOnJS(notifyEvent)(safeEvent);\n }\n };\n\n const onScroll = useAnimatedScrollHandler({\n onScroll: onScrollWorklet,\n });\n\n const onScrollEndDrag = (scrollRef: RefObject<Animated.ScrollView>): void =>{\n 'worklet';\n const y = scrollY.value;\n if(scrollVelocity.value < 0.3){\n if(scrollDirection.value < 0 && stickyNavTranslateY.value >= (navHeight.value / 9.9)){ // bottom visible\n scrollRef?.current?.scrollTo({ y: y + (navHeight.value - stickyNavTranslateY.value), animated: true })\n } else if( scrollDirection.value > 0 && stickyNavTranslateY.value <= (navHeight.value / 1.1)) { // top content visible\n scrollRef?.current?.scrollTo({ y: y - stickyNavTranslateY.value, animated: true })\n }\n }\n }\n\n const contextValue = {\n scrollDirection,\n stickyNavAnimateStyle,\n stickyContainerAnimateStyle,\n stickyContainerTranslateY,\n navHeight,\n bottomTabHeight, \n onScroll,\n onScrollWorklet,\n onScrollEndDrag\n };\n\n return (\n <Stick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