@jsenv/navi 0.15.5 → 0.15.7
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.
- package/dist/jsenv_navi.js +149 -107
- package/dist/jsenv_navi.js.map +28 -27
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -7194,7 +7194,11 @@ const UITransition = ({
|
|
|
7194
7194
|
};
|
|
7195
7195
|
const update = (part, newPart) => {
|
|
7196
7196
|
if (!set.has(part)) {
|
|
7197
|
-
|
|
7197
|
+
if (set.size === 0) {
|
|
7198
|
+
console.warn(`UITransition: content id update "${part}" -> "${newPart}" ignored because content id set is empty`);
|
|
7199
|
+
return;
|
|
7200
|
+
}
|
|
7201
|
+
console.warn(`UITransition: content id update "${part}" -> "${newPart}" ignored because content id not found in set, only got [${Array.from(set).join(", ")}]`);
|
|
7198
7202
|
return;
|
|
7199
7203
|
}
|
|
7200
7204
|
set.delete(part);
|
|
@@ -7640,9 +7644,9 @@ if (typeof window === "undefined") {
|
|
|
7640
7644
|
const setBaseUrl = (value) => {
|
|
7641
7645
|
baseUrl = new URL(value, window.location).href;
|
|
7642
7646
|
};
|
|
7643
|
-
// Controls what happens to actions when their route
|
|
7644
|
-
// 'abort' - Cancel the action immediately when route
|
|
7645
|
-
// 'keep-loading' - Allow action to continue running after route
|
|
7647
|
+
// Controls what happens to actions when their route stops matching:
|
|
7648
|
+
// 'abort' - Cancel the action immediately when route stops matching
|
|
7649
|
+
// 'keep-loading' - Allow action to continue running after route stops matching
|
|
7646
7650
|
//
|
|
7647
7651
|
// The 'keep-loading' strategy could act like preloading, keeping data ready for potential return.
|
|
7648
7652
|
// However, since route reactivation triggers action reload anyway, the old data won't be used
|
|
@@ -7669,13 +7673,31 @@ const updateRoutes = (
|
|
|
7669
7673
|
|
|
7670
7674
|
// Get previous state
|
|
7671
7675
|
const previousState = routePreviousStateMap.get(route) || {
|
|
7672
|
-
|
|
7676
|
+
matching: false,
|
|
7677
|
+
exactMatching: false,
|
|
7673
7678
|
params: null,
|
|
7674
7679
|
};
|
|
7675
|
-
const
|
|
7680
|
+
const oldMatching = previousState.matching;
|
|
7681
|
+
const oldExactMatching = previousState.exactMatching;
|
|
7676
7682
|
const oldParams = previousState.params;
|
|
7677
7683
|
const extractedParams = routePattern.applyOn(url);
|
|
7678
|
-
const
|
|
7684
|
+
const newMatching = Boolean(extractedParams);
|
|
7685
|
+
|
|
7686
|
+
// Calculate exact matching - true when matching but no wildcards have content
|
|
7687
|
+
let newExactMatching = false;
|
|
7688
|
+
if (newMatching && extractedParams) {
|
|
7689
|
+
// Check if any wildcard parameters (numeric keys) have meaningful content
|
|
7690
|
+
const hasWildcardContent = Object.keys(extractedParams).some((key) => {
|
|
7691
|
+
const keyAsNumber = parseInt(key, 10);
|
|
7692
|
+
if (!isNaN(keyAsNumber)) {
|
|
7693
|
+
// This is a wildcard parameter (numeric key)
|
|
7694
|
+
const value = extractedParams[key];
|
|
7695
|
+
return value && value.trim() !== "";
|
|
7696
|
+
}
|
|
7697
|
+
return false;
|
|
7698
|
+
});
|
|
7699
|
+
newExactMatching = !hasWildcardContent;
|
|
7700
|
+
}
|
|
7679
7701
|
let newParams;
|
|
7680
7702
|
if (extractedParams) {
|
|
7681
7703
|
if (compareTwoJsValues(oldParams, extractedParams)) {
|
|
@@ -7691,37 +7713,42 @@ const updateRoutes = (
|
|
|
7691
7713
|
const routeMatchInfo = {
|
|
7692
7714
|
route,
|
|
7693
7715
|
routePrivateProperties,
|
|
7694
|
-
|
|
7695
|
-
|
|
7716
|
+
oldMatching,
|
|
7717
|
+
newMatching,
|
|
7718
|
+
oldExactMatching,
|
|
7719
|
+
newExactMatching,
|
|
7696
7720
|
oldParams,
|
|
7697
7721
|
newParams,
|
|
7698
7722
|
};
|
|
7699
7723
|
routeMatchInfoSet.add(routeMatchInfo);
|
|
7700
7724
|
// Store current state for next comparison
|
|
7701
7725
|
routePreviousStateMap.set(route, {
|
|
7702
|
-
|
|
7726
|
+
matching: newMatching,
|
|
7727
|
+
exactMatching: newExactMatching,
|
|
7703
7728
|
params: newParams,
|
|
7704
7729
|
});
|
|
7705
7730
|
}
|
|
7706
7731
|
|
|
7707
7732
|
// Apply all signal updates in a batch
|
|
7708
|
-
const
|
|
7733
|
+
const matchingRouteSet = new Set();
|
|
7709
7734
|
batch(() => {
|
|
7710
7735
|
for (const {
|
|
7711
7736
|
route,
|
|
7712
7737
|
routePrivateProperties,
|
|
7713
|
-
|
|
7738
|
+
newMatching,
|
|
7739
|
+
newExactMatching,
|
|
7714
7740
|
newParams,
|
|
7715
7741
|
} of routeMatchInfoSet) {
|
|
7716
7742
|
const { updateStatus } = routePrivateProperties;
|
|
7717
7743
|
const visited = isVisited(route.url);
|
|
7718
7744
|
updateStatus({
|
|
7719
|
-
|
|
7745
|
+
matching: newMatching,
|
|
7746
|
+
exactMatching: newExactMatching,
|
|
7720
7747
|
params: newParams,
|
|
7721
7748
|
visited,
|
|
7722
7749
|
});
|
|
7723
|
-
if (
|
|
7724
|
-
|
|
7750
|
+
if (newMatching) {
|
|
7751
|
+
matchingRouteSet.add(route);
|
|
7725
7752
|
}
|
|
7726
7753
|
}
|
|
7727
7754
|
});
|
|
@@ -7773,8 +7800,8 @@ const updateRoutes = (
|
|
|
7773
7800
|
for (const {
|
|
7774
7801
|
route,
|
|
7775
7802
|
routePrivateProperties,
|
|
7776
|
-
|
|
7777
|
-
|
|
7803
|
+
newMatching,
|
|
7804
|
+
oldMatching,
|
|
7778
7805
|
newParams,
|
|
7779
7806
|
oldParams,
|
|
7780
7807
|
} of routeMatchInfoSet) {
|
|
@@ -7783,25 +7810,25 @@ const updateRoutes = (
|
|
|
7783
7810
|
continue;
|
|
7784
7811
|
}
|
|
7785
7812
|
|
|
7786
|
-
const
|
|
7787
|
-
const
|
|
7788
|
-
const
|
|
7789
|
-
|
|
7813
|
+
const becomesMatching = newMatching && !oldMatching;
|
|
7814
|
+
const becomesNotMatching = !newMatching && oldMatching;
|
|
7815
|
+
const paramsChangedWhileMatching =
|
|
7816
|
+
newMatching && oldMatching && newParams !== oldParams;
|
|
7790
7817
|
|
|
7791
|
-
// Handle actions for routes that become
|
|
7792
|
-
if (
|
|
7818
|
+
// Handle actions for routes that become matching
|
|
7819
|
+
if (becomesMatching) {
|
|
7793
7820
|
shouldLoad(route);
|
|
7794
7821
|
continue;
|
|
7795
7822
|
}
|
|
7796
7823
|
|
|
7797
|
-
// Handle actions for routes that become
|
|
7798
|
-
if (
|
|
7824
|
+
// Handle actions for routes that become not matching - abort them
|
|
7825
|
+
if (becomesNotMatching && ROUTE_DEACTIVATION_STRATEGY === "abort") {
|
|
7799
7826
|
shouldAbort(route);
|
|
7800
7827
|
continue;
|
|
7801
7828
|
}
|
|
7802
7829
|
|
|
7803
|
-
// Handle parameter changes while route stays
|
|
7804
|
-
if (
|
|
7830
|
+
// Handle parameter changes while route stays matching
|
|
7831
|
+
if (paramsChangedWhileMatching) {
|
|
7805
7832
|
shouldReload(route);
|
|
7806
7833
|
}
|
|
7807
7834
|
}
|
|
@@ -7811,7 +7838,7 @@ const updateRoutes = (
|
|
|
7811
7838
|
reloadSet: toReloadSet,
|
|
7812
7839
|
abortSignalMap,
|
|
7813
7840
|
routeLoadRequestedMap,
|
|
7814
|
-
|
|
7841
|
+
matchingRouteSet,
|
|
7815
7842
|
};
|
|
7816
7843
|
};
|
|
7817
7844
|
|
|
@@ -7833,7 +7860,8 @@ const createRoute = (urlPatternInput) => {
|
|
|
7833
7860
|
const route = {
|
|
7834
7861
|
urlPattern: urlPatternInput,
|
|
7835
7862
|
isRoute: true,
|
|
7836
|
-
|
|
7863
|
+
matching: false,
|
|
7864
|
+
exactMatching: false,
|
|
7837
7865
|
params: null,
|
|
7838
7866
|
buildUrl: null,
|
|
7839
7867
|
bindAction: null,
|
|
@@ -7851,18 +7879,24 @@ const createRoute = (urlPatternInput) => {
|
|
|
7851
7879
|
|
|
7852
7880
|
const routePrivateProperties = {
|
|
7853
7881
|
routePattern: null,
|
|
7854
|
-
|
|
7882
|
+
matchingSignal: null,
|
|
7883
|
+
exactMatchingSignal: null,
|
|
7855
7884
|
paramsSignal: null,
|
|
7856
7885
|
visitedSignal: null,
|
|
7857
7886
|
relativeUrlSignal: null,
|
|
7858
7887
|
urlSignal: null,
|
|
7859
|
-
updateStatus: ({
|
|
7888
|
+
updateStatus: ({ matching, exactMatching, params, visited }) => {
|
|
7860
7889
|
let someChange = false;
|
|
7861
|
-
|
|
7890
|
+
matchingSignal.value = matching;
|
|
7891
|
+
exactMatchingSignal.value = exactMatching;
|
|
7862
7892
|
paramsSignal.value = params;
|
|
7863
7893
|
visitedSignal.value = visited;
|
|
7864
|
-
if (route.
|
|
7865
|
-
route.
|
|
7894
|
+
if (route.matching !== matching) {
|
|
7895
|
+
route.matching = matching;
|
|
7896
|
+
someChange = true;
|
|
7897
|
+
}
|
|
7898
|
+
if (route.exactMatching !== exactMatching) {
|
|
7899
|
+
route.exactMatching = exactMatching;
|
|
7866
7900
|
someChange = true;
|
|
7867
7901
|
}
|
|
7868
7902
|
if (route.params !== params) {
|
|
@@ -7874,7 +7908,7 @@ const createRoute = (urlPatternInput) => {
|
|
|
7874
7908
|
someChange = true;
|
|
7875
7909
|
}
|
|
7876
7910
|
if (someChange) {
|
|
7877
|
-
publishStatus({
|
|
7911
|
+
publishStatus({ matching, exactMatching, params, visited });
|
|
7878
7912
|
}
|
|
7879
7913
|
},
|
|
7880
7914
|
};
|
|
@@ -7948,7 +7982,8 @@ const createRoute = (urlPatternInput) => {
|
|
|
7948
7982
|
};
|
|
7949
7983
|
route.buildUrl = buildUrl;
|
|
7950
7984
|
|
|
7951
|
-
const
|
|
7985
|
+
const matchingSignal = signal(false);
|
|
7986
|
+
const exactMatchingSignal = signal(false);
|
|
7952
7987
|
const paramsSignal = signal(null);
|
|
7953
7988
|
const visitedSignal = signal(false);
|
|
7954
7989
|
const relativeUrlSignal = computed(() => {
|
|
@@ -8054,7 +8089,8 @@ const createRoute = (urlPatternInput) => {
|
|
|
8054
8089
|
route.bindAction = bindAction;
|
|
8055
8090
|
|
|
8056
8091
|
{
|
|
8057
|
-
routePrivateProperties.
|
|
8092
|
+
routePrivateProperties.matchingSignal = matchingSignal;
|
|
8093
|
+
routePrivateProperties.exactMatchingSignal = exactMatchingSignal;
|
|
8058
8094
|
routePrivateProperties.paramsSignal = paramsSignal;
|
|
8059
8095
|
routePrivateProperties.visitedSignal = visitedSignal;
|
|
8060
8096
|
routePrivateProperties.relativeUrlSignal = relativeUrlSignal;
|
|
@@ -8072,17 +8108,24 @@ const useRouteStatus = (route) => {
|
|
|
8072
8108
|
throw new Error(`Cannot find route private properties for ${route}`);
|
|
8073
8109
|
}
|
|
8074
8110
|
|
|
8075
|
-
const {
|
|
8076
|
-
|
|
8111
|
+
const {
|
|
8112
|
+
urlSignal,
|
|
8113
|
+
matchingSignal,
|
|
8114
|
+
exactMatchingSignal,
|
|
8115
|
+
paramsSignal,
|
|
8116
|
+
visitedSignal,
|
|
8117
|
+
} = routePrivateProperties;
|
|
8077
8118
|
|
|
8078
8119
|
const url = urlSignal.value;
|
|
8079
|
-
const
|
|
8120
|
+
const matching = matchingSignal.value;
|
|
8121
|
+
const exactMatching = exactMatchingSignal.value;
|
|
8080
8122
|
const params = paramsSignal.value;
|
|
8081
8123
|
const visited = visitedSignal.value;
|
|
8082
8124
|
|
|
8083
8125
|
return {
|
|
8084
8126
|
url,
|
|
8085
|
-
|
|
8127
|
+
matching,
|
|
8128
|
+
exactMatching,
|
|
8086
8129
|
params,
|
|
8087
8130
|
visited,
|
|
8088
8131
|
};
|
|
@@ -8836,7 +8879,7 @@ const Routes = ({
|
|
|
8836
8879
|
element = RootElement,
|
|
8837
8880
|
children
|
|
8838
8881
|
}) => {
|
|
8839
|
-
const routeInfo =
|
|
8882
|
+
const routeInfo = useMatchingRouteInfo();
|
|
8840
8883
|
const route = routeInfo?.route;
|
|
8841
8884
|
return jsx(Route, {
|
|
8842
8885
|
route: route,
|
|
@@ -8844,7 +8887,7 @@ const Routes = ({
|
|
|
8844
8887
|
children: children
|
|
8845
8888
|
});
|
|
8846
8889
|
};
|
|
8847
|
-
const
|
|
8890
|
+
const useMatchingRouteInfo = () => useContext(RouteInfoContext);
|
|
8848
8891
|
const Route = ({
|
|
8849
8892
|
element,
|
|
8850
8893
|
route,
|
|
@@ -8855,43 +8898,43 @@ const Route = ({
|
|
|
8855
8898
|
}) => {
|
|
8856
8899
|
const forceRender = useForceRender();
|
|
8857
8900
|
const hasDiscoveredRef = useRef(false);
|
|
8858
|
-
const
|
|
8901
|
+
const matchingInfoRef = useRef(null);
|
|
8859
8902
|
if (!hasDiscoveredRef.current) {
|
|
8860
|
-
return jsx(
|
|
8903
|
+
return jsx(MatchingRouteManager, {
|
|
8861
8904
|
element: element,
|
|
8862
8905
|
route: route,
|
|
8863
8906
|
index: index,
|
|
8864
8907
|
fallback: fallback,
|
|
8865
8908
|
meta: meta,
|
|
8866
|
-
|
|
8909
|
+
onMatchingInfoChange: matchingInfo => {
|
|
8867
8910
|
hasDiscoveredRef.current = true;
|
|
8868
|
-
|
|
8911
|
+
matchingInfoRef.current = matchingInfo;
|
|
8869
8912
|
forceRender();
|
|
8870
8913
|
},
|
|
8871
8914
|
children: children
|
|
8872
8915
|
});
|
|
8873
8916
|
}
|
|
8874
|
-
const
|
|
8875
|
-
if (!
|
|
8917
|
+
const matchingInfo = matchingInfoRef.current;
|
|
8918
|
+
if (!matchingInfo) {
|
|
8876
8919
|
return null;
|
|
8877
8920
|
}
|
|
8878
8921
|
const {
|
|
8879
|
-
|
|
8880
|
-
} =
|
|
8881
|
-
return jsx(
|
|
8922
|
+
MatchingElement
|
|
8923
|
+
} = matchingInfo;
|
|
8924
|
+
return jsx(MatchingElement, {});
|
|
8882
8925
|
};
|
|
8883
8926
|
const RegisterChildRouteContext = createContext(null);
|
|
8884
8927
|
|
|
8885
8928
|
/* This component is ensure to be rendered once
|
|
8886
8929
|
So no need to cleanup things or whatever we know and ensure that
|
|
8887
|
-
it's executed once for the
|
|
8888
|
-
const
|
|
8930
|
+
it's executed once for the entire app lifecycle */
|
|
8931
|
+
const MatchingRouteManager = ({
|
|
8889
8932
|
element,
|
|
8890
8933
|
route,
|
|
8891
8934
|
index,
|
|
8892
8935
|
fallback,
|
|
8893
8936
|
meta,
|
|
8894
|
-
|
|
8937
|
+
onMatchingInfoChange,
|
|
8895
8938
|
children
|
|
8896
8939
|
}) => {
|
|
8897
8940
|
if (route && fallback) {
|
|
@@ -8935,7 +8978,7 @@ const ActiveRouteManager = ({
|
|
|
8935
8978
|
indexCandidate,
|
|
8936
8979
|
fallbackCandidate,
|
|
8937
8980
|
candidateSet,
|
|
8938
|
-
|
|
8981
|
+
onMatchingInfoChange,
|
|
8939
8982
|
registerChildRouteFromContext
|
|
8940
8983
|
});
|
|
8941
8984
|
}, []);
|
|
@@ -8953,7 +8996,7 @@ const initRouteObserver = ({
|
|
|
8953
8996
|
indexCandidate,
|
|
8954
8997
|
fallbackCandidate,
|
|
8955
8998
|
candidateSet,
|
|
8956
|
-
|
|
8999
|
+
onMatchingInfoChange,
|
|
8957
9000
|
registerChildRouteFromContext
|
|
8958
9001
|
}) => {
|
|
8959
9002
|
if (!fallbackCandidate && indexCandidate && indexCandidate.fallback !== false) {
|
|
@@ -8973,15 +9016,15 @@ const initRouteObserver = ({
|
|
|
8973
9016
|
const compositeRoute = {
|
|
8974
9017
|
urlPattern: `composite(${candidateElementIds})`,
|
|
8975
9018
|
isComposite: true,
|
|
8976
|
-
|
|
9019
|
+
matching: false,
|
|
8977
9020
|
subscribeStatus: subscribeCompositeStatus,
|
|
8978
9021
|
toString: () => `composite(${candidateSet.size} candidates)`,
|
|
8979
9022
|
routeFromProps: route,
|
|
8980
9023
|
elementFromProps: element
|
|
8981
9024
|
};
|
|
8982
|
-
const
|
|
9025
|
+
const findMatchingChildInfo = () => {
|
|
8983
9026
|
for (const candidate of candidateSet) {
|
|
8984
|
-
if (candidate.route?.
|
|
9027
|
+
if (candidate.route?.matching) {
|
|
8985
9028
|
return candidate;
|
|
8986
9029
|
}
|
|
8987
9030
|
}
|
|
@@ -9001,16 +9044,16 @@ const initRouteObserver = ({
|
|
|
9001
9044
|
}
|
|
9002
9045
|
return null;
|
|
9003
9046
|
};
|
|
9004
|
-
const
|
|
9005
|
-
if (!route.
|
|
9047
|
+
const getMatchingInfo = route ? () => {
|
|
9048
|
+
if (!route.matching) {
|
|
9006
9049
|
// we have a route and it does not match no need to go further
|
|
9007
9050
|
return null;
|
|
9008
9051
|
}
|
|
9009
|
-
// we have a route and it is
|
|
9010
|
-
// we search the first
|
|
9011
|
-
const
|
|
9012
|
-
if (
|
|
9013
|
-
return
|
|
9052
|
+
// we have a route and it is matching
|
|
9053
|
+
// we search the first matching child to put it in the slot
|
|
9054
|
+
const matchingChildInfo = findMatchingChildInfo();
|
|
9055
|
+
if (matchingChildInfo) {
|
|
9056
|
+
return matchingChildInfo;
|
|
9014
9057
|
}
|
|
9015
9058
|
return {
|
|
9016
9059
|
route,
|
|
@@ -9018,19 +9061,19 @@ const initRouteObserver = ({
|
|
|
9018
9061
|
meta
|
|
9019
9062
|
};
|
|
9020
9063
|
} : () => {
|
|
9021
|
-
// we don't have a route, do we have
|
|
9022
|
-
const
|
|
9023
|
-
if (
|
|
9024
|
-
return
|
|
9064
|
+
// we don't have a route, do we have a matching child?
|
|
9065
|
+
const matchingChildInfo = findMatchingChildInfo();
|
|
9066
|
+
if (matchingChildInfo) {
|
|
9067
|
+
return matchingChildInfo;
|
|
9025
9068
|
}
|
|
9026
9069
|
return null;
|
|
9027
9070
|
};
|
|
9028
|
-
const
|
|
9029
|
-
const
|
|
9030
|
-
const
|
|
9031
|
-
const
|
|
9032
|
-
useUITransitionContentId(
|
|
9033
|
-
const
|
|
9071
|
+
const matchingRouteInfoSignal = signal();
|
|
9072
|
+
const SlotMatchingElementSignal = signal();
|
|
9073
|
+
const MatchingElement = () => {
|
|
9074
|
+
const matchingRouteInfo = matchingRouteInfoSignal.value;
|
|
9075
|
+
useUITransitionContentId(matchingRouteInfo ? matchingRouteInfo.route.urlPattern : fallback ? "fallback" : undefined);
|
|
9076
|
+
const SlotMatchingElement = SlotMatchingElementSignal.value;
|
|
9034
9077
|
if (typeof element === "function") {
|
|
9035
9078
|
const Element = element;
|
|
9036
9079
|
element = jsx(Element, {});
|
|
@@ -9038,42 +9081,42 @@ const initRouteObserver = ({
|
|
|
9038
9081
|
// ensure we re-render on document url change (useful when navigating from /users/list to /users)
|
|
9039
9082
|
// so that we re-replace urls back to /users/list when /users/list is an index
|
|
9040
9083
|
useDocumentUrl();
|
|
9041
|
-
if (
|
|
9042
|
-
const routeUrl =
|
|
9084
|
+
if (matchingRouteInfo && matchingRouteInfo.index && !matchingRouteInfo.route.matching) {
|
|
9085
|
+
const routeUrl = matchingRouteInfo.route.routeFromProps.buildUrl();
|
|
9043
9086
|
replaceUrl(routeUrl);
|
|
9044
9087
|
}
|
|
9045
9088
|
return jsx(RouteInfoContext.Provider, {
|
|
9046
|
-
value:
|
|
9089
|
+
value: matchingRouteInfo,
|
|
9047
9090
|
children: jsx(SlotContext.Provider, {
|
|
9048
|
-
value:
|
|
9091
|
+
value: SlotMatchingElement,
|
|
9049
9092
|
children: element
|
|
9050
9093
|
})
|
|
9051
9094
|
});
|
|
9052
9095
|
};
|
|
9053
|
-
|
|
9054
|
-
const
|
|
9055
|
-
const
|
|
9056
|
-
if (
|
|
9057
|
-
compositeRoute.
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
route:
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
index:
|
|
9065
|
-
fallback:
|
|
9066
|
-
meta:
|
|
9096
|
+
MatchingElement.underlyingElementId = candidateSet.size === 0 ? `${getElementSignature(element)} without slot` : `[${getElementSignature(element)} with slot one of ${candidateElementIds}]`;
|
|
9097
|
+
const updateMatchingInfo = () => {
|
|
9098
|
+
const newMatchingInfo = getMatchingInfo();
|
|
9099
|
+
if (newMatchingInfo) {
|
|
9100
|
+
compositeRoute.matching = true;
|
|
9101
|
+
matchingRouteInfoSignal.value = newMatchingInfo;
|
|
9102
|
+
SlotMatchingElementSignal.value = newMatchingInfo.element;
|
|
9103
|
+
onMatchingInfoChange({
|
|
9104
|
+
route: newMatchingInfo.route,
|
|
9105
|
+
MatchingElement,
|
|
9106
|
+
SlotMatchingElement: newMatchingInfo.element,
|
|
9107
|
+
index: newMatchingInfo.index,
|
|
9108
|
+
fallback: newMatchingInfo.fallback,
|
|
9109
|
+
meta: newMatchingInfo.meta
|
|
9067
9110
|
});
|
|
9068
9111
|
} else {
|
|
9069
|
-
compositeRoute.
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9112
|
+
compositeRoute.matching = false;
|
|
9113
|
+
matchingRouteInfoSignal.value = null;
|
|
9114
|
+
SlotMatchingElementSignal.value = null;
|
|
9115
|
+
onMatchingInfoChange(null);
|
|
9073
9116
|
}
|
|
9074
9117
|
};
|
|
9075
9118
|
const onChange = () => {
|
|
9076
|
-
|
|
9119
|
+
updateMatchingInfo();
|
|
9077
9120
|
publishCompositeStatus();
|
|
9078
9121
|
};
|
|
9079
9122
|
if (route) {
|
|
@@ -9085,13 +9128,13 @@ const initRouteObserver = ({
|
|
|
9085
9128
|
if (registerChildRouteFromContext) {
|
|
9086
9129
|
registerChildRouteFromContext({
|
|
9087
9130
|
route: compositeRoute,
|
|
9088
|
-
element:
|
|
9131
|
+
element: MatchingElement,
|
|
9089
9132
|
index,
|
|
9090
9133
|
fallback,
|
|
9091
9134
|
meta
|
|
9092
9135
|
});
|
|
9093
9136
|
}
|
|
9094
|
-
|
|
9137
|
+
updateMatchingInfo();
|
|
9095
9138
|
return () => {
|
|
9096
9139
|
teardown();
|
|
9097
9140
|
};
|
|
@@ -17238,13 +17281,12 @@ const RouteLink = ({
|
|
|
17238
17281
|
}
|
|
17239
17282
|
const routeStatus = useRouteStatus(route);
|
|
17240
17283
|
const url = route.buildUrl(routeParams);
|
|
17241
|
-
const active = routeStatus.active;
|
|
17242
17284
|
const paramsAreMatching = route.matchesParams(routeParams);
|
|
17243
17285
|
return jsx(Link, {
|
|
17244
17286
|
...rest,
|
|
17245
17287
|
href: url,
|
|
17246
17288
|
pseudoState: {
|
|
17247
|
-
":-navi-href-current":
|
|
17289
|
+
":-navi-href-current": paramsAreMatching ? routeStatus.matching : routeStatus.exactMatching
|
|
17248
17290
|
},
|
|
17249
17291
|
children: children || route.buildRelativeUrl(routeParams)
|
|
17250
17292
|
});
|
|
@@ -17562,10 +17604,10 @@ const TabRoute = ({
|
|
|
17562
17604
|
...props
|
|
17563
17605
|
}) => {
|
|
17564
17606
|
const {
|
|
17565
|
-
|
|
17607
|
+
matching
|
|
17566
17608
|
} = useRouteStatus(route);
|
|
17567
17609
|
const paramsAreMatching = route.matchesParams(routeParams);
|
|
17568
|
-
const selected =
|
|
17610
|
+
const selected = matching && paramsAreMatching;
|
|
17569
17611
|
return jsx(TabBasic, {
|
|
17570
17612
|
selected: selected,
|
|
17571
17613
|
...props,
|
|
@@ -25456,5 +25498,5 @@ const UserSvg = () => jsx("svg", {
|
|
|
25456
25498
|
})
|
|
25457
25499
|
});
|
|
25458
25500
|
|
|
25459
|
-
export { ActionRenderer, ActiveKeyboardShortcuts, Address, BadgeCount, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, Checkbox, CheckboxList, Code, Col, Colgroup, ConstructionSvg, Details, DialogLayout, Editable, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Form, HeartSvg, HomeSvg, Icon, Image, Input, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, MessageBox, Paragraph, Radio, RadioList, Route, RouteLink, Routes, RowNumberCol, RowNumberTableCell, SINGLE_SPACE_CONSTRAINT, SVGMaskOverlay, SearchSvg, Select, SelectionContext, Separator, SettingsSvg, StarSvg, SummaryMarker, Svg, Tab, TabList, Table, TableCell, Tbody, Text, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, addCustomMessage, compareTwoJsValues, createAction, createAvailableConstraint, createRequestCanceller, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, forwardActionRequested, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, localStorageSignal, navBack, navForward, navTo, openCallout, rawUrlPart, reload, removeCustomMessage, requestAction, rerunActions, resource, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, updateActions, useActionData, useActionStatus,
|
|
25501
|
+
export { ActionRenderer, ActiveKeyboardShortcuts, Address, BadgeCount, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, Checkbox, CheckboxList, Code, Col, Colgroup, ConstructionSvg, Details, DialogLayout, Editable, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Form, HeartSvg, HomeSvg, Icon, Image, Input, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, MessageBox, Paragraph, Radio, RadioList, Route, RouteLink, Routes, RowNumberCol, RowNumberTableCell, SINGLE_SPACE_CONSTRAINT, SVGMaskOverlay, SearchSvg, Select, SelectionContext, Separator, SettingsSvg, StarSvg, SummaryMarker, Svg, Tab, TabList, Table, TableCell, Tbody, Text, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, addCustomMessage, compareTwoJsValues, createAction, createAvailableConstraint, createRequestCanceller, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, forwardActionRequested, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, localStorageSignal, navBack, navForward, navTo, openCallout, rawUrlPart, reload, removeCustomMessage, requestAction, rerunActions, resource, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, updateActions, useActionData, useActionStatus, useCalloutClose, useCellsAndColumns, useConstraintValidityState, useDependenciesDiff, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useMatchingRouteInfo, useNavState$1 as useNavState, useRouteStatus, useRunOnMount, useSelectableElement, useSelectionController, useSignalSync, useStateArray, useTitleLevel, useUrlSearchParam, valueInLocalStorage };
|
|
25460
25502
|
//# sourceMappingURL=jsenv_navi.js.map
|