@webority/mobile-ui 0.109.2 → 0.109.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/canvas-kit/kit.js +518 -458
- package/dist/canvas-kit/manifest.json +1 -1
- package/dist/canvas-kit/release.json +5 -5
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/commonjs/components/Screen/Screen.js +1 -1
- package/lib/commonjs/components/Screen/ScrollHost.js +1 -0
- package/lib/commonjs/components/SortableList/SortableList.js +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/module/components/Screen/Screen.js +1 -1
- package/lib/module/components/Screen/ScrollHost.js +1 -0
- package/lib/module/components/SortableList/SortableList.js +1 -1
- package/lib/typescript/commonjs/components/Screen/ScrollHost.d.ts +16 -0
- package/lib/typescript/module/components/Screen/ScrollHost.d.ts +16 -0
- package/package.json +7 -7
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webority-phone",
|
|
3
|
-
"version": "0.109.
|
|
3
|
+
"version": "0.109.4",
|
|
4
4
|
"platform": "Phone",
|
|
5
5
|
"kitModuleVersion": 2,
|
|
6
6
|
"rendererProtocolVersion": 12,
|
|
7
7
|
"library": {
|
|
8
8
|
"name": "@webority/mobile-ui",
|
|
9
|
-
"version": "0.109.
|
|
9
|
+
"version": "0.109.4"
|
|
10
10
|
},
|
|
11
11
|
"files": {
|
|
12
12
|
"manifest.json": {
|
|
13
|
-
"sha256": "
|
|
13
|
+
"sha256": "215b55d850940c1f68883d913e2779878a6b9abc85ee6a271f2baeb403a4c2bd",
|
|
14
14
|
"bytes": 625850
|
|
15
15
|
},
|
|
16
16
|
"kit.js": {
|
|
17
|
-
"sha256": "
|
|
18
|
-
"bytes":
|
|
17
|
+
"sha256": "f9094267670b4ed7a871879a0ff24f45883b6efd3f607dc36f568979d6b983e6",
|
|
18
|
+
"bytes": 5940174
|
|
19
19
|
},
|
|
20
20
|
"kit.css": {
|
|
21
21
|
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.ImageGallery=exports.DEFAULT_IMAGE_GALLERY_LABELS=void 0;var cache,_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_reactNativeGestureHandler=require("react-native-gesture-handler"),_reactNativeReanimated=_interopRequireWildcard(require("react-native-reanimated")),_index=require("../../theme/index.js"),_index2=require("../../utils/index.js"),_corners=require("../../utils/corners.js"),_hitSlop=require("../../utils/hitSlop.js"),_defaultIcons=require("../AppIcon/defaultIcons.js"),_index3=require("../Carousel/index.js"),_Modal=require("../Modal/Modal.js"),_index4=require("../Skeleton/index.js"),_index5=require("../Text/index.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,a){if(!a&&e&&e.__esModule)return e;var t,i,l=Object.defineProperty,r={__proto__:null,default:e};if(Object(e)!==e)return r;if(cache||"function"!=typeof WeakMap||(cache=new WeakMap),cache){if(cache.has(e))return cache.get(e);cache.set(e,r)}for(i in e)"default"!==i&&{}.hasOwnProperty.call(e,i)&&((t=l&&Object.getOwnPropertyDescriptor(e,i))&&(t.get||t.set)?l(r,i,t):r[i]=e[i]);return r}const DEFAULT_IMAGE_GALLERY_LABELS=exports.DEFAULT_IMAGE_GALLERY_LABELS={gallery:"Image gallery",imageOf:(e,a)=>`Image ${e} of ${a}`,openFullscreen:"Tap to open fullscreen",closeGallery:"Close gallery"},MAX_SCALE_FALLBACK=4,MIN_SCALE_FALLBACK=1,DOUBLE_TAP_SCALE_FALLBACK=2,SPRING_CONFIG={damping:18,stiffness:220,mass:1},ImageGallery=({images:e,initialIndex:a=0,showThumbnails:t=!0,showCounter:i=!0,enableLightbox:l=!0,enablePinchZoom:r=!0,onIndexChange:n,haptic:s,loading:o=!1,accessibilityLabel:c,containerStyle:u,testID:d,labels:m})=>{const _=(0,_index.useTheme)(),h=(0,_react.useMemo)(()=>buildStyles(_),[_]),g=(0,_react.useMemo)(()=>({...DEFAULT_IMAGE_GALLERY_LABELS,...m}),[m]),[v,x]=(0,_react.useState)(clamp(a,0,Math.max(0,e.length-1))),[p,b]=(0,_react.useState)(!1),R=(0,_react.useCallback)(e=>{x(e),n?.(e)},[n]),S=(0,_react.useCallback)(()=>{if(!l)return;const e=(0,_index2.resolveHaptic)(s,"selection");e&&(0,_index2.triggerHaptic)(e),b(!0)},[l,s]),y=(0,_react.useCallback)(()=>{const e=(0,_index2.resolveHaptic)(s,"selection");e&&(0,_index2.triggerHaptic)(e),b(!1)},[s]),I=(0,_react.useCallback)((a,t)=>{const i=a.alt??g.imageOf(t+1,e.length);return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:S,accessibilityRole:"image",accessibilityLabel:i,accessibilityHint:l?g.openFullscreen:void 0,style:h.imageWrap,children:(0,_jsxRuntime.jsx)(_reactNative.Image,{source:a.source,style:h.image,resizeMode:"cover"})})},[l,e.length,S,h,g]),N=(0,_react.useCallback)(e=>(0,_jsxRuntime.jsx)(_reactNative.Image,{source:e.source,style:h.thumbnailImage,resizeMode:"cover"}),[h]),j=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[h.container,u],testID:d,accessibilityLabel:c??g.gallery,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:h.carouselWrap,accessibilityElementsHidden:p,importantForAccessibility:p?"no-hide-descendants":"auto",children:[(0,_jsxRuntime.jsx)(_index3.Carousel,{data:e,defaultIndex:a,onIndexChange:R,renderItem:I,showPagination:!1,showThumbnails:t,renderThumbnail:N,haptic:s}),i&&e.length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:h.counterPill,pointerEvents:"none",children:(0,_jsxRuntime.jsx)(_index5.Text,{variant:"label",weight:"semibold",style:{color:_.colors["on-scrim"]},accessibilityLabel:g.imageOf(v+1,e.length),children:`${v+1} / ${e.length}`})}):null]}),l?(0,_jsxRuntime.jsx)(Lightbox,{visible:p,images:e,initialIndex:v,enablePinchZoom:r,showCounter:i,onClose:y,onIndexChange:R,haptic:s,labels:g}):null]});return o?(0,_jsxRuntime.jsx)(ImageGallerySkeleton,{images:e,showThumbnails:t,showCounter:i,containerStyle:u,testID:d}):j};exports.ImageGallery=ImageGallery,ImageGallery.displayName="ImageGallery";const ImageGallerySkeleton=({images:e,showThumbnails:a=!0,showCounter:t=!0,containerStyle:i,testID:l})=>{const r=(0,_index.useTheme)(),n=Math.min(e?.length||4,6);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[{width:"100%"},i],testID:l,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:{position:"relative"},children:[(0,_jsxRuntime.jsx)(_index4.Skeleton,{width:"100%",height:280,radius:"lg"}),t?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{position:"absolute",top:12,right:12},children:(0,_jsxRuntime.jsx)(_index4.Skeleton,{width:44,height:22,radius:"pill"})}):null]}),a?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flexDirection:"row",marginTop:r.space.md},children:Array.from({length:n}).map((e,a)=>(0,_jsxRuntime.jsx)(_index4.Skeleton,{width:64,height:64,radius:"md",style:{marginRight:r.space.sm}},`sk-thumb-${a}`))}):null]})};ImageGallerySkeleton.displayName="ImageGallerySkeleton",ImageGallery.Skeleton=ImageGallerySkeleton;const Lightbox=({visible:e,images:a,initialIndex:t,enablePinchZoom:i,showCounter:l,onClose:r,onIndexChange:n,haptic:s,labels:o})=>{const c=(0,_index.useTheme)(),u=(0,_react.useMemo)(()=>buildLightboxStyles(c),[c]),d=(0,_react.useRef)(null),[m,_]=(0,_react.useState)(t),h=(0,_react.useCallback)(e=>{if(e!==m){const a=(0,_index2.resolveHaptic)(s,"selection");a&&(0,_index2.triggerHaptic)(a),_(e),n(e)}},[m,n,s]),g=(0,_react.useCallback)((e,t)=>(0,_jsxRuntime.jsx)(ZoomableImage,{image:e,index:t,total:a.length,active:t===m,enabled:i,maxScale:4,minScale:1,doubleTapScale:2,haptic:s,imageLabel:o.imageOf}),[m,i,a.length,s,o]),v=a[m]?.caption;return(0,_jsxRuntime.jsx)(_Modal.Modal,{visible:e,onClose:r,presentation:"fullScreen",backdropPressClose:!1,animateMount:!1,contentStyle:{backgroundColor:"transparent"},children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:u.backdrop,children:[(0,_jsxRuntime.jsx)(_index3.Carousel,{ref:d,data:a,defaultIndex:t,onIndexChange:h,renderItem:g,showPagination:!1,haptic:s}),l&&a.length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:u.counterPill,pointerEvents:"none",children:(0,_jsxRuntime.jsx)(_index5.Text,{variant:"label",weight:"semibold",style:{color:c.colors["on-scrim"]},accessibilityLabel:o.imageOf(m+1,a.length),children:`${m+1} / ${a.length}`})}):null,(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:o.closeGallery,style:u.closeButton,hitSlop:12,...(0,_hitSlop.hitSlopMarker)(12),children:(c.settings.icons.close??_defaultIcons.defaultIcons.close)({size:24,color:c.colors["on-scrim"]})}),v?(0,_jsxRuntime.jsx)(_reactNativeReanimated.default.View,{style:u.captionWrap,entering:void 0,accessibilityElementsHidden:!1,children:(0,_jsxRuntime.jsx)(_index5.Text,{variant:"body",align:"center",numberOfLines:3,style:u.captionText,children:v})}):null]})})},ZoomableImage=({image:e,index:a,total:t,active:i,enabled:l,maxScale:r,minScale:n,doubleTapScale:s,haptic:o,imageLabel:c})=>{const u=_reactNative.Dimensions.get("window"),d=(0,_reactNativeReanimated.useSharedValue)(1),m=(0,_reactNativeReanimated.useSharedValue)(1),_=(0,_reactNativeReanimated.useSharedValue)(0),h=(0,_reactNativeReanimated.useSharedValue)(0),g=(0,_reactNativeReanimated.useSharedValue)(0),v=(0,_reactNativeReanimated.useSharedValue)(0),x=(0,_react.useCallback)(()=>{d.value=(0,_reactNativeReanimated.withSpring)(1,SPRING_CONFIG),m.value=1,_.value=(0,_reactNativeReanimated.withSpring)(0,SPRING_CONFIG),h.value=(0,_reactNativeReanimated.withSpring)(0,SPRING_CONFIG),g.value=0,v.value=0},[d,m,_,h,g,v]);_react.default.useEffect(()=>{i||(d.value=(0,_reactNativeReanimated.withTiming)(1,{duration:150}),_.value=(0,_reactNativeReanimated.withTiming)(0,{duration:150}),h.value=(0,_reactNativeReanimated.withTiming)(0,{duration:150}),m.value=1,g.value=0,v.value=0)},[i,d,_,h,m,g,v]);const p=(0,_react.useCallback)(()=>{!1!==o&&(0,_index2.triggerHaptic)("impactLight")},[o]),b=(0,_react.useMemo)(()=>_reactNativeGestureHandler.Gesture.Pinch().enabled(l).onStart(()=>{"worklet";m.value=d.value}).onUpdate(e=>{"worklet";const a=m.value*e.scale;d.value=a<n?n+.3*(a-n):a>r?r+.2*(a-r):a}).onEnd(()=>{"worklet";return d.value<n?(d.value=(0,_reactNativeReanimated.withSpring)(n,SPRING_CONFIG),_.value=(0,_reactNativeReanimated.withSpring)(0,SPRING_CONFIG),h.value=(0,_reactNativeReanimated.withSpring)(0,SPRING_CONFIG),m.value=n,g.value=0,void(v.value=0)):d.value>r?(d.value=(0,_reactNativeReanimated.withSpring)(r,SPRING_CONFIG),void(m.value=r)):void(m.value=d.value)}),[l,d,m,_,h,g,v,n,r]),R=(0,_react.useMemo)(()=>_reactNativeGestureHandler.Gesture.Pan().minPointers(1).maxPointers(1).onStart(()=>{"worklet";g.value=_.value,v.value=h.value}).onUpdate(e=>{"worklet";d.value<=1||(_.value=g.value+e.translationX,h.value=v.value+e.translationY)}).onEnd(()=>{"worklet";g.value=_.value,v.value=h.value}),[d,_,h,g,v]),S=(0,_react.useMemo)(()=>_reactNativeGestureHandler.Gesture.Tap().numberOfTaps(2).onEnd(()=>{"worklet";(0,_reactNativeReanimated.runOnJS)(p)(),d.value>1?(d.value=(0,_reactNativeReanimated.withSpring)(1,SPRING_CONFIG),_.value=(0,_reactNativeReanimated.withSpring)(0,SPRING_CONFIG),h.value=(0,_reactNativeReanimated.withSpring)(0,SPRING_CONFIG),m.value=1,g.value=0,v.value=0):(d.value=(0,_reactNativeReanimated.withSpring)(s,SPRING_CONFIG),m.value=s)}),[d,m,_,h,g,v,p,s]),y=(0,_react.useMemo)(()=>_reactNativeGestureHandler.Gesture.Race(b,R,S),[b,R,S]),I=(0,_reactNativeReanimated.useAnimatedStyle)(()=>({transform:[{translateX:_.value},{translateY:h.value},{scale:d.value}]}));_react.default.useEffect(()=>{i||x()},[i,x]);const N=e.alt??c(a+1,t);return(0,_jsxRuntime.jsx)(_reactNativeGestureHandler.GestureDetector,{gesture:y,children:(0,_jsxRuntime.jsx)(_reactNativeReanimated.default.View,{style:[lightboxImageStyles.container,{width:u.width}],children:(0,_jsxRuntime.jsx)(_reactNativeReanimated.default.Image,{source:e.source,resizeMode:"contain",style:[lightboxImageStyles.image,I],accessibilityLabel:N,accessible:!0})})})},clamp=(e,a,t)=>Math.min(Math.max(e,a),t),buildStyles=e=>_reactNative.StyleSheet.create({container:{width:"100%"},carouselWrap:{width:"100%",position:"relative"},imageWrap:{width:"100%",aspectRatio:16/9,backgroundColor:e.colors["bg-subtle"],overflow:"hidden",borderRadius:e.radius.md,..._corners.smoothCorners},image:{width:"100%",height:"100%"},thumbnailImage:{width:"100%",height:"100%"},counterPill:{position:"absolute",top:12,alignSelf:"center",paddingHorizontal:e.space.md,paddingVertical:e.space.xs,borderRadius:e.radius.pill,..._corners.smoothCorners,backgroundColor:"rgba(0,0,0,0.55)"}}),buildLightboxStyles=e=>_reactNative.StyleSheet.create({backdrop:{flex:1,backgroundColor:"#000",justifyContent:"center"},counterPill:{position:"absolute",top:48,alignSelf:"center",paddingHorizontal:e.space.md,paddingVertical:e.space.xs,borderRadius:e.radius.pill,..._corners.smoothCorners,backgroundColor:"rgba(0,0,0,0.6)"},closeButton:{position:"absolute",top:44,right:16,width:40,height:40,borderRadius:e.radius.pill,..._corners.smoothCorners,alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.5)"},captionWrap:{position:"absolute",left:0,right:0,bottom:32,paddingHorizontal:e.space.xl},captionText:{color:"#FFFFFF",lineHeight:21}}),lightboxImageStyles=_reactNative.StyleSheet.create({container:{flex:1,alignItems:"center",justifyContent:"center"},image:{width:"100%",height:"100%"}});var _default=exports.default=ImageGallery;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.ImageGallery=exports.DEFAULT_IMAGE_GALLERY_LABELS=void 0;var cache,_react=_interopRequireWildcard(require("react")),_reactNative=require("react-native"),_reactNativeGestureHandler=require("react-native-gesture-handler"),_reactNativeReanimated=_interopRequireWildcard(require("react-native-reanimated")),_index=require("../../theme/index.js"),_index2=require("../../utils/index.js"),_corners=require("../../utils/corners.js"),_hitSlop=require("../../utils/hitSlop.js"),_defaultIcons=require("../AppIcon/defaultIcons.js"),_index3=require("../Carousel/index.js"),_Modal=require("../Modal/Modal.js"),_index4=require("../Skeleton/index.js"),_index5=require("../Text/index.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,a){if(!a&&e&&e.__esModule)return e;var t,i,l=Object.defineProperty,r={__proto__:null,default:e};if(Object(e)!==e)return r;if(cache||"function"!=typeof WeakMap||(cache=new WeakMap),cache){if(cache.has(e))return cache.get(e);cache.set(e,r)}for(i in e)"default"!==i&&{}.hasOwnProperty.call(e,i)&&((t=l&&Object.getOwnPropertyDescriptor(e,i))&&(t.get||t.set)?l(r,i,t):r[i]=e[i]);return r}const DEFAULT_IMAGE_GALLERY_LABELS=exports.DEFAULT_IMAGE_GALLERY_LABELS={gallery:"Image gallery",imageOf:(e,a)=>`Image ${e} of ${a}`,openFullscreen:"Tap to open fullscreen",closeGallery:"Close gallery"},MAX_SCALE_FALLBACK=4,MIN_SCALE_FALLBACK=1,DOUBLE_TAP_SCALE_FALLBACK=2,SPRING_CONFIG={damping:18,stiffness:220,mass:1},ImageGallery=({images:e,initialIndex:a=0,showThumbnails:t=!0,showCounter:i=!0,enableLightbox:l=!0,enablePinchZoom:r=!0,onIndexChange:n,haptic:s,loading:o=!1,accessibilityLabel:c,containerStyle:u,testID:d,labels:m})=>{const _=(0,_index.useTheme)(),h=(0,_react.useMemo)(()=>buildStyles(_),[_]),g=(0,_react.useMemo)(()=>({...DEFAULT_IMAGE_GALLERY_LABELS,...m}),[m]),[v,x]=(0,_react.useState)(clamp(a,0,Math.max(0,e.length-1))),[p,b]=(0,_react.useState)(!1),R=(0,_react.useCallback)(e=>{x(e),n?.(e)},[n]),S=(0,_react.useCallback)(()=>{if(!l)return;const e=(0,_index2.resolveHaptic)(s,"selection");e&&(0,_index2.triggerHaptic)(e),b(!0)},[l,s]),y=(0,_react.useCallback)(()=>{const e=(0,_index2.resolveHaptic)(s,"selection");e&&(0,_index2.triggerHaptic)(e),b(!1)},[s]),I=(0,_react.useCallback)((a,t)=>{const i=a.alt??g.imageOf(t+1,e.length);return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:S,accessibilityRole:"image",accessibilityLabel:i,accessibilityHint:l?g.openFullscreen:void 0,style:h.imageWrap,children:(0,_jsxRuntime.jsx)(_reactNative.Image,{source:a.source,style:h.image,resizeMode:"cover"})})},[l,e.length,S,h,g]),N=(0,_react.useCallback)(e=>(0,_jsxRuntime.jsx)(_reactNative.Image,{source:e.source,style:h.thumbnailImage,resizeMode:"cover"}),[h]),j=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[h.container,u],testID:d,accessibilityLabel:c??g.gallery,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:h.carouselWrap,accessibilityElementsHidden:p,importantForAccessibility:p?"no-hide-descendants":"auto",children:[(0,_jsxRuntime.jsx)(_index3.Carousel,{data:e,defaultIndex:a,onIndexChange:R,renderItem:I,showPagination:!1,showThumbnails:t,renderThumbnail:N,haptic:s}),i&&e.length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:h.counterPill,pointerEvents:"none",children:(0,_jsxRuntime.jsx)(_index5.Text,{variant:"label",weight:"semibold",style:{color:_.colors["on-scrim"]},accessibilityLabel:g.imageOf(v+1,e.length),children:`${v+1} / ${e.length}`})}):null]}),l?(0,_jsxRuntime.jsx)(Lightbox,{visible:p,images:e,initialIndex:v,enablePinchZoom:r,showCounter:i,onClose:y,onIndexChange:R,haptic:s,labels:g}):null]});return o?(0,_jsxRuntime.jsx)(ImageGallerySkeleton,{images:e,showThumbnails:t,showCounter:i,containerStyle:u,testID:d}):j};exports.ImageGallery=ImageGallery,ImageGallery.displayName="ImageGallery";const ImageGallerySkeleton=({images:e,showThumbnails:a=!0,showCounter:t=!0,containerStyle:i,testID:l})=>{const r=(0,_index.useTheme)(),n=Math.min(e?.length||4,6);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[{width:"100%"},i],testID:l,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:{position:"relative"},children:[(0,_jsxRuntime.jsx)(_index4.Skeleton,{width:"100%",height:280,radius:"lg"}),t?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{position:"absolute",top:12,right:12},children:(0,_jsxRuntime.jsx)(_index4.Skeleton,{width:44,height:22,radius:"pill"})}):null]}),a?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flexDirection:"row",marginTop:r.space.md},children:Array.from({length:n}).map((e,a)=>(0,_jsxRuntime.jsx)(_index4.Skeleton,{width:64,height:64,radius:"md",style:{marginRight:r.space.sm}},`sk-thumb-${a}`))}):null]})};ImageGallerySkeleton.displayName="ImageGallerySkeleton",ImageGallery.Skeleton=ImageGallerySkeleton;const Lightbox=({visible:e,images:a,initialIndex:t,enablePinchZoom:i,showCounter:l,onClose:r,onIndexChange:n,haptic:s,labels:o})=>{const c=(0,_index.useTheme)(),u=(0,_react.useMemo)(()=>buildLightboxStyles(c),[c]),d=(0,_react.useRef)(null),[m,_]=(0,_react.useState)(t),h=(0,_react.useCallback)(e=>{if(e!==m){const a=(0,_index2.resolveHaptic)(s,"selection");a&&(0,_index2.triggerHaptic)(a),_(e),n(e)}},[m,n,s]),g=(0,_react.useCallback)((e,t)=>(0,_jsxRuntime.jsx)(ZoomableImage,{image:e,index:t,total:a.length,active:t===m,enabled:i,maxScale:4,minScale:1,doubleTapScale:2,haptic:s,imageLabel:o.imageOf}),[m,i,a.length,s,o]),v=a[m]?.caption;return(0,_jsxRuntime.jsx)(_Modal.Modal,{visible:e,onClose:r,presentation:"fullScreen",backdropPressClose:!1,animateMount:!1,contentStyle:{backgroundColor:"transparent"},children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:u.backdrop,children:[(0,_jsxRuntime.jsx)(_index3.Carousel,{ref:d,data:a,defaultIndex:t,onIndexChange:h,renderItem:g,showPagination:!1,haptic:s}),l&&a.length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:u.counterPill,pointerEvents:"none",children:(0,_jsxRuntime.jsx)(_index5.Text,{variant:"label",weight:"semibold",style:{color:c.colors["on-scrim"]},accessibilityLabel:o.imageOf(m+1,a.length),children:`${m+1} / ${a.length}`})}):null,(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:o.closeGallery,style:u.closeButton,hitSlop:12,...(0,_hitSlop.hitSlopMarker)(12),children:(c.settings.icons.close??_defaultIcons.defaultIcons.close)({size:24,color:c.colors["on-scrim"]})}),v?(0,_jsxRuntime.jsx)(_reactNativeReanimated.default.View,{style:u.captionWrap,entering:void 0,accessibilityElementsHidden:!1,children:(0,_jsxRuntime.jsx)(_index5.Text,{variant:"body",align:"center",numberOfLines:3,style:u.captionText,children:v})}):null]})})},ZoomableImage=({image:e,index:a,total:t,active:i,enabled:l,maxScale:r,minScale:n,doubleTapScale:s,haptic:o,imageLabel:c})=>{const u=_reactNative.Dimensions.get("window"),d=(0,_reactNativeReanimated.useSharedValue)(1),m=(0,_reactNativeReanimated.useSharedValue)(1),_=(0,_reactNativeReanimated.useSharedValue)(0),h=(0,_reactNativeReanimated.useSharedValue)(0),g=(0,_reactNativeReanimated.useSharedValue)(0),v=(0,_reactNativeReanimated.useSharedValue)(0),x=(0,_react.useCallback)(()=>{d.value=(0,_reactNativeReanimated.withSpring)(1,SPRING_CONFIG),m.value=1,_.value=(0,_reactNativeReanimated.withSpring)(0,SPRING_CONFIG),h.value=(0,_reactNativeReanimated.withSpring)(0,SPRING_CONFIG),g.value=0,v.value=0},[d,m,_,h,g,v]);_react.default.useEffect(()=>{i||(d.value=(0,_reactNativeReanimated.withTiming)(1,{duration:150}),_.value=(0,_reactNativeReanimated.withTiming)(0,{duration:150}),h.value=(0,_reactNativeReanimated.withTiming)(0,{duration:150}),m.value=1,g.value=0,v.value=0)},[i,d,_,h,m,g,v]);const p=(0,_react.useCallback)(()=>{!1!==o&&(0,_index2.triggerHaptic)("impactLight")},[o]),b=(0,_react.useMemo)(()=>_reactNativeGestureHandler.Gesture.Pinch().enabled(l).onStart(()=>{"worklet";m.value=d.value}).onUpdate(e=>{"worklet";const a=m.value*e.scale;d.value=a<n?n+.3*(a-n):a>r?r+.2*(a-r):a}).onEnd(()=>{"worklet";return d.value<n?(d.value=(0,_reactNativeReanimated.withSpring)(n,SPRING_CONFIG),_.value=(0,_reactNativeReanimated.withSpring)(0,SPRING_CONFIG),h.value=(0,_reactNativeReanimated.withSpring)(0,SPRING_CONFIG),m.value=n,g.value=0,void(v.value=0)):d.value>r?(d.value=(0,_reactNativeReanimated.withSpring)(r,SPRING_CONFIG),void(m.value=r)):void(m.value=d.value)}),[l,d,m,_,h,g,v,n,r]),R=(0,_react.useMemo)(()=>_reactNativeGestureHandler.Gesture.Pan().minPointers(1).maxPointers(1).onStart(()=>{"worklet";g.value=_.value,v.value=h.value}).onUpdate(e=>{"worklet";d.value<=1||(_.value=g.value+e.translationX,h.value=v.value+e.translationY)}).onEnd(()=>{"worklet";g.value=_.value,v.value=h.value}),[d,_,h,g,v]),S=(0,_react.useMemo)(()=>_reactNativeGestureHandler.Gesture.Tap().numberOfTaps(2).onEnd(()=>{"worklet";(0,_reactNativeReanimated.runOnJS)(p)(),d.value>1?(d.value=(0,_reactNativeReanimated.withSpring)(1,SPRING_CONFIG),_.value=(0,_reactNativeReanimated.withSpring)(0,SPRING_CONFIG),h.value=(0,_reactNativeReanimated.withSpring)(0,SPRING_CONFIG),m.value=1,g.value=0,v.value=0):(d.value=(0,_reactNativeReanimated.withSpring)(s,SPRING_CONFIG),m.value=s)}),[d,m,_,h,g,v,p,s]),y=(0,_react.useMemo)(()=>_reactNativeGestureHandler.Gesture.Race(b,R,S),[b,R,S]),I=(0,_reactNativeReanimated.useAnimatedStyle)(()=>({transform:[{translateX:_.value},{translateY:h.value},{scale:d.value}]}));_react.default.useEffect(()=>{i||x()},[i,x]);const N=e.alt??c(a+1,t);return(0,_jsxRuntime.jsx)(_reactNativeGestureHandler.GestureDetector,{gesture:y,children:(0,_jsxRuntime.jsx)(_reactNativeReanimated.default.View,{style:[lightboxImageStyles.container,{width:u.width}],children:(0,_jsxRuntime.jsx)(_reactNativeReanimated.default.Image,{source:e.source,resizeMode:"contain",style:[lightboxImageStyles.image,I],accessibilityLabel:N,accessible:!0})})})},clamp=(e,a,t)=>Math.min(Math.max(e,a),t),buildStyles=e=>_reactNative.StyleSheet.create({container:{width:"100%"},carouselWrap:{width:"100%",position:"relative"},imageWrap:{width:"100%",aspectRatio:16/9,backgroundColor:e.colors["bg-subtle"],overflow:"hidden",borderRadius:e.radius.md,..._corners.smoothCorners},image:{width:"100%",height:"100%"},thumbnailImage:{width:"100%",height:"100%"},counterPill:{position:"absolute",top:12,alignSelf:"center",paddingHorizontal:e.space.md,paddingVertical:e.space.xs,borderRadius:e.radius.pill,..._corners.smoothCorners,backgroundColor:"rgba(0,0,0,0.55)"}}),buildLightboxStyles=e=>_reactNative.StyleSheet.create({backdrop:{flex:1,backgroundColor:"#000",justifyContent:"center"},counterPill:{position:"absolute",top:48,alignSelf:"center",paddingHorizontal:e.space.md,paddingVertical:e.space.xs,borderRadius:e.radius.pill,..._corners.smoothCorners,backgroundColor:"rgba(0,0,0,0.6)"},closeButton:{position:"absolute",top:44,right:16,width:40,height:40,borderRadius:e.radius.pill,..._corners.smoothCorners,alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.5)"},captionWrap:{position:"absolute",left:0,right:0,bottom:32,paddingHorizontal:e.space.xl},captionText:{color:e.colors["on-scrim"],lineHeight:21}}),lightboxImageStyles=_reactNative.StyleSheet.create({container:{flex:1,alignItems:"center",justifyContent:"center"},image:{width:"100%",height:"100%"}});var _default=exports.default=ImageGallery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Screen=Screen;var _react=require("react"),_reactNative=require("react-native"),_reactNativeKeyboardController=require("react-native-keyboard-controller"),_reactNativeSafeAreaContext=require("react-native-safe-area-context"),_useRefreshControl=require("../../hooks/useRefreshControl.js"),_index=require("../../theme/index.js"),_index2=require("../AppBar/index.js"),_index3=require("../AsyncBlock/index.js"),_index4=require("../EmptyState/index.js"),_index5=require("../KeyboardAwareScrollView/index.js"),_index6=require("../KeyboardToolbar/index.js"),_index7=require("../PagedListFooter/index.js"),_jsxRuntime=require("react/jsx-runtime");const DEFAULT_EDGES=["top","bottom"],SCROLL_EVENT_THROTTLE=16,noop=()=>{};function renderFooter(e){return(0,_react.isValidElement)(e)?e:e?(0,_react.createElement)(e):null}const buildStyles=e=>_reactNative.StyleSheet.create({flex:{flex:1},root:{flex:1,backgroundColor:e.colors.bg},overlay:{position:"absolute",top:0,left:0,right:0},footer:{backgroundColor:e.colors.bg,borderTopWidth:_reactNative.StyleSheet.hairlineWidth,borderTopColor:e.colors.border}});function Screen(e){const{title:t,subtitle:r,largeTitle:o=!0,onBack:n,rightActions:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Screen=Screen;var _react=require("react"),_reactNative=require("react-native"),_reactNativeKeyboardController=require("react-native-keyboard-controller"),_reactNativeReanimated=require("react-native-reanimated"),_reactNativeSafeAreaContext=require("react-native-safe-area-context"),_useRefreshControl=require("../../hooks/useRefreshControl.js"),_index=require("../../theme/index.js"),_index2=require("../AppBar/index.js"),_index3=require("../AsyncBlock/index.js"),_index4=require("../EmptyState/index.js"),_index5=require("../KeyboardAwareScrollView/index.js"),_index6=require("../KeyboardToolbar/index.js"),_index7=require("../PagedListFooter/index.js"),_ScrollHost=require("./ScrollHost.js"),_jsxRuntime=require("react/jsx-runtime");const DEFAULT_EDGES=["top","bottom"],SCROLL_EVENT_THROTTLE=16,noop=()=>{};function renderFooter(e){return(0,_react.isValidElement)(e)?e:e?(0,_react.createElement)(e):null}const buildStyles=e=>_reactNative.StyleSheet.create({flex:{flex:1},root:{flex:1,backgroundColor:e.colors.bg},overlay:{position:"absolute",top:0,left:0,right:0},footer:{backgroundColor:e.colors.bg,borderTopWidth:_reactNative.StyleSheet.hairlineWidth,borderTopColor:e.colors.border}});function Screen(e){const{title:t,subtitle:r,largeTitle:o=!0,onBack:n,rightActions:a,leading:i,children:l,onRefresh:s,refreshing:c=!1,footer:d,scroll:u=!0,list:_,edges:x=DEFAULT_EDGES,keyboardToolbar:f=!0,bottomInset:v=0,scrollRef:h,onScroll:m,contentContainerStyle:g,testID:p}=e,R=(0,_index.useTheme)(),y=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),S=(0,_react.useMemo)(()=>buildStyles(R),[R]),[j]=(0,_react.useState)(()=>new _reactNative.Animated.Value(0)),[b,E]=(0,_react.useState)(0),C=void 0!==n,T=(0,_react.useRef)(n);T.current=n;const N=Boolean(t||r||n||i||a?.length),L=o&&void 0!==t,k=L&&(void 0!==_||u),V=k?b:0,A=void 0!==d,{refreshControl:q}=(0,_useRefreshControl.useRefreshControl)({onRefresh:s??noop,refreshing:c}),w=s?(0,_react.cloneElement)(q,{progressViewOffset:V}):void 0,B=(0,_reactNativeReanimated.useSharedValue)(0),F=(0,_reactNativeReanimated.useSharedValue)(0),O=(0,_reactNativeReanimated.useSharedValue)(0),M=(0,_reactNativeReanimated.useSharedValue)(0),H=(0,_react.useRef)(null),D=(0,_react.useRef)(0),K=(0,_react.useRef)(0),P=(0,_react.useMemo)(()=>({top:B,bottom:F,offset:O,maxOffset:M,scrollTo:e=>H.current?.scrollTo({y:e,animated:!1})}),[B,F,O,M]),I=(0,_react.useCallback)(e=>{H.current=e,"function"==typeof h?h(e):h&&(h.current=e)},[h]),W=(0,_react.useCallback)(()=>{M.value=Math.max(0,D.current-K.current)},[M]),G=(0,_react.useRef)(m);G.current=m;const U=(0,_react.useMemo)(()=>_reactNative.Animated.event([{nativeEvent:{contentOffset:{y:j}}}],{useNativeDriver:!1,listener:e=>{O.value=e.nativeEvent.contentOffset.y,G.current?.(e)}}),[j,O]),z=(0,_react.useCallback)(e=>{const{height:t}=e.nativeEvent.layout;E(e=>Math.max(e,t))},[]);(0,_react.useEffect)(()=>{if(!C)return;const e=_reactNative.BackHandler.addEventListener("hardwareBackPress",()=>(T.current?.(),!0));return()=>e.remove()},[C]);const Y=x.includes("left")?y.left:0,J=x.includes("right")?y.right:0,Q=x.includes("bottom")?y.bottom:0,X=x.includes("top")&&!N?y.top:0,Z=x.filter(e=>"top"!==e&&!("bottom"===e&&A)),$=N?(0,_jsxRuntime.jsx)(_reactNative.View,{style:k?S.overlay:void 0,onLayout:k?z:void 0,children:(0,_jsxRuntime.jsx)(_index2.AppBar,{title:t,subtitle:r,variant:L?"large":"default",scrollY:k?j:void 0,onBack:n,rightActions:a,leading:i})}):null,ee=k||m?U:void 0,te=(0,_react.useCallback)(()=>{H.current?.getNativeScrollRef()?.measureInWindow((e,t,r,o)=>{K.current=o,B.value=t+V,F.value=t+o,W()})},[V,B,F,W]);(0,_react.useEffect)(()=>{te()},[te]);const re=(0,_react.useCallback)((e,t)=>{D.current=t,W()},[W]);let oe;if(void 0!==_){const{state:e,paging:t,...r}=_,handleEndReached=e=>{t?.hasMore&&!t.loadingMore&&null==t.errorMore&&t.loadMore(),r.onEndReached?.(e)},o=(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled",onEndReachedThreshold:t?.5:void 0,...r,ref:h,refreshControl:w,onScroll:ee,onEndReached:t?handleEndReached:r.onEndReached,ListEmptyComponent:e?.empty?(0,_jsxRuntime.jsx)(_index4.EmptyState,{...e.empty}):void 0,ListFooterComponent:t||r.ListFooterComponent?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[renderFooter(r.ListFooterComponent),t?(0,_jsxRuntime.jsx)(_index7.PagedListFooter,{paging:t}):null]}):void 0,scrollEventThrottle:SCROLL_EVENT_THROTTLE,style:S.flex,contentContainerStyle:[{paddingTop:V,paddingLeft:Y,paddingRight:J},{paddingBottom:(A?0:Q)+v},r.contentContainerStyle,g]});oe=e?(0,_jsxRuntime.jsx)(_index3.AsyncBlock,{loading:e.loading,error:e.error,errorTitle:e.errorTitle,onRetry:e.onRetry,skeleton:e.skeleton,style:[S.flex,{paddingTop:V}],children:o}):o}else oe=u?(0,_jsxRuntime.jsx)(_ScrollHost.ScrollHostContext.Provider,{value:P,children:(0,_jsxRuntime.jsxs)(_index5.KeyboardAwareScrollView,{ref:I,refreshControl:w,onScroll:U,scrollEventThrottle:SCROLL_EVENT_THROTTLE,onLayout:te,onContentSizeChange:re,safeAreaEdges:Z,style:S.flex,contentContainerStyle:[{paddingTop:V},g],children:[l,v>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{height:v}}):null]})}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:[S.flex,{paddingLeft:Y,paddingRight:J,paddingBottom:(A?0:Q)+v},g],children:l});const ne=A?(0,_jsxRuntime.jsx)(_reactNativeKeyboardController.KeyboardStickyView,{style:[S.footer,{paddingLeft:Y,paddingRight:J,paddingBottom:Q+v}],children:d}):null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{testID:p,style:[S.root,{paddingTop:X}],children:[k?null:$,oe,ne,void 0!==_?l:null,k?$:null,f?(0,_jsxRuntime.jsx)(_index6.KeyboardToolbar,{}):null]})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ScrollHostContext=void 0,exports.useScrollHost=useScrollHost;var _react=require("react");const ScrollHostContext=exports.ScrollHostContext=(0,_react.createContext)(null);function useScrollHost(){return(0,_react.useContext)(ScrollHostContext)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_SORTABLE_LIST_LABELS=void 0,exports.SortableList=SortableList,exports.default=void 0,exports.dropIndex=dropIndex,exports.moveItem=moveItem,exports.rowShifts=rowShifts,exports.slotTop=slotTop,exports.topOf=topOf;var cache,_react=require("react"),_reactNative=require("react-native"),_reactNativeGestureHandler=require("react-native-gesture-handler"),_reactNativeReanimated=_interopRequireWildcard(require("react-native-reanimated")),_index=require("../../theme/index.js"),_index2=require("../../utils/index.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var a,r,n=Object.defineProperty,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_SORTABLE_LIST_LABELS=void 0,exports.SortableList=SortableList,exports.default=void 0,exports.dropIndex=dropIndex,exports.moveItem=moveItem,exports.rowShifts=rowShifts,exports.slotTop=slotTop,exports.topOf=topOf;var cache,_react=require("react"),_reactNative=require("react-native"),_reactNativeGestureHandler=require("react-native-gesture-handler"),_reactNativeReanimated=_interopRequireWildcard(require("react-native-reanimated")),_index=require("../../theme/index.js"),_index2=require("../../utils/index.js"),_ScrollHost=require("../Screen/ScrollHost.js"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var a,r,n=Object.defineProperty,l={__proto__:null,default:e};if(Object(e)!==e)return l;if(cache||"function"!=typeof WeakMap||(cache=new WeakMap),cache){if(cache.has(e))return cache.get(e);cache.set(e,l)}for(r in e)"default"!==r&&{}.hasOwnProperty.call(e,r)&&((a=n&&Object.getOwnPropertyDescriptor(e,r))&&(a.get||a.set)?n(l,r,a):l[r]=e[r]);return l}const DEFAULT_SORTABLE_LIST_LABELS=exports.DEFAULT_SORTABLE_LIST_LABELS=Object.freeze({moveUp:"Move up",moveDown:"Move down"}),LONG_PRESS_MS=350,EDGE_PX=48,SCROLL_STEP_PX=12,SPRING_CONFIG={damping:22,stiffness:260,mass:1},ACTION_STEP={moveUp:-1,moveDown:1},noop=e=>{};function moveItem(e,t,a){const r=e.slice();if(t<0||t>=r.length)return r;const[n]=r.splice(t,1);return r.splice(a,0,n),r}function topOf(e,t){"worklet";let a=0;for(let r=0;r<t;r++)a+=e[r]??0;return a}function slotTop(e,t,a){"worklet";let r=0,n=0;for(let l=0;l<e.length&&n<a;l++)l!==t&&(r+=e[l]??0,n++);return r}function dropIndex(e,t,a){"worklet";const r=topOf(e,t)+(e[t]??0)/2+a;let n=0,l=0;for(let a=0;a<e.length;a++){const i=e[a]??0;a!==t&&l+i/2<r&&n++,l+=i}return n}function rowShifts(e,t,a){const r=[];let n=0;for(const t of e)r.push(n),n+=t;const l=e.map(()=>0),i=moveItem(e.map((e,t)=>t),t,a);let o=0;for(const t of i)l[t]=o-(r[t]??0),o+=e[t]??0;return l}const buildStyles=e=>_reactNative.StyleSheet.create({handleRow:{flexDirection:"row",alignItems:"center"},handle:{paddingHorizontal:e.space.sm,paddingVertical:e.space.md,gap:e.space.xxs},bar:{width:e.space.md,height:e.space.xxs,backgroundColor:e.colors["text-muted"]},body:{flex:1}});function SortableRow({rowKey:e,index:t,count:a,shift:r,isActive:n,dragging:l,handle:i,disabled:o,shared:s,callbacks:c,labels:u,children:d}){const v=(0,_index.useTheme)(),_=(0,_react.useMemo)(()=>buildStyles(v),[v]),m=(0,_reactNativeReanimated.useSharedValue)(0);(0,_react.useEffect)(()=>{m.value=l&&!n?(0,_reactNativeReanimated.withSpring)(r,SPRING_CONFIG):r},[l,n,r,m]),(0,_react.useEffect)(()=>()=>{(0,_reactNativeReanimated.cancelAnimation)(m)},[m]);const h=(0,_reactNativeReanimated.useAnimatedStyle)(()=>({transform:[{translateY:n?s.dragY.value:m.value}],zIndex:n?1:0})),S=(0,_react.useMemo)(()=>{const{dragIndex:e,dropTo:a,dragY:r,translation:n,absoluteY:l,scrollY:u,scrollStart:d,hostOffset:v,hostStart:_,hostTarget:m,heights:h}=s,{onLift:S,onDrop:f,onSettled:p}=c,R=_reactNativeGestureHandler.Gesture.Pan().enabled(!o).onStart(()=>{"worklet";e.value=t,a.value=t,d.value=u.value,_.value=v.value,m.value=v.value,n.value=0,r.value=0,(0,_reactNativeReanimated.runOnJS)(S)(t)}).onUpdate(a=>{"worklet";e.value===t&&(n.value=a.translationY,l.value=a.absoluteY)}).onFinalize(()=>{"worklet";if(e.value!==t)return;const n=a.value,l=h.value;e.value=-1,r.value=topOf(l,t)+r.value-slotTop(l,t,n),r.value=(0,_reactNativeReanimated.withSpring)(0,SPRING_CONFIG,e=>{"worklet";e&&(0,_reactNativeReanimated.runOnJS)(p)()}),(0,_reactNativeReanimated.runOnJS)(f)(t,n)});return i?R:R.activateAfterLongPress(350)},[o,i,t,c,s]),f=o?[]:[...t>0?[{name:"moveUp",label:u.moveUp}]:[],...t<a-1?[{name:"moveDown",label:u.moveDown}]:[]];return(0,_jsxRuntime.jsx)(_reactNativeReanimated.default.View,{style:h,onLayout:t=>c.onHeight(e,t.nativeEvent.layout.height),accessibilityActions:f,onAccessibilityAction:e=>{if(o)return;const r=t+(ACTION_STEP[e.nativeEvent.actionName]??0);r!==t&&r>=0&&r<a&&c.onMove(t,r)},testID:`sortable-row-${e}`,children:i?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_.handleRow,children:[(0,_jsxRuntime.jsx)(_reactNativeGestureHandler.GestureDetector,{gesture:S,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_.handle,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:_.bar}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:_.bar}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:_.bar})]})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:_.body,children:d})]}):(0,_jsxRuntime.jsx)(_reactNativeGestureHandler.GestureDetector,{gesture:S,children:(0,_jsxRuntime.jsx)(_reactNative.View,{children:d})})})}function SortableList(e){const{data:t,keyExtractor:a,renderItem:r,onReorder:n,handle:l=!1,disabled:i=!1,accessibilityLabel:o,labels:s,testID:c}=e,u=(0,_react.useMemo)(()=>({...DEFAULT_SORTABLE_LIST_LABELS,...s}),[s]),d=(0,_react.useMemo)(()=>t.map((e,t)=>({key:a(e,t),item:e})),[t,a]),v=(0,_react.useMemo)(()=>d.map(e=>e.key),[d]),_=(0,_reactNativeReanimated.useAnimatedRef)(),m=(0,_reactNativeReanimated.useSharedValue)(0),h=(0,_reactNativeReanimated.useSharedValue)(0),S=(0,_reactNativeReanimated.useSharedValue)(0),f=(0,_ScrollHost.useScrollHost)(),p=(0,_reactNativeReanimated.useSharedValue)(0),R=null!==f,g=f?.top??p,x=f?.bottom??p,N=f?.offset??p,b=f?.maxOffset??p,L=f?.scrollTo??noop,w=(0,_reactNativeReanimated.useSharedValue)(0),O=(0,_reactNativeReanimated.useSharedValue)(0),y=(0,_reactNativeReanimated.useSharedValue)(0),E=(0,_reactNativeReanimated.useSharedValue)(0),j=(0,_reactNativeReanimated.useSharedValue)(-1),T=(0,_reactNativeReanimated.useSharedValue)(-1),k=(0,_reactNativeReanimated.useSharedValue)(0),I=(0,_reactNativeReanimated.useSharedValue)([]),A=(0,_react.useRef)(new Map),P=(0,_react.useRef)(v),[M,V]=(0,_react.useState)(null),C=(0,_react.useCallback)(()=>{I.value=P.current.map(e=>A.current.get(e)??0)},[I]);(0,_react.useEffect)(()=>{P.current=v,C()},[v,C]),(0,_react.useEffect)(()=>()=>{(0,_reactNativeReanimated.cancelAnimation)(k)},[k]);const D=(0,_react.useCallback)(e=>{V(t=>t?.dragging?{...t,to:e}:t)},[]),G=(0,_reactNativeReanimated.useFrameCallback)(()=>{"worklet";const e=j.value;if(e<0)return;const t=(0,_reactNativeReanimated.measure)(_);if(t){const e=R?Math.max(t.pageY,g.value):t.pageY,a=R?Math.min(t.pageY+t.height,x.value):t.pageY+t.height,r=Math.max(0,S.value-t.height);E.value<e+EDGE_PX?m.value>0?(0,_reactNativeReanimated.scrollTo)(_,0,Math.max(0,m.value-SCROLL_STEP_PX),!1):R&&O.value>0&&(O.value=Math.max(0,O.value-SCROLL_STEP_PX),(0,_reactNativeReanimated.runOnJS)(L)(O.value)):E.value>a-EDGE_PX&&(m.value<r?(0,_reactNativeReanimated.scrollTo)(_,0,Math.min(r,m.value+SCROLL_STEP_PX),!1):R&&O.value<b.value&&(O.value=Math.min(b.value,O.value+SCROLL_STEP_PX),(0,_reactNativeReanimated.runOnJS)(L)(O.value)))}k.value=y.value+m.value-h.value+N.value-w.value;const a=dropIndex(I.value,e,k.value);a!==T.value&&(T.value=a,(0,_reactNativeReanimated.runOnJS)(D)(a))},!1),Y=(0,_react.useCallback)(e=>{(0,_index2.triggerHaptic)("longPress"),G.setActive(!0),V({key:v[e]??"",from:e,to:e,dragging:!0})},[G,v]),H=(0,_react.useCallback)((e,t)=>{G.setActive(!1),V(e=>e?{...e,to:t,dragging:!1}:e),t!==e&&n(moveItem(v,e,t))},[G,v,n]),q=(0,_react.useCallback)(()=>{V(e=>e&&!e.dragging?null:e)},[]),F=(0,_react.useCallback)((e,t)=>{n(moveItem(v,e,t))},[v,n]),U=(0,_react.useCallback)((e,t)=>{A.current.set(e,t),C()},[C]),B=(0,_reactNativeReanimated.useAnimatedScrollHandler)({onScroll:e=>{"worklet";m.value=e.contentOffset.y}}),X=(0,_react.useCallback)((e,t)=>{S.value=t},[S]),J=(0,_react.useMemo)(()=>({scrollRef:_,scrollY:m,scrollStart:h,hostOffset:N,hostStart:w,hostTarget:O,translation:y,absoluteY:E,dragIndex:j,dropTo:T,dragY:k,heights:I}),[_,m,h,N,w,O,y,E,j,T,k,I]),z=(0,_react.useMemo)(()=>({onLift:Y,onDrop:H,onSettled:q,onMove:F,onHeight:U}),[Y,H,q,F,U]),W=!0===M?.dragging,K=W&&M?rowShifts(v.map(e=>A.current.get(e)??0),M.from,M.to):null;return(0,_jsxRuntime.jsx)(_reactNativeReanimated.default.ScrollView,{ref:_,onScroll:B,onContentSizeChange:X,scrollEventThrottle:16,scrollEnabled:!W,accessibilityLabel:o,testID:c,children:d.map((e,t)=>{const a=M?.key===e.key;return(0,_jsxRuntime.jsx)(SortableRow,{rowKey:e.key,index:t,count:d.length,shift:K?.[t]??0,isActive:a,dragging:W,handle:l,disabled:i,shared:J,callbacks:z,labels:u,children:r({item:e.item,index:t,isActive:a})},e.key)})})}SortableList.displayName="SortableList";var _default=exports.default=SortableList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import React,{useCallback,useMemo,useRef,useState}from"react";import{Dimensions,Image,Pressable,StyleSheet,View}from"react-native";import{Gesture,GestureDetector}from"react-native-gesture-handler";import Animated,{runOnJS,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{Carousel}from"../Carousel/index.js";import{Modal}from"../Modal/Modal.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_IMAGE_GALLERY_LABELS={gallery:"Image gallery",imageOf:(e,t)=>`Image ${e} of ${t}`,openFullscreen:"Tap to open fullscreen",closeGallery:"Close gallery"};const MAX_SCALE_FALLBACK=4,MIN_SCALE_FALLBACK=1,DOUBLE_TAP_SCALE_FALLBACK=2,SPRING_CONFIG={damping:18,stiffness:220,mass:1},ImageGallery=({images:e,initialIndex:t=0,showThumbnails:a=!0,showCounter:l=!0,enableLightbox:i=!0,enablePinchZoom:s=!0,onIndexChange:o,haptic:n,loading:r=!1,accessibilityLabel:c,containerStyle:u,testID:m,labels:d})=>{const h=useTheme(),g=useMemo(()=>buildStyles(h),[h]),p=useMemo(()=>({...DEFAULT_IMAGE_GALLERY_LABELS,...d}),[d]),[b,S]=useState(clamp(t,0,Math.max(0,e.length-1))),[v,x]=useState(!1),y=useCallback(e=>{S(e),o?.(e)},[o]),I=useCallback(()=>{if(!i)return;const e=resolveHaptic(n,"selection");e&&triggerHaptic(e),x(!0)},[i,n]),w=useCallback(()=>{const e=resolveHaptic(n,"selection");e&&triggerHaptic(e),x(!1)},[n]),C=useCallback((t,a)=>{const l=t.alt??p.imageOf(a+1,e.length);return _jsx(Pressable,{onPress:I,accessibilityRole:"image",accessibilityLabel:l,accessibilityHint:i?p.openFullscreen:void 0,style:g.imageWrap,children:_jsx(Image,{source:t.source,style:g.image,resizeMode:"cover"})})},[i,e.length,I,g,p]),_=useCallback(e=>_jsx(Image,{source:e.source,style:g.thumbnailImage,resizeMode:"cover"}),[g]),f=_jsxs(View,{style:[g.container,u],testID:m,accessibilityLabel:c??p.gallery,children:[_jsxs(View,{style:g.carouselWrap,accessibilityElementsHidden:v,importantForAccessibility:v?"no-hide-descendants":"auto",children:[_jsx(Carousel,{data:e,defaultIndex:t,onIndexChange:y,renderItem:C,showPagination:!1,showThumbnails:a,renderThumbnail:_,haptic:n}),l&&e.length>0?_jsx(View,{style:g.counterPill,pointerEvents:"none",children:_jsx(Text,{variant:"label",weight:"semibold",style:{color:h.colors["on-scrim"]},accessibilityLabel:p.imageOf(b+1,e.length),children:`${b+1} / ${e.length}`})}):null]}),i?_jsx(Lightbox,{visible:v,images:e,initialIndex:b,enablePinchZoom:s,showCounter:l,onClose:w,onIndexChange:y,haptic:n,labels:p}):null]});return r?_jsx(ImageGallerySkeleton,{images:e,showThumbnails:a,showCounter:l,containerStyle:u,testID:m}):f};ImageGallery.displayName="ImageGallery";const ImageGallerySkeleton=({images:e,showThumbnails:t=!0,showCounter:a=!0,containerStyle:l,testID:i})=>{const s=useTheme(),o=Math.min(e?.length||4,6);return _jsxs(View,{style:[{width:"100%"},l],testID:i,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[_jsxs(View,{style:{position:"relative"},children:[_jsx(Skeleton,{width:"100%",height:280,radius:"lg"}),a?_jsx(View,{style:{position:"absolute",top:12,right:12},children:_jsx(Skeleton,{width:44,height:22,radius:"pill"})}):null]}),t?_jsx(View,{style:{flexDirection:"row",marginTop:s.space.md},children:Array.from({length:o}).map((e,t)=>_jsx(Skeleton,{width:64,height:64,radius:"md",style:{marginRight:s.space.sm}},`sk-thumb-${t}`))}):null]})};ImageGallerySkeleton.displayName="ImageGallerySkeleton",ImageGallery.Skeleton=ImageGallerySkeleton;const Lightbox=({visible:e,images:t,initialIndex:a,enablePinchZoom:l,showCounter:i,onClose:s,onIndexChange:o,haptic:n,labels:r})=>{const c=useTheme(),u=useMemo(()=>buildLightboxStyles(c),[c]),m=useRef(null),[d,h]=useState(a),g=useCallback(e=>{if(e!==d){const t=resolveHaptic(n,"selection");t&&triggerHaptic(t),h(e),o(e)}},[d,o,n]),p=useCallback((e,a)=>_jsx(ZoomableImage,{image:e,index:a,total:t.length,active:a===d,enabled:l,maxScale:4,minScale:1,doubleTapScale:2,haptic:n,imageLabel:r.imageOf}),[d,l,t.length,n,r]),b=t[d]?.caption;return _jsx(Modal,{visible:e,onClose:s,presentation:"fullScreen",backdropPressClose:!1,animateMount:!1,contentStyle:{backgroundColor:"transparent"},children:_jsxs(View,{style:u.backdrop,children:[_jsx(Carousel,{ref:m,data:t,defaultIndex:a,onIndexChange:g,renderItem:p,showPagination:!1,haptic:n}),i&&t.length>0?_jsx(View,{style:u.counterPill,pointerEvents:"none",children:_jsx(Text,{variant:"label",weight:"semibold",style:{color:c.colors["on-scrim"]},accessibilityLabel:r.imageOf(d+1,t.length),children:`${d+1} / ${t.length}`})}):null,_jsx(Pressable,{onPress:s,accessibilityRole:"button",accessibilityLabel:r.closeGallery,style:u.closeButton,hitSlop:12,...hitSlopMarker(12),children:(c.settings.icons.close??defaultIcons.close)({size:24,color:c.colors["on-scrim"]})}),b?_jsx(Animated.View,{style:u.captionWrap,entering:void 0,accessibilityElementsHidden:!1,children:_jsx(Text,{variant:"body",align:"center",numberOfLines:3,style:u.captionText,children:b})}):null]})})},ZoomableImage=({image:e,index:t,total:a,active:l,enabled:i,maxScale:s,minScale:o,doubleTapScale:n,haptic:r,imageLabel:c})=>{const u=Dimensions.get("window"),m=useSharedValue(1),d=useSharedValue(1),h=useSharedValue(0),g=useSharedValue(0),p=useSharedValue(0),b=useSharedValue(0),S=useCallback(()=>{m.value=withSpring(1,SPRING_CONFIG),d.value=1,h.value=withSpring(0,SPRING_CONFIG),g.value=withSpring(0,SPRING_CONFIG),p.value=0,b.value=0},[m,d,h,g,p,b]);React.useEffect(()=>{l||(m.value=withTiming(1,{duration:150}),h.value=withTiming(0,{duration:150}),g.value=withTiming(0,{duration:150}),d.value=1,p.value=0,b.value=0)},[l,m,h,g,d,p,b]);const v=useCallback(()=>{!1!==r&&triggerHaptic("impactLight")},[r]),x=useMemo(()=>Gesture.Pinch().enabled(i).onStart(()=>{"worklet";d.value=m.value}).onUpdate(e=>{"worklet";const t=d.value*e.scale;m.value=t<o?o+.3*(t-o):t>s?s+.2*(t-s):t}).onEnd(()=>{"worklet";return m.value<o?(m.value=withSpring(o,SPRING_CONFIG),h.value=withSpring(0,SPRING_CONFIG),g.value=withSpring(0,SPRING_CONFIG),d.value=o,p.value=0,void(b.value=0)):m.value>s?(m.value=withSpring(s,SPRING_CONFIG),void(d.value=s)):void(d.value=m.value)}),[i,m,d,h,g,p,b,o,s]),y=useMemo(()=>Gesture.Pan().minPointers(1).maxPointers(1).onStart(()=>{"worklet";p.value=h.value,b.value=g.value}).onUpdate(e=>{"worklet";m.value<=1||(h.value=p.value+e.translationX,g.value=b.value+e.translationY)}).onEnd(()=>{"worklet";p.value=h.value,b.value=g.value}),[m,h,g,p,b]),I=useMemo(()=>Gesture.Tap().numberOfTaps(2).onEnd(()=>{"worklet";runOnJS(v)(),m.value>1?(m.value=withSpring(1,SPRING_CONFIG),h.value=withSpring(0,SPRING_CONFIG),g.value=withSpring(0,SPRING_CONFIG),d.value=1,p.value=0,b.value=0):(m.value=withSpring(n,SPRING_CONFIG),d.value=n)}),[m,d,h,g,p,b,v,n]),w=useMemo(()=>Gesture.Race(x,y,I),[x,y,I]),C=useAnimatedStyle(()=>({transform:[{translateX:h.value},{translateY:g.value},{scale:m.value}]}));React.useEffect(()=>{l||S()},[l,S]);const _=e.alt??c(t+1,a);return _jsx(GestureDetector,{gesture:w,children:_jsx(Animated.View,{style:[lightboxImageStyles.container,{width:u.width}],children:_jsx(Animated.Image,{source:e.source,resizeMode:"contain",style:[lightboxImageStyles.image,C],accessibilityLabel:_,accessible:!0})})})},clamp=(e,t,a)=>Math.min(Math.max(e,t),a),buildStyles=e=>StyleSheet.create({container:{width:"100%"},carouselWrap:{width:"100%",position:"relative"},imageWrap:{width:"100%",aspectRatio:16/9,backgroundColor:e.colors["bg-subtle"],overflow:"hidden",borderRadius:e.radius.md,...smoothCorners},image:{width:"100%",height:"100%"},thumbnailImage:{width:"100%",height:"100%"},counterPill:{position:"absolute",top:12,alignSelf:"center",paddingHorizontal:e.space.md,paddingVertical:e.space.xs,borderRadius:e.radius.pill,...smoothCorners,backgroundColor:"rgba(0,0,0,0.55)"}}),buildLightboxStyles=e=>StyleSheet.create({backdrop:{flex:1,backgroundColor:"#000",justifyContent:"center"},counterPill:{position:"absolute",top:48,alignSelf:"center",paddingHorizontal:e.space.md,paddingVertical:e.space.xs,borderRadius:e.radius.pill,...smoothCorners,backgroundColor:"rgba(0,0,0,0.6)"},closeButton:{position:"absolute",top:44,right:16,width:40,height:40,borderRadius:e.radius.pill,...smoothCorners,alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.5)"},captionWrap:{position:"absolute",left:0,right:0,bottom:32,paddingHorizontal:e.space.xl},captionText:{color:"
|
|
1
|
+
"use strict";import React,{useCallback,useMemo,useRef,useState}from"react";import{Dimensions,Image,Pressable,StyleSheet,View}from"react-native";import{Gesture,GestureDetector}from"react-native-gesture-handler";import Animated,{runOnJS,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{Carousel}from"../Carousel/index.js";import{Modal}from"../Modal/Modal.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_IMAGE_GALLERY_LABELS={gallery:"Image gallery",imageOf:(e,t)=>`Image ${e} of ${t}`,openFullscreen:"Tap to open fullscreen",closeGallery:"Close gallery"};const MAX_SCALE_FALLBACK=4,MIN_SCALE_FALLBACK=1,DOUBLE_TAP_SCALE_FALLBACK=2,SPRING_CONFIG={damping:18,stiffness:220,mass:1},ImageGallery=({images:e,initialIndex:t=0,showThumbnails:a=!0,showCounter:l=!0,enableLightbox:i=!0,enablePinchZoom:s=!0,onIndexChange:o,haptic:n,loading:r=!1,accessibilityLabel:c,containerStyle:u,testID:m,labels:d})=>{const h=useTheme(),g=useMemo(()=>buildStyles(h),[h]),p=useMemo(()=>({...DEFAULT_IMAGE_GALLERY_LABELS,...d}),[d]),[b,S]=useState(clamp(t,0,Math.max(0,e.length-1))),[v,x]=useState(!1),y=useCallback(e=>{S(e),o?.(e)},[o]),I=useCallback(()=>{if(!i)return;const e=resolveHaptic(n,"selection");e&&triggerHaptic(e),x(!0)},[i,n]),w=useCallback(()=>{const e=resolveHaptic(n,"selection");e&&triggerHaptic(e),x(!1)},[n]),C=useCallback((t,a)=>{const l=t.alt??p.imageOf(a+1,e.length);return _jsx(Pressable,{onPress:I,accessibilityRole:"image",accessibilityLabel:l,accessibilityHint:i?p.openFullscreen:void 0,style:g.imageWrap,children:_jsx(Image,{source:t.source,style:g.image,resizeMode:"cover"})})},[i,e.length,I,g,p]),_=useCallback(e=>_jsx(Image,{source:e.source,style:g.thumbnailImage,resizeMode:"cover"}),[g]),f=_jsxs(View,{style:[g.container,u],testID:m,accessibilityLabel:c??p.gallery,children:[_jsxs(View,{style:g.carouselWrap,accessibilityElementsHidden:v,importantForAccessibility:v?"no-hide-descendants":"auto",children:[_jsx(Carousel,{data:e,defaultIndex:t,onIndexChange:y,renderItem:C,showPagination:!1,showThumbnails:a,renderThumbnail:_,haptic:n}),l&&e.length>0?_jsx(View,{style:g.counterPill,pointerEvents:"none",children:_jsx(Text,{variant:"label",weight:"semibold",style:{color:h.colors["on-scrim"]},accessibilityLabel:p.imageOf(b+1,e.length),children:`${b+1} / ${e.length}`})}):null]}),i?_jsx(Lightbox,{visible:v,images:e,initialIndex:b,enablePinchZoom:s,showCounter:l,onClose:w,onIndexChange:y,haptic:n,labels:p}):null]});return r?_jsx(ImageGallerySkeleton,{images:e,showThumbnails:a,showCounter:l,containerStyle:u,testID:m}):f};ImageGallery.displayName="ImageGallery";const ImageGallerySkeleton=({images:e,showThumbnails:t=!0,showCounter:a=!0,containerStyle:l,testID:i})=>{const s=useTheme(),o=Math.min(e?.length||4,6);return _jsxs(View,{style:[{width:"100%"},l],testID:i,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[_jsxs(View,{style:{position:"relative"},children:[_jsx(Skeleton,{width:"100%",height:280,radius:"lg"}),a?_jsx(View,{style:{position:"absolute",top:12,right:12},children:_jsx(Skeleton,{width:44,height:22,radius:"pill"})}):null]}),t?_jsx(View,{style:{flexDirection:"row",marginTop:s.space.md},children:Array.from({length:o}).map((e,t)=>_jsx(Skeleton,{width:64,height:64,radius:"md",style:{marginRight:s.space.sm}},`sk-thumb-${t}`))}):null]})};ImageGallerySkeleton.displayName="ImageGallerySkeleton",ImageGallery.Skeleton=ImageGallerySkeleton;const Lightbox=({visible:e,images:t,initialIndex:a,enablePinchZoom:l,showCounter:i,onClose:s,onIndexChange:o,haptic:n,labels:r})=>{const c=useTheme(),u=useMemo(()=>buildLightboxStyles(c),[c]),m=useRef(null),[d,h]=useState(a),g=useCallback(e=>{if(e!==d){const t=resolveHaptic(n,"selection");t&&triggerHaptic(t),h(e),o(e)}},[d,o,n]),p=useCallback((e,a)=>_jsx(ZoomableImage,{image:e,index:a,total:t.length,active:a===d,enabled:l,maxScale:4,minScale:1,doubleTapScale:2,haptic:n,imageLabel:r.imageOf}),[d,l,t.length,n,r]),b=t[d]?.caption;return _jsx(Modal,{visible:e,onClose:s,presentation:"fullScreen",backdropPressClose:!1,animateMount:!1,contentStyle:{backgroundColor:"transparent"},children:_jsxs(View,{style:u.backdrop,children:[_jsx(Carousel,{ref:m,data:t,defaultIndex:a,onIndexChange:g,renderItem:p,showPagination:!1,haptic:n}),i&&t.length>0?_jsx(View,{style:u.counterPill,pointerEvents:"none",children:_jsx(Text,{variant:"label",weight:"semibold",style:{color:c.colors["on-scrim"]},accessibilityLabel:r.imageOf(d+1,t.length),children:`${d+1} / ${t.length}`})}):null,_jsx(Pressable,{onPress:s,accessibilityRole:"button",accessibilityLabel:r.closeGallery,style:u.closeButton,hitSlop:12,...hitSlopMarker(12),children:(c.settings.icons.close??defaultIcons.close)({size:24,color:c.colors["on-scrim"]})}),b?_jsx(Animated.View,{style:u.captionWrap,entering:void 0,accessibilityElementsHidden:!1,children:_jsx(Text,{variant:"body",align:"center",numberOfLines:3,style:u.captionText,children:b})}):null]})})},ZoomableImage=({image:e,index:t,total:a,active:l,enabled:i,maxScale:s,minScale:o,doubleTapScale:n,haptic:r,imageLabel:c})=>{const u=Dimensions.get("window"),m=useSharedValue(1),d=useSharedValue(1),h=useSharedValue(0),g=useSharedValue(0),p=useSharedValue(0),b=useSharedValue(0),S=useCallback(()=>{m.value=withSpring(1,SPRING_CONFIG),d.value=1,h.value=withSpring(0,SPRING_CONFIG),g.value=withSpring(0,SPRING_CONFIG),p.value=0,b.value=0},[m,d,h,g,p,b]);React.useEffect(()=>{l||(m.value=withTiming(1,{duration:150}),h.value=withTiming(0,{duration:150}),g.value=withTiming(0,{duration:150}),d.value=1,p.value=0,b.value=0)},[l,m,h,g,d,p,b]);const v=useCallback(()=>{!1!==r&&triggerHaptic("impactLight")},[r]),x=useMemo(()=>Gesture.Pinch().enabled(i).onStart(()=>{"worklet";d.value=m.value}).onUpdate(e=>{"worklet";const t=d.value*e.scale;m.value=t<o?o+.3*(t-o):t>s?s+.2*(t-s):t}).onEnd(()=>{"worklet";return m.value<o?(m.value=withSpring(o,SPRING_CONFIG),h.value=withSpring(0,SPRING_CONFIG),g.value=withSpring(0,SPRING_CONFIG),d.value=o,p.value=0,void(b.value=0)):m.value>s?(m.value=withSpring(s,SPRING_CONFIG),void(d.value=s)):void(d.value=m.value)}),[i,m,d,h,g,p,b,o,s]),y=useMemo(()=>Gesture.Pan().minPointers(1).maxPointers(1).onStart(()=>{"worklet";p.value=h.value,b.value=g.value}).onUpdate(e=>{"worklet";m.value<=1||(h.value=p.value+e.translationX,g.value=b.value+e.translationY)}).onEnd(()=>{"worklet";p.value=h.value,b.value=g.value}),[m,h,g,p,b]),I=useMemo(()=>Gesture.Tap().numberOfTaps(2).onEnd(()=>{"worklet";runOnJS(v)(),m.value>1?(m.value=withSpring(1,SPRING_CONFIG),h.value=withSpring(0,SPRING_CONFIG),g.value=withSpring(0,SPRING_CONFIG),d.value=1,p.value=0,b.value=0):(m.value=withSpring(n,SPRING_CONFIG),d.value=n)}),[m,d,h,g,p,b,v,n]),w=useMemo(()=>Gesture.Race(x,y,I),[x,y,I]),C=useAnimatedStyle(()=>({transform:[{translateX:h.value},{translateY:g.value},{scale:m.value}]}));React.useEffect(()=>{l||S()},[l,S]);const _=e.alt??c(t+1,a);return _jsx(GestureDetector,{gesture:w,children:_jsx(Animated.View,{style:[lightboxImageStyles.container,{width:u.width}],children:_jsx(Animated.Image,{source:e.source,resizeMode:"contain",style:[lightboxImageStyles.image,C],accessibilityLabel:_,accessible:!0})})})},clamp=(e,t,a)=>Math.min(Math.max(e,t),a),buildStyles=e=>StyleSheet.create({container:{width:"100%"},carouselWrap:{width:"100%",position:"relative"},imageWrap:{width:"100%",aspectRatio:16/9,backgroundColor:e.colors["bg-subtle"],overflow:"hidden",borderRadius:e.radius.md,...smoothCorners},image:{width:"100%",height:"100%"},thumbnailImage:{width:"100%",height:"100%"},counterPill:{position:"absolute",top:12,alignSelf:"center",paddingHorizontal:e.space.md,paddingVertical:e.space.xs,borderRadius:e.radius.pill,...smoothCorners,backgroundColor:"rgba(0,0,0,0.55)"}}),buildLightboxStyles=e=>StyleSheet.create({backdrop:{flex:1,backgroundColor:"#000",justifyContent:"center"},counterPill:{position:"absolute",top:48,alignSelf:"center",paddingHorizontal:e.space.md,paddingVertical:e.space.xs,borderRadius:e.radius.pill,...smoothCorners,backgroundColor:"rgba(0,0,0,0.6)"},closeButton:{position:"absolute",top:44,right:16,width:40,height:40,borderRadius:e.radius.pill,...smoothCorners,alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.5)"},captionWrap:{position:"absolute",left:0,right:0,bottom:32,paddingHorizontal:e.space.xl},captionText:{color:e.colors["on-scrim"],lineHeight:21}}),lightboxImageStyles=StyleSheet.create({container:{flex:1,alignItems:"center",justifyContent:"center"},image:{width:"100%",height:"100%"}});export{ImageGallery};export default ImageGallery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{cloneElement,createElement,isValidElement,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,BackHandler,FlatList,StyleSheet,View}from"react-native";import{KeyboardStickyView}from"react-native-keyboard-controller";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useRefreshControl}from"../../hooks/useRefreshControl.js";import{useTheme}from"../../theme/index.js";import{AppBar}from"../AppBar/index.js";import{AsyncBlock}from"../AsyncBlock/index.js";import{EmptyState}from"../EmptyState/index.js";import{KeyboardAwareScrollView}from"../KeyboardAwareScrollView/index.js";import{KeyboardToolbar}from"../KeyboardToolbar/index.js";import{PagedListFooter}from"../PagedListFooter/index.js";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";const DEFAULT_EDGES=["top","bottom"],SCROLL_EVENT_THROTTLE=16,noop=()=>{};function renderFooter(e){return isValidElement(e)?e:e?createElement(e):null}const buildStyles=e=>StyleSheet.create({flex:{flex:1},root:{flex:1,backgroundColor:e.colors.bg},overlay:{position:"absolute",top:0,left:0,right:0},footer:{backgroundColor:e.colors.bg,borderTopWidth:StyleSheet.hairlineWidth,borderTopColor:e.colors.border}});export function Screen(e){const{title:t,subtitle:o,largeTitle:r=!0,onBack:n,rightActions:l,leading:s,children:
|
|
1
|
+
"use strict";import{cloneElement,createElement,isValidElement,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,BackHandler,FlatList,StyleSheet,View}from"react-native";import{KeyboardStickyView}from"react-native-keyboard-controller";import{useSharedValue}from"react-native-reanimated";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useRefreshControl}from"../../hooks/useRefreshControl.js";import{useTheme}from"../../theme/index.js";import{AppBar}from"../AppBar/index.js";import{AsyncBlock}from"../AsyncBlock/index.js";import{EmptyState}from"../EmptyState/index.js";import{KeyboardAwareScrollView}from"../KeyboardAwareScrollView/index.js";import{KeyboardToolbar}from"../KeyboardToolbar/index.js";import{PagedListFooter}from"../PagedListFooter/index.js";import{ScrollHostContext}from"./ScrollHost.js";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";const DEFAULT_EDGES=["top","bottom"],SCROLL_EVENT_THROTTLE=16,noop=()=>{};function renderFooter(e){return isValidElement(e)?e:e?createElement(e):null}const buildStyles=e=>StyleSheet.create({flex:{flex:1},root:{flex:1,backgroundColor:e.colors.bg},overlay:{position:"absolute",top:0,left:0,right:0},footer:{backgroundColor:e.colors.bg,borderTopWidth:StyleSheet.hairlineWidth,borderTopColor:e.colors.border}});export function Screen(e){const{title:t,subtitle:o,largeTitle:r=!0,onBack:n,rightActions:l,leading:s,children:a,onRefresh:i,refreshing:d=!1,footer:c,scroll:u=!0,list:f,edges:m=DEFAULT_EDGES,keyboardToolbar:p=!0,bottomInset:h=0,scrollRef:g,onScroll:y,contentContainerStyle:S,testID:v}=e,x=useTheme(),b=useSafeAreaInsets(),E=useMemo(()=>buildStyles(x),[x]),[j]=useState(()=>new Animated.Value(0)),[C,T]=useState(0),k=void 0!==n,R=useRef(n);R.current=n;const _=Boolean(t||o||n||s||l?.length),L=r&&void 0!==t,V=L&&(void 0!==f||u),A=V?C:0,w=void 0!==c,{refreshControl:B}=useRefreshControl({onRefresh:i??noop,refreshing:d}),F=i?cloneElement(B,{progressViewOffset:A}):void 0,M=useSharedValue(0),K=useSharedValue(0),D=useSharedValue(0),H=useSharedValue(0),I=useRef(null),O=useRef(0),P=useRef(0),N=useMemo(()=>({top:M,bottom:K,offset:D,maxOffset:H,scrollTo:e=>I.current?.scrollTo({y:e,animated:!1})}),[M,K,D,H]),W=useCallback(e=>{I.current=e,"function"==typeof g?g(e):g&&(g.current=e)},[g]),G=useCallback(()=>{H.value=Math.max(0,O.current-P.current)},[H]),U=useRef(y);U.current=y;const z=useMemo(()=>Animated.event([{nativeEvent:{contentOffset:{y:j}}}],{useNativeDriver:!1,listener:e=>{D.value=e.nativeEvent.contentOffset.y,U.current?.(e)}}),[j,D]),Y=useCallback(e=>{const{height:t}=e.nativeEvent.layout;T(e=>Math.max(e,t))},[]);useEffect(()=>{if(!k)return;const e=BackHandler.addEventListener("hardwareBackPress",()=>(R.current?.(),!0));return()=>e.remove()},[k]);const q=m.includes("left")?b.left:0,J=m.includes("right")?b.right:0,Q=m.includes("bottom")?b.bottom:0,X=m.includes("top")&&!_?b.top:0,Z=m.filter(e=>"top"!==e&&!("bottom"===e&&w)),$=_?_jsx(View,{style:V?E.overlay:void 0,onLayout:V?Y:void 0,children:_jsx(AppBar,{title:t,subtitle:o,variant:L?"large":"default",scrollY:V?j:void 0,onBack:n,rightActions:l,leading:s})}):null,ee=V||y?z:void 0,te=useCallback(()=>{I.current?.getNativeScrollRef()?.measureInWindow((e,t,o,r)=>{P.current=r,M.value=t+A,K.value=t+r,G()})},[A,M,K,G]);useEffect(()=>{te()},[te]);const oe=useCallback((e,t)=>{O.current=t,G()},[G]);let re;if(void 0!==f){const{state:e,paging:t,...o}=f,handleEndReached=e=>{t?.hasMore&&!t.loadingMore&&null==t.errorMore&&t.loadMore(),o.onEndReached?.(e)},r=_jsx(FlatList,{keyboardShouldPersistTaps:"handled",onEndReachedThreshold:t?.5:void 0,...o,ref:g,refreshControl:F,onScroll:ee,onEndReached:t?handleEndReached:o.onEndReached,ListEmptyComponent:e?.empty?_jsx(EmptyState,{...e.empty}):void 0,ListFooterComponent:t||o.ListFooterComponent?_jsxs(_Fragment,{children:[renderFooter(o.ListFooterComponent),t?_jsx(PagedListFooter,{paging:t}):null]}):void 0,scrollEventThrottle:16,style:E.flex,contentContainerStyle:[{paddingTop:A,paddingLeft:q,paddingRight:J},{paddingBottom:(w?0:Q)+h},o.contentContainerStyle,S]});re=e?_jsx(AsyncBlock,{loading:e.loading,error:e.error,errorTitle:e.errorTitle,onRetry:e.onRetry,skeleton:e.skeleton,style:[E.flex,{paddingTop:A}],children:r}):r}else re=u?_jsx(ScrollHostContext.Provider,{value:N,children:_jsxs(KeyboardAwareScrollView,{ref:W,refreshControl:F,onScroll:z,scrollEventThrottle:16,onLayout:te,onContentSizeChange:oe,safeAreaEdges:Z,style:E.flex,contentContainerStyle:[{paddingTop:A},S],children:[a,h>0?_jsx(View,{style:{height:h}}):null]})}):_jsx(View,{style:[E.flex,{paddingLeft:q,paddingRight:J,paddingBottom:(w?0:Q)+h},S],children:a});const ne=w?_jsx(KeyboardStickyView,{style:[E.footer,{paddingLeft:q,paddingRight:J,paddingBottom:Q+h}],children:c}):null;return _jsxs(View,{testID:v,style:[E.root,{paddingTop:X}],children:[V?null:$,re,ne,void 0!==f?a:null,V?$:null,p?_jsx(KeyboardToolbar,{}):null]})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{createContext,useContext}from"react";export const ScrollHostContext=createContext(null);export function useScrollHost(){return useContext(ScrollHostContext)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{StyleSheet,View}from"react-native";import{Gesture,GestureDetector}from"react-native-gesture-handler";import Animated,{cancelAnimation,measure,runOnJS,scrollTo,useAnimatedRef,useAnimatedScrollHandler,useAnimatedStyle,useFrameCallback,useSharedValue,withSpring}from"react-native-reanimated";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SORTABLE_LIST_LABELS=Object.freeze({moveUp:"Move up",moveDown:"Move down"});const LONG_PRESS_MS=350,EDGE_PX=48,SCROLL_STEP_PX=12,SPRING_CONFIG={damping:22,stiffness:260,mass:1},ACTION_STEP={moveUp:-1,moveDown:1};export function moveItem(e,t,a){const l=e.slice();if(t<0||t>=l.length)return l;const[
|
|
1
|
+
"use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{StyleSheet,View}from"react-native";import{Gesture,GestureDetector}from"react-native-gesture-handler";import Animated,{cancelAnimation,measure,runOnJS,scrollTo,useAnimatedRef,useAnimatedScrollHandler,useAnimatedStyle,useFrameCallback,useSharedValue,withSpring}from"react-native-reanimated";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{useScrollHost}from"../Screen/ScrollHost.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SORTABLE_LIST_LABELS=Object.freeze({moveUp:"Move up",moveDown:"Move down"});const LONG_PRESS_MS=350,EDGE_PX=48,SCROLL_STEP_PX=12,SPRING_CONFIG={damping:22,stiffness:260,mass:1},ACTION_STEP={moveUp:-1,moveDown:1},noop=e=>{};export function moveItem(e,t,a){const l=e.slice();if(t<0||t>=l.length)return l;const[o]=l.splice(t,1);return l.splice(a,0,o),l}export function topOf(e,t){"worklet";let a=0;for(let l=0;l<t;l++)a+=e[l]??0;return a}export function slotTop(e,t,a){"worklet";let l=0,o=0;for(let r=0;r<e.length&&o<a;r++)r!==t&&(l+=e[r]??0,o++);return l}export function dropIndex(e,t,a){"worklet";const l=topOf(e,t)+(e[t]??0)/2+a;let o=0,r=0;for(let a=0;a<e.length;a++){const s=e[a]??0;a!==t&&r+s/2<l&&o++,r+=s}return o}export function rowShifts(e,t,a){const l=[];let o=0;for(const t of e)l.push(o),o+=t;const r=e.map(()=>0),s=moveItem(e.map((e,t)=>t),t,a);let n=0;for(const t of s)r[t]=n-(l[t]??0),n+=e[t]??0;return r}const buildStyles=e=>StyleSheet.create({handleRow:{flexDirection:"row",alignItems:"center"},handle:{paddingHorizontal:e.space.sm,paddingVertical:e.space.md,gap:e.space.xxs},bar:{width:e.space.md,height:e.space.xxs,backgroundColor:e.colors["text-muted"]},body:{flex:1}});function SortableRow({rowKey:e,index:t,count:a,shift:l,isActive:o,dragging:r,handle:s,disabled:n,shared:u,callbacks:i,labels:c,children:d}){const m=useTheme(),v=useMemo(()=>buildStyles(m),[m]),h=useSharedValue(0);useEffect(()=>{h.value=r&&!o?withSpring(l,SPRING_CONFIG):l},[r,o,l,h]),useEffect(()=>()=>{cancelAnimation(h)},[h]);const S=useAnimatedStyle(()=>({transform:[{translateY:o?u.dragY.value:h.value}],zIndex:o?1:0})),f=useMemo(()=>{const{dragIndex:e,dropTo:a,dragY:l,translation:o,absoluteY:r,scrollY:c,scrollStart:d,hostOffset:m,hostStart:v,hostTarget:h,heights:S}=u,{onLift:f,onDrop:g,onSettled:p}=i,b=Gesture.Pan().enabled(!n).onStart(()=>{"worklet";e.value=t,a.value=t,d.value=c.value,v.value=m.value,h.value=m.value,o.value=0,l.value=0,runOnJS(f)(t)}).onUpdate(a=>{"worklet";e.value===t&&(o.value=a.translationY,r.value=a.absoluteY)}).onFinalize(()=>{"worklet";if(e.value!==t)return;const o=a.value,r=S.value;e.value=-1,l.value=topOf(r,t)+l.value-slotTop(r,t,o),l.value=withSpring(0,SPRING_CONFIG,e=>{"worklet";e&&runOnJS(p)()}),runOnJS(g)(t,o)});return s?b:b.activateAfterLongPress(350)},[n,s,t,i,u]),g=n?[]:[...t>0?[{name:"moveUp",label:c.moveUp}]:[],...t<a-1?[{name:"moveDown",label:c.moveDown}]:[]];return _jsx(Animated.View,{style:S,onLayout:t=>i.onHeight(e,t.nativeEvent.layout.height),accessibilityActions:g,onAccessibilityAction:e=>{if(n)return;const l=t+(ACTION_STEP[e.nativeEvent.actionName]??0);l!==t&&l>=0&&l<a&&i.onMove(t,l)},testID:`sortable-row-${e}`,children:s?_jsxs(View,{style:v.handleRow,children:[_jsx(GestureDetector,{gesture:f,children:_jsxs(View,{style:v.handle,children:[_jsx(View,{style:v.bar}),_jsx(View,{style:v.bar}),_jsx(View,{style:v.bar})]})}),_jsx(View,{style:v.body,children:d})]}):_jsx(GestureDetector,{gesture:f,children:_jsx(View,{children:d})})})}export function SortableList(e){const{data:t,keyExtractor:a,renderItem:l,onReorder:o,handle:r=!1,disabled:s=!1,accessibilityLabel:n,labels:u,testID:i}=e,c=useMemo(()=>({...DEFAULT_SORTABLE_LIST_LABELS,...u}),[u]),d=useMemo(()=>t.map((e,t)=>({key:a(e,t),item:e})),[t,a]),m=useMemo(()=>d.map(e=>e.key),[d]),v=useAnimatedRef(),h=useSharedValue(0),S=useSharedValue(0),f=useSharedValue(0),g=useScrollHost(),p=useSharedValue(0),b=null!==g,x=g?.top??p,w=g?.bottom??p,y=g?.offset??p,k=g?.maxOffset??p,_=g?.scrollTo??noop,A=useSharedValue(0),V=useSharedValue(0),I=useSharedValue(0),O=useSharedValue(0),T=useSharedValue(-1),L=useSharedValue(-1),E=useSharedValue(0),j=useSharedValue([]),M=useRef(new Map),C=useRef(m),[R,D]=useState(null),Y=useCallback(()=>{j.value=C.current.map(e=>M.current.get(e)??0)},[j]);useEffect(()=>{C.current=m,Y()},[m,Y]),useEffect(()=>()=>{cancelAnimation(E)},[E]);const G=useCallback(e=>{D(t=>t?.dragging?{...t,to:e}:t)},[]),P=useFrameCallback(()=>{"worklet";const e=T.value;if(e<0)return;const t=measure(v);if(t){const e=b?Math.max(t.pageY,x.value):t.pageY,a=b?Math.min(t.pageY+t.height,w.value):t.pageY+t.height,l=Math.max(0,f.value-t.height);O.value<e+48?h.value>0?scrollTo(v,0,Math.max(0,h.value-12),!1):b&&V.value>0&&(V.value=Math.max(0,V.value-12),runOnJS(_)(V.value)):O.value>a-48&&(h.value<l?scrollTo(v,0,Math.min(l,h.value+12),!1):b&&V.value<k.value&&(V.value=Math.min(k.value,V.value+12),runOnJS(_)(V.value)))}E.value=I.value+h.value-S.value+y.value-A.value;const a=dropIndex(j.value,e,E.value);a!==L.value&&(L.value=a,runOnJS(G)(a))},!1),N=useCallback(e=>{triggerHaptic("longPress"),P.setActive(!0),D({key:m[e]??"",from:e,to:e,dragging:!0})},[P,m]),H=useCallback((e,t)=>{P.setActive(!1),D(e=>e?{...e,to:t,dragging:!1}:e),t!==e&&o(moveItem(m,e,t))},[P,m,o]),F=useCallback(()=>{D(e=>e&&!e.dragging?null:e)},[]),J=useCallback((e,t)=>{o(moveItem(m,e,t))},[m,o]),U=useCallback((e,t)=>{M.current.set(e,t),Y()},[Y]),z=useAnimatedScrollHandler({onScroll:e=>{"worklet";h.value=e.contentOffset.y}}),B=useCallback((e,t)=>{f.value=t},[f]),K=useMemo(()=>({scrollRef:v,scrollY:h,scrollStart:S,hostOffset:y,hostStart:A,hostTarget:V,translation:I,absoluteY:O,dragIndex:T,dropTo:L,dragY:E,heights:j}),[v,h,S,y,A,V,I,O,T,L,E,j]),X=useMemo(()=>({onLift:N,onDrop:H,onSettled:F,onMove:J,onHeight:U}),[N,H,F,J,U]),$=!0===R?.dragging,q=$&&R?rowShifts(m.map(e=>M.current.get(e)??0),R.from,R.to):null;return _jsx(Animated.ScrollView,{ref:v,onScroll:z,onContentSizeChange:B,scrollEventThrottle:16,scrollEnabled:!$,accessibilityLabel:n,testID:i,children:d.map((e,t)=>{const a=R?.key===e.key;return _jsx(SortableRow,{rowKey:e.key,index:t,count:d.length,shift:q?.[t]??0,isActive:a,dragging:$,handle:r,disabled:s,shared:K,callbacks:X,labels:c,children:l({item:e.item,index:t,isActive:a})},e.key)})})}SortableList.displayName="SortableList";export default SortableList;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SharedValue } from "react-native-reanimated";
|
|
2
|
+
/**
|
|
3
|
+
* The page scroll view a component sits inside, so a gesture inside it (a SortableList drag) can
|
|
4
|
+
* scroll the page when the finger nears the visible edge. `top` and `bottom` are the visible part
|
|
5
|
+
* in window coordinates, below the app bar.
|
|
6
|
+
*/
|
|
7
|
+
export interface ScrollHost {
|
|
8
|
+
top: SharedValue<number>;
|
|
9
|
+
bottom: SharedValue<number>;
|
|
10
|
+
offset: SharedValue<number>;
|
|
11
|
+
maxOffset: SharedValue<number>;
|
|
12
|
+
scrollTo: (y: number) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const ScrollHostContext: import("react").Context<ScrollHost | null>;
|
|
15
|
+
export declare function useScrollHost(): ScrollHost | null;
|
|
16
|
+
//# sourceMappingURL=ScrollHost.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SharedValue } from "react-native-reanimated";
|
|
2
|
+
/**
|
|
3
|
+
* The page scroll view a component sits inside, so a gesture inside it (a SortableList drag) can
|
|
4
|
+
* scroll the page when the finger nears the visible edge. `top` and `bottom` are the visible part
|
|
5
|
+
* in window coordinates, below the app bar.
|
|
6
|
+
*/
|
|
7
|
+
export interface ScrollHost {
|
|
8
|
+
top: SharedValue<number>;
|
|
9
|
+
bottom: SharedValue<number>;
|
|
10
|
+
offset: SharedValue<number>;
|
|
11
|
+
maxOffset: SharedValue<number>;
|
|
12
|
+
scrollTo: (y: number) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const ScrollHostContext: import("react").Context<ScrollHost | null>;
|
|
15
|
+
export declare function useScrollHost(): ScrollHost | null;
|
|
16
|
+
//# sourceMappingURL=ScrollHost.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/mobile-ui",
|
|
3
|
-
"version": "0.109.
|
|
3
|
+
"version": "0.109.4",
|
|
4
4
|
"description": "Beautiful, animated, accessible React Native components, theme and form engine for Webority projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
"react-native-safe-area-context": ">=5.4.0",
|
|
101
101
|
"react-native-svg": ">=15.0.0",
|
|
102
102
|
"react-native-worklets": ">=0.10.0",
|
|
103
|
-
"@webority/canvas-kit": "0.109.
|
|
104
|
-
"@webority/mobile-core": "0.109.
|
|
103
|
+
"@webority/canvas-kit": "0.109.4",
|
|
104
|
+
"@webority/mobile-core": "0.109.4"
|
|
105
105
|
},
|
|
106
106
|
"peerDependenciesMeta": {
|
|
107
107
|
"@react-navigation/bottom-tabs": {
|
|
@@ -170,10 +170,10 @@
|
|
|
170
170
|
"react-test-renderer": "19.2.8",
|
|
171
171
|
"rimraf": "6.1.3",
|
|
172
172
|
"typescript": "5.9.3",
|
|
173
|
-
"@webority/canvas-kit": "0.109.
|
|
174
|
-
"@webority/mobile-core": "0.109.
|
|
175
|
-
"@webority/
|
|
176
|
-
"@webority/
|
|
173
|
+
"@webority/canvas-kit": "0.109.4",
|
|
174
|
+
"@webority/mobile-core": "0.109.4",
|
|
175
|
+
"@webority/tokens": "0.109.4",
|
|
176
|
+
"@webority/mobile-dev": "0.0.0"
|
|
177
177
|
},
|
|
178
178
|
"scripts": {
|
|
179
179
|
"build": "bob build && node ../mobile-dev/scripts/minify-lib.mjs && node -e \"require('node:fs').rmSync('dist/canvas-kit',{recursive:true,force:true})\" && node ../canvas-kit/dist/cli.js build --config canvas-kit.json --out dist/canvas-kit",
|