@jsenv/navi 0.29.474 → 0.29.476

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.
@@ -22598,6 +22598,10 @@ const DROP_CONTAINER_ATTRIBUTE = "data-drop-container";
22598
22598
  // every outcome — a list runs one way, and something being put somewhere goes
22599
22599
  // wherever it is put.
22600
22600
  const AXIS_ATTRIBUTE = "data-drag-axis";
22601
+ // How the items of a reordered list are laid out: "column", "row", or "wrap" for
22602
+ // side by side over several lines. Said nothing, it is read from where the
22603
+ // items stand.
22604
+ const FLOW_ATTRIBUTE = "data-reorder-flow";
22601
22605
  const DELAY_ATTRIBUTE = "data-drag-delay";
22602
22606
  const SLOP_ATTRIBUTE = "data-drag-slop";
22603
22607
  const THRESHOLD_ATTRIBUTE$1 = "data-drag-threshold";
@@ -22650,14 +22654,24 @@ defineInteractionDetector({
22650
22654
  const tellsWhenRefused = types.includes(REFUSE);
22651
22655
  // Read at setup rather than at the press: a container can say it, and it is
22652
22656
  // what the gesture is about rather than something it discovers.
22657
+ const itemFlow =
22658
+ element.closest(`[${FLOW_ATTRIBUTE}]`)?.getAttribute(FLOW_ATTRIBUTE) ||
22659
+ undefined;
22653
22660
  const axisHolder = element.closest(`[${AXIS_ATTRIBUTE}]`);
22654
22661
  const axes =
22655
22662
  axisHolder?.getAttribute(AXIS_ATTRIBUTE) ||
22656
- // A list runs one way, and reordering walks it. Anything else goes wherever
22657
- // the hand takes it: a board has places all around, a thing put somewhere has
22658
- // two axes to be put along, a throw goes where it was thrown and a thing
22659
- // that leaves goes out by whichever edge.
22660
- (canReorder && !canLand && !canToss && !canLeave ? "y" : "xy");
22663
+ // A list runs one way, and reordering walks it: down a column, along a
22664
+ // row, and both for a row that wraps — its copy changes line. Anything
22665
+ // else goes wherever the hand takes it: a board has places all around, a
22666
+ // thing put somewhere has two axes to be put along, a throw goes where it
22667
+ // was thrown and a thing that leaves goes out by whichever edge.
22668
+ (canReorder && !canLand && !canToss && !canLeave
22669
+ ? itemFlow === "row"
22670
+ ? "x"
22671
+ : itemFlow === "wrap"
22672
+ ? "xy"
22673
+ : "y"
22674
+ : "xy");
22661
22675
  // Where the places are, read at setup for the same reason as the axes: they
22662
22676
  // are what the gesture is about, and it is what holds the two sides of it
22663
22677
  // that says them.
@@ -22716,6 +22730,7 @@ defineInteractionDetector({
22716
22730
  : undefined,
22717
22731
  containerElement: dropContainer || undefined,
22718
22732
  outsideOf,
22733
+ itemFlow,
22719
22734
  getItemId: (itemElement) => itemElement.id,
22720
22735
  direction: { x: axes.includes("x"), y: axes.includes("y") },
22721
22736
  // Where it may go, said in the DOM. A thing that is put somewhere stays
@@ -77521,6 +77536,7 @@ const useListScrollSync = ({
77521
77536
  useDuplicateHeaderWarning();
77522
77537
  useStuckWindowWarning({
77523
77538
  ref,
77539
+ getListEl,
77524
77540
  scrollerElResolved,
77525
77541
  renderWindowRef,
77526
77542
  windowLeavesItemsOut,
@@ -79045,6 +79061,7 @@ const readItemsPerLine = listEl => {
79045
79061
  // instead of scrolling — and there is no event missing to notice it by.
79046
79062
  const useStuckWindowWarning = ({
79047
79063
  ref,
79064
+ getListEl,
79048
79065
  scrollerElResolved,
79049
79066
  renderWindowRef,
79050
79067
  windowLeavesItemsOut,
@@ -79590,28 +79607,40 @@ const findItemElementAt = (listEl, index) => {
79590
79607
  }
79591
79608
  return null;
79592
79609
  };
79593
- // What the render window is placed and sized on (see evaluateWindow), along
79594
- // the scroll axis and in viewport coordinates: the size of the screen, the part
79595
- // of the list on it (the band), and the items drawn, in the order they stand.
79596
- // The screen is the viewport of the box that scrolls the list — what "150%"
79597
- // is a percentage of. A box that does not scroll — a list given no height, as
79598
- // tall as its items — shows no more of them than the browser does: its
79599
- // viewport is cut by the browser's, or a budget in % would draw items to fill
79600
- // a screen they make grow. A list off screen is met at its edge nearest to the
79601
- // screen, where it comes in.
79602
- const readWindowGeometry = (scrollerEl, listEl, horizontal) => {
79610
+ // The screen the render window is framed on, along the scroll axis and in
79611
+ // viewport coordinates: the viewport of the box that scrolls the list — what
79612
+ // "150%" is a percentage of. A box that does not scroll — a list given no
79613
+ // height, as tall as its items — shows no more of them than the browser does:
79614
+ // its viewport is cut by the browser's, or a budget in % would draw items to
79615
+ // fill a screen they make grow.
79616
+ const readWindowScreen = (scrollerEl, horizontal) => {
79603
79617
  const scrollerRect = getScrollerViewportRect(scrollerEl);
79604
- let screenFrom = horizontal ? scrollerRect.left : scrollerRect.top;
79605
- let screenTo = horizontal ? scrollerRect.right : scrollerRect.bottom;
79618
+ let from = horizontal ? scrollerRect.left : scrollerRect.top;
79619
+ let to = horizontal ? scrollerRect.right : scrollerRect.bottom;
79606
79620
  if (!canScrollerScroll(scrollerEl, horizontal ? "x" : "y")) {
79607
79621
  const browserSize = horizontal ? document.documentElement.clientWidth : document.documentElement.clientHeight;
79608
- if (screenFrom < 0) {
79609
- screenFrom = 0;
79622
+ if (from < 0) {
79623
+ from = 0;
79610
79624
  }
79611
- if (screenTo > browserSize) {
79612
- screenTo = browserSize;
79625
+ if (to > browserSize) {
79626
+ to = browserSize;
79613
79627
  }
79614
79628
  }
79629
+ return {
79630
+ from,
79631
+ to
79632
+ };
79633
+ };
79634
+ // What the render window is placed and sized on (see evaluateWindow), along
79635
+ // the scroll axis and in viewport coordinates: the size of the screen (see
79636
+ // readWindowScreen), the part of the list on it (the band), and the items
79637
+ // drawn, in the order they stand. A list off screen is met at its edge nearest
79638
+ // to the screen, where it comes in.
79639
+ const readWindowGeometry = (scrollerEl, listEl, horizontal) => {
79640
+ const {
79641
+ from: screenFrom,
79642
+ to: screenTo
79643
+ } = readWindowScreen(scrollerEl, horizontal);
79615
79644
  const screenSize = screenTo - screenFrom;
79616
79645
  if (screenSize < 1) {
79617
79646
  return null;