@jsenv/navi 0.12.28 → 0.12.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.
- package/dist/jsenv_navi.js +29 -8
- package/dist/jsenv_navi.js.map +13 -11
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -7704,6 +7704,10 @@ const createRoute = (urlPatternInput) => {
|
|
|
7704
7704
|
wildcardIndex++;
|
|
7705
7705
|
return replacement;
|
|
7706
7706
|
});
|
|
7707
|
+
// we did not replace anything, or not enough to remove the last "*"
|
|
7708
|
+
if (relativeUrl.endsWith("*")) {
|
|
7709
|
+
relativeUrl = relativeUrl.slice(0, -1);
|
|
7710
|
+
}
|
|
7707
7711
|
}
|
|
7708
7712
|
|
|
7709
7713
|
// Add remaining parameters as search params
|
|
@@ -9712,20 +9716,26 @@ const useForceRender = () => {
|
|
|
9712
9716
|
*
|
|
9713
9717
|
*/
|
|
9714
9718
|
|
|
9719
|
+
const debug$1 = (...args) => {
|
|
9720
|
+
return;
|
|
9721
|
+
};
|
|
9715
9722
|
const RootElement = () => {
|
|
9716
9723
|
return jsx(Route.Slot, {});
|
|
9717
9724
|
};
|
|
9725
|
+
const SlotContext = createContext(null);
|
|
9726
|
+
const RouteInfoContext = createContext(null);
|
|
9718
9727
|
const Routes = ({
|
|
9719
9728
|
element = RootElement,
|
|
9720
9729
|
children
|
|
9721
9730
|
}) => {
|
|
9722
|
-
return jsx(
|
|
9723
|
-
|
|
9724
|
-
children:
|
|
9731
|
+
return jsx(SlotContext.Provider, {
|
|
9732
|
+
value: null,
|
|
9733
|
+
children: jsx(Route, {
|
|
9734
|
+
element: element,
|
|
9735
|
+
children: children
|
|
9736
|
+
})
|
|
9725
9737
|
});
|
|
9726
9738
|
};
|
|
9727
|
-
const SlotContext = createContext(null);
|
|
9728
|
-
const RouteInfoContext = createContext(null);
|
|
9729
9739
|
const useActiveRouteInfo = () => useContext(RouteInfoContext);
|
|
9730
9740
|
const Route = ({
|
|
9731
9741
|
element,
|
|
@@ -9813,8 +9823,12 @@ const initRouteObserver = ({
|
|
|
9813
9823
|
onActiveInfoChange,
|
|
9814
9824
|
registerChildRouteFromContext
|
|
9815
9825
|
}) => {
|
|
9816
|
-
getElementSignature(element);
|
|
9817
|
-
const candidateElementIds = Array.from(candidateSet, c => getElementSignature(c.ActiveElement))
|
|
9826
|
+
const elementId = getElementSignature(element);
|
|
9827
|
+
const candidateElementIds = Array.from(candidateSet, c => getElementSignature(c.ActiveElement));
|
|
9828
|
+
if (candidateElementIds.length === 0) ; else {
|
|
9829
|
+
debug$1(`initRouteObserver ${elementId}, child candidates:
|
|
9830
|
+
- ${candidateElementIds.join("\n - ")}`);
|
|
9831
|
+
}
|
|
9818
9832
|
const [publishCompositeStatus, subscribeCompositeStatus] = createPubSub();
|
|
9819
9833
|
const compositeRoute = {
|
|
9820
9834
|
urlPattern: `composite(${candidateElementIds})`,
|
|
@@ -9919,11 +9933,14 @@ const initRouteObserver = ({
|
|
|
9919
9933
|
};
|
|
9920
9934
|
const RouteSlot = () => {
|
|
9921
9935
|
const SlotElement = useContext(SlotContext);
|
|
9922
|
-
if (
|
|
9936
|
+
if (SlotElement === undefined) {
|
|
9923
9937
|
return jsx("p", {
|
|
9924
9938
|
children: "RouteSlot must be used inside a Route"
|
|
9925
9939
|
});
|
|
9926
9940
|
}
|
|
9941
|
+
if (SlotElement === null) {
|
|
9942
|
+
return null;
|
|
9943
|
+
}
|
|
9927
9944
|
return jsx(SlotElement, {});
|
|
9928
9945
|
};
|
|
9929
9946
|
Route.Slot = RouteSlot;
|
|
@@ -11043,6 +11060,10 @@ const initPseudoStyles = (
|
|
|
11043
11060
|
const currentState = {};
|
|
11044
11061
|
for (const pseudoClass of pseudoClasses) {
|
|
11045
11062
|
const pseudoClassDefinition = PSEUDO_CLASSES[pseudoClass];
|
|
11063
|
+
if (!pseudoClassDefinition) {
|
|
11064
|
+
console.warn(`Unknown pseudo class: ${pseudoClass}`);
|
|
11065
|
+
continue;
|
|
11066
|
+
}
|
|
11046
11067
|
let currentValue;
|
|
11047
11068
|
if (
|
|
11048
11069
|
pseudoState &&
|