@xaui/native 0.2.2 → 0.2.4
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/alert/index.cjs +2 -2
- package/dist/alert/index.js +4 -4
- package/dist/dialog/index.cjs +2 -2
- package/dist/dialog/index.js +2 -2
- package/dist/tabs/index.cjs +3 -2
- package/dist/tabs/index.d.cts +4 -0
- package/dist/tabs/index.d.ts +4 -0
- package/dist/tabs/index.js +3 -2
- package/dist/view/index.cjs +33 -1
- package/dist/view/index.d.cts +30 -3
- package/dist/view/index.d.ts +30 -3
- package/dist/view/index.js +71 -39
- package/package.json +5 -1
package/dist/alert/index.cjs
CHANGED
|
@@ -18,8 +18,8 @@ var _reactnative = require('react-native');
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
|
|
22
21
|
var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
22
|
+
var _reactnativeworklets = require('react-native-worklets');
|
|
23
23
|
|
|
24
24
|
// src/components/alert/alert.style.ts
|
|
25
25
|
|
|
@@ -254,7 +254,7 @@ var Alert = ({
|
|
|
254
254
|
opacity.value = _reactnativereanimated.withTiming.call(void 0, 0, { duration: 250 });
|
|
255
255
|
scale.value = _reactnativereanimated.withTiming.call(void 0, 0.95, { duration: 250 }, (finished) => {
|
|
256
256
|
if (finished) {
|
|
257
|
-
|
|
257
|
+
_reactnativeworklets.scheduleOnRN.call(void 0, finishClosing);
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
}, [finishClosing, opacity, scale, visible]);
|
package/dist/alert/index.js
CHANGED
|
@@ -15,11 +15,11 @@ import React2, {
|
|
|
15
15
|
} from "react";
|
|
16
16
|
import { Pressable, Text, View } from "react-native";
|
|
17
17
|
import Animated, {
|
|
18
|
-
useSharedValue,
|
|
19
18
|
useAnimatedStyle,
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
useSharedValue,
|
|
20
|
+
withTiming
|
|
22
21
|
} from "react-native-reanimated";
|
|
22
|
+
import { scheduleOnRN } from "react-native-worklets";
|
|
23
23
|
|
|
24
24
|
// src/components/alert/alert.style.ts
|
|
25
25
|
import { StyleSheet } from "react-native";
|
|
@@ -254,7 +254,7 @@ var Alert = ({
|
|
|
254
254
|
opacity.value = withTiming(0, { duration: 250 });
|
|
255
255
|
scale.value = withTiming(0.95, { duration: 250 }, (finished) => {
|
|
256
256
|
if (finished) {
|
|
257
|
-
|
|
257
|
+
scheduleOnRN(finishClosing);
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
}, [finishClosing, opacity, scale, visible]);
|
package/dist/dialog/index.cjs
CHANGED
|
@@ -19,8 +19,8 @@ var _reactnative = require('react-native');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
|
|
23
22
|
var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
23
|
+
var _reactnativeworklets = require('react-native-worklets');
|
|
24
24
|
var _core = require('@xaui/core');
|
|
25
25
|
var _icons = require('@xaui/icons');
|
|
26
26
|
|
|
@@ -263,7 +263,7 @@ var Dialog = ({
|
|
|
263
263
|
},
|
|
264
264
|
(finished) => {
|
|
265
265
|
if (finished) {
|
|
266
|
-
|
|
266
|
+
_reactnativeworklets.scheduleOnRN.call(void 0, finishClosing);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
);
|
package/dist/dialog/index.js
CHANGED
|
@@ -16,11 +16,11 @@ import React, {
|
|
|
16
16
|
import { Modal, Pressable, Text, View } from "react-native";
|
|
17
17
|
import Animated, {
|
|
18
18
|
Easing,
|
|
19
|
-
runOnJS,
|
|
20
19
|
useAnimatedStyle,
|
|
21
20
|
useSharedValue,
|
|
22
21
|
withTiming
|
|
23
22
|
} from "react-native-reanimated";
|
|
23
|
+
import { scheduleOnRN } from "react-native-worklets";
|
|
24
24
|
import { withOpacity } from "@xaui/core";
|
|
25
25
|
import { CloseIcon } from "@xaui/icons";
|
|
26
26
|
|
|
@@ -263,7 +263,7 @@ var Dialog = ({
|
|
|
263
263
|
},
|
|
264
264
|
(finished) => {
|
|
265
265
|
if (finished) {
|
|
266
|
-
|
|
266
|
+
scheduleOnRN(finishClosing);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
);
|
package/dist/tabs/index.cjs
CHANGED
|
@@ -197,12 +197,13 @@ function toTabItems(children) {
|
|
|
197
197
|
if (!_react2.default.isValidElement(child) || child.type !== Tab) {
|
|
198
198
|
return [];
|
|
199
199
|
}
|
|
200
|
-
|
|
200
|
+
const tabKey = child.props.tabKey;
|
|
201
|
+
if (!tabKey) {
|
|
201
202
|
return [];
|
|
202
203
|
}
|
|
203
204
|
return [
|
|
204
205
|
{
|
|
205
|
-
key:
|
|
206
|
+
key: tabKey,
|
|
206
207
|
title: child.props.title,
|
|
207
208
|
startContent: child.props.startContent,
|
|
208
209
|
endContent: child.props.endContent,
|
package/dist/tabs/index.d.cts
CHANGED
package/dist/tabs/index.d.ts
CHANGED
package/dist/tabs/index.js
CHANGED
|
@@ -197,12 +197,13 @@ function toTabItems(children) {
|
|
|
197
197
|
if (!React.isValidElement(child) || child.type !== Tab) {
|
|
198
198
|
return [];
|
|
199
199
|
}
|
|
200
|
-
|
|
200
|
+
const tabKey = child.props.tabKey;
|
|
201
|
+
if (!tabKey) {
|
|
201
202
|
return [];
|
|
202
203
|
}
|
|
203
204
|
return [
|
|
204
205
|
{
|
|
205
|
-
key:
|
|
206
|
+
key: tabKey,
|
|
206
207
|
title: child.props.title,
|
|
207
208
|
startContent: child.props.startContent,
|
|
208
209
|
endContent: child.props.endContent,
|
package/dist/view/index.cjs
CHANGED
|
@@ -430,6 +430,37 @@ var Surface = ({
|
|
|
430
430
|
};
|
|
431
431
|
Surface.displayName = "Surface";
|
|
432
432
|
|
|
433
|
+
// src/components/view/screen/screen.tsx
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
var _reactnativesafeareacontext = require('react-native-safe-area-context');
|
|
437
|
+
var Screen = ({
|
|
438
|
+
children,
|
|
439
|
+
padding,
|
|
440
|
+
backgroundColor,
|
|
441
|
+
safeArea = false,
|
|
442
|
+
style
|
|
443
|
+
}) => {
|
|
444
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
445
|
+
const resolvedBackgroundColor = _nullishCoalesce(backgroundColor, () => ( theme.colors.background));
|
|
446
|
+
const Container = safeArea ? _reactnativesafeareacontext.SafeAreaView : _reactnative.View;
|
|
447
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
448
|
+
Container,
|
|
449
|
+
{
|
|
450
|
+
style: [
|
|
451
|
+
{
|
|
452
|
+
flex: 1,
|
|
453
|
+
backgroundColor: resolvedBackgroundColor,
|
|
454
|
+
padding
|
|
455
|
+
},
|
|
456
|
+
style
|
|
457
|
+
]
|
|
458
|
+
},
|
|
459
|
+
children
|
|
460
|
+
);
|
|
461
|
+
};
|
|
462
|
+
Screen.displayName = "Screen";
|
|
463
|
+
|
|
433
464
|
// src/components/view/center/center.tsx
|
|
434
465
|
|
|
435
466
|
|
|
@@ -1094,4 +1125,5 @@ MasonryGridBuilder.displayName = "MasonryGridBuilder";
|
|
|
1094
1125
|
|
|
1095
1126
|
|
|
1096
1127
|
|
|
1097
|
-
|
|
1128
|
+
|
|
1129
|
+
exports.AspectRatio = AspectRatio; exports.BlurView = BlurView; exports.Center = Center; exports.Column = Column; exports.ConditionalView = ConditionalView; 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;
|
package/dist/view/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode, ReactElement, ComponentType } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { StyleProp, ViewStyle, ColorValue, ScrollViewProps } from 'react-native';
|
|
3
3
|
import { T as ThemeColor, R as Radius } from '../index-BOw6tbkc.cjs';
|
|
4
4
|
|
|
5
5
|
type MainAxisAlignment = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
@@ -36,7 +36,7 @@ type RowProps = {
|
|
|
36
36
|
/**
|
|
37
37
|
* Custom style for the row container.
|
|
38
38
|
*/
|
|
39
|
-
style?: ViewStyle
|
|
39
|
+
style?: StyleProp<ViewStyle>;
|
|
40
40
|
};
|
|
41
41
|
type ColumnProps = RowProps & {
|
|
42
42
|
/**
|
|
@@ -351,6 +351,33 @@ type SurfaceProps = {
|
|
|
351
351
|
|
|
352
352
|
declare const Surface: React.FC<SurfaceProps>;
|
|
353
353
|
|
|
354
|
+
type ScreenProps = {
|
|
355
|
+
/**
|
|
356
|
+
* Content rendered inside the screen container.
|
|
357
|
+
*/
|
|
358
|
+
children: ReactNode;
|
|
359
|
+
/**
|
|
360
|
+
* Uniform padding applied to the screen.
|
|
361
|
+
*/
|
|
362
|
+
padding?: number;
|
|
363
|
+
/**
|
|
364
|
+
* Optional custom background color.
|
|
365
|
+
* Uses theme background by default.
|
|
366
|
+
*/
|
|
367
|
+
backgroundColor?: string;
|
|
368
|
+
/**
|
|
369
|
+
* Wrap content in a SafeAreaView.
|
|
370
|
+
* @default false
|
|
371
|
+
*/
|
|
372
|
+
safeArea?: boolean;
|
|
373
|
+
/**
|
|
374
|
+
* Additional container styles.
|
|
375
|
+
*/
|
|
376
|
+
style?: StyleProp<ViewStyle>;
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
declare const Screen: React.FC<ScreenProps>;
|
|
380
|
+
|
|
354
381
|
type CenterProps = {
|
|
355
382
|
/**
|
|
356
383
|
* Content to render inside the centered container.
|
|
@@ -685,4 +712,4 @@ declare const MasonryGridBuilder: {
|
|
|
685
712
|
displayName: string;
|
|
686
713
|
};
|
|
687
714
|
|
|
688
|
-
export { AspectRatio, type AspectRatioProps, BlurView, type BlurViewProps, Center, type CenterProps, Column, type ColumnProps, ConditionalView, type ConditionalViewAnimation, type ConditionalViewProps, type CrossAxisAlignment, Grid, GridBuilder, type GridBuilderProps, GridItem, type GridItemProps, type GridProps, type MainAxisAlignment, Margin, type MarginProps, MasonryGrid, MasonryGridBuilder, type MasonryGridBuilderProps, MasonryGridItem, type MasonryGridItemProps, type MasonryGridProps, Padding, type PaddingProps, PositionedView, type PositionedViewProps, RoundedView, type RoundedViewProps, Row, type RowProps, SizedBox, type SizedBoxProps, Spacer, type SpacerProps, Surface, type SurfaceProps, type SurfaceThemeColor };
|
|
715
|
+
export { AspectRatio, type AspectRatioProps, BlurView, type BlurViewProps, Center, type CenterProps, Column, type ColumnProps, ConditionalView, type ConditionalViewAnimation, type ConditionalViewProps, type CrossAxisAlignment, Grid, GridBuilder, type GridBuilderProps, GridItem, type GridItemProps, type GridProps, type MainAxisAlignment, Margin, type MarginProps, MasonryGrid, MasonryGridBuilder, type MasonryGridBuilderProps, MasonryGridItem, type MasonryGridItemProps, type MasonryGridProps, Padding, type PaddingProps, PositionedView, type PositionedViewProps, RoundedView, type RoundedViewProps, Row, type RowProps, Screen, type ScreenProps, SizedBox, type SizedBoxProps, Spacer, type SpacerProps, Surface, type SurfaceProps, type SurfaceThemeColor };
|
package/dist/view/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode, ReactElement, ComponentType } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { StyleProp, ViewStyle, ColorValue, ScrollViewProps } from 'react-native';
|
|
3
3
|
import { T as ThemeColor, R as Radius } from '../index-BOw6tbkc.js';
|
|
4
4
|
|
|
5
5
|
type MainAxisAlignment = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
@@ -36,7 +36,7 @@ type RowProps = {
|
|
|
36
36
|
/**
|
|
37
37
|
* Custom style for the row container.
|
|
38
38
|
*/
|
|
39
|
-
style?: ViewStyle
|
|
39
|
+
style?: StyleProp<ViewStyle>;
|
|
40
40
|
};
|
|
41
41
|
type ColumnProps = RowProps & {
|
|
42
42
|
/**
|
|
@@ -351,6 +351,33 @@ type SurfaceProps = {
|
|
|
351
351
|
|
|
352
352
|
declare const Surface: React.FC<SurfaceProps>;
|
|
353
353
|
|
|
354
|
+
type ScreenProps = {
|
|
355
|
+
/**
|
|
356
|
+
* Content rendered inside the screen container.
|
|
357
|
+
*/
|
|
358
|
+
children: ReactNode;
|
|
359
|
+
/**
|
|
360
|
+
* Uniform padding applied to the screen.
|
|
361
|
+
*/
|
|
362
|
+
padding?: number;
|
|
363
|
+
/**
|
|
364
|
+
* Optional custom background color.
|
|
365
|
+
* Uses theme background by default.
|
|
366
|
+
*/
|
|
367
|
+
backgroundColor?: string;
|
|
368
|
+
/**
|
|
369
|
+
* Wrap content in a SafeAreaView.
|
|
370
|
+
* @default false
|
|
371
|
+
*/
|
|
372
|
+
safeArea?: boolean;
|
|
373
|
+
/**
|
|
374
|
+
* Additional container styles.
|
|
375
|
+
*/
|
|
376
|
+
style?: StyleProp<ViewStyle>;
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
declare const Screen: React.FC<ScreenProps>;
|
|
380
|
+
|
|
354
381
|
type CenterProps = {
|
|
355
382
|
/**
|
|
356
383
|
* Content to render inside the centered container.
|
|
@@ -685,4 +712,4 @@ declare const MasonryGridBuilder: {
|
|
|
685
712
|
displayName: string;
|
|
686
713
|
};
|
|
687
714
|
|
|
688
|
-
export { AspectRatio, type AspectRatioProps, BlurView, type BlurViewProps, Center, type CenterProps, Column, type ColumnProps, ConditionalView, type ConditionalViewAnimation, type ConditionalViewProps, type CrossAxisAlignment, Grid, GridBuilder, type GridBuilderProps, GridItem, type GridItemProps, type GridProps, type MainAxisAlignment, Margin, type MarginProps, MasonryGrid, MasonryGridBuilder, type MasonryGridBuilderProps, MasonryGridItem, type MasonryGridItemProps, type MasonryGridProps, Padding, type PaddingProps, PositionedView, type PositionedViewProps, RoundedView, type RoundedViewProps, Row, type RowProps, SizedBox, type SizedBoxProps, Spacer, type SpacerProps, Surface, type SurfaceProps, type SurfaceThemeColor };
|
|
715
|
+
export { AspectRatio, type AspectRatioProps, BlurView, type BlurViewProps, Center, type CenterProps, Column, type ColumnProps, ConditionalView, type ConditionalViewAnimation, type ConditionalViewProps, type CrossAxisAlignment, Grid, GridBuilder, type GridBuilderProps, GridItem, type GridItemProps, type GridProps, type MainAxisAlignment, Margin, type MarginProps, MasonryGrid, MasonryGridBuilder, type MasonryGridBuilderProps, MasonryGridItem, type MasonryGridItemProps, type MasonryGridProps, Padding, type PaddingProps, PositionedView, type PositionedViewProps, RoundedView, type RoundedViewProps, Row, type RowProps, Screen, type ScreenProps, SizedBox, type SizedBoxProps, Spacer, type SpacerProps, Surface, type SurfaceProps, type SurfaceThemeColor };
|
package/dist/view/index.js
CHANGED
|
@@ -430,9 +430,40 @@ var Surface = ({
|
|
|
430
430
|
};
|
|
431
431
|
Surface.displayName = "Surface";
|
|
432
432
|
|
|
433
|
-
// src/components/view/
|
|
433
|
+
// src/components/view/screen/screen.tsx
|
|
434
434
|
import React12 from "react";
|
|
435
435
|
import { View as View12 } from "react-native";
|
|
436
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
437
|
+
var Screen = ({
|
|
438
|
+
children,
|
|
439
|
+
padding,
|
|
440
|
+
backgroundColor,
|
|
441
|
+
safeArea = false,
|
|
442
|
+
style
|
|
443
|
+
}) => {
|
|
444
|
+
const theme = useXUITheme();
|
|
445
|
+
const resolvedBackgroundColor = backgroundColor ?? theme.colors.background;
|
|
446
|
+
const Container = safeArea ? SafeAreaView : View12;
|
|
447
|
+
return /* @__PURE__ */ React12.createElement(
|
|
448
|
+
Container,
|
|
449
|
+
{
|
|
450
|
+
style: [
|
|
451
|
+
{
|
|
452
|
+
flex: 1,
|
|
453
|
+
backgroundColor: resolvedBackgroundColor,
|
|
454
|
+
padding
|
|
455
|
+
},
|
|
456
|
+
style
|
|
457
|
+
]
|
|
458
|
+
},
|
|
459
|
+
children
|
|
460
|
+
);
|
|
461
|
+
};
|
|
462
|
+
Screen.displayName = "Screen";
|
|
463
|
+
|
|
464
|
+
// src/components/view/center/center.tsx
|
|
465
|
+
import React13 from "react";
|
|
466
|
+
import { View as View13 } from "react-native";
|
|
436
467
|
var Center = ({
|
|
437
468
|
children,
|
|
438
469
|
fullWidth,
|
|
@@ -440,8 +471,8 @@ var Center = ({
|
|
|
440
471
|
noGrowth = false
|
|
441
472
|
}) => {
|
|
442
473
|
const fullWidthStyle = fullWidth ? { width: "100%" } : void 0;
|
|
443
|
-
return /* @__PURE__ */
|
|
444
|
-
|
|
474
|
+
return /* @__PURE__ */ React13.createElement(
|
|
475
|
+
View13,
|
|
445
476
|
{
|
|
446
477
|
style: [
|
|
447
478
|
{
|
|
@@ -459,16 +490,16 @@ var Center = ({
|
|
|
459
490
|
Center.displayName = "Center";
|
|
460
491
|
|
|
461
492
|
// src/components/view/grid/grid.tsx
|
|
462
|
-
import
|
|
493
|
+
import React15, { useMemo as useMemo2, useState } from "react";
|
|
463
494
|
import {
|
|
464
|
-
View as
|
|
495
|
+
View as View15
|
|
465
496
|
} from "react-native";
|
|
466
497
|
|
|
467
498
|
// src/components/view/grid/grid-item.tsx
|
|
468
|
-
import
|
|
469
|
-
import { View as
|
|
499
|
+
import React14 from "react";
|
|
500
|
+
import { View as View14 } from "react-native";
|
|
470
501
|
var GridItem = ({ children, style }) => {
|
|
471
|
-
return /* @__PURE__ */
|
|
502
|
+
return /* @__PURE__ */ React14.createElement(View14, { style }, children);
|
|
472
503
|
};
|
|
473
504
|
GridItem.displayName = "GridItem";
|
|
474
505
|
|
|
@@ -482,7 +513,7 @@ var getSafeSpan = (span, columns) => {
|
|
|
482
513
|
return Math.min(Math.floor(span), columns);
|
|
483
514
|
};
|
|
484
515
|
var isGridItemElement = (child) => {
|
|
485
|
-
if (!
|
|
516
|
+
if (!React15.isValidElement(child)) return false;
|
|
486
517
|
if (child.type === GridItem) return true;
|
|
487
518
|
const displayName = child.type.displayName;
|
|
488
519
|
return displayName === "GridItem";
|
|
@@ -501,15 +532,15 @@ var Grid = ({
|
|
|
501
532
|
const resolvedRowSpacing = rowSpacing ?? spacing ?? 0;
|
|
502
533
|
const resolvedColumnSpacing = columnSpacing ?? spacing ?? 0;
|
|
503
534
|
const itemWidth = `${100 / safeColumns}%`;
|
|
504
|
-
const items =
|
|
535
|
+
const items = React15.Children.toArray(children);
|
|
505
536
|
const totalColumnGap = resolvedColumnSpacing * (safeColumns - 1);
|
|
506
537
|
const baseItemWidth = useMemo2(() => {
|
|
507
538
|
if (!containerWidth) return void 0;
|
|
508
539
|
return (containerWidth - totalColumnGap) / safeColumns;
|
|
509
540
|
}, [containerWidth, safeColumns, totalColumnGap]);
|
|
510
541
|
let currentColumn = 0;
|
|
511
|
-
return /* @__PURE__ */
|
|
512
|
-
|
|
542
|
+
return /* @__PURE__ */ React15.createElement(
|
|
543
|
+
View15,
|
|
513
544
|
{
|
|
514
545
|
style: [
|
|
515
546
|
{
|
|
@@ -526,7 +557,7 @@ var Grid = ({
|
|
|
526
557
|
}
|
|
527
558
|
},
|
|
528
559
|
items.map((child, index) => {
|
|
529
|
-
const key =
|
|
560
|
+
const key = React15.isValidElement(child) && child.key ? child.key : `grid-${index}`;
|
|
530
561
|
const span = isGridItemElement(child) ? getSafeSpan(child.props.span, safeColumns) : 1;
|
|
531
562
|
const spanWidth = baseItemWidth === void 0 ? `${100 / safeColumns * span}%` : baseItemWidth * span + resolvedColumnSpacing * (span - 1);
|
|
532
563
|
if (currentColumn + span > safeColumns) {
|
|
@@ -546,7 +577,7 @@ var Grid = ({
|
|
|
546
577
|
itemStyle,
|
|
547
578
|
child.props.style
|
|
548
579
|
];
|
|
549
|
-
const element2 =
|
|
580
|
+
const element2 = React15.cloneElement(child, {
|
|
550
581
|
key,
|
|
551
582
|
style: mergedStyle
|
|
552
583
|
});
|
|
@@ -554,8 +585,8 @@ var Grid = ({
|
|
|
554
585
|
return element2;
|
|
555
586
|
}
|
|
556
587
|
const defaultItemWidth = baseItemWidth === void 0 ? itemWidth : baseItemWidth;
|
|
557
|
-
const element = /* @__PURE__ */
|
|
558
|
-
|
|
588
|
+
const element = /* @__PURE__ */ React15.createElement(
|
|
589
|
+
View15,
|
|
559
590
|
{
|
|
560
591
|
key,
|
|
561
592
|
style: [
|
|
@@ -578,11 +609,11 @@ var Grid = ({
|
|
|
578
609
|
};
|
|
579
610
|
|
|
580
611
|
// src/components/view/grid/grid-builder.tsx
|
|
581
|
-
import
|
|
612
|
+
import React16, { useMemo as useMemo3 } from "react";
|
|
582
613
|
import {
|
|
583
614
|
FlatList,
|
|
584
615
|
StyleSheet as StyleSheet2,
|
|
585
|
-
View as
|
|
616
|
+
View as View16
|
|
586
617
|
} from "react-native";
|
|
587
618
|
var getSafeColumns2 = (columns) => {
|
|
588
619
|
if (!columns || columns <= 0) return 1;
|
|
@@ -669,7 +700,7 @@ var GridBuilder = ({
|
|
|
669
700
|
},
|
|
670
701
|
itemStyle
|
|
671
702
|
];
|
|
672
|
-
return /* @__PURE__ */
|
|
703
|
+
return /* @__PURE__ */ React16.createElement(View16, { style: placeholderStyle, pointerEvents: "none" });
|
|
673
704
|
}
|
|
674
705
|
const element = resolvedRenderer({ item: item.item, index: item.index });
|
|
675
706
|
if (element === null) return null;
|
|
@@ -685,7 +716,7 @@ var GridBuilder = ({
|
|
|
685
716
|
},
|
|
686
717
|
itemStyle
|
|
687
718
|
];
|
|
688
|
-
return /* @__PURE__ */
|
|
719
|
+
return /* @__PURE__ */ React16.createElement(View16, { style: wrapperStyle }, element);
|
|
689
720
|
};
|
|
690
721
|
const flattenedStyle = StyleSheet2.flatten(style) ?? {};
|
|
691
722
|
const {
|
|
@@ -706,7 +737,7 @@ var GridBuilder = ({
|
|
|
706
737
|
...columnGap !== void 0 ? { columnGap } : {}
|
|
707
738
|
};
|
|
708
739
|
const hasLayoutStyle = Object.keys(layoutStyle).length > 0;
|
|
709
|
-
return /* @__PURE__ */
|
|
740
|
+
return /* @__PURE__ */ React16.createElement(
|
|
710
741
|
FlatList,
|
|
711
742
|
{
|
|
712
743
|
data: paddedData,
|
|
@@ -726,7 +757,7 @@ var GridBuilder = ({
|
|
|
726
757
|
GridBuilder.displayName = "GridBuilder";
|
|
727
758
|
|
|
728
759
|
// src/components/view/conditional/conditional-view.tsx
|
|
729
|
-
import
|
|
760
|
+
import React17, { useEffect as useEffect2, useMemo as useMemo4, useRef as useRef2, useState as useState2 } from "react";
|
|
730
761
|
import { Animated as Animated3 } from "react-native";
|
|
731
762
|
|
|
732
763
|
// src/components/view/conditional/conditional-view.utils.ts
|
|
@@ -878,18 +909,18 @@ var ConditionalView = ({
|
|
|
878
909
|
if (!shouldRender) {
|
|
879
910
|
return null;
|
|
880
911
|
}
|
|
881
|
-
return /* @__PURE__ */
|
|
912
|
+
return /* @__PURE__ */ React17.createElement(Animated3.View, { style: animatedStyle }, children);
|
|
882
913
|
};
|
|
883
914
|
|
|
884
915
|
// src/components/view/masonry-grid/masonry-grid.tsx
|
|
885
|
-
import
|
|
886
|
-
import { View as
|
|
916
|
+
import React18, { useMemo as useMemo5, useRef as useRef3, useState as useState3 } from "react";
|
|
917
|
+
import { View as View17 } from "react-native";
|
|
887
918
|
var getSafeColumns3 = (columns) => {
|
|
888
919
|
if (!columns || columns <= 0) return 1;
|
|
889
920
|
return Math.floor(columns);
|
|
890
921
|
};
|
|
891
922
|
var getItemKey = (child, index) => {
|
|
892
|
-
return
|
|
923
|
+
return React18.isValidElement(child) && child.key ? String(child.key) : `masonry-${index}`;
|
|
893
924
|
};
|
|
894
925
|
var MasonryGrid = ({
|
|
895
926
|
children,
|
|
@@ -912,7 +943,7 @@ var MasonryGrid = ({
|
|
|
912
943
|
return (containerWidth - totalColumnGap) / safeColumns;
|
|
913
944
|
}, [containerWidth, safeColumns, totalColumnGap]);
|
|
914
945
|
const items = useMemo5(
|
|
915
|
-
() =>
|
|
946
|
+
() => React18.Children.toArray(children).map((child, index) => ({
|
|
916
947
|
key: getItemKey(child, index),
|
|
917
948
|
element: child
|
|
918
949
|
})),
|
|
@@ -929,8 +960,8 @@ var MasonryGrid = ({
|
|
|
929
960
|
});
|
|
930
961
|
return buckets;
|
|
931
962
|
}, [items, layoutVersion, resolvedRowSpacing, safeColumns]);
|
|
932
|
-
return /* @__PURE__ */
|
|
933
|
-
|
|
963
|
+
return /* @__PURE__ */ React18.createElement(
|
|
964
|
+
View17,
|
|
934
965
|
{
|
|
935
966
|
style: [
|
|
936
967
|
{
|
|
@@ -953,10 +984,10 @@ var MasonryGrid = ({
|
|
|
953
984
|
},
|
|
954
985
|
columnStyle
|
|
955
986
|
];
|
|
956
|
-
return /* @__PURE__ */
|
|
987
|
+
return /* @__PURE__ */ React18.createElement(View17, { key: `masonry-col-${columnIndex}`, style: columnStyles }, column.map((item, index) => {
|
|
957
988
|
const isLastRow = index === column.length - 1;
|
|
958
|
-
return /* @__PURE__ */
|
|
959
|
-
|
|
989
|
+
return /* @__PURE__ */ React18.createElement(
|
|
990
|
+
View17,
|
|
960
991
|
{
|
|
961
992
|
key: item.key,
|
|
962
993
|
style: { marginBottom: isLastRow ? 0 : resolvedRowSpacing },
|
|
@@ -975,18 +1006,18 @@ var MasonryGrid = ({
|
|
|
975
1006
|
};
|
|
976
1007
|
|
|
977
1008
|
// src/components/view/masonry-grid/masonry-grid-item.tsx
|
|
978
|
-
import
|
|
979
|
-
import { View as
|
|
1009
|
+
import React19 from "react";
|
|
1010
|
+
import { View as View18 } from "react-native";
|
|
980
1011
|
var MasonryGridItem = ({
|
|
981
1012
|
children,
|
|
982
1013
|
style
|
|
983
1014
|
}) => {
|
|
984
|
-
return /* @__PURE__ */
|
|
1015
|
+
return /* @__PURE__ */ React19.createElement(View18, { style }, children);
|
|
985
1016
|
};
|
|
986
1017
|
MasonryGridItem.displayName = "MasonryGridItem";
|
|
987
1018
|
|
|
988
1019
|
// src/components/view/masonry-grid/masonry-grid-builder.tsx
|
|
989
|
-
import
|
|
1020
|
+
import React20, { useMemo as useMemo6, useRef as useRef4 } from "react";
|
|
990
1021
|
import {
|
|
991
1022
|
ScrollView
|
|
992
1023
|
} from "react-native";
|
|
@@ -1046,7 +1077,7 @@ var MasonryGridBuilder = ({
|
|
|
1046
1077
|
onEndReached();
|
|
1047
1078
|
}
|
|
1048
1079
|
};
|
|
1049
|
-
return /* @__PURE__ */
|
|
1080
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1050
1081
|
ScrollView,
|
|
1051
1082
|
{
|
|
1052
1083
|
scrollEventThrottle: 16,
|
|
@@ -1058,7 +1089,7 @@ var MasonryGridBuilder = ({
|
|
|
1058
1089
|
onScroll: handleScroll
|
|
1059
1090
|
},
|
|
1060
1091
|
header,
|
|
1061
|
-
/* @__PURE__ */
|
|
1092
|
+
/* @__PURE__ */ React20.createElement(
|
|
1062
1093
|
MasonryGrid,
|
|
1063
1094
|
{
|
|
1064
1095
|
columns,
|
|
@@ -1068,7 +1099,7 @@ var MasonryGridBuilder = ({
|
|
|
1068
1099
|
style: [{ width: "100%" }, style],
|
|
1069
1100
|
columnStyle
|
|
1070
1101
|
},
|
|
1071
|
-
resolvedData.map((item, index) => /* @__PURE__ */
|
|
1102
|
+
resolvedData.map((item, index) => /* @__PURE__ */ React20.createElement(MasonryGridItem, { key: resolvedKeyExtractor(item, index) }, resolvedRenderer({ item, index })))
|
|
1072
1103
|
),
|
|
1073
1104
|
footer
|
|
1074
1105
|
);
|
|
@@ -1091,6 +1122,7 @@ export {
|
|
|
1091
1122
|
PositionedView,
|
|
1092
1123
|
RoundedView,
|
|
1093
1124
|
Row,
|
|
1125
|
+
Screen,
|
|
1094
1126
|
SizedBox,
|
|
1095
1127
|
Spacer,
|
|
1096
1128
|
Surface
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xaui/native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Flutter-inspired React Native UI components with native animations powered by React Native Reanimated",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -276,6 +276,8 @@
|
|
|
276
276
|
"react-native": ">=0.70.0",
|
|
277
277
|
"react-native-gesture-handler": ">=2.0.0",
|
|
278
278
|
"react-native-reanimated": ">=4.0.0",
|
|
279
|
+
"react-native-safe-area-context": ">=4.0.0",
|
|
280
|
+
"react-native-worklets": ">=0.5.0",
|
|
279
281
|
"react-native-svg": ">=15.0.0"
|
|
280
282
|
},
|
|
281
283
|
"devDependencies": {
|
|
@@ -285,6 +287,8 @@
|
|
|
285
287
|
"react-native": "^0.81.5",
|
|
286
288
|
"react-native-gesture-handler": "^2.28.0",
|
|
287
289
|
"react-native-reanimated": "^4.0.0",
|
|
290
|
+
"react-native-safe-area-context": "^5.6.0",
|
|
291
|
+
"react-native-worklets": "^0.5.1",
|
|
288
292
|
"react-native-svg": "^15.8.0",
|
|
289
293
|
"tsup": "^8.5.1",
|
|
290
294
|
"typescript": "^5.9.3"
|