@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.mjs
CHANGED
|
@@ -2661,6 +2661,38 @@ import {
|
|
|
2661
2661
|
Image
|
|
2662
2662
|
} from "react-native";
|
|
2663
2663
|
import { jsx } from "react/jsx-runtime";
|
|
2664
|
+
var roleToAccessibilityRole = {
|
|
2665
|
+
button: "button",
|
|
2666
|
+
link: "link",
|
|
2667
|
+
img: "image",
|
|
2668
|
+
image: "image",
|
|
2669
|
+
summary: "summary",
|
|
2670
|
+
switch: "switch",
|
|
2671
|
+
checkbox: "checkbox",
|
|
2672
|
+
radio: "radio",
|
|
2673
|
+
heading: "header",
|
|
2674
|
+
text: "text",
|
|
2675
|
+
search: "search",
|
|
2676
|
+
alert: "alert",
|
|
2677
|
+
none: "none",
|
|
2678
|
+
presentation: "none",
|
|
2679
|
+
progressbar: "progressbar",
|
|
2680
|
+
scrollbar: "scrollbar",
|
|
2681
|
+
adjustable: "adjustable",
|
|
2682
|
+
tab: "tab",
|
|
2683
|
+
menu: "menu",
|
|
2684
|
+
menuitem: "menuitem",
|
|
2685
|
+
list: "list",
|
|
2686
|
+
timer: "timer"
|
|
2687
|
+
};
|
|
2688
|
+
var toGapValue = (gap) => {
|
|
2689
|
+
if (gap === void 0) return void 0;
|
|
2690
|
+
if (typeof gap === "number") return gap;
|
|
2691
|
+
const pxMatch = /^(\d+(?:\.\d+)?)px$/.exec(gap);
|
|
2692
|
+
if (pxMatch) return Number(pxMatch[1]);
|
|
2693
|
+
const asNumber = Number(gap);
|
|
2694
|
+
return Number.isFinite(asNumber) ? asNumber : void 0;
|
|
2695
|
+
};
|
|
2664
2696
|
var Box = ({
|
|
2665
2697
|
children,
|
|
2666
2698
|
onPress,
|
|
@@ -2693,8 +2725,10 @@ var Box = ({
|
|
|
2693
2725
|
marginLeft,
|
|
2694
2726
|
marginRight,
|
|
2695
2727
|
flexDirection,
|
|
2728
|
+
flexWrap,
|
|
2696
2729
|
alignItems,
|
|
2697
2730
|
justifyContent,
|
|
2731
|
+
alignSelf,
|
|
2698
2732
|
position,
|
|
2699
2733
|
top,
|
|
2700
2734
|
bottom,
|
|
@@ -2706,11 +2740,14 @@ var Box = ({
|
|
|
2706
2740
|
maxWidth,
|
|
2707
2741
|
maxHeight,
|
|
2708
2742
|
flex,
|
|
2743
|
+
flexShrink,
|
|
2744
|
+
gap,
|
|
2709
2745
|
overflow,
|
|
2710
2746
|
zIndex,
|
|
2711
2747
|
hoverStyle,
|
|
2712
2748
|
pressStyle,
|
|
2713
2749
|
style,
|
|
2750
|
+
disabled,
|
|
2714
2751
|
"data-testid": dataTestId,
|
|
2715
2752
|
testID,
|
|
2716
2753
|
as,
|
|
@@ -2749,14 +2786,18 @@ var Box = ({
|
|
|
2749
2786
|
marginLeft,
|
|
2750
2787
|
marginRight,
|
|
2751
2788
|
flexDirection,
|
|
2789
|
+
flexWrap,
|
|
2752
2790
|
alignItems,
|
|
2753
2791
|
justifyContent,
|
|
2792
|
+
alignSelf,
|
|
2754
2793
|
position,
|
|
2755
2794
|
top,
|
|
2756
2795
|
bottom,
|
|
2757
2796
|
left,
|
|
2758
2797
|
right,
|
|
2759
2798
|
flex,
|
|
2799
|
+
flexShrink,
|
|
2800
|
+
gap: toGapValue(gap),
|
|
2760
2801
|
...style
|
|
2761
2802
|
});
|
|
2762
2803
|
const finalTestID = dataTestId || testID;
|
|
@@ -2765,15 +2806,25 @@ var Box = ({
|
|
|
2765
2806
|
tabIndex,
|
|
2766
2807
|
onKeyDown,
|
|
2767
2808
|
onKeyUp,
|
|
2768
|
-
"aria-label":
|
|
2809
|
+
"aria-label": ariaLabel,
|
|
2769
2810
|
"aria-labelledby": _ariaLabelledBy,
|
|
2770
2811
|
"aria-current": _ariaCurrent,
|
|
2771
|
-
"aria-disabled":
|
|
2772
|
-
"aria-live":
|
|
2812
|
+
"aria-disabled": ariaDisabled,
|
|
2813
|
+
"aria-live": ariaLive,
|
|
2814
|
+
"aria-busy": ariaBusy,
|
|
2773
2815
|
className,
|
|
2774
2816
|
"data-testid": _dataTestId,
|
|
2817
|
+
cursor: _cursor,
|
|
2818
|
+
type: _type,
|
|
2775
2819
|
...nativeRest
|
|
2776
2820
|
} = rest;
|
|
2821
|
+
const accessibilityRole = typeof role === "string" && roleToAccessibilityRole[role] || (as === "button" ? "button" : void 0);
|
|
2822
|
+
const isDisabled = Boolean(disabled || ariaDisabled);
|
|
2823
|
+
const accessibilityState = {
|
|
2824
|
+
disabled: isDisabled || void 0,
|
|
2825
|
+
busy: Boolean(ariaBusy) || void 0
|
|
2826
|
+
};
|
|
2827
|
+
const accessibilityLiveRegion = ariaLive === "polite" || ariaLive === "assertive" ? ariaLive : void 0;
|
|
2777
2828
|
if (as === "img" && src) {
|
|
2778
2829
|
const imageStyle = {
|
|
2779
2830
|
width,
|
|
@@ -2792,16 +2843,18 @@ var Box = ({
|
|
|
2792
2843
|
source: { uri: src },
|
|
2793
2844
|
style: imageStyle,
|
|
2794
2845
|
testID: finalTestID,
|
|
2846
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : alt,
|
|
2795
2847
|
resizeMode: "cover",
|
|
2796
2848
|
...nativeRest
|
|
2797
2849
|
}
|
|
2798
2850
|
);
|
|
2799
2851
|
}
|
|
2800
|
-
if (onPress) {
|
|
2852
|
+
if (onPress || as === "button") {
|
|
2801
2853
|
return /* @__PURE__ */ jsx(
|
|
2802
2854
|
Pressable,
|
|
2803
2855
|
{
|
|
2804
|
-
onPress,
|
|
2856
|
+
onPress: !isDisabled && onPress ? onPress : void 0,
|
|
2857
|
+
disabled: isDisabled,
|
|
2805
2858
|
onLayout,
|
|
2806
2859
|
onMoveShouldSetResponder,
|
|
2807
2860
|
onResponderGrant,
|
|
@@ -2810,6 +2863,10 @@ var Box = ({
|
|
|
2810
2863
|
onResponderTerminate,
|
|
2811
2864
|
style: ({ pressed }) => getContainerStyle(pressed),
|
|
2812
2865
|
testID: finalTestID,
|
|
2866
|
+
accessibilityRole,
|
|
2867
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : void 0,
|
|
2868
|
+
accessibilityState,
|
|
2869
|
+
accessibilityLiveRegion,
|
|
2813
2870
|
...nativeRest,
|
|
2814
2871
|
children
|
|
2815
2872
|
}
|
|
@@ -2826,6 +2883,10 @@ var Box = ({
|
|
|
2826
2883
|
onResponderMove,
|
|
2827
2884
|
onResponderRelease,
|
|
2828
2885
|
onResponderTerminate,
|
|
2886
|
+
accessibilityRole,
|
|
2887
|
+
accessibilityLabel: typeof ariaLabel === "string" ? ariaLabel : void 0,
|
|
2888
|
+
accessibilityState,
|
|
2889
|
+
accessibilityLiveRegion,
|
|
2829
2890
|
...nativeRest,
|
|
2830
2891
|
children
|
|
2831
2892
|
}
|