react-native-divkit 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +176 -0
- package/README.md +340 -0
- package/dist/DivKit.d.ts +68 -0
- package/dist/DivKit.d.ts.map +1 -0
- package/dist/DivKit.js +400 -0
- package/dist/DivKit.js.map +1 -0
- package/dist/actions/array.d.ts +8 -0
- package/dist/actions/array.d.ts.map +1 -0
- package/dist/actions/array.js +139 -0
- package/dist/actions/array.js.map +1 -0
- package/dist/actions/copyToClipboard.d.ts +22 -0
- package/dist/actions/copyToClipboard.d.ts.map +1 -0
- package/dist/actions/copyToClipboard.js +63 -0
- package/dist/actions/copyToClipboard.js.map +1 -0
- package/dist/actions/dict.d.ts +6 -0
- package/dist/actions/dict.d.ts.map +1 -0
- package/dist/actions/dict.js +58 -0
- package/dist/actions/dict.js.map +1 -0
- package/dist/actions/index.d.ts +11 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +11 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/updateStructure.d.ts +6 -0
- package/dist/actions/updateStructure.d.ts.map +1 -0
- package/dist/actions/updateStructure.js +116 -0
- package/dist/actions/updateStructure.js.map +1 -0
- package/dist/components/DivComponent.d.ts +29 -0
- package/dist/components/DivComponent.d.ts.map +1 -0
- package/dist/components/DivComponent.js +62 -0
- package/dist/components/DivComponent.js.map +1 -0
- package/dist/components/container/DivContainer.d.ts +26 -0
- package/dist/components/container/DivContainer.d.ts.map +1 -0
- package/dist/components/container/DivContainer.js +172 -0
- package/dist/components/container/DivContainer.js.map +1 -0
- package/dist/components/container/index.d.ts +3 -0
- package/dist/components/container/index.d.ts.map +1 -0
- package/dist/components/container/index.js +2 -0
- package/dist/components/container/index.js.map +1 -0
- package/dist/components/image/DivImage.d.ts +29 -0
- package/dist/components/image/DivImage.d.ts.map +1 -0
- package/dist/components/image/DivImage.js +122 -0
- package/dist/components/image/DivImage.js.map +1 -0
- package/dist/components/image/index.d.ts +3 -0
- package/dist/components/image/index.d.ts.map +1 -0
- package/dist/components/image/index.js +2 -0
- package/dist/components/image/index.js.map +1 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +11 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/state/DivState.d.ts +26 -0
- package/dist/components/state/DivState.d.ts.map +1 -0
- package/dist/components/state/DivState.js +121 -0
- package/dist/components/state/DivState.js.map +1 -0
- package/dist/components/state/index.d.ts +3 -0
- package/dist/components/state/index.d.ts.map +1 -0
- package/dist/components/state/index.js +2 -0
- package/dist/components/state/index.js.map +1 -0
- package/dist/components/text/DivText.d.ts +28 -0
- package/dist/components/text/DivText.d.ts.map +1 -0
- package/dist/components/text/DivText.js +143 -0
- package/dist/components/text/DivText.js.map +1 -0
- package/dist/components/text/index.d.ts +3 -0
- package/dist/components/text/index.d.ts.map +1 -0
- package/dist/components/text/index.js +2 -0
- package/dist/components/text/index.js.map +1 -0
- package/dist/components/utilities/Outer.d.ts +17 -0
- package/dist/components/utilities/Outer.d.ts.map +1 -0
- package/dist/components/utilities/Outer.js +210 -0
- package/dist/components/utilities/Outer.js.map +1 -0
- package/dist/components/utilities/Unknown.d.ts +11 -0
- package/dist/components/utilities/Unknown.d.ts.map +1 -0
- package/dist/components/utilities/Unknown.js +50 -0
- package/dist/components/utilities/Unknown.js.map +1 -0
- package/dist/components/utilities/index.d.ts +5 -0
- package/dist/components/utilities/index.d.ts.map +1 -0
- package/dist/components/utilities/index.js +3 -0
- package/dist/components/utilities/index.js.map +1 -0
- package/dist/context/ActionContext.d.ts +25 -0
- package/dist/context/ActionContext.d.ts.map +1 -0
- package/dist/context/ActionContext.js +20 -0
- package/dist/context/ActionContext.js.map +1 -0
- package/dist/context/DivKitContext.d.ts +33 -0
- package/dist/context/DivKitContext.d.ts.map +1 -0
- package/dist/context/DivKitContext.js +14 -0
- package/dist/context/DivKitContext.js.map +1 -0
- package/dist/context/EnabledContext.d.ts +31 -0
- package/dist/context/EnabledContext.d.ts.map +1 -0
- package/dist/context/EnabledContext.js +31 -0
- package/dist/context/EnabledContext.js.map +1 -0
- package/dist/context/StateContext.d.ts +57 -0
- package/dist/context/StateContext.d.ts.map +1 -0
- package/dist/context/StateContext.js +20 -0
- package/dist/context/StateContext.js.map +1 -0
- package/dist/context/index.d.ts +9 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +9 -0
- package/dist/context/index.js.map +1 -0
- package/dist/expressions/bigint.d.ts +8 -0
- package/dist/expressions/bigint.d.ts.map +1 -0
- package/dist/expressions/bigint.js +31 -0
- package/dist/expressions/bigint.js.map +1 -0
- package/dist/expressions/const.d.ts +15 -0
- package/dist/expressions/const.d.ts.map +1 -0
- package/dist/expressions/const.js +15 -0
- package/dist/expressions/const.js.map +1 -0
- package/dist/expressions/eval.d.ts +77 -0
- package/dist/expressions/eval.d.ts.map +1 -0
- package/dist/expressions/eval.js +459 -0
- package/dist/expressions/eval.js.map +1 -0
- package/dist/expressions/expressions.d.ts +7 -0
- package/dist/expressions/expressions.d.ts.map +1 -0
- package/dist/expressions/expressions.js +3191 -0
- package/dist/expressions/expressions.js.map +1 -0
- package/dist/expressions/funcs/array.d.ts +2 -0
- package/dist/expressions/funcs/array.d.ts.map +1 -0
- package/dist/expressions/funcs/array.js +381 -0
- package/dist/expressions/funcs/array.js.map +1 -0
- package/dist/expressions/funcs/colors.d.ts +2 -0
- package/dist/expressions/funcs/colors.d.ts.map +1 -0
- package/dist/expressions/funcs/colors.js +75 -0
- package/dist/expressions/funcs/colors.js.map +1 -0
- package/dist/expressions/funcs/customFuncs.d.ts +8 -0
- package/dist/expressions/funcs/customFuncs.d.ts.map +1 -0
- package/dist/expressions/funcs/customFuncs.js +114 -0
- package/dist/expressions/funcs/customFuncs.js.map +1 -0
- package/dist/expressions/funcs/datetime.d.ts +2 -0
- package/dist/expressions/funcs/datetime.d.ts.map +1 -0
- package/dist/expressions/funcs/datetime.js +182 -0
- package/dist/expressions/funcs/datetime.js.map +1 -0
- package/dist/expressions/funcs/dict.d.ts +2 -0
- package/dist/expressions/funcs/dict.d.ts.map +1 -0
- package/dist/expressions/funcs/dict.js +170 -0
- package/dist/expressions/funcs/dict.js.map +1 -0
- package/dist/expressions/funcs/funcs.d.ts +80 -0
- package/dist/expressions/funcs/funcs.d.ts.map +1 -0
- package/dist/expressions/funcs/funcs.js +146 -0
- package/dist/expressions/funcs/funcs.js.map +1 -0
- package/dist/expressions/funcs/index.d.ts +2 -0
- package/dist/expressions/funcs/index.d.ts.map +1 -0
- package/dist/expressions/funcs/index.js +23 -0
- package/dist/expressions/funcs/index.js.map +1 -0
- package/dist/expressions/funcs/interval.d.ts +2 -0
- package/dist/expressions/funcs/interval.d.ts.map +1 -0
- package/dist/expressions/funcs/interval.js +61 -0
- package/dist/expressions/funcs/interval.js.map +1 -0
- package/dist/expressions/funcs/math.d.ts +2 -0
- package/dist/expressions/funcs/math.d.ts.map +1 -0
- package/dist/expressions/funcs/math.js +324 -0
- package/dist/expressions/funcs/math.js.map +1 -0
- package/dist/expressions/funcs/std.d.ts +2 -0
- package/dist/expressions/funcs/std.d.ts.map +1 -0
- package/dist/expressions/funcs/std.js +293 -0
- package/dist/expressions/funcs/std.js.map +1 -0
- package/dist/expressions/funcs/stored.d.ts +4 -0
- package/dist/expressions/funcs/stored.d.ts.map +1 -0
- package/dist/expressions/funcs/stored.js +62 -0
- package/dist/expressions/funcs/stored.js.map +1 -0
- package/dist/expressions/funcs/strings.d.ts +2 -0
- package/dist/expressions/funcs/strings.d.ts.map +1 -0
- package/dist/expressions/funcs/strings.js +158 -0
- package/dist/expressions/funcs/strings.js.map +1 -0
- package/dist/expressions/funcs/trigonometry.d.ts +2 -0
- package/dist/expressions/funcs/trigonometry.d.ts.map +1 -0
- package/dist/expressions/funcs/trigonometry.js +92 -0
- package/dist/expressions/funcs/trigonometry.js.map +1 -0
- package/dist/expressions/json.d.ts +18 -0
- package/dist/expressions/json.d.ts.map +1 -0
- package/dist/expressions/json.js +271 -0
- package/dist/expressions/json.js.map +1 -0
- package/dist/expressions/parserCache.d.ts +4 -0
- package/dist/expressions/parserCache.d.ts.map +1 -0
- package/dist/expressions/parserCache.js +23 -0
- package/dist/expressions/parserCache.js.map +1 -0
- package/dist/expressions/simpleUnescapeString.d.ts +2 -0
- package/dist/expressions/simpleUnescapeString.d.ts.map +1 -0
- package/dist/expressions/simpleUnescapeString.js +61 -0
- package/dist/expressions/simpleUnescapeString.js.map +1 -0
- package/dist/expressions/utils.d.ts +29 -0
- package/dist/expressions/utils.d.ts.map +1 -0
- package/dist/expressions/utils.js +236 -0
- package/dist/expressions/utils.js.map +1 -0
- package/dist/expressions/variable.d.ts +82 -0
- package/dist/expressions/variable.d.ts.map +1 -0
- package/dist/expressions/variable.js +337 -0
- package/dist/expressions/variable.js.map +1 -0
- package/dist/expressions/walk.d.ts +7 -0
- package/dist/expressions/walk.d.ts.map +1 -0
- package/dist/expressions/walk.js +39 -0
- package/dist/expressions/walk.js.map +1 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +11 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useAction.d.ts +102 -0
- package/dist/hooks/useAction.d.ts.map +1 -0
- package/dist/hooks/useAction.js +116 -0
- package/dist/hooks/useAction.js.map +1 -0
- package/dist/hooks/useDerivedFromVars.d.ts +72 -0
- package/dist/hooks/useDerivedFromVars.d.ts.map +1 -0
- package/dist/hooks/useDerivedFromVars.js +100 -0
- package/dist/hooks/useDerivedFromVars.js.map +1 -0
- package/dist/hooks/useVariable.d.ts +86 -0
- package/dist/hooks/useVariable.d.ts.map +1 -0
- package/dist/hooks/useVariable.js +130 -0
- package/dist/hooks/useVariable.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/stores/createObservable.d.ts +38 -0
- package/dist/stores/createObservable.d.ts.map +1 -0
- package/dist/stores/createObservable.js +49 -0
- package/dist/stores/createObservable.js.map +1 -0
- package/dist/utils/applyTemplate.d.ts +8 -0
- package/dist/utils/applyTemplate.d.ts.map +1 -0
- package/dist/utils/applyTemplate.js +94 -0
- package/dist/utils/applyTemplate.js.map +1 -0
- package/dist/utils/correctColor.d.ts +18 -0
- package/dist/utils/correctColor.d.ts.map +1 -0
- package/dist/utils/correctColor.js +79 -0
- package/dist/utils/correctColor.js.map +1 -0
- package/dist/utils/escapeRegExp.d.ts +2 -0
- package/dist/utils/escapeRegExp.d.ts.map +1 -0
- package/dist/utils/escapeRegExp.js +4 -0
- package/dist/utils/escapeRegExp.js.map +1 -0
- package/dist/utils/formatDate.d.ts +6 -0
- package/dist/utils/formatDate.d.ts.map +1 -0
- package/dist/utils/formatDate.js +325 -0
- package/dist/utils/formatDate.js.map +1 -0
- package/dist/utils/padLeft.d.ts +2 -0
- package/dist/utils/padLeft.d.ts.map +1 -0
- package/dist/utils/padLeft.js +7 -0
- package/dist/utils/padLeft.js.map +1 -0
- package/dist/utils/uniq.d.ts +2 -0
- package/dist/utils/uniq.d.ts.map +1 -0
- package/dist/utils/uniq.js +4 -0
- package/dist/utils/uniq.js.map +1 -0
- package/dist/utils/wrapError.d.ts +10 -0
- package/dist/utils/wrapError.d.ts.map +1 -0
- package/dist/utils/wrapError.js +9 -0
- package/dist/utils/wrapError.js.map +1 -0
- package/package.json +58 -0
- package/src/DivKit.tsx +542 -0
- package/src/actions/array.ts +170 -0
- package/src/actions/copyToClipboard.ts +82 -0
- package/src/actions/dict.ts +71 -0
- package/src/actions/index.ts +11 -0
- package/src/actions/updateStructure.ts +134 -0
- package/src/components/DivComponent.tsx +75 -0
- package/src/components/README.md +230 -0
- package/src/components/container/DivContainer.tsx +222 -0
- package/src/components/container/index.ts +2 -0
- package/src/components/image/DivImage.tsx +172 -0
- package/src/components/image/index.ts +2 -0
- package/src/components/index.ts +20 -0
- package/src/components/state/DivState.tsx +146 -0
- package/src/components/state/index.ts +2 -0
- package/src/components/text/DivText.tsx +186 -0
- package/src/components/text/index.ts +2 -0
- package/src/components/utilities/Outer.tsx +239 -0
- package/src/components/utilities/README.md +175 -0
- package/src/components/utilities/Unknown.tsx +60 -0
- package/src/components/utilities/index.ts +4 -0
- package/src/context/ActionContext.tsx +37 -0
- package/src/context/DivKitContext.tsx +54 -0
- package/src/context/EnabledContext.tsx +50 -0
- package/src/context/StateContext.tsx +75 -0
- package/src/context/index.ts +33 -0
- package/src/expressions/ast.d.ts +101 -0
- package/src/expressions/bigint.ts +38 -0
- package/src/expressions/const.ts +16 -0
- package/src/expressions/eval.ts +669 -0
- package/src/expressions/expressions.peggy +235 -0
- package/src/expressions/expressions.ts +2854 -0
- package/src/expressions/funcs/array.ts +412 -0
- package/src/expressions/funcs/colors.ts +100 -0
- package/src/expressions/funcs/customFuncs.ts +139 -0
- package/src/expressions/funcs/datetime.ts +232 -0
- package/src/expressions/funcs/dict.ts +207 -0
- package/src/expressions/funcs/funcs.ts +323 -0
- package/src/expressions/funcs/index.ts +23 -0
- package/src/expressions/funcs/interval.ts +76 -0
- package/src/expressions/funcs/math.ts +395 -0
- package/src/expressions/funcs/std.ts +392 -0
- package/src/expressions/funcs/stored.ts +62 -0
- package/src/expressions/funcs/strings.ts +200 -0
- package/src/expressions/funcs/trigonometry.ts +108 -0
- package/src/expressions/json.ts +367 -0
- package/src/expressions/parserCache.ts +32 -0
- package/src/expressions/simpleUnescapeString.ts +57 -0
- package/src/expressions/utils.ts +271 -0
- package/src/expressions/variable.ts +429 -0
- package/src/expressions/walk.ts +43 -0
- package/src/hooks/README.md +265 -0
- package/src/hooks/index.ts +28 -0
- package/src/hooks/useAction.ts +152 -0
- package/src/hooks/useDerivedFromVars.ts +187 -0
- package/src/hooks/useVariable.ts +157 -0
- package/src/index.ts +97 -0
- package/src/stores/createObservable.ts +64 -0
- package/src/types/alignment.d.ts +13 -0
- package/src/types/background.d.ts +71 -0
- package/src/types/base.d.ts +224 -0
- package/src/types/border.d.ts +46 -0
- package/src/types/componentContext.d.ts +98 -0
- package/src/types/container.d.ts +40 -0
- package/src/types/edgeInserts.d.ts +9 -0
- package/src/types/general.d.ts +3 -0
- package/src/types/image.d.ts +33 -0
- package/src/types/imageScale.d.ts +1 -0
- package/src/types/layoutParams.d.ts +27 -0
- package/src/types/sizes.d.ts +37 -0
- package/src/types/state.d.ts +19 -0
- package/src/types/text.d.ts +126 -0
- package/src/utils/applyTemplate.ts +145 -0
- package/src/utils/correctColor.ts +102 -0
- package/src/utils/escapeRegExp.ts +3 -0
- package/src/utils/formatDate.ts +385 -0
- package/src/utils/padLeft.ts +6 -0
- package/src/utils/uniq.ts +3 -0
- package/src/utils/wrapError.ts +21 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React hook for subscribing to a specific DivKit variable
|
|
3
|
+
* Automatically updates component when variable value changes
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { useEffect, useState } from 'react';
|
|
7
|
+
import type { Variable, VariableValue } from '../expressions/variable';
|
|
8
|
+
import { useDivKitContext } from '../context/DivKitContext';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Subscribe to a variable by name and get its current value
|
|
12
|
+
*
|
|
13
|
+
* @param variableName Name of the variable to subscribe to
|
|
14
|
+
* @returns Current value of the variable, or undefined if not found
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* function MyComponent() {
|
|
19
|
+
* const userName = useVariable('userName');
|
|
20
|
+
* return <Text>Hello {userName}</Text>;
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function useVariable(variableName: string): VariableValue | undefined {
|
|
25
|
+
const { getVariable } = useDivKitContext();
|
|
26
|
+
const variable = getVariable(variableName);
|
|
27
|
+
|
|
28
|
+
const [value, setValue] = useState<VariableValue | undefined>(() =>
|
|
29
|
+
variable ? variable.getValue() : undefined
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (!variable) {
|
|
34
|
+
setValue(undefined);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Subscribe to variable changes
|
|
39
|
+
const unsubscribe = variable.subscribe((newValue) => {
|
|
40
|
+
setValue(newValue);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return unsubscribe;
|
|
44
|
+
}, [variable]);
|
|
45
|
+
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Subscribe to a Variable instance directly (for advanced use cases)
|
|
51
|
+
*
|
|
52
|
+
* @param variable Variable instance to subscribe to
|
|
53
|
+
* @returns Current value of the variable
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* function MyComponent({ variable }: { variable: Variable }) {
|
|
58
|
+
* const value = useVariableInstance(variable);
|
|
59
|
+
* return <Text>{String(value)}</Text>;
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export function useVariableInstance<T extends VariableValue>(
|
|
64
|
+
variable: Variable<T> | undefined
|
|
65
|
+
): T | undefined {
|
|
66
|
+
const [value, setValue] = useState<T | undefined>(() =>
|
|
67
|
+
variable ? variable.getValue() : undefined
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (!variable) {
|
|
72
|
+
setValue(undefined);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Subscribe to variable changes
|
|
77
|
+
const unsubscribe = variable.subscribe((newValue) => {
|
|
78
|
+
setValue(newValue);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
return unsubscribe;
|
|
82
|
+
}, [variable]);
|
|
83
|
+
|
|
84
|
+
return value;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Get variable setter function
|
|
89
|
+
* Returns a function that updates the variable value
|
|
90
|
+
*
|
|
91
|
+
* @param variableName Name of the variable
|
|
92
|
+
* @returns Setter function, or undefined if variable not found
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```tsx
|
|
96
|
+
* function MyComponent() {
|
|
97
|
+
* const userName = useVariable('userName');
|
|
98
|
+
* const setUserName = useVariableSetter('userName');
|
|
99
|
+
*
|
|
100
|
+
* return (
|
|
101
|
+
* <View>
|
|
102
|
+
* <Text>Hello {userName}</Text>
|
|
103
|
+
* <Button
|
|
104
|
+
* title="Change name"
|
|
105
|
+
* onPress={() => setUserName?.('Bob')}
|
|
106
|
+
* />
|
|
107
|
+
* </View>
|
|
108
|
+
* );
|
|
109
|
+
* }
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
export function useVariableSetter(
|
|
113
|
+
variableName: string
|
|
114
|
+
): ((value: VariableValue) => void) | undefined {
|
|
115
|
+
const { setVariable } = useDivKitContext();
|
|
116
|
+
|
|
117
|
+
// Return stable function reference
|
|
118
|
+
return (value: VariableValue) => {
|
|
119
|
+
setVariable(variableName, value);
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Combined hook that returns both value and setter
|
|
125
|
+
*
|
|
126
|
+
* @param variableName Name of the variable
|
|
127
|
+
* @returns Tuple of [value, setter]
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```tsx
|
|
131
|
+
* function MyComponent() {
|
|
132
|
+
* const [userName, setUserName] = useVariableState('userName');
|
|
133
|
+
*
|
|
134
|
+
* return (
|
|
135
|
+
* <View>
|
|
136
|
+
* <Text>Hello {userName}</Text>
|
|
137
|
+
* <Button
|
|
138
|
+
* title="Change name"
|
|
139
|
+
* onPress={() => setUserName('Bob')}
|
|
140
|
+
* />
|
|
141
|
+
* </View>
|
|
142
|
+
* );
|
|
143
|
+
* }
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
export function useVariableState(
|
|
147
|
+
variableName: string
|
|
148
|
+
): [VariableValue | undefined, (value: VariableValue) => void] {
|
|
149
|
+
const value = useVariable(variableName);
|
|
150
|
+
const { setVariable } = useDivKitContext();
|
|
151
|
+
|
|
152
|
+
const setter = (newValue: VariableValue) => {
|
|
153
|
+
setVariable(variableName, newValue);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
return [value, setter];
|
|
157
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* react-native-divkit
|
|
3
|
+
*
|
|
4
|
+
* React Native implementation of DivKit
|
|
5
|
+
* Based on Web (TypeScript + Svelte) implementation
|
|
6
|
+
*
|
|
7
|
+
* MVP Scope:
|
|
8
|
+
* - 4 basic components: Text, Container, Image, State
|
|
9
|
+
* - Expression engine with variable system
|
|
10
|
+
* - Action execution
|
|
11
|
+
* - Template resolution
|
|
12
|
+
*
|
|
13
|
+
* @see https://github.com/divkit/divkit
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// Main component
|
|
17
|
+
export { DivKit } from './DivKit';
|
|
18
|
+
export type {
|
|
19
|
+
DivKitProps,
|
|
20
|
+
StatCallback,
|
|
21
|
+
CustomActionCallback,
|
|
22
|
+
ErrorCallback
|
|
23
|
+
} from './DivKit';
|
|
24
|
+
|
|
25
|
+
// Types
|
|
26
|
+
export type {
|
|
27
|
+
Action,
|
|
28
|
+
DivJson,
|
|
29
|
+
DivBase,
|
|
30
|
+
DivVariable,
|
|
31
|
+
Direction,
|
|
32
|
+
TemplateContext,
|
|
33
|
+
BooleanInt
|
|
34
|
+
} from '../typings/common';
|
|
35
|
+
|
|
36
|
+
export type {
|
|
37
|
+
DivBaseData
|
|
38
|
+
} from './types/base';
|
|
39
|
+
|
|
40
|
+
export type {
|
|
41
|
+
ComponentContext
|
|
42
|
+
} from './types/componentContext';
|
|
43
|
+
|
|
44
|
+
// Variables
|
|
45
|
+
export {
|
|
46
|
+
createVariable,
|
|
47
|
+
Variable,
|
|
48
|
+
StringVariable,
|
|
49
|
+
IntegerVariable,
|
|
50
|
+
NumberVariable,
|
|
51
|
+
BooleanVariable,
|
|
52
|
+
ColorVariable,
|
|
53
|
+
UrlVariable,
|
|
54
|
+
DictVariable,
|
|
55
|
+
ArrayVariable
|
|
56
|
+
} from './expressions/variable';
|
|
57
|
+
|
|
58
|
+
export type {
|
|
59
|
+
VariableType,
|
|
60
|
+
VariableValue
|
|
61
|
+
} from './expressions/variable';
|
|
62
|
+
|
|
63
|
+
// Context hooks (for advanced usage)
|
|
64
|
+
export {
|
|
65
|
+
useDivKitContext,
|
|
66
|
+
DivKitContext
|
|
67
|
+
} from './context/DivKitContext';
|
|
68
|
+
|
|
69
|
+
export type {
|
|
70
|
+
DivKitContextValue
|
|
71
|
+
} from './context/DivKitContext';
|
|
72
|
+
|
|
73
|
+
// Hooks (for custom components)
|
|
74
|
+
export {
|
|
75
|
+
useDerivedFromVars,
|
|
76
|
+
useDerivedFromVarsSimple
|
|
77
|
+
} from './hooks/useDerivedFromVars';
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
useVariable,
|
|
81
|
+
useVariableInstance,
|
|
82
|
+
useVariableSetter,
|
|
83
|
+
useVariableState
|
|
84
|
+
} from './hooks/useVariable';
|
|
85
|
+
|
|
86
|
+
export {
|
|
87
|
+
useAction,
|
|
88
|
+
useActions,
|
|
89
|
+
useActionHandler,
|
|
90
|
+
useHasActions
|
|
91
|
+
} from './hooks/useAction';
|
|
92
|
+
|
|
93
|
+
// Utils (for advanced usage)
|
|
94
|
+
export { wrapError } from './utils/wrapError';
|
|
95
|
+
export type { WrappedError } from './utils/wrapError';
|
|
96
|
+
|
|
97
|
+
export { correctColor } from './utils/correctColor';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Observable implementation to replace Svelte stores for React Native
|
|
3
|
+
* Provides subscribe/set pattern compatible with Svelte store interface
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export type Subscriber<T> = (value: T) => void;
|
|
7
|
+
export type Unsubscriber = () => void;
|
|
8
|
+
|
|
9
|
+
export class Observable<T> {
|
|
10
|
+
private value: T;
|
|
11
|
+
private subscribers = new Set<Subscriber<T>>();
|
|
12
|
+
|
|
13
|
+
constructor(initialValue: T) {
|
|
14
|
+
this.value = initialValue;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Subscribe to value changes
|
|
19
|
+
* @param callback Function called immediately with current value and on each change
|
|
20
|
+
* @returns Unsubscribe function
|
|
21
|
+
*/
|
|
22
|
+
subscribe(callback: Subscriber<T>): Unsubscriber {
|
|
23
|
+
this.subscribers.add(callback);
|
|
24
|
+
// Immediately call with current value (Svelte store behavior)
|
|
25
|
+
callback(this.value);
|
|
26
|
+
|
|
27
|
+
return () => {
|
|
28
|
+
this.subscribers.delete(callback);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Update the value and notify all subscribers
|
|
34
|
+
* @param newValue New value to set
|
|
35
|
+
*/
|
|
36
|
+
set(newValue: T): void {
|
|
37
|
+
if (this.value !== newValue) {
|
|
38
|
+
this.value = newValue;
|
|
39
|
+
this.subscribers.forEach(cb => cb(newValue));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get current value without subscribing
|
|
45
|
+
* @returns Current value
|
|
46
|
+
*/
|
|
47
|
+
get(): T {
|
|
48
|
+
return this.value;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Create a writable observable (compatible with Svelte's writable store)
|
|
54
|
+
* @param initialValue Initial value
|
|
55
|
+
* @returns Observable instance
|
|
56
|
+
*/
|
|
57
|
+
export function writable<T>(initialValue: T): Observable<T> {
|
|
58
|
+
return new Observable(initialValue);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* TypeScript type compatibility with Svelte stores
|
|
63
|
+
*/
|
|
64
|
+
export type Writable<T> = Observable<T>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type AlignmentHorizontal = 'left' | 'center' | 'right' | 'start' | 'end';
|
|
2
|
+
|
|
3
|
+
export type AlignmentVertical = 'top' | 'center' | 'bottom' | 'baseline';
|
|
4
|
+
|
|
5
|
+
export type ContentAlignmentHorizontal =
|
|
6
|
+
'left' | 'center' | 'right' |
|
|
7
|
+
'start' | 'end' |
|
|
8
|
+
'space-between' | 'space-around' | 'space-evenly';
|
|
9
|
+
|
|
10
|
+
export type ContentAlignmentVertical =
|
|
11
|
+
'top' | 'center' | 'bottom' |
|
|
12
|
+
'space-between' | 'space-around' | 'space-evenly' |
|
|
13
|
+
'baseline';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { AlignmentHorizontal, AlignmentVertical } from './alignment';
|
|
2
|
+
import type { ImageScale } from './imageScale';
|
|
3
|
+
import type { FixedSize } from './sizes';
|
|
4
|
+
import type { EdgeInsets } from './edgeInserts';
|
|
5
|
+
import type { Filter } from './filter';
|
|
6
|
+
|
|
7
|
+
export interface GradientColorPoint {
|
|
8
|
+
color: string;
|
|
9
|
+
position: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface GradientBackground {
|
|
13
|
+
type: 'gradient';
|
|
14
|
+
colors?: string[];
|
|
15
|
+
color_map?: GradientColorPoint[];
|
|
16
|
+
angle?: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ImageBackground {
|
|
20
|
+
type: 'image';
|
|
21
|
+
image_url: string;
|
|
22
|
+
content_alignment_vertical?: AlignmentVertical;
|
|
23
|
+
content_alignment_horizontal?: AlignmentHorizontal;
|
|
24
|
+
scale?: ImageScale;
|
|
25
|
+
alpha?: number;
|
|
26
|
+
// preload_required
|
|
27
|
+
filters?: Filter[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface NinePatchImageBackground {
|
|
31
|
+
type: 'nine_patch_image';
|
|
32
|
+
image_url: string;
|
|
33
|
+
insets: EdgeInsets;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface SolidBackground {
|
|
37
|
+
type: 'solid';
|
|
38
|
+
color: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface RadialBackgroundRelativeRadius {
|
|
42
|
+
type: 'relative';
|
|
43
|
+
value: 'nearest_side' | 'nearest_corner' | 'farthest_side' | 'farthest_corner';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type RadialBackgroundRadius = FixedSize | RadialBackgroundRelativeRadius;
|
|
47
|
+
|
|
48
|
+
export interface RadialGradientFixedCenter {
|
|
49
|
+
type: 'fixed';
|
|
50
|
+
value: number;
|
|
51
|
+
// unit:
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface RadialGradientRelativeCenter {
|
|
55
|
+
type: 'relative';
|
|
56
|
+
value: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type RadialGradientCenter = RadialGradientFixedCenter | RadialGradientRelativeCenter;
|
|
60
|
+
|
|
61
|
+
export interface RadialBackground {
|
|
62
|
+
type: 'radial_gradient';
|
|
63
|
+
colors?: string[];
|
|
64
|
+
color_map?: GradientColorPoint[];
|
|
65
|
+
radius?: RadialBackgroundRadius;
|
|
66
|
+
center_x?: RadialGradientCenter;
|
|
67
|
+
center_y?: RadialGradientCenter;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type Background = GradientBackground | ImageBackground |
|
|
71
|
+
SolidBackground | RadialBackground | NinePatchImageBackground;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import type { Size } from './sizes';
|
|
2
|
+
import type { AlignmentHorizontal, AlignmentVertical } from './alignment';
|
|
3
|
+
import type { Border } from './border';
|
|
4
|
+
import type { Background } from './background';
|
|
5
|
+
import type { EdgeInsets } from './edgeInserts';
|
|
6
|
+
import type { Dimension } from './sizes';
|
|
7
|
+
import type { Action, AnimatorDirection, AnimatorRepeatCount, BooleanInt, DisappearAction, DivFunction, DivVariable, Interpolation, VariableTrigger, VisibilityAction } from '../../typings/common';
|
|
8
|
+
import type { Focus } from './focus';
|
|
9
|
+
import type { Animation } from './animation';
|
|
10
|
+
|
|
11
|
+
export type AccessibilityType = 'none' | 'button' | 'image' | 'text' | 'edit_text' |
|
|
12
|
+
'header' | 'tab_bar' | 'list' | 'select' | 'checkbox' | 'radio' | 'auto';
|
|
13
|
+
|
|
14
|
+
export type AccessibilityMode = 'default' | 'merge' | 'exclude';
|
|
15
|
+
|
|
16
|
+
export interface Accessibility {
|
|
17
|
+
description?: string;
|
|
18
|
+
type?: AccessibilityType;
|
|
19
|
+
state_description?: string;
|
|
20
|
+
hint?: string;
|
|
21
|
+
is_checked?: BooleanInt;
|
|
22
|
+
mode?: AccessibilityMode;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface TransitionBase {
|
|
26
|
+
start_delay?: number;
|
|
27
|
+
duration?: number;
|
|
28
|
+
interpolator?: Interpolation;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface FadeTransition extends TransitionBase {
|
|
32
|
+
type: 'fade';
|
|
33
|
+
alpha?: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ScaleTransition extends TransitionBase {
|
|
37
|
+
type: 'scale';
|
|
38
|
+
scale?: number;
|
|
39
|
+
pivot_x?: number;
|
|
40
|
+
pivot_y?: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type SlideTransitionEdge = 'left' | 'top' | 'right' | 'bottom';
|
|
44
|
+
|
|
45
|
+
export interface SlideTransition extends TransitionBase {
|
|
46
|
+
type: 'slide';
|
|
47
|
+
edge?: SlideTransitionEdge;
|
|
48
|
+
distance?: Dimension;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type AnyTransition = FadeTransition | ScaleTransition | SlideTransition;
|
|
52
|
+
|
|
53
|
+
interface TransitionSet {
|
|
54
|
+
type: 'set';
|
|
55
|
+
items: AppearanceTransition[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type AppearanceTransition = AnyTransition | TransitionSet;
|
|
59
|
+
|
|
60
|
+
export type Visibility = 'visible' | 'invisible' | 'gone';
|
|
61
|
+
export type TransitionTrigger = 'state_change' | 'visibility_change';
|
|
62
|
+
|
|
63
|
+
export interface ChangeBoundsTransition extends TransitionBase {
|
|
64
|
+
type: 'change_bounds';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export type TransitionChange = ChangeBoundsTransition | {
|
|
68
|
+
type: 'set';
|
|
69
|
+
items: TransitionChange[];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface PivotFixedValue {
|
|
73
|
+
type: 'pivot-fixed';
|
|
74
|
+
value: number;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface PivotPercentageValue {
|
|
78
|
+
type: 'pivot-percentage';
|
|
79
|
+
value: number;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export type PivotValue = PivotFixedValue | PivotPercentageValue;
|
|
83
|
+
|
|
84
|
+
export interface Transform {
|
|
85
|
+
pivot_x?: PivotValue;
|
|
86
|
+
pivot_y?: PivotValue;
|
|
87
|
+
rotation?: number;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface RotationTransformation {
|
|
91
|
+
type: 'rotation';
|
|
92
|
+
angle: number;
|
|
93
|
+
pivot_x?: PivotValue;
|
|
94
|
+
pivot_y?: PivotValue;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface PercentageTranslation {
|
|
98
|
+
type: 'translation-percentage';
|
|
99
|
+
value: number;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface FixedTranslation {
|
|
103
|
+
type: 'translation-fixed';
|
|
104
|
+
value: number;
|
|
105
|
+
// unit?:
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export type Translation = PercentageTranslation | FixedTranslation;
|
|
109
|
+
|
|
110
|
+
export interface TranslationTransformation {
|
|
111
|
+
type: 'translation';
|
|
112
|
+
x?: Translation;
|
|
113
|
+
y?: Translation;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export type Transformation = RotationTransformation | TranslationTransformation;
|
|
117
|
+
|
|
118
|
+
export interface Extension {
|
|
119
|
+
id: string;
|
|
120
|
+
params?: object;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface TooltipModeModal {
|
|
124
|
+
type: 'modal';
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface TooltipModeNonModal {
|
|
128
|
+
type: 'non_modal';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type TooltipMode = TooltipModeModal | TooltipModeNonModal;
|
|
132
|
+
|
|
133
|
+
export interface Tooltip {
|
|
134
|
+
id: string;
|
|
135
|
+
div: DivBaseData;
|
|
136
|
+
position: 'left' | 'top-left' | 'top' | 'top-right' | 'right' |
|
|
137
|
+
'bottom-right' | 'bottom' | 'bottom-left' | 'center';
|
|
138
|
+
duration?: number;
|
|
139
|
+
offset?: {
|
|
140
|
+
x: {
|
|
141
|
+
value: number;
|
|
142
|
+
// unit;
|
|
143
|
+
};
|
|
144
|
+
y: {
|
|
145
|
+
value: number;
|
|
146
|
+
// unit;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
animation_in?: Animation;
|
|
150
|
+
animation_out?: Animation;
|
|
151
|
+
|
|
152
|
+
mode?: TooltipMode;
|
|
153
|
+
tap_outside_actions?: Action[];
|
|
154
|
+
close_by_tap_outside?: boolean;
|
|
155
|
+
background_accessibility_description?: string;
|
|
156
|
+
substrate_div?: DivBaseData;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface DivLayoutProvider {
|
|
160
|
+
width_variable_name?: string;
|
|
161
|
+
height_variable_name?: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface AnimatorBase {
|
|
165
|
+
id: string;
|
|
166
|
+
variable_name: string;
|
|
167
|
+
duration: number;
|
|
168
|
+
start_delay?: number;
|
|
169
|
+
interpolator?: Interpolation;
|
|
170
|
+
direction?: AnimatorDirection;
|
|
171
|
+
repeat_count?: AnimatorRepeatCount;
|
|
172
|
+
end_actions?: Action[];
|
|
173
|
+
cancel_actions?: Action[];
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export interface NumberAnimator extends AnimatorBase {
|
|
177
|
+
type: 'number_animator';
|
|
178
|
+
start_value?: number;
|
|
179
|
+
end_value: number;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface ColorAnimator extends AnimatorBase {
|
|
183
|
+
type: 'color_animator';
|
|
184
|
+
start_value?: string;
|
|
185
|
+
end_value: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export type Animator = NumberAnimator | ColorAnimator;
|
|
189
|
+
|
|
190
|
+
export interface DivBaseData {
|
|
191
|
+
type: string;
|
|
192
|
+
id?: string;
|
|
193
|
+
border?: Border;
|
|
194
|
+
width?: Size;
|
|
195
|
+
height?: Size;
|
|
196
|
+
background?: Background[];
|
|
197
|
+
paddings?: EdgeInsets;
|
|
198
|
+
margins?: EdgeInsets;
|
|
199
|
+
alpha?: number;
|
|
200
|
+
alignment_horizontal?: AlignmentHorizontal;
|
|
201
|
+
alignment_vertical?: AlignmentVertical;
|
|
202
|
+
row_span?: number;
|
|
203
|
+
column_span?: number;
|
|
204
|
+
visibility?: Visibility;
|
|
205
|
+
visibility_action?: VisibilityAction;
|
|
206
|
+
visibility_actions?: VisibilityAction[];
|
|
207
|
+
disappear_actions?: DisappearAction[];
|
|
208
|
+
tooltips?: Tooltip[];
|
|
209
|
+
accessibility?: Accessibility;
|
|
210
|
+
extensions?: Extension[];
|
|
211
|
+
transition_in?: AppearanceTransition;
|
|
212
|
+
transition_change?: TransitionChange;
|
|
213
|
+
transition_out?: AppearanceTransition;
|
|
214
|
+
transition_triggers?: TransitionTrigger[];
|
|
215
|
+
selected_actions?: Action[];
|
|
216
|
+
focus?: Focus;
|
|
217
|
+
layout_provider?: DivLayoutProvider;
|
|
218
|
+
transform?: Transform;
|
|
219
|
+
transformations?: Transformation[];
|
|
220
|
+
variables?: DivVariable[];
|
|
221
|
+
variable_triggers?: VariableTrigger[];
|
|
222
|
+
animators?: Animator[];
|
|
223
|
+
functions?: DivFunction[];
|
|
224
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { BooleanInt } from '../../typings/common';
|
|
2
|
+
import type { Dimension } from './sizes';
|
|
3
|
+
|
|
4
|
+
export interface StrokeStyleSolid {
|
|
5
|
+
type: 'solid';
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface StrokeStyleDashed {
|
|
9
|
+
type: 'dashed';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type StrokeStyle = StrokeStyleSolid | StrokeStyleDashed;
|
|
13
|
+
|
|
14
|
+
export interface Stroke {
|
|
15
|
+
width?: number;
|
|
16
|
+
color: string;
|
|
17
|
+
// unit
|
|
18
|
+
style?: StrokeStyle;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CornersRadius {
|
|
22
|
+
'top-left'?: number;
|
|
23
|
+
'top-right'?: number;
|
|
24
|
+
'bottom-left'?: number;
|
|
25
|
+
'bottom-right'?: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface Point {
|
|
29
|
+
x: Dimension;
|
|
30
|
+
y: Dimension;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface Shadow {
|
|
34
|
+
color?: string;
|
|
35
|
+
offset: Point;
|
|
36
|
+
blur?: number;
|
|
37
|
+
alpha?: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface Border {
|
|
41
|
+
has_shadow?: BooleanInt;
|
|
42
|
+
shadow?: Shadow;
|
|
43
|
+
stroke?: Stroke;
|
|
44
|
+
corner_radius?: number;
|
|
45
|
+
corners_radius?: CornersRadius;
|
|
46
|
+
}
|