react-native-divkit 1.2.1 → 1.4.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/README.md +64 -2
- package/dist/components/text/DivText.d.ts.map +1 -1
- package/dist/components/text/DivText.js +24 -3
- package/dist/components/text/DivText.js.map +1 -1
- package/dist/components/utilities/Outer.d.ts +2 -2
- package/dist/components/utilities/Outer.d.ts.map +1 -1
- package/dist/components/utilities/Outer.js +112 -23
- package/dist/components/utilities/Outer.js.map +1 -1
- package/dist/utils/flattenAnimation.d.ts +4 -0
- package/dist/utils/flattenAnimation.d.ts.map +1 -0
- package/dist/utils/flattenAnimation.js +13 -0
- package/dist/utils/flattenAnimation.js.map +1 -0
- package/package.json +1 -1
- package/src/components/text/DivText.tsx +31 -4
- package/src/components/utilities/Outer.tsx +150 -24
- package/src/types/actionable.d.ts +15 -0
- package/src/types/animation.d.ts +19 -0
- package/src/utils/flattenAnimation.ts +16 -0
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ DivKit — это фреймворк для построения UI на осн
|
|
|
11
11
|
|
|
12
12
|
## Статус
|
|
13
13
|
|
|
14
|
-
**MVP
|
|
14
|
+
**MVP**
|
|
15
15
|
|
|
16
16
|
| Функция | Статус |
|
|
17
17
|
| ------------------- | ----------- |
|
|
@@ -23,6 +23,7 @@ DivKit — это фреймворк для построения UI на осн
|
|
|
23
23
|
| Движок выражений | ✅ Готово |
|
|
24
24
|
| Обработчики действий| ✅ Готово |
|
|
25
25
|
| Подстановка шаблонов| ✅ Готово |
|
|
26
|
+
| Анимации нажатия | ✅ Готово |
|
|
26
27
|
|
|
27
28
|
## Скриншоты
|
|
28
29
|
|
|
@@ -241,6 +242,67 @@ export default function App() {
|
|
|
241
242
|
}
|
|
242
243
|
```
|
|
243
244
|
|
|
245
|
+
## Анимации нажатия (Action Animation)
|
|
246
|
+
|
|
247
|
+
Компоненты с действиями могут иметь анимацию при нажатии. Поддерживаются анимации `fade` (прозрачность), `scale` (масштаб) и их комбинация через `set`.
|
|
248
|
+
|
|
249
|
+
```json
|
|
250
|
+
{
|
|
251
|
+
"type": "text",
|
|
252
|
+
"text": "Нажми меня",
|
|
253
|
+
"actions": [
|
|
254
|
+
{
|
|
255
|
+
"log_id": "button_tap",
|
|
256
|
+
"url": "div-action://tap"
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
"action_animation": {
|
|
260
|
+
"name": "fade",
|
|
261
|
+
"start_value": 1,
|
|
262
|
+
"end_value": 0.4,
|
|
263
|
+
"duration": 500,
|
|
264
|
+
"interpolator": "ease_in_out"
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Комбинированная анимация (Set)
|
|
270
|
+
|
|
271
|
+
```json
|
|
272
|
+
{
|
|
273
|
+
"action_animation": {
|
|
274
|
+
"name": "set",
|
|
275
|
+
"items": [
|
|
276
|
+
{
|
|
277
|
+
"name": "fade",
|
|
278
|
+
"start_value": 1,
|
|
279
|
+
"end_value": 0.2,
|
|
280
|
+
"duration": 300,
|
|
281
|
+
"interpolator": "ease_in_out"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "scale",
|
|
285
|
+
"start_value": 1,
|
|
286
|
+
"end_value": 0.5,
|
|
287
|
+
"duration": 500,
|
|
288
|
+
"interpolator": "ease_in_out"
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Параметры анимации
|
|
296
|
+
|
|
297
|
+
| Параметр | Тип | По умолч. | Описание |
|
|
298
|
+
| -------------- | ------- | ------------ | --------------------------- |
|
|
299
|
+
| `name` | string | — | `fade`, `scale`, `set`, `native`, `no_animation` |
|
|
300
|
+
| `start_value` | number | `1` | Начальное значение |
|
|
301
|
+
| `end_value` | number | `1` | Конечное значение |
|
|
302
|
+
| `duration` | number | `300` | Длительность в миллисекундах|
|
|
303
|
+
| `start_delay` | number | `0` | Задержка перед стартом |
|
|
304
|
+
| `interpolator` | string | `ease_in_out`| `linear`, `ease`, `ease_in`, `ease_out`, `ease_in_out`, `spring` |
|
|
305
|
+
|
|
244
306
|
## Свойства (Props)
|
|
245
307
|
|
|
246
308
|
| Свойство | Тип | Обязательно | Описание |
|
|
@@ -297,7 +359,7 @@ npm run ios # или npm run android
|
|
|
297
359
|
- Input (Ввод), Select (Выбор), Switch (Переключатель)
|
|
298
360
|
- Видео, Lottie-анимации
|
|
299
361
|
- Диапазоны текста, сложные градиенты
|
|
300
|
-
- Продвинутые переходы
|
|
362
|
+
- Продвинутые переходы (transition_in/transition_out)
|
|
301
363
|
- API пользовательских компонентов
|
|
302
364
|
|
|
303
365
|
## Архитектура
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DivText.d.ts","sourceRoot":"","sources":["../../../src/components/text/DivText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAsC,MAAM,kBAAkB,CAAC;AAKxF,MAAM,WAAW,YAAY;IACzB,gBAAgB,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;CACnD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,OAAO,CAAC,EAAE,gBAAgB,EAAE,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"DivText.d.ts","sourceRoot":"","sources":["../../../src/components/text/DivText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAsC,MAAM,kBAAkB,CAAC;AAKxF,MAAM,WAAW,YAAY;IACzB,gBAAgB,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;CACnD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,OAAO,CAAC,EAAE,gBAAgB,EAAE,EAAE,YAAY,qBA2LzD"}
|
|
@@ -31,6 +31,7 @@ export function DivText({ componentContext }) {
|
|
|
31
31
|
const fontSize = useDerivedFromVarsSimple(json.font_size || 12, variables || new Map());
|
|
32
32
|
const textColor = useDerivedFromVarsSimple(json.text_color || '#000000', variables || new Map());
|
|
33
33
|
const textAlignmentHorizontal = useDerivedFromVarsSimple(json.text_alignment_horizontal || 'start', variables || new Map());
|
|
34
|
+
const textAlignmentVertical = useDerivedFromVarsSimple(json.text_alignment_vertical || 'top', variables || new Map());
|
|
34
35
|
const fontSizeUnit = useDerivedFromVarsSimple(json.font_size_unit || 'sp', variables || new Map());
|
|
35
36
|
const maxLines = useDerivedFromVarsSimple(json.max_lines, variables || new Map());
|
|
36
37
|
// Convert size value based on font_size_unit
|
|
@@ -147,9 +148,29 @@ export function DivText({ componentContext }) {
|
|
|
147
148
|
}
|
|
148
149
|
return undefined;
|
|
149
150
|
}, [json.truncate, numberOfLines]);
|
|
150
|
-
//
|
|
151
|
-
//
|
|
152
|
-
|
|
151
|
+
// Build wrapper style for text block alignment inside the Outer container
|
|
152
|
+
// In Web, .text is display:flex with justify-content (halign) and align-items (valign)
|
|
153
|
+
// In RN (column layout): justifyContent = vertical, alignItems = horizontal
|
|
154
|
+
const outerStyle = useMemo(() => {
|
|
155
|
+
const style = {};
|
|
156
|
+
// Vertical alignment of text block
|
|
157
|
+
switch (textAlignmentVertical) {
|
|
158
|
+
case 'center':
|
|
159
|
+
style.justifyContent = 'center';
|
|
160
|
+
break;
|
|
161
|
+
case 'bottom':
|
|
162
|
+
style.justifyContent = 'flex-end';
|
|
163
|
+
break;
|
|
164
|
+
case 'baseline':
|
|
165
|
+
style.justifyContent = 'flex-end';
|
|
166
|
+
break;
|
|
167
|
+
default: // top
|
|
168
|
+
style.justifyContent = 'flex-start';
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
return style;
|
|
172
|
+
}, [textAlignmentVertical]);
|
|
173
|
+
return (<Outer componentContext={componentContext} style={outerStyle}>
|
|
153
174
|
<Text style={textStyle} numberOfLines={numberOfLines} ellipsizeMode={ellipsizeMode} allowFontScaling={allowFontScaling}>
|
|
154
175
|
{text}
|
|
155
176
|
</Text>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DivText.js","sourceRoot":"","sources":["../../../src/components/text/DivText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"DivText.js","sourceRoot":"","sources":["../../../src/components/text/DivText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AAGtE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAM/D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,gBAAgB,EAAgB;IACtD,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAC3D,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,gBAAgB,CAAC;IAE7C,4EAA4E;IAC5E,MAAM,IAAI,GAAG,wBAAwB,CAAS,IAAI,CAAC,IAAI,IAAI,EAAE,EAAE,SAAS,IAAI,IAAI,GAAG,EAAE,CAAC,CAAC;IAEvF,MAAM,QAAQ,GAAG,wBAAwB,CAAS,IAAI,CAAC,SAAS,IAAI,EAAE,EAAE,SAAS,IAAI,IAAI,GAAG,EAAE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UAAU,CAAC;gBAClC,MAAM;YACV,SAAS,MAAM;gBACX,KAAK,CAAC,cAAc,GAAG,YAAY,CAAC;gBACpC,MAAM;QACd,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC,EAAE,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAE5B,OAAO,CACH,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CACzD;YAAA,CAAC,IAAI,CACD,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CAEnC;gBAAA,CAAC,IAAI,CACT;YAAA,EAAE,IAAI,CACV;QAAA,EAAE,KAAK,CAAC,CACX,CAAC;AACN,CAAC"}
|
|
@@ -9,9 +9,9 @@ export interface OuterProps<T extends DivBaseData = DivBaseData> {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Outer component - base wrapper for all DivKit components
|
|
12
|
-
* Handles visibility, sizing, padding, margins, background, borders, and
|
|
12
|
+
* Handles visibility, sizing, padding, margins, background, borders, actions and action_animation
|
|
13
13
|
*
|
|
14
|
-
* Based on Web Outer.svelte
|
|
14
|
+
* Based on Web Outer.svelte
|
|
15
15
|
*/
|
|
16
16
|
export declare function Outer<T extends DivBaseData = DivBaseData>({ componentContext, children, style: customStyle }: OuterProps<T>): React.JSX.Element | null;
|
|
17
17
|
//# sourceMappingURL=Outer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Outer.d.ts","sourceRoot":"","sources":["../../../src/components/utilities/Outer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"Outer.d.ts","sourceRoot":"","sources":["../../../src/components/utilities/Outer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAgC,MAAM,OAAO,CAAC;AACvE,OAAO,EAA6B,SAAS,EAAsC,MAAM,cAAc,CAAC;AACxG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAqFpD,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW;IAC3D,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,EACvD,gBAAgB,EAChB,QAAQ,EACR,KAAK,EAAE,WAAW,EACrB,EAAE,UAAU,CAAC,CAAC,CAAC,4BA0Sf"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import { View, Pressable, StyleSheet } from 'react-native';
|
|
1
|
+
import React, { useMemo, useRef, useCallback } from 'react';
|
|
2
|
+
import { View, Pressable, Animated, StyleSheet, Easing } from 'react-native';
|
|
3
3
|
import { useDerivedFromVarsSimple } from '../../hooks/useDerivedFromVars';
|
|
4
4
|
import { useActionHandler, useHasActions } from '../../hooks/useAction';
|
|
5
5
|
import { useDivKitContext } from '../../context/DivKitContext';
|
|
6
6
|
import { useLayoutParams } from '../../context/LayoutParamsContext';
|
|
7
7
|
import { Background } from './Background';
|
|
8
|
+
import { flattenAnimation } from '../../utils/flattenAnimation';
|
|
8
9
|
function resolveAlignSelf(alignment, dir) {
|
|
9
10
|
if (!alignment)
|
|
10
11
|
return undefined;
|
|
@@ -23,18 +24,55 @@ function resolveAlignSelf(alignment, dir) {
|
|
|
23
24
|
return undefined;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
27
|
+
function interpolationToEasing(interpolator) {
|
|
28
|
+
switch (interpolator) {
|
|
29
|
+
case 'linear':
|
|
30
|
+
return Easing.linear;
|
|
31
|
+
case 'ease':
|
|
32
|
+
return Easing.ease;
|
|
33
|
+
case 'ease_in':
|
|
34
|
+
return Easing.in(Easing.ease);
|
|
35
|
+
case 'ease_out':
|
|
36
|
+
return Easing.out(Easing.ease);
|
|
37
|
+
case 'ease_in_out':
|
|
38
|
+
return Easing.inOut(Easing.ease);
|
|
39
|
+
case 'spring':
|
|
40
|
+
return Easing.inOut(Easing.ease);
|
|
41
|
+
default:
|
|
42
|
+
return Easing.inOut(Easing.ease);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function parseActionAnimations(animation) {
|
|
46
|
+
if (!animation)
|
|
47
|
+
return [];
|
|
48
|
+
const list = flattenAnimation(animation);
|
|
49
|
+
const result = [];
|
|
50
|
+
for (const anim of list) {
|
|
51
|
+
if (anim.name === 'fade' || anim.name === 'scale') {
|
|
52
|
+
result.push({
|
|
53
|
+
type: anim.name,
|
|
54
|
+
startValue: anim.start_value ?? 1,
|
|
55
|
+
endValue: anim.end_value ?? 1,
|
|
56
|
+
duration: Math.max(0, anim.duration ?? 300),
|
|
57
|
+
startDelay: Math.max(0, anim.start_delay ?? 0),
|
|
58
|
+
easing: interpolationToEasing(anim.interpolator),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
// 'native' and 'no_animation' are ignored
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
26
65
|
/**
|
|
27
66
|
* Outer component - base wrapper for all DivKit components
|
|
28
|
-
* Handles visibility, sizing, padding, margins, background, borders, and
|
|
67
|
+
* Handles visibility, sizing, padding, margins, background, borders, actions and action_animation
|
|
29
68
|
*
|
|
30
|
-
* Based on Web Outer.svelte
|
|
69
|
+
* Based on Web Outer.svelte
|
|
31
70
|
*/
|
|
32
71
|
export function Outer({ componentContext, children, style: customStyle }) {
|
|
33
72
|
const { direction } = useDivKitContext();
|
|
34
73
|
const layoutParams = useLayoutParams();
|
|
35
74
|
const { json, variables } = componentContext;
|
|
36
75
|
// Only use reactive hooks for truly dynamic properties (visibility, alpha)
|
|
37
|
-
// For MVP, other properties are read directly from JSON (can be enhanced later)
|
|
38
76
|
const visibility = useDerivedFromVarsSimple(json.visibility || 'visible', variables || new Map());
|
|
39
77
|
const alpha = useDerivedFromVarsSimple(json.alpha !== undefined ? json.alpha : 1, variables || new Map());
|
|
40
78
|
// Paddings and margins need expression evaluation (e.g. @{safeAreaTop})
|
|
@@ -46,11 +84,51 @@ export function Outer({ componentContext, children, style: customStyle }) {
|
|
|
46
84
|
const height = useDerivedFromVarsSimple(json.height, variables || new Map());
|
|
47
85
|
const alignmentHorizontal = useDerivedFromVarsSimple(json.alignment_horizontal, variables || new Map());
|
|
48
86
|
const alignmentVertical = useDerivedFromVarsSimple(json.alignment_vertical, variables || new Map());
|
|
49
|
-
// Actions
|
|
87
|
+
// Actions
|
|
50
88
|
const jsonAny = json;
|
|
51
89
|
const actions = jsonAny.actions || (jsonAny.action ? [jsonAny.action] : []);
|
|
52
90
|
const hasActions = useHasActions(actions);
|
|
53
91
|
const handlePress = useActionHandler(actions, { componentContext });
|
|
92
|
+
// Action animation
|
|
93
|
+
const actionAnimation = jsonAny.action_animation;
|
|
94
|
+
const parsedAnimations = useMemo(() => parseActionAnimations(actionAnimation), [actionAnimation]);
|
|
95
|
+
const hasFadeAnimation = parsedAnimations.some(a => a.type === 'fade');
|
|
96
|
+
const hasScaleAnimation = parsedAnimations.some(a => a.type === 'scale');
|
|
97
|
+
// Animated values (created once, stable refs)
|
|
98
|
+
const animOpacity = useRef(new Animated.Value(1)).current;
|
|
99
|
+
const animScale = useRef(new Animated.Value(1)).current;
|
|
100
|
+
const onPressIn = useCallback(() => {
|
|
101
|
+
if (parsedAnimations.length === 0)
|
|
102
|
+
return;
|
|
103
|
+
const anims = [];
|
|
104
|
+
for (const anim of parsedAnimations) {
|
|
105
|
+
const target = anim.type === 'fade' ? animOpacity : animScale;
|
|
106
|
+
anims.push(Animated.timing(target, {
|
|
107
|
+
toValue: anim.endValue,
|
|
108
|
+
duration: anim.duration,
|
|
109
|
+
delay: anim.startDelay,
|
|
110
|
+
easing: anim.easing,
|
|
111
|
+
useNativeDriver: true,
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
Animated.parallel(anims).start();
|
|
115
|
+
}, [parsedAnimations, animOpacity, animScale]);
|
|
116
|
+
const onPressOut = useCallback(() => {
|
|
117
|
+
if (parsedAnimations.length === 0)
|
|
118
|
+
return;
|
|
119
|
+
const anims = [];
|
|
120
|
+
for (const anim of parsedAnimations) {
|
|
121
|
+
const target = anim.type === 'fade' ? animOpacity : animScale;
|
|
122
|
+
anims.push(Animated.timing(target, {
|
|
123
|
+
toValue: anim.startValue,
|
|
124
|
+
duration: anim.duration,
|
|
125
|
+
delay: anim.startDelay,
|
|
126
|
+
easing: anim.easing,
|
|
127
|
+
useNativeDriver: true,
|
|
128
|
+
}));
|
|
129
|
+
}
|
|
130
|
+
Animated.parallel(anims).start();
|
|
131
|
+
}, [parsedAnimations, animOpacity, animScale]);
|
|
54
132
|
// Early return for gone visibility
|
|
55
133
|
if (visibility === 'gone') {
|
|
56
134
|
return null;
|
|
@@ -74,7 +152,6 @@ export function Outer({ componentContext, children, style: customStyle }) {
|
|
|
74
152
|
}
|
|
75
153
|
else if (widthVal.type === 'match_parent') {
|
|
76
154
|
styles.alignSelf = 'stretch';
|
|
77
|
-
// flexGrow only on the main axis (horizontal parent)
|
|
78
155
|
if (parentOrientation === 'horizontal') {
|
|
79
156
|
styles.flexGrow = widthVal.weight || 1;
|
|
80
157
|
styles.flexShrink = 1;
|
|
@@ -86,9 +163,7 @@ export function Outer({ componentContext, children, style: customStyle }) {
|
|
|
86
163
|
}
|
|
87
164
|
}
|
|
88
165
|
else {
|
|
89
|
-
// Default: match_parent
|
|
90
166
|
styles.alignSelf = 'stretch';
|
|
91
|
-
// flexGrow only on the main axis (horizontal parent) or outside a container
|
|
92
167
|
if (!parentOrientation || parentOrientation === 'horizontal') {
|
|
93
168
|
styles.flexGrow = 1;
|
|
94
169
|
styles.flexShrink = 1;
|
|
@@ -101,16 +176,13 @@ export function Outer({ componentContext, children, style: customStyle }) {
|
|
|
101
176
|
styles.height = heightVal.value;
|
|
102
177
|
}
|
|
103
178
|
else if (heightVal.type === 'match_parent') {
|
|
104
|
-
// flexGrow only on the main axis (vertical parent)
|
|
105
179
|
if (parentOrientation === 'vertical') {
|
|
106
180
|
styles.flexGrow = heightVal.weight || 1;
|
|
107
181
|
}
|
|
108
182
|
else {
|
|
109
|
-
// Cross axis — stretch via alignSelf or explicit height
|
|
110
183
|
styles.alignSelf = 'stretch';
|
|
111
184
|
}
|
|
112
185
|
}
|
|
113
|
-
// wrap_content is default in React Native
|
|
114
186
|
}
|
|
115
187
|
// Paddings
|
|
116
188
|
if (paddings) {
|
|
@@ -119,7 +191,6 @@ export function Outer({ componentContext, children, style: customStyle }) {
|
|
|
119
191
|
styles.paddingTop = p.top;
|
|
120
192
|
if (p.bottom !== undefined)
|
|
121
193
|
styles.paddingBottom = p.bottom;
|
|
122
|
-
// Handle RTL for start/end
|
|
123
194
|
if (direction === 'rtl') {
|
|
124
195
|
if (p.start !== undefined)
|
|
125
196
|
styles.paddingRight = p.start;
|
|
@@ -132,7 +203,6 @@ export function Outer({ componentContext, children, style: customStyle }) {
|
|
|
132
203
|
if (p.end !== undefined)
|
|
133
204
|
styles.paddingRight = p.end;
|
|
134
205
|
}
|
|
135
|
-
// Fallback to left/right if start/end not provided
|
|
136
206
|
if (p.left !== undefined && p.start === undefined) {
|
|
137
207
|
styles.paddingLeft = p.left;
|
|
138
208
|
}
|
|
@@ -147,7 +217,6 @@ export function Outer({ componentContext, children, style: customStyle }) {
|
|
|
147
217
|
styles.marginTop = m.top;
|
|
148
218
|
if (m.bottom !== undefined)
|
|
149
219
|
styles.marginBottom = m.bottom;
|
|
150
|
-
// Handle RTL for start/end
|
|
151
220
|
if (direction === 'rtl') {
|
|
152
221
|
if (m.start !== undefined)
|
|
153
222
|
styles.marginRight = m.start;
|
|
@@ -160,7 +229,6 @@ export function Outer({ componentContext, children, style: customStyle }) {
|
|
|
160
229
|
if (m.end !== undefined)
|
|
161
230
|
styles.marginRight = m.end;
|
|
162
231
|
}
|
|
163
|
-
// Fallback to left/right
|
|
164
232
|
if (m.left !== undefined && m.start === undefined) {
|
|
165
233
|
styles.marginLeft = m.left;
|
|
166
234
|
}
|
|
@@ -168,7 +236,6 @@ export function Outer({ componentContext, children, style: customStyle }) {
|
|
|
168
236
|
styles.marginRight = m.right;
|
|
169
237
|
}
|
|
170
238
|
}
|
|
171
|
-
// Background handled by Background component
|
|
172
239
|
// Border
|
|
173
240
|
if (border) {
|
|
174
241
|
const b = border;
|
|
@@ -179,12 +246,10 @@ export function Outer({ componentContext, children, style: customStyle }) {
|
|
|
179
246
|
styles.borderColor = strokeColor;
|
|
180
247
|
styles.borderStyle = b.stroke.style?.type === 'dashed' ? 'dashed' : 'solid';
|
|
181
248
|
}
|
|
182
|
-
// Border radius
|
|
183
249
|
if (b.corner_radius !== undefined) {
|
|
184
250
|
styles.borderRadius = b.corner_radius;
|
|
185
251
|
}
|
|
186
252
|
else if (b.corners_radius) {
|
|
187
|
-
// React Native supports individual corners
|
|
188
253
|
const corners = b.corners_radius;
|
|
189
254
|
if (corners['top-left'] !== undefined) {
|
|
190
255
|
styles.borderTopLeftRadius = corners['top-left'];
|
|
@@ -199,7 +264,9 @@ export function Outer({ componentContext, children, style: customStyle }) {
|
|
|
199
264
|
styles.borderBottomRightRadius = corners['bottom-right'];
|
|
200
265
|
}
|
|
201
266
|
}
|
|
202
|
-
|
|
267
|
+
if (b.corner_radius !== undefined || b.corners_radius) {
|
|
268
|
+
styles.overflow = 'hidden';
|
|
269
|
+
}
|
|
203
270
|
if (b.has_shadow) {
|
|
204
271
|
const shadow = b.shadow;
|
|
205
272
|
if (shadow) {
|
|
@@ -210,11 +277,9 @@ export function Outer({ componentContext, children, style: customStyle }) {
|
|
|
210
277
|
};
|
|
211
278
|
styles.shadowOpacity = shadow.alpha !== undefined ? shadow.alpha : 0.18;
|
|
212
279
|
styles.shadowRadius = shadow.blur || 2;
|
|
213
|
-
// Android elevation
|
|
214
280
|
styles.elevation = 3;
|
|
215
281
|
}
|
|
216
282
|
else {
|
|
217
|
-
// Default shadow
|
|
218
283
|
styles.shadowColor = '#000000';
|
|
219
284
|
styles.shadowOffset = { width: 0, height: 1 };
|
|
220
285
|
styles.shadowOpacity = 0.18;
|
|
@@ -243,8 +308,32 @@ export function Outer({ componentContext, children, style: customStyle }) {
|
|
|
243
308
|
res.borderBottomRightRadius = s.borderBottomRightRadius;
|
|
244
309
|
return res;
|
|
245
310
|
}, [finalStyle]);
|
|
246
|
-
// Render with
|
|
311
|
+
// Render with actions and animation
|
|
247
312
|
if (hasActions) {
|
|
313
|
+
const hasAnimation = parsedAnimations.length > 0;
|
|
314
|
+
if (hasAnimation) {
|
|
315
|
+
// Build animated style with opacity/scale overrides
|
|
316
|
+
const animatedStyle = { ...finalStyle };
|
|
317
|
+
if (hasFadeAnimation) {
|
|
318
|
+
const staticOpacity = animatedStyle.opacity;
|
|
319
|
+
if (staticOpacity !== undefined && staticOpacity !== 1) {
|
|
320
|
+
animatedStyle.opacity = Animated.multiply(animOpacity, staticOpacity);
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
animatedStyle.opacity = animOpacity;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
if (hasScaleAnimation) {
|
|
327
|
+
const existingTransform = animatedStyle.transform || [];
|
|
328
|
+
animatedStyle.transform = [...existingTransform, { scale: animScale }];
|
|
329
|
+
}
|
|
330
|
+
return (<Pressable onPress={handlePress} onPressIn={onPressIn} onPressOut={onPressOut} style={{ alignSelf: finalStyle?.alignSelf, flexGrow: finalStyle?.flexGrow, flexShrink: finalStyle?.flexShrink }}>
|
|
331
|
+
<Animated.View style={animatedStyle}>
|
|
332
|
+
<Background layers={background} style={borderStyle}/>
|
|
333
|
+
{children}
|
|
334
|
+
</Animated.View>
|
|
335
|
+
</Pressable>);
|
|
336
|
+
}
|
|
248
337
|
return (<Pressable onPress={handlePress} style={finalStyle}>
|
|
249
338
|
<Background layers={background} style={borderStyle}/>
|
|
250
339
|
{children}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Outer.js","sourceRoot":"","sources":["../../../src/components/utilities/Outer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,OAAO,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAa,UAAU,EAAE,MAAM,cAAc,CAAC;AAMtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,SAAS,gBAAgB,CACrB,SAA6B,EAC7B,GAAW;IAEX,IAAI,CAAC,SAAS;QAAE,OAAO,SAAS,CAAC;IACjC,QAAQ,SAAS,EAAE,CAAC;QAChB,KAAK,QAAQ;YACT,OAAO,QAAQ,CAAC;QACpB,KAAK,MAAM;YACP,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC;QACrD,KAAK,OAAO;YACR,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC;QACrD,KAAK,OAAO;YACR,OAAO,YAAY,CAAC;QACxB,KAAK,KAAK;YACN,OAAO,UAAU,CAAC;QACtB;YACI,OAAO,SAAS,CAAC;IACzB,CAAC;AACL,CAAC;AAQD;;;;;GAKG;A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AAW,CAAC,CACrB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAEhH;oBAAA,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CAChC;wBAAA,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,UAAiB,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,EAC1D;wBAAA,CAAC,QAAQ,CACb;oBAAA,EAAE,QAAQ,CAAC,IAAI,CACnB;gBAAA,EAAE,SAAS,CAAC,CACf,CAAC;QACN,CAAC;QAED,OAAO,CACH,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAC/C;gBAAA,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,UAAiB,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,EAC1D;gBAAA,CAAC,QAAQ,CACb;YAAA,EAAE,SAAS,CAAC,CACf,CAAC;IACN,CAAC;IAED,OAAO,CACH,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CACpB;YAAA,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,UAAiB,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,EAC1D;YAAA,CAAC,QAAQ,CACb;QAAA,EAAE,IAAI,CAAC,CACV,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { MaybeMissing } from '../expressions/json';
|
|
2
|
+
import type { Animation, AnyAnimation } from '../types/animation';
|
|
3
|
+
export declare function flattenAnimation(animation: MaybeMissing<Animation>): MaybeMissing<AnyAnimation>[];
|
|
4
|
+
//# sourceMappingURL=flattenAnimation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flattenAnimation.d.ts","sourceRoot":"","sources":["../../src/utils/flattenAnimation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElE,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,EAAE,CAYjG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function flattenAnimation(animation) {
|
|
2
|
+
const res = [];
|
|
3
|
+
if (animation.name === 'set') {
|
|
4
|
+
(animation.items || []).forEach(item => {
|
|
5
|
+
res.push(...flattenAnimation(item));
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
res.push(animation);
|
|
10
|
+
}
|
|
11
|
+
return res;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=flattenAnimation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flattenAnimation.js","sourceRoot":"","sources":["../../src/utils/flattenAnimation.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,gBAAgB,CAAC,SAAkC;IAC/D,MAAM,GAAG,GAAiC,EAAE,CAAC;IAE7C,IAAI,SAAS,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;QAC3B,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACnC,GAAG,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACP,CAAC;SAAM,CAAC;QACJ,GAAG,CAAC,IAAI,CAAC,SAAuC,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
import { PixelRatio, Text, TextStyle } from 'react-native';
|
|
2
|
+
import { PixelRatio, Text, TextStyle, ViewStyle } from 'react-native';
|
|
3
3
|
import type { ComponentContext } from '../../types/componentContext';
|
|
4
4
|
import type { DivTextData, FontSizeUnit, FontWeight, Truncate } from '../../types/text';
|
|
5
5
|
import { Outer } from '../utilities/Outer';
|
|
@@ -46,6 +46,11 @@ export function DivText({ componentContext }: DivTextProps) {
|
|
|
46
46
|
variables || new Map()
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
+
const textAlignmentVertical = useDerivedFromVarsSimple(
|
|
50
|
+
json.text_alignment_vertical || 'top',
|
|
51
|
+
variables || new Map()
|
|
52
|
+
);
|
|
53
|
+
|
|
49
54
|
const fontSizeUnit = useDerivedFromVarsSimple<FontSizeUnit>(json.font_size_unit || 'sp', variables || new Map());
|
|
50
55
|
|
|
51
56
|
const maxLines = useDerivedFromVarsSimple<number | undefined>(json.max_lines, variables || new Map());
|
|
@@ -175,11 +180,33 @@ export function DivText({ componentContext }: DivTextProps) {
|
|
|
175
180
|
return undefined;
|
|
176
181
|
}, [json.truncate, numberOfLines]);
|
|
177
182
|
|
|
178
|
-
//
|
|
179
|
-
//
|
|
183
|
+
// Build wrapper style for text block alignment inside the Outer container
|
|
184
|
+
// In Web, .text is display:flex with justify-content (halign) and align-items (valign)
|
|
185
|
+
// In RN (column layout): justifyContent = vertical, alignItems = horizontal
|
|
186
|
+
const outerStyle = useMemo((): ViewStyle => {
|
|
187
|
+
const style: ViewStyle = {};
|
|
188
|
+
|
|
189
|
+
// Vertical alignment of text block
|
|
190
|
+
switch (textAlignmentVertical) {
|
|
191
|
+
case 'center':
|
|
192
|
+
style.justifyContent = 'center';
|
|
193
|
+
break;
|
|
194
|
+
case 'bottom':
|
|
195
|
+
style.justifyContent = 'flex-end';
|
|
196
|
+
break;
|
|
197
|
+
case 'baseline':
|
|
198
|
+
style.justifyContent = 'flex-end';
|
|
199
|
+
break;
|
|
200
|
+
default: // top
|
|
201
|
+
style.justifyContent = 'flex-start';
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return style;
|
|
206
|
+
}, [textAlignmentVertical]);
|
|
180
207
|
|
|
181
208
|
return (
|
|
182
|
-
<Outer componentContext={componentContext}>
|
|
209
|
+
<Outer componentContext={componentContext} style={outerStyle}>
|
|
183
210
|
<Text
|
|
184
211
|
style={textStyle}
|
|
185
212
|
numberOfLines={numberOfLines}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import React, { ReactNode, useMemo } from 'react';
|
|
2
|
-
import { View, Pressable, ViewStyle, StyleSheet } from 'react-native';
|
|
1
|
+
import React, { ReactNode, useMemo, useRef, useCallback } from 'react';
|
|
2
|
+
import { View, Pressable, Animated, ViewStyle, StyleSheet, Easing, EasingFunction } from 'react-native';
|
|
3
3
|
import type { ComponentContext } from '../../types/componentContext';
|
|
4
4
|
import type { DivBaseData } from '../../types/base';
|
|
5
5
|
import type { Visibility } from '../../types/base';
|
|
6
6
|
import type { FixedSize, MatchParentSize } from '../../types/sizes';
|
|
7
7
|
import type { MaybeMissing } from '../../expressions/json';
|
|
8
|
+
import type { Animation } from '../../types/animation';
|
|
9
|
+
import type { Interpolation } from '../../../typings/common';
|
|
8
10
|
import { useDerivedFromVarsSimple } from '../../hooks/useDerivedFromVars';
|
|
9
11
|
import { useActionHandler, useHasActions } from '../../hooks/useAction';
|
|
10
12
|
import { useDivKitContext } from '../../context/DivKitContext';
|
|
11
13
|
import { useLayoutParams } from '../../context/LayoutParamsContext';
|
|
12
14
|
import { Background } from './Background';
|
|
15
|
+
import { flattenAnimation } from '../../utils/flattenAnimation';
|
|
13
16
|
|
|
14
17
|
function resolveAlignSelf(
|
|
15
18
|
alignment: string | undefined,
|
|
@@ -32,6 +35,57 @@ function resolveAlignSelf(
|
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
37
|
|
|
38
|
+
function interpolationToEasing(interpolator: Interpolation | undefined): EasingFunction {
|
|
39
|
+
switch (interpolator) {
|
|
40
|
+
case 'linear':
|
|
41
|
+
return Easing.linear;
|
|
42
|
+
case 'ease':
|
|
43
|
+
return Easing.ease;
|
|
44
|
+
case 'ease_in':
|
|
45
|
+
return Easing.in(Easing.ease);
|
|
46
|
+
case 'ease_out':
|
|
47
|
+
return Easing.out(Easing.ease);
|
|
48
|
+
case 'ease_in_out':
|
|
49
|
+
return Easing.inOut(Easing.ease);
|
|
50
|
+
case 'spring':
|
|
51
|
+
return Easing.inOut(Easing.ease);
|
|
52
|
+
default:
|
|
53
|
+
return Easing.inOut(Easing.ease);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface ParsedActionAnimation {
|
|
58
|
+
type: 'fade' | 'scale';
|
|
59
|
+
startValue: number;
|
|
60
|
+
endValue: number;
|
|
61
|
+
duration: number;
|
|
62
|
+
startDelay: number;
|
|
63
|
+
easing: EasingFunction;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function parseActionAnimations(animation: MaybeMissing<Animation> | undefined): ParsedActionAnimation[] {
|
|
67
|
+
if (!animation) return [];
|
|
68
|
+
|
|
69
|
+
const list = flattenAnimation(animation);
|
|
70
|
+
const result: ParsedActionAnimation[] = [];
|
|
71
|
+
|
|
72
|
+
for (const anim of list) {
|
|
73
|
+
if (anim.name === 'fade' || anim.name === 'scale') {
|
|
74
|
+
result.push({
|
|
75
|
+
type: anim.name,
|
|
76
|
+
startValue: anim.start_value ?? 1,
|
|
77
|
+
endValue: anim.end_value ?? 1,
|
|
78
|
+
duration: Math.max(0, anim.duration ?? 300),
|
|
79
|
+
startDelay: Math.max(0, anim.start_delay ?? 0),
|
|
80
|
+
easing: interpolationToEasing(anim.interpolator),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
// 'native' and 'no_animation' are ignored
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
|
|
35
89
|
export interface OuterProps<T extends DivBaseData = DivBaseData> {
|
|
36
90
|
componentContext: ComponentContext<T>;
|
|
37
91
|
children: ReactNode;
|
|
@@ -40,9 +94,9 @@ export interface OuterProps<T extends DivBaseData = DivBaseData> {
|
|
|
40
94
|
|
|
41
95
|
/**
|
|
42
96
|
* Outer component - base wrapper for all DivKit components
|
|
43
|
-
* Handles visibility, sizing, padding, margins, background, borders, and
|
|
97
|
+
* Handles visibility, sizing, padding, margins, background, borders, actions and action_animation
|
|
44
98
|
*
|
|
45
|
-
* Based on Web Outer.svelte
|
|
99
|
+
* Based on Web Outer.svelte
|
|
46
100
|
*/
|
|
47
101
|
export function Outer<T extends DivBaseData = DivBaseData>({
|
|
48
102
|
componentContext,
|
|
@@ -54,7 +108,6 @@ export function Outer<T extends DivBaseData = DivBaseData>({
|
|
|
54
108
|
const { json, variables } = componentContext;
|
|
55
109
|
|
|
56
110
|
// Only use reactive hooks for truly dynamic properties (visibility, alpha)
|
|
57
|
-
// For MVP, other properties are read directly from JSON (can be enhanced later)
|
|
58
111
|
const visibility = useDerivedFromVarsSimple<Visibility>(json.visibility || 'visible', variables || new Map());
|
|
59
112
|
const alpha = useDerivedFromVarsSimple<number>(json.alpha !== undefined ? json.alpha : 1, variables || new Map());
|
|
60
113
|
|
|
@@ -68,12 +121,63 @@ export function Outer<T extends DivBaseData = DivBaseData>({
|
|
|
68
121
|
const alignmentHorizontal = useDerivedFromVarsSimple(json.alignment_horizontal, variables || new Map());
|
|
69
122
|
const alignmentVertical = useDerivedFromVarsSimple(json.alignment_vertical, variables || new Map());
|
|
70
123
|
|
|
71
|
-
// Actions
|
|
124
|
+
// Actions
|
|
72
125
|
const jsonAny = json as any;
|
|
73
126
|
const actions = jsonAny.actions || (jsonAny.action ? [jsonAny.action] : []);
|
|
74
127
|
const hasActions = useHasActions(actions);
|
|
75
128
|
const handlePress = useActionHandler(actions, { componentContext });
|
|
76
129
|
|
|
130
|
+
// Action animation
|
|
131
|
+
const actionAnimation = jsonAny.action_animation as MaybeMissing<Animation> | undefined;
|
|
132
|
+
const parsedAnimations = useMemo(() => parseActionAnimations(actionAnimation), [actionAnimation]);
|
|
133
|
+
|
|
134
|
+
const hasFadeAnimation = parsedAnimations.some(a => a.type === 'fade');
|
|
135
|
+
const hasScaleAnimation = parsedAnimations.some(a => a.type === 'scale');
|
|
136
|
+
|
|
137
|
+
// Animated values (created once, stable refs)
|
|
138
|
+
const animOpacity = useRef(new Animated.Value(1)).current;
|
|
139
|
+
const animScale = useRef(new Animated.Value(1)).current;
|
|
140
|
+
|
|
141
|
+
const onPressIn = useCallback(() => {
|
|
142
|
+
if (parsedAnimations.length === 0) return;
|
|
143
|
+
|
|
144
|
+
const anims: Animated.CompositeAnimation[] = [];
|
|
145
|
+
for (const anim of parsedAnimations) {
|
|
146
|
+
const target = anim.type === 'fade' ? animOpacity : animScale;
|
|
147
|
+
anims.push(
|
|
148
|
+
Animated.timing(target, {
|
|
149
|
+
toValue: anim.endValue,
|
|
150
|
+
duration: anim.duration,
|
|
151
|
+
delay: anim.startDelay,
|
|
152
|
+
easing: anim.easing,
|
|
153
|
+
useNativeDriver: true,
|
|
154
|
+
})
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
Animated.parallel(anims).start();
|
|
159
|
+
}, [parsedAnimations, animOpacity, animScale]);
|
|
160
|
+
|
|
161
|
+
const onPressOut = useCallback(() => {
|
|
162
|
+
if (parsedAnimations.length === 0) return;
|
|
163
|
+
|
|
164
|
+
const anims: Animated.CompositeAnimation[] = [];
|
|
165
|
+
for (const anim of parsedAnimations) {
|
|
166
|
+
const target = anim.type === 'fade' ? animOpacity : animScale;
|
|
167
|
+
anims.push(
|
|
168
|
+
Animated.timing(target, {
|
|
169
|
+
toValue: anim.startValue,
|
|
170
|
+
duration: anim.duration,
|
|
171
|
+
delay: anim.startDelay,
|
|
172
|
+
easing: anim.easing,
|
|
173
|
+
useNativeDriver: true,
|
|
174
|
+
})
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
Animated.parallel(anims).start();
|
|
179
|
+
}, [parsedAnimations, animOpacity, animScale]);
|
|
180
|
+
|
|
77
181
|
// Early return for gone visibility
|
|
78
182
|
if (visibility === 'gone') {
|
|
79
183
|
return null;
|
|
@@ -99,7 +203,6 @@ export function Outer<T extends DivBaseData = DivBaseData>({
|
|
|
99
203
|
styles.width = (widthVal as FixedSize).value;
|
|
100
204
|
} else if (widthVal.type === 'match_parent') {
|
|
101
205
|
styles.alignSelf = 'stretch';
|
|
102
|
-
// flexGrow only on the main axis (horizontal parent)
|
|
103
206
|
if (parentOrientation === 'horizontal') {
|
|
104
207
|
styles.flexGrow = (widthVal as MatchParentSize).weight || 1;
|
|
105
208
|
styles.flexShrink = 1;
|
|
@@ -109,9 +212,7 @@ export function Outer<T extends DivBaseData = DivBaseData>({
|
|
|
109
212
|
styles.alignSelf = hAlign || 'flex-start';
|
|
110
213
|
}
|
|
111
214
|
} else {
|
|
112
|
-
// Default: match_parent
|
|
113
215
|
styles.alignSelf = 'stretch';
|
|
114
|
-
// flexGrow only on the main axis (horizontal parent) or outside a container
|
|
115
216
|
if (!parentOrientation || parentOrientation === 'horizontal') {
|
|
116
217
|
styles.flexGrow = 1;
|
|
117
218
|
styles.flexShrink = 1;
|
|
@@ -124,15 +225,12 @@ export function Outer<T extends DivBaseData = DivBaseData>({
|
|
|
124
225
|
if (heightVal.type === 'fixed') {
|
|
125
226
|
styles.height = (heightVal as FixedSize).value;
|
|
126
227
|
} else if (heightVal.type === 'match_parent') {
|
|
127
|
-
// flexGrow only on the main axis (vertical parent)
|
|
128
228
|
if (parentOrientation === 'vertical') {
|
|
129
229
|
styles.flexGrow = (heightVal as MatchParentSize).weight || 1;
|
|
130
230
|
} else {
|
|
131
|
-
// Cross axis — stretch via alignSelf or explicit height
|
|
132
231
|
styles.alignSelf = 'stretch';
|
|
133
232
|
}
|
|
134
233
|
}
|
|
135
|
-
// wrap_content is default in React Native
|
|
136
234
|
}
|
|
137
235
|
|
|
138
236
|
// Paddings
|
|
@@ -141,7 +239,6 @@ export function Outer<T extends DivBaseData = DivBaseData>({
|
|
|
141
239
|
if (p.top !== undefined) styles.paddingTop = p.top;
|
|
142
240
|
if (p.bottom !== undefined) styles.paddingBottom = p.bottom;
|
|
143
241
|
|
|
144
|
-
// Handle RTL for start/end
|
|
145
242
|
if (direction === 'rtl') {
|
|
146
243
|
if (p.start !== undefined) styles.paddingRight = p.start;
|
|
147
244
|
if (p.end !== undefined) styles.paddingLeft = p.end;
|
|
@@ -150,7 +247,6 @@ export function Outer<T extends DivBaseData = DivBaseData>({
|
|
|
150
247
|
if (p.end !== undefined) styles.paddingRight = p.end;
|
|
151
248
|
}
|
|
152
249
|
|
|
153
|
-
// Fallback to left/right if start/end not provided
|
|
154
250
|
if (p.left !== undefined && p.start === undefined) {
|
|
155
251
|
styles.paddingLeft = p.left;
|
|
156
252
|
}
|
|
@@ -165,7 +261,6 @@ export function Outer<T extends DivBaseData = DivBaseData>({
|
|
|
165
261
|
if (m.top !== undefined) styles.marginTop = m.top;
|
|
166
262
|
if (m.bottom !== undefined) styles.marginBottom = m.bottom;
|
|
167
263
|
|
|
168
|
-
// Handle RTL for start/end
|
|
169
264
|
if (direction === 'rtl') {
|
|
170
265
|
if (m.start !== undefined) styles.marginRight = m.start;
|
|
171
266
|
if (m.end !== undefined) styles.marginLeft = m.end;
|
|
@@ -174,7 +269,6 @@ export function Outer<T extends DivBaseData = DivBaseData>({
|
|
|
174
269
|
if (m.end !== undefined) styles.marginRight = m.end;
|
|
175
270
|
}
|
|
176
271
|
|
|
177
|
-
// Fallback to left/right
|
|
178
272
|
if (m.left !== undefined && m.start === undefined) {
|
|
179
273
|
styles.marginLeft = m.left;
|
|
180
274
|
}
|
|
@@ -183,8 +277,6 @@ export function Outer<T extends DivBaseData = DivBaseData>({
|
|
|
183
277
|
}
|
|
184
278
|
}
|
|
185
279
|
|
|
186
|
-
// Background handled by Background component
|
|
187
|
-
|
|
188
280
|
// Border
|
|
189
281
|
if (border) {
|
|
190
282
|
const b = border as any;
|
|
@@ -196,11 +288,9 @@ export function Outer<T extends DivBaseData = DivBaseData>({
|
|
|
196
288
|
styles.borderStyle = b.stroke.style?.type === 'dashed' ? 'dashed' : 'solid';
|
|
197
289
|
}
|
|
198
290
|
|
|
199
|
-
// Border radius
|
|
200
291
|
if (b.corner_radius !== undefined) {
|
|
201
292
|
styles.borderRadius = b.corner_radius;
|
|
202
293
|
} else if (b.corners_radius) {
|
|
203
|
-
// React Native supports individual corners
|
|
204
294
|
const corners = b.corners_radius;
|
|
205
295
|
if (corners['top-left'] !== undefined) {
|
|
206
296
|
styles.borderTopLeftRadius = corners['top-left'];
|
|
@@ -216,7 +306,10 @@ export function Outer<T extends DivBaseData = DivBaseData>({
|
|
|
216
306
|
}
|
|
217
307
|
}
|
|
218
308
|
|
|
219
|
-
|
|
309
|
+
if (b.corner_radius !== undefined || b.corners_radius) {
|
|
310
|
+
styles.overflow = 'hidden';
|
|
311
|
+
}
|
|
312
|
+
|
|
220
313
|
if (b.has_shadow) {
|
|
221
314
|
const shadow = b.shadow;
|
|
222
315
|
if (shadow) {
|
|
@@ -227,10 +320,8 @@ export function Outer<T extends DivBaseData = DivBaseData>({
|
|
|
227
320
|
};
|
|
228
321
|
styles.shadowOpacity = shadow.alpha !== undefined ? shadow.alpha : 0.18;
|
|
229
322
|
styles.shadowRadius = shadow.blur || 2;
|
|
230
|
-
// Android elevation
|
|
231
323
|
styles.elevation = 3;
|
|
232
324
|
} else {
|
|
233
|
-
// Default shadow
|
|
234
325
|
styles.shadowColor = '#000000';
|
|
235
326
|
styles.shadowOffset = { width: 0, height: 1 };
|
|
236
327
|
styles.shadowOpacity = 0.18;
|
|
@@ -258,8 +349,43 @@ export function Outer<T extends DivBaseData = DivBaseData>({
|
|
|
258
349
|
return res;
|
|
259
350
|
}, [finalStyle]);
|
|
260
351
|
|
|
261
|
-
// Render with
|
|
352
|
+
// Render with actions and animation
|
|
262
353
|
if (hasActions) {
|
|
354
|
+
const hasAnimation = parsedAnimations.length > 0;
|
|
355
|
+
|
|
356
|
+
if (hasAnimation) {
|
|
357
|
+
// Build animated style with opacity/scale overrides
|
|
358
|
+
const animatedStyle: any = { ...finalStyle };
|
|
359
|
+
|
|
360
|
+
if (hasFadeAnimation) {
|
|
361
|
+
const staticOpacity = animatedStyle.opacity;
|
|
362
|
+
if (staticOpacity !== undefined && staticOpacity !== 1) {
|
|
363
|
+
animatedStyle.opacity = Animated.multiply(animOpacity, staticOpacity);
|
|
364
|
+
} else {
|
|
365
|
+
animatedStyle.opacity = animOpacity;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if (hasScaleAnimation) {
|
|
370
|
+
const existingTransform = animatedStyle.transform || [];
|
|
371
|
+
animatedStyle.transform = [...existingTransform, { scale: animScale }];
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
return (
|
|
375
|
+
<Pressable
|
|
376
|
+
onPress={handlePress}
|
|
377
|
+
onPressIn={onPressIn}
|
|
378
|
+
onPressOut={onPressOut}
|
|
379
|
+
style={{ alignSelf: finalStyle?.alignSelf, flexGrow: finalStyle?.flexGrow, flexShrink: finalStyle?.flexShrink }}
|
|
380
|
+
>
|
|
381
|
+
<Animated.View style={animatedStyle}>
|
|
382
|
+
<Background layers={background as any} style={borderStyle} />
|
|
383
|
+
{children}
|
|
384
|
+
</Animated.View>
|
|
385
|
+
</Pressable>
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
|
|
263
389
|
return (
|
|
264
390
|
<Pressable onPress={handlePress} style={finalStyle}>
|
|
265
391
|
<Background layers={background as any} style={borderStyle} />
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Action } from '../../typings/common';
|
|
2
|
+
import type { Animation } from './animation';
|
|
3
|
+
|
|
4
|
+
export interface DivActionableData {
|
|
5
|
+
action?: Action;
|
|
6
|
+
actions?: Action[];
|
|
7
|
+
longtap_actions?: Action[];
|
|
8
|
+
doubletap_actions?: Action[];
|
|
9
|
+
action_animation?: Animation;
|
|
10
|
+
hover_start_actions?: Action[];
|
|
11
|
+
hover_end_actions?: Action[];
|
|
12
|
+
press_start_actions?: Action[];
|
|
13
|
+
press_end_actions?: Action[];
|
|
14
|
+
capture_focus_on_action?: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Interpolation } from '../../typings/common';
|
|
2
|
+
|
|
3
|
+
export type AnimationType = 'fade' | 'scale' | 'native' | 'no_animation' | 'translate';
|
|
4
|
+
|
|
5
|
+
export interface AnyAnimation {
|
|
6
|
+
name: AnimationType;
|
|
7
|
+
duration?: number;
|
|
8
|
+
start_delay?: number;
|
|
9
|
+
start_value?: number;
|
|
10
|
+
end_value?: number;
|
|
11
|
+
interpolator?: Interpolation;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface AnimationSet {
|
|
15
|
+
name: 'set';
|
|
16
|
+
items: Animation[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type Animation = AnyAnimation | AnimationSet;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MaybeMissing } from '../expressions/json';
|
|
2
|
+
import type { Animation, AnyAnimation } from '../types/animation';
|
|
3
|
+
|
|
4
|
+
export function flattenAnimation(animation: MaybeMissing<Animation>): MaybeMissing<AnyAnimation>[] {
|
|
5
|
+
const res: MaybeMissing<AnyAnimation>[] = [];
|
|
6
|
+
|
|
7
|
+
if (animation.name === 'set') {
|
|
8
|
+
(animation.items || []).forEach(item => {
|
|
9
|
+
res.push(...flattenAnimation(item));
|
|
10
|
+
});
|
|
11
|
+
} else {
|
|
12
|
+
res.push(animation as MaybeMissing<AnyAnimation>);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return res;
|
|
16
|
+
}
|