@webority/mobile-ui 0.119.0 → 0.120.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.
@@ -30225,7 +30225,7 @@ function IT(e) {
30225
30225
  let e = S.addEventListener("hardwareBackPress", () => (ee.current?.(), !0));
30226
30226
  return () => e.remove();
30227
30227
  }, [U]);
30228
- let _e = y.includes("left") ? F.left : 0, ve = y.includes("right") ? F.right : 0, ye = y.includes("bottom") ? F.bottom : 0, be = y.includes("top") && !W ? F.top : 0, xe = j.space[j.components["floating-action-button"]["bottom-offset"]], Se = E ? on(j, E.props.size ?? "md").diameter + xe + j.space.lg : 0, Ce = Y ? Math.max(0, B - F.bottom) : C, we = E ? r(E, { bottomOffset: (E.props.bottomOffset ?? xe) + Ce }) : null, Te = y.filter((e) => e !== "top" && !(e === "bottom" && Y)), Ee = W ? q(H, {
30228
+ let _e = y.includes("left") ? F.left : 0, ve = y.includes("right") ? F.right : 0, ye = y.includes("bottom") ? F.bottom : 0, be = y.includes("top") && !W ? F.top : 0, xe = j.space[j.components["floating-action-button"]["bottom-offset"]], Se = E?.props.bottomOffset ?? xe, Ce = E ? on(j, E.props.size ?? "md").diameter + Se + j.space.lg : 0, we = Y ? Math.max(0, B - F.bottom) : C, Te = E ? r(E, { bottomOffset: Se + we }) : null, Ee = Y ? Ce : Math.max(ye, E ? Ce + F.bottom : 0), De = C + Ee - (Y ? 0 : ye), Oe = y.filter((e) => e !== "top" && !(e === "bottom" && Y)), ke = W ? q(H, {
30229
30229
  style: ne ? I.overlay : void 0,
30230
30230
  onLayout: ne ? he : void 0,
30231
30231
  children: q(Ng, {
@@ -30238,7 +30238,7 @@ function IT(e) {
30238
30238
  leading: s,
30239
30239
  gutter: N
30240
30240
  })
30241
- }) : null, De = l(() => {
30241
+ }) : null, Ae = l(() => {
30242
30242
  let e = se.current?.getNativeScrollRef();
30243
30243
  e && e.measureInWindow((e, t, n, r) => {
30244
30244
  le.current = r, Z.value = t + K, Q.value = t + r, fe();
@@ -30250,11 +30250,11 @@ function IT(e) {
30250
30250
  fe
30251
30251
  ]);
30252
30252
  d(() => {
30253
- De();
30254
- }, [De]);
30255
- let Oe = l((e, t) => {
30253
+ Ae();
30254
+ }, [Ae]);
30255
+ let je = l((e, t) => {
30256
30256
  ce.current = t, fe();
30257
- }, [fe]), ke;
30257
+ }, [fe]), Me;
30258
30258
  if (v !== void 0) {
30259
30259
  let { state: e, paging: t, ...n } = v, r = (e) => {
30260
30260
  t?.hasMore && !t.loadingMore && t.errorMore == null && t.loadMore(), n.onEndReached?.(e);
@@ -30266,10 +30266,10 @@ function IT(e) {
30266
30266
  refreshControl: X,
30267
30267
  onScroll: me,
30268
30268
  onLayout: (e) => {
30269
- De(), n.onLayout?.(e);
30269
+ Ae(), n.onLayout?.(e);
30270
30270
  },
30271
30271
  onContentSizeChange: (e, t) => {
30272
- Oe(e, t), n.onContentSizeChange?.(e, t);
30272
+ je(e, t), n.onContentSizeChange?.(e, t);
30273
30273
  },
30274
30274
  onEndReached: t ? r : n.onEndReached,
30275
30275
  ListEmptyComponent: e?.empty ? q(Lg, { ...e.empty }) : void 0,
@@ -30282,12 +30282,12 @@ function IT(e) {
30282
30282
  paddingLeft: _e + P,
30283
30283
  paddingRight: ve + P
30284
30284
  },
30285
- { paddingBottom: (Y ? 0 : ye) + C + Se },
30285
+ { paddingBottom: C + Ee },
30286
30286
  n.contentContainerStyle,
30287
30287
  k
30288
30288
  ]
30289
30289
  });
30290
- ke = q(AT.Provider, {
30290
+ Me = q(AT.Provider, {
30291
30291
  value: ue,
30292
30292
  children: e ? q(Hg, {
30293
30293
  loading: e.loading,
@@ -30299,22 +30299,22 @@ function IT(e) {
30299
30299
  children: i
30300
30300
  }) : i
30301
30301
  });
30302
- } else ke = _ ? q(AT.Provider, {
30302
+ } else Me = _ ? q(AT.Provider, {
30303
30303
  value: ue,
30304
30304
  children: J(pS, {
30305
30305
  ref: de,
30306
30306
  refreshControl: X,
30307
30307
  onScroll: me,
30308
30308
  scrollEventThrottle: 16,
30309
- onLayout: De,
30310
- onContentSizeChange: Oe,
30311
- safeAreaEdges: Te,
30309
+ onLayout: Ae,
30310
+ onContentSizeChange: je,
30311
+ safeAreaEdges: Oe,
30312
30312
  style: I.flex,
30313
30313
  contentContainerStyle: [{
30314
30314
  paddingTop: K,
30315
30315
  paddingHorizontal: P
30316
30316
  }, k],
30317
- children: [c, C + Se > 0 ? q(H, { style: { height: C + Se } }) : null]
30317
+ children: [c, De > 0 ? q(H, { style: { height: De } }) : null]
30318
30318
  })
30319
30319
  }) : q(H, {
30320
30320
  style: [
@@ -30322,13 +30322,13 @@ function IT(e) {
30322
30322
  {
30323
30323
  paddingLeft: _e + P,
30324
30324
  paddingRight: ve + P,
30325
- paddingBottom: (Y ? 0 : ye) + C + Se
30325
+ paddingBottom: C + Ee
30326
30326
  },
30327
30327
  k
30328
30328
  ],
30329
30329
  children: c
30330
30330
  });
30331
- let Ae = Y ? q(G, {
30331
+ let Ne = Y ? q(G, {
30332
30332
  onLayout: ge,
30333
30333
  style: [I.footer, {
30334
30334
  paddingLeft: _e + N,
@@ -30341,12 +30341,12 @@ function IT(e) {
30341
30341
  testID: A,
30342
30342
  style: [I.root, { paddingTop: be }],
30343
30343
  children: [
30344
- ne ? null : Ee,
30345
- ke,
30346
- Ae,
30347
- we,
30344
+ ne ? null : ke,
30345
+ Me,
30346
+ Ne,
30347
+ Te,
30348
30348
  v === void 0 ? null : c,
30349
- ne ? Ee : null,
30349
+ ne ? ke : null,
30350
30350
  x ? q(gS, {}) : null
30351
30351
  ]
30352
30352
  });
@@ -36501,7 +36501,7 @@ var PO = Pt({
36501
36501
  kind: "WeborityPhone",
36502
36502
  library: {
36503
36503
  name: "@webority/mobile-ui",
36504
- version: "0.119.0"
36504
+ version: "0.120.1"
36505
36505
  },
36506
36506
  rendererProtocolVersion: 13,
36507
36507
  platform: "Phone",
@@ -2,7 +2,7 @@
2
2
  "kind": "WeborityPhone",
3
3
  "library": {
4
4
  "name": "@webority/mobile-ui",
5
- "version": "0.119.0"
5
+ "version": "0.120.1"
6
6
  },
7
7
  "rendererProtocolVersion": 13,
8
8
  "platform": "Phone",
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "webority-phone",
3
- "version": "0.119.0",
3
+ "version": "0.120.1",
4
4
  "platform": "Phone",
5
5
  "kitModuleVersion": 2,
6
6
  "rendererProtocolVersion": 13,
7
7
  "library": {
8
8
  "name": "@webority/mobile-ui",
9
- "version": "0.119.0"
9
+ "version": "0.120.1"
10
10
  },
11
11
  "files": {
12
12
  "manifest.json": {
13
- "sha256": "b5fc2fb8bab45ba573cca3f152424206d745a86e0ee1cc59ca69954ecfb075ba",
13
+ "sha256": "a7e6047af075e9b89e2be745d4c9528c5557f4a5b30094c3bce6621242add818",
14
14
  "bytes": 636991
15
15
  },
16
16
  "kit.js": {
17
- "sha256": "a22fcf068954f8325a7641da4db8c438eeba9c48008124cf448250deb79a9cf8",
18
- "bytes": 5959831
17
+ "sha256": "12160f30a840d616e0f61d850bcc660d242e83663705ffa977d2bdd1741c62de",
18
+ "bytes": 5959880
19
19
  },
20
20
  "kit.css": {
21
21
  "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
@@ -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("../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:f=DEFAULT_EDGES,keyboardToolbar:x=!0,bottomInset:m=0,gutter:v,floatingAction:h,scrollRef:g,onScroll:p,contentContainerStyle:y,testID:R}=e,S=(0,_index.useTheme)(),b=v??void 0===_,j=S.space[S.components.screen.gutter],C=b?j:0,E=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),T=(0,_react.useMemo)(()=>buildStyles(S),[S]),[L]=(0,_react.useState)(()=>new _reactNative.Animated.Value(0)),[N,k]=(0,_react.useState)(0),[A,V]=(0,_react.useState)(0),q=void 0!==n,O=(0,_react.useRef)(n);O.current=n;const w=Boolean(t||r||n||i||a?.length),B=o&&void 0!==t,F=B&&(void 0!==_||u),H=F?N:0,M=void 0!==d,{refreshControl:D}=(0,_useRefreshControl.useRefreshControl)({onRefresh:s??noop,refreshing:c}),K=s?(0,_react.cloneElement)(D,{progressViewOffset:H}):void 0,P=(0,_reactNativeReanimated.useSharedValue)(0),z=(0,_reactNativeReanimated.useSharedValue)(0),I=(0,_reactNativeReanimated.useSharedValue)(0),W=(0,_reactNativeReanimated.useSharedValue)(0),G=(0,_react.useRef)(null),U=(0,_react.useRef)(0),Y=(0,_react.useRef)(0),J=(0,_react.useMemo)(()=>({top:P,bottom:z,offset:I,maxOffset:W,scrollTo:e=>{const t=G.current;t instanceof _reactNative.FlatList?t.scrollToOffset({offset:e,animated:!1}):t?.scrollTo({y:e,animated:!1})}}),[P,z,I,W]),Q=(0,_react.useCallback)(e=>{G.current=e,"function"==typeof g?g(e):g&&(g.current=e)},[g]),X=(0,_react.useCallback)(()=>{W.value=Math.max(0,U.current-Y.current)},[W]),Z=(0,_react.useRef)(p);Z.current=p;const $=(0,_react.useMemo)(()=>_reactNative.Animated.event([{nativeEvent:{contentOffset:{y:L}}}],{useNativeDriver:!1,listener:e=>{I.value=e.nativeEvent.contentOffset.y,Z.current?.(e)}}),[L,I]),ee=(0,_react.useCallback)(e=>{const{height:t}=e.nativeEvent.layout;k(e=>Math.max(e,t))},[]),te=(0,_react.useCallback)(e=>{V(e.nativeEvent.layout.height)},[]);(0,_react.useEffect)(()=>{if(!q)return;const e=_reactNative.BackHandler.addEventListener("hardwareBackPress",()=>(O.current?.(),!0));return()=>e.remove()},[q]);const re=f.includes("left")?E.left:0,oe=f.includes("right")?E.right:0,ne=f.includes("bottom")?E.bottom:0,ae=f.includes("top")&&!w?E.top:0,ie=S.space[S.components["floating-action-button"]["bottom-offset"]],le=h?(0,_index.resolveFloatingActionButtonSize)(S,h.props.size??"md").diameter+ie+S.space.lg:0,se=M?Math.max(0,A-E.bottom):m,ce=h?(0,_react.cloneElement)(h,{bottomOffset:(h.props.bottomOffset??ie)+se}):null,de=f.filter(e=>"top"!==e&&!("bottom"===e&&M)),ue=w?(0,_jsxRuntime.jsx)(_reactNative.View,{style:F?T.overlay:void 0,onLayout:F?ee:void 0,children:(0,_jsxRuntime.jsx)(_index2.AppBar,{title:t,subtitle:r,variant:B?"large":"default",scrollY:F?L:void 0,onBack:n,rightActions:a,leading:i,gutter:j})}):null,fe=(0,_react.useCallback)(()=>{const e=G.current?.getNativeScrollRef();e&&e.measureInWindow((e,t,r,o)=>{Y.current=o,P.value=t+H,z.value=t+o,X()})},[H,P,z,X]);(0,_react.useEffect)(()=>{fe()},[fe]);const xe=(0,_react.useCallback)((e,t)=>{U.current=t,X()},[X]);let me;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:Q,refreshControl:K,onScroll:$,onLayout:e=>{fe(),r.onLayout?.(e)},onContentSizeChange:(e,t)=>{xe(e,t),r.onContentSizeChange?.(e,t)},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:T.flex,contentContainerStyle:[{paddingTop:H,paddingLeft:re+C,paddingRight:oe+C},{paddingBottom:(M?0:ne)+m+le},r.contentContainerStyle,y]});me=(0,_jsxRuntime.jsx)(_ScrollHost.ScrollHostContext.Provider,{value:J,children:e?(0,_jsxRuntime.jsx)(_index3.AsyncBlock,{loading:e.loading,error:e.error,errorTitle:e.errorTitle,onRetry:e.onRetry,skeleton:e.skeleton,style:[T.flex,{paddingTop:H}],children:o}):o})}else me=u?(0,_jsxRuntime.jsx)(_ScrollHost.ScrollHostContext.Provider,{value:J,children:(0,_jsxRuntime.jsxs)(_index5.KeyboardAwareScrollView,{ref:Q,refreshControl:K,onScroll:$,scrollEventThrottle:SCROLL_EVENT_THROTTLE,onLayout:fe,onContentSizeChange:xe,safeAreaEdges:de,style:T.flex,contentContainerStyle:[{paddingTop:H,paddingHorizontal:C},y],children:[l,m+le>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{height:m+le}}):null]})}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:[T.flex,{paddingLeft:re+C,paddingRight:oe+C,paddingBottom:(M?0:ne)+m+le},y],children:l});const ve=M?(0,_jsxRuntime.jsx)(_reactNativeKeyboardController.KeyboardStickyView,{onLayout:te,style:[T.footer,{paddingLeft:re+j,paddingRight:oe+j,paddingBottom:ne+m}],children:d}):null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{testID:R,style:[T.root,{paddingTop:ae}],children:[F?null:ue,me,ve,ce,void 0!==_?l:null,F?ue:null,x?(0,_jsxRuntime.jsx)(_index6.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"),_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:f=DEFAULT_EDGES,keyboardToolbar:x=!0,bottomInset:m=0,gutter:v,floatingAction:h,scrollRef:g,onScroll:p,contentContainerStyle:y,testID:R}=e,S=(0,_index.useTheme)(),b=v??void 0===_,j=S.space[S.components.screen.gutter],C=b?j:0,E=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),T=(0,_react.useMemo)(()=>buildStyles(S),[S]),[L]=(0,_react.useState)(()=>new _reactNative.Animated.Value(0)),[N,k]=(0,_react.useState)(0),[A,V]=(0,_react.useState)(0),q=void 0!==n,O=(0,_react.useRef)(n);O.current=n;const w=Boolean(t||r||n||i||a?.length),B=o&&void 0!==t,F=B&&(void 0!==_||u),M=F?N:0,H=void 0!==d,{refreshControl:D}=(0,_useRefreshControl.useRefreshControl)({onRefresh:s??noop,refreshing:c}),K=s?(0,_react.cloneElement)(D,{progressViewOffset:M}):void 0,P=(0,_reactNativeReanimated.useSharedValue)(0),z=(0,_reactNativeReanimated.useSharedValue)(0),I=(0,_reactNativeReanimated.useSharedValue)(0),W=(0,_reactNativeReanimated.useSharedValue)(0),G=(0,_react.useRef)(null),U=(0,_react.useRef)(0),Y=(0,_react.useRef)(0),J=(0,_react.useMemo)(()=>({top:P,bottom:z,offset:I,maxOffset:W,scrollTo:e=>{const t=G.current;t instanceof _reactNative.FlatList?t.scrollToOffset({offset:e,animated:!1}):t?.scrollTo({y:e,animated:!1})}}),[P,z,I,W]),Q=(0,_react.useCallback)(e=>{G.current=e,"function"==typeof g?g(e):g&&(g.current=e)},[g]),X=(0,_react.useCallback)(()=>{W.value=Math.max(0,U.current-Y.current)},[W]),Z=(0,_react.useRef)(p);Z.current=p;const $=(0,_react.useMemo)(()=>_reactNative.Animated.event([{nativeEvent:{contentOffset:{y:L}}}],{useNativeDriver:!1,listener:e=>{I.value=e.nativeEvent.contentOffset.y,Z.current?.(e)}}),[L,I]),ee=(0,_react.useCallback)(e=>{const{height:t}=e.nativeEvent.layout;k(e=>Math.max(e,t))},[]),te=(0,_react.useCallback)(e=>{V(e.nativeEvent.layout.height)},[]);(0,_react.useEffect)(()=>{if(!q)return;const e=_reactNative.BackHandler.addEventListener("hardwareBackPress",()=>(O.current?.(),!0));return()=>e.remove()},[q]);const re=f.includes("left")?E.left:0,oe=f.includes("right")?E.right:0,ne=f.includes("bottom")?E.bottom:0,ae=f.includes("top")&&!w?E.top:0,ie=S.space[S.components["floating-action-button"]["bottom-offset"]],le=h?.props.bottomOffset??ie,se=h?(0,_index.resolveFloatingActionButtonSize)(S,h.props.size??"md").diameter+le+S.space.lg:0,ce=H?Math.max(0,A-E.bottom):m,de=h?(0,_react.cloneElement)(h,{bottomOffset:le+ce}):null,ue=H?se:Math.max(ne,h?se+E.bottom:0),fe=m+ue-(H?0:ne),xe=f.filter(e=>"top"!==e&&!("bottom"===e&&H)),me=w?(0,_jsxRuntime.jsx)(_reactNative.View,{style:F?T.overlay:void 0,onLayout:F?ee:void 0,children:(0,_jsxRuntime.jsx)(_index2.AppBar,{title:t,subtitle:r,variant:B?"large":"default",scrollY:F?L:void 0,onBack:n,rightActions:a,leading:i,gutter:j})}):null,ve=(0,_react.useCallback)(()=>{const e=G.current?.getNativeScrollRef();e&&e.measureInWindow((e,t,r,o)=>{Y.current=o,P.value=t+M,z.value=t+o,X()})},[M,P,z,X]);(0,_react.useEffect)(()=>{ve()},[ve]);const he=(0,_react.useCallback)((e,t)=>{U.current=t,X()},[X]);let ge;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:Q,refreshControl:K,onScroll:$,onLayout:e=>{ve(),r.onLayout?.(e)},onContentSizeChange:(e,t)=>{he(e,t),r.onContentSizeChange?.(e,t)},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:T.flex,contentContainerStyle:[{paddingTop:M,paddingLeft:re+C,paddingRight:oe+C},{paddingBottom:m+ue},r.contentContainerStyle,y]});ge=(0,_jsxRuntime.jsx)(_ScrollHost.ScrollHostContext.Provider,{value:J,children:e?(0,_jsxRuntime.jsx)(_index3.AsyncBlock,{loading:e.loading,error:e.error,errorTitle:e.errorTitle,onRetry:e.onRetry,skeleton:e.skeleton,style:[T.flex,{paddingTop:M}],children:o}):o})}else ge=u?(0,_jsxRuntime.jsx)(_ScrollHost.ScrollHostContext.Provider,{value:J,children:(0,_jsxRuntime.jsxs)(_index5.KeyboardAwareScrollView,{ref:Q,refreshControl:K,onScroll:$,scrollEventThrottle:SCROLL_EVENT_THROTTLE,onLayout:ve,onContentSizeChange:he,safeAreaEdges:xe,style:T.flex,contentContainerStyle:[{paddingTop:M,paddingHorizontal:C},y],children:[l,fe>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{height:fe}}):null]})}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:[T.flex,{paddingLeft:re+C,paddingRight:oe+C,paddingBottom:m+ue},y],children:l});const pe=H?(0,_jsxRuntime.jsx)(_reactNativeKeyboardController.KeyboardStickyView,{onLayout:te,style:[T.footer,{paddingLeft:re+j,paddingRight:oe+j,paddingBottom:ne+m}],children:d}):null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{testID:R,style:[T.root,{paddingTop:ae}],children:[F?null:me,ge,pe,de,void 0!==_?l:null,F?me:null,x?(0,_jsxRuntime.jsx)(_index6.KeyboardToolbar,{}):null]})}
@@ -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{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{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,gutter:g,floatingAction:y,scrollRef:S,onScroll:v,contentContainerStyle:b,testID:x}=e,E=useTheme(),C=g??void 0===f,j=E.space[E.components.screen.gutter],T=C?j:0,k=useSafeAreaInsets(),L=useMemo(()=>buildStyles(E),[E]),[R]=useState(()=>new Animated.Value(0)),[_,A]=useState(0),[V,F]=useState(0),w=void 0!==n,B=useRef(n);B.current=n;const M=Boolean(t||o||n||s||l?.length),O=r&&void 0!==t,H=O&&(void 0!==f||u),K=H?_:0,z=void 0!==c,{refreshControl:D}=useRefreshControl({onRefresh:i??noop,refreshing:d}),P=i?cloneElement(D,{progressViewOffset:K}):void 0,I=useSharedValue(0),N=useSharedValue(0),W=useSharedValue(0),G=useSharedValue(0),U=useRef(null),Y=useRef(0),q=useRef(0),J=useMemo(()=>({top:I,bottom:N,offset:W,maxOffset:G,scrollTo:e=>{const t=U.current;t instanceof FlatList?t.scrollToOffset({offset:e,animated:!1}):t?.scrollTo({y:e,animated:!1})}}),[I,N,W,G]),Q=useCallback(e=>{U.current=e,"function"==typeof S?S(e):S&&(S.current=e)},[S]),X=useCallback(()=>{G.value=Math.max(0,Y.current-q.current)},[G]),Z=useRef(v);Z.current=v;const $=useMemo(()=>Animated.event([{nativeEvent:{contentOffset:{y:R}}}],{useNativeDriver:!1,listener:e=>{W.value=e.nativeEvent.contentOffset.y,Z.current?.(e)}}),[R,W]),ee=useCallback(e=>{const{height:t}=e.nativeEvent.layout;A(e=>Math.max(e,t))},[]),te=useCallback(e=>{F(e.nativeEvent.layout.height)},[]);useEffect(()=>{if(!w)return;const e=BackHandler.addEventListener("hardwareBackPress",()=>(B.current?.(),!0));return()=>e.remove()},[w]);const oe=m.includes("left")?k.left:0,re=m.includes("right")?k.right:0,ne=m.includes("bottom")?k.bottom:0,le=m.includes("top")&&!M?k.top:0,se=E.space[E.components["floating-action-button"]["bottom-offset"]],ae=y?resolveFloatingActionButtonSize(E,y.props.size??"md").diameter+se+E.space.lg:0,ie=z?Math.max(0,V-k.bottom):h,de=y?cloneElement(y,{bottomOffset:(y.props.bottomOffset??se)+ie}):null,ce=m.filter(e=>"top"!==e&&!("bottom"===e&&z)),ue=M?_jsx(View,{style:H?L.overlay:void 0,onLayout:H?ee:void 0,children:_jsx(AppBar,{title:t,subtitle:o,variant:O?"large":"default",scrollY:H?R:void 0,onBack:n,rightActions:l,leading:s,gutter:j})}):null,fe=useCallback(()=>{const e=U.current?.getNativeScrollRef();e&&e.measureInWindow((e,t,o,r)=>{q.current=r,I.value=t+K,N.value=t+r,X()})},[K,I,N,X]);useEffect(()=>{fe()},[fe]);const me=useCallback((e,t)=>{Y.current=t,X()},[X]);let pe;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:Q,refreshControl:P,onScroll:$,onLayout:e=>{fe(),o.onLayout?.(e)},onContentSizeChange:(e,t)=>{me(e,t),o.onContentSizeChange?.(e,t)},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:L.flex,contentContainerStyle:[{paddingTop:K,paddingLeft:oe+T,paddingRight:re+T},{paddingBottom:(z?0:ne)+h+ae},o.contentContainerStyle,b]});pe=_jsx(ScrollHostContext.Provider,{value:J,children:e?_jsx(AsyncBlock,{loading:e.loading,error:e.error,errorTitle:e.errorTitle,onRetry:e.onRetry,skeleton:e.skeleton,style:[L.flex,{paddingTop:K}],children:r}):r})}else pe=u?_jsx(ScrollHostContext.Provider,{value:J,children:_jsxs(KeyboardAwareScrollView,{ref:Q,refreshControl:P,onScroll:$,scrollEventThrottle:16,onLayout:fe,onContentSizeChange:me,safeAreaEdges:ce,style:L.flex,contentContainerStyle:[{paddingTop:K,paddingHorizontal:T},b],children:[a,h+ae>0?_jsx(View,{style:{height:h+ae}}):null]})}):_jsx(View,{style:[L.flex,{paddingLeft:oe+T,paddingRight:re+T,paddingBottom:(z?0:ne)+h+ae},b],children:a});const he=z?_jsx(KeyboardStickyView,{onLayout:te,style:[L.footer,{paddingLeft:oe+j,paddingRight:re+j,paddingBottom:ne+h}],children:c}):null;return _jsxs(View,{testID:x,style:[L.root,{paddingTop:le}],children:[H?null:ue,pe,he,de,void 0!==f?a:null,H?ue:null,p?_jsx(KeyboardToolbar,{}):null]})}
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{resolveFloatingActionButtonSize,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,gutter:g,floatingAction:y,scrollRef:S,onScroll:v,contentContainerStyle:b,testID:x}=e,E=useTheme(),C=g??void 0===f,j=E.space[E.components.screen.gutter],T=C?j:0,k=useSafeAreaInsets(),L=useMemo(()=>buildStyles(E),[E]),[R]=useState(()=>new Animated.Value(0)),[_,A]=useState(0),[V,F]=useState(0),w=void 0!==n,B=useRef(n);B.current=n;const M=Boolean(t||o||n||s||l?.length),O=r&&void 0!==t,H=O&&(void 0!==f||u),K=H?_:0,z=void 0!==c,{refreshControl:D}=useRefreshControl({onRefresh:i??noop,refreshing:d}),P=i?cloneElement(D,{progressViewOffset:K}):void 0,I=useSharedValue(0),N=useSharedValue(0),W=useSharedValue(0),G=useSharedValue(0),U=useRef(null),Y=useRef(0),q=useRef(0),J=useMemo(()=>({top:I,bottom:N,offset:W,maxOffset:G,scrollTo:e=>{const t=U.current;t instanceof FlatList?t.scrollToOffset({offset:e,animated:!1}):t?.scrollTo({y:e,animated:!1})}}),[I,N,W,G]),Q=useCallback(e=>{U.current=e,"function"==typeof S?S(e):S&&(S.current=e)},[S]),X=useCallback(()=>{G.value=Math.max(0,Y.current-q.current)},[G]),Z=useRef(v);Z.current=v;const $=useMemo(()=>Animated.event([{nativeEvent:{contentOffset:{y:R}}}],{useNativeDriver:!1,listener:e=>{W.value=e.nativeEvent.contentOffset.y,Z.current?.(e)}}),[R,W]),ee=useCallback(e=>{const{height:t}=e.nativeEvent.layout;A(e=>Math.max(e,t))},[]),te=useCallback(e=>{F(e.nativeEvent.layout.height)},[]);useEffect(()=>{if(!w)return;const e=BackHandler.addEventListener("hardwareBackPress",()=>(B.current?.(),!0));return()=>e.remove()},[w]);const oe=m.includes("left")?k.left:0,re=m.includes("right")?k.right:0,ne=m.includes("bottom")?k.bottom:0,le=m.includes("top")&&!M?k.top:0,se=E.space[E.components["floating-action-button"]["bottom-offset"]],ae=y?.props.bottomOffset??se,ie=y?resolveFloatingActionButtonSize(E,y.props.size??"md").diameter+ae+E.space.lg:0,de=z?Math.max(0,V-k.bottom):h,ce=y?cloneElement(y,{bottomOffset:ae+de}):null,ue=z?ie:Math.max(ne,y?ie+k.bottom:0),fe=h+ue-(z?0:ne),me=m.filter(e=>"top"!==e&&!("bottom"===e&&z)),pe=M?_jsx(View,{style:H?L.overlay:void 0,onLayout:H?ee:void 0,children:_jsx(AppBar,{title:t,subtitle:o,variant:O?"large":"default",scrollY:H?R:void 0,onBack:n,rightActions:l,leading:s,gutter:j})}):null,he=useCallback(()=>{const e=U.current?.getNativeScrollRef();e&&e.measureInWindow((e,t,o,r)=>{q.current=r,I.value=t+K,N.value=t+r,X()})},[K,I,N,X]);useEffect(()=>{he()},[he]);const ge=useCallback((e,t)=>{Y.current=t,X()},[X]);let ye;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:Q,refreshControl:P,onScroll:$,onLayout:e=>{he(),o.onLayout?.(e)},onContentSizeChange:(e,t)=>{ge(e,t),o.onContentSizeChange?.(e,t)},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:L.flex,contentContainerStyle:[{paddingTop:K,paddingLeft:oe+T,paddingRight:re+T},{paddingBottom:h+ue},o.contentContainerStyle,b]});ye=_jsx(ScrollHostContext.Provider,{value:J,children:e?_jsx(AsyncBlock,{loading:e.loading,error:e.error,errorTitle:e.errorTitle,onRetry:e.onRetry,skeleton:e.skeleton,style:[L.flex,{paddingTop:K}],children:r}):r})}else ye=u?_jsx(ScrollHostContext.Provider,{value:J,children:_jsxs(KeyboardAwareScrollView,{ref:Q,refreshControl:P,onScroll:$,scrollEventThrottle:16,onLayout:he,onContentSizeChange:ge,safeAreaEdges:me,style:L.flex,contentContainerStyle:[{paddingTop:K,paddingHorizontal:T},b],children:[a,fe>0?_jsx(View,{style:{height:fe}}):null]})}):_jsx(View,{style:[L.flex,{paddingLeft:oe+T,paddingRight:re+T,paddingBottom:h+ue},b],children:a});const Se=z?_jsx(KeyboardStickyView,{onLayout:te,style:[L.footer,{paddingLeft:oe+j,paddingRight:re+j,paddingBottom:ne+h}],children:c}):null;return _jsxs(View,{testID:x,style:[L.root,{paddingTop:le}],children:[H?null:pe,ye,Se,ce,void 0!==f?a:null,H?pe:null,p?_jsx(KeyboardToolbar,{}):null]})}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/mobile-ui",
3
- "version": "0.119.0",
3
+ "version": "0.120.1",
4
4
  "description": "Beautiful, animated, accessible React Native components, theme and form engine for Webority projects.",
