@jsenv/navi 0.18.27 → 0.18.29

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.
@@ -12512,6 +12512,8 @@ const RootElement = () => {
12512
12512
  };
12513
12513
  const SlotContext = createContext(null);
12514
12514
  const RouteInfoContext = createContext(null);
12515
+ const UpdateOnlyContext = createContext(false);
12516
+ const elementSignals = new WeakMap();
12515
12517
  const Routes = ({
12516
12518
  element = jsx(RootElement, {}),
12517
12519
  children
@@ -12538,7 +12540,28 @@ const Route = ({
12538
12540
  const forceRender = useForceRender();
12539
12541
  const hasDiscoveredRef = useRef(false);
12540
12542
  const matchingInfoRef = useRef(null);
12543
+ const isUpdateOnly = useContext(UpdateOnlyContext);
12544
+
12545
+ // Update the element signal for this route.
12546
+ // In update-only mode this is the only purpose of rendering this Route.
12547
+ if (route && elementSignals.has(route)) {
12548
+ elementSignals.get(route).value = element;
12549
+ }
12550
+ if (isUpdateOnly) {
12551
+ if (children) {
12552
+ return jsx(UpdateOnlyContext.Provider, {
12553
+ value: true,
12554
+ children: children
12555
+ });
12556
+ }
12557
+ return null;
12558
+ }
12541
12559
  if (!hasDiscoveredRef.current) {
12560
+ // Create the element signal during discovery
12561
+ if (route && !elementSignals.has(route)) {
12562
+ // eslint-disable-next-line signals/no-signal-in-component-body
12563
+ elementSignals.set(route, signal(element));
12564
+ }
12542
12565
  return jsx(RouteMatchManager, {
12543
12566
  element: element,
12544
12567
  action: action,
@@ -12562,7 +12585,14 @@ const Route = ({
12562
12585
  const {
12563
12586
  MatchingElement
12564
12587
  } = matchingInfo;
12565
- return jsx(MatchingElement, {});
12588
+ // After discovery: render MatchingElement for visible output, and keep
12589
+ // children alive in update-only mode so their element signals stay current.
12590
+ return jsxs(Fragment, {
12591
+ children: [jsx(MatchingElement, {}), children ? jsx(UpdateOnlyContext.Provider, {
12592
+ value: true,
12593
+ children: children
12594
+ }) : null]
12595
+ });
12566
12596
  };
12567
12597
  const RegisterChildRouteContext = createContext(null);
12568
12598
 
@@ -12725,18 +12755,23 @@ const initRouteObserver = ({
12725
12755
  const matchingRouteInfoSignal = signal();
12726
12756
  const SlotMatchingElementSignal = signal();
12727
12757
  const MatchingElement = () => {
12758
+ // Read element from the signal (updated by update-only renders) when
12759
+ // available, falling back to the closure variable for routes without
12760
+ // a route prop (e.g. the Routes wrapper).
12761
+ const elementSignal = route ? elementSignals.get(route) : undefined;
12762
+ const currentElement = elementSignal ? elementSignal.value : element;
12728
12763
  const matchingRouteInfo = matchingRouteInfoSignal.value;
12729
12764
  useUITransitionContentId(matchingRouteInfo ? matchingRouteInfo.route.urlPattern : fallback ? "fallback" : undefined);
12730
12765
  const SlotMatchingElement = SlotMatchingElementSignal.value;
12731
- element = action ? jsx(ActionRenderer, {
12766
+ const renderedElement = action ? jsx(ActionRenderer, {
12732
12767
  action: action,
12733
- children: element
12734
- }) : element;
12768
+ children: currentElement
12769
+ }) : currentElement;
12735
12770
  return jsx(RouteInfoContext.Provider, {
12736
12771
  value: matchingRouteInfo,
12737
12772
  children: jsx(SlotContext.Provider, {
12738
12773
  value: SlotMatchingElement,
12739
- children: element
12774
+ children: renderedElement
12740
12775
  })
12741
12776
  });
12742
12777
  };
@@ -29081,17 +29116,15 @@ const Address = ({
29081
29116
  });
29082
29117
  };
29083
29118
 
29084
- const LoadingDots = ({
29085
- color = "FF156D"
29086
- }) => {
29119
+ const LoadingDots = () => {
29087
29120
  return jsxs("svg", {
29088
29121
  viewBox: "0 0 200 200",
29089
29122
  width: "100%",
29090
29123
  height: "100%",
29091
29124
  xmlns: "http://www.w3.org/2000/svg",
29092
29125
  children: [jsx("rect", {
29093
- fill: color,
29094
- stroke: color,
29126
+ fill: "currentColor",
29127
+ stroke: "currentColor",
29095
29128
  "stroke-width": "15",
29096
29129
  width: "30",
29097
29130
  height: "30",
@@ -29107,8 +29140,8 @@ const LoadingDots = ({
29107
29140
  begin: "-.4"
29108
29141
  })
29109
29142
  }), jsx("rect", {
29110
- fill: color,
29111
- stroke: color,
29143
+ fill: "currentColor",
29144
+ stroke: "currentColor",
29112
29145
  "stroke-width": "15",
29113
29146
  width: "30",
29114
29147
  height: "30",
@@ -29124,8 +29157,8 @@ const LoadingDots = ({
29124
29157
  begin: "-.2"
29125
29158
  })
29126
29159
  }), jsx("rect", {
29127
- fill: color,
29128
- stroke: color,
29160
+ fill: "currentColor",
29161
+ stroke: "currentColor",
29129
29162
  "stroke-width": "15",
29130
29163
  width: "30",
29131
29164
  height: "30",
@@ -30133,6 +30166,7 @@ const Meter = ({
30133
30166
  let children = caption;
30134
30167
  if (children === undefined && percentage) {
30135
30168
  children = jsx(Quantity, {
30169
+ loading: loading,
30136
30170
  unit: "%",
30137
30171
  unitSizeRatio: "1",
30138
30172
  unitColor: "inherit",