@william-callao/antonella-ui 2.0.1 → 2.0.3

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.
Files changed (2) hide show
  1. package/dist/index.js +19 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10300,6 +10300,10 @@ function AppLayout({
10300
10300
  () => computeSectionTargets(resolveLayoutState(initialRoute.state), initialNaturalsValue, H)
10301
10301
  );
10302
10302
  const appliedRef = (0, import_react37.useRef)(layoutHeights);
10303
+ const previousLayoutHeightsRef = (0, import_react37.useRef)(layoutHeights);
10304
+ (0, import_react37.useLayoutEffect)(() => {
10305
+ previousLayoutHeightsRef.current = layoutHeights;
10306
+ }, [layoutHeights]);
10303
10307
  const naturalsRef = (0, import_react37.useRef)({ ...initialNaturalsValue });
10304
10308
  const routeSnapshotRef = (0, import_react37.useRef)(/* @__PURE__ */ new Map());
10305
10309
  const [revealHidden, setRevealHidden] = (0, import_react37.useState)(false);
@@ -10382,14 +10386,10 @@ function AppLayout({
10382
10386
  });
10383
10387
  return () => sub.remove();
10384
10388
  }, [canGoBack, back]);
10385
- const navigationValue = {
10386
- navigate,
10387
- back,
10388
- canGoBack,
10389
- currentRoute,
10390
- stack,
10391
- replace
10392
- };
10389
+ const navigationValue = (0, import_react37.useMemo)(
10390
+ () => ({ navigate, back, canGoBack, currentRoute, stack, replace }),
10391
+ [navigate, back, canGoBack, currentRoute, stack, replace]
10392
+ );
10393
10393
  const state = resolveLayoutState(currentRoute.state);
10394
10394
  const slots = currentRoute.slots ?? {};
10395
10395
  stateRef.current = state;
@@ -10401,12 +10401,10 @@ function AppLayout({
10401
10401
  const leavingOnlyCenter = contentFadeEnabled && isOnlyCenterLayout(prevLayoutState) && !isOnlyCenterLayout(state);
10402
10402
  const enteringOnlyCenter = contentFadeEnabled && !isOnlyCenterLayout(prevLayoutState) && isOnlyCenterLayout(state);
10403
10403
  const goingBack = navigationDirectionRef.current === "back";
10404
- const skipContentFadeOut = leavingFullBottom || leavingOnlyCenter || goingBack;
10404
+ const enteringOnlyCenterLayout = !!prevLayoutState && !isOnlyCenterLayout(prevLayoutState) && isOnlyCenterLayout(state);
10405
+ const skipContentFadeOut = leavingFullBottom || leavingOnlyCenter || goingBack || enteringOnlyCenterLayout;
10405
10406
  const contentFadeOutMs = goingBack ? CONTENT_FADE_OUT_BACK_MS : CONTENT_FADE_OUT_MS;
10406
10407
  const contentFadeInMs = goingBack ? CONTENT_FADE_IN_BACK_MS : CONTENT_FADE_IN_MS;
10407
- if (contentFadeEnabled) {
10408
- contentOutProgress.value = skipContentFadeOut ? 0 : 1;
10409
- }
10410
10408
  const transitionDuration = (() => {
10411
10409
  if (transitionLatchRef.current.route === currentRoute.name) {
10412
10410
  return transitionLatchRef.current.duration;
@@ -10598,7 +10596,10 @@ function AppLayout({
10598
10596
  const cur = state.sections[k];
10599
10597
  const prevB = prevLayoutState?.sections[k];
10600
10598
  const prevVisible = !!prevB?.visible;
10601
- if (!cur?.visible && (!prevVisible || goingBack)) return null;
10599
+ const dropOutgoing = goingBack || enteringOnlyCenterLayout;
10600
+ if (!cur?.visible && (!prevVisible || dropOutgoing)) {
10601
+ return null;
10602
+ }
10602
10603
  const usePrevContent = !cur?.visible && prevVisible;
10603
10604
  const behavior = usePrevContent ? prevB : cur;
10604
10605
  const slot = behavior?.slot;
@@ -10621,6 +10622,9 @@ function AppLayout({
10621
10622
  const skipPreviousCenter = enteringOnlyCenter && k === "mid";
10622
10623
  const previousSlot = contentFadeEnabled && !skipContentFadeOut && !goingBack && !skipPreviousCenter && !hidePreviousBody && !usePrevContent ? prevB?.slot : void 0;
10623
10624
  const previousContent = previousSlot ? prevRoute?.slots?.[previousSlot] : null;
10625
+ const remountOnBack = enteringOnlyCenterLayout;
10626
+ const sectionKey = remountOnBack ? `${k}:${currentRoute.name}` : k;
10627
+ const animateSectionLayout = animateLayout && previousLayoutHeightsRef.current[k] !== height;
10624
10628
  const currentLayer = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
10625
10629
  import_react_native_reanimated17.default.View,
10626
10630
  {
@@ -10650,7 +10654,7 @@ function AppLayout({
10650
10654
  return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
10651
10655
  import_react_native_reanimated17.default.View,
10652
10656
  {
10653
- layout: animateLayout ? transition2 : void 0,
10657
+ layout: remountOnBack || !animateSectionLayout ? void 0 : transition2,
10654
10658
  collapsable: false,
10655
10659
  style: [
10656
10660
  styles79.colBlock,
@@ -10675,7 +10679,7 @@ function AppLayout({
10675
10679
  ] }) })
10676
10680
  ]
10677
10681
  },
10678
- k
10682
+ sectionKey
10679
10683
  );
10680
10684
  };
10681
10685
  return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(AppNavigationContext.Provider, { value: navigationValue, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_react_native_reanimated17.default.View, { style: [styles79.root, pageBgStyle], children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@william-callao/antonella-ui",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Componentes UI de Antonella.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",