@jsenv/navi 0.29.328 → 0.29.329
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/dev/jsenv_navi.js +31 -17
- package/dist/dev/jsenv_navi.js.map +4 -4
- package/dist/jsenv_navi.js +31 -17
- package/dist/jsenv_navi.js.map +4 -4
- package/package.json +1 -1
package/dist/dev/jsenv_navi.js
CHANGED
|
@@ -24224,10 +24224,16 @@ const createRoutePattern = (
|
|
|
24224
24224
|
// search params are updated. When buildMostPreciseUrl performs an ancestor
|
|
24225
24225
|
// optimisation (e.g. "/map/isochrone/compare" → "/map/isochrone") it is trusted
|
|
24226
24226
|
// as-is because the built pathname will differ from the route's own base pathname.
|
|
24227
|
-
//
|
|
24228
|
-
//
|
|
24229
|
-
//
|
|
24230
|
-
|
|
24227
|
+
// A weak param is never inherited from its signal by a url built for a link
|
|
24228
|
+
// (see readSignalForUrlBuild). A url amended in place is another matter: the
|
|
24229
|
+
// route is matching, so the signal IS this visit's state, kept in step with
|
|
24230
|
+
// the address by every routing pass — and what it holds is carried over, so
|
|
24231
|
+
// that changing another param does not end the visit this one qualifies.
|
|
24232
|
+
// Read from the signal, not from the url being amended: several signals
|
|
24233
|
+
// written in one batch flush one url write at a time, and the routing pass
|
|
24234
|
+
// of the first would take the others for gone — and reset them — if the url
|
|
24235
|
+
// it wrote did not already carry what they hold.
|
|
24236
|
+
const carryOverWeakParams = (params) => {
|
|
24231
24237
|
let paramsWithWeak = params;
|
|
24232
24238
|
for (const connection of connections) {
|
|
24233
24239
|
const { paramName } = connection;
|
|
@@ -24235,17 +24241,13 @@ const createRoutePattern = (
|
|
|
24235
24241
|
continue;
|
|
24236
24242
|
}
|
|
24237
24243
|
const currentValue = connection.signal.peek();
|
|
24238
|
-
if (currentValue
|
|
24239
|
-
continue;
|
|
24240
|
-
}
|
|
24241
|
-
const currentParams = applyOn(currentUrl);
|
|
24242
|
-
if (!currentParams || currentParams[paramName] === undefined) {
|
|
24244
|
+
if (connection.isDefaultValue(currentValue)) {
|
|
24243
24245
|
continue;
|
|
24244
24246
|
}
|
|
24245
24247
|
if (paramsWithWeak === params) {
|
|
24246
24248
|
paramsWithWeak = { ...params };
|
|
24247
24249
|
}
|
|
24248
|
-
paramsWithWeak[paramName] =
|
|
24250
|
+
paramsWithWeak[paramName] = currentValue;
|
|
24249
24251
|
}
|
|
24250
24252
|
return paramsWithWeak;
|
|
24251
24253
|
};
|
|
@@ -24281,7 +24283,7 @@ const createRoutePattern = (
|
|
|
24281
24283
|
};
|
|
24282
24284
|
|
|
24283
24285
|
const buildUrlPreservingPath = (currentUrl, params = {}) => {
|
|
24284
|
-
params = carryOverWeakParams(
|
|
24286
|
+
params = carryOverWeakParams(params);
|
|
24285
24287
|
if (currentUrl) {
|
|
24286
24288
|
params = carryOverPathParams(currentUrl, params);
|
|
24287
24289
|
}
|
|
@@ -36837,7 +36839,7 @@ const useUIStateController = (
|
|
|
36837
36839
|
// reach until that popup opens. Letting it block interaction would make
|
|
36838
36840
|
// a picker whose content is loading impossible to open at all.
|
|
36839
36841
|
getInteractionBlockingControls: () => [],
|
|
36840
|
-
onUIAction: (e, { skipCommand } = {}) => {
|
|
36842
|
+
onUIAction: (e, { skipCommand, skipBoundSignal } = {}) => {
|
|
36841
36843
|
if (controlType === "button" && controller.controlHostProps.name) {
|
|
36842
36844
|
const buttonName = controller.controlHostProps.name;
|
|
36843
36845
|
const parentController = controller.parentUIStateController;
|
|
@@ -36867,7 +36869,9 @@ const useUIStateController = (
|
|
|
36867
36869
|
}
|
|
36868
36870
|
// Trigger uiAction/command side effects without changing UI state.
|
|
36869
36871
|
const currentUIState = controller.uiState;
|
|
36870
|
-
|
|
36872
|
+
if (!skipBoundSignal) {
|
|
36873
|
+
writeBoundSignal(currentUIState);
|
|
36874
|
+
}
|
|
36871
36875
|
s.uiActionInternal?.(currentUIState, e);
|
|
36872
36876
|
if (s.uiAction) {
|
|
36873
36877
|
debugUIState(`calling uiAction for ${controlType}`, currentUIState);
|
|
@@ -37093,7 +37097,15 @@ const useUIStateController = (
|
|
|
37093
37097
|
// sync, but do NOT fire the command and do NOT notify the parent —
|
|
37094
37098
|
// both would cause an infinite loop when a parent cascades state
|
|
37095
37099
|
// down to its children (child command would re-trigger the cascade).
|
|
37096
|
-
|
|
37100
|
+
// A control following what it was given (state_prop_change) does
|
|
37101
|
+
// not write its bound signal either: the signal is what it
|
|
37102
|
+
// follows. The one write that would change it is an emptied
|
|
37103
|
+
// signal refilled with the suggestion the control fell back on —
|
|
37104
|
+
// a state the app just took back, put back by the control.
|
|
37105
|
+
controller.onUIAction(e, {
|
|
37106
|
+
skipCommand: true,
|
|
37107
|
+
skipBoundSignal: e.type === "state_prop_change",
|
|
37108
|
+
});
|
|
37097
37109
|
}
|
|
37098
37110
|
if (
|
|
37099
37111
|
e.type === "facade_propagate_up" ||
|
|
@@ -74985,8 +74997,11 @@ const Spin = ({
|
|
|
74985
74997
|
// elsewhere on the page — and the control follows it. A control seeded from a
|
|
74986
74998
|
// signal only writes back into it (see resolveInputProps), which is enough
|
|
74987
74999
|
// for a field one only ever types into and not for a value that is also moved
|
|
74988
|
-
// from outside.
|
|
74989
|
-
// the
|
|
75000
|
+
// from outside. A signal holding nothing is left alone: the control goes back
|
|
75001
|
+
// to the suggestion it started on by itself (see resolveValueState), and
|
|
75002
|
+
// asking it to reset would be an act of its own, written into the signal —
|
|
75003
|
+
// the signal could then never hold nothing while a spin is bound to it, and a
|
|
75004
|
+
// day the app took back would come back as today.
|
|
74990
75005
|
const signalValue = signalProp ? signalProp.value : undefined;
|
|
74991
75006
|
// The value as of the render this effect belongs to, and not one the closure
|
|
74992
75007
|
// captured a while ago: a step writes the signal, the signal brings us back
|
|
@@ -75000,7 +75015,6 @@ const Spin = ({
|
|
|
75000
75015
|
return;
|
|
75001
75016
|
}
|
|
75002
75017
|
if (signalValue === undefined) {
|
|
75003
|
-
dispatchRequestResetUIState(controlEl);
|
|
75004
75018
|
return;
|
|
75005
75019
|
}
|
|
75006
75020
|
if (signalValue !== valueRef.current) {
|