@xaui/native 0.1.0 → 0.1.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/dist/view/index.cjs +42 -6
- package/dist/view/index.d.cts +24 -1
- package/dist/view/index.d.ts +24 -1
- package/dist/view/index.js +77 -41
- package/package.json +1 -1
package/dist/view/index.cjs
CHANGED
|
@@ -42,7 +42,7 @@ var Column = ({
|
|
|
42
42
|
style
|
|
43
43
|
}) => {
|
|
44
44
|
const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
|
|
45
|
-
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } :
|
|
45
|
+
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%", flexGrow: 1 } : { flexGrow: 1 };
|
|
46
46
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
47
47
|
_reactnative.View,
|
|
48
48
|
{
|
|
@@ -74,7 +74,7 @@ var Row = ({
|
|
|
74
74
|
style
|
|
75
75
|
}) => {
|
|
76
76
|
const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
|
|
77
|
-
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
|
|
77
|
+
const fullWidthStyle = fullWidth ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
|
|
78
78
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
79
79
|
_reactnative.View,
|
|
80
80
|
{
|
|
@@ -128,7 +128,7 @@ var Padding = ({
|
|
|
128
128
|
fullWidth,
|
|
129
129
|
style
|
|
130
130
|
}) => {
|
|
131
|
-
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } :
|
|
131
|
+
const fullWidthStyle = fullWidth ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : { flexGrow: 1 };
|
|
132
132
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
133
133
|
_reactnative.View,
|
|
134
134
|
{
|
|
@@ -166,7 +166,7 @@ var Margin = ({
|
|
|
166
166
|
fullWidth,
|
|
167
167
|
style
|
|
168
168
|
}) => {
|
|
169
|
-
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } :
|
|
169
|
+
const fullWidthStyle = fullWidth ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : { flexGrow: 1 };
|
|
170
170
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
171
171
|
_reactnative.View,
|
|
172
172
|
{
|
|
@@ -369,6 +369,9 @@ var RoundedView = ({
|
|
|
369
369
|
};
|
|
370
370
|
var styles2 = _reactnative.StyleSheet.create({
|
|
371
371
|
fullWidth: {
|
|
372
|
+
flexGrow: 1,
|
|
373
|
+
flexShrink: 1,
|
|
374
|
+
flexBasis: "auto",
|
|
372
375
|
width: "100%"
|
|
373
376
|
}
|
|
374
377
|
});
|
|
@@ -400,6 +403,7 @@ var Surface = ({
|
|
|
400
403
|
themeColor = "background",
|
|
401
404
|
padding,
|
|
402
405
|
radius = "none",
|
|
406
|
+
fullWidth = false,
|
|
403
407
|
style
|
|
404
408
|
}) => {
|
|
405
409
|
const theme = _chunkRZJFCDFScjs.useXUITheme.call(void 0, );
|
|
@@ -410,8 +414,13 @@ var Surface = ({
|
|
|
410
414
|
{
|
|
411
415
|
style: [
|
|
412
416
|
radiusStyle,
|
|
417
|
+
fullWidth && {
|
|
418
|
+
flexShrink: 1,
|
|
419
|
+
flexBasis: "auto",
|
|
420
|
+
width: "100%",
|
|
421
|
+
flexGrow: 1
|
|
422
|
+
},
|
|
413
423
|
{
|
|
414
|
-
flex: 1,
|
|
415
424
|
backgroundColor: background,
|
|
416
425
|
padding
|
|
417
426
|
},
|
|
@@ -423,6 +432,32 @@ var Surface = ({
|
|
|
423
432
|
};
|
|
424
433
|
Surface.displayName = "Surface";
|
|
425
434
|
|
|
435
|
+
// src/components/view/center/center.tsx
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
var Center = ({
|
|
439
|
+
children,
|
|
440
|
+
fullWidth = false,
|
|
441
|
+
style
|
|
442
|
+
}) => {
|
|
443
|
+
const fullWidthStyle = fullWidth ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : { flexGrow: 1 };
|
|
444
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
445
|
+
_reactnative.View,
|
|
446
|
+
{
|
|
447
|
+
style: [
|
|
448
|
+
{
|
|
449
|
+
alignItems: "center",
|
|
450
|
+
justifyContent: "center"
|
|
451
|
+
},
|
|
452
|
+
fullWidthStyle,
|
|
453
|
+
style
|
|
454
|
+
]
|
|
455
|
+
},
|
|
456
|
+
children
|
|
457
|
+
);
|
|
458
|
+
};
|
|
459
|
+
Center.displayName = "Center";
|
|
460
|
+
|
|
426
461
|
// src/components/view/grid/grid.tsx
|
|
427
462
|
|
|
428
463
|
|
|
@@ -1058,4 +1093,5 @@ MasonryGridBuilder.displayName = "MasonryGridBuilder";
|
|
|
1058
1093
|
|
|
1059
1094
|
|
|
1060
1095
|
|
|
1061
|
-
|
|
1096
|
+
|
|
1097
|
+
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.SizedBox = SizedBox; exports.Spacer = Spacer; exports.Surface = Surface;
|
package/dist/view/index.d.cts
CHANGED
|
@@ -312,6 +312,11 @@ type SurfaceProps = {
|
|
|
312
312
|
* @default 'none'
|
|
313
313
|
*/
|
|
314
314
|
radius?: Radius;
|
|
315
|
+
/**
|
|
316
|
+
* Force the surface to take the full width.
|
|
317
|
+
* @default false
|
|
318
|
+
*/
|
|
319
|
+
fullWidth?: boolean;
|
|
315
320
|
/**
|
|
316
321
|
* Additional container styles.
|
|
317
322
|
*/
|
|
@@ -320,6 +325,24 @@ type SurfaceProps = {
|
|
|
320
325
|
|
|
321
326
|
declare const Surface: React.FC<SurfaceProps>;
|
|
322
327
|
|
|
328
|
+
type CenterProps = {
|
|
329
|
+
/**
|
|
330
|
+
* Content to render inside the centered container.
|
|
331
|
+
*/
|
|
332
|
+
children: ReactNode;
|
|
333
|
+
/**
|
|
334
|
+
* Force the container to take the full width.
|
|
335
|
+
* @default false
|
|
336
|
+
*/
|
|
337
|
+
fullWidth?: boolean;
|
|
338
|
+
/**
|
|
339
|
+
* Additional style for the container.
|
|
340
|
+
*/
|
|
341
|
+
style?: StyleProp<ViewStyle>;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
declare const Center: React.FC<CenterProps>;
|
|
345
|
+
|
|
323
346
|
type GridProps = {
|
|
324
347
|
/**
|
|
325
348
|
* The grid items to render.
|
|
@@ -631,4 +654,4 @@ declare const MasonryGridBuilder: {
|
|
|
631
654
|
displayName: string;
|
|
632
655
|
};
|
|
633
656
|
|
|
634
|
-
export { AspectRatio, type AspectRatioProps, BlurView, type BlurViewProps, 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 };
|
|
657
|
+
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 };
|
package/dist/view/index.d.ts
CHANGED
|
@@ -312,6 +312,11 @@ type SurfaceProps = {
|
|
|
312
312
|
* @default 'none'
|
|
313
313
|
*/
|
|
314
314
|
radius?: Radius;
|
|
315
|
+
/**
|
|
316
|
+
* Force the surface to take the full width.
|
|
317
|
+
* @default false
|
|
318
|
+
*/
|
|
319
|
+
fullWidth?: boolean;
|
|
315
320
|
/**
|
|
316
321
|
* Additional container styles.
|
|
317
322
|
*/
|
|
@@ -320,6 +325,24 @@ type SurfaceProps = {
|
|
|
320
325
|
|
|
321
326
|
declare const Surface: React.FC<SurfaceProps>;
|
|
322
327
|
|
|
328
|
+
type CenterProps = {
|
|
329
|
+
/**
|
|
330
|
+
* Content to render inside the centered container.
|
|
331
|
+
*/
|
|
332
|
+
children: ReactNode;
|
|
333
|
+
/**
|
|
334
|
+
* Force the container to take the full width.
|
|
335
|
+
* @default false
|
|
336
|
+
*/
|
|
337
|
+
fullWidth?: boolean;
|
|
338
|
+
/**
|
|
339
|
+
* Additional style for the container.
|
|
340
|
+
*/
|
|
341
|
+
style?: StyleProp<ViewStyle>;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
declare const Center: React.FC<CenterProps>;
|
|
345
|
+
|
|
323
346
|
type GridProps = {
|
|
324
347
|
/**
|
|
325
348
|
* The grid items to render.
|
|
@@ -631,4 +654,4 @@ declare const MasonryGridBuilder: {
|
|
|
631
654
|
displayName: string;
|
|
632
655
|
};
|
|
633
656
|
|
|
634
|
-
export { AspectRatio, type AspectRatioProps, BlurView, type BlurViewProps, 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 };
|
|
657
|
+
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 };
|
package/dist/view/index.js
CHANGED
|
@@ -42,7 +42,7 @@ var Column = ({
|
|
|
42
42
|
style
|
|
43
43
|
}) => {
|
|
44
44
|
const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
|
|
45
|
-
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } :
|
|
45
|
+
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%", flexGrow: 1 } : { flexGrow: 1 };
|
|
46
46
|
return /* @__PURE__ */ React.createElement(
|
|
47
47
|
View,
|
|
48
48
|
{
|
|
@@ -74,7 +74,7 @@ var Row = ({
|
|
|
74
74
|
style
|
|
75
75
|
}) => {
|
|
76
76
|
const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
|
|
77
|
-
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
|
|
77
|
+
const fullWidthStyle = fullWidth ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
|
|
78
78
|
return /* @__PURE__ */ React2.createElement(
|
|
79
79
|
View2,
|
|
80
80
|
{
|
|
@@ -128,7 +128,7 @@ var Padding = ({
|
|
|
128
128
|
fullWidth,
|
|
129
129
|
style
|
|
130
130
|
}) => {
|
|
131
|
-
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } :
|
|
131
|
+
const fullWidthStyle = fullWidth ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : { flexGrow: 1 };
|
|
132
132
|
return /* @__PURE__ */ React4.createElement(
|
|
133
133
|
View4,
|
|
134
134
|
{
|
|
@@ -166,7 +166,7 @@ var Margin = ({
|
|
|
166
166
|
fullWidth,
|
|
167
167
|
style
|
|
168
168
|
}) => {
|
|
169
|
-
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } :
|
|
169
|
+
const fullWidthStyle = fullWidth ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : { flexGrow: 1 };
|
|
170
170
|
return /* @__PURE__ */ React5.createElement(
|
|
171
171
|
View5,
|
|
172
172
|
{
|
|
@@ -369,6 +369,9 @@ var RoundedView = ({
|
|
|
369
369
|
};
|
|
370
370
|
var styles2 = StyleSheet2.create({
|
|
371
371
|
fullWidth: {
|
|
372
|
+
flexGrow: 1,
|
|
373
|
+
flexShrink: 1,
|
|
374
|
+
flexBasis: "auto",
|
|
372
375
|
width: "100%"
|
|
373
376
|
}
|
|
374
377
|
});
|
|
@@ -400,6 +403,7 @@ var Surface = ({
|
|
|
400
403
|
themeColor = "background",
|
|
401
404
|
padding,
|
|
402
405
|
radius = "none",
|
|
406
|
+
fullWidth = false,
|
|
403
407
|
style
|
|
404
408
|
}) => {
|
|
405
409
|
const theme = useXUITheme();
|
|
@@ -410,8 +414,13 @@ var Surface = ({
|
|
|
410
414
|
{
|
|
411
415
|
style: [
|
|
412
416
|
radiusStyle,
|
|
417
|
+
fullWidth && {
|
|
418
|
+
flexShrink: 1,
|
|
419
|
+
flexBasis: "auto",
|
|
420
|
+
width: "100%",
|
|
421
|
+
flexGrow: 1
|
|
422
|
+
},
|
|
413
423
|
{
|
|
414
|
-
flex: 1,
|
|
415
424
|
backgroundColor: background,
|
|
416
425
|
padding
|
|
417
426
|
},
|
|
@@ -423,17 +432,43 @@ var Surface = ({
|
|
|
423
432
|
};
|
|
424
433
|
Surface.displayName = "Surface";
|
|
425
434
|
|
|
435
|
+
// src/components/view/center/center.tsx
|
|
436
|
+
import React12 from "react";
|
|
437
|
+
import { View as View12 } from "react-native";
|
|
438
|
+
var Center = ({
|
|
439
|
+
children,
|
|
440
|
+
fullWidth = false,
|
|
441
|
+
style
|
|
442
|
+
}) => {
|
|
443
|
+
const fullWidthStyle = fullWidth ? { flexGrow: 1, flexShrink: 1, flexBasis: "auto", width: "100%" } : { flexGrow: 1 };
|
|
444
|
+
return /* @__PURE__ */ React12.createElement(
|
|
445
|
+
View12,
|
|
446
|
+
{
|
|
447
|
+
style: [
|
|
448
|
+
{
|
|
449
|
+
alignItems: "center",
|
|
450
|
+
justifyContent: "center"
|
|
451
|
+
},
|
|
452
|
+
fullWidthStyle,
|
|
453
|
+
style
|
|
454
|
+
]
|
|
455
|
+
},
|
|
456
|
+
children
|
|
457
|
+
);
|
|
458
|
+
};
|
|
459
|
+
Center.displayName = "Center";
|
|
460
|
+
|
|
426
461
|
// src/components/view/grid/grid.tsx
|
|
427
|
-
import
|
|
462
|
+
import React14, { useMemo as useMemo2, useState } from "react";
|
|
428
463
|
import {
|
|
429
|
-
View as
|
|
464
|
+
View as View14
|
|
430
465
|
} from "react-native";
|
|
431
466
|
|
|
432
467
|
// src/components/view/grid/grid-item.tsx
|
|
433
|
-
import
|
|
434
|
-
import { View as
|
|
468
|
+
import React13 from "react";
|
|
469
|
+
import { View as View13 } from "react-native";
|
|
435
470
|
var GridItem = ({ children, style }) => {
|
|
436
|
-
return /* @__PURE__ */
|
|
471
|
+
return /* @__PURE__ */ React13.createElement(View13, { style }, children);
|
|
437
472
|
};
|
|
438
473
|
GridItem.displayName = "GridItem";
|
|
439
474
|
|
|
@@ -447,7 +482,7 @@ var getSafeSpan = (span, columns) => {
|
|
|
447
482
|
return Math.min(Math.floor(span), columns);
|
|
448
483
|
};
|
|
449
484
|
var isGridItemElement = (child) => {
|
|
450
|
-
if (!
|
|
485
|
+
if (!React14.isValidElement(child)) return false;
|
|
451
486
|
if (child.type === GridItem) return true;
|
|
452
487
|
const displayName = child.type.displayName;
|
|
453
488
|
return displayName === "GridItem";
|
|
@@ -466,15 +501,15 @@ var Grid = ({
|
|
|
466
501
|
const resolvedRowSpacing = rowSpacing ?? spacing ?? 0;
|
|
467
502
|
const resolvedColumnSpacing = columnSpacing ?? spacing ?? 0;
|
|
468
503
|
const itemWidth = `${100 / safeColumns}%`;
|
|
469
|
-
const items =
|
|
504
|
+
const items = React14.Children.toArray(children);
|
|
470
505
|
const totalColumnGap = resolvedColumnSpacing * (safeColumns - 1);
|
|
471
506
|
const baseItemWidth = useMemo2(() => {
|
|
472
507
|
if (!containerWidth) return void 0;
|
|
473
508
|
return (containerWidth - totalColumnGap) / safeColumns;
|
|
474
509
|
}, [containerWidth, safeColumns, totalColumnGap]);
|
|
475
510
|
let currentColumn = 0;
|
|
476
|
-
return /* @__PURE__ */
|
|
477
|
-
|
|
511
|
+
return /* @__PURE__ */ React14.createElement(
|
|
512
|
+
View14,
|
|
478
513
|
{
|
|
479
514
|
style: [
|
|
480
515
|
{
|
|
@@ -491,7 +526,7 @@ var Grid = ({
|
|
|
491
526
|
}
|
|
492
527
|
},
|
|
493
528
|
items.map((child, index) => {
|
|
494
|
-
const key =
|
|
529
|
+
const key = React14.isValidElement(child) && child.key ? child.key : `grid-${index}`;
|
|
495
530
|
const span = isGridItemElement(child) ? getSafeSpan(child.props.span, safeColumns) : 1;
|
|
496
531
|
const spanWidth = baseItemWidth === void 0 ? `${100 / safeColumns * span}%` : baseItemWidth * span + resolvedColumnSpacing * (span - 1);
|
|
497
532
|
if (currentColumn + span > safeColumns) {
|
|
@@ -511,7 +546,7 @@ var Grid = ({
|
|
|
511
546
|
itemStyle,
|
|
512
547
|
child.props.style
|
|
513
548
|
];
|
|
514
|
-
const element2 =
|
|
549
|
+
const element2 = React14.cloneElement(child, {
|
|
515
550
|
key,
|
|
516
551
|
style: mergedStyle
|
|
517
552
|
});
|
|
@@ -519,8 +554,8 @@ var Grid = ({
|
|
|
519
554
|
return element2;
|
|
520
555
|
}
|
|
521
556
|
const defaultItemWidth = baseItemWidth === void 0 ? itemWidth : baseItemWidth;
|
|
522
|
-
const element = /* @__PURE__ */
|
|
523
|
-
|
|
557
|
+
const element = /* @__PURE__ */ React14.createElement(
|
|
558
|
+
View14,
|
|
524
559
|
{
|
|
525
560
|
key,
|
|
526
561
|
style: [
|
|
@@ -543,11 +578,11 @@ var Grid = ({
|
|
|
543
578
|
};
|
|
544
579
|
|
|
545
580
|
// src/components/view/grid/grid-builder.tsx
|
|
546
|
-
import
|
|
581
|
+
import React15, { useMemo as useMemo3 } from "react";
|
|
547
582
|
import {
|
|
548
583
|
FlatList,
|
|
549
584
|
StyleSheet as StyleSheet3,
|
|
550
|
-
View as
|
|
585
|
+
View as View15
|
|
551
586
|
} from "react-native";
|
|
552
587
|
var getSafeColumns2 = (columns) => {
|
|
553
588
|
if (!columns || columns <= 0) return 1;
|
|
@@ -634,7 +669,7 @@ var GridBuilder = ({
|
|
|
634
669
|
},
|
|
635
670
|
itemStyle
|
|
636
671
|
];
|
|
637
|
-
return /* @__PURE__ */
|
|
672
|
+
return /* @__PURE__ */ React15.createElement(View15, { style: placeholderStyle, pointerEvents: "none" });
|
|
638
673
|
}
|
|
639
674
|
const element = resolvedRenderer({ item: item.item, index: item.index });
|
|
640
675
|
if (element === null) return null;
|
|
@@ -650,7 +685,7 @@ var GridBuilder = ({
|
|
|
650
685
|
},
|
|
651
686
|
itemStyle
|
|
652
687
|
];
|
|
653
|
-
return /* @__PURE__ */
|
|
688
|
+
return /* @__PURE__ */ React15.createElement(View15, { style: wrapperStyle }, element);
|
|
654
689
|
};
|
|
655
690
|
const flattenedStyle = StyleSheet3.flatten(style) ?? {};
|
|
656
691
|
const {
|
|
@@ -671,7 +706,7 @@ var GridBuilder = ({
|
|
|
671
706
|
...columnGap !== void 0 ? { columnGap } : {}
|
|
672
707
|
};
|
|
673
708
|
const hasLayoutStyle = Object.keys(layoutStyle).length > 0;
|
|
674
|
-
return /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ React15.createElement(
|
|
675
710
|
FlatList,
|
|
676
711
|
{
|
|
677
712
|
data: paddedData,
|
|
@@ -691,7 +726,7 @@ var GridBuilder = ({
|
|
|
691
726
|
GridBuilder.displayName = "GridBuilder";
|
|
692
727
|
|
|
693
728
|
// src/components/view/conditional/conditional-view.tsx
|
|
694
|
-
import
|
|
729
|
+
import React16, { useEffect as useEffect2, useMemo as useMemo4, useRef as useRef2, useState as useState2 } from "react";
|
|
695
730
|
import { Animated as Animated3 } from "react-native";
|
|
696
731
|
|
|
697
732
|
// src/components/view/conditional/conditional-view.utils.ts
|
|
@@ -843,18 +878,18 @@ var ConditionalView = ({
|
|
|
843
878
|
if (!shouldRender) {
|
|
844
879
|
return null;
|
|
845
880
|
}
|
|
846
|
-
return /* @__PURE__ */
|
|
881
|
+
return /* @__PURE__ */ React16.createElement(Animated3.View, { style: animatedStyle }, children);
|
|
847
882
|
};
|
|
848
883
|
|
|
849
884
|
// src/components/view/masonry-grid/masonry-grid.tsx
|
|
850
|
-
import
|
|
851
|
-
import { View as
|
|
885
|
+
import React17, { useMemo as useMemo5, useRef as useRef3, useState as useState3 } from "react";
|
|
886
|
+
import { View as View16 } from "react-native";
|
|
852
887
|
var getSafeColumns3 = (columns) => {
|
|
853
888
|
if (!columns || columns <= 0) return 1;
|
|
854
889
|
return Math.floor(columns);
|
|
855
890
|
};
|
|
856
891
|
var getItemKey = (child, index) => {
|
|
857
|
-
return
|
|
892
|
+
return React17.isValidElement(child) && child.key ? String(child.key) : `masonry-${index}`;
|
|
858
893
|
};
|
|
859
894
|
var MasonryGrid = ({
|
|
860
895
|
children,
|
|
@@ -877,7 +912,7 @@ var MasonryGrid = ({
|
|
|
877
912
|
return (containerWidth - totalColumnGap) / safeColumns;
|
|
878
913
|
}, [containerWidth, safeColumns, totalColumnGap]);
|
|
879
914
|
const items = useMemo5(
|
|
880
|
-
() =>
|
|
915
|
+
() => React17.Children.toArray(children).map((child, index) => ({
|
|
881
916
|
key: getItemKey(child, index),
|
|
882
917
|
element: child
|
|
883
918
|
})),
|
|
@@ -894,8 +929,8 @@ var MasonryGrid = ({
|
|
|
894
929
|
});
|
|
895
930
|
return buckets;
|
|
896
931
|
}, [items, layoutVersion, resolvedRowSpacing, safeColumns]);
|
|
897
|
-
return /* @__PURE__ */
|
|
898
|
-
|
|
932
|
+
return /* @__PURE__ */ React17.createElement(
|
|
933
|
+
View16,
|
|
899
934
|
{
|
|
900
935
|
style: [
|
|
901
936
|
{
|
|
@@ -918,10 +953,10 @@ var MasonryGrid = ({
|
|
|
918
953
|
},
|
|
919
954
|
columnStyle
|
|
920
955
|
];
|
|
921
|
-
return /* @__PURE__ */
|
|
956
|
+
return /* @__PURE__ */ React17.createElement(View16, { key: `masonry-col-${columnIndex}`, style: columnStyles }, column.map((item, index) => {
|
|
922
957
|
const isLastRow = index === column.length - 1;
|
|
923
|
-
return /* @__PURE__ */
|
|
924
|
-
|
|
958
|
+
return /* @__PURE__ */ React17.createElement(
|
|
959
|
+
View16,
|
|
925
960
|
{
|
|
926
961
|
key: item.key,
|
|
927
962
|
style: { marginBottom: isLastRow ? 0 : resolvedRowSpacing },
|
|
@@ -940,18 +975,18 @@ var MasonryGrid = ({
|
|
|
940
975
|
};
|
|
941
976
|
|
|
942
977
|
// src/components/view/masonry-grid/masonry-grid-item.tsx
|
|
943
|
-
import
|
|
944
|
-
import { View as
|
|
978
|
+
import React18 from "react";
|
|
979
|
+
import { View as View17 } from "react-native";
|
|
945
980
|
var MasonryGridItem = ({
|
|
946
981
|
children,
|
|
947
982
|
style
|
|
948
983
|
}) => {
|
|
949
|
-
return /* @__PURE__ */
|
|
984
|
+
return /* @__PURE__ */ React18.createElement(View17, { style }, children);
|
|
950
985
|
};
|
|
951
986
|
MasonryGridItem.displayName = "MasonryGridItem";
|
|
952
987
|
|
|
953
988
|
// src/components/view/masonry-grid/masonry-grid-builder.tsx
|
|
954
|
-
import
|
|
989
|
+
import React19, { useMemo as useMemo6, useRef as useRef4 } from "react";
|
|
955
990
|
import {
|
|
956
991
|
ScrollView
|
|
957
992
|
} from "react-native";
|
|
@@ -1011,7 +1046,7 @@ var MasonryGridBuilder = ({
|
|
|
1011
1046
|
onEndReached();
|
|
1012
1047
|
}
|
|
1013
1048
|
};
|
|
1014
|
-
return /* @__PURE__ */
|
|
1049
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1015
1050
|
ScrollView,
|
|
1016
1051
|
{
|
|
1017
1052
|
scrollEventThrottle: 16,
|
|
@@ -1023,7 +1058,7 @@ var MasonryGridBuilder = ({
|
|
|
1023
1058
|
onScroll: handleScroll
|
|
1024
1059
|
},
|
|
1025
1060
|
header,
|
|
1026
|
-
/* @__PURE__ */
|
|
1061
|
+
/* @__PURE__ */ React19.createElement(
|
|
1027
1062
|
MasonryGrid,
|
|
1028
1063
|
{
|
|
1029
1064
|
columns,
|
|
@@ -1033,7 +1068,7 @@ var MasonryGridBuilder = ({
|
|
|
1033
1068
|
style: [{ width: "100%" }, style],
|
|
1034
1069
|
columnStyle
|
|
1035
1070
|
},
|
|
1036
|
-
resolvedData.map((item, index) => /* @__PURE__ */
|
|
1071
|
+
resolvedData.map((item, index) => /* @__PURE__ */ React19.createElement(MasonryGridItem, { key: resolvedKeyExtractor(item, index) }, resolvedRenderer({ item, index })))
|
|
1037
1072
|
),
|
|
1038
1073
|
footer
|
|
1039
1074
|
);
|
|
@@ -1042,6 +1077,7 @@ MasonryGridBuilder.displayName = "MasonryGridBuilder";
|
|
|
1042
1077
|
export {
|
|
1043
1078
|
AspectRatio,
|
|
1044
1079
|
BlurView,
|
|
1080
|
+
Center,
|
|
1045
1081
|
Column,
|
|
1046
1082
|
ConditionalView,
|
|
1047
1083
|
Grid,
|