@evlop/native-components 1.0.254 → 1.0.256
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/dist/cjs/src/Actionable.d.ts +1 -1
- package/dist/cjs/src/Actionable.d.ts.map +1 -1
- package/dist/cjs/src/Actionable.js +2 -163
- package/dist/cjs/src/Actionable.js.map +1 -1
- package/dist/cjs/src/Button.d.ts +2 -0
- package/dist/cjs/src/Button.d.ts.map +1 -1
- package/dist/cjs/src/Button.js +6 -2
- package/dist/cjs/src/Button.js.map +1 -1
- package/dist/cjs/src/RenderPage/index.d.ts.map +1 -1
- package/dist/cjs/src/RenderPage/index.js +3 -4
- package/dist/cjs/src/RenderPage/index.js.map +1 -1
- package/dist/cjs/src/hooks/index.d.ts +2 -0
- package/dist/cjs/src/hooks/index.d.ts.map +1 -0
- package/dist/cjs/src/hooks/index.js +18 -0
- package/dist/cjs/src/hooks/index.js.map +1 -0
- package/dist/cjs/src/hooks/useAnimatedPress.d.ts +56 -0
- package/dist/cjs/src/hooks/useAnimatedPress.d.ts.map +1 -0
- package/dist/cjs/src/hooks/useAnimatedPress.js +168 -0
- package/dist/cjs/src/hooks/useAnimatedPress.js.map +1 -0
- package/dist/cjs/src/utils/index.d.ts +1 -0
- package/dist/cjs/src/utils/index.d.ts.map +1 -1
- package/dist/cjs/src/utils/index.js +1 -0
- package/dist/cjs/src/utils/index.js.map +1 -1
- package/dist/cjs/src/utils/pushNotification.d.ts +13 -0
- package/dist/cjs/src/utils/pushNotification.d.ts.map +1 -0
- package/dist/cjs/src/utils/pushNotification.js +21 -0
- package/dist/cjs/src/utils/pushNotification.js.map +1 -0
- package/dist/cjs/src/utils/pushNotification.native.d.ts +19 -0
- package/dist/cjs/src/utils/pushNotification.native.d.ts.map +1 -0
- package/dist/cjs/src/utils/pushNotification.native.js +113 -0
- package/dist/cjs/src/utils/pushNotification.native.js.map +1 -0
- package/dist/types/main.ai.d.ts +2 -1
- package/dist/types/src/Actionable.d.ts +1 -1
- package/dist/types/src/Actionable.d.ts.map +1 -1
- package/dist/types/src/Button.d.ts +2 -0
- package/dist/types/src/Button.d.ts.map +1 -1
- package/dist/types/src/RenderPage/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useAnimatedPress.d.ts +56 -0
- package/dist/types/src/hooks/useAnimatedPress.d.ts.map +1 -0
- package/dist/types/src/utils/index.d.ts +1 -0
- package/dist/types/src/utils/index.d.ts.map +1 -1
- package/dist/types/src/utils/pushNotification.d.ts +13 -0
- package/dist/types/src/utils/pushNotification.d.ts.map +1 -0
- package/dist/types/src/utils/pushNotification.native.d.ts +19 -0
- package/dist/types/src/utils/pushNotification.native.d.ts.map +1 -0
- package/package.json +3 -1
|
@@ -2,7 +2,7 @@ import { Action } from '@evlop/commons';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PressableProps } from 'react-native';
|
|
4
4
|
import { HapticType } from './utils/haptic';
|
|
5
|
-
|
|
5
|
+
import { EffectType } from './hooks/useAnimatedPress';
|
|
6
6
|
export interface BaseActionableProps extends PressableProps {
|
|
7
7
|
pressEffect?: EffectType;
|
|
8
8
|
hapticFeedback?: HapticType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actionable.d.ts","sourceRoot":"","sources":["../../../src/Actionable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA2B,MAAM,gBAAgB,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"Actionable.d.ts","sourceRoot":"","sources":["../../../src/Actionable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA2B,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAA8C,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAyB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAoB,MAAM,0BAA0B,CAAC;AAIxE,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACvD,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAWD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAsBnE,CAAA;;;;;;;;;;AAED,wBAImB"}
|
|
@@ -42,176 +42,15 @@ const commons_1 = require("@evlop/commons");
|
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
43
43
|
const react_native_1 = require("react-native");
|
|
44
44
|
const haptic_1 = require("./utils/haptic");
|
|
45
|
+
const useAnimatedPress_1 = require("./hooks/useAnimatedPress");
|
|
45
46
|
const native_1 = __importDefault(require("styled-components/native"));
|
|
46
47
|
const styled_system_1 = require("styled-system");
|
|
47
48
|
const AnimatedPressable = react_native_1.Animated.createAnimatedComponent(react_native_1.Pressable);
|
|
48
49
|
const StyledPressable = (0, native_1.default)(AnimatedPressable)(styled_system_1.border, styled_system_1.background, styled_system_1.layout, styled_system_1.space);
|
|
49
|
-
// Hook to create animated press effect
|
|
50
|
-
const useAnimatedPress = (effect) => {
|
|
51
|
-
return (0, react_1.useMemo)(() => {
|
|
52
|
-
if (effect === 'none') {
|
|
53
|
-
return {};
|
|
54
|
-
}
|
|
55
|
-
const animatedValue = new react_native_1.Animated.Value(1);
|
|
56
|
-
const handlePressIn = () => {
|
|
57
|
-
react_native_1.Animated.spring(animatedValue, {
|
|
58
|
-
toValue: 0,
|
|
59
|
-
useNativeDriver: true,
|
|
60
|
-
speed: 50,
|
|
61
|
-
bounciness: 4,
|
|
62
|
-
}).start();
|
|
63
|
-
};
|
|
64
|
-
const handlePressOut = () => {
|
|
65
|
-
react_native_1.Animated.spring(animatedValue, {
|
|
66
|
-
toValue: 1,
|
|
67
|
-
useNativeDriver: true,
|
|
68
|
-
speed: 20,
|
|
69
|
-
bounciness: 6,
|
|
70
|
-
}).start();
|
|
71
|
-
};
|
|
72
|
-
const getAnimatedStyle = () => {
|
|
73
|
-
switch (effect) {
|
|
74
|
-
case 'shrink':
|
|
75
|
-
return {
|
|
76
|
-
transform: [{
|
|
77
|
-
scale: animatedValue.interpolate({
|
|
78
|
-
inputRange: [0, 1],
|
|
79
|
-
outputRange: [0.95, 1],
|
|
80
|
-
}),
|
|
81
|
-
}],
|
|
82
|
-
};
|
|
83
|
-
case 'dim':
|
|
84
|
-
return {
|
|
85
|
-
opacity: animatedValue.interpolate({
|
|
86
|
-
inputRange: [0, 1],
|
|
87
|
-
outputRange: [0.7, 1],
|
|
88
|
-
}),
|
|
89
|
-
};
|
|
90
|
-
case 'shrink-dim':
|
|
91
|
-
return {
|
|
92
|
-
transform: [{
|
|
93
|
-
scale: animatedValue.interpolate({
|
|
94
|
-
inputRange: [0, 1],
|
|
95
|
-
outputRange: [0.95, 1],
|
|
96
|
-
}),
|
|
97
|
-
}],
|
|
98
|
-
opacity: animatedValue.interpolate({
|
|
99
|
-
inputRange: [0, 1],
|
|
100
|
-
outputRange: [0.7, 1],
|
|
101
|
-
}),
|
|
102
|
-
};
|
|
103
|
-
case 'push-down':
|
|
104
|
-
return {
|
|
105
|
-
transform: [
|
|
106
|
-
{
|
|
107
|
-
scale: animatedValue.interpolate({
|
|
108
|
-
inputRange: [0, 1],
|
|
109
|
-
outputRange: [0.97, 1],
|
|
110
|
-
}),
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
translateY: animatedValue.interpolate({
|
|
114
|
-
inputRange: [0, 1],
|
|
115
|
-
outputRange: [2, 0],
|
|
116
|
-
}),
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
};
|
|
120
|
-
case 'gentle-shrink':
|
|
121
|
-
return {
|
|
122
|
-
transform: [{
|
|
123
|
-
scale: animatedValue.interpolate({
|
|
124
|
-
inputRange: [0, 1],
|
|
125
|
-
outputRange: [0.98, 1],
|
|
126
|
-
}),
|
|
127
|
-
}],
|
|
128
|
-
};
|
|
129
|
-
case 'tilt':
|
|
130
|
-
return {
|
|
131
|
-
transform: [
|
|
132
|
-
{
|
|
133
|
-
scale: animatedValue.interpolate({
|
|
134
|
-
inputRange: [0, 1],
|
|
135
|
-
outputRange: [0.97, 1],
|
|
136
|
-
}),
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
rotateZ: animatedValue.interpolate({
|
|
140
|
-
inputRange: [0, 1],
|
|
141
|
-
outputRange: ['-2deg', '0deg'],
|
|
142
|
-
}),
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
perspective: animatedValue.interpolate({
|
|
146
|
-
inputRange: [0, 1],
|
|
147
|
-
outputRange: [800, 1000],
|
|
148
|
-
}),
|
|
149
|
-
},
|
|
150
|
-
],
|
|
151
|
-
};
|
|
152
|
-
case 'bounce':
|
|
153
|
-
return {
|
|
154
|
-
transform: [{
|
|
155
|
-
scale: animatedValue.interpolate({
|
|
156
|
-
inputRange: [0, 0.5, 1],
|
|
157
|
-
outputRange: [0.9, 0.95, 1],
|
|
158
|
-
}),
|
|
159
|
-
}],
|
|
160
|
-
};
|
|
161
|
-
case 'squeeze':
|
|
162
|
-
return {
|
|
163
|
-
transform: [
|
|
164
|
-
{
|
|
165
|
-
scaleX: animatedValue.interpolate({
|
|
166
|
-
inputRange: [0, 1],
|
|
167
|
-
outputRange: [0.92, 1],
|
|
168
|
-
}),
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
scaleY: animatedValue.interpolate({
|
|
172
|
-
inputRange: [0, 1],
|
|
173
|
-
outputRange: [1.04, 1],
|
|
174
|
-
}),
|
|
175
|
-
},
|
|
176
|
-
],
|
|
177
|
-
};
|
|
178
|
-
case 'pop':
|
|
179
|
-
return {
|
|
180
|
-
transform: [{
|
|
181
|
-
scale: animatedValue.interpolate({
|
|
182
|
-
inputRange: [0, 1],
|
|
183
|
-
outputRange: [1.05, 1],
|
|
184
|
-
}),
|
|
185
|
-
}],
|
|
186
|
-
};
|
|
187
|
-
case 'wobble':
|
|
188
|
-
return {
|
|
189
|
-
transform: [
|
|
190
|
-
{
|
|
191
|
-
scale: animatedValue.interpolate({
|
|
192
|
-
inputRange: [0, 1],
|
|
193
|
-
outputRange: [0.97, 1],
|
|
194
|
-
}),
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
rotateZ: animatedValue.interpolate({
|
|
198
|
-
inputRange: [0, 0.25, 0.5, 0.75, 1],
|
|
199
|
-
outputRange: ['0deg', '-1deg', '1deg', '-0.5deg', '0deg'],
|
|
200
|
-
}),
|
|
201
|
-
},
|
|
202
|
-
],
|
|
203
|
-
};
|
|
204
|
-
default:
|
|
205
|
-
return {};
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
return { handlePressIn, handlePressOut, animatedStyle: getAnimatedStyle() };
|
|
209
|
-
}, [effect]);
|
|
210
|
-
};
|
|
211
50
|
const BaseActionable = (_a) => {
|
|
212
51
|
var { action, pressEffect = 'none', hapticFeedback: hapticFeedbackType, style } = _a, props = __rest(_a, ["action", "pressEffect", "hapticFeedback", "style"]);
|
|
213
52
|
const onPress = (0, commons_1.useAction)(action);
|
|
214
|
-
const { handlePressIn, handlePressOut, animatedStyle } = useAnimatedPress(pressEffect);
|
|
53
|
+
const { handlePressIn, handlePressOut, animatedStyle } = (0, useAnimatedPress_1.useAnimatedPress)(pressEffect);
|
|
215
54
|
const handlePress = (0, react_1.useCallback)((event) => {
|
|
216
55
|
if (hapticFeedbackType) {
|
|
217
56
|
(0, haptic_1.triggerHapticFeedback)(hapticFeedbackType);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actionable.js","sourceRoot":"","sources":["../../../src/Actionable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAiE;AACjE,+
|
|
1
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C1B,KAAK,EAAE,CAAC,aAAa,EAAE,KAAK,CAAQ,IAChC,KAAK,EACX,CACL,CAAC;AACN,CAAC,CAAA;AAtBY,QAAA,cAAc,kBAsB1B;AAED,kBAAe,IAAA,sBAAY,EAAC;IACxB,IAAI,EAAE,YAAY;IAClB,oBAAoB,EAAE,EAAE;IACxB,YAAY,EAAE,EAAE;CACnB,CAAC,CAAC,sBAAc,CAAC,CAAC"}
|
package/dist/cjs/src/Button.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Action, Color, IconIdentifier, Theme } from '@evlop/commons';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { TextStyle, ViewProps } from 'react-native';
|
|
4
4
|
import { BackgroundColorProps, BorderProps, FontSizeProps, FontWeightProps, LayoutProps, SpaceProps } from 'styled-system';
|
|
5
|
+
import { EffectType } from './hooks/useAnimatedPress';
|
|
5
6
|
declare type ButtonSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
6
7
|
export interface BaseButtonProps extends ViewProps, FontWeightProps<Theme>, FontSizeProps<Theme>, LayoutProps<Theme>, SpaceProps<Theme>, BackgroundColorProps<Theme>, BorderProps<Theme> {
|
|
7
8
|
disabled?: boolean;
|
|
@@ -16,6 +17,7 @@ export interface BaseButtonProps extends ViewProps, FontWeightProps<Theme>, Font
|
|
|
16
17
|
icon?: IconIdentifier;
|
|
17
18
|
iconPosition?: 'left' | 'right';
|
|
18
19
|
iconSize?: number;
|
|
20
|
+
pressEffect?: EffectType;
|
|
19
21
|
}
|
|
20
22
|
export declare const BaseButton: React.FC<BaseButtonProps>;
|
|
21
23
|
declare const ButtonWithSettings: (props: BaseButtonProps & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAgC,MAAM,gBAAgB,CAAC;AAEpG,OAA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AO,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,UAAU,CAAC;CAC1B;AAyHD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAiEhD,CAAC;AAEF,QAAA,MAAM,kBAAkB;;;;;;;;uBAIV,CAAC;AAEf,eAAe,kBAAkB,CAAC"}
|
package/dist/cjs/src/Button.js
CHANGED
|
@@ -24,6 +24,7 @@ const styled_system_1 = require("styled-system");
|
|
|
24
24
|
const Flexbox_1 = require("./Flexbox");
|
|
25
25
|
const Text_1 = require("./Text");
|
|
26
26
|
const Icon_1 = require("./Icon");
|
|
27
|
+
const useAnimatedPress_1 = require("./hooks/useAnimatedPress");
|
|
27
28
|
const buttonVariant = ({ variant, color, theme }) => {
|
|
28
29
|
var _a, _b;
|
|
29
30
|
const _color = color ? ((_a = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _a === void 0 ? void 0 : _a[color]) || color : ((_b = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _b === void 0 ? void 0 : _b.primary) || '#000';
|
|
@@ -85,6 +86,7 @@ const sizeVariant = (0, styled_system_1.variant)({
|
|
|
85
86
|
},
|
|
86
87
|
},
|
|
87
88
|
});
|
|
89
|
+
const AnimatedPressable = react_native_1.Animated.createAnimatedComponent(react_native_1.Pressable);
|
|
88
90
|
const StyledActivityIndicator = (0, native_1.default)(react_native_1.ActivityIndicator).attrs(({ color, theme }) => {
|
|
89
91
|
var _a;
|
|
90
92
|
return ({
|
|
@@ -132,12 +134,14 @@ const gapBetweenIconAndText = {
|
|
|
132
134
|
const BaseButton = (_a) => {
|
|
133
135
|
var { variant = 'filled', size = 'md', loading = false, disabled = false, color = 'primary', textColor, label, textStyle, action: __action,
|
|
134
136
|
// @ts-ignore
|
|
135
|
-
icon, iconPosition = 'left', iconSize, fontWeight, fontSize } = _a, props = __rest(_a, ["variant", "size", "loading", "disabled", "color", "textColor", "label", "textStyle", "action", "icon", "iconPosition", "iconSize", "fontWeight", "fontSize"]);
|
|
137
|
+
icon, iconPosition = 'left', iconSize, pressEffect = 'none', fontWeight, fontSize } = _a, props = __rest(_a, ["variant", "size", "loading", "disabled", "color", "textColor", "label", "textStyle", "action", "icon", "iconPosition", "iconSize", "pressEffect", "fontWeight", "fontSize"]);
|
|
136
138
|
const [isProcessing, actionHandeller] = (0, commons_1.useAsyncAction)(__action);
|
|
139
|
+
const { handlePressIn, handlePressOut, animatedStyle } = (0, useAnimatedPress_1.useAnimatedPress)(pressEffect);
|
|
137
140
|
const textColorToUse = textColor || (variant === 'filled' ? 'white' : color);
|
|
138
141
|
const isDisabled = disabled || isProcessing;
|
|
139
142
|
const isLoading = loading || isProcessing;
|
|
140
|
-
|
|
143
|
+
const PressableComponent = pressEffect === 'none' ? react_native_1.Pressable : AnimatedPressable;
|
|
144
|
+
return (react_1.default.createElement(PressableComponent, { onPress: actionHandeller, disabled: isDisabled, onPressIn: handlePressIn, onPressOut: handlePressOut, style: animatedStyle },
|
|
141
145
|
react_1.default.createElement(StyledButtonView, Object.assign({ disabled: isDisabled, variant: variant, size: size, color: color }, props),
|
|
142
146
|
isLoading && (react_1.default.createElement(StyledActivityIndicator, { color: textColorToUse })),
|
|
143
147
|
react_1.default.createElement(Flexbox_1.BaseFlexbox, { flexDirection: iconPosition === 'right' ? 'row-reverse' : 'row', alignItems: "center", justifyContent: "center", gap: gapBetweenIconAndText[size], opacity: isLoading ? 0 : 1 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4CAAoG;AACpG,uCAA0C;AAC1C,kDAA0B;AAC1B,+
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4CAAoG;AACpG,uCAA0C;AAC1C,kDAA0B;AAC1B,+CAAk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C;AACJ,CAAC,CAAC;AAjEW,QAAA,UAAU,cAiErB;AAEF,MAAM,kBAAkB,GAAG,IAAA,sBAAY,EAAC;IACpC,IAAI,EAAE,QAAQ;IACd,YAAY,EAAE,EAAE;IAChB,oBAAoB,EAAE,EAAE;CAC3B,CAAC,CAAC,kBAAU,CAAC,CAAC;AAEf,kBAAe,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/RenderPage/index.tsx"],"names":[],"mappings":";;AAcA,eAAO,MAAM,UAAU;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/RenderPage/index.tsx"],"names":[],"mappings":";;AAcA,eAAO,MAAM,UAAU;;iBAiHtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,4BAA6B,GAAG,qDAA2C,CAAC;AAE7G,eAAO,MAAM,uBAAuB,UAAkB,GAAG,aAAa,GAAG,EAAE;;sCA4BxD,CAAC;AAEpB,eAAe,UAAU,CAAC"}
|
|
@@ -93,10 +93,9 @@ const RenderPage = ({ id }) => {
|
|
|
93
93
|
return (react_1.default.createElement(RenderComponent_1.RenderComponent, { uuid: "page-layout", key: layout.type, type: layout.type, data: layout.data }, pageContent));
|
|
94
94
|
}, [pageContent, layout]);
|
|
95
95
|
const topInset = headerHeight + navigationTitleBarHeight;
|
|
96
|
-
return (react_1.default.createElement(
|
|
97
|
-
react_1.default.createElement(
|
|
98
|
-
react_1.default.createElement(commons_1.
|
|
99
|
-
react_1.default.createElement(commons_1.ScopesProvider, { values: pageScopes }, pageContent)))));
|
|
96
|
+
return (react_1.default.createElement(contexts_1.PageInsetsProvider, { top: topInset, bottom: footerHeight },
|
|
97
|
+
react_1.default.createElement(commons_1.PageProvider, { value: page },
|
|
98
|
+
react_1.default.createElement(commons_1.ScopesProvider, { values: pageScopes }, pageContent))));
|
|
100
99
|
};
|
|
101
100
|
exports.RenderPage = RenderPage;
|
|
102
101
|
exports.getPageComponentById = (0, lodash_1.memoize)(pageId => (props) => react_1.default.createElement(exports.RenderPage, Object.assign({}, props, { id: pageId })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/RenderPage/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/RenderPage/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAqG;AACrG,qDAA4E;AAC5E,mCAAoD;AACpD,+CAAkE;AAClE,+CAA0D;AAC1D,6CAA0C;AAC1C,0CAAgE;AAChE,kEAA0C;AAC1C,sEAA8C;AAC9C,0EAAkD;AAClD,0EAAkD;AAClD,wDAAqD;AACrD,yDAA6D;AAEtD,MAAM,UAAU,GAAG,CAAC,EAAC,EAAE,EAAC,EAAE,EAAE;IACjC,MAAM,YAAY,GAAG,IAAA,wBAAa,GAAE,CAAC;IACrC,MAAM,UAAU,GAAG,IAAA,sBAAa,GAAE,CAAC;IACnC,MAAM,KAAK,GAAG,IAAA,yBAAW,EAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,IAAA,mBAAS,GAAE,CAAC;IAC3B,MAAM,IAAI,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,IAAA,aAAI,EAAC,KAAK,EAAE,EAAC,EAAE,EAAC,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3D,MAAM,0BAA0B,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,IAAI,uBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAE5E,MAAM,CAAC,mBAAmB,CAAC,GAAG,IAAA,wBAAc,EAA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kB,EAAE;QACjD,MAAM,yBAAyB,GAAG,iBAAiB,CAAC,aAAa,CAAC;QAClE,IAAG,yBAAyB,EAAE;YAC5B,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,yBAAyB,CAAC,CAAC;SAC7D;KACF;IAED,IAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,aAAa,EAAE;QACtB,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;KACtD;IAED,MAAM,UAAU,GAAG,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,0CAAE,IAAI,KAAI,SAAS,CAAC;IACnD,IAAG,UAAU,KAAK,SAAS,EAAE;QAC3B,iBAAiB,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;KAC1C;IAGD,OAAO,iBAAiB,CAAC;AAC3B,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEpB,kBAAe,kBAAU,CAAC;AAE1B,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,eAAe,EAAE;QACf,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;KACV;IACD,eAAe,EAAE;QACf,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;KACV;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useAnimatedPress"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Animated } from 'react-native';
|
|
2
|
+
export declare type EffectType = 'none' | 'shrink' | 'dim' | 'shrink-dim' | 'push-down' | 'gentle-shrink' | 'tilt' | 'bounce' | 'squeeze' | 'pop' | 'wobble';
|
|
3
|
+
export declare const useAnimatedPress: (effect: EffectType) => {
|
|
4
|
+
handlePressIn?: undefined;
|
|
5
|
+
handlePressOut?: undefined;
|
|
6
|
+
animatedStyle?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
handlePressIn: () => void;
|
|
9
|
+
handlePressOut: () => void;
|
|
10
|
+
animatedStyle: {
|
|
11
|
+
opacity: Animated.AnimatedInterpolation<string | number>;
|
|
12
|
+
transform?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
transform: {
|
|
15
|
+
scale: Animated.AnimatedInterpolation<string | number>;
|
|
16
|
+
}[];
|
|
17
|
+
opacity: Animated.AnimatedInterpolation<string | number>;
|
|
18
|
+
} | {
|
|
19
|
+
transform: ({
|
|
20
|
+
scale: Animated.AnimatedInterpolation<string | number>;
|
|
21
|
+
translateY?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
translateY: Animated.AnimatedInterpolation<string | number>;
|
|
24
|
+
scale?: undefined;
|
|
25
|
+
})[];
|
|
26
|
+
opacity?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
transform: ({
|
|
29
|
+
scale: Animated.AnimatedInterpolation<string | number>;
|
|
30
|
+
rotateZ?: undefined;
|
|
31
|
+
perspective?: undefined;
|
|
32
|
+
} | {
|
|
33
|
+
rotateZ: Animated.AnimatedInterpolation<string | number>;
|
|
34
|
+
scale?: undefined;
|
|
35
|
+
perspective?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
perspective: Animated.AnimatedInterpolation<string | number>;
|
|
38
|
+
scale?: undefined;
|
|
39
|
+
rotateZ?: undefined;
|
|
40
|
+
})[];
|
|
41
|
+
opacity?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
transform: ({
|
|
44
|
+
scaleX: Animated.AnimatedInterpolation<string | number>;
|
|
45
|
+
scaleY?: undefined;
|
|
46
|
+
} | {
|
|
47
|
+
scaleY: Animated.AnimatedInterpolation<string | number>;
|
|
48
|
+
scaleX?: undefined;
|
|
49
|
+
})[];
|
|
50
|
+
opacity?: undefined;
|
|
51
|
+
} | {
|
|
52
|
+
opacity?: undefined;
|
|
53
|
+
transform?: undefined;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=useAnimatedPress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnimatedPress.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useAnimatedPress.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,oBAAY,UAAU,GAChB,MAAM,GACN,QAAQ,GACR,KAAK,GACL,YAAY,GACZ,WAAW,GACX,eAAe,GACf,MAAM,GACN,QAAQ,GACR,SAAS,GACT,KAAK,GACL,QAAQ,CAAC;AAEf,eAAO,MAAM,gBAAgB,WAAY,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqKlD,CAAC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAnimatedPress = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const useAnimatedPress = (effect) => {
|
|
7
|
+
return (0, react_1.useMemo)(() => {
|
|
8
|
+
if (effect === 'none') {
|
|
9
|
+
return {};
|
|
10
|
+
}
|
|
11
|
+
const animatedValue = new react_native_1.Animated.Value(1);
|
|
12
|
+
const handlePressIn = () => {
|
|
13
|
+
react_native_1.Animated.spring(animatedValue, {
|
|
14
|
+
toValue: 0,
|
|
15
|
+
useNativeDriver: true,
|
|
16
|
+
speed: 50,
|
|
17
|
+
bounciness: 4,
|
|
18
|
+
}).start();
|
|
19
|
+
};
|
|
20
|
+
const handlePressOut = () => {
|
|
21
|
+
react_native_1.Animated.spring(animatedValue, {
|
|
22
|
+
toValue: 1,
|
|
23
|
+
useNativeDriver: true,
|
|
24
|
+
speed: 20,
|
|
25
|
+
bounciness: 6,
|
|
26
|
+
}).start();
|
|
27
|
+
};
|
|
28
|
+
const getAnimatedStyle = () => {
|
|
29
|
+
switch (effect) {
|
|
30
|
+
case 'shrink':
|
|
31
|
+
return {
|
|
32
|
+
transform: [{
|
|
33
|
+
scale: animatedValue.interpolate({
|
|
34
|
+
inputRange: [0, 1],
|
|
35
|
+
outputRange: [0.95, 1],
|
|
36
|
+
}),
|
|
37
|
+
}],
|
|
38
|
+
};
|
|
39
|
+
case 'dim':
|
|
40
|
+
return {
|
|
41
|
+
opacity: animatedValue.interpolate({
|
|
42
|
+
inputRange: [0, 1],
|
|
43
|
+
outputRange: [0.7, 1],
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
case 'shrink-dim':
|
|
47
|
+
return {
|
|
48
|
+
transform: [{
|
|
49
|
+
scale: animatedValue.interpolate({
|
|
50
|
+
inputRange: [0, 1],
|
|
51
|
+
outputRange: [0.95, 1],
|
|
52
|
+
}),
|
|
53
|
+
}],
|
|
54
|
+
opacity: animatedValue.interpolate({
|
|
55
|
+
inputRange: [0, 1],
|
|
56
|
+
outputRange: [0.7, 1],
|
|
57
|
+
}),
|
|
58
|
+
};
|
|
59
|
+
case 'push-down':
|
|
60
|
+
return {
|
|
61
|
+
transform: [
|
|
62
|
+
{
|
|
63
|
+
scale: animatedValue.interpolate({
|
|
64
|
+
inputRange: [0, 1],
|
|
65
|
+
outputRange: [0.97, 1],
|
|
66
|
+
}),
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
translateY: animatedValue.interpolate({
|
|
70
|
+
inputRange: [0, 1],
|
|
71
|
+
outputRange: [2, 0],
|
|
72
|
+
}),
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
case 'gentle-shrink':
|
|
77
|
+
return {
|
|
78
|
+
transform: [{
|
|
79
|
+
scale: animatedValue.interpolate({
|
|
80
|
+
inputRange: [0, 1],
|
|
81
|
+
outputRange: [0.98, 1],
|
|
82
|
+
}),
|
|
83
|
+
}],
|
|
84
|
+
};
|
|
85
|
+
case 'tilt':
|
|
86
|
+
return {
|
|
87
|
+
transform: [
|
|
88
|
+
{
|
|
89
|
+
scale: animatedValue.interpolate({
|
|
90
|
+
inputRange: [0, 1],
|
|
91
|
+
outputRange: [0.97, 1],
|
|
92
|
+
}),
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
rotateZ: animatedValue.interpolate({
|
|
96
|
+
inputRange: [0, 1],
|
|
97
|
+
outputRange: ['-2deg', '0deg'],
|
|
98
|
+
}),
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
perspective: animatedValue.interpolate({
|
|
102
|
+
inputRange: [0, 1],
|
|
103
|
+
outputRange: [800, 1000],
|
|
104
|
+
}),
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
};
|
|
108
|
+
case 'bounce':
|
|
109
|
+
return {
|
|
110
|
+
transform: [{
|
|
111
|
+
scale: animatedValue.interpolate({
|
|
112
|
+
inputRange: [0, 0.5, 1],
|
|
113
|
+
outputRange: [0.9, 0.95, 1],
|
|
114
|
+
}),
|
|
115
|
+
}],
|
|
116
|
+
};
|
|
117
|
+
case 'squeeze':
|
|
118
|
+
return {
|
|
119
|
+
transform: [
|
|
120
|
+
{
|
|
121
|
+
scaleX: animatedValue.interpolate({
|
|
122
|
+
inputRange: [0, 1],
|
|
123
|
+
outputRange: [0.92, 1],
|
|
124
|
+
}),
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
scaleY: animatedValue.interpolate({
|
|
128
|
+
inputRange: [0, 1],
|
|
129
|
+
outputRange: [1.04, 1],
|
|
130
|
+
}),
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
};
|
|
134
|
+
case 'pop':
|
|
135
|
+
return {
|
|
136
|
+
transform: [{
|
|
137
|
+
scale: animatedValue.interpolate({
|
|
138
|
+
inputRange: [0, 1],
|
|
139
|
+
outputRange: [1.05, 1],
|
|
140
|
+
}),
|
|
141
|
+
}],
|
|
142
|
+
};
|
|
143
|
+
case 'wobble':
|
|
144
|
+
return {
|
|
145
|
+
transform: [
|
|
146
|
+
{
|
|
147
|
+
scale: animatedValue.interpolate({
|
|
148
|
+
inputRange: [0, 1],
|
|
149
|
+
outputRange: [0.97, 1],
|
|
150
|
+
}),
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
rotateZ: animatedValue.interpolate({
|
|
154
|
+
inputRange: [0, 0.25, 0.5, 0.75, 1],
|
|
155
|
+
outputRange: ['0deg', '-1deg', '1deg', '-0.5deg', '0deg'],
|
|
156
|
+
}),
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
};
|
|
160
|
+
default:
|
|
161
|
+
return {};
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
return { handlePressIn, handlePressOut, animatedStyle: getAnimatedStyle() };
|
|
165
|
+
}, [effect]);
|
|
166
|
+
};
|
|
167
|
+
exports.useAnimatedPress = useAnimatedPress;
|
|
168
|
+
//# sourceMappingURL=useAnimatedPress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnimatedPress.js","sourceRoot":"","sources":["../../../../src/hooks/useAnimatedPress.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,+CAAwC;AAejC,MAAM,gBAAgB,GAAG,CAAC,MAAkB,EAAE,EAAE;IACnD,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE;QAChB,IAAI,MAAM,KAAK,MAAM,EAAE;YACnB,OAAO,EAAE,CAAC;SACb;QAED,MAAM,aAAa,GAAG,IAAI,uBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAE5C,MAAM,aAAa,GAAG,GAAG,EAAE;YACvB,uBAAQ,CAAC,MAAM,CAAC,aAAa,EAAE;gBAC3B,OAAO,EAAE,CAAC;gBACV,eAAe,EAAE,IAAI;gBACrB,KAAK,EAAE,EAAE;gBACT,UAAU,EAAE,CAAC;aAChB,CAAC,CAAC,KAAK,EAAE,CAAC;QACf,CAAC,CAAC;QAEF,MAAM,cAAc,GAAG,GAAG,EAAE;YACxB,uBAAQ,CAAC,MAAM,CAAC,aAAa,EAAE;gBAC3B,OAAO,EAAE,CAAC;gBACV,eAAe,EAAE,IAAI;gBACrB,KAAK,EAAE,EAAE;gBACT,UAAU,EAAE,CAAC;aAChB,CAAC,CAAC,KAAK,EAAE,CAAC;QACf,CAAC,CAAC;QAEF,MAAM,gBAAgB,GAAG,GAAG,EAAE;Y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"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC"}
|
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./haptic"), exports);
|
|
18
|
+
__exportStar(require("./pushNotification"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,qDAAmC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Action } from "@evlop/commons";
|
|
2
|
+
interface TriggerPushNotificationOptions {
|
|
3
|
+
id?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
body?: string;
|
|
6
|
+
image?: string;
|
|
7
|
+
action?: Action;
|
|
8
|
+
sendAt?: Date;
|
|
9
|
+
}
|
|
10
|
+
export declare function triggerPushNotification({ id, title, body, image, action, sendAt }: TriggerPushNotificationOptions): Promise<void>;
|
|
11
|
+
export declare function cancelTriggerPushNotification(id: string): Promise<void>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=pushNotification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pushNotification.d.ts","sourceRoot":"","sources":["../../../../src/utils/pushNotification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,UAAU,8BAA8B;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,IAAI,CAAC;CACjB;AAED,wBAAsB,uBAAuB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,8BAA8B,iBAAI;AAE5H,wBAAsB,6BAA6B,CAAC,EAAE,EAAE,MAAM,iBAAI"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.cancelTriggerPushNotification = exports.triggerPushNotification = void 0;
|
|
13
|
+
function triggerPushNotification({ id, title, body, image, action, sendAt }) {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () { });
|
|
15
|
+
}
|
|
16
|
+
exports.triggerPushNotification = triggerPushNotification;
|
|
17
|
+
function cancelTriggerPushNotification(id) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () { });
|
|
19
|
+
}
|
|
20
|
+
exports.cancelTriggerPushNotification = cancelTriggerPushNotification;
|
|
21
|
+
//# sourceMappingURL=pushNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pushNotification.js","sourceRoot":"","sources":["../../../../src/utils/pushNotification.ts"],"names":[],"mappings":";;;;;;;;;;;;AAWA,SAAsB,uBAAuB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAkC;0DAAG,CAAC;CAAA;AAA5H,0DAA4H;AAE5H,SAAsB,6BAA6B,CAAC,EAAU;0DAAG,CAAC;CAAA;AAAlE,sEAAkE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Action } from '@evlop/commons';
|
|
2
|
+
interface TriggerPushNotificationOptions {
|
|
3
|
+
id?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
body?: string;
|
|
6
|
+
image?: string;
|
|
7
|
+
action?: Action;
|
|
8
|
+
sendAt?: Date;
|
|
9
|
+
}
|
|
10
|
+
export declare const triggerPushNotification: ({ id: notificationId, title: notificationTitle, body: notificationBody, image: notificationImageUrl, action, sendAt }: TriggerPushNotificationOptions) => Promise<void>;
|
|
11
|
+
interface CancelTriggerPushNotificationOptions {
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* If true, cancel the scheduled notification. If false, cancel the displayed notification. (default: false) */
|
|
15
|
+
scheduled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const cancelTriggerPushNotification: ({ id, scheduled }: CancelTriggerPushNotificationOptions) => Promise<void>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=pushNotification.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pushNotification.native.d.ts","sourceRoot":"","sources":["../../../../src/utils/pushNotification.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAIxC,UAAU,8BAA8B;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,IAAI,CAAC;CACf;AAED,eAAO,MAAM,uBAAuB,0HAAiI,8BAA8B,kBAmElM,CAAA;AAED,UAAU,oCAAoC;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX;mHAC+G;IAC/G,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,6BAA6B,sBAA6B,oCAAoC,kBAO1G,CAAA"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.cancelTriggerPushNotification = exports.triggerPushNotification = void 0;
|
|
36
|
+
const react_native_1 = __importStar(require("@notifee/react-native"));
|
|
37
|
+
const react_native_2 = require("react-native");
|
|
38
|
+
const triggerPushNotification = ({ id: notificationId, title: notificationTitle, body: notificationBody, image: notificationImageUrl, action, sendAt }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
+
let notificationTimeStampDate = null;
|
|
40
|
+
let shouldSendInstantly = true;
|
|
41
|
+
if (sendAt) {
|
|
42
|
+
notificationTimeStampDate = sendAt instanceof Date ? sendAt : new Date(sendAt);
|
|
43
|
+
shouldSendInstantly = notificationTimeStampDate.getTime() <= Date.now();
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
// Request permissions (required for iOS)
|
|
47
|
+
react_native_2.Platform.OS == 'ios' && (yield react_native_1.default.requestPermission());
|
|
48
|
+
// Create a channel (required for Android)
|
|
49
|
+
const channelId = yield react_native_1.default.createChannel({
|
|
50
|
+
id: 'default',
|
|
51
|
+
name: 'Default Channel',
|
|
52
|
+
});
|
|
53
|
+
// /** @type {import('@notifee/react-native').Notification} */
|
|
54
|
+
const notification = {
|
|
55
|
+
id: notificationId,
|
|
56
|
+
title: notificationTitle,
|
|
57
|
+
body: notificationBody,
|
|
58
|
+
android: {
|
|
59
|
+
channelId,
|
|
60
|
+
pressAction: {
|
|
61
|
+
id: 'default',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
data: {},
|
|
65
|
+
};
|
|
66
|
+
if (notificationImageUrl) {
|
|
67
|
+
notification.android.style = {
|
|
68
|
+
type: react_native_1.AndroidStyle.BIGPICTURE,
|
|
69
|
+
picture: notificationImageUrl,
|
|
70
|
+
};
|
|
71
|
+
notification.ios = {
|
|
72
|
+
attachments: [{
|
|
73
|
+
url: notificationImageUrl,
|
|
74
|
+
}]
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
if (action) {
|
|
78
|
+
notification.data.action = typeof action === 'object' ? JSON.stringify(action) : action;
|
|
79
|
+
}
|
|
80
|
+
if (shouldSendInstantly) {
|
|
81
|
+
// Display notification immediately
|
|
82
|
+
yield react_native_1.default.displayNotification(notification);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
// Schedule notification for future
|
|
86
|
+
const trigger = {
|
|
87
|
+
type: react_native_1.TriggerType.TIMESTAMP,
|
|
88
|
+
timestamp: notificationTimeStampDate.getTime(),
|
|
89
|
+
alarmManager: {
|
|
90
|
+
allowWhileIdle: true,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
yield react_native_1.default.createTriggerNotification(notification, trigger);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
console.error('error', error);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
exports.triggerPushNotification = triggerPushNotification;
|
|
101
|
+
const cancelTriggerPushNotification = ({ id, scheduled }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
102
|
+
try {
|
|
103
|
+
if (scheduled)
|
|
104
|
+
yield react_native_1.default.cancelTriggerNotification(id);
|
|
105
|
+
else
|
|
106
|
+
yield react_native_1.default.cancelDisplayedNotification(id);
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
console.error('error', error);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
exports.cancelTriggerPushNotification = cancelTriggerPushNotification;
|
|
113
|
+
//# sourceMappingURL=pushNotification.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pushNotification.native.js","sourceRoot":"","sources":["../../../../src/utils/pushNotification.native.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,sEAAyH;AACzH,+CAAwC;AAWjC,MAAM,uBAAuB,GAAG,CAAO,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,EAAkC,EAAE,EAAE;IAErM,IAAI,yBAAyB,GAAS,IAAI,CAAC;IAC3C,IAAI,mBAAmB,GAAG,IAAI,CAAC;IAE/B,IAAI,MAAM,EAAE;QACV,yBAAyB,GAAG,MAAM,YAAY,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/E,mBAAmB,GAAG,yBAAyB,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;KACzE;IAED,IAAI;QACF,yCAAyC;QACzC,uBAAQ,CAAC,EAAE,IAAI,KAAK,KAAI,MAAM,sBAAO,CAAC,iBAAiB,EAAE,CAAA,CAAA;QAEzD,0CAA0C;QAC1C,MAAM,SAAS,GAAG,MAAM,sBAAO,CAAC,aAAa,CAAC;YAC5C,EAAE,EAAE,SAAS;YACb,IAAI,EAAE,iBAAiB;SACxB,CAAC,CAAC;QACH,8DAA8D;QAC9D,MAAM,YAAY,GAAwB;YACxC,EAAE,EAAE,cAAc;YAClB,KAAK,EAAE,iBAAiB;YACxB,IA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B,CAAC,EAAE,CAAC,CAAA;;YACrD,MAAM,sBAAO,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;KACpD;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAC/B;AACH,CAAC,CAAA,CAAA;AAPY,QAAA,6BAA6B,iCAOzC"}
|
package/dist/types/main.ai.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ type BaseIconProps = {
|
|
|
31
31
|
onPress?: any;
|
|
32
32
|
};
|
|
33
33
|
declare const BaseIcon: React$1.ComponentType<BaseIconProps>;
|
|
34
|
+
type EffectType = "none" | "shrink" | "dim" | "shrink-dim" | "push-down" | "gentle-shrink" | "tilt" | "bounce" | "squeeze" | "pop" | "wobble";
|
|
34
35
|
type ButtonSize = "sm" | "md" | "lg" | "xl" | "2xl";
|
|
35
36
|
interface BaseButtonProps extends ViewProps, FontWeightProps<Theme>, FontSizeProps<Theme>, LayoutProps<Theme>, SpaceProps<Theme>, BackgroundColorProps<Theme>, BorderProps<Theme> {
|
|
36
37
|
disabled?: boolean;
|
|
@@ -45,11 +46,11 @@ interface BaseButtonProps extends ViewProps, FontWeightProps<Theme>, FontSizePro
|
|
|
45
46
|
icon?: IconIdentifier;
|
|
46
47
|
iconPosition?: "left" | "right";
|
|
47
48
|
iconSize?: number;
|
|
49
|
+
pressEffect?: EffectType;
|
|
48
50
|
}
|
|
49
51
|
declare const BaseButton: React$1.FC<BaseButtonProps>;
|
|
50
52
|
type HapticType = "impactLight" | "impactMedium" | "impactHeavy" | "rigid" | "soft" | "notificationSuccess" | "notificationWarning" | "notificationError";
|
|
51
53
|
export declare const triggerHapticFeedback: (_type: HapticType) => void;
|
|
52
|
-
type EffectType = "none" | "shrink" | "dim" | "shrink-dim" | "push-down" | "gentle-shrink" | "tilt" | "bounce" | "squeeze" | "pop" | "wobble";
|
|
53
54
|
interface BaseActionableProps extends PressableProps {
|
|
54
55
|
pressEffect?: EffectType;
|
|
55
56
|
hapticFeedback?: HapticType;
|
|
@@ -2,7 +2,7 @@ import { Action } from '@evlop/commons';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PressableProps } from 'react-native';
|
|
4
4
|
import { HapticType } from './utils/haptic';
|
|
5
|
-
|
|
5
|
+
import { EffectType } from './hooks/useAnimatedPress';
|
|
6
6
|
export interface BaseActionableProps extends PressableProps {
|
|
7
7
|
pressEffect?: EffectType;
|
|
8
8
|
hapticFeedback?: HapticType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actionable.d.ts","sourceRoot":"","sources":["../../../src/Actionable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA2B,MAAM,gBAAgB,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"Actionable.d.ts","sourceRoot":"","sources":["../../../src/Actionable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA2B,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAA8C,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAyB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAoB,MAAM,0BAA0B,CAAC;AAIxE,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACvD,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAWD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAsBnE,CAAA;;;;;;;;;;AAED,wBAImB"}
|
|
@@ -2,6 +2,7 @@ import { Action, Color, IconIdentifier, Theme } from '@evlop/commons';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { TextStyle, ViewProps } from 'react-native';
|
|
4
4
|
import { BackgroundColorProps, BorderProps, FontSizeProps, FontWeightProps, LayoutProps, SpaceProps } from 'styled-system';
|
|
5
|
+
import { EffectType } from './hooks/useAnimatedPress';
|
|
5
6
|
declare type ButtonSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
6
7
|
export interface BaseButtonProps extends ViewProps, FontWeightProps<Theme>, FontSizeProps<Theme>, LayoutProps<Theme>, SpaceProps<Theme>, BackgroundColorProps<Theme>, BorderProps<Theme> {
|
|
7
8
|
disabled?: boolean;
|
|
@@ -16,6 +17,7 @@ export interface BaseButtonProps extends ViewProps, FontWeightProps<Theme>, Font
|
|
|
16
17
|
icon?: IconIdentifier;
|
|
17
18
|
iconPosition?: 'left' | 'right';
|
|
18
19
|
iconSize?: number;
|
|
20
|
+
pressEffect?: EffectType;
|
|
19
21
|
}
|
|
20
22
|
export declare const BaseButton: React.FC<BaseButtonProps>;
|
|
21
23
|
declare const ButtonWithSettings: (props: BaseButtonProps & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAgC,MAAM,gBAAgB,CAAC;AAEpG,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAgC,MAAM,gBAAgB,CAAC;AAEpG,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA0C,SAAS,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAC;AAElG,OAAO,EAAmB,oBAAoB,EAAU,WAAW,EAAE,aAAa,EAAE,eAAe,EAAU,WAAW,EAAS,UAAU,EAAuB,MAAM,eAAe,CAAC;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ources":["../../../../src/RenderPage/index.tsx"],"names":[],"mappings":";;AAcA,eAAO,MAAM,UAAU;;iBAiHtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,4BAA6B,GAAG,qDAA2C,CAAC;AAE7G,eAAO,MAAM,uBAAuB,UAAkB,GAAG,aAAa,GAAG,EAAE;;sCA4BxD,CAAC;AAEpB,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Animated } from 'react-native';
|
|
2
|
+
export declare type EffectType = 'none' | 'shrink' | 'dim' | 'shrink-dim' | 'push-down' | 'gentle-shrink' | 'tilt' | 'bounce' | 'squeeze' | 'pop' | 'wobble';
|
|
3
|
+
export declare const useAnimatedPress: (effect: EffectType) => {
|
|
4
|
+
handlePressIn?: undefined;
|
|
5
|
+
handlePressOut?: undefined;
|
|
6
|
+
animatedStyle?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
handlePressIn: () => void;
|
|
9
|
+
handlePressOut: () => void;
|
|
10
|
+
animatedStyle: {
|
|
11
|
+
opacity: Animated.AnimatedInterpolation<string | number>;
|
|
12
|
+
transform?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
transform: {
|
|
15
|
+
scale: Animated.AnimatedInterpolation<string | number>;
|
|
16
|
+
}[];
|
|
17
|
+
opacity: Animated.AnimatedInterpolation<string | number>;
|
|
18
|
+
} | {
|
|
19
|
+
transform: ({
|
|
20
|
+
scale: Animated.AnimatedInterpolation<string | number>;
|
|
21
|
+
translateY?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
translateY: Animated.AnimatedInterpolation<string | number>;
|
|
24
|
+
scale?: undefined;
|
|
25
|
+
})[];
|
|
26
|
+
opacity?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
transform: ({
|
|
29
|
+
scale: Animated.AnimatedInterpolation<string | number>;
|
|
30
|
+
rotateZ?: undefined;
|
|
31
|
+
perspective?: undefined;
|
|
32
|
+
} | {
|
|
33
|
+
rotateZ: Animated.AnimatedInterpolation<string | number>;
|
|
34
|
+
scale?: undefined;
|
|
35
|
+
perspective?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
perspective: Animated.AnimatedInterpolation<string | number>;
|
|
38
|
+
scale?: undefined;
|
|
39
|
+
rotateZ?: undefined;
|
|
40
|
+
})[];
|
|
41
|
+
opacity?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
transform: ({
|
|
44
|
+
scaleX: Animated.AnimatedInterpolation<string | number>;
|
|
45
|
+
scaleY?: undefined;
|
|
46
|
+
} | {
|
|
47
|
+
scaleY: Animated.AnimatedInterpolation<string | number>;
|
|
48
|
+
scaleX?: undefined;
|
|
49
|
+
})[];
|
|
50
|
+
opacity?: undefined;
|
|
51
|
+
} | {
|
|
52
|
+
opacity?: undefined;
|
|
53
|
+
transform?: undefined;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=useAnimatedPress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnimatedPress.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useAnimatedPress.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,oBAAY,UAAU,GAChB,MAAM,GACN,QAAQ,GACR,KAAK,GACL,YAAY,GACZ,WAAW,GACX,eAAe,GACf,MAAM,GACN,QAAQ,GACR,SAAS,GACT,KAAK,GACL,QAAQ,CAAC;AAEf,eAAO,MAAM,gBAAgB,WAAY,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqKlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Action } from "@evlop/commons";
|
|
2
|
+
interface TriggerPushNotificationOptions {
|
|
3
|
+
id?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
body?: string;
|
|
6
|
+
image?: string;
|
|
7
|
+
action?: Action;
|
|
8
|
+
sendAt?: Date;
|
|
9
|
+
}
|
|
10
|
+
export declare function triggerPushNotification({ id, title, body, image, action, sendAt }: TriggerPushNotificationOptions): Promise<void>;
|
|
11
|
+
export declare function cancelTriggerPushNotification(id: string): Promise<void>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=pushNotification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pushNotification.d.ts","sourceRoot":"","sources":["../../../../src/utils/pushNotification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,UAAU,8BAA8B;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,IAAI,CAAC;CACjB;AAED,wBAAsB,uBAAuB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,8BAA8B,iBAAI;AAE5H,wBAAsB,6BAA6B,CAAC,EAAE,EAAE,MAAM,iBAAI"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Action } from '@evlop/commons';
|
|
2
|
+
interface TriggerPushNotificationOptions {
|
|
3
|
+
id?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
body?: string;
|
|
6
|
+
image?: string;
|
|
7
|
+
action?: Action;
|
|
8
|
+
sendAt?: Date;
|
|
9
|
+
}
|
|
10
|
+
export declare const triggerPushNotification: ({ id: notificationId, title: notificationTitle, body: notificationBody, image: notificationImageUrl, action, sendAt }: TriggerPushNotificationOptions) => Promise<void>;
|
|
11
|
+
interface CancelTriggerPushNotificationOptions {
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* If true, cancel the scheduled notification. If false, cancel the displayed notification. (default: false) */
|
|
15
|
+
scheduled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const cancelTriggerPushNotification: ({ id, scheduled }: CancelTriggerPushNotificationOptions) => Promise<void>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=pushNotification.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pushNotification.native.d.ts","sourceRoot":"","sources":["../../../../src/utils/pushNotification.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAIxC,UAAU,8BAA8B;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,IAAI,CAAC;CACf;AAED,eAAO,MAAM,uBAAuB,0HAAiI,8BAA8B,kBAmElM,CAAA;AAED,UAAU,oCAAoC;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX;mHAC+G;IAC/G,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,6BAA6B,sBAA6B,oCAAoC,kBAO1G,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evlop/native-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.256",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/main.js",
|
|
6
6
|
"types": "dist/types/main.d.ts",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"license": "ISC",
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@evlop/commons": "^1.0.137",
|
|
24
|
+
"@notifee/react-native": "^9.1.8",
|
|
24
25
|
"@react-navigation/elements": "^2.9.3",
|
|
25
26
|
"i18next": "^21.8.9",
|
|
26
27
|
"lodash": "^4.17.15",
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@evlop/commons": "^1.0.369",
|
|
45
|
+
"@notifee/react-native": "*",
|
|
44
46
|
"@react-navigation/elements": "*",
|
|
45
47
|
"@react-navigation/native": "^7.1.17",
|
|
46
48
|
"@types/lodash": "^4.14.178",
|