@wavemaker/app-rn-runtime 11.14.1-18.6459 → 11.14.1-19.6462
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.
- package/components/basic/bottomsheet/bottomsheet.component.js +0 -12
- package/components/basic/bottomsheet/bottomsheet.component.js.map +1 -1
- package/components/basic/progress-circle/progress-circle.component.js +3 -3
- package/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- package/components/chart/area-chart/area-chart.component.js +9 -26
- package/components/chart/area-chart/area-chart.component.js.map +1 -1
- package/components/chart/bar-chart/bar-chart.component.js +6 -38
- package/components/chart/bar-chart/bar-chart.component.js.map +1 -1
- package/components/chart/bar-chart/bar-chart.props.js +0 -1
- package/components/chart/bar-chart/bar-chart.props.js.map +1 -1
- package/components/chart/basechart.component.js +15 -8
- package/components/chart/basechart.component.js.map +1 -1
- package/components/chart/basechart.props.js +0 -1
- package/components/chart/basechart.props.js.map +1 -1
- package/components/chart/bubble-chart/bubble-chart.component.js +5 -22
- package/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- package/components/chart/line-chart/line-chart.component.js +5 -22
- package/components/chart/line-chart/line-chart.component.js.map +1 -1
- package/components/chart/pie-chart/pie-chart.component.js +3 -14
- package/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- package/components/container/tabs/tabs.component.js +29 -62
- package/components/container/tabs/tabs.component.js.map +1 -1
- package/components/container/tabs/tabs.props.js +0 -1
- package/components/container/tabs/tabs.props.js.map +1 -1
- package/components/container/wizard/wizard.component.js +1 -1
- package/components/container/wizard/wizard.component.js.map +1 -1
- package/components/container/wizard/wizard.props.js +1 -0
- package/components/container/wizard/wizard.props.js.map +1 -1
- package/components/container/wizard/wizardstep/wizardstep.component.js +2 -2
- package/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- package/components/data/form/form-field/form-field.component.js +0 -1
- package/components/data/form/form-field/form-field.component.js.map +1 -1
- package/components/data/form/form-field/form-field.props.js +0 -1
- package/components/data/form/form-field/form-field.props.js.map +1 -1
- package/components/data/form/form.component.js +1 -4
- package/components/data/form/form.component.js.map +1 -1
- package/components/dialogs/dialogcontent/dialogcontent.component.js +2 -1
- package/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
- package/components/input/baseinput/baseinput.component.js +3 -21
- package/components/input/baseinput/baseinput.component.js.map +1 -1
- package/components/input/baseinput/baseinput.props.js +0 -1
- package/components/input/baseinput/baseinput.props.js.map +1 -1
- package/components/input/basenumber/basenumber.component.js +3 -18
- package/components/input/basenumber/basenumber.component.js.map +1 -1
- package/components/input/basenumber/basenumber.props.js +0 -1
- package/components/input/basenumber/basenumber.props.js.map +1 -1
- package/components/input/checkboxset/checkboxset.component.js +1 -1
- package/components/input/checkboxset/checkboxset.component.js.map +1 -1
- package/components/input/currency/currency.component.js +0 -2
- package/components/input/currency/currency.component.js.map +1 -1
- package/components/input/currency/currency.styles.js +1 -10
- package/components/input/currency/currency.styles.js.map +1 -1
- package/components/input/number/number.component.js +0 -2
- package/components/input/number/number.component.js.map +1 -1
- package/components/input/number/number.styles.js +0 -4
- package/components/input/number/number.styles.js.map +1 -1
- package/components/input/radioset/radioset.component.js +6 -3
- package/components/input/radioset/radioset.component.js.map +1 -1
- package/components/input/text/text.component.js +0 -2
- package/components/input/text/text.component.js.map +1 -1
- package/components/input/text/text.props.js +1 -0
- package/components/input/text/text.props.js.map +1 -1
- package/components/input/text/text.styles.js +0 -17
- package/components/input/text/text.styles.js.map +1 -1
- package/components/input/textarea/textarea.component.js +0 -1
- package/components/input/textarea/textarea.component.js.map +1 -1
- package/components/input/textarea/textarea.styles.js +0 -4
- package/components/input/textarea/textarea.styles.js.map +1 -1
- package/components/navigation/popover/popover.component.js +3 -3
- package/components/navigation/popover/popover.component.js.map +1 -1
- package/core/AppConfig.js.map +1 -1
- package/core/advanced-promise-rejection-tracker.js +207 -0
- package/core/advanced-promise-rejection-tracker.js.map +1 -0
- package/core/base.component.js +5 -0
- package/core/base.component.js.map +1 -1
- package/core/components/error-fallback/error-fallback.component.js +50 -18
- package/core/components/error-fallback/error-fallback.component.js.map +1 -1
- package/core/components/error-fallback/error-fallback.styles.js +4 -1
- package/core/components/error-fallback/error-fallback.styles.js.map +1 -1
- package/core/components/textinput.component.js +4 -25
- package/core/components/textinput.component.js.map +1 -1
- package/core/error-boundary.component.js +46 -2
- package/core/error-boundary.component.js.map +1 -1
- package/core/fixed-view.component.js +2 -19
- package/core/fixed-view.component.js.map +1 -1
- package/core/global-error-handler.service.js +177 -0
- package/core/global-error-handler.service.js.map +1 -0
- package/core/tappable.component.js +1 -1
- package/core/tappable.component.js.map +1 -1
- package/core/viewport.js +8 -13
- package/core/viewport.js.map +1 -1
- package/gestures/carousel-swipe.animation.js +1 -0
- package/gestures/carousel-swipe.animation.js.map +1 -1
- package/npm-shrinkwrap.json +13 -13
- package/package-lock.json +13 -13
- package/package.json +2 -2
- package/runtime/App.js +174 -12
- package/runtime/App.js.map +1 -1
- package/runtime/base-page.component.js +11 -2
- package/runtime/base-page.component.js.map +1 -1
- package/runtime/navigator/stack.navigator.js +6 -0
- package/runtime/navigator/stack.navigator.js.map +1 -1
- package/styles/theme.js +0 -6
- package/styles/theme.js.map +1 -1
package/core/viewport.js
CHANGED
|
@@ -25,23 +25,18 @@ export class ViewPort extends EventNotifier {
|
|
|
25
25
|
Dimensions.addEventListener('change', () => {
|
|
26
26
|
const dim = Dimensions.get('window');
|
|
27
27
|
const orientation = dim.width > dim.height ? SCREEN_ORIENTATION.LANDSCAPE : SCREEN_ORIENTATION.PORTRAIT;
|
|
28
|
-
const oldWidth = this.width;
|
|
29
|
-
const oldHeight = this.height;
|
|
30
|
-
const oldOrientation = this.orientation;
|
|
31
|
-
|
|
32
|
-
// Update dimensions BEFORE notifying subscribers so they get the correct values
|
|
33
|
-
this.width = dim.width;
|
|
34
|
-
this.height = dim.height;
|
|
35
|
-
this.orientation = orientation;
|
|
36
28
|
this.notify(EVENTS.SIZE_CHANGE, [{
|
|
29
|
+
width: dim.width,
|
|
30
|
+
height: dim.height
|
|
31
|
+
}, {
|
|
37
32
|
width: this.width,
|
|
38
33
|
height: this.height
|
|
39
|
-
}, {
|
|
40
|
-
width: oldWidth,
|
|
41
|
-
height: oldHeight
|
|
42
34
|
}]);
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
this.width = dim.width;
|
|
36
|
+
this.height = dim.height;
|
|
37
|
+
if (this.orientation != orientation) {
|
|
38
|
+
this.notify(EVENTS.ORIENTATION_CHANGE, [orientation, this.orientation]);
|
|
39
|
+
this.orientation = orientation;
|
|
45
40
|
}
|
|
46
41
|
});
|
|
47
42
|
}
|
package/core/viewport.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Dimensions","EventNotifier","SCREEN_ORIENTATION","LANDSCAPE","PORTRAIT","EVENTS","ORIENTATION_CHANGE","SIZE_CHANGE","ViewPort","constructor","_defineProperty","dim","get","width","height","orientation","addEventListener","
|
|
1
|
+
{"version":3,"names":["Dimensions","EventNotifier","SCREEN_ORIENTATION","LANDSCAPE","PORTRAIT","EVENTS","ORIENTATION_CHANGE","SIZE_CHANGE","ViewPort","constructor","_defineProperty","dim","get","width","height","orientation","addEventListener","notify"],"sources":["viewport.ts"],"sourcesContent":["import { Dimensions } from \"react-native\";\nimport EventNotifier from \"./event-notifier\";\n\n\nexport const SCREEN_ORIENTATION = {\n LANDSCAPE: 'LANDSCAPE',\n PORTRAIT: 'PORTRAIT'\n};\n\nexport const EVENTS = {\n ORIENTATION_CHANGE: 'orientationChange',\n SIZE_CHANGE: 'sizeChange'\n};\n\nexport class ViewPort extends EventNotifier {\n public width: number;\n public height: number;\n public orientation: string;\n public isMobileType = true;\n\n constructor() {\n super();\n const dim = Dimensions.get('window');\n this.width = dim.width;\n this.height = dim.height;\n this.orientation = this.width > this.height ? SCREEN_ORIENTATION.LANDSCAPE: SCREEN_ORIENTATION.PORTRAIT;\n Dimensions.addEventListener('change', () => {\n const dim = Dimensions.get('window');\n const orientation = dim.width > dim.height ? SCREEN_ORIENTATION.LANDSCAPE: SCREEN_ORIENTATION.PORTRAIT;\n this.notify(EVENTS.SIZE_CHANGE, [\n {width: dim.width, height: dim.height}, \n {width: this.width, height: this.height}\n ]);\n this.width = dim.width;\n this.height = dim.height;\n if (this.orientation != orientation) {\n this.notify(EVENTS.ORIENTATION_CHANGE, [orientation, this.orientation]);\n this.orientation = orientation;\n }\n });\n }\n}\n\nexport default new ViewPort();"],"mappings":";;;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,OAAOC,aAAa,MAAM,kBAAkB;AAG5C,OAAO,MAAMC,kBAAkB,GAAG;EAC9BC,SAAS,EAAE,WAAW;EACtBC,QAAQ,EAAE;AACd,CAAC;AAED,OAAO,MAAMC,MAAM,GAAG;EAClBC,kBAAkB,EAAE,mBAAmB;EACvCC,WAAW,EAAE;AACjB,CAAC;AAED,OAAO,MAAMC,QAAQ,SAASP,aAAa,CAAC;EAMxCQ,WAAWA,CAAA,EAAG;IACV,KAAK,CAAC,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,uBAHU,IAAI;IAItB,MAAMC,GAAG,GAAGX,UAAU,CAACY,GAAG,CAAC,QAAQ,CAAC;IACpC,IAAI,CAACC,KAAK,GAAGF,GAAG,CAACE,KAAK;IACtB,IAAI,CAACC,MAAM,GAAGH,GAAG,CAACG,MAAM;IACxB,IAAI,CAACC,WAAW,GAAG,IAAI,CAACF,KAAK,GAAG,IAAI,CAACC,MAAM,GAAGZ,kBAAkB,CAACC,SAAS,GAAED,kBAAkB,CAACE,QAAQ;IACvGJ,UAAU,CAACgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM;MACxC,MAAML,GAAG,GAAGX,UAAU,CAACY,GAAG,CAAC,QAAQ,CAAC;MACpC,MAAMG,WAAW,GAAGJ,GAAG,CAACE,KAAK,GAAGF,GAAG,CAACG,MAAM,GAAGZ,kBAAkB,CAACC,SAAS,GAAED,kBAAkB,CAACE,QAAQ;MACtG,IAAI,CAACa,MAAM,CAACZ,MAAM,CAACE,WAAW,EAAE,CAC5B;QAACM,KAAK,EAAEF,GAAG,CAACE,KAAK;QAAEC,MAAM,EAAEH,GAAG,CAACG;MAAM,CAAC,EACtC;QAACD,KAAK,EAAE,IAAI,CAACA,KAAK;QAAEC,MAAM,EAAE,IAAI,CAACA;MAAM,CAAC,CAC3C,CAAC;MACF,IAAI,CAACD,KAAK,GAAGF,GAAG,CAACE,KAAK;MACtB,IAAI,CAACC,MAAM,GAAGH,GAAG,CAACG,MAAM;MACxB,IAAI,IAAI,CAACC,WAAW,IAAIA,WAAW,EAAE;QACjC,IAAI,CAACE,MAAM,CAACZ,MAAM,CAACC,kBAAkB,EAAE,CAACS,WAAW,EAAE,IAAI,CAACA,WAAW,CAAC,CAAC;QACvE,IAAI,CAACA,WAAW,GAAGA,WAAW;MAClC;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,eAAe,IAAIP,QAAQ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -149,6 +149,7 @@ export class View extends React.Component {
|
|
|
149
149
|
goToLower(e) {
|
|
150
150
|
var _this$props$handlers7, _this$props$handlers8;
|
|
151
151
|
const bounds = ((_this$props$handlers7 = this.props.handlers) === null || _this$props$handlers7 === void 0 ? void 0 : _this$props$handlers7.bounds) && ((_this$props$handlers8 = this.props.handlers) === null || _this$props$handlers8 === void 0 ? void 0 : _this$props$handlers8.bounds(e)) || {};
|
|
152
|
+
console.log("🚀 ~ View ~ goToLower ~ bounds:", bounds);
|
|
152
153
|
this.setPosition(bounds.lower).then(() => {
|
|
153
154
|
if (!isNil(bounds.lower) && bounds.center !== bounds.lower) {
|
|
154
155
|
var _this$props$handlers9, _this$props$handlers0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isNil","React","Animated","Easing","View","RNView","PanResponder","injector","Handlers","constructor","_defineProperty","Props","undefined","State","Number","MAX_VALUE","Component","props","Value","I18nService","get","dx","dy","gestureEnableThreshold","shouldEnable","direction","Math","abs","enableGestures","e","_this$props$handlers","_this$props$handlers2","bounds","handlers","d","state","isHorizontal","phase","computePhase","center","lower","upper","animationPhase","setValue","position","isRTL","_this$props$handlers3","_this$props$handlers4","onAnimation","goToLower","goToUpper","threshold","touchStart","x","y","active","panResponder","create","onStartShouldSetPanResponder","evt","gestureState","shouldEnablePanResponder","onStartShouldSetPanResponderCapture","onMoveShouldSetPanResponder","onMoveShouldSetPanResponderCapture","onPanResponderMove","onChange","onPanResponderRelease","onEnd","activeIndex","setPosition","slidesLayout","computeMaxScroll","_this$viewLayout2","max","childrenWidth","childrenLayout","reduce","s","v","width","childrenHeight","height","_this$viewLayout","viewLayout","setState","maxPosition","setChildrenLayout","event","index","nativeEvent","layout","setViewLayout","value","_this$props$handlers5","_this$props$handlers6","i18nService","isRTLLocale","_this$props$handlers7","_this$props$handlers8","then","_this$props$handlers9","_this$props$handlers0","onLower","_this$props$handlers1","_this$props$handlers10","_this$props$handlers11","_this$props$handlers12","onUpper","Promise","reject","isNaN","resolve","parallel","timing","useNativeDriver","toValue","duration","easing","out","linear","start","render","createElement","_extends","style","flexDirection","flexWrap","alignItems","onLayout","bind","panHandlers","children","map","c","i","_this$props$style","key","slideMinWidth","minWidth","slideWidth","transform","translateX","translateY"],"sources":["carousel-swipe.animation.tsx"],"sourcesContent":["import { isNil } from 'lodash-es';\nimport React from 'react';\nimport { Animated, Easing, View as RNView, ViewStyle, LayoutChangeEvent, LayoutRectangle, DimensionValue, PanResponder } from 'react-native';\nimport { Gesture, GestureDetector, GestureUpdateEvent } from 'react-native-gesture-handler';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport class Handlers {\n bounds?: (g: GestureUpdateEvent<any>) => Bounds = null as any;\n onAnimation?: (g: GestureUpdateEvent<any>) => any = () => { };\n onLower?: (g: GestureUpdateEvent<any>) => any = () => { };\n onUpper?: (g: GestureUpdateEvent<any>) => any = () => { };\n computePhase?: (value: number) => number = null as any;\n}\n\nexport interface Bounds {\n upper?: number;\n center?: number;\n lower?: number;\n}\n\nexport class Props {\n threshold?: number = 5;\n direction?: 'horizontal' | 'vertical' = 'horizontal';\n handlers?: Handlers = {} as any;\n style?: ViewStyle = {} as any;\n children: any;\n enableGestures: any;\n slideWidth?: DimensionValue = '100%';\n slideMinWidth?: DimensionValue = undefined;\n slidesLayout?: any = [];\n activeIndex?: number | null = null;\n}\n\nexport class State {\n threshold = 5;\n isHorizontal = false;\n bounds: Bounds = {} as any;\n maxPosition = Number.MAX_VALUE;\n}\n\nexport class View extends React.Component<Props, State> {\n\n static defaultProps = new Props();\n private position = new Animated.Value(0);\n public animationPhase = new Animated.Value(0);\n private i18nService = injector.I18nService.get();\n private childrenLayout: LayoutRectangle[] = [];\n private viewLayout: LayoutRectangle = null as any;\n private panResponder: any = null;\n\n constructor(props: Props) {\n super(props);\n this.state = {\n isHorizontal: props.direction === 'horizontal',\n threshold: props.threshold || 49,\n bounds: {} as any\n } as State;\n var touchStart = {\n x: 0,\n y: 0,\n active: false\n };\n\n this.panResponder = PanResponder.create({\n onStartShouldSetPanResponder: (evt, gestureState) => {\n return this.shouldEnablePanResponder(gestureState.dx, gestureState.dy);\n },\n onStartShouldSetPanResponderCapture: (evt, gestureState) => {\n return this.shouldEnablePanResponder(gestureState.dx, gestureState.dy);\n },\n onMoveShouldSetPanResponder: (evt, gestureState) => {\n return this.shouldEnablePanResponder(gestureState.dx, gestureState.dy);\n },\n onMoveShouldSetPanResponderCapture: (evt, gestureState) =>{\n return this.shouldEnablePanResponder(gestureState.dx, gestureState.dy);\n },\n onPanResponderMove: (evt, gestureState) => {\n this.onChange(gestureState)\n },\n onPanResponderRelease: (evt, gestureState) => {\n if (\n this.props.direction === 'horizontal' && \n (gestureState.dx > this.state.threshold || gestureState.dx < -this.state.threshold)\n ) {\n this.onEnd(gestureState);\n }\n if (\n this.props.direction === 'vertical' && \n (gestureState.dy > this.state.threshold || gestureState.dy < -this.state.threshold)\n ) {\n this.onEnd(gestureState);\n }\n\n if (\n !(gestureState.dy > this.state.threshold || gestureState.dy < -this.state.threshold) && \n !(gestureState.dx > this.state.threshold || gestureState.dx < -this.state.threshold)\n ) {\n if (this.props.activeIndex) {\n this.setPosition(this.props.slidesLayout[this.props.activeIndex])\n }\n }\n }\n });\n\n }\n\n\n shouldEnablePanResponder = (dx: number, dy: number) => {\n const gestureEnableThreshold = 30;\n\n const shouldEnable = (this.props.direction === 'horizontal' ? Math.abs(dx) > Math.abs(dy) : Math.abs(dx) < Math.abs(dy)) &&\n (this.props.direction === 'horizontal' ? Math.abs(dx) > gestureEnableThreshold : Math.abs(dy) > gestureEnableThreshold)\n\n return this.props.enableGestures && shouldEnable;\n }\n\n onChange = (e: any) => {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n const d = (this.state.isHorizontal ? e.dx : e.dy);\n let phase = this.computePhase(bounds?.center || 0);\n if (d && d < 0 && !isNil(bounds.center) && !isNil(bounds.lower)\n && bounds.center !== bounds.lower) {\n phase += (d / (bounds.center - bounds.lower)) || 0;\n } else if (d && d > 0 && !isNil(bounds.center) && !isNil(bounds.upper)\n && bounds.center !== bounds.upper) {\n phase += (d / (bounds.upper - bounds.center)) || 0;\n }\n this.animationPhase.setValue(phase);\n this.position.setValue(\n (this.isRTL() ? -bounds?.center! : bounds?.center || 0) + d);\n }\n\n onEnd = (e: any) => {\n this.props.handlers?.onAnimation &&\n this.props.handlers?.onAnimation(e);\n if (e.dx < 0) {\n this.isRTL() ? this.goToLower(e) : this.goToUpper(e);\n } else if (e.dx > 0) {\n this.isRTL() ? this.goToUpper(e) : this.goToLower(e);\n }\n }\n\n computeMaxScroll() {\n let max = Number.MAX_VALUE;\n const childrenWidth = this.childrenLayout.reduce((s, v) => s + v.width, 0);\n const childrenHeight = this.childrenLayout.reduce((s, v) => s + v.height, 0);\n if (this.props.direction === 'horizontal') {\n if (childrenWidth && this.viewLayout?.width) {\n max = childrenWidth - this.viewLayout.width;\n }\n } else if (childrenHeight && this.viewLayout?.height) {\n max = childrenHeight - this.viewLayout.height;\n }\n this.setState({ maxPosition: -1 * max });\n }\n\n setChildrenLayout(event: LayoutChangeEvent, index: number) {\n this.childrenLayout[index] = event.nativeEvent.layout;\n this.computeMaxScroll();\n }\n\n setViewLayout(event: LayoutChangeEvent) {\n this.viewLayout = event.nativeEvent.layout;\n this.computeMaxScroll();\n }\n\n computePhase(value: number) {\n return (this.props.handlers?.computePhase &&\n this.props.handlers?.computePhase(value)) || 0;\n }\n\n isRTL() {\n return this.i18nService.isRTLLocale();\n }\n\n goToLower(e?: any) {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n this.setPosition(bounds.lower)\n .then(() => {\n if (!isNil(bounds.lower) && bounds.center !== bounds.lower) {\n this.props.handlers?.onLower &&\n this.props.handlers?.onLower(e);\n }\n });\n }\n\n goToUpper(e?: any) {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n this.setPosition(bounds.upper)\n .then(() => {\n if (!isNil(bounds.upper) && bounds.center !== bounds.upper) {\n this.props.handlers?.onUpper &&\n this.props.handlers?.onUpper(e);\n }\n });\n }\n\n setPosition(value: number | undefined) {\n if (isNil(value)) {\n return Promise.reject();\n }\n let position = isNaN(this.state.maxPosition) ? value : Math.max(this.state.maxPosition, value);\n return new Promise((resolve) => {\n Animated.parallel([\n Animated.timing(this.animationPhase, {\n useNativeDriver: true,\n toValue: this.computePhase(value),\n duration: 200,\n easing: Easing.out(Easing.linear)\n }),\n Animated.timing(this.position, {\n useNativeDriver: true,\n toValue: (this.isRTL() ? -1 : 1) * position,\n duration: 200,\n easing: Easing.out(Easing.linear)\n })\n ]).start(resolve);\n });\n }\n\n public render() {\n const isHorizontal = this.props.direction === 'horizontal';\n return (\n //@ts-ignore\n <RNView style={[\n isHorizontal ? {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'center',\n } : null,\n this.props.style]}\n onLayout={this.setViewLayout.bind(this)}\n {...this.panResponder.panHandlers}\n >\n {this.props.children.map((c: any, i: number) => {\n return (<Animated.View onLayout={(e) => this.setChildrenLayout(e, i)} key={c.key}\n style={[this.props.slideMinWidth ? {\n minWidth: this.props.slideMinWidth\n } : {\n width: this.props.slideWidth\n },\n this.props.style?.height === '100%' ? {\n height: '100%'\n } : null,\n {\n transform: this.state.isHorizontal ? [{\n translateX: this.position\n }] : [{\n translateY: this.position\n }]\n }\n ]}>\n {c}\n </Animated.View>);\n })}\n </RNView>\n );\n }\n\n}\n"],"mappings":";;;;AAAA,SAASA,KAAK,QAAQ,WAAW;AACjC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,IAAIC,MAAM,EAAiEC,YAAY,QAAQ,cAAc;AAG5I,OAAOC,QAAQ,MAAM,yCAAyC;AAE9D,OAAO,MAAMC,QAAQ,CAAC;EAAAC,YAAA;IAAAC,eAAA,iBACgC,IAAI;IAAAA,eAAA,sBACF,MAAM,CAAE,CAAC;IAAAA,eAAA,kBACb,MAAM,CAAE,CAAC;IAAAA,eAAA,kBACT,MAAM,CAAE,CAAC;IAAAA,eAAA,uBACd,IAAI;EAAA;AACnD;AAQA,OAAO,MAAMC,KAAK,CAAC;EAAAF,YAAA;IAAAC,eAAA,oBACM,CAAC;IAAAA,eAAA,oBACkB,YAAY;IAAAA,eAAA,mBAC9B,CAAC,CAAC;IAAAA,eAAA,gBACJ,CAAC,CAAC;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,qBAGQ,MAAM;IAAAA,eAAA,wBACHE,SAAS;IAAAF,eAAA,uBACrB,EAAE;IAAAA,eAAA,sBACO,IAAI;EAAA;AACtC;AAEA,OAAO,MAAMG,KAAK,CAAC;EAAAJ,YAAA;IAAAC,eAAA,oBACH,CAAC;IAAAA,eAAA,uBACE,KAAK;IAAAA,eAAA,iBACH,CAAC,CAAC;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"names":["isNil","React","Animated","Easing","View","RNView","PanResponder","injector","Handlers","constructor","_defineProperty","Props","undefined","State","Number","MAX_VALUE","Component","props","Value","I18nService","get","dx","dy","gestureEnableThreshold","shouldEnable","direction","Math","abs","enableGestures","e","_this$props$handlers","_this$props$handlers2","bounds","handlers","d","state","isHorizontal","phase","computePhase","center","lower","upper","animationPhase","setValue","position","isRTL","_this$props$handlers3","_this$props$handlers4","onAnimation","goToLower","goToUpper","threshold","touchStart","x","y","active","panResponder","create","onStartShouldSetPanResponder","evt","gestureState","shouldEnablePanResponder","onStartShouldSetPanResponderCapture","onMoveShouldSetPanResponder","onMoveShouldSetPanResponderCapture","onPanResponderMove","onChange","onPanResponderRelease","onEnd","activeIndex","setPosition","slidesLayout","computeMaxScroll","_this$viewLayout2","max","childrenWidth","childrenLayout","reduce","s","v","width","childrenHeight","height","_this$viewLayout","viewLayout","setState","maxPosition","setChildrenLayout","event","index","nativeEvent","layout","setViewLayout","value","_this$props$handlers5","_this$props$handlers6","i18nService","isRTLLocale","_this$props$handlers7","_this$props$handlers8","console","log","then","_this$props$handlers9","_this$props$handlers0","onLower","_this$props$handlers1","_this$props$handlers10","_this$props$handlers11","_this$props$handlers12","onUpper","Promise","reject","isNaN","resolve","parallel","timing","useNativeDriver","toValue","duration","easing","out","linear","start","render","createElement","_extends","style","flexDirection","flexWrap","alignItems","onLayout","bind","panHandlers","children","map","c","i","_this$props$style","key","slideMinWidth","minWidth","slideWidth","transform","translateX","translateY"],"sources":["carousel-swipe.animation.tsx"],"sourcesContent":["import { isNil } from 'lodash-es';\nimport React from 'react';\nimport { Animated, Easing, View as RNView, ViewStyle, LayoutChangeEvent, LayoutRectangle, DimensionValue, PanResponder } from 'react-native';\nimport { Gesture, GestureDetector, GestureUpdateEvent } from 'react-native-gesture-handler';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport class Handlers {\n bounds?: (g: GestureUpdateEvent<any>) => Bounds = null as any;\n onAnimation?: (g: GestureUpdateEvent<any>) => any = () => { };\n onLower?: (g: GestureUpdateEvent<any>) => any = () => { };\n onUpper?: (g: GestureUpdateEvent<any>) => any = () => { };\n computePhase?: (value: number) => number = null as any;\n}\n\nexport interface Bounds {\n upper?: number;\n center?: number;\n lower?: number;\n}\n\nexport class Props {\n threshold?: number = 5;\n direction?: 'horizontal' | 'vertical' = 'horizontal';\n handlers?: Handlers = {} as any;\n style?: ViewStyle = {} as any;\n children: any;\n enableGestures: any;\n slideWidth?: DimensionValue = '100%';\n slideMinWidth?: DimensionValue = undefined;\n slidesLayout?: any = [];\n activeIndex?: number | null = null;\n}\n\nexport class State {\n threshold = 5;\n isHorizontal = false;\n bounds: Bounds = {} as any;\n maxPosition = Number.MAX_VALUE;\n}\n\nexport class View extends React.Component<Props, State> {\n\n static defaultProps = new Props();\n private position = new Animated.Value(0);\n public animationPhase = new Animated.Value(0);\n private i18nService = injector.I18nService.get();\n private childrenLayout: LayoutRectangle[] = [];\n private viewLayout: LayoutRectangle = null as any;\n private panResponder: any = null;\n\n constructor(props: Props) {\n super(props);\n this.state = {\n isHorizontal: props.direction === 'horizontal',\n threshold: props.threshold || 49,\n bounds: {} as any\n } as State;\n var touchStart = {\n x: 0,\n y: 0,\n active: false\n };\n\n this.panResponder = PanResponder.create({\n onStartShouldSetPanResponder: (evt, gestureState) => {\n return this.shouldEnablePanResponder(gestureState.dx, gestureState.dy);\n },\n onStartShouldSetPanResponderCapture: (evt, gestureState) => {\n return this.shouldEnablePanResponder(gestureState.dx, gestureState.dy);\n },\n onMoveShouldSetPanResponder: (evt, gestureState) => {\n return this.shouldEnablePanResponder(gestureState.dx, gestureState.dy);\n },\n onMoveShouldSetPanResponderCapture: (evt, gestureState) =>{\n return this.shouldEnablePanResponder(gestureState.dx, gestureState.dy);\n },\n onPanResponderMove: (evt, gestureState) => {\n this.onChange(gestureState)\n },\n onPanResponderRelease: (evt, gestureState) => {\n if (\n this.props.direction === 'horizontal' && \n (gestureState.dx > this.state.threshold || gestureState.dx < -this.state.threshold)\n ) {\n this.onEnd(gestureState);\n }\n if (\n this.props.direction === 'vertical' && \n (gestureState.dy > this.state.threshold || gestureState.dy < -this.state.threshold)\n ) {\n this.onEnd(gestureState);\n }\n\n if (\n !(gestureState.dy > this.state.threshold || gestureState.dy < -this.state.threshold) && \n !(gestureState.dx > this.state.threshold || gestureState.dx < -this.state.threshold)\n ) {\n if (this.props.activeIndex) {\n this.setPosition(this.props.slidesLayout[this.props.activeIndex])\n }\n }\n }\n });\n\n }\n\n\n shouldEnablePanResponder = (dx: number, dy: number) => {\n const gestureEnableThreshold = 30;\n\n const shouldEnable = (this.props.direction === 'horizontal' ? Math.abs(dx) > Math.abs(dy) : Math.abs(dx) < Math.abs(dy)) &&\n (this.props.direction === 'horizontal' ? Math.abs(dx) > gestureEnableThreshold : Math.abs(dy) > gestureEnableThreshold)\n\n return this.props.enableGestures && shouldEnable;\n }\n\n onChange = (e: any) => {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n const d = (this.state.isHorizontal ? e.dx : e.dy);\n let phase = this.computePhase(bounds?.center || 0);\n if (d && d < 0 && !isNil(bounds.center) && !isNil(bounds.lower)\n && bounds.center !== bounds.lower) {\n phase += (d / (bounds.center - bounds.lower)) || 0;\n } else if (d && d > 0 && !isNil(bounds.center) && !isNil(bounds.upper)\n && bounds.center !== bounds.upper) {\n phase += (d / (bounds.upper - bounds.center)) || 0;\n }\n this.animationPhase.setValue(phase);\n this.position.setValue(\n (this.isRTL() ? -bounds?.center! : bounds?.center || 0) + d);\n }\n\n onEnd = (e: any) => {\n this.props.handlers?.onAnimation &&\n this.props.handlers?.onAnimation(e);\n if (e.dx < 0) {\n this.isRTL() ? this.goToLower(e) : this.goToUpper(e);\n } else if (e.dx > 0) {\n this.isRTL() ? this.goToUpper(e) : this.goToLower(e);\n }\n }\n\n computeMaxScroll() {\n let max = Number.MAX_VALUE;\n const childrenWidth = this.childrenLayout.reduce((s, v) => s + v.width, 0);\n const childrenHeight = this.childrenLayout.reduce((s, v) => s + v.height, 0);\n if (this.props.direction === 'horizontal') {\n if (childrenWidth && this.viewLayout?.width) {\n max = childrenWidth - this.viewLayout.width;\n }\n } else if (childrenHeight && this.viewLayout?.height) {\n max = childrenHeight - this.viewLayout.height;\n }\n this.setState({ maxPosition: -1 * max });\n }\n\n setChildrenLayout(event: LayoutChangeEvent, index: number) {\n this.childrenLayout[index] = event.nativeEvent.layout;\n this.computeMaxScroll();\n }\n\n setViewLayout(event: LayoutChangeEvent) {\n this.viewLayout = event.nativeEvent.layout;\n this.computeMaxScroll();\n }\n\n computePhase(value: number) {\n return (this.props.handlers?.computePhase &&\n this.props.handlers?.computePhase(value)) || 0;\n }\n\n isRTL() {\n return this.i18nService.isRTLLocale();\n }\n\n goToLower(e?: any) {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n console.log(\"🚀 ~ View ~ goToLower ~ bounds:\", bounds)\n this.setPosition(bounds.lower)\n .then(() => {\n if (!isNil(bounds.lower) && bounds.center !== bounds.lower) {\n this.props.handlers?.onLower &&\n this.props.handlers?.onLower(e);\n }\n });\n }\n\n goToUpper(e?: any) {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n this.setPosition(bounds.upper)\n .then(() => {\n if (!isNil(bounds.upper) && bounds.center !== bounds.upper) {\n this.props.handlers?.onUpper &&\n this.props.handlers?.onUpper(e);\n }\n });\n }\n\n setPosition(value: number | undefined) {\n if (isNil(value)) {\n return Promise.reject();\n }\n let position = isNaN(this.state.maxPosition) ? value : Math.max(this.state.maxPosition, value);\n return new Promise((resolve) => {\n Animated.parallel([\n Animated.timing(this.animationPhase, {\n useNativeDriver: true,\n toValue: this.computePhase(value),\n duration: 200,\n easing: Easing.out(Easing.linear)\n }),\n Animated.timing(this.position, {\n useNativeDriver: true,\n toValue: (this.isRTL() ? -1 : 1) * position,\n duration: 200,\n easing: Easing.out(Easing.linear)\n })\n ]).start(resolve);\n });\n }\n\n public render() {\n const isHorizontal = this.props.direction === 'horizontal';\n return (\n //@ts-ignore\n <RNView style={[\n isHorizontal ? {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'center',\n } : null,\n this.props.style]}\n onLayout={this.setViewLayout.bind(this)}\n {...this.panResponder.panHandlers}\n >\n {this.props.children.map((c: any, i: number) => {\n return (<Animated.View onLayout={(e) => this.setChildrenLayout(e, i)} key={c.key}\n style={[this.props.slideMinWidth ? {\n minWidth: this.props.slideMinWidth\n } : {\n width: this.props.slideWidth\n },\n this.props.style?.height === '100%' ? {\n height: '100%'\n } : null,\n {\n transform: this.state.isHorizontal ? [{\n translateX: this.position\n }] : [{\n translateY: this.position\n }]\n }\n ]}>\n {c}\n </Animated.View>);\n })}\n </RNView>\n );\n }\n\n}\n"],"mappings":";;;;AAAA,SAASA,KAAK,QAAQ,WAAW;AACjC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,IAAIC,MAAM,EAAiEC,YAAY,QAAQ,cAAc;AAG5I,OAAOC,QAAQ,MAAM,yCAAyC;AAE9D,OAAO,MAAMC,QAAQ,CAAC;EAAAC,YAAA;IAAAC,eAAA,iBACgC,IAAI;IAAAA,eAAA,sBACF,MAAM,CAAE,CAAC;IAAAA,eAAA,kBACb,MAAM,CAAE,CAAC;IAAAA,eAAA,kBACT,MAAM,CAAE,CAAC;IAAAA,eAAA,uBACd,IAAI;EAAA;AACnD;AAQA,OAAO,MAAMC,KAAK,CAAC;EAAAF,YAAA;IAAAC,eAAA,oBACM,CAAC;IAAAA,eAAA,oBACkB,YAAY;IAAAA,eAAA,mBAC9B,CAAC,CAAC;IAAAA,eAAA,gBACJ,CAAC,CAAC;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,qBAGQ,MAAM;IAAAA,eAAA,wBACHE,SAAS;IAAAF,eAAA,uBACrB,EAAE;IAAAA,eA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G,CAAC;cACFqG,UAAU,EAAE,IAAI,CAACrG;YACrB,CAAC;UACL,CAAC;QACC,GACD4F,CACU,CAAC;MACpB,CAAC,CACG;IAAC;EAEjB;AAEJ;AAAC9H,eAAA,CA5NYN,IAAI,kBAES,IAAIO,KAAK,CAAC,CAAC","ignoreList":[]}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavemaker/app-rn-runtime",
|
|
3
|
-
"version": "11.14.1-
|
|
3
|
+
"version": "11.14.1-19.6462",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@wavemaker/app-rn-runtime",
|
|
9
|
-
"version": "11.14.1-
|
|
9
|
+
"version": "11.14.1-19.6462",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@expo/vector-icons": "15.0.2",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@react-navigation/drawer": "7.5.8",
|
|
21
21
|
"@react-navigation/native": "7.1.18",
|
|
22
22
|
"@react-navigation/stack": "7.4.8",
|
|
23
|
-
"@wavemaker/variables": "11.14.1-
|
|
23
|
+
"@wavemaker/variables": "11.14.1-19.6462",
|
|
24
24
|
"axios": "1.8.3",
|
|
25
25
|
"color": "4.2.3",
|
|
26
26
|
"cross-env": "7.0.3",
|
|
@@ -6611,8 +6611,8 @@
|
|
|
6611
6611
|
"peer": true
|
|
6612
6612
|
},
|
|
6613
6613
|
"node_modules/@wavemaker/variables": {
|
|
6614
|
-
"version": "11.14.1-
|
|
6615
|
-
"integrity": "sha512-
|
|
6614
|
+
"version": "11.14.1-19.6462",
|
|
6615
|
+
"integrity": "sha512-AYf4eAnRbvN7Cg6i/eay3UBMzyFQHQYeDNgk3kuyYvub46SspekdODDjW6JFJer6EiQIzXvLpU5JKXEsJQv+0w==",
|
|
6616
6616
|
"license": "ISC",
|
|
6617
6617
|
"dependencies": {
|
|
6618
6618
|
"@metrichor/jmespath": "^0.3.1",
|
|
@@ -8645,8 +8645,8 @@
|
|
|
8645
8645
|
"license": "MIT"
|
|
8646
8646
|
},
|
|
8647
8647
|
"node_modules/baseline-browser-mapping": {
|
|
8648
|
-
"version": "2.10.
|
|
8649
|
-
"integrity": "sha512-
|
|
8648
|
+
"version": "2.10.13",
|
|
8649
|
+
"integrity": "sha512-BL2sTuHOdy0YT1lYieUxTw/QMtPBC3pmlJC6xk8BBYVv6vcw3SGdKemQ+Xsx9ik2F/lYDO9tqsFQH1r9PFuHKw==",
|
|
8650
8650
|
"license": "Apache-2.0",
|
|
8651
8651
|
"bin": {
|
|
8652
8652
|
"baseline-browser-mapping": "dist/cli.cjs"
|
|
@@ -8996,8 +8996,8 @@
|
|
|
8996
8996
|
}
|
|
8997
8997
|
},
|
|
8998
8998
|
"node_modules/caniuse-lite": {
|
|
8999
|
-
"version": "1.0.
|
|
9000
|
-
"integrity": "sha512-
|
|
8999
|
+
"version": "1.0.30001784",
|
|
9000
|
+
"integrity": "sha512-WU346nBTklUV9YfUl60fqRbU5ZqyXlqvo1SgigE1OAXK5bFL8LL9q1K7aap3N739l4BvNqnkm3YrGHiY9sfUQw==",
|
|
9001
9001
|
"funding": [
|
|
9002
9002
|
{
|
|
9003
9003
|
"type": "opencollective",
|
|
@@ -10910,8 +10910,8 @@
|
|
|
10910
10910
|
"license": "MIT"
|
|
10911
10911
|
},
|
|
10912
10912
|
"node_modules/electron-to-chromium": {
|
|
10913
|
-
"version": "1.5.
|
|
10914
|
-
"integrity": "sha512
|
|
10913
|
+
"version": "1.5.330",
|
|
10914
|
+
"integrity": "sha512-jFNydB5kFtYUobh4IkWUnXeyDbjf/r9gcUEXe1xcrcUxIGfTdzPXA+ld6zBRbwvgIGVzDll/LTIiDztEtckSnA==",
|
|
10915
10915
|
"license": "ISC"
|
|
10916
10916
|
},
|
|
10917
10917
|
"node_modules/emittery": {
|
|
@@ -24532,8 +24532,8 @@
|
|
|
24532
24532
|
}
|
|
24533
24533
|
},
|
|
24534
24534
|
"node_modules/undici": {
|
|
24535
|
-
"version": "7.24.
|
|
24536
|
-
"integrity": "sha512-
|
|
24535
|
+
"version": "7.24.7",
|
|
24536
|
+
"integrity": "sha512-H/nlJ/h0ggGC+uRL3ovD+G0i4bqhvsDOpbDv7At5eFLlj2b41L8QliGbnl2H7SnDiYhENphh1tQFJZf+MyfLsQ==",
|
|
24537
24537
|
"dev": true,
|
|
24538
24538
|
"license": "MIT",
|
|
24539
24539
|
"engines": {
|
package/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavemaker/app-rn-runtime",
|
|
3
|
-
"version": "11.14.1-
|
|
3
|
+
"version": "11.14.1-19.6462",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@wavemaker/app-rn-runtime",
|
|
9
|
-
"version": "11.14.1-
|
|
9
|
+
"version": "11.14.1-19.6462",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@expo/vector-icons": "15.0.2",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@react-navigation/drawer": "7.5.8",
|
|
21
21
|
"@react-navigation/native": "7.1.18",
|
|
22
22
|
"@react-navigation/stack": "7.4.8",
|
|
23
|
-
"@wavemaker/variables": "11.14.1-
|
|
23
|
+
"@wavemaker/variables": "11.14.1-19.6462",
|
|
24
24
|
"axios": "1.8.3",
|
|
25
25
|
"color": "4.2.3",
|
|
26
26
|
"cross-env": "7.0.3",
|
|
@@ -6611,8 +6611,8 @@
|
|
|
6611
6611
|
"peer": true
|
|
6612
6612
|
},
|
|
6613
6613
|
"node_modules/@wavemaker/variables": {
|
|
6614
|
-
"version": "11.14.1-
|
|
6615
|
-
"integrity": "sha512-
|
|
6614
|
+
"version": "11.14.1-19.6462",
|
|
6615
|
+
"integrity": "sha512-AYf4eAnRbvN7Cg6i/eay3UBMzyFQHQYeDNgk3kuyYvub46SspekdODDjW6JFJer6EiQIzXvLpU5JKXEsJQv+0w==",
|
|
6616
6616
|
"license": "ISC",
|
|
6617
6617
|
"dependencies": {
|
|
6618
6618
|
"@metrichor/jmespath": "^0.3.1",
|
|
@@ -8645,8 +8645,8 @@
|
|
|
8645
8645
|
"license": "MIT"
|
|
8646
8646
|
},
|
|
8647
8647
|
"node_modules/baseline-browser-mapping": {
|
|
8648
|
-
"version": "2.10.
|
|
8649
|
-
"integrity": "sha512-
|
|
8648
|
+
"version": "2.10.13",
|
|
8649
|
+
"integrity": "sha512-BL2sTuHOdy0YT1lYieUxTw/QMtPBC3pmlJC6xk8BBYVv6vcw3SGdKemQ+Xsx9ik2F/lYDO9tqsFQH1r9PFuHKw==",
|
|
8650
8650
|
"license": "Apache-2.0",
|
|
8651
8651
|
"bin": {
|
|
8652
8652
|
"baseline-browser-mapping": "dist/cli.cjs"
|
|
@@ -8996,8 +8996,8 @@
|
|
|
8996
8996
|
}
|
|
8997
8997
|
},
|
|
8998
8998
|
"node_modules/caniuse-lite": {
|
|
8999
|
-
"version": "1.0.
|
|
9000
|
-
"integrity": "sha512-
|
|
8999
|
+
"version": "1.0.30001784",
|
|
9000
|
+
"integrity": "sha512-WU346nBTklUV9YfUl60fqRbU5ZqyXlqvo1SgigE1OAXK5bFL8LL9q1K7aap3N739l4BvNqnkm3YrGHiY9sfUQw==",
|
|
9001
9001
|
"funding": [
|
|
9002
9002
|
{
|
|
9003
9003
|
"type": "opencollective",
|
|
@@ -10910,8 +10910,8 @@
|
|
|
10910
10910
|
"license": "MIT"
|
|
10911
10911
|
},
|
|
10912
10912
|
"node_modules/electron-to-chromium": {
|
|
10913
|
-
"version": "1.5.
|
|
10914
|
-
"integrity": "sha512
|
|
10913
|
+
"version": "1.5.330",
|
|
10914
|
+
"integrity": "sha512-jFNydB5kFtYUobh4IkWUnXeyDbjf/r9gcUEXe1xcrcUxIGfTdzPXA+ld6zBRbwvgIGVzDll/LTIiDztEtckSnA==",
|
|
10915
10915
|
"license": "ISC"
|
|
10916
10916
|
},
|
|
10917
10917
|
"node_modules/emittery": {
|
|
@@ -24532,8 +24532,8 @@
|
|
|
24532
24532
|
}
|
|
24533
24533
|
},
|
|
24534
24534
|
"node_modules/undici": {
|
|
24535
|
-
"version": "7.24.
|
|
24536
|
-
"integrity": "sha512-
|
|
24535
|
+
"version": "7.24.7",
|
|
24536
|
+
"integrity": "sha512-H/nlJ/h0ggGC+uRL3ovD+G0i4bqhvsDOpbDv7At5eFLlj2b41L8QliGbnl2H7SnDiYhENphh1tQFJZf+MyfLsQ==",
|
|
24537
24537
|
"dev": true,
|
|
24538
24538
|
"license": "MIT",
|
|
24539
24539
|
"engines": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavemaker/app-rn-runtime",
|
|
3
|
-
"version": "11.14.1-
|
|
3
|
+
"version": "11.14.1-19.6462",
|
|
4
4
|
"description": "''",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"module": "index",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@react-navigation/drawer": "7.5.8",
|
|
60
60
|
"@react-navigation/native": "7.1.18",
|
|
61
61
|
"@react-navigation/stack": "7.4.8",
|
|
62
|
-
"@wavemaker/variables": "11.14.1-
|
|
62
|
+
"@wavemaker/variables": "11.14.1-19.6462",
|
|
63
63
|
"axios": "1.8.3",
|
|
64
64
|
"color": "4.2.3",
|
|
65
65
|
"cross-env": "7.0.3",
|
package/runtime/App.js
CHANGED
|
@@ -58,6 +58,8 @@ import moment from 'moment';
|
|
|
58
58
|
import ErrorBoundary from '../core/error-boundary.component';
|
|
59
59
|
import { ScreenCaptureProtectionProvider } from '../core/screen-capture-protection.service';
|
|
60
60
|
import { allowScreenCaptureAsync, preventScreenCaptureAsync } from 'expo-screen-capture';
|
|
61
|
+
import { setupGlobalJsErrorHandler } from '../core/global-error-handler.service';
|
|
62
|
+
import Fallback from '../core/components/error-fallback/error-fallback.component';
|
|
61
63
|
//some old react libraries need this
|
|
62
64
|
View['propTypes'] = {
|
|
63
65
|
style: ProtoTypes.any
|
|
@@ -128,6 +130,8 @@ export default class BaseApp extends React.Component {
|
|
|
128
130
|
}));
|
|
129
131
|
_defineProperty(this, "networkStatus", {});
|
|
130
132
|
_defineProperty(this, "statusbarInsets", void 0);
|
|
133
|
+
_defineProperty(this, "globalError", null);
|
|
134
|
+
_defineProperty(this, "globalJsErrorHandlerCleanup", null);
|
|
131
135
|
_defineProperty(this, "enableProtection", async () => {
|
|
132
136
|
try {
|
|
133
137
|
if (Platform.OS !== 'web') {
|
|
@@ -150,6 +154,9 @@ export default class BaseApp extends React.Component {
|
|
|
150
154
|
setTimeout(() => SplashScreen.hideAsync(), 10000);
|
|
151
155
|
this.appConfig.app = this;
|
|
152
156
|
this.appConfig.drawer = new DrawerImpl(() => this.refresh());
|
|
157
|
+
|
|
158
|
+
// Register app instance in injector for Error Boundary access
|
|
159
|
+
injector.set('APP_INSTANCE', this);
|
|
153
160
|
AppSpinnerService.setDefaultOptions({
|
|
154
161
|
spinner: this.appConfig.spinner
|
|
155
162
|
});
|
|
@@ -245,10 +252,62 @@ export default class BaseApp extends React.Component {
|
|
|
245
252
|
try {
|
|
246
253
|
this.onPageReady(activePageName, activePageScope);
|
|
247
254
|
} catch (e) {
|
|
248
|
-
|
|
255
|
+
this.handleCallbackError(e, `Error in onPageReady callback`);
|
|
249
256
|
}
|
|
250
257
|
}
|
|
251
258
|
onPageReady(activePageName, activePageScope) {}
|
|
259
|
+
triggerOnError(error, errorInfo, errorType) {
|
|
260
|
+
try {
|
|
261
|
+
this.onError(error, errorInfo, errorType);
|
|
262
|
+
} catch (e) {
|
|
263
|
+
console.error('Error in onError callback:', e);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
onError(error, errorInfo, errorType) {
|
|
267
|
+
// Empty implementation - user can override in app.js
|
|
268
|
+
// errorType: 'render' for React component errors, 'javascript' for other JS errors
|
|
269
|
+
}
|
|
270
|
+
handleCallbackError(error, context) {
|
|
271
|
+
var _this$appConfig;
|
|
272
|
+
console.error(error);
|
|
273
|
+
const errorObj = error instanceof Error ? error : new Error(String(error));
|
|
274
|
+
|
|
275
|
+
// Check if error handling is enabled
|
|
276
|
+
const prefs = (_this$appConfig = this.appConfig) === null || _this$appConfig === void 0 ? void 0 : _this$appConfig.preferences;
|
|
277
|
+
const globalEnabled = (prefs === null || prefs === void 0 ? void 0 : prefs.enableGlobalErrorHandler) === true;
|
|
278
|
+
const showDefaultFallback = (prefs === null || prefs === void 0 ? void 0 : prefs.showDefaultErrorFallback) !== false;
|
|
279
|
+
if (!globalEnabled) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// Immediately hide all overlays to ensure error fallback is visible
|
|
284
|
+
try {
|
|
285
|
+
// Hide Expo SplashScreen
|
|
286
|
+
SplashScreen.hideAsync();
|
|
287
|
+
|
|
288
|
+
// Hide App Spinner (force hide regardless of count)
|
|
289
|
+
AppSpinnerService.hide();
|
|
290
|
+
} catch (hideError) {
|
|
291
|
+
console.warn('Error hiding overlays:', hideError);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// Trigger user callback
|
|
295
|
+
this.triggerOnError(errorObj, context, 'javascript');
|
|
296
|
+
|
|
297
|
+
// Only set global error state if fallback should be shown
|
|
298
|
+
if (showDefaultFallback) {
|
|
299
|
+
this.globalError = {
|
|
300
|
+
error: errorObj,
|
|
301
|
+
errorInfo: context,
|
|
302
|
+
errorType: 'javascript',
|
|
303
|
+
isFatal: false
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
// Set isStarted to true so app template will render the error screen
|
|
307
|
+
this.isStarted = true;
|
|
308
|
+
this.forceUpdate(); // Show fallback screen
|
|
309
|
+
}
|
|
310
|
+
}
|
|
252
311
|
setTimezone(timezone) {
|
|
253
312
|
AppI18nService.setTimezone(timezone);
|
|
254
313
|
}
|
|
@@ -286,9 +345,18 @@ export default class BaseApp extends React.Component {
|
|
|
286
345
|
config.headers['X-Requested-With'] = 'XMLHttpRequest';
|
|
287
346
|
console.log('onBeforeService call invoked on ' + config.url);
|
|
288
347
|
this.notify('beforeServiceCall', config);
|
|
289
|
-
|
|
348
|
+
try {
|
|
349
|
+
return this.onBeforeServiceCall(config);
|
|
350
|
+
} catch (e) {
|
|
351
|
+
this.handleCallbackError(e, `Error in onBeforeServiceCall callback`);
|
|
352
|
+
return config; // Return original config as fallback
|
|
353
|
+
}
|
|
290
354
|
}), axios.interceptors.response.use(response => {
|
|
291
|
-
|
|
355
|
+
try {
|
|
356
|
+
this.onServiceSuccess(response.data, response);
|
|
357
|
+
} catch (e) {
|
|
358
|
+
this.handleCallbackError(e, `Error in onServiceSuccess callback`);
|
|
359
|
+
}
|
|
292
360
|
this.notify('afterServiceCall', response.config, response);
|
|
293
361
|
return response;
|
|
294
362
|
}, error => {
|
|
@@ -302,8 +370,41 @@ export default class BaseApp extends React.Component {
|
|
|
302
370
|
errMsg = error.message || "Service Call Failed";
|
|
303
371
|
}
|
|
304
372
|
error.message = errMsg;
|
|
373
|
+
|
|
374
|
+
// Mark as service error for priority handling
|
|
375
|
+
// Set flags on both error and config to handle wrapping scenarios
|
|
376
|
+
error.__wmServiceError = true;
|
|
377
|
+
error.__wmServiceErrorHandled = false;
|
|
378
|
+
if (error.config) {
|
|
379
|
+
error.config.__wmServiceError = true;
|
|
380
|
+
error.config.__wmServiceErrorHandled = false;
|
|
381
|
+
}
|
|
305
382
|
console.error(`Error ${errMsg} recieved from ${(_error$response = error.response) === null || _error$response === void 0 || (_error$response = _error$response.config) === null || _error$response === void 0 ? void 0 : _error$response.url}`);
|
|
306
|
-
|
|
383
|
+
try {
|
|
384
|
+
var _this$appConfig2;
|
|
385
|
+
this.onServiceError(error.message, error);
|
|
386
|
+
// Mark as handled to prevent onError from being called
|
|
387
|
+
error.__wmServiceErrorHandled = true;
|
|
388
|
+
if (error.config) {
|
|
389
|
+
error.config.__wmServiceErrorHandled = true;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// Show fallback for service errors if enabled (but don't call onError)
|
|
393
|
+
const prefs = (_this$appConfig2 = this.appConfig) === null || _this$appConfig2 === void 0 ? void 0 : _this$appConfig2.preferences;
|
|
394
|
+
const globalEnabled = (prefs === null || prefs === void 0 ? void 0 : prefs.enableGlobalErrorHandler) === true;
|
|
395
|
+
const showDefaultFallback = (prefs === null || prefs === void 0 ? void 0 : prefs.showDefaultErrorFallback) !== false;
|
|
396
|
+
if (globalEnabled && showDefaultFallback) {
|
|
397
|
+
this.globalError = {
|
|
398
|
+
error: error,
|
|
399
|
+
errorInfo: (error === null || error === void 0 ? void 0 : error.stack) || (error === null || error === void 0 ? void 0 : error.toString()),
|
|
400
|
+
errorType: 'javascript',
|
|
401
|
+
isFatal: false
|
|
402
|
+
};
|
|
403
|
+
this.forceUpdate(); // Trigger re-render to show error fallback
|
|
404
|
+
}
|
|
405
|
+
} catch (e) {
|
|
406
|
+
this.handleCallbackError(e, `Error in onServiceError callback`);
|
|
407
|
+
}
|
|
307
408
|
if ((_error$response2 = error.response) !== null && _error$response2 !== void 0 && (_error$response2 = _error$response2.config.url) !== null && _error$response2 !== void 0 && _error$response2.startsWith(this.appConfig.url) && !((_error$response3 = error.response) !== null && _error$response3 !== void 0 && (_error$response3 = _error$response3.config.url) !== null && _error$response3 !== void 0 && _error$response3.includes('/services/')) && ((_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : _error$response4.status) === 401) {
|
|
308
409
|
var _this$appConfig$curre5, _this$appConfig$curre6;
|
|
309
410
|
((_this$appConfig$curre5 = this.appConfig.currentPage) === null || _this$appConfig$curre5 === void 0 ? void 0 : _this$appConfig$curre5.pageName) !== 'Login' && ((_this$appConfig$curre6 = this.appConfig.currentPage) === null || _this$appConfig$curre6 === void 0 ? void 0 : _this$appConfig$curre6.goToPage('Login'));
|
|
@@ -327,6 +428,34 @@ export default class BaseApp extends React.Component {
|
|
|
327
428
|
return Promise.all(this.startUpVariables.map(s => this.Variables[s] && this.Variables[s].invoke())).catch(() => {});
|
|
328
429
|
}
|
|
329
430
|
componentDidMount() {
|
|
431
|
+
var _this$appConfig3;
|
|
432
|
+
// Setup global JS error handler with granular control
|
|
433
|
+
const prefs = (_this$appConfig3 = this.appConfig) === null || _this$appConfig3 === void 0 ? void 0 : _this$appConfig3.preferences;
|
|
434
|
+
const globalEnabled = (prefs === null || prefs === void 0 ? void 0 : prefs.enableGlobalErrorHandler) === true;
|
|
435
|
+
const enableSyncErrors = (prefs === null || prefs === void 0 ? void 0 : prefs.enableJsSyncErrors) !== false;
|
|
436
|
+
const enableAsyncErrors = (prefs === null || prefs === void 0 ? void 0 : prefs.enableJsAsyncErrors) !== false;
|
|
437
|
+
const showFallback = (prefs === null || prefs === void 0 ? void 0 : prefs.showDefaultErrorFallback) !== false;
|
|
438
|
+
|
|
439
|
+
// Only setup if master switch is on and at least one error type is enabled
|
|
440
|
+
if (globalEnabled && (enableSyncErrors || enableAsyncErrors)) {
|
|
441
|
+
this.globalJsErrorHandlerCleanup = setupGlobalJsErrorHandler((error, isFatal, errorInfo) => {
|
|
442
|
+
// Trigger user error callback
|
|
443
|
+
this.triggerOnError(error, errorInfo, 'javascript');
|
|
444
|
+
|
|
445
|
+
// Only set global error state if fallback should be shown
|
|
446
|
+
if (showFallback) {
|
|
447
|
+
this.globalError = {
|
|
448
|
+
error,
|
|
449
|
+
errorInfo,
|
|
450
|
+
errorType: 'javascript',
|
|
451
|
+
isFatal
|
|
452
|
+
};
|
|
453
|
+
this.forceUpdate(); // Trigger re-render to show error fallback
|
|
454
|
+
}
|
|
455
|
+
}, true,
|
|
456
|
+
// suppressDefaultErrorScreen = true when global error handler is enabled
|
|
457
|
+
enableSyncErrors, enableAsyncErrors);
|
|
458
|
+
}
|
|
330
459
|
AppSpinnerService.show({
|
|
331
460
|
spinner: this.appConfig.spinner
|
|
332
461
|
});
|
|
@@ -342,7 +471,12 @@ export default class BaseApp extends React.Component {
|
|
|
342
471
|
}));
|
|
343
472
|
this.startUpActions.map(a => this.Actions[a] && this.Actions[a].invoke());
|
|
344
473
|
return this.triggerStartUpVariables().then(() => {
|
|
345
|
-
|
|
474
|
+
try {
|
|
475
|
+
this.onAppVariablesReady();
|
|
476
|
+
} catch (e) {
|
|
477
|
+
this.handleCallbackError(e, `Error in onAppVariablesReady callback`);
|
|
478
|
+
return; // Early return to prevent subsequent code from executing
|
|
479
|
+
}
|
|
346
480
|
this.isStarted = true;
|
|
347
481
|
this.forceUpdate();
|
|
348
482
|
}, () => {});
|
|
@@ -352,6 +486,11 @@ export default class BaseApp extends React.Component {
|
|
|
352
486
|
axios.interceptors.request.eject(id);
|
|
353
487
|
});
|
|
354
488
|
this.cleanup.forEach(fn => fn());
|
|
489
|
+
|
|
490
|
+
// Cleanup global JS error handler
|
|
491
|
+
if (this.globalJsErrorHandlerCleanup) {
|
|
492
|
+
this.globalJsErrorHandlerCleanup();
|
|
493
|
+
}
|
|
355
494
|
}
|
|
356
495
|
refresh() {
|
|
357
496
|
this.appConfig.refresh();
|
|
@@ -376,8 +515,8 @@ export default class BaseApp extends React.Component {
|
|
|
376
515
|
}, content))))))));
|
|
377
516
|
}
|
|
378
517
|
renderToasters() {
|
|
379
|
-
var _this$
|
|
380
|
-
const isEdgeToEdgeApp = !!((_this$
|
|
518
|
+
var _this$appConfig4;
|
|
519
|
+
const isEdgeToEdgeApp = !!((_this$appConfig4 = this.appConfig) !== null && _this$appConfig4 !== void 0 && (_this$appConfig4 = _this$appConfig4.edgeToEdgeConfig) !== null && _this$appConfig4 !== void 0 && _this$appConfig4.isEdgeToEdgeApp);
|
|
381
520
|
this.toastsOpened = AppToastService.toastsOpened.length;
|
|
382
521
|
return /*#__PURE__*/React.createElement(WmMemo, {
|
|
383
522
|
watcher: this.watcher,
|
|
@@ -570,13 +709,13 @@ export default class BaseApp extends React.Component {
|
|
|
570
709
|
return false;
|
|
571
710
|
}
|
|
572
711
|
renderApp(commonPartial) {
|
|
573
|
-
var _this$
|
|
712
|
+
var _this$appConfig5, _this$appConfig6;
|
|
574
713
|
this.autoUpdateVariables.forEach(value => {
|
|
575
714
|
var _this$Variables$value;
|
|
576
715
|
return (_this$Variables$value = this.Variables[value]) === null || _this$Variables$value === void 0 ? void 0 : _this$Variables$value.invokeOnParamChange();
|
|
577
716
|
});
|
|
578
|
-
const edgeToEdgeConfig = (_this$
|
|
579
|
-
const statusbarConfig = (_this$
|
|
717
|
+
const edgeToEdgeConfig = (_this$appConfig5 = this.appConfig) === null || _this$appConfig5 === void 0 ? void 0 : _this$appConfig5.edgeToEdgeConfig;
|
|
718
|
+
const statusbarConfig = (_this$appConfig6 = this.appConfig) === null || _this$appConfig6 === void 0 || (_this$appConfig6 = _this$appConfig6.edgeToEdgeConfig) === null || _this$appConfig6 === void 0 ? void 0 : _this$appConfig6.statusbarConfig;
|
|
580
719
|
const isEdgeToEdgeApp = !!(edgeToEdgeConfig !== null && edgeToEdgeConfig !== void 0 && edgeToEdgeConfig.isEdgeToEdgeApp);
|
|
581
720
|
const Wrapper = isEdgeToEdgeApp ? View : SafeAreaView;
|
|
582
721
|
return /*#__PURE__*/React.createElement(SafeAreaProvider, null, /*#__PURE__*/React.createElement(SafeAreaInsetsContext.Consumer, null, (insets = {
|
|
@@ -599,7 +738,8 @@ export default class BaseApp extends React.Component {
|
|
|
599
738
|
}), /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
600
739
|
value: this.appConfig.theme
|
|
601
740
|
}, /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
602
|
-
currentPage: this.appConfig.currentPage
|
|
741
|
+
currentPage: this.appConfig.currentPage,
|
|
742
|
+
app: this
|
|
603
743
|
}, this.renderIosStatusbarInsetsView(isEdgeToEdgeApp, insets), /*#__PURE__*/React.createElement(View, {
|
|
604
744
|
style: {
|
|
605
745
|
flex: 1
|
|
@@ -617,7 +757,29 @@ export default class BaseApp extends React.Component {
|
|
|
617
757
|
drawerAnimation: (_this$appConfig$drawe2 = this.appConfig.drawer) === null || _this$appConfig$drawe2 === void 0 ? void 0 : _this$appConfig$drawe2.getAnimation()
|
|
618
758
|
}), /*#__PURE__*/React.createElement(FixedViewContainer, null, commonPartial))), this.appConfig.url ? /*#__PURE__*/React.createElement(WmNetworkInfoToaster, {
|
|
619
759
|
appLocale: this.appConfig.appLocale
|
|
620
|
-
}) : null, this.renderToasters(), this.renderDialogs(), this.renderDisplayManager()
|
|
760
|
+
}) : null, this.renderToasters(), this.renderDialogs(), this.renderDisplayManager(), this.globalError && /*#__PURE__*/React.createElement(View, {
|
|
761
|
+
style: {
|
|
762
|
+
position: 'absolute',
|
|
763
|
+
height: "100%",
|
|
764
|
+
width: "100%",
|
|
765
|
+
top: 0,
|
|
766
|
+
left: 0,
|
|
767
|
+
right: 0,
|
|
768
|
+
bottom: 0,
|
|
769
|
+
zIndex: 999999,
|
|
770
|
+
elevation: 999999
|
|
771
|
+
}
|
|
772
|
+
}, /*#__PURE__*/React.createElement(Fallback, {
|
|
773
|
+
error: this.globalError.error,
|
|
774
|
+
info: {
|
|
775
|
+
errorInfo: this.globalError.errorInfo
|
|
776
|
+
},
|
|
777
|
+
errorType: this.globalError.errorType,
|
|
778
|
+
resetErrorBoundary: () => {
|
|
779
|
+
this.globalError = null;
|
|
780
|
+
this.forceUpdate();
|
|
781
|
+
}
|
|
782
|
+
}))), isEdgeToEdgeApp && (statusbarConfig === null || statusbarConfig === void 0 ? void 0 : statusbarConfig.type) === 'blur' ? this.renderBlurView("top", insets, statusbarConfig) : null, isEdgeToEdgeApp && (statusbarConfig === null || statusbarConfig === void 0 ? void 0 : statusbarConfig.type) === 'transparent' ? this.renderTransparentView("top", insets, statusbarConfig) : null))))));
|
|
621
783
|
}));
|
|
622
784
|
}
|
|
623
785
|
}
|