@jsenv/navi 0.29.500 → 0.29.502
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 +24 -10
- package/dist/dev/jsenv_navi.js.map +3 -3
- package/dist/jsenv_navi.js +24 -10
- package/dist/jsenv_navi.js.map +3 -3
- package/docs/drag_interactions.md +5 -1
- package/package.json +2 -2
package/dist/dev/jsenv_navi.js
CHANGED
|
@@ -9102,11 +9102,7 @@ const route = (pattern, options = {}) => {
|
|
|
9102
9102
|
);
|
|
9103
9103
|
}
|
|
9104
9104
|
// eslint-disable-next-line no-loop-func
|
|
9105
|
-
const
|
|
9106
|
-
const value = paramSignal.value;
|
|
9107
|
-
// Use peek() to avoid subscribing to URL-derived signals.
|
|
9108
|
-
// This effect should only re-run when the param signal changes,
|
|
9109
|
-
// not when the URL changes (which would create a cycle: signal→URL→signal).
|
|
9105
|
+
const writeValueInUrl = (value) => {
|
|
9110
9106
|
const rawParams = route.rawParamsSignal.peek();
|
|
9111
9107
|
const urlParamValue = rawParams[paramName];
|
|
9112
9108
|
const matching = route.matchingSignal.peek();
|
|
@@ -9181,6 +9177,14 @@ const route = (pattern, options = {}) => {
|
|
|
9181
9177
|
debounceUrl,
|
|
9182
9178
|
},
|
|
9183
9179
|
);
|
|
9180
|
+
};
|
|
9181
|
+
const cleanupSignalUrlEffect = effect(() => {
|
|
9182
|
+
const value = paramSignal.value;
|
|
9183
|
+
// Only the param signal re-runs this effect. Writing the url reads
|
|
9184
|
+
// more (the route's other params, to build it): subscribed to those,
|
|
9185
|
+
// the write is made again whenever one of them changes — a second
|
|
9186
|
+
// entry when the write pushes.
|
|
9187
|
+
untracked(() => writeValueInUrl(value));
|
|
9184
9188
|
});
|
|
9185
9189
|
cleanupSignalUrlEffectSet.add(cleanupSignalUrlEffect);
|
|
9186
9190
|
}
|
|
@@ -25667,6 +25671,10 @@ const DROP_CONTAINER_ATTRIBUTE = "data-drop-container";
|
|
|
25667
25671
|
// every outcome — a list runs one way, and something being put somewhere goes
|
|
25668
25672
|
// wherever it is put.
|
|
25669
25673
|
const AXIS_ATTRIBUTE = "data-drag-axis";
|
|
25674
|
+
// Which of those axes a press takes it by, when not all of them: a card pulled
|
|
25675
|
+
// up out of a strip that scrolls sideways, then carried both ways. Said nothing,
|
|
25676
|
+
// it is every axis the drag walks.
|
|
25677
|
+
const INTENT_AXIS_ATTRIBUTE = "data-drag-intent-axis";
|
|
25670
25678
|
// How the items of a reordered list are laid out: "column", "row", or "wrap" for
|
|
25671
25679
|
// side by side over several lines. Said nothing, it is read from where the
|
|
25672
25680
|
// items stand.
|
|
@@ -25818,6 +25826,10 @@ defineInteractionDetector({
|
|
|
25818
25826
|
? "xy"
|
|
25819
25827
|
: "y"
|
|
25820
25828
|
: "xy");
|
|
25829
|
+
const intentAxis =
|
|
25830
|
+
element
|
|
25831
|
+
.closest(`[${INTENT_AXIS_ATTRIBUTE}]`)
|
|
25832
|
+
?.getAttribute(INTENT_AXIS_ATTRIBUTE) || axes;
|
|
25821
25833
|
// Where the places are, read at setup for the same reason as the axes: they
|
|
25822
25834
|
// are what the gesture is about, and it is what holds the two sides of it
|
|
25823
25835
|
// that says them.
|
|
@@ -25837,11 +25849,13 @@ defineInteractionDetector({
|
|
|
25837
25849
|
if (canReorder) {
|
|
25838
25850
|
element.setAttribute(REORDERABLE_ATTRIBUTE, "");
|
|
25839
25851
|
}
|
|
25840
|
-
// What @jsenv/dom puts on a drag source: the axes
|
|
25841
|
-
// whoever else answers this press (a sheet pushed
|
|
25842
|
-
//
|
|
25843
|
-
//
|
|
25844
|
-
|
|
25852
|
+
// What @jsenv/dom puts on a drag source: the axes a press takes it by,
|
|
25853
|
+
// written in the DOM for whoever else answers this press (a sheet pushed
|
|
25854
|
+
// down to close it, a row of slides, a finger given back to the scroll), no
|
|
25855
|
+
// iOS callout, the touch left to the scroll until the press becomes a grab,
|
|
25856
|
+
// and the listener that lets the grab take it back. Once taken, the copy
|
|
25857
|
+
// walks `axes`.
|
|
25858
|
+
const unmarkDragSource = markDragSource(element, intentAxis);
|
|
25845
25859
|
|
|
25846
25860
|
// What a release can mean, which is not all of what was declared: "grab",
|
|
25847
25861
|
// "release" and "refuse" are moments, not outcomes, and "moving" is the carry
|