@lichens-innovation/react-native-common 2.11.0 → 2.12.0
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/LICENSE +21 -0
- package/README.md +12 -3
- package/dist/components/battery/battery.utils.js +1 -2
- package/dist/components/battery/battery.utils.js.map +1 -1
- package/dist/components/code-scanner/barcode-scanner.utils.js +1 -1
- package/dist/components/code-scanner/barcode-scanner.utils.js.map +1 -1
- package/dist/components/error/use-error-details.js +1 -1
- package/dist/components/error/use-error-details.js.map +1 -1
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.js +1 -0
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/resizable/index.d.ts +4 -0
- package/dist/components/layout/resizable/index.js +5 -0
- package/dist/components/layout/resizable/index.js.map +1 -0
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.d.ts +3 -0
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.js +121 -0
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.js.map +1 -0
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.types.d.ts +22 -0
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.types.js +1 -0
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.types.js.map +1 -0
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.utils.d.ts +2 -0
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.utils.js +31 -0
- package/dist/components/layout/resizable/vertical-resizable-overlay-view.utils.js.map +1 -0
- package/dist/components/layout/resizable/vertical-resizable-split-view.d.ts +3 -0
- package/dist/components/layout/resizable/vertical-resizable-split-view.js +79 -0
- package/dist/components/layout/resizable/vertical-resizable-split-view.js.map +1 -0
- package/dist/components/layout/resizable/vertical-resizable-split-view.types.d.ts +20 -0
- package/dist/components/layout/resizable/vertical-resizable-split-view.types.js +1 -0
- package/dist/components/layout/resizable/vertical-resizable-split-view.types.js.map +1 -0
- package/dist/components/layout/resizable/vertical-resizable-split-view.utils.d.ts +2 -0
- package/dist/components/layout/resizable/vertical-resizable-split-view.utils.js +23 -0
- package/dist/components/layout/resizable/vertical-resizable-split-view.utils.js.map +1 -0
- package/dist/components/score-indicator/score-indicator.js +1 -1
- package/dist/components/score-indicator/score-indicator.js.map +1 -1
- package/dist/components/spinner/activity-progress.utils.js +1 -1
- package/dist/components/spinner/activity-progress.utils.js.map +1 -1
- package/dist/hooks/use-updates.js +1 -1
- package/dist/hooks/use-updates.js.map +1 -1
- package/dist/logger/logger.js +1 -1
- package/dist/logger/logger.js.map +1 -1
- package/dist/services/files/native-file-system.js +1 -1
- package/dist/services/files/native-file-system.js.map +1 -1
- package/dist/services/wifi/use-wifi-info.js +1 -1
- package/dist/services/wifi/use-wifi-info.js.map +1 -1
- package/dist/services/wifi/wifi-info.types.js +1 -1
- package/dist/services/wifi/wifi-info.types.js.map +1 -1
- package/dist/services/wifi/wifi-info.utils.simulator.js +1 -1
- package/dist/services/wifi/wifi-info.utils.simulator.js.map +1 -1
- package/dist/utils/axios.config.js +2 -2
- package/dist/utils/axios.config.js.map +1 -1
- package/dist/utils/date.utils.d.ts +0 -4
- package/dist/utils/date.utils.js +0 -5
- package/dist/utils/date.utils.js.map +1 -1
- package/dist/utils/errors.utils.d.ts +0 -1
- package/dist/utils/errors.utils.js +1 -12
- package/dist/utils/errors.utils.js.map +1 -1
- package/dist/utils/file.utils.js +1 -1
- package/dist/utils/file.utils.js.map +1 -1
- package/dist/utils/index.d.ts +0 -7
- package/dist/utils/index.js +0 -7
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/network.utils.js +1 -2
- package/dist/utils/network.utils.js.map +1 -1
- package/dist/utils/sqlite.utils.js +1 -2
- package/dist/utils/sqlite.utils.js.map +1 -1
- package/dist/utils/storage.windows.js +1 -1
- package/dist/utils/storage.windows.js.map +1 -1
- package/package.json +7 -4
- package/dist/utils/color.utils.d.ts +0 -1
- package/dist/utils/color.utils.js +0 -27
- package/dist/utils/color.utils.js.map +0 -1
- package/dist/utils/http.utils.d.ts +0 -3
- package/dist/utils/http.utils.js +0 -20
- package/dist/utils/http.utils.js.map +0 -1
- package/dist/utils/number.utils.d.ts +0 -1
- package/dist/utils/number.utils.js +0 -13
- package/dist/utils/number.utils.js.map +0 -1
- package/dist/utils/regex.d.ts +0 -2
- package/dist/utils/regex.js +0 -3
- package/dist/utils/regex.js.map +0 -1
- package/dist/utils/string.utils.d.ts +0 -16
- package/dist/utils/string.utils.js +0 -30
- package/dist/utils/string.utils.js.map +0 -1
- package/dist/utils/thread.utils.d.ts +0 -1
- package/dist/utils/thread.utils.js +0 -2
- package/dist/utils/thread.utils.js.map +0 -1
- package/dist/utils/time.utils.d.ts +0 -12
- package/dist/utils/time.utils.js +0 -13
- package/dist/utils/time.utils.js.map +0 -1
- package/dist/utils/types.utils.d.ts +0 -4
- package/dist/utils/types.utils.js +0 -24
- package/dist/utils/types.utils.js.map +0 -1
- package/dist/utils/uri.utils.d.ts +0 -11
- package/dist/utils/uri.utils.js +0 -19
- package/dist/utils/uri.utils.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Lichens Innovation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ Table of content
|
|
|
18
18
|
|
|
19
19
|
- [React Native Common Module](#react-native-common-module)
|
|
20
20
|
- [Reusable Components](#reusable-components)
|
|
21
|
+
- [Examples](#examples)
|
|
21
22
|
- [Services, Utilities and Hooks](#services-utilities-and-hooks)
|
|
22
23
|
- [Consume in a project](#consume-in-a-project)
|
|
23
24
|
- [Adding the dependency to an existing mobile application](#adding-the-dependency-to-an-existing-mobile-application)
|
|
@@ -42,6 +43,14 @@ Table of content
|
|
|
42
43
|
- various interactive components (dropdowns, bottom sheets, etc.)
|
|
43
44
|
- global theme and light/dark modes support
|
|
44
45
|
|
|
46
|
+
### Examples
|
|
47
|
+
|
|
48
|
+
| Vertical Split View | Dialog Ok/Cancel |
|
|
49
|
+
|:-------------------:|:----------------:|
|
|
50
|
+
| <img src="docs/demos/demo-vertical-split-view.gif" width="200" /> | <img src="docs/demos/demo-dialog-ok-cancel.gif" width="200" /> |
|
|
51
|
+
|
|
52
|
+
- [Components Catalog](docs/catalog.md)
|
|
53
|
+
|
|
45
54
|
## Services, Utilities and Hooks
|
|
46
55
|
|
|
47
56
|
- `@tanstack/react-query` hooks
|
|
@@ -72,7 +81,7 @@ Depending on your Expo SDK version, here are the compatibility table for `react-
|
|
|
72
81
|
The following will install the latest available version on your react-native app:
|
|
73
82
|
|
|
74
83
|
```bash
|
|
75
|
-
yarn add @
|
|
84
|
+
yarn add @lichens-Innovation/react-native-common
|
|
76
85
|
```
|
|
77
86
|
|
|
78
87
|
### Basic Usage Example
|
|
@@ -80,7 +89,7 @@ yarn add @Lichens-Innovation/react-native-common
|
|
|
80
89
|
Here's how to import and use the `DialogOkCancel` component:
|
|
81
90
|
|
|
82
91
|
```tsx
|
|
83
|
-
import { DialogOkCancel } from '@
|
|
92
|
+
import { DialogOkCancel } from '@lichens-Innovation/react-native-common';
|
|
84
93
|
import React, { useState } from 'react';
|
|
85
94
|
import { Button } from 'react-native-paper';
|
|
86
95
|
|
|
@@ -191,4 +200,4 @@ Adhering to established coding guidelines is essential for developing efficient,
|
|
|
191
200
|
|
|
192
201
|
## License
|
|
193
202
|
|
|
194
|
-
This project is
|
|
203
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { getColorForPercentage } from '
|
|
2
|
-
import { isNullish } from '../../utils/types.utils';
|
|
1
|
+
import { getColorForPercentage, isNullish } from '@lichens-innovation/ts-common';
|
|
3
2
|
export const getBatteryIcon = (level) => {
|
|
4
3
|
if (isNullish(level))
|
|
5
4
|
return 'battery-alert-variant-outline';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"battery.utils.js","sourceRoot":"","sources":["../../../src/components/battery/battery.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"battery.utils.js","sourceRoot":"","sources":["../../../src/components/battery/battery.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAEjF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAqB,EAAE,EAAE;IACtD,IAAI,SAAS,CAAC,KAAK,CAAC;QAAE,OAAO,+BAA+B,CAAC;IAE7D,IAAI,KAAK,IAAI,EAAE;QAAE,OAAO,SAAS,CAAC;IAClC,IAAI,KAAK,IAAI,EAAE;QAAE,OAAO,YAAY,CAAC;IACrC,IAAI,KAAK,IAAI,EAAE;QAAE,OAAO,YAAY,CAAC;IACrC,IAAI,KAAK,IAAI,EAAE;QAAE,OAAO,YAAY,CAAC;IACrC,IAAI,KAAK,IAAI,EAAE;QAAE,OAAO,YAAY,CAAC;IACrC,IAAI,KAAK,IAAI,EAAE;QAAE,OAAO,YAAY,CAAC;IACrC,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,YAAY,CAAC;IAEnC,OAAO,4BAA4B,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,YAA4B,EAAE,EAAE;IAC9D,OAAO,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,YAAY,GAAG,GAAG,CAAC,CAAC;AACtF,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { isNullish } from '@lichens-innovation/ts-common';
|
|
1
2
|
import { Camera } from 'expo-camera';
|
|
2
3
|
import i18next from 'i18next';
|
|
3
4
|
import { logger } from '../../logger/logger';
|
|
4
|
-
import { isNullish } from '../../utils/types.utils';
|
|
5
5
|
export const BARCODE_TYPES = [
|
|
6
6
|
'aztec',
|
|
7
7
|
'ean13',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"barcode-scanner.utils.js","sourceRoot":"","sources":["../../../src/components/code-scanner/barcode-scanner.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,OAAO,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"barcode-scanner.utils.js","sourceRoot":"","sources":["../../../src/components/code-scanner/barcode-scanner.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAe,MAAM,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,MAAM,CAAC,MAAM,aAAa,GAAkB;IAC1C,OAAO;IACP,OAAO;IACP,MAAM;IACN,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,SAAS;IACT,SAAS;IACT,OAAO;CACR,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,aAA8B,EAAU,EAAE;IAC7E,IAAI,SAAS,CAAC,aAAa,CAAC,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAC,CAAC,CAAC,kDAAkD,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,aAAa;QAClB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,2CAA2C,CAAC;QACxD,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,IAAsB,EAAE;IACnE,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,6BAA6B,EAAE,CAAC;QAChE,OAAO,MAAM,KAAK,SAAS,CAAC;IAC9B,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QACpB,MAAM,CAAC,KAAK,CAAC,uDAAuD,EAAE,CAAC,CAAC,CAAC;QACzE,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { getErrorMessage } from '@lichens-innovation/ts-common';
|
|
1
2
|
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import uuid from 'react-native-uuid';
|
|
3
|
-
import { getErrorMessage } from '../../utils/errors.utils';
|
|
4
4
|
export const useErrorDetails = (error) => {
|
|
5
5
|
const { t } = useTranslation();
|
|
6
6
|
const id = uuid.v4();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-error-details.js","sourceRoot":"","sources":["../../../src/components/error/use-error-details.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"use-error-details.js","sourceRoot":"","sources":["../../../src/components/error/use-error-details.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,IAAI,MAAM,mBAAmB,CAAC;AAErC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAc,EAAE,EAAE;IAChD,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAC;IAE/B,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACrB,MAAM,KAAK,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC;IAChC,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC;IACrD,MAAM,WAAW,GAAG,CAAC,CAAC,4BAA4B,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtE,MAAM,KAAK,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAExD,OAAO;QACL,EAAE;QACF,KAAK;QACL,QAAQ;QACR,WAAW;QACX,KAAK;KACN,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/layout/resizable/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
5
|
+
import Animated, { useAnimatedStyle, useSharedValue, withSpring } from 'react-native-reanimated';
|
|
6
|
+
import { isDevelopment } from '../../../utils';
|
|
7
|
+
import { validateResizableOverlayProps } from './vertical-resizable-overlay-view.utils';
|
|
8
|
+
const DRAG_HANDLE_HEIGHT = 20;
|
|
9
|
+
const DEFAULT_ANIMATION_CONFIG = { damping: 25, stiffness: 300, mass: 0.8 };
|
|
10
|
+
export const VerticalResizableOverlayView = (props) => {
|
|
11
|
+
if (isDevelopment())
|
|
12
|
+
validateResizableOverlayProps(props);
|
|
13
|
+
const { foregroundContent, backgroundContent, initialForegroundRatio = 0.5, minForegroundRatio = 0.15, maxForegroundRatio = 0.85, foregroundContentAspectRatio, handleContainerStyle, handleStyle, hideHandle = false, } = props;
|
|
14
|
+
// Track measured container height
|
|
15
|
+
const [isReady, setIsReady] = useState(false);
|
|
16
|
+
// Shared values for animation
|
|
17
|
+
const overlayHeight = useSharedValue(0);
|
|
18
|
+
const containerWidth = useSharedValue(0);
|
|
19
|
+
const minHeight = useSharedValue(0);
|
|
20
|
+
const maxHeight = useSharedValue(0);
|
|
21
|
+
const startY = useSharedValue(0);
|
|
22
|
+
const isDragging = useSharedValue(false);
|
|
23
|
+
// Handle container layout measurement
|
|
24
|
+
const handleLayout = useCallback((event) => {
|
|
25
|
+
const { height, width } = event.nativeEvent.layout;
|
|
26
|
+
if (height > 0 && !isReady) {
|
|
27
|
+
minHeight.value = height * minForegroundRatio;
|
|
28
|
+
maxHeight.value = height * maxForegroundRatio;
|
|
29
|
+
overlayHeight.value = height * initialForegroundRatio;
|
|
30
|
+
containerWidth.value = width;
|
|
31
|
+
setIsReady(true);
|
|
32
|
+
}
|
|
33
|
+
}, [
|
|
34
|
+
minForegroundRatio,
|
|
35
|
+
maxForegroundRatio,
|
|
36
|
+
initialForegroundRatio,
|
|
37
|
+
minHeight,
|
|
38
|
+
maxHeight,
|
|
39
|
+
overlayHeight,
|
|
40
|
+
containerWidth,
|
|
41
|
+
isReady,
|
|
42
|
+
]);
|
|
43
|
+
const panGesture = Gesture.Pan()
|
|
44
|
+
.onStart(() => {
|
|
45
|
+
startY.value = overlayHeight.value;
|
|
46
|
+
isDragging.value = true;
|
|
47
|
+
})
|
|
48
|
+
.onUpdate((event) => {
|
|
49
|
+
const newHeight = startY.value + event.translationY;
|
|
50
|
+
overlayHeight.value = Math.max(minHeight.value, Math.min(newHeight, maxHeight.value));
|
|
51
|
+
})
|
|
52
|
+
.onEnd(() => {
|
|
53
|
+
isDragging.value = false;
|
|
54
|
+
});
|
|
55
|
+
const overlayAnimatedStyle = useAnimatedStyle(() => {
|
|
56
|
+
let height = overlayHeight.value;
|
|
57
|
+
let width;
|
|
58
|
+
if (foregroundContentAspectRatio !== undefined) {
|
|
59
|
+
const calculatedWidth = height * foregroundContentAspectRatio;
|
|
60
|
+
if (calculatedWidth > containerWidth.value) {
|
|
61
|
+
// Width exceeds container, recalculate height to maintain aspect ratio
|
|
62
|
+
width = containerWidth.value;
|
|
63
|
+
height = Math.max(containerWidth.value / foregroundContentAspectRatio, minHeight.value);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
width = calculatedWidth;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return width !== undefined ? { height, width } : { height };
|
|
70
|
+
});
|
|
71
|
+
const dragHandleContainerAnimatedStyle = useAnimatedStyle(() => {
|
|
72
|
+
let effectiveHeight = overlayHeight.value;
|
|
73
|
+
let effectiveWidth = containerWidth.value;
|
|
74
|
+
if (foregroundContentAspectRatio !== undefined) {
|
|
75
|
+
const calculatedWidth = effectiveHeight * foregroundContentAspectRatio;
|
|
76
|
+
if (calculatedWidth > containerWidth.value) {
|
|
77
|
+
effectiveHeight = Math.max(containerWidth.value / foregroundContentAspectRatio, minHeight.value);
|
|
78
|
+
effectiveWidth = containerWidth.value;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
effectiveWidth = calculatedWidth;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
top: effectiveHeight - DRAG_HANDLE_HEIGHT / 2,
|
|
86
|
+
right: 0,
|
|
87
|
+
width: effectiveWidth,
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
const dragHandleAnimatedStyle = useAnimatedStyle(() => ({
|
|
91
|
+
transform: [{ scale: withSpring(isDragging.value ? 1.2 : 1, DEFAULT_ANIMATION_CONFIG) }],
|
|
92
|
+
}));
|
|
93
|
+
return (_jsxs(View, { style: [styles.container], onLayout: handleLayout, children: [_jsx(View, { style: styles.backgroundSection, children: backgroundContent }), _jsx(Animated.View, { style: [styles.overlaySection, overlayAnimatedStyle], children: foregroundContent }), !hideHandle && (_jsx(GestureDetector, { gesture: panGesture, children: _jsx(Animated.View, { style: [styles.handleContainer, handleContainerStyle, dragHandleContainerAnimatedStyle], children: _jsx(Animated.View, { style: [styles.handle, handleStyle, dragHandleAnimatedStyle] }) }) }))] }));
|
|
94
|
+
};
|
|
95
|
+
const styles = StyleSheet.create({
|
|
96
|
+
container: {
|
|
97
|
+
flex: 1,
|
|
98
|
+
},
|
|
99
|
+
backgroundSection: {
|
|
100
|
+
flex: 1,
|
|
101
|
+
},
|
|
102
|
+
overlaySection: {
|
|
103
|
+
position: 'absolute',
|
|
104
|
+
top: 0,
|
|
105
|
+
right: 0,
|
|
106
|
+
overflow: 'hidden',
|
|
107
|
+
},
|
|
108
|
+
handleContainer: {
|
|
109
|
+
position: 'absolute',
|
|
110
|
+
height: DRAG_HANDLE_HEIGHT,
|
|
111
|
+
alignItems: 'center',
|
|
112
|
+
justifyContent: 'center',
|
|
113
|
+
},
|
|
114
|
+
handle: {
|
|
115
|
+
width: 40,
|
|
116
|
+
height: 4,
|
|
117
|
+
backgroundColor: '#888888',
|
|
118
|
+
borderRadius: 4,
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
//# sourceMappingURL=vertical-resizable-overlay-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical-resizable-overlay-view.js","sourceRoot":"","sources":["../../../../src/components/layout/resizable/vertical-resizable-overlay-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAA0B,MAAM,OAAO,CAAC;AACtE,OAAO,EAAqB,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,QAAQ,EAAE,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAExF,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,wBAAwB,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AAE5E,MAAM,CAAC,MAAM,4BAA4B,GAAyD,CAAC,KAAK,EAAE,EAAE;IAC1G,IAAI,aAAa,EAAE;QAAE,6BAA6B,CAAC,KAAK,CAAC,CAAC;IAE1D,MAAM,EACJ,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,GAAG,G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I,CACd,KAAC,eAAe,IAAC,OAAO,EAAE,UAAU,YAClC,KAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,eAAe,EAAE,oBAAoB,EAAE,gCAAgC,CAAC,YACpG,KAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,uBAAuB,CAAC,GAAI,GACjE,GACA,CACnB,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;KACR;IACD,iBAAiB,EAAE;QACjB,IAAI,EAAE,CAAC;KACR;IACD,cAAc,EAAE;QACd,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,QAAQ;KACnB;IACD,eAAe,EAAE;QACf,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,kBAAkB;QAC1B,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,CAAC;QACT,eAAe,EAAE,SAAS;QAC1B,YAAY,EAAE,CAAC;KAChB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ViewStyle } from 'react-native';
|
|
3
|
+
export interface VerticalResizableOverlayViewProps {
|
|
4
|
+
/** Content to display in the overlay section (foreground, on top) */
|
|
5
|
+
foregroundContent: ReactNode;
|
|
6
|
+
/** Content to display in the background section (fills the entire container) */
|
|
7
|
+
backgroundContent: ReactNode;
|
|
8
|
+
/** Initial height ratio for the foreground overlay (0 to 1). Default: 0.5 */
|
|
9
|
+
initialForegroundRatio?: number;
|
|
10
|
+
/** Minimum height ratio for the foreground overlay (0 to 1). Default: 0.15 */
|
|
11
|
+
minForegroundRatio?: number;
|
|
12
|
+
/** Maximum height ratio for the foreground overlay (0 to 1). Default: 0.85 */
|
|
13
|
+
maxForegroundRatio?: number;
|
|
14
|
+
/** Aspect ratio (width/height) for the foreground content. If provided, width will be calculated based on height */
|
|
15
|
+
foregroundContentAspectRatio?: number;
|
|
16
|
+
/** Style for the drag handle container */
|
|
17
|
+
handleContainerStyle?: ViewStyle;
|
|
18
|
+
/** Style for the drag handle bar */
|
|
19
|
+
handleStyle?: ViewStyle;
|
|
20
|
+
/** Whether to hide the drag handle. Default: false */
|
|
21
|
+
hideHandle?: boolean;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=vertical-resizable-overlay-view.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical-resizable-overlay-view.types.js","sourceRoot":"","sources":["../../../../src/components/layout/resizable/vertical-resizable-overlay-view.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isNullish } from '@lichens-innovation/ts-common';
|
|
2
|
+
export const validateResizableOverlayProps = (props) => {
|
|
3
|
+
const { foregroundContentAspectRatio, initialForegroundRatio, minForegroundRatio, maxForegroundRatio } = props;
|
|
4
|
+
if (!isNullish(foregroundContentAspectRatio)) {
|
|
5
|
+
if (foregroundContentAspectRatio <= 0)
|
|
6
|
+
throw new Error('foregroundContentAspectRatio must be greater than 0. Provided: ' + foregroundContentAspectRatio);
|
|
7
|
+
}
|
|
8
|
+
if (!isNullish(initialForegroundRatio)) {
|
|
9
|
+
if (initialForegroundRatio < 0 || initialForegroundRatio > 1)
|
|
10
|
+
throw new Error(`initialForegroundRatio must be between 0 and 1. Provided: ${initialForegroundRatio}`);
|
|
11
|
+
}
|
|
12
|
+
if (!isNullish(minForegroundRatio)) {
|
|
13
|
+
if (minForegroundRatio < 0 || minForegroundRatio > 1)
|
|
14
|
+
throw new Error(`minForegroundRatio must be between 0 and 1. Provided: ${minForegroundRatio}`);
|
|
15
|
+
}
|
|
16
|
+
if (!isNullish(maxForegroundRatio)) {
|
|
17
|
+
if (maxForegroundRatio < 0 || maxForegroundRatio > 1)
|
|
18
|
+
throw new Error(`maxForegroundRatio must be between 0 and 1. Provided: ${maxForegroundRatio}`);
|
|
19
|
+
}
|
|
20
|
+
if (!isNullish(minForegroundRatio) && !isNullish(maxForegroundRatio) && minForegroundRatio >= maxForegroundRatio)
|
|
21
|
+
throw new Error(`minForegroundRatio must be less than maxForegroundRatio. Provided: ${JSON.stringify({ minForegroundRatio, maxForegroundRatio })}`);
|
|
22
|
+
if (!isNullish(initialForegroundRatio) &&
|
|
23
|
+
!isNullish(minForegroundRatio) &&
|
|
24
|
+
initialForegroundRatio < minForegroundRatio)
|
|
25
|
+
throw new Error(`initialForegroundRatio must be >= minForegroundRatio. Provided: ${JSON.stringify({ initialForegroundRatio, minForegroundRatio })}`);
|
|
26
|
+
if (!isNullish(initialForegroundRatio) &&
|
|
27
|
+
!isNullish(maxForegroundRatio) &&
|
|
28
|
+
initialForegroundRatio > maxForegroundRatio)
|
|
29
|
+
throw new Error(`initialForegroundRatio must be <= maxForegroundRatio. Provided: ${JSON.stringify({ initialForegroundRatio, maxForegroundRatio })}`);
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=vertical-resizable-overlay-view.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical-resizable-overlay-view.utils.js","sourceRoot":"","sources":["../../../../src/components/layout/resizable/vertical-resizable-overlay-view.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAG1D,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,KAAwC,EAAE,EAAE;IACxF,MAAM,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IAE/G,IAAI,CAAC,SAAS,CAAC,4BA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,SAAS,CAAC,kBAAkB,CAAC;QAC9B,sBAAsB,GAAG,kBAAkB;QAE3C,MAAM,IAAI,KAAK,CACb,mEAAmE,IAAI,CAAC,SAAS,CAAC,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,CAAC,EAAE,CACpI,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
5
|
+
import Animated, { useAnimatedStyle, useSharedValue, withSpring } from 'react-native-reanimated';
|
|
6
|
+
import { isDevelopment } from '../../../utils';
|
|
7
|
+
import { validateResizableSplitViewProps } from './vertical-resizable-split-view.utils';
|
|
8
|
+
const DRAG_HANDLE_HEIGHT = 20;
|
|
9
|
+
const DEFAULT_ANIMATION_CONFIG = { damping: 25, stiffness: 300, mass: 0.8 };
|
|
10
|
+
export const VerticalResizableSplitView = (props) => {
|
|
11
|
+
if (isDevelopment())
|
|
12
|
+
validateResizableSplitViewProps(props);
|
|
13
|
+
const { topContent, bottomContent, initialTopRatio = 0.5, minTopRatio = 0.15, maxTopRatio = 0.85, handleContainerStyle, handleStyle, hideHandle = false, } = props;
|
|
14
|
+
// Track measured container height
|
|
15
|
+
const [isReady, setIsReady] = useState(false);
|
|
16
|
+
// Shared values for animation
|
|
17
|
+
const topSectionHeight = useSharedValue(0);
|
|
18
|
+
const minHeight = useSharedValue(0);
|
|
19
|
+
const maxHeight = useSharedValue(0);
|
|
20
|
+
const startY = useSharedValue(0);
|
|
21
|
+
const isDragging = useSharedValue(false);
|
|
22
|
+
// Handle container layout measurement
|
|
23
|
+
const handleLayout = useCallback((event) => {
|
|
24
|
+
const { height } = event.nativeEvent.layout;
|
|
25
|
+
if (height > 0 && !isReady) {
|
|
26
|
+
minHeight.value = height * minTopRatio;
|
|
27
|
+
maxHeight.value = height * maxTopRatio;
|
|
28
|
+
topSectionHeight.value = height * initialTopRatio;
|
|
29
|
+
setIsReady(true);
|
|
30
|
+
}
|
|
31
|
+
}, [minTopRatio, maxTopRatio, initialTopRatio, minHeight, maxHeight, topSectionHeight, isReady]);
|
|
32
|
+
const panGesture = Gesture.Pan()
|
|
33
|
+
.onStart(() => {
|
|
34
|
+
startY.value = topSectionHeight.value;
|
|
35
|
+
isDragging.value = true;
|
|
36
|
+
})
|
|
37
|
+
.onUpdate((event) => {
|
|
38
|
+
const newHeight = startY.value + event.translationY;
|
|
39
|
+
topSectionHeight.value = Math.max(minHeight.value, Math.min(newHeight, maxHeight.value));
|
|
40
|
+
})
|
|
41
|
+
.onEnd(() => {
|
|
42
|
+
isDragging.value = false;
|
|
43
|
+
});
|
|
44
|
+
const topSectionAnimatedStyle = useAnimatedStyle(() => ({ height: topSectionHeight.value }));
|
|
45
|
+
const dragHandleContainerAnimatedStyle = useAnimatedStyle(() => ({
|
|
46
|
+
top: topSectionHeight.value - DRAG_HANDLE_HEIGHT / 2,
|
|
47
|
+
}));
|
|
48
|
+
const dragHandleAnimatedStyle = useAnimatedStyle(() => ({
|
|
49
|
+
transform: [{ scale: withSpring(isDragging.value ? 1.2 : 1, DEFAULT_ANIMATION_CONFIG) }],
|
|
50
|
+
}));
|
|
51
|
+
return (_jsxs(View, { style: [styles.container], onLayout: handleLayout, children: [_jsx(Animated.View, { style: [styles.topSection, topSectionAnimatedStyle], children: topContent }), !hideHandle && (_jsx(GestureDetector, { gesture: panGesture, children: _jsx(Animated.View, { style: [styles.handleContainer, handleContainerStyle, dragHandleContainerAnimatedStyle], children: _jsx(Animated.View, { style: [styles.handle, handleStyle, dragHandleAnimatedStyle] }) }) })), _jsx(View, { style: [styles.bottomSection], children: bottomContent })] }));
|
|
52
|
+
};
|
|
53
|
+
const styles = StyleSheet.create({
|
|
54
|
+
container: {
|
|
55
|
+
flex: 1,
|
|
56
|
+
},
|
|
57
|
+
topSection: {
|
|
58
|
+
overflow: 'hidden',
|
|
59
|
+
},
|
|
60
|
+
bottomSection: {
|
|
61
|
+
flex: 1,
|
|
62
|
+
overflow: 'hidden',
|
|
63
|
+
},
|
|
64
|
+
handleContainer: {
|
|
65
|
+
position: 'absolute',
|
|
66
|
+
left: 0,
|
|
67
|
+
right: 0,
|
|
68
|
+
height: DRAG_HANDLE_HEIGHT,
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
justifyContent: 'center',
|
|
71
|
+
},
|
|
72
|
+
handle: {
|
|
73
|
+
width: 40,
|
|
74
|
+
height: 4,
|
|
75
|
+
backgroundColor: '#888888',
|
|
76
|
+
borderRadius: 2,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=vertical-resizable-split-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical-resizable-split-view.js","sourceRoot":"","sources":["../../../../src/components/layout/resizable/vertical-resizable-split-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAA0B,MAAM,OAAO,CAAC;AACtE,OAAO,EAAqB,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,QAAQ,EAAE,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AAExF,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,wBAAwB,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AAE5E,MAAM,CAAC,MAAM,0BAA0B,GAAuD,CAAC,KAAK,EAAE,EAAE;I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uBAAuB,CAAC,YAAG,UAAU,GAAiB,EAE/F,CAAC,UAAU,IAAI,CACd,KAAC,eAAe,IAAC,OAAO,EAAE,UAAU,YAClC,KAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,eAAe,EAAE,oBAAoB,EAAE,gCAAgC,CAAC,YACpG,KAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,uBAAuB,CAAC,GAAI,GACjE,GACA,CACnB,EAED,KAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,YAAG,aAAa,GAAQ,IACtD,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;KACR;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,QAAQ;KACnB;IACD,aAAa,EAAE;QACb,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,QAAQ;KACnB;IACD,eAAe,EAAE;QACf,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,kBAAkB;QAC1B,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,CAAC;QACT,eAAe,EAAE,SAAS;QAC1B,YAAY,EAAE,CAAC;KAChB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ViewStyle } from 'react-native';
|
|
3
|
+
export interface VerticalResizableSplitViewProps {
|
|
4
|
+
/** Content to display in the top section */
|
|
5
|
+
topContent: ReactNode;
|
|
6
|
+
/** Content to display in the bottom section */
|
|
7
|
+
bottomContent: ReactNode;
|
|
8
|
+
/** Initial proportion for the top section (0 to 1). Default: 0.5 */
|
|
9
|
+
initialTopRatio?: number;
|
|
10
|
+
/** Minimum proportion for the top section (0 to 1). Default: 0.15 */
|
|
11
|
+
minTopRatio?: number;
|
|
12
|
+
/** Maximum proportion for the top section (0 to 1). Default: 0.85 */
|
|
13
|
+
maxTopRatio?: number;
|
|
14
|
+
/** Style for the drag handle container */
|
|
15
|
+
handleContainerStyle?: ViewStyle;
|
|
16
|
+
/** Style for the drag handle bar */
|
|
17
|
+
handleStyle?: ViewStyle;
|
|
18
|
+
/** Whether to hide the drag handle. Default: false */
|
|
19
|
+
hideHandle?: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=vertical-resizable-split-view.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical-resizable-split-view.types.js","sourceRoot":"","sources":["../../../../src/components/layout/resizable/vertical-resizable-split-view.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isNullish } from '@lichens-innovation/ts-common';
|
|
2
|
+
export const validateResizableSplitViewProps = (props) => {
|
|
3
|
+
const { initialTopRatio, minTopRatio, maxTopRatio } = props;
|
|
4
|
+
if (!isNullish(initialTopRatio)) {
|
|
5
|
+
if (initialTopRatio < 0 || initialTopRatio > 1)
|
|
6
|
+
throw new Error(`initialTopRatio must be between 0 and 1. Provided: ${initialTopRatio}`);
|
|
7
|
+
}
|
|
8
|
+
if (!isNullish(minTopRatio)) {
|
|
9
|
+
if (minTopRatio < 0 || minTopRatio > 1)
|
|
10
|
+
throw new Error(`minTopRatio must be between 0 and 1. Provided: ${minTopRatio}`);
|
|
11
|
+
}
|
|
12
|
+
if (!isNullish(maxTopRatio)) {
|
|
13
|
+
if (maxTopRatio < 0 || maxTopRatio > 1)
|
|
14
|
+
throw new Error(`maxTopRatio must be between 0 and 1. Provided: ${maxTopRatio}`);
|
|
15
|
+
}
|
|
16
|
+
if (!isNullish(minTopRatio) && !isNullish(maxTopRatio) && minTopRatio >= maxTopRatio)
|
|
17
|
+
throw new Error(`minTopRatio must be less than maxTopRatio. Provided: ${JSON.stringify({ minTopRatio, maxTopRatio })}`);
|
|
18
|
+
if (!isNullish(initialTopRatio) && !isNullish(minTopRatio) && initialTopRatio < minTopRatio)
|
|
19
|
+
throw new Error(`initialTopRatio must be >= minTopRatio. Provided: ${JSON.stringify({ initialTopRatio, minTopRatio })}`);
|
|
20
|
+
if (!isNullish(initialTopRatio) && !isNullish(maxTopRatio) && initialTopRatio > maxTopRatio)
|
|
21
|
+
throw new Error(`initialTopRatio must be <= maxTopRatio. Provided: ${JSON.stringify({ initialTopRatio, maxTopRatio })}`);
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=vertical-resizable-split-view.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical-resizable-split-view.utils.js","sourceRoot":"","sources":["../../../../src/components/layout/resizable/vertical-resizable-split-view.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAG1D,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,KAAsC,EAAE,EAAE;IACxF,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAE5D,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,CAAC;QAChC,IAAI,eAAe,GAAG,CAAC,IAAI,eAAe,GAAG,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,sDAAsD,eAAe,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;QAC5B,IAAI,WAAW,GAAG,CAAC,IAAI,WAAW,GAAG,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,kDAAkD,WAAW,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;QAC5B,IAAI,WAAW,GAAG,CAAC,IAAI,WAAW,GAAG,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,kDAAkD,WAAW,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,WAAW,IAAI,WAAW;QAClF,MAAM,IAAI,KAAK,CACb,wDAAwD,IAAI,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,EAAE,CACvG,CAAC;IAEJ,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,eAAe,GAAG,WAAW;QACzF,MAAM,IAAI,KAAK,CACb,qDAAqD,IAAI,CAAC,SAAS,CAAC,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC,EAAE,CACxG,CAAC;IAEJ,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,eAAe,GAAG,WAAW;QACzF,MAAM,IAAI,KAAK,CACb,qDAAqD,IAAI,CAAC,SAAS,CAAC,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC,EAAE,CACxG,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getColorForPercentage } from '@lichens-innovation/ts-common';
|
|
2
3
|
import { StyleSheet, View } from 'react-native';
|
|
3
4
|
import { ProgressBar } from 'react-native-paper';
|
|
4
5
|
import { useAppTheme } from '../../theme/theme';
|
|
5
|
-
import { getColorForPercentage } from '../../utils/color.utils';
|
|
6
6
|
const ScoreIndicator = ({ score }) => {
|
|
7
7
|
const styles = useStyles();
|
|
8
8
|
if (score === undefined || score === null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"score-indicator.js","sourceRoot":"","sources":["../../../src/components/score-indicator/score-indicator.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"score-indicator.js","sourceRoot":"","sources":["../../../src/components/score-indicator/score-indicator.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMhD,MAAM,cAAc,GAA2C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3E,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,SAAS,YAC3B,KAAC,WAAW,IAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,qBAAqB,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,GAAI,GAC3F,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;IAE5B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;SACjC;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE,EAAE;YACZ,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;SAC/B;QACD,WAAW,EAAE;YACX,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,EAAE;YACV,YAAY,EAAE,KAAK,CAAC,SAAS;SAC9B;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-progress.utils.js","sourceRoot":"","sources":["../../../src/components/spinner/activity-progress.utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"activity-progress.utils.js","sourceRoot":"","sources":["../../../src/components/spinner/activity-progress.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,WAAW,MAAM,cAAc,CAAC;AASvC,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,QAA2B,EAAE,EAAE;IACrE,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACtC,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,GAAG,CAAC,EAAE,GAAG,QAAQ,CAAC;IACjE,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC;IAEzB,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QACxC,MAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,MAAM,KAAK,GAAG,GAAG,WAAW,MAAM,UAAU,EAAE,CAAC;QAC/C,MAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC,GAAG,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5E,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;IAC/B,CAAC;IAED,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC;IAC9D,MAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC,GAAG,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;AAC/B,CAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { sleep } from '@lichens-innovation/ts-common';
|
|
1
2
|
import { nativeApplicationVersion, nativeBuildVersion } from 'expo-application';
|
|
2
3
|
import * as Updates from 'expo-updates';
|
|
3
4
|
import { useEffect, useState } from 'react';
|
|
4
5
|
import { logger } from '../logger/logger';
|
|
5
6
|
import { getDeviceType, isRealDevice } from '../utils/device.utils';
|
|
6
|
-
import { sleep } from '../utils/thread.utils';
|
|
7
7
|
import { isProduction } from '../utils/env.utils.windows';
|
|
8
8
|
const checkForUpdateAsync = async () => {
|
|
9
9
|
const deviceType = getDeviceType();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-updates.js","sourceRoot":"","sources":["../../src/hooks/use-updates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"use-updates.js","sourceRoot":"","sources":["../../src/hooks/use-updates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC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F,MAAM,eAAe,GAAG,KAAK,IAAI,EAAE;QACjC,YAAY,CAAC,IAAI,CAAC,CAAC;QAEnB,IAAI,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;YACpE,MAAM,mBAAmB,EAAE,CAAC;YAC5B,MAAM,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;QAC3E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,2DAA2D,EAAE,KAAK,CAAC,CAAC;QACnF,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,eAAe,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;YACvD,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,mDAAmD;QAC5E,CAAC;IACH,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IAEtB,MAAM,YAAY,GAAG,kBAAkB,wBAAwB,KAAK,kBAAkB,GAAG,CAAC;IAC1F,MAAM,cAAc,GAAG,gBAAgB,CAAC,gBAAgB;QACtD,CAAC,CAAC,GAAG,YAAY,2CAA2C;QAC5D,CAAC,CAAC,GAAG,YAAY,yBAAyB,CAAC;IAE7C,OAAO;QACL,cAAc;QACd,iBAAiB;QACjB,eAAe;QACf,eAAe;QACf,SAAS;QACT,mBAAmB;KACpB,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/logger/logger.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var _a;
|
|
2
|
+
import { isString } from '@lichens-innovation/ts-common';
|
|
2
3
|
import * as Sentry from '@sentry/react-native';
|
|
3
4
|
import { InteractionManager, LogBox } from 'react-native';
|
|
4
5
|
import { fileAsyncTransport, mapConsoleTransport, logger as RNLogger, sentryTransport, } from 'react-native-logs';
|
|
@@ -7,7 +8,6 @@ import { getSentryDns, isSentryActivated } from '../config/env.config';
|
|
|
7
8
|
import { commonLogsStoreTransport } from '../store/common-logs.store';
|
|
8
9
|
import { getAppIdentifier } from '../utils/device.utils';
|
|
9
10
|
import { isDevelopment } from '../utils/env.utils';
|
|
10
|
-
import { isString } from '../utils/types.utils';
|
|
11
11
|
import { LOG_LEVELS } from './logger.utils';
|
|
12
12
|
LogBox.ignoreLogs([/^ErrorBoundary /, /Support for defaultProps will be removed from function components/]);
|
|
13
13
|
const appName = getAppIdentifier();
|