5
5
  "keywords": [
6
6
  "react-native",
@@ -85,13 +85,13 @@
85
85
  }
86
86
  },
87
87
  "dependencies": {
88
- "@webority/markdown-core": "0.119.0"
88
+ "@webority/markdown-core": "0.120.1"
89
89
  },
90
90
  "peerDependencies": {
91
91
  "@react-navigation/bottom-tabs": ">=7.0.0",
92
92
  "@react-navigation/native": ">=7.0.0",
93
- "@webority/canvas-kit": "0.119.0",
94
- "@webority/mobile-core": "0.119.0",
93
+ "@webority/canvas-kit": "0.120.1",
94
+ "@webority/mobile-core": "0.120.1",
95
95
  "expo": ">=57.0.0",
96
96
  "expo-file-system": ">=57.0.0",
97
97
  "expo-haptics": ">=57.0.0",
@@ -155,10 +155,10 @@
155
155
  "@types/node": "25.6.0",
156
156
  "@types/react": "19.2.18",
157
157
  "@types/react-test-renderer": "19.1.0",
158
- "@webority/canvas-kit": "0.119.0",
159
- "@webority/mobile-core": "0.119.0",
158
+ "@webority/canvas-kit": "0.120.1",
159
+ "@webority/mobile-core": "0.120.1",
160
160
  "@webority/mobile-dev": "0.0.0",
161
- "@webority/tokens": "0.119.0",
161
+ "@webority/tokens": "0.120.1",
162
162
  "expo": "57.0.31",
163
163
  "expo-file-system": "57.0.7",
164
164
  "expo-haptics": "57.0.3",