@wavemaker/app-rn-runtime 11.14.1-18.6445 → 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/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 +2 -6
- 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 +112 -112
- package/package-lock.json +112 -112
- 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
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global Error Handler Service for WaveMaker Runtime
|
|
3
|
+
*
|
|
4
|
+
* This service provides comprehensive error handling for React Native applications:
|
|
5
|
+
* 1. JavaScript Error Handling: Uses ErrorUtils.setGlobalHandler for sync errors
|
|
6
|
+
* 2. Promise Rejection Tracking: Multi-engine approach for unhandled promise rejections
|
|
7
|
+
* - Web: Uses browser's 'unhandledrejection' event
|
|
8
|
+
* - Hermes: Uses HermesInternal.enablePromiseRejectionTracker
|
|
9
|
+
* - JSC: Uses React Native's 'promise/setimmediate/rejection-tracking' module
|
|
10
|
+
*
|
|
11
|
+
* Key Features:
|
|
12
|
+
* - Catches ALL API call failures (fetch, axios, any HTTP library)
|
|
13
|
+
* - Handles async function errors and manual Promise.reject calls
|
|
14
|
+
* - Automatic engine detection and optimal method selection
|
|
15
|
+
* - Production-ready with proper cleanup mechanisms
|
|
16
|
+
* - Configurable suppression of React Native's default error screens
|
|
17
|
+
*
|
|
18
|
+
* Research Background:
|
|
19
|
+
* This implementation was developed after extensive research into React Native's
|
|
20
|
+
* error handling mechanisms across different JavaScript engines. It addresses
|
|
21
|
+
* the common problem where API call failures and async errors are not caught
|
|
22
|
+
* by standard error boundaries, providing a unified solution for all error types.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { Platform } from 'react-native';
|
|
26
|
+
import { isWebPreviewMode } from './utils';
|
|
27
|
+
import { setupAdvancedPromiseRejectionTracking } from './advanced-promise-rejection-tracker';
|
|
28
|
+
let globalJsErrorHandler = null;
|
|
29
|
+
let promiseRejectionTracker = null;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Extracts meaningful error message from various error formats
|
|
33
|
+
* Handles WaveMaker API errors, Axios errors, Error instances, and objects
|
|
34
|
+
* @param error The error object/value to extract message from
|
|
35
|
+
* @returns Extracted error message string
|
|
36
|
+
*/
|
|
37
|
+
const extractErrorMessage = error => {
|
|
38
|
+
var _error$details, _error$details2;
|
|
39
|
+
if (typeof error === 'string') return error;
|
|
40
|
+
if (error instanceof Error) return error.message;
|
|
41
|
+
if (!error || typeof error !== 'object') return String(error);
|
|
42
|
+
|
|
43
|
+
// WaveMaker API error format: details.data.errors.error[0]
|
|
44
|
+
if ((_error$details = error.details) !== null && _error$details !== void 0 && (_error$details = _error$details.data) !== null && _error$details !== void 0 && (_error$details = _error$details.errors) !== null && _error$details !== void 0 && _error$details.error && Array.isArray(error.details.data.errors.error)) {
|
|
45
|
+
const firstError = error.details.data.errors.error[0];
|
|
46
|
+
if (firstError && firstError.message) {
|
|
47
|
+
let message = firstError.message;
|
|
48
|
+
|
|
49
|
+
// Interpolate parameters {0}, {1}, etc.
|
|
50
|
+
if (firstError.parameters && Array.isArray(firstError.parameters)) {
|
|
51
|
+
firstError.parameters.forEach((param, index) => {
|
|
52
|
+
message = message.replace(`{${index}}`, String(param));
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return message;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Wrapped format: { error: "message" }
|
|
60
|
+
if (error.error && typeof error.error === 'string') {
|
|
61
|
+
return error.error;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Standard format: { message: "..." }
|
|
65
|
+
if (error.message) {
|
|
66
|
+
return error.message;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Nested details message
|
|
70
|
+
if ((_error$details2 = error.details) !== null && _error$details2 !== void 0 && _error$details2.message) {
|
|
71
|
+
return error.details.message;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Last resort - stringify the object
|
|
75
|
+
try {
|
|
76
|
+
return JSON.stringify(error);
|
|
77
|
+
} catch {
|
|
78
|
+
return String(error);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Sets up global JavaScript error handling for sync JS errors and unhandled promise rejections
|
|
84
|
+
* Note: Render errors are handled separately by React ErrorBoundary
|
|
85
|
+
* @param onError Callback function to handle errors
|
|
86
|
+
* @param suppressDefaultErrorScreen Whether to suppress React Native's default error screen
|
|
87
|
+
* @param enableSyncErrors Whether to enable synchronous JavaScript error handling
|
|
88
|
+
* @param enableAsyncErrors Whether to enable asynchronous error handling (promise rejections)
|
|
89
|
+
* @returns Cleanup function to remove the error handlers
|
|
90
|
+
*/
|
|
91
|
+
export const setupGlobalJsErrorHandler = (onError, suppressDefaultErrorScreen = false, enableSyncErrors = true, enableAsyncErrors = true) => {
|
|
92
|
+
let originalHandler = null;
|
|
93
|
+
const ErrorUtilsRef = globalThis === null || globalThis === void 0 ? void 0 : globalThis.ErrorUtils;
|
|
94
|
+
|
|
95
|
+
// Only setup synchronous JavaScript error handler if enabled
|
|
96
|
+
if (ErrorUtilsRef && enableSyncErrors) {
|
|
97
|
+
var _ErrorUtilsRef$getGlo, _ErrorUtilsRef$setGlo;
|
|
98
|
+
// Store the original error handler to restore it later
|
|
99
|
+
originalHandler = ErrorUtilsRef === null || ErrorUtilsRef === void 0 || (_ErrorUtilsRef$getGlo = ErrorUtilsRef.getGlobalHandler) === null || _ErrorUtilsRef$getGlo === void 0 ? void 0 : _ErrorUtilsRef$getGlo.call(ErrorUtilsRef);
|
|
100
|
+
|
|
101
|
+
// Setup synchronous JavaScript error handler
|
|
102
|
+
globalJsErrorHandler = (error, isFatal = false) => {
|
|
103
|
+
const errorInfo = __DEV__ ? `${error.stack || error.toString()}` : 'An unexpected error occurred';
|
|
104
|
+
|
|
105
|
+
// Call our custom error handler
|
|
106
|
+
onError(error, isFatal, errorInfo);
|
|
107
|
+
|
|
108
|
+
// Call the original handler for development/debugging if not suppressed
|
|
109
|
+
// This controls whether React Native's default red error screen is shown
|
|
110
|
+
if (originalHandler && __DEV__ && !suppressDefaultErrorScreen) {
|
|
111
|
+
originalHandler(error, isFatal);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
// Set our custom global JS error handler
|
|
116
|
+
ErrorUtilsRef === null || ErrorUtilsRef === void 0 || (_ErrorUtilsRef$setGlo = ErrorUtilsRef.setGlobalHandler) === null || _ErrorUtilsRef$setGlo === void 0 || _ErrorUtilsRef$setGlo.call(ErrorUtilsRef, globalJsErrorHandler);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Setup Advanced Promise Rejection Tracking only if async errors are enabled
|
|
120
|
+
// This automatically detects the best method for the current JavaScript engine:
|
|
121
|
+
// - Web: Uses unhandledrejection event for complete coverage
|
|
122
|
+
// - Hermes: Uses HermesInternal.enablePromiseRejectionTracker for native tracking
|
|
123
|
+
// - JSC: Uses promise/setimmediate/rejection-tracking module for comprehensive handling
|
|
124
|
+
if (enableAsyncErrors) {
|
|
125
|
+
promiseRejectionTracker = setupAdvancedPromiseRejectionTracking(error => {
|
|
126
|
+
var _error$config, _error$config2, _error$details3, _error$details4;
|
|
127
|
+
// Skip if this is a service error that was already handled by onServiceError
|
|
128
|
+
// Check multiple locations as error might be wrapped
|
|
129
|
+
const isServiceErrorHandled = (error === null || error === void 0 ? void 0 : error.__wmServiceError) && (error === null || error === void 0 ? void 0 : error.__wmServiceErrorHandled) || (error === null || error === void 0 || (_error$config = error.config) === null || _error$config === void 0 ? void 0 : _error$config.__wmServiceError) && (error === null || error === void 0 || (_error$config2 = error.config) === null || _error$config2 === void 0 ? void 0 : _error$config2.__wmServiceErrorHandled) || (error === null || error === void 0 || (_error$details3 = error.details) === null || _error$details3 === void 0 || (_error$details3 = _error$details3.config) === null || _error$details3 === void 0 ? void 0 : _error$details3.__wmServiceError) && (error === null || error === void 0 || (_error$details4 = error.details) === null || _error$details4 === void 0 || (_error$details4 = _error$details4.config) === null || _error$details4 === void 0 ? void 0 : _error$details4.__wmServiceErrorHandled);
|
|
130
|
+
if (isServiceErrorHandled) {
|
|
131
|
+
if (__DEV__) {
|
|
132
|
+
console.log('[ErrorHandler] Skipping service error, already handled by onServiceError');
|
|
133
|
+
}
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const promiseError = error instanceof Error ? error : new Error(extractErrorMessage(error));
|
|
137
|
+
|
|
138
|
+
// Preserve original error for debugging
|
|
139
|
+
if (!(error instanceof Error)) {
|
|
140
|
+
promiseError.originalError = error;
|
|
141
|
+
}
|
|
142
|
+
const errorInfo = __DEV__ ? `Promise rejection: ${promiseError.stack || promiseError.toString()}` : 'An unexpected error occurred';
|
|
143
|
+
|
|
144
|
+
// Call our custom error handler with promise-specific info
|
|
145
|
+
// This ensures API call failures and async errors trigger the same error flow
|
|
146
|
+
onError(promiseError, false, errorInfo);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
return () => {
|
|
150
|
+
// Cleanup function - restores original error handling mechanisms
|
|
151
|
+
if (enableSyncErrors && ErrorUtilsRef) {
|
|
152
|
+
var _ErrorUtilsRef$setGlo2;
|
|
153
|
+
ErrorUtilsRef === null || ErrorUtilsRef === void 0 || (_ErrorUtilsRef$setGlo2 = ErrorUtilsRef.setGlobalHandler) === null || _ErrorUtilsRef$setGlo2 === void 0 || _ErrorUtilsRef$setGlo2.call(ErrorUtilsRef, originalHandler);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Cleanup advanced promise rejection tracking
|
|
157
|
+
if (enableAsyncErrors && promiseRejectionTracker) {
|
|
158
|
+
promiseRejectionTracker.cleanup();
|
|
159
|
+
promiseRejectionTracker = null;
|
|
160
|
+
}
|
|
161
|
+
globalJsErrorHandler = null;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Get current error handling configuration and capabilities
|
|
167
|
+
* Useful for debugging and monitoring the error handling setup
|
|
168
|
+
*/
|
|
169
|
+
export const getErrorHandlingInfo = () => {
|
|
170
|
+
return {
|
|
171
|
+
platform: Platform.OS,
|
|
172
|
+
isWebPreview: isWebPreviewMode(),
|
|
173
|
+
hasPromiseTracking: promiseRejectionTracker !== null,
|
|
174
|
+
hasJavaScriptHandler: globalJsErrorHandler !== null
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
//# sourceMappingURL=global-error-handler.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","isWebPreviewMode","setupAdvancedPromiseRejectionTracking","globalJsErrorHandler","promiseRejectionTracker","extractErrorMessage","error","_error$details","_error$details2","Error","message","String","details","data","errors","Array","isArray","firstError","parameters","forEach","param","index","replace","JSON","stringify","setupGlobalJsErrorHandler","onError","suppressDefaultErrorScreen","enableSyncErrors","enableAsyncErrors","originalHandler","ErrorUtilsRef","globalThis","ErrorUtils","_ErrorUtilsRef$getGlo","_ErrorUtilsRef$setGlo","getGlobalHandler","call","isFatal","errorInfo","__DEV__","stack","toString","setGlobalHandler","_error$config","_error$config2","_error$details3","_error$details4","isServiceErrorHandled","__wmServiceError","__wmServiceErrorHandled","config","console","log","promiseError","originalError","_ErrorUtilsRef$setGlo2","cleanup","getErrorHandlingInfo","platform","OS","isWebPreview","hasPromiseTracking","hasJavaScriptHandler"],"sources":["global-error-handler.service.ts"],"sourcesContent":["/**\n * Global Error Handler Service for WaveMaker Runtime\n *\n * This service provides comprehensive error handling for React Native applications:\n * 1. JavaScript Error Handling: Uses ErrorUtils.setGlobalHandler for sync errors\n * 2. Promise Rejection Tracking: Multi-engine approach for unhandled promise rejections\n * - Web: Uses browser's 'unhandledrejection' event\n * - Hermes: Uses HermesInternal.enablePromiseRejectionTracker\n * - JSC: Uses React Native's 'promise/setimmediate/rejection-tracking' module\n *\n * Key Features:\n * - Catches ALL API call failures (fetch, axios, any HTTP library)\n * - Handles async function errors and manual Promise.reject calls\n * - Automatic engine detection and optimal method selection\n * - Production-ready with proper cleanup mechanisms\n * - Configurable suppression of React Native's default error screens\n *\n * Research Background:\n * This implementation was developed after extensive research into React Native's\n * error handling mechanisms across different JavaScript engines. It addresses\n * the common problem where API call failures and async errors are not caught\n * by standard error boundaries, providing a unified solution for all error types.\n */\n\nimport { Platform } from 'react-native';\nimport { isWebPreviewMode } from './utils';\nimport {\n setupAdvancedPromiseRejectionTracking,\n AdvancedPromiseRejectionTracker,\n} from './advanced-promise-rejection-tracker';\n\nexport interface GlobalErrorState {\n error: Error;\n errorInfo: string;\n errorType: 'javascript';\n isFatal?: boolean;\n}\n\nexport type GlobalErrorCallback = (\n error: Error,\n isFatal: boolean,\n errorInfo: string\n) => void;\n\nlet globalJsErrorHandler: ((error: any, isFatal?: boolean) => void) | null = null;\nlet promiseRejectionTracker: AdvancedPromiseRejectionTracker | null = null;\n\n/**\n * Extracts meaningful error message from various error formats\n * Handles WaveMaker API errors, Axios errors, Error instances, and objects\n * @param error The error object/value to extract message from\n * @returns Extracted error message string\n */\nconst extractErrorMessage = (error: any): string => {\n if (typeof error === 'string') return error;\n \n if (error instanceof Error) return error.message;\n \n if (!error || typeof error !== 'object') return String(error);\n \n // WaveMaker API error format: details.data.errors.error[0]\n if (error.details?.data?.errors?.error && Array.isArray(error.details.data.errors.error)) {\n const firstError = error.details.data.errors.error[0];\n if (firstError && firstError.message) {\n let message = firstError.message;\n \n // Interpolate parameters {0}, {1}, etc.\n if (firstError.parameters && Array.isArray(firstError.parameters)) {\n firstError.parameters.forEach((param: any, index: number) => {\n message = message.replace(`{${index}}`, String(param));\n });\n }\n \n return message;\n }\n }\n \n // Wrapped format: { error: \"message\" }\n if (error.error && typeof error.error === 'string') {\n return error.error;\n }\n \n // Standard format: { message: \"...\" }\n if (error.message) {\n return error.message;\n }\n \n // Nested details message\n if (error.details?.message) {\n return error.details.message;\n }\n \n // Last resort - stringify the object\n try {\n return JSON.stringify(error);\n } catch {\n return String(error);\n }\n};\n\n/**\n * Sets up global JavaScript error handling for sync JS errors and unhandled promise rejections\n * Note: Render errors are handled separately by React ErrorBoundary\n * @param onError Callback function to handle errors\n * @param suppressDefaultErrorScreen Whether to suppress React Native's default error screen\n * @param enableSyncErrors Whether to enable synchronous JavaScript error handling\n * @param enableAsyncErrors Whether to enable asynchronous error handling (promise rejections)\n * @returns Cleanup function to remove the error handlers\n */\nexport const setupGlobalJsErrorHandler = (\n onError: GlobalErrorCallback,\n suppressDefaultErrorScreen: boolean = false,\n enableSyncErrors: boolean = true,\n enableAsyncErrors: boolean = true\n): (() => void) => {\n let originalHandler: any = null;\n const ErrorUtilsRef = (globalThis as any)?.ErrorUtils;\n \n // Only setup synchronous JavaScript error handler if enabled\n if (ErrorUtilsRef && enableSyncErrors) {\n // Store the original error handler to restore it later\n originalHandler = ErrorUtilsRef?.getGlobalHandler?.();\n\n // Setup synchronous JavaScript error handler\n globalJsErrorHandler = (error: any, isFatal: boolean = false) => {\n const errorInfo = __DEV__\n ? `${error.stack || error.toString()}`\n : 'An unexpected error occurred';\n\n // Call our custom error handler\n onError(error, isFatal, errorInfo);\n\n // Call the original handler for development/debugging if not suppressed\n // This controls whether React Native's default red error screen is shown\n if (originalHandler && __DEV__ && !suppressDefaultErrorScreen) {\n originalHandler(error, isFatal);\n }\n };\n\n // Set our custom global JS error handler\n ErrorUtilsRef?.setGlobalHandler?.(globalJsErrorHandler);\n }\n\n // Setup Advanced Promise Rejection Tracking only if async errors are enabled\n // This automatically detects the best method for the current JavaScript engine:\n // - Web: Uses unhandledrejection event for complete coverage\n // - Hermes: Uses HermesInternal.enablePromiseRejectionTracker for native tracking\n // - JSC: Uses promise/setimmediate/rejection-tracking module for comprehensive handling\n if (enableAsyncErrors) {\n promiseRejectionTracker = setupAdvancedPromiseRejectionTracking(\n (error: any) => {\n // Skip if this is a service error that was already handled by onServiceError\n // Check multiple locations as error might be wrapped\n const isServiceErrorHandled = \n (error?.__wmServiceError && error?.__wmServiceErrorHandled) ||\n (error?.config?.__wmServiceError && error?.config?.__wmServiceErrorHandled) ||\n (error?.details?.config?.__wmServiceError && error?.details?.config?.__wmServiceErrorHandled);\n \n if (isServiceErrorHandled) {\n if (__DEV__) {\n console.log('[ErrorHandler] Skipping service error, already handled by onServiceError');\n }\n return;\n }\n const promiseError = error instanceof Error ? error : new Error(extractErrorMessage(error));\n\n // Preserve original error for debugging\n if (!(error instanceof Error)) {\n (promiseError as any).originalError = error;\n }\n \n const errorInfo = __DEV__\n ? `Promise rejection: ${promiseError.stack || promiseError.toString()}`\n : 'An unexpected error occurred';\n\n // Call our custom error handler with promise-specific info\n // This ensures API call failures and async errors trigger the same error flow\n onError(promiseError, false, errorInfo);\n }\n );\n }\n\n return () => {\n // Cleanup function - restores original error handling mechanisms\n if (enableSyncErrors && ErrorUtilsRef) {\n ErrorUtilsRef?.setGlobalHandler?.(originalHandler);\n }\n\n // Cleanup advanced promise rejection tracking\n if (enableAsyncErrors && promiseRejectionTracker) {\n promiseRejectionTracker.cleanup();\n promiseRejectionTracker = null;\n }\n\n globalJsErrorHandler = null;\n };\n};\n\n/**\n * Get current error handling configuration and capabilities\n * Useful for debugging and monitoring the error handling setup\n */\nexport const getErrorHandlingInfo = () => {\n return {\n platform: Platform.OS,\n isWebPreview: isWebPreviewMode(),\n hasPromiseTracking: promiseRejectionTracker !== null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AChC;IAEAD,oBAAoB,GAAG,IAAI;EAC7B,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMuD,oBAAoB,GAAGA,CAAA,KAAM;EACxC,OAAO;IACLC,QAAQ,EAAE3D,QAAQ,CAAC4D,EAAE;IACrBC,YAAY,EAAE5D,gBAAgB,CAAC,CAAC;IAChC6D,kBAAkB,EAAE1D,uBAAuB,KAAK,IAAI;IACpD2D,oBAAoB,EAAE5D,oBAAoB,KAAK;EACjD,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -114,7 +114,7 @@ export class Tappable extends React.Component {
|
|
|
114
114
|
accessibilityLabel: this.props.testID,
|
|
115
115
|
testID: this.props.testID
|
|
116
116
|
} : {
|
|
117
|
-
|
|
117
|
+
accessible: false,
|
|
118
118
|
testID: this.props.testID
|
|
119
119
|
}),
|
|
120
120
|
...this.props.accessibilityProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","View","TouchableOpacity","get","injector","TouchableRipple","TappableContext","createContext","UIPreferencesConsumer","ParentTappableContext","SyntheticEvent","constructor","_defineProperty","stopPropagation","propagationEnabled","Tappable","Component","props","triggerTap","e","_this$parent","target","onTap","invokeEventCallback","parent","onPress","_this$props$target","lastPress","Date","now","onTouchStart","currentTime","tapDelta","lastTap","isLongTap","_injector$FOCUSED_ELE","FOCUSED_ELEMENT","blur","lastDoubleTap","onDoubleTap","setTimeout","_this$parent2","onLongTap","_this$props$target2","_this$parent3","onPressOut","onTouchEnd","_this$props$target3","_this$parent4","setParent","render","commonProps","OS","accessibilityLabel","testID","accessibilityProps","disabled","proxy","style","styles","_e$target","tagName","onLongPress","onLongtap","onDoubletap","createElement","preferences","enableRipple","Consumer","Provider","value","_extends","rippleColor","disableTouchEffect","borderless","onLayout","Fragment","children","activeOpacity"],"sources":["tappable.component.tsx"],"sourcesContent":["import { BaseComponent } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport React from \"react\";\nimport { GestureResponderEvent, Platform, View, TouchableOpacity } from \"react-native\";\nimport { get } from \"lodash\";\nimport injector from \"./injector\";\nimport { TouchableRipple } from \"react-native-paper\";\nimport ThemeVariables from \"../styles/theme.variables\";\nimport { isDefined } from \"./utils\";\n\nexport const TappableContext = React.createContext<Tappable>(null as any);\nimport { UIPreferencesConsumer, UI_PREFERENCES } from \"./ui-preferences.context\";\n\nexport const ParentTappableContext = React.createContext<Tappable>(null as any);\ninterface TappableProps {\n testID?: string;\n children?: any\n styles?: any;\n target?: BaseComponent<any, any, any>;\n onTap?: (e: any) => void;\n onLongTap?: (e: any) => void; \n onDoubleTap?: (e: any) => void;\n onTouchStart? : (e: any) => void;\n onTouchEnd? : (e: any) => void;\n rippleColor?: string;\n accessibilityProps?: any;\n disableTouchEffect?:boolean;\n onLayout?: any;\n}\n\nexport class SyntheticEvent {\n // as the event is being used in onPress, onPressOut and onLongTap the TapEvent is renamed to SyntheticEvent\n propagationEnabled = true;\n \n constructor() {\n\n }\n\n stopPropagation() {\n this.propagationEnabled = false;\n }\n}\n\nexport class Tappable extends React.Component<TappableProps, any> {\n private lastPress = 0;\n private lastTap = 0;\n private lastDoubleTap = 0;\n private isLongTap = false;\n private parent:Tappable = null as any;\n \n constructor(props: any) {\n super(props);\n }\n\n async triggerTap(e = new SyntheticEvent()) {\n if (!e.propagationEnabled) {\n return;\n }\n const target = this.props.target;\n if (this.props.onTap) {\n await this.props.onTap(e);\n } else {\n await target?.invokeEventCallback('onTap', [e, target]);\n }\n this.parent?.triggerTap(e);\n }\n\n onPress(e: SyntheticEvent): void { \n this.lastPress = Date.now();\n const target = this.props.target;\n this.props.onTouchStart && this.props.onTouchStart(e);\n this.props.target?.invokeEventCallback('onTouchstart', [e, this.props.target]);\n const currentTime = Date.now();\n const tapDelta = currentTime - this.lastTap;\n if (this.isLongTap) {\n this.isLongTap = false;\n return;\n }\n if (e.propagationEnabled) {\n injector.FOCUSED_ELEMENT.get()?.blur();\n if(this.lastDoubleTap !== this.lastTap \n && tapDelta < 500) {\n this.props.onDoubleTap && this.props.onDoubleTap(e);\n setTimeout(() => {\n target?.invokeEventCallback('onDoubletap', [e, target]);\n }, 200);\n this.lastDoubleTap = currentTime;\n }\n setTimeout(() => {\n if (!e.propagationEnabled) {\n return;\n }\n if (this.props.onTap) {\n this.props.onTap(e);\n } else {\n target?.invokeEventCallback('onTap', [e, target]);\n }\n this.parent?.onPress(e);\n }, 200);\n this.lastTap = currentTime;\n }\n }\n\n onLongTap(e: SyntheticEvent): void {\n if(!e.propagationEnabled){\n return;\n }\n this.props.onLongTap && this.props.onLongTap(e);\n setTimeout(() => {\n this.props.target?.invokeEventCallback('onLongtap', [e, this.props.target]);\n this.parent?.onPressOut(e);\n }, 200);\n this.isLongTap = true;\n }\n \n onPressOut(e: SyntheticEvent): void {\n if(!e.propagationEnabled){\n return;\n } \n this.props.onTouchEnd && this.props.onTouchEnd(e);\n setTimeout(() => {\n this.props.target?.invokeEventCallback('onTouchend', [e, this.props.target]);\n this.parent?.onPressOut(e);\n }, 200);\n this.isLongTap = false;\n }\n private setParent(parent: Tappable) {\n if (parent && this.parent !== parent) {\n this.parent = parent;\n }\n }\n\n render() {\n const target = this.props.target;\n const commonProps = {\n ...(Platform.OS === 'android' || Platform.OS === 'web') ? {\n accessibilityLabel: this.props.testID,\n testID: this.props.testID\n }: {\n // accessible: false,\n testID: this.props.testID\n },\n ...this.props.accessibilityProps,\n disabled:get(target?.proxy, 'disabled'),\n style:this.props.styles,\n onPress:(e?: GestureResponderEvent) => {\n if ((e?.target as any)?.tagName === 'INPUT') {\n return;\n }\n this.onPress(new SyntheticEvent())\n },\n onLongPress:(e?: GestureResponderEvent) => this.onLongTap(new SyntheticEvent()),\n onPressOut:(e?: GestureResponderEvent) => this.onPressOut(new SyntheticEvent())\n };\n if (target?.props.onTap \n || target?.props.onLongtap \n || target?.props.onDoubletap \n || this.props.onTap \n || this.props.onLongTap \n || this.props.onDoubleTap) {\n return (\n <UIPreferencesConsumer>\n {(preferences: UI_PREFERENCES) => {\n return preferences.enableRipple != false ? (\n <ParentTappableContext.Consumer>{(parent) => {\n this.setParent(parent);\n return(\n <ParentTappableContext.Provider value={this}>\n <TouchableRipple \n rippleColor={this.props.disableTouchEffect ? \"transparent\" : this.props.rippleColor} \n borderless={true} \n {...commonProps}\n onLayout={this.props.onLayout}\n >\n <>{this.props.children}</>\n </TouchableRipple>\n </ParentTappableContext.Provider>\n )\n }}</ParentTappableContext.Consumer>): (\n //default value is 0.2\n <TouchableOpacity \n activeOpacity={this.props.disableTouchEffect ? 1 : 0.2} \n onLayout={this.props.onLayout}\n {...commonProps}\n >\n <>{this.props.children}</>\n </TouchableOpacity>);\n }}\n </UIPreferencesConsumer>\n );\n }\n return (\n <View \n style={this.props.styles}\n onLayout={this.props.onLayout}\n {...this.props.accessibilityProps}\n >\n {this.props.children}\n </View>);\n }\n}\n"],"mappings":";;;;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAgCC,QAAQ,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AACtF,SAASC,GAAG,QAAQ,QAAQ;AAC5B,OAAOC,QAAQ,MAAM,YAAY;AACjC,SAASC,eAAe,QAAQ,oBAAoB;AAIpD,OAAO,MAAMC,eAAe,gBAAGP,KAAK,CAACQ,aAAa,CAAW,IAAW,CAAC;AACzE,SAASC,qBAAqB,QAAwB,0BAA0B;AAEhF,OAAO,MAAMC,qBAAqB,gBAAGV,KAAK,CAACQ,aAAa,CAAW,IAAW,CAAC;AAiB/E,OAAO,MAAMG,cAAc,CAAC;EAIxBC,WAAWA,CAAA,EAAG;IAHd;IAAAC,eAAA,6BACqB,IAAI;EAIzB;EAEAC,eAAeA,CAAA,EAAG;IACd,IAAI,CAACC,kBAAkB,GAAG,KAAK;EACnC;AACJ;AAEA,OAAO,MAAMC,QAAQ,SAAShB,KAAK,CAACiB,SAAS,CAAqB;EAO9DL,WAAWA,CAACM,KAAU,EAAE;IACpB,KAAK,CAACA,KAAK,CAA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CAAA6E,QAAA,QAAG,IAAI,CAAC3D,KAAK,CAAC4D,QAAW,CACX,CAAE;MAC5B,CACmB,CAAC;IAE5B;IACA,oBACI9E,KAAA,CAAAkE,aAAA,CAAChE,IAAI,EAAAsE,QAAA;MACDb,KAAK,EAAE,IAAI,CAACzC,KAAK,CAAC0C,MAAO;MACzBgB,QAAQ,EAAE,IAAI,CAAC1D,KAAK,CAAC0D;IAAS,GAC1B,IAAI,CAAC1D,KAAK,CAACsC,kBAAkB,GAEhC,IAAI,CAACtC,KAAK,CAAC4D,QACV,CAAC;EACf;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Platform","View","TouchableOpacity","get","injector","TouchableRipple","TappableContext","createContext","UIPreferencesConsumer","ParentTappableContext","SyntheticEvent","constructor","_defineProperty","stopPropagation","propagationEnabled","Tappable","Component","props","triggerTap","e","_this$parent","target","onTap","invokeEventCallback","parent","onPress","_this$props$target","lastPress","Date","now","onTouchStart","currentTime","tapDelta","lastTap","isLongTap","_injector$FOCUSED_ELE","FOCUSED_ELEMENT","blur","lastDoubleTap","onDoubleTap","setTimeout","_this$parent2","onLongTap","_this$props$target2","_this$parent3","onPressOut","onTouchEnd","_this$props$target3","_this$parent4","setParent","render","commonProps","OS","accessibilityLabel","testID","accessible","accessibilityProps","disabled","proxy","style","styles","_e$target","tagName","onLongPress","onLongtap","onDoubletap","createElement","preferences","enableRipple","Consumer","Provider","value","_extends","rippleColor","disableTouchEffect","borderless","onLayout","Fragment","children","activeOpacity"],"sources":["tappable.component.tsx"],"sourcesContent":["import { BaseComponent } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport React from \"react\";\nimport { GestureResponderEvent, Platform, View, TouchableOpacity } from \"react-native\";\nimport { get } from \"lodash\";\nimport injector from \"./injector\";\nimport { TouchableRipple } from \"react-native-paper\";\nimport ThemeVariables from \"../styles/theme.variables\";\nimport { isDefined } from \"./utils\";\n\nexport const TappableContext = React.createContext<Tappable>(null as any);\nimport { UIPreferencesConsumer, UI_PREFERENCES } from \"./ui-preferences.context\";\n\nexport const ParentTappableContext = React.createContext<Tappable>(null as any);\ninterface TappableProps {\n testID?: string;\n children?: any\n styles?: any;\n target?: BaseComponent<any, any, any>;\n onTap?: (e: any) => void;\n onLongTap?: (e: any) => void; \n onDoubleTap?: (e: any) => void;\n onTouchStart? : (e: any) => void;\n onTouchEnd? : (e: any) => void;\n rippleColor?: string;\n accessibilityProps?: any;\n disableTouchEffect?:boolean;\n onLayout?: any;\n}\n\nexport class SyntheticEvent {\n // as the event is being used in onPress, onPressOut and onLongTap the TapEvent is renamed to SyntheticEvent\n propagationEnabled = true;\n \n constructor() {\n\n }\n\n stopPropagation() {\n this.propagationEnabled = false;\n }\n}\n\nexport class Tappable extends React.Component<TappableProps, any> {\n private lastPress = 0;\n private lastTap = 0;\n private lastDoubleTap = 0;\n private isLongTap = false;\n private parent:Tappable = null as any;\n \n constructor(props: any) {\n super(props);\n }\n\n async triggerTap(e = new SyntheticEvent()) {\n if (!e.propagationEnabled) {\n return;\n }\n const target = this.props.target;\n if (this.props.onTap) {\n await this.props.onTap(e);\n } else {\n await target?.invokeEventCallback('onTap', [e, target]);\n }\n this.parent?.triggerTap(e);\n }\n\n onPress(e: SyntheticEvent): void { \n this.lastPress = Date.now();\n const target = this.props.target;\n this.props.onTouchStart && this.props.onTouchStart(e);\n this.props.target?.invokeEventCallback('onTouchstart', [e, this.props.target]);\n const currentTime = Date.now();\n const tapDelta = currentTime - this.lastTap;\n if (this.isLongTap) {\n this.isLongTap = false;\n return;\n }\n if (e.propagationEnabled) {\n injector.FOCUSED_ELEMENT.get()?.blur();\n if(this.lastDoubleTap !== this.lastTap \n && tapDelta < 500) {\n this.props.onDoubleTap && this.props.onDoubleTap(e);\n setTimeout(() => {\n target?.invokeEventCallback('onDoubletap', [e, target]);\n }, 200);\n this.lastDoubleTap = currentTime;\n }\n setTimeout(() => {\n if (!e.propagationEnabled) {\n return;\n }\n if (this.props.onTap) {\n this.props.onTap(e);\n } else {\n target?.invokeEventCallback('onTap', [e, target]);\n }\n this.parent?.onPress(e);\n }, 200);\n this.lastTap = currentTime;\n }\n }\n\n onLongTap(e: SyntheticEvent): void {\n if(!e.propagationEnabled){\n return;\n }\n this.props.onLongTap && this.props.onLongTap(e);\n setTimeout(() => {\n this.props.target?.invokeEventCallback('onLongtap', [e, this.props.target]);\n this.parent?.onPressOut(e);\n }, 200);\n this.isLongTap = true;\n }\n \n onPressOut(e: SyntheticEvent): void {\n if(!e.propagationEnabled){\n return;\n } \n this.props.onTouchEnd && this.props.onTouchEnd(e);\n setTimeout(() => {\n this.props.target?.invokeEventCallback('onTouchend', [e, this.props.target]);\n this.parent?.onPressOut(e);\n }, 200);\n this.isLongTap = false;\n }\n private setParent(parent: Tappable) {\n if (parent && this.parent !== parent) {\n this.parent = parent;\n }\n }\n\n render() {\n const target = this.props.target;\n const commonProps = {\n ...(Platform.OS === 'android' || Platform.OS === 'web') ? {\n accessibilityLabel: this.props.testID,\n testID: this.props.testID\n }: {\n accessible: false,\n testID: this.props.testID\n },\n ...this.props.accessibilityProps,\n disabled:get(target?.proxy, 'disabled'),\n style:this.props.styles,\n onPress:(e?: GestureResponderEvent) => {\n if ((e?.target as any)?.tagName === 'INPUT') {\n return;\n }\n this.onPress(new SyntheticEvent())\n },\n onLongPress:(e?: GestureResponderEvent) => this.onLongTap(new SyntheticEvent()),\n onPressOut:(e?: GestureResponderEvent) => this.onPressOut(new SyntheticEvent())\n };\n if (target?.props.onTap \n || target?.props.onLongtap \n || target?.props.onDoubletap \n || this.props.onTap \n || this.props.onLongTap \n || this.props.onDoubleTap) {\n return (\n <UIPreferencesConsumer>\n {(preferences: UI_PREFERENCES) => {\n return preferences.enableRipple != false ? (\n <ParentTappableContext.Consumer>{(parent) => {\n this.setParent(parent);\n return(\n <ParentTappableContext.Provider value={this}>\n <TouchableRipple \n rippleColor={this.props.disableTouchEffect ? \"transparent\" : this.props.rippleColor} \n borderless={true} \n {...commonProps}\n onLayout={this.props.onLayout}\n >\n <>{this.props.children}</>\n </TouchableRipple>\n </ParentTappableContext.Provider>\n )\n }}</ParentTappableContext.Consumer>): (\n //default value is 0.2\n <TouchableOpacity \n activeOpacity={this.props.disableTouchEffect ? 1 : 0.2} \n onLayout={this.props.onLayout}\n {...commonProps}\n >\n <>{this.props.children}</>\n </TouchableOpacity>);\n }}\n </UIPreferencesConsumer>\n );\n }\n return (\n <View \n style={this.props.styles}\n onLayout={this.props.onLayout}\n {...this.props.accessibilityProps}\n >\n {this.props.children}\n </View>);\n }\n}\n"],"mappings":";;;;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAgCC,QAAQ,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AACtF,SAASC,GAAG,QAAQ,QAAQ;AAC5B,OAAOC,QAAQ,MAAM,YAAY;AACjC,SAASC,eAAe,QAAQ,oBAAoB;AAIpD,OAAO,MAAMC,eAAe,gBAAGP,KAAK,CAACQ,aAAa,CAAW,IAAW,CAAC;AACzE,SAASC,qBAAqB,QAAwB,0BAA0B;AAEhF,OAAO,MAAMC,qBAAqB,gBAAGV,KAAK,CAACQ,aAAa,CAAW,IAAW,CAAC;AAiB/E,OAAO,MAAMG,cAAc,CAAC;EAIxBC,WAAWA,CAAA,EAAG;IAHd;IAAAC,eAAA,6BACqB,IAAI;EAIzB;EAEAC,eAAeA,CAAA,EAAG;IACd,IAAI,CAACC,kBAAkB,GAAG,KAAK;EACnC;AACJ;AAEA,OAAO,MAAMC,QAAQ,SAAShB,KAAK,CAACiB,SAAS,CAAqB;EAO9DL,WAAWA,CAACM,KAAU,EAAE;IACpB,KAAK,CAACA,KAAK,CAAC;IAACL,eAAA,oBAPG,CAAC;IAAAA,eAAA,kBACH,CAAC;IAAAA,eAAA,wBACK,CAAC;IAAAA,eAAA,oBACL,KAAK;IAAAA,eAAA,iBACC,IAAI;EAI9B;EAEA,MAAMM,UAAUA,CAACC,CAAC,GAAG,IAAIT,cAAc,CAAC,CAAC,EAA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C1C,KAAK,CAAC2C,MAAO;MACzBgB,QAAQ,EAAE,IAAI,CAAC3D,KAAK,CAAC2D;IAAS,GAC1B,IAAI,CAAC3D,KAAK,CAACuC,kBAAkB,GAEhC,IAAI,CAACvC,KAAK,CAAC6D,QACV,CAAC;EACf;AACJ","ignoreList":[]}
|
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,OA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,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,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C,IAAI,CAAC5G,KAAK,CAACyH,aAAa,GAAG;YAC/BC,QAAQ,EAAE,IAAI,CAAC1H,KAAK,CAACyH;UACzB,CAAC,GAAG;YACA1D,KAAK,EAAE,IAAI,CAAC/D,KAAK,CAAC2H;UACtB,CAAC,EACD,EAAAJ,iBAAA,OAAI,CAACvH,KAAK,CAAC4G,KAAK,cAAAW,iBAAA,uBAAhBA,iBAAA,CAAkBtD,MAAM,MAAK,MAAM,GAAG;YAClCA,MAAM,EAAE;UACZ,CAAC,GAAG,IAAI,EACR;YACI2D,SAAS,EAAE,IAAI,CAAC1G,KAAK,CAACC,YAAY,GAAG,CAAC;cAClC0G,UAAU,EAAE,IAAI,CAAClG;YACrB,CAAC,CAAC,GAAG,CAAC;cACFmG,UAAU,EAAE,IAAI,CAACnG;YACrB,CAAC;UACL,CAAC;QACC,GACD0F,CACU,CAAC;MACpB,CAAC,CACG;IAAC;EAEjB;AAEJ;AAAC5H,eAAA,CA3NYN,IAAI,kBAES,IAAIO,KAAK,CAAC,CAAC","ignoreList":[]}
|
|
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","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,KAA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