@jsenv/navi 0.20.9 → 0.20.10

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.
@@ -9347,18 +9347,9 @@ const createRoutePattern = (pattern, { searchParams = {} } = {}) => {
9347
9347
  ([, value]) => value === literalValue,
9348
9348
  );
9349
9349
 
9350
- // Check if any signal in the current pattern tree can provide this literal
9351
- // We traverse ancestors and descendants to find signals that could provide the literal
9352
- const getAncestorSignals = (pattern) => {
9353
- const signals = [];
9354
- let current = pattern;
9355
- while (current) {
9356
- signals.push(...current.connections);
9357
- current = current.parent;
9358
- }
9359
- return signals;
9360
- };
9361
-
9350
+ // Check if any descendant signal can provide this literal
9351
+ // (ancestor signals are excluded since they operate on different path positions
9352
+ // that the current pattern has already "passed")
9362
9353
  const getDescendantSignals = (pattern) => {
9363
9354
  const signals = [...pattern.connections];
9364
9355
  for (const child of pattern.children) {
@@ -9367,12 +9358,9 @@ const createRoutePattern = (pattern, { searchParams = {} } = {}) => {
9367
9358
  return signals;
9368
9359
  };
9369
9360
 
9370
- const allRelevantSignals = [
9371
- ...getAncestorSignals(patternObject),
9372
- ...getDescendantSignals(patternObject),
9373
- ];
9361
+ const descendantSignals = getDescendantSignals(patternObject);
9374
9362
 
9375
- const systemCanProvide = allRelevantSignals.some((conn) => {
9363
+ const systemCanProvide = descendantSignals.some((conn) => {
9376
9364
  const signalValue = conn.signal.value;
9377
9365
  return signalValue === literalValue && conn.isCustomValue(signalValue);
9378
9366
  });
@@ -9956,8 +9944,12 @@ const createRoutePattern = (pattern, { searchParams = {} } = {}) => {
9956
9944
 
9957
9945
  const parentPatternObj = currentPatternObj.parent;
9958
9946
 
9959
- // Add parent's signal parameters
9947
+ // Add parent's signal parameters (query params only, not path params)
9948
+ // Path params from ancestors are structural path segments, not inheritable
9960
9949
  for (const connection of parentPatternObj.connections) {
9950
+ if (connection.paramType === "path") {
9951
+ continue;
9952
+ }
9961
9953
  const { paramName } = connection;
9962
9954
 
9963
9955
  // Skip if child route already handles this parameter
@@ -10934,7 +10926,12 @@ const createRoutePattern = (pattern, { searchParams = {} } = {}) => {
10934
10926
  // Traverse up the parent chain to inherit parameters
10935
10927
  while (currentParent) {
10936
10928
  // Check parent's signal connections for non-default values to inherit
10929
+ // Only inherit query (search) parameters, not path parameters
10930
+ // Path parameters are structural and correspond to specific path segments
10937
10931
  for (const parentConnection of currentParent.connections) {
10932
+ if (parentConnection.paramType === "path") {
10933
+ continue;
10934
+ }
10938
10935
  const { paramName } = parentConnection;
10939
10936
  if (paramName in finalParams) {
10940
10937
  continue; // Already have this parameter