@webority/mobile-ui 0.177.0 → 0.178.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.
@@ -2,7 +2,7 @@
2
2
  "kind": "WeborityPhone",
3
3
  "library": {
4
4
  "name": "@webority/mobile-ui",
5
- "version": "0.177.0"
5
+ "version": "0.178.1"
6
6
  },
7
7
  "rendererProtocolVersion": 14,
8
8
  "platform": "Phone",
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "webority-phone",
3
- "version": "0.177.0",
3
+ "version": "0.178.1",
4
4
  "platform": "Phone",
5
5
  "kitModuleVersion": 2,
6
6
  "rendererProtocolVersion": 14,
7
7
  "library": {
8
8
  "name": "@webority/mobile-ui",
9
- "version": "0.177.0"
9
+ "version": "0.178.1"
10
10
  },
11
11
  "files": {
12
12
  "manifest.json": {
13
- "sha256": "de98c4a51db82f7ae09acdee236fe8935df2738d07d3541843418c0471d8953e",
13
+ "sha256": "833b20900f097cc6828985c5c94fbd1abad6432780f21483fe9c335d560b2cd3",
14
14
  "bytes": 673973
15
15
  },
16
16
  "kit.js": {
17
- "sha256": "35be67fbed09ecacd2935885afd1eff6ccd16e1aa5a39cdee0f1881e87875165",
18
- "bytes": 5706083
17
+ "sha256": "b0a5b1fde500f031a5bad9be26662c928f86dab3292f7138c27204e138b94bf7",
18
+ "bytes": 5706179
19
19
  },
20
20
  "kit.css": {
21
21
  "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KeyboardAwareScrollView=KeyboardAwareScrollView,exports.default=void 0;var _reactNative=require("react-native"),_reactNativeKeyboardController=require("react-native-keyboard-controller"),_reactNativeSafeAreaContext=require("react-native-safe-area-context"),_index=require("../../theme/index.js"),_jsxRuntime=require("react/jsx-runtime");const tapAreaStyle={flexGrow:1},CHILD_LAYOUT_KEYS=["gap","rowGap","columnGap","flexDirection","flexWrap","alignItems","alignContent","justifyContent"],childLayout=e=>{const r=_reactNative.StyleSheet.flatten(e),t={};for(const e of CHILD_LAYOUT_KEYS)void 0!==r?.[e]&&Object.assign(t,{[e]:r[e]});return t};function KeyboardAwareScrollView({ref:e,...r}){const{children:t,bottomOffset:o=24,extraKeyboardSpace:a=0,safeAreaEdges:i=["bottom"],refreshing:n=!1,onRefresh:s,dismissOnTapOutside:l=!0,contentContainerStyle:d,refreshControl:c,...u}=r,f=(0,_index.useTheme)(),y=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),b=i.includes("bottom"),p={paddingBottom:b?y.bottom:0,...i.includes("top")?{paddingTop:y.top}:null,...i.includes("left")?{paddingLeft:y.left}:null,...i.includes("right")?{paddingRight:y.right}:null},x=c??(s?(0,_jsxRuntime.jsx)(_reactNative.RefreshControl,{refreshing:n,onRefresh:s,tintColor:f.colors.primary,colors:[f.colors.primary],progressBackgroundColor:f.colors.surface,titleColor:f.colors["text-muted"]}):void 0);return(0,_jsxRuntime.jsx)(_reactNativeKeyboardController.KeyboardAwareScrollView,{ref:e,bottomOffset:o,extraKeyboardSpace:a-(b?y.bottom:0),disableScrollOnKeyboardHide:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"none",contentContainerStyle:[d,p],refreshControl:x,...u,children:l?(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessible:!1,onPress:_reactNative.Keyboard.dismiss,style:[tapAreaStyle,childLayout(d)],children:t}):t})}var _default=exports.default=KeyboardAwareScrollView;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KeyboardAwareScrollView=KeyboardAwareScrollView,exports.default=void 0;var _reactNative=require("react-native"),_reactNativeKeyboardController=require("react-native-keyboard-controller"),_reactNativeSafeAreaContext=require("react-native-safe-area-context"),_index=require("../../theme/index.js"),_contentPadding=require("../../utils/contentPadding.js"),_jsxRuntime=require("react/jsx-runtime");const tapAreaStyle={flexGrow:1},CHILD_LAYOUT_KEYS=["gap","rowGap","columnGap","flexDirection","flexWrap","alignItems","alignContent","justifyContent"],childLayout=e=>{const t=_reactNative.StyleSheet.flatten(e),r={};for(const e of CHILD_LAYOUT_KEYS)void 0!==t?.[e]&&Object.assign(r,{[e]:t[e]});return r};function KeyboardAwareScrollView({ref:e,...t}){const{children:r,bottomOffset:o=24,extraKeyboardSpace:a=0,safeAreaEdges:n=["bottom"],refreshing:i=!1,onRefresh:s,dismissOnTapOutside:l=!0,contentContainerStyle:d,refreshControl:c,...u}=t,f=(0,_index.useTheme)(),b=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),y=n.includes("bottom"),p={paddingBottom:(0,_contentPadding.bottomPaddingOf)(d)+(y?b.bottom:0),...n.includes("top")?{paddingTop:b.top}:null,...n.includes("left")?{paddingLeft:b.left}:null,...n.includes("right")?{paddingRight:b.right}:null},x=c??(s?(0,_jsxRuntime.jsx)(_reactNative.RefreshControl,{refreshing:i,onRefresh:s,tintColor:f.colors.primary,colors:[f.colors.primary],progressBackgroundColor:f.colors.surface,titleColor:f.colors["text-muted"]}):void 0);return(0,_jsxRuntime.jsx)(_reactNativeKeyboardController.KeyboardAwareScrollView,{ref:e,bottomOffset:o,extraKeyboardSpace:a-(y?b.bottom:0),disableScrollOnKeyboardHide:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"none",contentContainerStyle:[d,p],refreshControl:x,...u,children:l?(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessible:!1,onPress:_reactNative.Keyboard.dismiss,style:[tapAreaStyle,childLayout(d)],children:r}):r})}var _default=exports.default=KeyboardAwareScrollView;
@@ -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"),_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("../KeyboardAwareScrollView/index.js"),_index4=require("../KeyboardToolbar/index.js"),_index5=require("../PagedList/index.js"),_ScrollHost=require("./ScrollHost.js"),_jsxRuntime=require("react/jsx-runtime");const DEFAULT_EDGES=["top","bottom"],SCROLL_EVENT_THROTTLE=16,noop=()=>{},topPaddingOf=e=>{const t=_reactNative.StyleSheet.flatten(e),r=t?.paddingTop??t?.paddingVertical??t?.padding;return"number"==typeof r?r:0},buildStyles=e=>_reactNative.StyleSheet.create({flex:{flex:1},root:{flex:1,backgroundColor:e.colors.bg},overlay:{position:"absolute",top:0,left:0,right:0},headerRaised:{zIndex:1},footer:{backgroundColor:e.colors.bg,borderTopWidth:_reactNative.StyleSheet.hairlineWidth,borderTopColor:e.colors.border}});function Screen(e){const{title:t,subtitle:r,largeTitle:o=!0,headerShadowOnScroll:a,onBack:n,rightActions:i,leading:l,trailing:s,children:c,onRefresh:d,refreshing:u=!1,footer:f,scroll:_=!0,list:v,edges:p=DEFAULT_EDGES,keyboardToolbar:g=!0,bottomInset:h=0,gutter:x,floatingAction:m,scrollRef:S,onScroll:b,contentContainerStyle:y,testID:R}=e,C=(0,_index.useTheme)(),j=x??void 0===v,T=C.space[C.components.screen.gutter],E=j?T:0,N=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),L=(0,_react.useMemo)(()=>buildStyles(C),[C]),[O]=(0,_react.useState)(()=>new _reactNative.Animated.Value(0)),[V,k]=(0,_react.useState)(0),[w,A]=(0,_react.useState)(0),q=void 0!==n,B=(0,_react.useRef)(n);B.current=n;const H=Boolean(t||r||n||l||s||i?.length),D=o&&void 0!==t,M=D&&(void 0!==v||_),z=M?V:0,I=H&&!M&&(a??C.settings.components.screen?.headerShadowOnScroll??!0),[K,P]=(0,_react.useState)(!1),F=(0,_react.useRef)(I);F.current=I;const headerGap=e=>e>0?e:H?C.space.lg:0,W=void 0!==f,{refreshControl:G}=(0,_useRefreshControl.useRefreshControl)({onRefresh:d??noop,refreshing:u}),U=d?(0,_react.cloneElement)(G,{progressViewOffset:z}):void 0,Y=(0,_reactNativeReanimated.useSharedValue)(0),$=(0,_reactNativeReanimated.useSharedValue)(0),J=(0,_reactNativeReanimated.useSharedValue)(0),Q=(0,_reactNativeReanimated.useSharedValue)(0),X=(0,_react.useRef)(null),Z=(0,_react.useRef)(0),ee=(0,_react.useRef)(0),te=(0,_react.useMemo)(()=>({top:Y,bottom:$,offset:J,maxOffset:Q,scrollTo:e=>{const t=X.current;t instanceof _reactNative.FlatList?t.scrollToOffset({offset:e,animated:!1}):t?.scrollTo({y:e,animated:!1})}}),[Y,$,J,Q]),re=(0,_react.useCallback)(e=>{X.current=e,"function"==typeof S?S(e):S&&(S.current=e)},[S]),oe=(0,_react.useCallback)(()=>{Q.value=Math.max(0,Z.current-ee.current)},[Q]),ae=(0,_react.useRef)(b);ae.current=b;const ne=(0,_react.useMemo)(()=>_reactNative.Animated.event([{nativeEvent:{contentOffset:{y:O}}}],{useNativeDriver:!1,listener:e=>{if(J.value=e.nativeEvent.contentOffset.y,F.current){const t=e.nativeEvent.contentOffset.y>0;P(e=>e===t?e:t)}ae.current?.(e)}}),[O,J]),ie=(0,_react.useCallback)(e=>{const{height:t}=e.nativeEvent.layout;k(e=>Math.max(e,t))},[]),le=(0,_react.useCallback)(e=>{A(e.nativeEvent.layout.height)},[]);(0,_react.useEffect)(()=>{if(!q)return;const e=_reactNative.BackHandler.addEventListener("hardwareBackPress",()=>(B.current?.(),!0));return()=>e.remove()},[q]);const se=p.includes("left")?N.left:0,ce=p.includes("right")?N.right:0,de=p.includes("bottom")?N.bottom:0,ue=p.includes("top")&&!H?N.top:0,fe=C.space[C.components["floating-action-button"]["bottom-offset"]],ve=m?.props.bottomOffset??fe,pe=m?(0,_index.resolveFloatingActionButtonSize)(C,m.props.size??"md").diameter+ve+C.space.lg:0,ge=W?Math.max(0,w-N.bottom):h,he=m?(0,_react.cloneElement)(m,{bottomOffset:ve+ge,position:m.props.position??"bottomRight"}):null,xe=W?pe:Math.max(de,m?pe+N.bottom:0),me=h+xe-(W?0:de),Se=p.filter(e=>"top"!==e&&!("bottom"===e&&W)),be=H?(0,_jsxRuntime.jsx)(_reactNative.View,{style:M?L.overlay:I?L.headerRaised:void 0,onLayout:M?ie:void 0,children:(0,_jsxRuntime.jsx)(_index2.AppBar,{title:t,subtitle:r,variant:D?"large":"default",scrollY:M?O:void 0,elevated:I&&K,onBack:n,rightActions:i,leading:l,trailing:s,gutter:T,testID:R?`${R}-app-bar`:void 0})}):null,ye=(0,_react.useCallback)(()=>{const e=X.current?.getNativeScrollRef();e&&e.measureInWindow((e,t,r,o)=>{ee.current=o,Y.value=t+z,$.value=t+o,oe()})},[z,Y,$,oe]);(0,_react.useEffect)(()=>{ye()},[ye]);const Re=(0,_react.useCallback)((e,t)=>{Z.current=t,oe()},[oe]);let Ce;if(void 0!==v){const e=topPaddingOf([v.contentContainerStyle,y]);Ce=(0,_jsxRuntime.jsx)(_ScrollHost.ScrollHostContext,{value:te,children:(0,_jsxRuntime.jsx)(_index5.PagedList,{...v,ref:re,onRefresh:v.state?void 0:d,refreshing:v.state?void 0:u,progressViewOffset:z,placeholderStyle:[L.flex,{paddingTop:z+headerGap(e)}],onScroll:ne,onLayout:e=>{ye(),v.onLayout?.(e)},onContentSizeChange:(e,t)=>{Re(e,t),v.onContentSizeChange?.(e,t)},scrollEventThrottle:SCROLL_EVENT_THROTTLE,style:L.flex,contentContainerStyle:[{paddingTop:z,paddingLeft:se+E,paddingRight:ce+E},{paddingBottom:h+xe},v.contentContainerStyle,y,{paddingTop:z+headerGap(e)}]})})}else Ce=_?(0,_jsxRuntime.jsx)(_ScrollHost.ScrollHostContext,{value:te,children:(0,_jsxRuntime.jsxs)(_index3.KeyboardAwareScrollView,{ref:re,refreshControl:U,onScroll:ne,scrollEventThrottle:SCROLL_EVENT_THROTTLE,onLayout:ye,onContentSizeChange:Re,safeAreaEdges:Se,style:L.flex,contentContainerStyle:[{paddingHorizontal:E},y,{paddingTop:z+headerGap(topPaddingOf(y))}],children:[c,me>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{height:me}}):null]})}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:[L.flex,{paddingLeft:se+E,paddingRight:ce+E,paddingBottom:h+xe},y],children:c});const je=W?(0,_jsxRuntime.jsx)(_reactNativeKeyboardController.KeyboardStickyView,{onLayout:le,style:[L.footer,{paddingLeft:se+T,paddingRight:ce+T,paddingBottom:de+h}],children:f}):null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{testID:R,style:[L.root,{paddingTop:ue}],children:[M?null:be,Ce,je,he,void 0!==v?c:null,M?be:null,g?(0,_jsxRuntime.jsx)(_index4.KeyboardToolbar,{}):null]})}
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"),_contentPadding=require("../../utils/contentPadding.js"),_index2=require("../AppBar/index.js"),_index3=require("../KeyboardAwareScrollView/index.js"),_index4=require("../KeyboardToolbar/index.js"),_index5=require("../PagedList/index.js"),_ScrollHost=require("./ScrollHost.js"),_jsxRuntime=require("react/jsx-runtime");const DEFAULT_EDGES=["top","bottom"],SCROLL_EVENT_THROTTLE=16,noop=()=>{},buildStyles=e=>_reactNative.StyleSheet.create({flex:{flex:1},root:{flex:1,backgroundColor:e.colors.bg},overlay:{position:"absolute",top:0,left:0,right:0},headerRaised:{zIndex:1},footer:{backgroundColor:e.colors.bg,borderTopWidth:_reactNative.StyleSheet.hairlineWidth,borderTopColor:e.colors.border}});function Screen(e){const{title:t,subtitle:o,largeTitle:r=!0,headerShadowOnScroll:n,onBack:a,rightActions:i,leading:l,trailing:s,children:c,onRefresh:d,refreshing:u=!1,footer:f,scroll:_=!0,list:g,edges:v=DEFAULT_EDGES,keyboardToolbar:h=!0,bottomInset:p=0,gutter:x,floatingAction:m,scrollRef:S,onScroll:b,contentContainerStyle:R,testID:y}=e,C=(0,_index.useTheme)(),j=x??void 0===g,T=C.space[C.components.screen.gutter],E=j?T:0,N=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),L=(0,_react.useMemo)(()=>buildStyles(C),[C]),[O]=(0,_react.useState)(()=>new _reactNative.Animated.Value(0)),[V,k]=(0,_react.useState)(0),[w,A]=(0,_react.useState)(0),q=void 0!==a,P=(0,_react.useRef)(a);P.current=a;const B=Boolean(t||o||a||l||s||i?.length),H=r&&void 0!==t,D=H&&(void 0!==g||_),M=D?V:0,z=B&&!D&&(n??C.settings.components.screen?.headerShadowOnScroll??!0),[I,K]=(0,_react.useState)(!1),F=(0,_react.useRef)(z);F.current=z;const headerGap=e=>e>0?e:B?C.space.lg:0,W=void 0!==f,{refreshControl:G}=(0,_useRefreshControl.useRefreshControl)({onRefresh:d??noop,refreshing:u}),U=d?(0,_react.cloneElement)(G,{progressViewOffset:M}):void 0,Y=(0,_reactNativeReanimated.useSharedValue)(0),$=(0,_reactNativeReanimated.useSharedValue)(0),J=(0,_reactNativeReanimated.useSharedValue)(0),Q=(0,_reactNativeReanimated.useSharedValue)(0),X=(0,_react.useRef)(null),Z=(0,_react.useRef)(0),ee=(0,_react.useRef)(0),te=(0,_react.useMemo)(()=>({top:Y,bottom:$,offset:J,maxOffset:Q,scrollTo:e=>{const t=X.current;t instanceof _reactNative.FlatList?t.scrollToOffset({offset:e,animated:!1}):t?.scrollTo({y:e,animated:!1})}}),[Y,$,J,Q]),oe=(0,_react.useCallback)(e=>{X.current=e,"function"==typeof S?S(e):S&&(S.current=e)},[S]),re=(0,_react.useCallback)(()=>{Q.value=Math.max(0,Z.current-ee.current)},[Q]),ne=(0,_react.useRef)(b);ne.current=b;const ae=(0,_react.useMemo)(()=>_reactNative.Animated.event([{nativeEvent:{contentOffset:{y:O}}}],{useNativeDriver:!1,listener:e=>{if(J.value=e.nativeEvent.contentOffset.y,F.current){const t=e.nativeEvent.contentOffset.y>0;K(e=>e===t?e:t)}ne.current?.(e)}}),[O,J]),ie=(0,_react.useCallback)(e=>{const{height:t}=e.nativeEvent.layout;k(e=>Math.max(e,t))},[]),le=(0,_react.useCallback)(e=>{A(e.nativeEvent.layout.height)},[]);(0,_react.useEffect)(()=>{if(!q)return;const e=_reactNative.BackHandler.addEventListener("hardwareBackPress",()=>(P.current?.(),!0));return()=>e.remove()},[q]);const se=v.includes("left")?N.left:0,ce=v.includes("right")?N.right:0,de=v.includes("bottom")?N.bottom:0,ue=v.includes("top")&&!B?N.top:0,fe=C.space[C.components["floating-action-button"]["bottom-offset"]],ge=m?.props.bottomOffset??fe,ve=m?(0,_index.resolveFloatingActionButtonSize)(C,m.props.size??"md").diameter+ge+C.space.lg:0,he=W?Math.max(0,w-N.bottom):p,pe=m?(0,_react.cloneElement)(m,{bottomOffset:ge+he,position:m.props.position??"bottomRight"}):null,xe=W?ve:Math.max(de,m?ve+N.bottom:0),me=p+xe-(W?0:de),Se=v.filter(e=>"top"!==e&&!("bottom"===e&&W)),be=B?(0,_jsxRuntime.jsx)(_reactNative.View,{style:D?L.overlay:z?L.headerRaised:void 0,onLayout:D?ie:void 0,children:(0,_jsxRuntime.jsx)(_index2.AppBar,{title:t,subtitle:o,variant:H?"large":"default",scrollY:D?O:void 0,elevated:z&&I,onBack:a,rightActions:i,leading:l,trailing:s,gutter:T,testID:y?`${y}-app-bar`:void 0})}):null,Re=(0,_react.useCallback)(()=>{const e=X.current?.getNativeScrollRef();e&&e.measureInWindow((e,t,o,r)=>{ee.current=r,Y.value=t+M,$.value=t+r,re()})},[M,Y,$,re]);(0,_react.useEffect)(()=>{Re()},[Re]);const ye=(0,_react.useCallback)((e,t)=>{Z.current=t,re()},[re]);let Ce;if(void 0!==g){const e=(0,_contentPadding.topPaddingOf)([g.contentContainerStyle,R]);Ce=(0,_jsxRuntime.jsx)(_ScrollHost.ScrollHostContext,{value:te,children:(0,_jsxRuntime.jsx)(_index5.PagedList,{...g,ref:oe,onRefresh:g.state?void 0:d,refreshing:g.state?void 0:u,progressViewOffset:M,placeholderStyle:[L.flex,{paddingTop:M+headerGap(e)}],onScroll:ae,onLayout:e=>{Re(),g.onLayout?.(e)},onContentSizeChange:(e,t)=>{ye(e,t),g.onContentSizeChange?.(e,t)},scrollEventThrottle:SCROLL_EVENT_THROTTLE,style:L.flex,contentContainerStyle:[{paddingTop:M,paddingLeft:se+E,paddingRight:ce+E},g.contentContainerStyle,R,{paddingTop:M+headerGap(e),paddingBottom:(0,_contentPadding.bottomPaddingOf)([g.contentContainerStyle,R])+p+xe}]})})}else Ce=_?(0,_jsxRuntime.jsx)(_ScrollHost.ScrollHostContext,{value:te,children:(0,_jsxRuntime.jsxs)(_index3.KeyboardAwareScrollView,{ref:oe,refreshControl:U,onScroll:ae,scrollEventThrottle:SCROLL_EVENT_THROTTLE,onLayout:Re,onContentSizeChange:ye,safeAreaEdges:Se,style:L.flex,contentContainerStyle:[{paddingHorizontal:E},R,{paddingTop:M+headerGap((0,_contentPadding.topPaddingOf)(R))}],children:[c,me>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{height:me}}):null]})}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:[L.flex,{paddingLeft:se+E,paddingRight:ce+E},R,{paddingBottom:(0,_contentPadding.bottomPaddingOf)(R)+p+xe}],children:c});const je=W?(0,_jsxRuntime.jsx)(_reactNativeKeyboardController.KeyboardStickyView,{onLayout:le,style:[L.footer,{paddingLeft:se+T,paddingRight:ce+T,paddingBottom:de+p}],children:f}):null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{testID:y,style:[L.root,{paddingTop:ue}],children:[D?null:be,Ce,je,pe,void 0!==g?c:null,D?be:null,h?(0,_jsxRuntime.jsx)(_index4.KeyboardToolbar,{}):null]})}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.topPaddingOf=exports.bottomPaddingOf=void 0;var _reactNative=require("react-native");const edgePaddingOf=(t,d)=>{const e=_reactNative.StyleSheet.flatten(t),o=e?.[d]??e?.paddingVertical??e?.padding;return"number"==typeof o?o:0},topPaddingOf=t=>edgePaddingOf(t,"paddingTop");exports.topPaddingOf=topPaddingOf;const bottomPaddingOf=t=>edgePaddingOf(t,"paddingBottom");exports.bottomPaddingOf=bottomPaddingOf;
@@ -1 +1 @@
1
- "use strict";import{Keyboard,Pressable,RefreshControl,StyleSheet}from"react-native";import{KeyboardAwareScrollView as ControllerScrollView}from"react-native-keyboard-controller";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useTheme}from"../../theme/index.js";import{jsx as _jsx}from"react/jsx-runtime";const tapAreaStyle={flexGrow:1},CHILD_LAYOUT_KEYS=["gap","rowGap","columnGap","flexDirection","flexWrap","alignItems","alignContent","justifyContent"],childLayout=e=>{const r=StyleSheet.flatten(e),o={};for(const e of CHILD_LAYOUT_KEYS)void 0!==r?.[e]&&Object.assign(o,{[e]:r[e]});return o};function KeyboardAwareScrollView({ref:e,...r}){const{children:o,bottomOffset:t=24,extraKeyboardSpace:s=0,safeAreaEdges:l=["bottom"],refreshing:a=!1,onRefresh:n,dismissOnTapOutside:i=!0,contentContainerStyle:d,refreshControl:c,...f}=r,m=useTheme(),p=useSafeAreaInsets(),u=l.includes("bottom"),y={paddingBottom:u?p.bottom:0,...l.includes("top")?{paddingTop:p.top}:null,...l.includes("left")?{paddingLeft:p.left}:null,...l.includes("right")?{paddingRight:p.right}:null},b=c??(n?_jsx(RefreshControl,{refreshing:a,onRefresh:n,tintColor:m.colors.primary,colors:[m.colors.primary],progressBackgroundColor:m.colors.surface,titleColor:m.colors["text-muted"]}):void 0);return _jsx(ControllerScrollView,{ref:e,bottomOffset:t,extraKeyboardSpace:s-(u?p.bottom:0),disableScrollOnKeyboardHide:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"none",contentContainerStyle:[d,y],refreshControl:b,...f,children:i?_jsx(Pressable,{accessible:!1,onPress:Keyboard.dismiss,style:[tapAreaStyle,childLayout(d)],children:o}):o})}export{KeyboardAwareScrollView};export default KeyboardAwareScrollView;
1
+ "use strict";import{Keyboard,Pressable,RefreshControl,StyleSheet}from"react-native";import{KeyboardAwareScrollView as ControllerScrollView}from"react-native-keyboard-controller";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useTheme}from"../../theme/index.js";import{bottomPaddingOf}from"../../utils/contentPadding.js";import{jsx as _jsx}from"react/jsx-runtime";const tapAreaStyle={flexGrow:1},CHILD_LAYOUT_KEYS=["gap","rowGap","columnGap","flexDirection","flexWrap","alignItems","alignContent","justifyContent"],childLayout=e=>{const o=StyleSheet.flatten(e),r={};for(const e of CHILD_LAYOUT_KEYS)void 0!==o?.[e]&&Object.assign(r,{[e]:o[e]});return r};function KeyboardAwareScrollView({ref:e,...o}){const{children:r,bottomOffset:t=24,extraKeyboardSpace:s=0,safeAreaEdges:a=["bottom"],refreshing:l=!1,onRefresh:n,dismissOnTapOutside:i=!0,contentContainerStyle:d,refreshControl:c,...f}=o,m=useTheme(),p=useSafeAreaInsets(),u=a.includes("bottom"),b={paddingBottom:bottomPaddingOf(d)+(u?p.bottom:0),...a.includes("top")?{paddingTop:p.top}:null,...a.includes("left")?{paddingLeft:p.left}:null,...a.includes("right")?{paddingRight:p.right}:null},y=c??(n?_jsx(RefreshControl,{refreshing:l,onRefresh:n,tintColor:m.colors.primary,colors:[m.colors.primary],progressBackgroundColor:m.colors.surface,titleColor:m.colors["text-muted"]}):void 0);return _jsx(ControllerScrollView,{ref:e,bottomOffset:t,extraKeyboardSpace:s-(u?p.bottom:0),disableScrollOnKeyboardHide:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"none",contentContainerStyle:[d,b],refreshControl:y,...f,children:i?_jsx(Pressable,{accessible:!1,onPress:Keyboard.dismiss,style:[tapAreaStyle,childLayout(d)],children:r}):r})}export{KeyboardAwareScrollView};export default KeyboardAwareScrollView;
@@ -1 +1 @@
1
- "use strict";import{cloneElement,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{resolveFloatingActionButtonSize,useTheme}from"../../theme/index.js";import{AppBar}from"../AppBar/index.js";import{KeyboardAwareScrollView}from"../KeyboardAwareScrollView/index.js";import{KeyboardToolbar}from"../KeyboardToolbar/index.js";import{PagedList}from"../PagedList/index.js";import{ScrollHostContext}from"./ScrollHost.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const DEFAULT_EDGES=["top","bottom"],SCROLL_EVENT_THROTTLE=16,noop=()=>{},topPaddingOf=e=>{const t=StyleSheet.flatten(e),o=t?.paddingTop??t?.paddingVertical??t?.padding;return"number"==typeof o?o:0},buildStyles=e=>StyleSheet.create({flex:{flex:1},root:{flex:1,backgroundColor:e.colors.bg},overlay:{position:"absolute",top:0,left:0,right:0},headerRaised:{zIndex:1},footer:{backgroundColor:e.colors.bg,borderTopWidth:StyleSheet.hairlineWidth,borderTopColor:e.colors.border}});export function Screen(e){const{title:t,subtitle:o,largeTitle:n=!0,headerShadowOnScroll:r,onBack:a,rightActions:l,leading:s,trailing:i,children:d,onRefresh:c,refreshing:u=!1,footer:f,scroll:p=!0,list:m,edges:g=DEFAULT_EDGES,keyboardToolbar:h=!0,bottomInset:S=0,gutter:b,floatingAction:v,scrollRef:y,onScroll:x,contentContainerStyle:C,testID:T}=e,E=useTheme(),j=b??void 0===m,R=E.space[E.components.screen.gutter],w=j?R:0,V=useSafeAreaInsets(),k=useMemo(()=>buildStyles(E),[E]),[A]=useState(()=>new Animated.Value(0)),[L,_]=useState(0),[O,B]=useState(0),z=void 0!==a,D=useRef(a);D.current=a;const H=Boolean(t||o||a||s||i||l?.length),I=n&&void 0!==t,K=I&&(void 0!==m||p),M=K?L:0,P=H&&!K&&(r??E.settings.components.screen?.headerShadowOnScroll??!0),[F,N]=useState(!1),W=useRef(P);W.current=P;const headerGap=e=>e>0?e:H?E.space.lg:0,G=void 0!==f,{refreshControl:U}=useRefreshControl({onRefresh:c??noop,refreshing:u}),Y=c?cloneElement(U,{progressViewOffset:M}):void 0,$=useSharedValue(0),q=useSharedValue(0),J=useSharedValue(0),Q=useSharedValue(0),X=useRef(null),Z=useRef(0),ee=useRef(0),te=useMemo(()=>({top:$,bottom:q,offset:J,maxOffset:Q,scrollTo:e=>{const t=X.current;t instanceof FlatList?t.scrollToOffset({offset:e,animated:!1}):t?.scrollTo({y:e,animated:!1})}}),[$,q,J,Q]),oe=useCallback(e=>{X.current=e,"function"==typeof y?y(e):y&&(y.current=e)},[y]),ne=useCallback(()=>{Q.value=Math.max(0,Z.current-ee.current)},[Q]),re=useRef(x);re.current=x;const ae=useMemo(()=>Animated.event([{nativeEvent:{contentOffset:{y:A}}}],{useNativeDriver:!1,listener:e=>{if(J.value=e.nativeEvent.contentOffset.y,W.current){const t=e.nativeEvent.contentOffset.y>0;N(e=>e===t?e:t)}re.current?.(e)}}),[A,J]),le=useCallback(e=>{const{height:t}=e.nativeEvent.layout;_(e=>Math.max(e,t))},[]),se=useCallback(e=>{B(e.nativeEvent.layout.height)},[]);useEffect(()=>{if(!z)return;const e=BackHandler.addEventListener("hardwareBackPress",()=>(D.current?.(),!0));return()=>e.remove()},[z]);const ie=g.includes("left")?V.left:0,de=g.includes("right")?V.right:0,ce=g.includes("bottom")?V.bottom:0,ue=g.includes("top")&&!H?V.top:0,fe=E.space[E.components["floating-action-button"]["bottom-offset"]],pe=v?.props.bottomOffset??fe,me=v?resolveFloatingActionButtonSize(E,v.props.size??"md").diameter+pe+E.space.lg:0,ge=G?Math.max(0,O-V.bottom):S,he=v?cloneElement(v,{bottomOffset:pe+ge,position:v.props.position??"bottomRight"}):null,Se=G?me:Math.max(ce,v?me+V.bottom:0),be=S+Se-(G?0:ce),ve=g.filter(e=>"top"!==e&&!("bottom"===e&&G)),ye=H?_jsx(View,{style:K?k.overlay:P?k.headerRaised:void 0,onLayout:K?le:void 0,children:_jsx(AppBar,{title:t,subtitle:o,variant:I?"large":"default",scrollY:K?A:void 0,elevated:P&&F,onBack:a,rightActions:l,leading:s,trailing:i,gutter:R,testID:T?`${T}-app-bar`:void 0})}):null,xe=useCallback(()=>{const e=X.current?.getNativeScrollRef();e&&e.measureInWindow((e,t,o,n)=>{ee.current=n,$.value=t+M,q.value=t+n,ne()})},[M,$,q,ne]);useEffect(()=>{xe()},[xe]);const Ce=useCallback((e,t)=>{Z.current=t,ne()},[ne]);let Te;if(void 0!==m){const e=topPaddingOf([m.contentContainerStyle,C]);Te=_jsx(ScrollHostContext,{value:te,children:_jsx(PagedList,{...m,ref:oe,onRefresh:m.state?void 0:c,refreshing:m.state?void 0:u,progressViewOffset:M,placeholderStyle:[k.flex,{paddingTop:M+headerGap(e)}],onScroll:ae,onLayout:e=>{xe(),m.onLayout?.(e)},onContentSizeChange:(e,t)=>{Ce(e,t),m.onContentSizeChange?.(e,t)},scrollEventThrottle:16,style:k.flex,contentContainerStyle:[{paddingTop:M,paddingLeft:ie+w,paddingRight:de+w},{paddingBottom:S+Se},m.contentContainerStyle,C,{paddingTop:M+headerGap(e)}]})})}else Te=p?_jsx(ScrollHostContext,{value:te,children:_jsxs(KeyboardAwareScrollView,{ref:oe,refreshControl:Y,onScroll:ae,scrollEventThrottle:16,onLayout:xe,onContentSizeChange:Ce,safeAreaEdges:ve,style:k.flex,contentContainerStyle:[{paddingHorizontal:w},C,{paddingTop:M+headerGap(topPaddingOf(C))}],children:[d,be>0?_jsx(View,{style:{height:be}}):null]})}):_jsx(View,{style:[k.flex,{paddingLeft:ie+w,paddingRight:de+w,paddingBottom:S+Se},C],children:d});const Ee=G?_jsx(KeyboardStickyView,{onLayout:se,style:[k.footer,{paddingLeft:ie+R,paddingRight:de+R,paddingBottom:ce+S}],children:f}):null;return _jsxs(View,{testID:T,style:[k.root,{paddingTop:ue}],children:[K?null:ye,Te,Ee,he,void 0!==m?d:null,K?ye:null,h?_jsx(KeyboardToolbar,{}):null]})}
1
+ "use strict";import{cloneElement,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{resolveFloatingActionButtonSize,useTheme}from"../../theme/index.js";import{bottomPaddingOf,topPaddingOf}from"../../utils/contentPadding.js";import{AppBar}from"../AppBar/index.js";import{KeyboardAwareScrollView}from"../KeyboardAwareScrollView/index.js";import{KeyboardToolbar}from"../KeyboardToolbar/index.js";import{PagedList}from"../PagedList/index.js";import{ScrollHostContext}from"./ScrollHost.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const DEFAULT_EDGES=["top","bottom"],SCROLL_EVENT_THROTTLE=16,noop=()=>{},buildStyles=e=>StyleSheet.create({flex:{flex:1},root:{flex:1,backgroundColor:e.colors.bg},overlay:{position:"absolute",top:0,left:0,right:0},headerRaised:{zIndex:1},footer:{backgroundColor:e.colors.bg,borderTopWidth:StyleSheet.hairlineWidth,borderTopColor:e.colors.border}});export function Screen(e){const{title:t,subtitle:o,largeTitle:n=!0,headerShadowOnScroll:r,onBack:a,rightActions:l,leading:s,trailing:i,children:d,onRefresh:c,refreshing:u=!1,footer:f,scroll:p=!0,list:m,edges:g=DEFAULT_EDGES,keyboardToolbar:h=!0,bottomInset:S=0,gutter:b,floatingAction:v,scrollRef:y,onScroll:x,contentContainerStyle:C,testID:T}=e,j=useTheme(),E=b??void 0===m,R=j.space[j.components.screen.gutter],w=E?R:0,k=useSafeAreaInsets(),A=useMemo(()=>buildStyles(j),[j]),[L]=useState(()=>new Animated.Value(0)),[O,V]=useState(0),[_,B]=useState(0),P=void 0!==a,z=useRef(a);z.current=a;const D=Boolean(t||o||a||s||i||l?.length),H=n&&void 0!==t,I=H&&(void 0!==m||p),K=I?O:0,M=D&&!I&&(r??j.settings.components.screen?.headerShadowOnScroll??!0),[F,N]=useState(!1),W=useRef(M);W.current=M;const headerGap=e=>e>0?e:D?j.space.lg:0,G=void 0!==f,{refreshControl:U}=useRefreshControl({onRefresh:c??noop,refreshing:u}),Y=c?cloneElement(U,{progressViewOffset:K}):void 0,$=useSharedValue(0),q=useSharedValue(0),J=useSharedValue(0),Q=useSharedValue(0),X=useRef(null),Z=useRef(0),ee=useRef(0),te=useMemo(()=>({top:$,bottom:q,offset:J,maxOffset:Q,scrollTo:e=>{const t=X.current;t instanceof FlatList?t.scrollToOffset({offset:e,animated:!1}):t?.scrollTo({y:e,animated:!1})}}),[$,q,J,Q]),oe=useCallback(e=>{X.current=e,"function"==typeof y?y(e):y&&(y.current=e)},[y]),ne=useCallback(()=>{Q.value=Math.max(0,Z.current-ee.current)},[Q]),re=useRef(x);re.current=x;const ae=useMemo(()=>Animated.event([{nativeEvent:{contentOffset:{y:L}}}],{useNativeDriver:!1,listener:e=>{if(J.value=e.nativeEvent.contentOffset.y,W.current){const t=e.nativeEvent.contentOffset.y>0;N(e=>e===t?e:t)}re.current?.(e)}}),[L,J]),le=useCallback(e=>{const{height:t}=e.nativeEvent.layout;V(e=>Math.max(e,t))},[]),se=useCallback(e=>{B(e.nativeEvent.layout.height)},[]);useEffect(()=>{if(!P)return;const e=BackHandler.addEventListener("hardwareBackPress",()=>(z.current?.(),!0));return()=>e.remove()},[P]);const ie=g.includes("left")?k.left:0,de=g.includes("right")?k.right:0,ce=g.includes("bottom")?k.bottom:0,ue=g.includes("top")&&!D?k.top:0,fe=j.space[j.components["floating-action-button"]["bottom-offset"]],pe=v?.props.bottomOffset??fe,me=v?resolveFloatingActionButtonSize(j,v.props.size??"md").diameter+pe+j.space.lg:0,ge=G?Math.max(0,_-k.bottom):S,he=v?cloneElement(v,{bottomOffset:pe+ge,position:v.props.position??"bottomRight"}):null,Se=G?me:Math.max(ce,v?me+k.bottom:0),be=S+Se-(G?0:ce),ve=g.filter(e=>"top"!==e&&!("bottom"===e&&G)),ye=D?_jsx(View,{style:I?A.overlay:M?A.headerRaised:void 0,onLayout:I?le:void 0,children:_jsx(AppBar,{title:t,subtitle:o,variant:H?"large":"default",scrollY:I?L:void 0,elevated:M&&F,onBack:a,rightActions:l,leading:s,trailing:i,gutter:R,testID:T?`${T}-app-bar`:void 0})}):null,xe=useCallback(()=>{const e=X.current?.getNativeScrollRef();e&&e.measureInWindow((e,t,o,n)=>{ee.current=n,$.value=t+K,q.value=t+n,ne()})},[K,$,q,ne]);useEffect(()=>{xe()},[xe]);const Ce=useCallback((e,t)=>{Z.current=t,ne()},[ne]);let Te;if(void 0!==m){const e=topPaddingOf([m.contentContainerStyle,C]);Te=_jsx(ScrollHostContext,{value:te,children:_jsx(PagedList,{...m,ref:oe,onRefresh:m.state?void 0:c,refreshing:m.state?void 0:u,progressViewOffset:K,placeholderStyle:[A.flex,{paddingTop:K+headerGap(e)}],onScroll:ae,onLayout:e=>{xe(),m.onLayout?.(e)},onContentSizeChange:(e,t)=>{Ce(e,t),m.onContentSizeChange?.(e,t)},scrollEventThrottle:16,style:A.flex,contentContainerStyle:[{paddingTop:K,paddingLeft:ie+w,paddingRight:de+w},m.contentContainerStyle,C,{paddingTop:K+headerGap(e),paddingBottom:bottomPaddingOf([m.contentContainerStyle,C])+S+Se}]})})}else Te=p?_jsx(ScrollHostContext,{value:te,children:_jsxs(KeyboardAwareScrollView,{ref:oe,refreshControl:Y,onScroll:ae,scrollEventThrottle:16,onLayout:xe,onContentSizeChange:Ce,safeAreaEdges:ve,style:A.flex,contentContainerStyle:[{paddingHorizontal:w},C,{paddingTop:K+headerGap(topPaddingOf(C))}],children:[d,be>0?_jsx(View,{style:{height:be}}):null]})}):_jsx(View,{style:[A.flex,{paddingLeft:ie+w,paddingRight:de+w},C,{paddingBottom:bottomPaddingOf(C)+S+Se}],children:d});const je=G?_jsx(KeyboardStickyView,{onLayout:se,style:[A.footer,{paddingLeft:ie+R,paddingRight:de+R,paddingBottom:ce+S}],children:f}):null;return _jsxs(View,{testID:T,style:[A.root,{paddingTop:ue}],children:[I?null:ye,Te,je,he,void 0!==m?d:null,I?ye:null,h?_jsx(KeyboardToolbar,{}):null]})}
@@ -0,0 +1 @@
1
+ "use strict";import{StyleSheet}from"react-native";const edgePaddingOf=(t,e)=>{const d=StyleSheet.flatten(t),n=d?.[e]??d?.paddingVertical??d?.padding;return"number"==typeof n?n:0};export const topPaddingOf=t=>edgePaddingOf(t,"paddingTop");export const bottomPaddingOf=t=>edgePaddingOf(t,"paddingBottom");
@@ -0,0 +1,4 @@
1
+ import type { StyleProp, ViewStyle } from "react-native";
2
+ export declare const topPaddingOf: (style: StyleProp<ViewStyle>) => number;
3
+ export declare const bottomPaddingOf: (style: StyleProp<ViewStyle>) => number;
4
+ //# sourceMappingURL=contentPadding.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { StyleProp, ViewStyle } from "react-native";
2
+ export declare const topPaddingOf: (style: StyleProp<ViewStyle>) => number;
3
+ export declare const bottomPaddingOf: (style: StyleProp<ViewStyle>) => number;
4
+ //# sourceMappingURL=contentPadding.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/mobile-ui",
3
- "version": "0.177.0",
3
+ "version": "0.178.1",
4
4
  "description": "Beautiful, animated, accessible React Native components, theme and form engine for Webority projects.",
5
5
  "keywords": [
6
6
  "react-native",
@@ -126,13 +126,13 @@
126
126
  }
127
127
  },
128
128
  "dependencies": {
129
- "@webority/markdown-core": "0.177.0"
129
+ "@webority/markdown-core": "0.178.1"
130
130
  },
131
131
  "peerDependencies": {
132
132
  "@react-navigation/bottom-tabs": ">=7.0.0",
133
133
  "@react-navigation/native": ">=7.0.0",
134
- "@webority/canvas-kit": "0.177.0",
135
- "@webority/mobile-core": "0.177.0",
134
+ "@webority/canvas-kit": "0.178.1",
135
+ "@webority/mobile-core": "0.178.1",
136
136
  "expo": ">=58.0.0",
137
137
  "expo-file-system": ">=58.0.0",
138
138
  "expo-haptics": ">=58.0.0",
@@ -196,10 +196,10 @@
196
196
  "@types/jest": "29.5.14",
197
197
  "@types/node": "25.6.0",
198
198
  "@types/react": "19.3.0",
199
- "@webority/canvas-kit": "0.177.0",
200
- "@webority/mobile-core": "0.177.0",
199
+ "@webority/canvas-kit": "0.178.1",
200
+ "@webority/mobile-core": "0.178.1",
201
201
  "@webority/mobile-dev": "0.0.0",
202
- "@webority/tokens": "0.177.0",
202
+ "@webority/tokens": "0.178.1",
203
203
  "expo": "58.0.23",
204
204
  "expo-file-system": "58.0.13",
205
205
  "expo-haptics": "58.0.7",