@xsolla/xui-b2c-image-thumbnail 0.199.0 → 0.200.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/native/index.js +66 -5
- package/native/index.js.map +1 -1
- package/native/index.mjs +66 -5
- package/native/index.mjs.map +1 -1
- package/package.json +3 -3
package/native/index.js
CHANGED
|
@@ -2665,6 +2665,38 @@ module.exports = __toCommonJS(index_exports);
|
|
|
2665
2665
|
// ../../foundation/primitives-native/src/Box.tsx
|
|
2666
2666
|
var import_react_native = require("react-native");
|
|
2667
2667
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
2668
|
+
var roleToAccessibilityRole = {
|
|
2669
|
+
button: "button",
|
|
2670
|
+
link: "link",
|
|
2671
|
+
img: "image",
|
|
2672
|
+
image: "image",
|
|
2673
|
+
summary: "summary",
|
|
2674
|
+
switch: "switch",
|
|
2675
|
+
checkbox: "checkbox",
|
|
2676
|
+
radio: "radio",
|
|
2677
|
+
heading: "header",
|
|
2678
|
+
text: "text",
|
|
2679
|
+
search: "search",
|
|
2680
|
+
alert: "alert",
|
|
2681
|
+
none: "none",
|
|
2682
|
+
presentation: "none",
|
|
2683
|
+
progressbar: "progressbar",
|
|
2684
|
+
scrollbar: "scrollbar",
|
|
2685
|
+
adjustable: "adjustable",
|
|
2686
|
+
tab: "tab",
|
|
2687
|
+
menu: "menu",
|
|
2688
|
+
menuitem: "menuitem",
|
|
2689
|
+
list: "list",
|
|
2690
|
+
timer: "timer"
|
|
2691
|
+
};
|
|
2692
|
+
var toGapValue = (gap) => {
|
|
2693
|
+
if (gap === void 0) return void 0;
|
|
2694
|
+
if (typeof gap === "number") return gap;
|
|
2695
|
+
const pxMatch = /^(\d+(?:\.\d+)?)px$/.exec(gap);
|
|
2696
|
+
if (pxMatch) return Number(pxMatch[1]);
|
|
2697
|
+
const asNumber = Number(gap);
|
|
2698
|
+
return Number.isFinite(asNumber) ? asNumber : void 0;
|
|
2699
|
+
};
|
|
2668
2700
|
var Box = ({
|
|
2669
2701
|
children,
|
|
2670
2702
|
onPress,
|
|
@@ -2697,8 +2729,10 @@ var Box = ({
|
|
|
2697
2729
|
marginLeft,
|
|
2698
2730
|
marginRight,
|
|
2699
2731
|
flexDirection,
|
|
2732
|
+
flexWrap,
|
|
2700
2733
|
alignItems,
|
|
2701
2734
|
justifyContent,
|
|
2735
|
+
alignSelf,
|
|
2702
2736
|
position,
|
|
2703
2737
|
top,
|
|
2704
2738
|
bottom,
|
|
@@ -2710,11 +2744,14 @@ var Box = ({
|
|
|
2710
2744
|
maxWidth,
|
|
2711
2745
|
maxHeight,
|
|
2712
2746
|
flex,
|
|
2747
|
+
flexShrink,
|
|
2748
|
+
gap,
|
|
2713
2749
|
overflow,
|
|
2714
2750
|
zIndex,
|
|
2715
2751
|
hoverStyle,
|
|
2716
2752
|
pressStyle,
|
|
2717
2753
|
style,
|
|
2754
|
+
disabled,
|
|
2718
2755
|
"data-testid": dataTestId,
|
|
2719
2756
|
testID,
|
|
2720
2757
|
as,
|
|
@@ -2753,14 +2790,18 @@ var Box = ({
|
|
|
2753
2790
|
marginLeft,
|
|
2754
2791
|
marginRight,
|
|
2755
2792
|
flexDirection,
|
|
2793
|
+
flexWrap,
|
|
2756
2794
|
alignItems,
|
|
2757
2795
|
justifyContent,
|
|
2796
|
+
alignSelf,
|
|
2758
2797
|
position,
|
|
2759
2798
|
top,
|
|
2760
2799
|
bottom,
|
|
2761
2800
|
left,
|
|
2762
2801
|
right,
|
|
2763
2802
|
flex,
|
|
2803
|
+
flexShrink,
|
|
2804
|
+
gap: toGapValue(gap),
|
|
2764
2805
|
...style
|
|
2765
2806
|
});
|
|
2766
2807
|
const finalTestID = dataTestId || testID;
|
|
@@ -2769,15 +2810,25 @@ var Box = ({
|
|
|
2769
2810
|
tabIndex,
|
|
2770
2811
|
onKeyDown,
|
|
2771
2812
|
onKeyUp,
|
|
2772
|
-
"aria-label":
|
|
2813
|
+
"aria-label": ariaLabel,
|
|
2773
2814
|
"aria-labelledby": _ariaLabelledBy,
|
|
2774
2815
|
"aria-current": _ariaCurrent,
|
|
2775
|
-
"aria-disabled":
|
|
2776
|
-
"aria-live":
|
|
2816
|
+
"aria-disabled": ariaDisabled,
|
|
2817
|
+
"aria-live": ariaLive,
|
|
2818
|
+
"aria-busy": ariaBusy,
|
|
2777
2819
|
className,
|
|
2778
2820
|
"data-testid": _dataTestId,
|
|
2821
|
+
cursor: _cursor,
|
|
2822
|
+
type: _type,
|
|
2779
2823
|
...nativeRest
|
|
2780
2824
|
} = rest;
|
|
2825
|
+
const accessibilityRole = typeof role === "string" && roleToAccessibilityRole[role] || (as === "button" ? "button" : void 0);
|
|
2826
|
+
const isDisabled = Boolean(disabled || ariaDisabled);
|
|
2827
|
+
const accessibilityState = {
|
|
2828
|
+
disabled: isDisabled || void 0,
|
|
2829
|
+
busy: Boolean(ariaBusy) || void 0
|
|
2830
|
+
};
|
|
2831
|
+
const accessibilityLiveRegion = ariaLive === "polite" || ariaLive === "assertive" ? ariaLive : void 0;
|
|
2781
2832
|
if (as === "img" && src) {
|
|
2782
2833
|
const imageStyle = {
|
|
2783
2834
|
width,
|
|
@@ -2796,16 +2847,18 @@ var Box = ({
|
|
|
2796
2847
|
source: { uri: src },
|
|
2797
2848
|
style: imageStyle,
|
|
2798
2849
|
testID: finalTestID,
|
|
2850
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : alt,
|
|
2799
2851
|
resizeMode: "cover",
|
|
2800
2852
|
...nativeRest
|
|
2801
2853
|
}
|
|
2802
2854
|
);
|
|
2803
2855
|
}
|
|
2804
|
-
if (onPress) {
|
|
2856
|
+
if (onPress || as === "button") {
|
|
2805
2857
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2806
2858
|
import_react_native.Pressable,
|
|
2807
2859
|
{
|
|
2808
|
-
onPress,
|
|
2860
|
+
onPress: !isDisabled && onPress ? onPress : void 0,
|
|
2861
|
+
disabled: isDisabled,
|
|
2809
2862
|
onLayout,
|
|
2810
2863
|
onMoveShouldSetResponder,
|
|
2811
2864
|
onResponderGrant,
|
|
@@ -2814,6 +2867,10 @@ var Box = ({
|
|
|
2814
2867
|
onResponderTerminate,
|
|
2815
2868
|
style: ({ pressed }) => getContainerStyle(pressed),
|
|
2816
2869
|
testID: finalTestID,
|
|
2870
|
+
accessibilityRole,
|
|
2871
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : void 0,
|
|
2872
|
+
accessibilityState,
|
|
2873
|
+
accessibilityLiveRegion,
|
|
2817
2874
|
...nativeRest,
|
|
2818
2875
|
children
|
|
2819
2876
|
}
|
|
@@ -2830,6 +2887,10 @@ var Box = ({
|
|
|
2830
2887
|
onResponderMove,
|
|
2831
2888
|
onResponderRelease,
|
|
2832
2889
|
onResponderTerminate,
|
|
2890
|
+
accessibilityRole,
|
|
2891
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : void 0,
|
|
2892
|
+
accessibilityState,
|
|
2893
|
+
accessibilityLiveRegion,
|
|
2833
2894
|
...nativeRest,
|
|
2834
2895
|
children
|
|
2835
2896
|
}
|