@xaui/native 0.2.5 → 0.2.7
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/color-picker/index.cjs +1 -4
- package/dist/color-picker/index.js +1 -4
- package/dist/dialog/index.cjs +28 -37
- package/dist/dialog/index.js +28 -37
- package/dist/picker/index.cjs +20 -26
- package/dist/picker/index.js +20 -26
- package/dist/snackbar/index.cjs +19 -3
- package/dist/snackbar/index.js +19 -3
- package/dist/snippet/index.cjs +6 -1
- package/dist/snippet/index.js +6 -1
- package/dist/view/index.cjs +411 -169
- package/dist/view/index.d.cts +255 -137
- package/dist/view/index.d.ts +255 -137
- package/dist/view/index.js +480 -238
- package/package.json +3 -8
- package/dist/container/index.cjs +0 -203
- package/dist/container/index.d.cts +0 -40
- package/dist/container/index.d.ts +0 -40
- package/dist/container/index.js +0 -203
package/dist/view/index.cjs
CHANGED
|
@@ -4,96 +4,314 @@
|
|
|
4
4
|
|
|
5
5
|
var _chunk7UFBLUMVcjs = require('../chunk-7UFBLUMV.cjs');
|
|
6
6
|
|
|
7
|
-
// src/components/view/
|
|
7
|
+
// src/components/view/container/container.tsx
|
|
8
8
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
9
9
|
var _reactnative = require('react-native');
|
|
10
10
|
|
|
11
|
+
// src/components/view/container/container.utils.ts
|
|
12
|
+
var resolveEdgeInsets = (value, prefix) => {
|
|
13
|
+
if (typeof value === "number") {
|
|
14
|
+
return prefix === "padding" ? { padding: value } : { margin: value };
|
|
15
|
+
}
|
|
16
|
+
const style = {};
|
|
17
|
+
if (prefix === "padding") {
|
|
18
|
+
if (value.horizontal !== void 0) style.paddingHorizontal = value.horizontal;
|
|
19
|
+
if (value.vertical !== void 0) style.paddingVertical = value.vertical;
|
|
20
|
+
if (value.top !== void 0) style.paddingTop = value.top;
|
|
21
|
+
if (value.bottom !== void 0) style.paddingBottom = value.bottom;
|
|
22
|
+
if (value.left !== void 0) style.paddingLeft = value.left;
|
|
23
|
+
if (value.right !== void 0) style.paddingRight = value.right;
|
|
24
|
+
} else {
|
|
25
|
+
if (value.horizontal !== void 0) style.marginHorizontal = value.horizontal;
|
|
26
|
+
if (value.vertical !== void 0) style.marginVertical = value.vertical;
|
|
27
|
+
if (value.top !== void 0) style.marginTop = value.top;
|
|
28
|
+
if (value.bottom !== void 0) style.marginBottom = value.bottom;
|
|
29
|
+
if (value.left !== void 0) style.marginLeft = value.left;
|
|
30
|
+
if (value.right !== void 0) style.marginRight = value.right;
|
|
31
|
+
}
|
|
32
|
+
return style;
|
|
33
|
+
};
|
|
34
|
+
var ALIGNMENT_MAP = {
|
|
35
|
+
topLeft: { justifyContent: "flex-start", alignItems: "flex-start" },
|
|
36
|
+
topCenter: { justifyContent: "flex-start", alignItems: "center" },
|
|
37
|
+
topRight: { justifyContent: "flex-start", alignItems: "flex-end" },
|
|
38
|
+
centerLeft: { justifyContent: "center", alignItems: "flex-start" },
|
|
39
|
+
center: { justifyContent: "center", alignItems: "center" },
|
|
40
|
+
centerRight: { justifyContent: "center", alignItems: "flex-end" },
|
|
41
|
+
bottomLeft: { justifyContent: "flex-end", alignItems: "flex-start" },
|
|
42
|
+
bottomCenter: { justifyContent: "flex-end", alignItems: "center" },
|
|
43
|
+
bottomRight: { justifyContent: "flex-end", alignItems: "flex-end" }
|
|
44
|
+
};
|
|
45
|
+
var toFlexPosition = (v) => {
|
|
46
|
+
if (v <= 0) return "flex-start";
|
|
47
|
+
if (v >= 1) return "flex-end";
|
|
48
|
+
return "center";
|
|
49
|
+
};
|
|
50
|
+
var resolveAlignment = (value) => {
|
|
51
|
+
if (typeof value === "object") {
|
|
52
|
+
return {
|
|
53
|
+
justifyContent: toFlexPosition(value.y),
|
|
54
|
+
alignItems: toFlexPosition(value.x)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return _nullishCoalesce(ALIGNMENT_MAP[value], () => ( {
|
|
58
|
+
justifyContent: "flex-start",
|
|
59
|
+
alignItems: "flex-start"
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
var resolveBorderRadius = (value) => {
|
|
63
|
+
if (typeof value === "number") {
|
|
64
|
+
return { borderRadius: value };
|
|
65
|
+
}
|
|
66
|
+
const style = {};
|
|
67
|
+
if (value.topLeft !== void 0) style.borderTopLeftRadius = value.topLeft;
|
|
68
|
+
if (value.topRight !== void 0) style.borderTopRightRadius = value.topRight;
|
|
69
|
+
if (value.bottomLeft !== void 0) style.borderBottomLeftRadius = value.bottomLeft;
|
|
70
|
+
if (value.bottomRight !== void 0)
|
|
71
|
+
style.borderBottomRightRadius = value.bottomRight;
|
|
72
|
+
return style;
|
|
73
|
+
};
|
|
74
|
+
var resolveBorderSide = (side, position) => {
|
|
75
|
+
const style = {};
|
|
76
|
+
if (position === "") {
|
|
77
|
+
if (side.width !== void 0) style.borderWidth = side.width;
|
|
78
|
+
if (side.color !== void 0) style.borderColor = side.color;
|
|
79
|
+
if (side.style !== void 0) style.borderStyle = side.style;
|
|
80
|
+
return style;
|
|
81
|
+
}
|
|
82
|
+
if (position === "Top") {
|
|
83
|
+
if (side.width !== void 0) style.borderTopWidth = side.width;
|
|
84
|
+
if (side.color !== void 0) style.borderTopColor = side.color;
|
|
85
|
+
} else if (position === "Bottom") {
|
|
86
|
+
if (side.width !== void 0) style.borderBottomWidth = side.width;
|
|
87
|
+
if (side.color !== void 0) style.borderBottomColor = side.color;
|
|
88
|
+
} else if (position === "Left") {
|
|
89
|
+
if (side.width !== void 0) style.borderLeftWidth = side.width;
|
|
90
|
+
if (side.color !== void 0) style.borderLeftColor = side.color;
|
|
91
|
+
} else {
|
|
92
|
+
if (side.width !== void 0) style.borderRightWidth = side.width;
|
|
93
|
+
if (side.color !== void 0) style.borderRightColor = side.color;
|
|
94
|
+
}
|
|
95
|
+
return style;
|
|
96
|
+
};
|
|
97
|
+
var resolveBorder = (value) => {
|
|
98
|
+
const dir = value;
|
|
99
|
+
if (dir.top !== void 0 || dir.bottom !== void 0 || dir.left !== void 0 || dir.right !== void 0) {
|
|
100
|
+
return {
|
|
101
|
+
...dir.top ? resolveBorderSide(dir.top, "Top") : {},
|
|
102
|
+
...dir.bottom ? resolveBorderSide(dir.bottom, "Bottom") : {},
|
|
103
|
+
...dir.left ? resolveBorderSide(dir.left, "Left") : {},
|
|
104
|
+
...dir.right ? resolveBorderSide(dir.right, "Right") : {}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return resolveBorderSide(value, "");
|
|
108
|
+
};
|
|
109
|
+
var resolveShadow = (value) => ({
|
|
110
|
+
shadowColor: _nullishCoalesce(value.color, () => ( "#000000")),
|
|
111
|
+
shadowOffset: {
|
|
112
|
+
width: _nullishCoalesce(_optionalChain([value, 'access', _2 => _2.offset, 'optionalAccess', _3 => _3.x]), () => ( 0)),
|
|
113
|
+
height: _nullishCoalesce(_optionalChain([value, 'access', _4 => _4.offset, 'optionalAccess', _5 => _5.y]), () => ( 4))
|
|
114
|
+
},
|
|
115
|
+
shadowOpacity: _nullishCoalesce(value.opacity, () => ( 0.1)),
|
|
116
|
+
shadowRadius: _nullishCoalesce(value.blur, () => ( 4)),
|
|
117
|
+
elevation: _nullishCoalesce(value.elevation, () => ( 2))
|
|
118
|
+
});
|
|
119
|
+
var resolveTransform = (value) => {
|
|
120
|
+
const transforms = [];
|
|
121
|
+
if (value.rotate !== void 0) transforms.push({ rotate: value.rotate });
|
|
122
|
+
if (value.rotateX !== void 0) transforms.push({ rotateX: value.rotateX });
|
|
123
|
+
if (value.rotateY !== void 0) transforms.push({ rotateY: value.rotateY });
|
|
124
|
+
if (value.scale !== void 0) transforms.push({ scale: value.scale });
|
|
125
|
+
if (value.scaleX !== void 0) transforms.push({ scaleX: value.scaleX });
|
|
126
|
+
if (value.scaleY !== void 0) transforms.push({ scaleY: value.scaleY });
|
|
127
|
+
if (value.translateX !== void 0)
|
|
128
|
+
transforms.push({ translateX: value.translateX });
|
|
129
|
+
if (value.translateY !== void 0)
|
|
130
|
+
transforms.push({ translateY: value.translateY });
|
|
131
|
+
if (value.skewX !== void 0) transforms.push({ skewX: value.skewX });
|
|
132
|
+
if (value.skewY !== void 0) transforms.push({ skewY: value.skewY });
|
|
133
|
+
return transforms;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
// src/components/view/container/container.tsx
|
|
137
|
+
var buildStyle = (props) => ({
|
|
138
|
+
...props.width !== void 0 && { width: props.width },
|
|
139
|
+
...props.height !== void 0 && { height: props.height },
|
|
140
|
+
...props.minWidth !== void 0 && { minWidth: props.minWidth },
|
|
141
|
+
...props.maxWidth !== void 0 && { maxWidth: props.maxWidth },
|
|
142
|
+
...props.minHeight !== void 0 && { minHeight: props.minHeight },
|
|
143
|
+
...props.maxHeight !== void 0 && { maxHeight: props.maxHeight },
|
|
144
|
+
...props.aspectRatio !== void 0 && { aspectRatio: props.aspectRatio },
|
|
145
|
+
...props.flex !== void 0 && { flex: props.flex },
|
|
146
|
+
...props.color !== void 0 && { backgroundColor: props.color },
|
|
147
|
+
...props.clip && { overflow: "hidden" },
|
|
148
|
+
...props.opacity !== void 0 && { opacity: props.opacity },
|
|
149
|
+
...props.padding !== void 0 && resolveEdgeInsets(props.padding, "padding"),
|
|
150
|
+
...props.margin !== void 0 && resolveEdgeInsets(props.margin, "margin"),
|
|
151
|
+
...props.alignment !== void 0 && resolveAlignment(props.alignment),
|
|
152
|
+
...props.borderRadius !== void 0 && resolveBorderRadius(props.borderRadius),
|
|
153
|
+
...props.border !== void 0 && resolveBorder(props.border),
|
|
154
|
+
...props.shadow !== void 0 && resolveShadow(props.shadow),
|
|
155
|
+
...props.transform !== void 0 && {
|
|
156
|
+
transform: resolveTransform(props.transform)
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
var Container = (props) => {
|
|
160
|
+
const {
|
|
161
|
+
children,
|
|
162
|
+
onPress,
|
|
163
|
+
onLongPress,
|
|
164
|
+
onPressIn,
|
|
165
|
+
onPressOut,
|
|
166
|
+
disabled = false,
|
|
167
|
+
accessibilityLabel,
|
|
168
|
+
accessibilityRole,
|
|
169
|
+
accessibilityState,
|
|
170
|
+
accessible,
|
|
171
|
+
testID,
|
|
172
|
+
style
|
|
173
|
+
} = props;
|
|
174
|
+
const containerStyle = buildStyle(props);
|
|
175
|
+
const isInteractive = !!(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(onPress, () => ( onLongPress)), () => ( onPressIn)), () => ( onPressOut)));
|
|
176
|
+
if (isInteractive) {
|
|
177
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
178
|
+
_reactnative.Pressable,
|
|
179
|
+
{
|
|
180
|
+
onPress: disabled ? void 0 : onPress,
|
|
181
|
+
onLongPress: disabled ? void 0 : onLongPress,
|
|
182
|
+
onPressIn: disabled ? void 0 : onPressIn,
|
|
183
|
+
onPressOut: disabled ? void 0 : onPressOut,
|
|
184
|
+
disabled,
|
|
185
|
+
accessibilityLabel,
|
|
186
|
+
accessibilityRole,
|
|
187
|
+
accessibilityState,
|
|
188
|
+
accessible,
|
|
189
|
+
testID,
|
|
190
|
+
style: [containerStyle, style]
|
|
191
|
+
},
|
|
192
|
+
children
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
196
|
+
_reactnative.View,
|
|
197
|
+
{
|
|
198
|
+
accessibilityLabel,
|
|
199
|
+
accessibilityRole,
|
|
200
|
+
accessibilityState,
|
|
201
|
+
accessible,
|
|
202
|
+
testID,
|
|
203
|
+
style: [containerStyle, style]
|
|
204
|
+
},
|
|
205
|
+
children
|
|
206
|
+
);
|
|
207
|
+
};
|
|
208
|
+
Container.displayName = "Container";
|
|
209
|
+
|
|
210
|
+
// src/components/view/flex/flex.tsx
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
11
214
|
// src/components/view/layout-utils.ts
|
|
12
215
|
var MAIN_AXIS_JUSTIFY_MAP = {
|
|
13
216
|
start: "flex-start",
|
|
14
217
|
center: "center",
|
|
15
218
|
end: "flex-end",
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
219
|
+
spaceBetween: "space-between",
|
|
220
|
+
spaceAround: "space-around",
|
|
221
|
+
spaceEvenly: "space-evenly"
|
|
19
222
|
};
|
|
20
223
|
var CROSS_AXIS_ALIGN_MAP = {
|
|
21
224
|
start: "flex-start",
|
|
22
225
|
center: "center",
|
|
23
226
|
end: "flex-end",
|
|
24
|
-
stretch: "stretch"
|
|
25
|
-
baseline: "baseline"
|
|
26
|
-
};
|
|
27
|
-
var resolveMainAxisAlignment = (alignment) => {
|
|
28
|
-
return MAIN_AXIS_JUSTIFY_MAP[_nullishCoalesce(alignment, () => ( "start"))];
|
|
227
|
+
stretch: "stretch"
|
|
29
228
|
};
|
|
30
|
-
var
|
|
31
|
-
|
|
229
|
+
var resolveMainAxisAlignment = (alignment) => MAIN_AXIS_JUSTIFY_MAP[_nullishCoalesce(alignment, () => ( "start"))];
|
|
230
|
+
var resolveCrossAxisAlignment = (alignment) => CROSS_AXIS_ALIGN_MAP[_nullishCoalesce(alignment, () => ( "center"))];
|
|
231
|
+
var resolveMainAxisSize = (size = "max", direction) => {
|
|
232
|
+
if (size === "min") return {};
|
|
233
|
+
return direction === "vertical" ? { flex: 1 } : { width: "100%" };
|
|
32
234
|
};
|
|
33
235
|
|
|
34
|
-
// src/components/view/
|
|
35
|
-
var
|
|
236
|
+
// src/components/view/flex/flex.tsx
|
|
237
|
+
var Flex = ({
|
|
36
238
|
children,
|
|
239
|
+
direction,
|
|
37
240
|
mainAxisAlignment,
|
|
38
241
|
crossAxisAlignment,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
242
|
+
mainAxisSize,
|
|
243
|
+
wrap = false,
|
|
244
|
+
gap,
|
|
245
|
+
reversed = false,
|
|
246
|
+
flex,
|
|
42
247
|
style,
|
|
43
|
-
|
|
248
|
+
testID
|
|
44
249
|
}) => {
|
|
45
|
-
const
|
|
46
|
-
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
250
|
+
const flexDir = direction === "horizontal" ? reversed ? "row-reverse" : "row" : reversed ? "column-reverse" : "column";
|
|
47
251
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
48
252
|
_reactnative.View,
|
|
49
253
|
{
|
|
254
|
+
testID,
|
|
50
255
|
style: [
|
|
256
|
+
resolveMainAxisSize(mainAxisSize, direction),
|
|
51
257
|
{
|
|
52
|
-
|
|
53
|
-
flexDirection: reverse ? "column-reverse" : "column",
|
|
258
|
+
flexDirection: flexDir,
|
|
54
259
|
justifyContent: resolveMainAxisAlignment(mainAxisAlignment),
|
|
55
|
-
alignItems: resolveCrossAxisAlignment(crossAxisAlignment)
|
|
260
|
+
alignItems: resolveCrossAxisAlignment(crossAxisAlignment),
|
|
261
|
+
flexWrap: wrap ? "wrap" : "nowrap",
|
|
262
|
+
...gap !== void 0 && { gap },
|
|
263
|
+
...flex !== void 0 && { flex }
|
|
56
264
|
},
|
|
57
|
-
fullWidthStyle,
|
|
58
|
-
gapStyle,
|
|
59
265
|
style
|
|
60
266
|
]
|
|
61
267
|
},
|
|
62
268
|
children
|
|
63
269
|
);
|
|
64
270
|
};
|
|
271
|
+
Flex.displayName = "Flex";
|
|
272
|
+
|
|
273
|
+
// src/components/view/column/column.tsx
|
|
274
|
+
|
|
275
|
+
var Column = (props) => /* @__PURE__ */ _react2.default.createElement(Flex, { ...props, direction: "vertical" });
|
|
276
|
+
Column.displayName = "Column";
|
|
65
277
|
|
|
66
278
|
// src/components/view/row/row.tsx
|
|
67
279
|
|
|
280
|
+
var Row = (props) => /* @__PURE__ */ _react2.default.createElement(Flex, { ...props, direction: "horizontal" });
|
|
281
|
+
Row.displayName = "Row";
|
|
282
|
+
|
|
283
|
+
// src/components/view/expanded/expanded.tsx
|
|
68
284
|
|
|
69
|
-
|
|
285
|
+
|
|
286
|
+
var Expanded = ({
|
|
70
287
|
children,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
288
|
+
flex = 1,
|
|
289
|
+
style,
|
|
290
|
+
testID
|
|
291
|
+
}) => /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { testID, style: [{ flex }, style] }, children);
|
|
292
|
+
Expanded.displayName = "Expanded";
|
|
293
|
+
|
|
294
|
+
// src/components/view/flexible/flexible.tsx
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
var Flexible = ({
|
|
298
|
+
children,
|
|
299
|
+
flex = 1,
|
|
300
|
+
fit = "loose",
|
|
301
|
+
style,
|
|
302
|
+
testID
|
|
303
|
+
}) => /* @__PURE__ */ _react2.default.createElement(
|
|
304
|
+
_reactnative.View,
|
|
305
|
+
{
|
|
306
|
+
testID,
|
|
307
|
+
style: [
|
|
308
|
+
fit === "tight" ? { flex } : { flexGrow: flex, flexShrink: 1, flexBasis: "auto" },
|
|
309
|
+
style
|
|
310
|
+
]
|
|
311
|
+
},
|
|
312
|
+
children
|
|
313
|
+
);
|
|
314
|
+
Flexible.displayName = "Flexible";
|
|
97
315
|
|
|
98
316
|
// src/components/view/spacer/spacer.tsx
|
|
99
317
|
|
|
@@ -115,84 +333,49 @@ var Spacer = ({ flex = 1, style }) => {
|
|
|
115
333
|
};
|
|
116
334
|
Spacer.displayName = "Spacer";
|
|
117
335
|
|
|
118
|
-
// src/components/view/
|
|
336
|
+
// src/components/view/wrap/wrap.tsx
|
|
119
337
|
|
|
120
338
|
|
|
121
|
-
var
|
|
339
|
+
var Wrap = ({
|
|
122
340
|
children,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
bottom,
|
|
129
|
-
left,
|
|
130
|
-
fullWidth,
|
|
341
|
+
direction = "horizontal",
|
|
342
|
+
alignment,
|
|
343
|
+
runAlignment,
|
|
344
|
+
spacing = 0,
|
|
345
|
+
runSpacing = 0,
|
|
131
346
|
style,
|
|
132
|
-
|
|
133
|
-
}) =>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
347
|
+
testID
|
|
348
|
+
}) => /* @__PURE__ */ _react2.default.createElement(
|
|
349
|
+
_reactnative.View,
|
|
350
|
+
{
|
|
351
|
+
testID,
|
|
352
|
+
style: [
|
|
353
|
+
{
|
|
354
|
+
flexDirection: direction === "horizontal" ? "row" : "column",
|
|
355
|
+
flexWrap: "wrap",
|
|
356
|
+
justifyContent: resolveMainAxisAlignment(alignment),
|
|
357
|
+
alignContent: resolveMainAxisAlignment(runAlignment),
|
|
358
|
+
gap: spacing,
|
|
359
|
+
rowGap: direction === "horizontal" ? runSpacing : spacing,
|
|
360
|
+
columnGap: direction === "horizontal" ? spacing : runSpacing
|
|
361
|
+
},
|
|
362
|
+
style
|
|
363
|
+
]
|
|
364
|
+
},
|
|
365
|
+
children
|
|
366
|
+
);
|
|
367
|
+
Wrap.displayName = "Wrap";
|
|
368
|
+
|
|
369
|
+
// src/components/view/padding/padding.tsx
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
var Padding = ({ children, padding, style }) => /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [resolveEdgeInsets(padding, "padding"), style] }, children);
|
|
156
373
|
Padding.displayName = "Padding";
|
|
157
374
|
|
|
158
375
|
// src/components/view/margin/margin.tsx
|
|
159
376
|
|
|
160
377
|
|
|
161
|
-
var Margin = ({
|
|
162
|
-
children,
|
|
163
|
-
all,
|
|
164
|
-
horizontal,
|
|
165
|
-
vertical,
|
|
166
|
-
top,
|
|
167
|
-
right,
|
|
168
|
-
bottom,
|
|
169
|
-
left,
|
|
170
|
-
fullWidth,
|
|
171
|
-
style,
|
|
172
|
-
noGrowth = false
|
|
173
|
-
}) => {
|
|
174
|
-
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
175
|
-
return /* @__PURE__ */ _react2.default.createElement(
|
|
176
|
-
_reactnative.View,
|
|
177
|
-
{
|
|
178
|
-
style: [
|
|
179
|
-
{
|
|
180
|
-
flex: noGrowth ? void 0 : 1,
|
|
181
|
-
margin: all,
|
|
182
|
-
marginHorizontal: horizontal,
|
|
183
|
-
marginVertical: vertical,
|
|
184
|
-
marginTop: top,
|
|
185
|
-
marginRight: right,
|
|
186
|
-
marginBottom: bottom,
|
|
187
|
-
marginLeft: left
|
|
188
|
-
},
|
|
189
|
-
fullWidthStyle,
|
|
190
|
-
style
|
|
191
|
-
]
|
|
192
|
-
},
|
|
193
|
-
children
|
|
194
|
-
);
|
|
195
|
-
};
|
|
378
|
+
var Margin = ({ children, margin, style }) => /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [resolveEdgeInsets(margin, "margin"), style] }, children);
|
|
196
379
|
Margin.displayName = "Margin";
|
|
197
380
|
|
|
198
381
|
// src/components/view/sized-box/sized-box.tsx
|
|
@@ -202,27 +385,73 @@ var SizedBox = ({
|
|
|
202
385
|
children,
|
|
203
386
|
width,
|
|
204
387
|
height,
|
|
205
|
-
|
|
206
|
-
|
|
388
|
+
expand,
|
|
389
|
+
shrink,
|
|
390
|
+
style,
|
|
391
|
+
testID
|
|
207
392
|
}) => {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
{
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
);
|
|
393
|
+
if (shrink) {
|
|
394
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
395
|
+
_reactnative.View,
|
|
396
|
+
{
|
|
397
|
+
testID,
|
|
398
|
+
style: [{ width: 0, height: 0, overflow: "hidden" }, style]
|
|
399
|
+
},
|
|
400
|
+
children
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
if (expand) {
|
|
404
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { testID, style: [{ flex: 1, alignSelf: "stretch" }, style] }, children);
|
|
405
|
+
}
|
|
406
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { testID, style: [{ width, height }, style] }, children);
|
|
223
407
|
};
|
|
224
408
|
SizedBox.displayName = "SizedBox";
|
|
225
409
|
|
|
410
|
+
// src/components/view/constrained-box/constrained-box.tsx
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
var ConstrainedBox = ({
|
|
414
|
+
children,
|
|
415
|
+
constraints,
|
|
416
|
+
style,
|
|
417
|
+
testID
|
|
418
|
+
}) => /* @__PURE__ */ _react2.default.createElement(
|
|
419
|
+
_reactnative.View,
|
|
420
|
+
{
|
|
421
|
+
testID,
|
|
422
|
+
style: [
|
|
423
|
+
{
|
|
424
|
+
minWidth: constraints.minWidth,
|
|
425
|
+
maxWidth: constraints.maxWidth,
|
|
426
|
+
minHeight: constraints.minHeight,
|
|
427
|
+
maxHeight: constraints.maxHeight
|
|
428
|
+
},
|
|
429
|
+
style
|
|
430
|
+
]
|
|
431
|
+
},
|
|
432
|
+
children
|
|
433
|
+
);
|
|
434
|
+
ConstrainedBox.displayName = "ConstrainedBox";
|
|
435
|
+
|
|
436
|
+
// src/components/view/fractionally-sized-box/fractionally-sized-box.tsx
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
var FractionallySizedBox = ({
|
|
440
|
+
children,
|
|
441
|
+
widthFactor,
|
|
442
|
+
heightFactor,
|
|
443
|
+
alignment,
|
|
444
|
+
style,
|
|
445
|
+
testID
|
|
446
|
+
}) => {
|
|
447
|
+
const sizedStyle = {};
|
|
448
|
+
if (widthFactor !== void 0) sizedStyle.width = `${widthFactor * 100}%`;
|
|
449
|
+
if (heightFactor !== void 0) sizedStyle.height = `${heightFactor * 100}%`;
|
|
450
|
+
const alignStyle = alignment ? resolveAlignment(alignment) : {};
|
|
451
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { testID, style: [sizedStyle, alignStyle, style] }, children);
|
|
452
|
+
};
|
|
453
|
+
FractionallySizedBox.displayName = "FractionallySizedBox";
|
|
454
|
+
|
|
226
455
|
// src/components/view/positioned-view/positioned-view.tsx
|
|
227
456
|
|
|
228
457
|
|
|
@@ -385,10 +614,29 @@ var RoundedView = ({
|
|
|
385
614
|
var AspectRatio = ({
|
|
386
615
|
children,
|
|
387
616
|
ratio,
|
|
388
|
-
|
|
617
|
+
alignment,
|
|
618
|
+
clip,
|
|
619
|
+
style,
|
|
620
|
+
testID
|
|
389
621
|
}) => {
|
|
390
|
-
|
|
622
|
+
const alignStyle = alignment ? resolveAlignment(alignment) : {};
|
|
623
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
624
|
+
_reactnative.View,
|
|
625
|
+
{
|
|
626
|
+
testID,
|
|
627
|
+
style: [
|
|
628
|
+
{
|
|
629
|
+
aspectRatio: ratio,
|
|
630
|
+
overflow: clip ? "hidden" : "visible"
|
|
631
|
+
},
|
|
632
|
+
alignStyle,
|
|
633
|
+
style
|
|
634
|
+
]
|
|
635
|
+
},
|
|
636
|
+
children
|
|
637
|
+
);
|
|
391
638
|
};
|
|
639
|
+
AspectRatio.displayName = "AspectRatio";
|
|
392
640
|
|
|
393
641
|
// src/components/view/surface/surface.tsx
|
|
394
642
|
|
|
@@ -443,7 +691,10 @@ var Screen = ({
|
|
|
443
691
|
}) => {
|
|
444
692
|
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
445
693
|
const resolvedBackgroundColor = _nullishCoalesce(backgroundColor, () => ( theme.colors.background));
|
|
446
|
-
const containerStyle = [
|
|
694
|
+
const containerStyle = [
|
|
695
|
+
{ flex: 1, backgroundColor: resolvedBackgroundColor, padding },
|
|
696
|
+
style
|
|
697
|
+
];
|
|
447
698
|
if (safeArea) {
|
|
448
699
|
return /* @__PURE__ */ _react2.default.createElement(_reactnativesafeareacontext.SafeAreaView, { style: containerStyle }, children);
|
|
449
700
|
}
|
|
@@ -451,32 +702,15 @@ var Screen = ({
|
|
|
451
702
|
};
|
|
452
703
|
Screen.displayName = "Screen";
|
|
453
704
|
|
|
454
|
-
// src/components/view/
|
|
705
|
+
// src/components/view/align/align.tsx
|
|
455
706
|
|
|
456
707
|
|
|
457
|
-
var
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}) => {
|
|
463
|
-
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
464
|
-
return /* @__PURE__ */ _react2.default.createElement(
|
|
465
|
-
_reactnative.View,
|
|
466
|
-
{
|
|
467
|
-
style: [
|
|
468
|
-
{
|
|
469
|
-
flex: noGrowth ? void 0 : 1,
|
|
470
|
-
alignItems: "center",
|
|
471
|
-
justifyContent: "center"
|
|
472
|
-
},
|
|
473
|
-
fullWidthStyle,
|
|
474
|
-
style
|
|
475
|
-
]
|
|
476
|
-
},
|
|
477
|
-
children
|
|
478
|
-
);
|
|
479
|
-
};
|
|
708
|
+
var Align = ({ children, alignment, style }) => /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [{ flex: 1 }, resolveAlignment(alignment), style] }, children);
|
|
709
|
+
Align.displayName = "Align";
|
|
710
|
+
|
|
711
|
+
// src/components/view/center/center.tsx
|
|
712
|
+
|
|
713
|
+
var Center = ({ children, style }) => /* @__PURE__ */ _react2.default.createElement(Align, { alignment: "center", style }, children);
|
|
480
714
|
Center.displayName = "Center";
|
|
481
715
|
|
|
482
716
|
// src/components/view/grid/grid.tsx
|
|
@@ -815,7 +1049,7 @@ var runConditionalViewAnimation = ({
|
|
|
815
1049
|
]);
|
|
816
1050
|
animation.start(({ finished }) => {
|
|
817
1051
|
if (finished) {
|
|
818
|
-
_optionalChain([onComplete, 'optionalCall',
|
|
1052
|
+
_optionalChain([onComplete, 'optionalCall', _6 => _6()]);
|
|
819
1053
|
}
|
|
820
1054
|
});
|
|
821
1055
|
return animation;
|
|
@@ -869,7 +1103,7 @@ var ConditionalView = ({
|
|
|
869
1103
|
}
|
|
870
1104
|
return;
|
|
871
1105
|
}
|
|
872
|
-
_optionalChain([animationRef, 'access',
|
|
1106
|
+
_optionalChain([animationRef, 'access', _7 => _7.current, 'optionalAccess', _8 => _8.stop, 'call', _9 => _9()]);
|
|
873
1107
|
animationRef.current = runConditionalViewAnimation({
|
|
874
1108
|
opacity,
|
|
875
1109
|
scale,
|
|
@@ -1056,10 +1290,10 @@ var MasonryGridBuilder = ({
|
|
|
1056
1290
|
const lastEndReachedHeight = _react.useRef.call(void 0, 0);
|
|
1057
1291
|
if (!resolvedRenderer) return null;
|
|
1058
1292
|
const handleScroll = (event) => {
|
|
1059
|
-
_optionalChain([onScroll, 'optionalCall',
|
|
1293
|
+
_optionalChain([onScroll, 'optionalCall', _10 => _10(event)]);
|
|
1060
1294
|
if (!onEndReached) return;
|
|
1061
1295
|
const { layoutMeasurement, contentOffset, contentSize } = event.nativeEvent;
|
|
1062
|
-
if (!_optionalChain([layoutMeasurement, 'optionalAccess',
|
|
1296
|
+
if (!_optionalChain([layoutMeasurement, 'optionalAccess', _11 => _11.height])) return;
|
|
1063
1297
|
const distanceFromEnd = contentSize.height - (layoutMeasurement.height + contentOffset.y);
|
|
1064
1298
|
const threshold = onEndReachedThreshold * layoutMeasurement.height;
|
|
1065
1299
|
if (distanceFromEnd <= threshold && contentSize.height !== lastEndReachedHeight.current) {
|
|
@@ -1116,4 +1350,12 @@ MasonryGridBuilder.displayName = "MasonryGridBuilder";
|
|
|
1116
1350
|
|
|
1117
1351
|
|
|
1118
1352
|
|
|
1119
|
-
|
|
1353
|
+
|
|
1354
|
+
|
|
1355
|
+
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
exports.Align = Align; exports.AspectRatio = AspectRatio; exports.BlurView = BlurView; exports.Center = Center; exports.Column = Column; exports.ConditionalView = ConditionalView; exports.ConstrainedBox = ConstrainedBox; exports.Container = Container; exports.Expanded = Expanded; exports.Flex = Flex; exports.Flexible = Flexible; exports.FractionallySizedBox = FractionallySizedBox; exports.Grid = Grid; exports.GridBuilder = GridBuilder; exports.GridItem = GridItem; exports.Margin = Margin; exports.MasonryGrid = MasonryGrid; exports.MasonryGridBuilder = MasonryGridBuilder; exports.MasonryGridItem = MasonryGridItem; exports.Padding = Padding; exports.PositionedView = PositionedView; exports.RoundedView = RoundedView; exports.Row = Row; exports.Screen = Screen; exports.SizedBox = SizedBox; exports.Spacer = Spacer; exports.Surface = Surface; exports.Wrap = Wrap;
|