@plexui/vue 0.32.0 → 0.34.0

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.
@@ -1,3 +1,24 @@
1
+ /**
2
+ * The room on the side the popover did not take, from the room the popper gives its own side (which already holds
3
+ * the offset and the collision padding) and where the trigger stands in the viewport. With no trigger found it is
4
+ * zero, so the popover is capped to its own side as before.
5
+ */
6
+ function otherRoom(content, room) {
7
+ const trigger = content.id ? document.querySelector(`[aria-controls="${content.id}"]`) : null;
8
+ if (!trigger)
9
+ return 0;
10
+ const rect = trigger.getBoundingClientRect();
11
+ // The popper (Floating UI, fixed) measures the visual viewport, which a keyboard or a zoom makes shorter than the
12
+ // layout one, and in WebKit it moves the trigger's rect by the visual viewport's offset as it does
13
+ const view = window.visualViewport;
14
+ const top = view ? view.offsetTop : 0;
15
+ const height = view ? view.height : document.documentElement.clientHeight;
16
+ const webkit = typeof CSS !== "undefined" && typeof CSS.supports === "function" && CSS.supports("-webkit-backdrop-filter", "none");
17
+ const shift = view && webkit ? view.offsetTop : 0;
18
+ const above = rect.top + shift - top;
19
+ const below = top + height - (rect.bottom + shift);
20
+ return content.getAttribute("data-side") === "top" ? room - above + below : room - below + above;
21
+ }
1
22
  /**
2
23
  * On a phone the calendar keeps its whole height, so its popover flips to the side of the trigger with room
3
24
  * (Calendar.module.css). When neither side has room, it is capped to the room of the side it took and scrolls, so
@@ -30,7 +51,11 @@ export function watchCalendarFit(wrapper) {
30
51
  frame = requestAnimationFrame(check);
31
52
  return;
32
53
  }
33
- const squeezed = content.scrollHeight > room + 0.5;
54
+ // The cap goes on only when the other side has no room for the whole calendar either. On the side it took
55
+ // while it was shorter, it would otherwise make the grown calendar fit there and stop the popper's flip
56
+ // (console 15.11: a lower row of a sheet opened below and scrolled with 440px free above it).
57
+ const height = content.scrollHeight;
58
+ const squeezed = height > room + 0.5 && height > otherRoom(content, room) + 0.5;
34
59
  if (content.hasAttribute("data-calendar-squeezed") !== squeezed)
35
60
  content.toggleAttribute("data-calendar-squeezed", squeezed);
36
61
  };
@@ -1 +1 @@
1
- {"version":3,"file":"calendarFit.js","sourceRoot":"","sources":["../../../src/lib/calendarFit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAoB;IACnD,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,qBAAqB,KAAK,WAAW;QAAE,OAAO,GAAG,EAAE,GAAE,CAAC,CAAA;IAClG,IAAI,OAAO,GAAuB,IAAI,CAAA;IACtC,IAAI,SAAuC,CAAA;IAC3C,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,MAAM,KAAK,GAAG,GAAG,EAAE;QACjB,KAAK,GAAG,CAAC,CAAA;QACT,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,OAAO,CAAC,OAAO,CAAc,iBAAiB,CAAC,CAAA;YACzD,IAAI,OAAO,IAAI,OAAO,gBAAgB,KAAK,WAAW,EAAE,CAAC;gBACvD,SAAS,GAAG,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAA;gBAC1C,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,CAAC,CAAA;YAC3F,CAAC;QACH,CAAC;QACD,MAAM,IAAI,GAAG,OAAO;YAClB,CAAC,CAAC,UAAU,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,0CAA0C,CAAC,CAAC;YACpG,CAAC,CAAC,GAAG,CAAA;QACP,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;YACpD,IAAI,EAAE,KAAK,GAAG,EAAE;gBAAE,KAAK,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAA;YACtD,OAAM;QACR,CAAC;QACD,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,GAAG,GAAG,CAAA;QAClD,IAAI,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC,KAAK,QAAQ;YAAE,OAAO,CAAC,eAAe,CAAC,wBAAwB,EAAE,QAAQ,CAAC,CAAA;IAC9H,CAAC,CAAA;IACD,SAAS,QAAQ;QACf,KAAK,GAAG,CAAC,CAAA;QACT,IAAI,CAAC,KAAK;YAAE,KAAK,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAA;IAClD,CAAC;IACD,QAAQ,EAAE,CAAA;IACV,MAAM,OAAO,GAAG,OAAO,cAAc,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAChG,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;IACzB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC3C,OAAO,GAAG,EAAE;QACV,IAAI,KAAK;YAAE,oBAAoB,CAAC,KAAK,CAAC,CAAA;QACtC,OAAO,EAAE,UAAU,EAAE,CAAA;QACrB,SAAS,EAAE,UAAU,EAAE,CAAA;QACvB,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;QAC9C,OAAO,EAAE,eAAe,CAAC,wBAAwB,CAAC,CAAA;IACpD,CAAC,CAAA;AACH,CAAC","sourcesContent":["/**\n * On a phone the calendar keeps its whole height, so its popover flips to the side of the trigger with room\n * (Calendar.module.css). When neither side has room, it is capped to the room of the side it took and scrolls, so\n * every date and the time row stay reachable (Codex 15.11). The popover's scroll height is the calendar's own height\n * whether or not it is capped, so the check never feeds on its own result. The popover is looked up in a frame (a\n * Vue parent sets its role after its children mount) and watched for the room and side the popper writes on it as\n * the page scrolls. Returns the cleanup.\n */\nexport function watchCalendarFit(wrapper: HTMLElement): () => void {\n if (typeof window === \"undefined\" || typeof requestAnimationFrame === \"undefined\") return () => {}\n let content: HTMLElement | null = null\n let mutations: MutationObserver | undefined\n let frame = 0\n let tries = 0\n const check = () => {\n frame = 0\n if (!content) {\n content = wrapper.closest<HTMLElement>('[role=\"dialog\"]')\n if (content && typeof MutationObserver !== \"undefined\") {\n mutations = new MutationObserver(schedule)\n mutations.observe(content, { attributes: true, attributeFilter: [\"style\", \"data-side\"] })\n }\n }\n const room = content\n ? parseFloat(getComputedStyle(content).getPropertyValue(\"--radix-popover-content-available-height\"))\n : NaN\n if (!content || !Number.isFinite(room) || room <= 0) {\n if (++tries < 20) frame = requestAnimationFrame(check)\n return\n }\n const squeezed = content.scrollHeight > room + 0.5\n if (content.hasAttribute(\"data-calendar-squeezed\") !== squeezed) content.toggleAttribute(\"data-calendar-squeezed\", squeezed)\n }\n function schedule() {\n tries = 0\n if (!frame) frame = requestAnimationFrame(check)\n }\n schedule()\n const resizes = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(schedule) : undefined\n resizes?.observe(wrapper)\n window.addEventListener(\"resize\", schedule)\n return () => {\n if (frame) cancelAnimationFrame(frame)\n resizes?.disconnect()\n mutations?.disconnect()\n window.removeEventListener(\"resize\", schedule)\n content?.removeAttribute(\"data-calendar-squeezed\")\n }\n}\n\n"]}
1
+ {"version":3,"file":"calendarFit.js","sourceRoot":"","sources":["../../../src/lib/calendarFit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,SAAS,SAAS,CAAC,OAAoB,EAAE,IAAY;IACnD,MAAM,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAc,mBAAmB,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC1G,IAAI,CAAC,OAAO;QAAE,OAAO,CAAC,CAAA;IACtB,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAA;IAC5C,kHAAkH;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AAqB,CAAC,KAAK,CAAC,CAAA;IAClD,CAAC;IACD,QAAQ,EAAE,CAAA;IACV,MAAM,OAAO,GAAG,OAAO,cAAc,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAChG,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;IACzB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC3C,OAAO,GAAG,EAAE;QACV,IAAI,KAAK;YAAE,oBAAoB,CAAC,KAAK,CAAC,CAAA;QACtC,OAAO,EAAE,UAAU,EAAE,CAAA;QACrB,SAAS,EAAE,UAAU,EAAE,CAAA;QACvB,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;QAC9C,OAAO,EAAE,eAAe,CAAC,wBAAwB,CAAC,CAAA;IACpD,CAAC,CAAA;AACH,CAAC","sourcesContent":["/**\n * The room on the side the popover did not take, from the room the popper gives its own side (which already holds\n * the offset and the collision padding) and where the trigger stands in the viewport. With no trigger found it is\n * zero, so the popover is capped to its own side as before.\n */\nfunction otherRoom(content: HTMLElement, room: number): number {\n const trigger = content.id ? document.querySelector<HTMLElement>(`[aria-controls=\"${content.id}\"]`) : null\n if (!trigger) return 0\n const rect = trigger.getBoundingClientRect()\n // The popper (Floating UI, fixed) measures the visual viewport, which a keyboard or a zoom makes shorter than the\n // layout one, and in WebKit it moves the trigger's rect by the visual viewport's offset as it does\n const view = window.visualViewport\n const top = view ? view.offsetTop : 0\n const height = view ? view.height : document.documentElement.clientHeight\n const webkit = typeof CSS !== \"undefined\" && typeof CSS.supports === \"function\" && CSS.supports(\"-webkit-backdrop-filter\", \"none\")\n const shift = view && webkit ? view.offsetTop : 0\n const above = rect.top + shift - top\n const below = top + height - (rect.bottom + shift)\n return content.getAttribute(\"data-side\") === \"top\" ? room - above + below : room - below + above\n}\n\n/**\n * On a phone the calendar keeps its whole height, so its popover flips to the side of the trigger with room\n * (Calendar.module.css). When neither side has room, it is capped to the room of the side it took and scrolls, so\n * every date and the time row stay reachable (Codex 15.11). The popover's scroll height is the calendar's own height\n * whether or not it is capped, so the check never feeds on its own result. The popover is looked up in a frame (a\n * Vue parent sets its role after its children mount) and watched for the room and side the popper writes on it as\n * the page scrolls. Returns the cleanup.\n */\nexport function watchCalendarFit(wrapper: HTMLElement): () => void {\n if (typeof window === \"undefined\" || typeof requestAnimationFrame === \"undefined\") return () => {}\n let content: HTMLElement | null = null\n let mutations: MutationObserver | undefined\n let frame = 0\n let tries = 0\n const check = () => {\n frame = 0\n if (!content) {\n content = wrapper.closest<HTMLElement>('[role=\"dialog\"]')\n if (content && typeof MutationObserver !== \"undefined\") {\n mutations = new MutationObserver(schedule)\n mutations.observe(content, { attributes: true, attributeFilter: [\"style\", \"data-side\"] })\n }\n }\n const room = content\n ? parseFloat(getComputedStyle(content).getPropertyValue(\"--radix-popover-content-available-height\"))\n : NaN\n if (!content || !Number.isFinite(room) || room <= 0) {\n if (++tries < 20) frame = requestAnimationFrame(check)\n return\n }\n // The cap goes on only when the other side has no room for the whole calendar either. On the side it took\n // while it was shorter, it would otherwise make the grown calendar fit there and stop the popper's flip\n // (console 15.11: a lower row of a sheet opened below and scrolled with 440px free above it).\n const height = content.scrollHeight\n const squeezed = height > room + 0.5 && height > otherRoom(content, room) + 0.5\n if (content.hasAttribute(\"data-calendar-squeezed\") !== squeezed) content.toggleAttribute(\"data-calendar-squeezed\", squeezed)\n }\n function schedule() {\n tries = 0\n if (!frame) frame = requestAnimationFrame(check)\n }\n schedule()\n const resizes = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(schedule) : undefined\n resizes?.observe(wrapper)\n window.addEventListener(\"resize\", schedule)\n return () => {\n if (frame) cancelAnimationFrame(frame)\n resizes?.disconnect()\n mutations?.disconnect()\n window.removeEventListener(\"resize\", schedule)\n content?.removeAttribute(\"data-calendar-squeezed\")\n }\n}\n\n"]}
@@ -274,10 +274,14 @@ function startDrag(event, list, source, layout, immediate, commit, link) {
274
274
  stopListening();
275
275
  return;
276
276
  }
277
- const moved = travel >= START_DISTANCE;
278
- if (moved && touch)
279
- stopListening();
280
- else if (moved)
277
+ // A finger drifts while it holds: as an iOS long press, a touch keeps its hold within the long press slop and scrolls
278
+ // only past it. At 4 a hold that drifted 5 before the lift was dropped, so a row lifted one time and not the next.
279
+ if (touch) {
280
+ if (travel > CONTEXT_MENU_LONG_PRESS_SLOP)
281
+ stopListening();
282
+ return;
283
+ }
284
+ if (travel >= START_DISTANCE)
281
285
  begin();
282
286
  }
283
287
  function onUp(event) {
@@ -1 +1 @@
1
- {"version":3,"file":"sortable.js","sourceRoot":"","sources":["../../../src/lib/sortable.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,wDAAwD,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,eAAe,EAAwB,MAAM,sBAAsB,CAAA;AA8D7H,MAAM,cAAc,GAAG,CAAC,CAAA;AACxB,MAAM,UAAU,GAAG,GAAG,CAAA;AACtB,0DAA0D;AAC1D,MAAM,WAAW,GAAG,GAAG,CAAA;AACvB,MAAM,WAAW,GAAG,EAAE,CAAA;AACtB,MAAM,WAAW,GAAG,CAAC,CAAA;AACrB,MAAM,WAAW,GAAG,EAAE,CAAA;AACtB,MAAM,SAAS,GAAG,EAAE,CAAA;AACpB,MAAM,UAAU,GAAG,EAAE,CAAA;AACrB,MAAM,IAAI,GAAG,CAAC,CAAA;AACd,8DAA8D;AAC9D,MAAM,MAAM,GAAG,2BAA2B,CAAA;AAC1C,4DAA4D;AAC5D,MAAM,WAAW,GAAG,IAAI,OAAO,EAAwB,CAAA;AACvD,MAAM,MAAM,GAAG,wBAAwB,CAAA;AACvC,MAAM,IAAI,GAAG,sBAAsB,CAAA;AACnC,MAAM,MAAM,GAAG,sBAAsB,CAAA;AACrC,MAAM,WAAW,GAAG;IAClB,SAAS;IACT,QAAQ;I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GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;AAC5D,CAAC","sourcesContent":["import s from \"@plexui/styles/components/Sortable/Sortable.module.css\"\nimport { CONTEXT_MENU_HOLD, CONTEXT_MENU_LONG_PRESS_SLOP, heldContextMenu, type ContextMenuHold } from \"./contextMenuHold.js\"\n\n// Drag to reorder, for any list of elements. Nothing moves until the drop: the\n// item leaves a flat slot and shrinks to a chip at the cursor, a line marks the\n// nearest gap, and only the drop changes the order. Items that stand apart part\n// at the gap. Rows that touch hold still: their text would run over the hairlines.\n// Lists of one group trade items, and a target outside them takes an item whole.\n// A list may keep its items to itself (reach \"list\") or only hand them to targets\n// (reach \"targets\"): then nothing parts, no line shows and the keys leave the order.\n\nexport type SortableLayout = \"list\" | \"grid\"\n\n/** Where a drag from the list may go: the lists of its group and their targets, the list itself and the targets, or\n * the targets only */\nexport type SortableReach = \"group\" | \"list\" | \"targets\"\n\n/** Applies a move to the list. Resolves once the DOM shows the new order. */\nexport type SortableCommit = (from: number, to: number) => void | Promise<void>\n\n/** A move inside a list, into another list of its group or onto a target */\nexport type SortableMove<T = unknown> = {\n /** The entry of `value` that moved */\n item: T\n /** The `name` of the list it left */\n from: string\n /** Its place there */\n fromIndex: number\n /** The `name` of the list or the target it reached */\n to: string\n /** Its place after the move. A target has no places: the app decides. */\n toIndex?: number\n}\n\n/** What a list does when an item leaves it. Resolves once the DOM shows the move. */\nexport type SortableLink = {\n move: (fromIndex: number, to: string, toIndex?: number) => void | Promise<void>\n hold?: (name: string) => void\n}\n\ntype Slot = {\n gap: number\n /** Offsets from the list's corner, so a scroll under the drag keeps them true */\n x: number\n y: number\n length: number\n before?: Element\n after?: Element\n}\n\ntype Area = {\n list: HTMLElement\n items: HTMLElement[]\n slots: Slot[]\n scrollLeft: number\n scrollTop: number\n}\n\ntype Found = {\n area: Area\n slot: Slot\n}\n\nconst START_DISTANCE = 4\nconst TOUCH_HOLD = 200\n// Long enough to pass over a target on the way to another\nconst TARGET_HOLD = 500\nconst SCROLL_EDGE = 80\nconst SCROLL_SLOW = 4\nconst SCROLL_FAST = 30\nconst NEAR_LIST = 40\nconst LINE_INSET = 16\nconst PART = 4\n// --cubic-enter: an animation here cannot read a CSS variable\nconst EASING = \"cubic-bezier(.19,1,.22,1)\"\n// One pointer owns a pending hold or drag in this document.\nconst activeDrags = new WeakMap<Document, () => void>()\nconst HANDLE = \"[data-sortable-handle]\"\nconst GRAB = \"[data-sortable-grab]\"\nconst STATIC = \"data-sortable-static\"\nconst INTERACTIVE = [\n \"a[href]\",\n \"button\",\n \"input\",\n \"select\",\n \"summary\",\n \"textarea\",\n \"[contenteditable]\",\n \"[role=button]\",\n \"[role=checkbox]\",\n \"[role=combobox]\",\n \"[role=link]\",\n \"[role=radio]\",\n \"[role=slider]\",\n \"[role=switch]\",\n \"[role=tab]\",\n].join(\",\")\n\n// Read at the moment of use: the setting can change while the page is open\nconst reduced = () => window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches\n\n/** How far the line stands in from the sides of the list */\nconst lineInset = (list: HTMLElement) => {\n const inset = parseFloat(getComputedStyle(list).getPropertyValue(\"--sortable-line-inset\"))\n return Number.isNaN(inset) ? LINE_INSET : inset\n}\n\n/** A head row or an empty message stands among the items and is not one of them */\nconst itemsOf = (list: HTMLElement) => ([...list.children] as HTMLElement[]).filter((item) => !item.hasAttribute(STATIC))\n\nconst reachOf = (list: HTMLElement): SortableReach => {\n const { reach } = list.dataset\n return reach === \"list\" || reach === \"targets\" ? reach : \"group\"\n}\n\n/** The lists a drag from this one can reach, in the order of the page. A list that keeps its items to itself or only\n * hands them to targets takes none from the others either. */\nconst listsOf = (list: HTMLElement) => {\n const { group } = list.dataset\n if (!group || reachOf(list) !== \"group\") return [list]\n return [...document.querySelectorAll<HTMLElement>(`[data-sortable][data-group=\"${CSS.escape(group)}\"]:not([data-disabled])`)]\n .filter((entry) => entry === list || reachOf(entry) === \"group\")\n}\n\n/** Grips stand in a table, elsewhere only when the list asks for them */\nconst showsHandles = (list: HTMLElement) => (list.dataset.handles ?? String(list.tagName === \"TBODY\")) === \"true\"\n\n/** The direct child of the list that holds `target` */\nconst itemOf = (list: HTMLElement, target: Element) => {\n let node: Element | null = target\n while (node && node.parentElement !== list) node = node.parentElement\n return node as HTMLElement | null\n}\n\n/** The order after a move. `to` counts the list without the moved item. */\nexport const moveItem = <T>(items: readonly T[], from: number, to: number) => {\n const next = [...items]\n next.splice(to, 0, ...next.splice(from, 1))\n return next\n}\n\nconst labelOf = (item: HTMLElement) => {\n const named = item.dataset.sortableLabel ?? item.querySelector(\"[data-sortable-label], label\")?.textContent\n if (named) return named.trim()\n // The cells of a row or the lines of a card run together: the first one is the name\n const texts = document.createTreeWalker(item, NodeFilter.SHOW_TEXT)\n while (texts.nextNode()) {\n if (texts.currentNode.textContent?.trim()) return texts.currentNode.parentElement?.textContent?.trim() ?? \"\"\n }\n return \"\"\n}\n\n/** What a screen reader hears: a picture has no text of its own */\nconst nameOf = (item: HTMLElement) => labelOf(item) || item.querySelector(\"img\")?.alt || \"\"\n\nfunction makeChip(item: HTMLElement) {\n const chip = document.createElement(\"div\")\n chip.className = s.Chip\n const image = item.querySelector<HTMLElement>(\"[data-sortable-image], img\")\n if (image instanceof HTMLImageElement) {\n const picture = document.createElement(\"img\")\n picture.className = s.ChipImage\n picture.src = image.currentSrc || image.src\n picture.alt = \"\"\n chip.append(picture)\n } else if (image) {\n // A cropped background: the chip takes the element as it stands, at the chip's size\n const picture = image.cloneNode(false) as HTMLElement\n picture.className = s.ChipImage\n picture.hidden = false\n chip.append(picture)\n }\n const text = labelOf(item)\n if (text) {\n const label = document.createElement(\"span\")\n label.className = s.ChipLabel\n label.textContent = text\n chip.append(label)\n }\n document.body.append(chip)\n return chip\n}\n\nfunction announce(text: string) {\n let region = document.querySelector(\"[data-sortable-live]\")\n if (!region) {\n region = document.createElement(\"div\")\n region.className = s.Live\n region.setAttribute(\"aria-live\", \"polite\")\n region.setAttribute(\"data-sortable-live\", \"\")\n document.body.append(region)\n }\n region.textContent = text\n}\n\nconst scrollParent = (start: Element | null) => {\n for (let node = start; node && node !== document.body; node = node.parentElement) {\n if (/auto|scroll/.test(getComputedStyle(node).overflowY) && node.scrollHeight > node.clientHeight) return node\n }\n return undefined\n}\n\n// The nearer the edge the faster: slow to aim at a row, fast across a long list\nconst scrollStep = (depth: number) =>\n SCROLL_SLOW + (SCROLL_FAST - SCROLL_SLOW) * Math.min(depth / SCROLL_EDGE, 1)\n\nfunction listSlots(list: HTMLElement, items: HTMLElement[]) {\n const box = list.getBoundingClientRect()\n const inset = lineInset(list)\n if (!items.length) {\n // Above a message or an empty row: the line must not cross its text\n const rest = (list.lastElementChild ?? list).getBoundingClientRect()\n return [{ gap: 0, x: inset, y: rest.top - box.top, length: box.width - inset * 2 }]\n }\n const rects = items.map((item) => item.getBoundingClientRect())\n return Array.from({ length: items.length + 1 }, (_, gap): Slot => {\n const above = rects[gap - 1]\n const below = rects[gap]\n const y = above && below ? (above.bottom + below.top) / 2 : (below?.top ?? above.bottom)\n return {\n gap,\n x: inset,\n y: y - box.top,\n length: box.width - inset * 2,\n before: items[gap - 1],\n after: items[gap],\n }\n })\n}\n\n// One slot per gap, and two where a line wraps: the end of one line and the start of the next\nfunction gridSlots(list: HTMLElement, items: HTMLElement[]) {\n const box = list.getBoundingClientRect()\n if (!items.length) return [{ gap: 0, x: 0, y: 0, length: box.height }]\n const half = (parseFloat(getComputedStyle(list).columnGap) || 8) / 2\n const rects = items.map((item) => item.getBoundingClientRect())\n const slots: Slot[] = []\n const add = (gap: number, x: number, rect: DOMRect, before?: Element, after?: Element) =>\n slots.push({ gap, x: x - box.left, y: rect.top - box.top, length: rect.height, before, after })\n\n rects.forEach((rect, gap) => {\n const previous = rects[gap - 1]\n if (previous && Math.abs(previous.top - rect.top) < rect.height / 2) {\n add(gap, (previous.right + rect.left) / 2, rect, items[gap - 1], items[gap])\n return\n }\n if (previous) add(gap, previous.right + half, previous, items[gap - 1])\n add(gap, rect.left - half, rect, undefined, items[gap])\n })\n const last = rects.length - 1\n add(rects.length, rects[last].right + half, rects[last], items[last])\n return slots\n}\n\n// The chip keeps its size and fades out: grown to the item, its text would stand over the item's own\nfunction flyChip(chip: HTMLElement, to: DOMRect | undefined, layout: SortableLayout) {\n if (reduced() || !to) {\n chip.remove()\n return\n }\n const from = chip.getBoundingClientRect()\n const x = layout === \"grid\" ? to.left + (to.width - from.width) / 2 : to.left\n const y = to.top + (to.height - from.height) / 2\n chip.animate(\n [\n { transform: `translate(${from.left}px, ${from.top}px)`, opacity: 1 },\n { transform: `translate(${x}px, ${y}px)`, opacity: 0 },\n ],\n { duration: 200, easing: EASING, fill: \"forwards\" },\n ).onfinish = () => chip.remove()\n}\n\n/** The items that changed place slide there from where they stood */\nasync function flip(items: HTMLElement[], work: () => void | Promise<void>, skip?: HTMLElement) {\n const before = new Map(items.map((item) => [item, item.getBoundingClientRect()]))\n await work()\n if (reduced()) return\n items\n .filter((item) => item !== skip && item.isConnected)\n .forEach((item) => {\n const was = before.get(item) as DOMRect\n const now = item.getBoundingClientRect()\n const x = was.left - now.left\n const y = was.top - now.top\n if (x || y) item.animate([{ transform: `translate(${x}px, ${y}px)` }, { transform: \"none\" }], { duration: 200, easing: EASING })\n })\n}\n\nconst swallow = (event: Event) => {\n event.stopPropagation()\n event.preventDefault()\n}\n\nfunction startDrag(\n event: PointerEvent,\n list: HTMLElement,\n source: HTMLElement,\n layout: SortableLayout,\n immediate: boolean,\n commit: SortableCommit,\n link?: SortableLink,\n) {\n const doc = list.ownerDocument\n const pointerId = event.pointerId\n const validSource = () => list.isConnected && !list.hasAttribute(\"data-disabled\")\n && source.parentElement === list && !source.hasAttribute(STATIC)\n const cancel = () => finish(false, true)\n activeDrags.set(doc, cancel)\n const touch = event.pointerType === \"touch\" && !immediate\n const origin = { x: event.clientX, y: event.clientY }\n const pointer = { ...origin }\n // An item with a context menu shares one hold with it, as an iOS preview: the drag waits for the menu, and once\n // the menu stands the finger moving on closes it and drags the item\n const menu = touch ? heldContextMenu(event.target, source) : undefined\n let lifted: { x: number; y: number; close: () => void } | undefined\n const holdTimer = touch && !menu ? setTimeout(begin, TOUCH_HOLD) : undefined\n const style = getComputedStyle(list)\n const part = parseFloat(layout === \"grid\" ? style.columnGap : style.rowGap) ? PART : 0\n const scroller = scrollParent(list)\n const { group } = list.dataset\n const targets = group ? `[data-sortable-target=\"${CSS.escape(group)}\"]` : undefined\n let drag:\n | {\n chip: HTMLElement\n line: HTMLElement\n width: number\n height: number\n areas: Area[]\n frame?: number\n found?: Found\n under?: Element | null\n target?: HTMLElement\n rest?: ReturnType<typeof setTimeout>\n }\n | undefined\n\n window.addEventListener(\"pointermove\", onMove)\n window.addEventListener(\"pointerup\", onUp)\n window.addEventListener(\"pointercancel\", onCancel)\n window.addEventListener(\"blur\", cancel)\n menu?.addEventListener(CONTEXT_MENU_HOLD, onMenuHold)\n\n function onMenuHold(holdEvent: Event) {\n const hold = (holdEvent as CustomEvent<ContextMenuHold>).detail\n if (hold.pointerId !== pointerId || lifted || drag) return\n lifted = { x: pointer.x, y: pointer.y, close: hold.close }\n // The finger now holds the preview: moving it drags, the page under it stays\n window.addEventListener(\"touchmove\", blockScroll, { passive: false })\n }\n\n function onMove(event: PointerEvent) {\n if (event.pointerId !== pointerId) return\n if (!validSource()) { cancel(); return }\n const { clientX, clientY } = event\n pointer.x = clientX\n pointer.y = clientY\n if (drag) return\n if (lifted) {\n if (Math.hypot(clientX - lifted.x, clientY - lifted.y) < START_DISTANCE) return\n lifted.close()\n begin()\n return\n }\n const travel = Math.hypot(clientX - origin.x, clientY - origin.y)\n // Before the menu opens, a touch that moves as far as the menu lets it scrolls\n if (menu) {\n if (travel > CONTEXT_MENU_LONG_PRESS_SLOP) stopListening()\n return\n }\n const moved = travel >= START_DISTANCE\n if (moved && touch) stopListening()\n else if (moved) begin()\n }\n\n function onUp(event: PointerEvent) {\n if (event.pointerId === pointerId) finish(true)\n }\n\n function onCancel(event: PointerEvent) {\n if (event.pointerId === pointerId) cancel()\n }\n\n function onKey(keyEvent: KeyboardEvent) {\n if (keyEvent.key !== \"Escape\") return\n keyEvent.stopPropagation()\n finish(false)\n }\n\n function blockScroll(touchEvent: TouchEvent) {\n touchEvent.preventDefault()\n }\n\n function stopListening() {\n clearTimeout(holdTimer)\n menu?.removeEventListener(CONTEXT_MENU_HOLD, onMenuHold)\n window.removeEventListener(\"pointermove\", onMove)\n window.removeEventListener(\"pointerup\", onUp)\n window.removeEventListener(\"pointercancel\", onCancel)\n window.removeEventListener(\"blur\", cancel)\n if (activeDrags.get(doc) === cancel) activeDrags.delete(doc)\n window.removeEventListener(\"keydown\", onKey, true)\n window.removeEventListener(\"touchmove\", blockScroll)\n }\n\n // Only onto a target: the list has no gaps to drop in, so nothing parts, no line shows and a drop elsewhere puts\n // the item back\n const onlyTargets = reachOf(list) === \"targets\"\n\n function measure() {\n return listsOf(list).map((entry) => {\n const items = itemsOf(entry)\n entry.setAttribute(\"data-dragging\", \"\")\n return {\n list: entry, items,\n slots: onlyTargets ? [] : layout === \"grid\" ? gridSlots(entry, items) : listSlots(entry, items),\n scrollLeft: entry.scrollLeft, scrollTop: entry.scrollTop,\n }\n })\n }\n\n function begin() {\n if (!validSource()) { cancel(); return }\n const areas = measure()\n window.getSelection()?.removeAllRanges()\n document.documentElement.classList.add(s.Dragging)\n source.setAttribute(\"data-sortable-source\", \"\")\n window.addEventListener(\"keydown\", onKey, true)\n window.addEventListener(\"touchmove\", blockScroll, { passive: false })\n const chip = makeChip(source)\n const line = document.createElement(\"div\")\n line.className = s.Line\n line.hidden = true\n document.body.append(line)\n const { width, height } = chip.getBoundingClientRect()\n drag = { chip, line, width, height, areas }\n tick()\n }\n\n function tick() {\n if (!drag) return\n if (!validSource()) { cancel(); return }\n drag.under = targets ? document.elementFromPoint(pointer.x, pointer.y) : undefined\n autoScroll()\n update()\n drag.frame = requestAnimationFrame(tick)\n }\n\n /** A reachable list or target scrolls in its own pane, not the source pane. */\n function panelUnder() {\n const panel = drag?.under ? scrollParent(drag.under) : undefined\n if (!panel || panel === scroller) return undefined\n const acceptsList = drag?.areas.some(({ list: entry }) =>\n entry.isConnected && !entry.hasAttribute(\"data-disabled\") && panel.contains(entry))\n const acceptsTarget = targets && panel.querySelector(targets)\n return acceptsList || acceptsTarget ? panel : undefined\n }\n\n function autoScroll() {\n const area = panelUnder() ?? scroller\n const box = area?.getBoundingClientRect() ?? { top: 0, bottom: window.innerHeight }\n const above = box.top + SCROLL_EDGE - pointer.y\n const below = pointer.y - box.bottom + SCROLL_EDGE\n const step = above > 0 ? -scrollStep(above) : below > 0 ? scrollStep(below) : 0\n if (!step) return\n if (area) area.scrollTop += step\n else window.scrollBy(0, step)\n }\n\n function update() {\n if (!drag) return\n drag.chip.style.transform = `translate(${pointer.x - drag.width / 2}px, ${pointer.y - drag.height / 2}px)`\n const target = (targets && drag.under?.closest<HTMLElement>(targets)) || undefined\n if (target !== drag.target) pointAt(target)\n const box = source.getBoundingClientRect()\n const overSource = pointer.x >= box.left && pointer.x <= box.right && pointer.y >= box.top && pointer.y <= box.bottom\n source.toggleAttribute(\"data-sortable-away\", !overSource)\n showGap(target || overSource ? undefined : nearestSlot())\n }\n\n function pointAt(target: HTMLElement | undefined) {\n if (!drag) return\n clearTimeout(drag.rest)\n drag.target?.removeAttribute(\"data-over\")\n drag.target = target\n if (!target) return\n target.setAttribute(\"data-over\", \"\")\n drag.rest = setTimeout(() => {\n link?.hold?.(target.dataset.name as string)\n // What the hold changed is drawn two frames on: a list opened, the page jumped\n requestAnimationFrame(() => requestAnimationFrame(() => drag && (drag.areas = measure())))\n }, TARGET_HOLD)\n }\n\n // Slots retain their measured offsets while the list itself may scroll.\n function slotOrigin(area: Area, box = area.list.getBoundingClientRect()) {\n return {\n left: box.left + area.scrollLeft - area.list.scrollLeft,\n top: box.top + area.scrollTop - area.list.scrollTop,\n }\n }\n\n function distance(slot: Slot, box: { left: number; top: number }) {\n if (layout === \"list\") return Math.abs(pointer.y - (box.top + slot.y))\n const top = box.top + slot.y\n return Math.hypot(pointer.x - (box.left + slot.x), Math.max(top - pointer.y, 0, pointer.y - top - slot.length))\n }\n\n function nearestSlot() {\n if (!drag) return undefined\n let best: Found | undefined\n let closest = Infinity\n for (const area of drag.areas) {\n if (!area.list.isConnected || area.list.hasAttribute(\"data-disabled\")) continue\n const box = area.list.getBoundingClientRect()\n const near =\n pointer.x >= box.left - NEAR_LIST &&\n pointer.x <= box.right + NEAR_LIST &&\n pointer.y >= box.top - NEAR_LIST &&\n pointer.y <= box.bottom + NEAR_LIST\n if (!near) continue\n const origin = slotOrigin(area, box)\n for (const slot of area.slots) {\n const away = distance(slot, origin)\n if (away < closest) {\n closest = away\n best = { area, slot }\n }\n }\n }\n if (!best) return undefined\n const index = best.area.items.indexOf(source)\n return index >= 0 && (best.slot.gap === index || best.slot.gap === index + 1) ? undefined : best\n }\n\n function shift(slot: Slot | undefined, by: number) {\n const move = (item: Element | undefined, offset: number) => {\n if (!item || !part) return\n ;(item as HTMLElement).style.transform = by\n ? layout === \"grid\"\n ? `translateX(${offset}px)`\n : `translateY(${offset}px)`\n : \"\"\n }\n move(slot?.before, -by)\n move(slot?.after, by)\n }\n\n function showGap(found: Found | undefined) {\n if (!drag) return\n if (found?.slot !== drag.found?.slot) {\n shift(drag.found?.slot, 0)\n shift(found?.slot, part)\n }\n drag.found = found\n drag.line.hidden = !found\n if (!found) return\n const box = slotOrigin(found.area)\n if (layout === \"grid\") {\n drag.line.style.transform = `translate(${box.left + found.slot.x - 1}px, ${box.top + found.slot.y}px)`\n drag.line.style.height = `${found.slot.length}px`\n } else {\n drag.line.style.transform = `translate(${box.left + found.slot.x}px, ${box.top + found.slot.y - 1}px)`\n drag.line.style.width = `${found.slot.length}px`\n }\n }\n\n function restoreSource() {\n source.removeAttribute(\"data-sortable-source\")\n source.removeAttribute(\"data-sortable-away\")\n }\n\n function settle(chip: HTMLElement, item: HTMLElement | undefined = source) {\n const shown = item?.isConnected ? item : undefined\n flyChip(chip, shown?.getBoundingClientRect(), layout)\n if (!reduced() && shown) shown.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 250, easing: EASING })\n }\n\n async function land(chip: HTMLElement, areas: Area[], { area, slot: { gap } }: Found, clear: () => void) {\n const from = itemsOf(list).indexOf(source)\n restoreSource()\n if (area.list === list) {\n const to = gap > from ? gap - 1 : gap\n await flip(\n area.items,\n () => {\n clear()\n return commit(from, to)\n },\n source,\n )\n announce(`${nameOf(source)}, ${to + 1} / ${area.items.length}`)\n settle(chip)\n return\n }\n const name = nameOf(source)\n await flip(\n areas.flatMap(({ items }) => items),\n () => {\n clear()\n return link?.move(from, area.list.dataset.name as string, gap)\n },\n source,\n )\n announce(`${name}, ${gap + 1} / ${area.items.length + 1}`)\n // A framework builds the row anew under its new parent\n settle(chip, source.isConnected ? source : itemsOf(area.list)[gap])\n }\n\n async function dropOn(chip: HTMLElement, areas: Area[], name: string, clear: () => void) {\n const from = itemsOf(list).indexOf(source)\n restoreSource()\n await flip(\n areas.flatMap(({ items }) => items),\n () => {\n clear()\n return link?.move(from, name)\n },\n source,\n )\n flyChip(chip, undefined, layout)\n }\n\n function finish(drop: boolean, dispose = false) {\n const mayDrop = drop && validSource()\n stopListening()\n if (!drag) return\n const { chip, line, found, areas, frame, target, rest } = drag\n if (frame) cancelAnimationFrame(frame)\n clearTimeout(rest)\n target?.removeAttribute(\"data-over\")\n // The pointer lifts over a row: that click must not act on it\n window.addEventListener(\"click\", swallow, { capture: true, once: true })\n setTimeout(() => window.removeEventListener(\"click\", swallow, { capture: true }))\n line.remove()\n drag = undefined\n // On a drop this waits for the flip to read where the parted items stand\n const clear = () => {\n areas.forEach((area) => area.list.removeAttribute(\"data-dragging\"))\n document.documentElement.classList.remove(s.Dragging)\n shift(found?.slot, 0)\n }\n const targetName = target?.isConnected ? target.dataset.name : undefined\n if (mayDrop && targetName && targetName !== list.dataset.name) {\n void dropOn(chip, areas, targetName, clear)\n return\n }\n if (mayDrop && found && !target && found.area.list.isConnected && !found.area.list.hasAttribute(\"data-disabled\")) {\n void land(chip, areas, found, clear)\n return\n }\n clear()\n restoreSource()\n if (dispose) chip.remove()\n else settle(chip)\n }\n\n return cancel\n}\n\n/** Starts a drag from a press inside the list. Goes on the list's `pointerdown`. */\nexport function sortablePointerDown(\n event: PointerEvent,\n list: HTMLElement,\n layout: SortableLayout,\n commit: SortableCommit,\n link?: SortableLink,\n) {\n const target = event.target\n if (event.defaultPrevented || event.button || list.hasAttribute(\"data-disabled\")\n || activeDrags.has(list.ownerDocument) || !(target instanceof Element)\n || target.closest(\"[data-sortable]\") !== list) return\n const source = itemOf(list, target)\n if (!source || source.hasAttribute(STATIC)) return\n const handle = target.closest(HANDLE)\n const control = target.closest(INTERACTIVE)\n // A grip in sight is the only way to drag, otherwise anything but a control\n // starts it, and a control that opens its row on a click may let a pull through\n if (source.querySelector(HANDLE) && showsHandles(list) ? !handle : control && !control.closest(GRAB)) return\n return startDrag(event, list, source, layout, !!handle, commit, link)\n}\n\nconst KEY_STEPS: Record<string, number> = { ArrowUp: -1, ArrowLeft: -1, ArrowDown: 1, ArrowRight: 1 }\n\n/** Moves the focused handle's item with the arrow keys. Goes on the list's `keydown`. */\nexport async function sortableKeyDown(event: KeyboardEvent, list: HTMLElement, commit: SortableCommit, link?: SortableLink) {\n const step = KEY_STEPS[event.key]\n const target = event.target as HTMLElement\n if (!step || event.defaultPrevented || list.hasAttribute(\"data-disabled\") || target.closest(\"[data-sortable]\") !== list) return\n const source = itemOf(list, target)\n if (!source || source.hasAttribute(STATIC) || (target !== source && !target.closest(HANDLE))) return\n // A list that only hands its items to targets has no order to change\n if (reachOf(list) === \"targets\") return\n const items = itemsOf(list)\n const from = items.indexOf(source)\n const to = from + step\n if (to < 0 || to >= items.length) {\n // Past the end of the list: on to the next list of the group\n const lists = listsOf(list)\n const next = lists[lists.indexOf(list) + step]\n if (!next || !link) return\n event.preventDefault()\n const place = step > 0 ? 0 : itemsOf(next).length\n const name = nameOf(source)\n await flip(lists.flatMap(itemsOf), () => link.move(from, next.dataset.name as string, place))\n const landed = itemsOf(next)[place]\n ;(landed?.querySelector<HTMLElement>(HANDLE) ?? landed)?.focus()\n announce(`${name}, ${place + 1} / ${itemsOf(next).length}`)\n return\n }\n event.preventDefault()\n await flip(items, () => commit(from, to))\n // Moving an element in the document drops its focus\n if (target.isConnected && document.activeElement !== target) target.focus()\n announce(`${nameOf(source)}, ${to + 1} / ${items.length}`)\n}\n"]}
1
+ {"version":3,"file":"sortable.js","sourceRoot":"","sources":["../../../src/lib/sortable.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,wDAAwD,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,eAAe,EAAwB,MAAM,sBAAsB,CAAA;AA8D7H,MAAM,cAAc,GAAG,CAAC,CAAA;AACxB,MAAM,UAAU,GAAG,GAAG,CAAA;AACtB,0DAA0D;AAC1D,MAAM,WAAW,GAAG,GAAG,CAAA;AACvB,MAAM,WAAW,GAAG,EAAE,CAAA;AACtB,MAAM,WAAW,GAAG,CAAC,CAAA;AACrB,MAAM,WAAW,GAAG,EAAE,CAAA;AACtB,MAAM,SAAS,GAAG,EAAE,CAAA;AACpB,MAAM,UAAU,GAAG,EAAE,CAAA;AACrB,MAAM,IAAI,GAAG,CAAC,CAAA;AACd,8DAA8D;AAC9D,MAAM,MAAM,GAAG,2BAA2B,CAAA;AAC1C,4DAA4D;AAC5D,MAAM,WAAW,GAAG,IAAI,OAAO,EAAwB,CAAA;AACvD,MAAM,MAAM,GAAG,wBAAwB,CAAA;AACvC,MAAM,IAAI,GAAG,sBAAsB,CAAA;AACnC,MAAM,MAAM,GAAG,sBAAsB,CAAA;AACrC,MAAM,WAAW,GAAG;IAClB,SAAS;IACT,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,SAAS;IACT,UAAU;IACV,mBAAmB;IACnB,eAAe;IACf,iBAAiB;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,EAAE,GAAG,CAAC,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;AAC5D,CAAC","sourcesContent":["import s from \"@plexui/styles/components/Sortable/Sortable.module.css\"\nimport { CONTEXT_MENU_HOLD, CONTEXT_MENU_LONG_PRESS_SLOP, heldContextMenu, type ContextMenuHold } from \"./contextMenuHold.js\"\n\n// Drag to reorder, for any list of elements. Nothing moves until the drop: the\n// item leaves a flat slot and shrinks to a chip at the cursor, a line marks the\n// nearest gap, and only the drop changes the order. Items that stand apart part\n// at the gap. Rows that touch hold still: their text would run over the hairlines.\n// Lists of one group trade items, and a target outside them takes an item whole.\n// A list may keep its items to itself (reach \"list\") or only hand them to targets\n// (reach \"targets\"): then nothing parts, no line shows and the keys leave the order.\n\nexport type SortableLayout = \"list\" | \"grid\"\n\n/** Where a drag from the list may go: the lists of its group and their targets, the list itself and the targets, or\n * the targets only */\nexport type SortableReach = \"group\" | \"list\" | \"targets\"\n\n/** Applies a move to the list. Resolves once the DOM shows the new order. */\nexport type SortableCommit = (from: number, to: number) => void | Promise<void>\n\n/** A move inside a list, into another list of its group or onto a target */\nexport type SortableMove<T = unknown> = {\n /** The entry of `value` that moved */\n item: T\n /** The `name` of the list it left */\n from: string\n /** Its place there */\n fromIndex: number\n /** The `name` of the list or the target it reached */\n to: string\n /** Its place after the move. A target has no places: the app decides. */\n toIndex?: number\n}\n\n/** What a list does when an item leaves it. Resolves once the DOM shows the move. */\nexport type SortableLink = {\n move: (fromIndex: number, to: string, toIndex?: number) => void | Promise<void>\n hold?: (name: string) => void\n}\n\ntype Slot = {\n gap: number\n /** Offsets from the list's corner, so a scroll under the drag keeps them true */\n x: number\n y: number\n length: number\n before?: Element\n after?: Element\n}\n\ntype Area = {\n list: HTMLElement\n items: HTMLElement[]\n slots: Slot[]\n scrollLeft: number\n scrollTop: number\n}\n\ntype Found = {\n area: Area\n slot: Slot\n}\n\nconst START_DISTANCE = 4\nconst TOUCH_HOLD = 200\n// Long enough to pass over a target on the way to another\nconst TARGET_HOLD = 500\nconst SCROLL_EDGE = 80\nconst SCROLL_SLOW = 4\nconst SCROLL_FAST = 30\nconst NEAR_LIST = 40\nconst LINE_INSET = 16\nconst PART = 4\n// --cubic-enter: an animation here cannot read a CSS variable\nconst EASING = \"cubic-bezier(.19,1,.22,1)\"\n// One pointer owns a pending hold or drag in this document.\nconst activeDrags = new WeakMap<Document, () => void>()\nconst HANDLE = \"[data-sortable-handle]\"\nconst GRAB = \"[data-sortable-grab]\"\nconst STATIC = \"data-sortable-static\"\nconst INTERACTIVE = [\n \"a[href]\",\n \"button\",\n \"input\",\n \"select\",\n \"summary\",\n \"textarea\",\n \"[contenteditable]\",\n \"[role=button]\",\n \"[role=checkbox]\",\n \"[role=combobox]\",\n \"[role=link]\",\n \"[role=radio]\",\n \"[role=slider]\",\n \"[role=switch]\",\n \"[role=tab]\",\n].join(\",\")\n\n// Read at the moment of use: the setting can change while the page is open\nconst reduced = () => window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches\n\n/** How far the line stands in from the sides of the list */\nconst lineInset = (list: HTMLElement) => {\n const inset = parseFloat(getComputedStyle(list).getPropertyValue(\"--sortable-line-inset\"))\n return Number.isNaN(inset) ? LINE_INSET : inset\n}\n\n/** A head row or an empty message stands among the items and is not one of them */\nconst itemsOf = (list: HTMLElement) => ([...list.children] as HTMLElement[]).filter((item) => !item.hasAttribute(STATIC))\n\nconst reachOf = (list: HTMLElement): SortableReach => {\n const { reach } = list.dataset\n return reach === \"list\" || reach === \"targets\" ? reach : \"group\"\n}\n\n/** The lists a drag from this one can reach, in the order of the page. A list that keeps its items to itself or only\n * hands them to targets takes none from the others either. */\nconst listsOf = (list: HTMLElement) => {\n const { group } = list.dataset\n if (!group || reachOf(list) !== \"group\") return [list]\n return [...document.querySelectorAll<HTMLElement>(`[data-sortable][data-group=\"${CSS.escape(group)}\"]:not([data-disabled])`)]\n .filter((entry) => entry === list || reachOf(entry) === \"group\")\n}\n\n/** Grips stand in a table, elsewhere only when the list asks for them */\nconst showsHandles = (list: HTMLElement) => (list.dataset.handles ?? String(list.tagName === \"TBODY\")) === \"true\"\n\n/** The direct child of the list that holds `target` */\nconst itemOf = (list: HTMLElement, target: Element) => {\n let node: Element | null = target\n while (node && node.parentElement !== list) node = node.parentElement\n return node as HTMLElement | null\n}\n\n/** The order after a move. `to` counts the list without the moved item. */\nexport const moveItem = <T>(items: readonly T[], from: number, to: number) => {\n const next = [...items]\n next.splice(to, 0, ...next.splice(from, 1))\n return next\n}\n\nconst labelOf = (item: HTMLElement) => {\n const named = item.dataset.sortableLabel ?? item.querySelector(\"[data-sortable-label], label\")?.textContent\n if (named) return named.trim()\n // The cells of a row or the lines of a card run together: the first one is the name\n const texts = document.createTreeWalker(item, NodeFilter.SHOW_TEXT)\n while (texts.nextNode()) {\n if (texts.currentNode.textContent?.trim()) return texts.currentNode.parentElement?.textContent?.trim() ?? \"\"\n }\n return \"\"\n}\n\n/** What a screen reader hears: a picture has no text of its own */\nconst nameOf = (item: HTMLElement) => labelOf(item) || item.querySelector(\"img\")?.alt || \"\"\n\nfunction makeChip(item: HTMLElement) {\n const chip = document.createElement(\"div\")\n chip.className = s.Chip\n const image = item.querySelector<HTMLElement>(\"[data-sortable-image], img\")\n if (image instanceof HTMLImageElement) {\n const picture = document.createElement(\"img\")\n picture.className = s.ChipImage\n picture.src = image.currentSrc || image.src\n picture.alt = \"\"\n chip.append(picture)\n } else if (image) {\n // A cropped background: the chip takes the element as it stands, at the chip's size\n const picture = image.cloneNode(false) as HTMLElement\n picture.className = s.ChipImage\n picture.hidden = false\n chip.append(picture)\n }\n const text = labelOf(item)\n if (text) {\n const label = document.createElement(\"span\")\n label.className = s.ChipLabel\n label.textContent = text\n chip.append(label)\n }\n document.body.append(chip)\n return chip\n}\n\nfunction announce(text: string) {\n let region = document.querySelector(\"[data-sortable-live]\")\n if (!region) {\n region = document.createElement(\"div\")\n region.className = s.Live\n region.setAttribute(\"aria-live\", \"polite\")\n region.setAttribute(\"data-sortable-live\", \"\")\n document.body.append(region)\n }\n region.textContent = text\n}\n\nconst scrollParent = (start: Element | null) => {\n for (let node = start; node && node !== document.body; node = node.parentElement) {\n if (/auto|scroll/.test(getComputedStyle(node).overflowY) && node.scrollHeight > node.clientHeight) return node\n }\n return undefined\n}\n\n// The nearer the edge the faster: slow to aim at a row, fast across a long list\nconst scrollStep = (depth: number) =>\n SCROLL_SLOW + (SCROLL_FAST - SCROLL_SLOW) * Math.min(depth / SCROLL_EDGE, 1)\n\nfunction listSlots(list: HTMLElement, items: HTMLElement[]) {\n const box = list.getBoundingClientRect()\n const inset = lineInset(list)\n if (!items.length) {\n // Above a message or an empty row: the line must not cross its text\n const rest = (list.lastElementChild ?? list).getBoundingClientRect()\n return [{ gap: 0, x: inset, y: rest.top - box.top, length: box.width - inset * 2 }]\n }\n const rects = items.map((item) => item.getBoundingClientRect())\n return Array.from({ length: items.length + 1 }, (_, gap): Slot => {\n const above = rects[gap - 1]\n const below = rects[gap]\n const y = above && below ? (above.bottom + below.top) / 2 : (below?.top ?? above.bottom)\n return {\n gap,\n x: inset,\n y: y - box.top,\n length: box.width - inset * 2,\n before: items[gap - 1],\n after: items[gap],\n }\n })\n}\n\n// One slot per gap, and two where a line wraps: the end of one line and the start of the next\nfunction gridSlots(list: HTMLElement, items: HTMLElement[]) {\n const box = list.getBoundingClientRect()\n if (!items.length) return [{ gap: 0, x: 0, y: 0, length: box.height }]\n const half = (parseFloat(getComputedStyle(list).columnGap) || 8) / 2\n const rects = items.map((item) => item.getBoundingClientRect())\n const slots: Slot[] = []\n const add = (gap: number, x: number, rect: DOMRect, before?: Element, after?: Element) =>\n slots.push({ gap, x: x - box.left, y: rect.top - box.top, length: rect.height, before, after })\n\n rects.forEach((rect, gap) => {\n const previous = rects[gap - 1]\n if (previous && Math.abs(previous.top - rect.top) < rect.height / 2) {\n add(gap, (previous.right + rect.left) / 2, rect, items[gap - 1], items[gap])\n return\n }\n if (previous) add(gap, previous.right + half, previous, items[gap - 1])\n add(gap, rect.left - half, rect, undefined, items[gap])\n })\n const last = rects.length - 1\n add(rects.length, rects[last].right + half, rects[last], items[last])\n return slots\n}\n\n// The chip keeps its size and fades out: grown to the item, its text would stand over the item's own\nfunction flyChip(chip: HTMLElement, to: DOMRect | undefined, layout: SortableLayout) {\n if (reduced() || !to) {\n chip.remove()\n return\n }\n const from = chip.getBoundingClientRect()\n const x = layout === \"grid\" ? to.left + (to.width - from.width) / 2 : to.left\n const y = to.top + (to.height - from.height) / 2\n chip.animate(\n [\n { transform: `translate(${from.left}px, ${from.top}px)`, opacity: 1 },\n { transform: `translate(${x}px, ${y}px)`, opacity: 0 },\n ],\n { duration: 200, easing: EASING, fill: \"forwards\" },\n ).onfinish = () => chip.remove()\n}\n\n/** The items that changed place slide there from where they stood */\nasync function flip(items: HTMLElement[], work: () => void | Promise<void>, skip?: HTMLElement) {\n const before = new Map(items.map((item) => [item, item.getBoundingClientRect()]))\n await work()\n if (reduced()) return\n items\n .filter((item) => item !== skip && item.isConnected)\n .forEach((item) => {\n const was = before.get(item) as DOMRect\n const now = item.getBoundingClientRect()\n const x = was.left - now.left\n const y = was.top - now.top\n if (x || y) item.animate([{ transform: `translate(${x}px, ${y}px)` }, { transform: \"none\" }], { duration: 200, easing: EASING })\n })\n}\n\nconst swallow = (event: Event) => {\n event.stopPropagation()\n event.preventDefault()\n}\n\nfunction startDrag(\n event: PointerEvent,\n list: HTMLElement,\n source: HTMLElement,\n layout: SortableLayout,\n immediate: boolean,\n commit: SortableCommit,\n link?: SortableLink,\n) {\n const doc = list.ownerDocument\n const pointerId = event.pointerId\n const validSource = () => list.isConnected && !list.hasAttribute(\"data-disabled\")\n && source.parentElement === list && !source.hasAttribute(STATIC)\n const cancel = () => finish(false, true)\n activeDrags.set(doc, cancel)\n const touch = event.pointerType === \"touch\" && !immediate\n const origin = { x: event.clientX, y: event.clientY }\n const pointer = { ...origin }\n // An item with a context menu shares one hold with it, as an iOS preview: the drag waits for the menu, and once\n // the menu stands the finger moving on closes it and drags the item\n const menu = touch ? heldContextMenu(event.target, source) : undefined\n let lifted: { x: number; y: number; close: () => void } | undefined\n const holdTimer = touch && !menu ? setTimeout(begin, TOUCH_HOLD) : undefined\n const style = getComputedStyle(list)\n const part = parseFloat(layout === \"grid\" ? style.columnGap : style.rowGap) ? PART : 0\n const scroller = scrollParent(list)\n const { group } = list.dataset\n const targets = group ? `[data-sortable-target=\"${CSS.escape(group)}\"]` : undefined\n let drag:\n | {\n chip: HTMLElement\n line: HTMLElement\n width: number\n height: number\n areas: Area[]\n frame?: number\n found?: Found\n under?: Element | null\n target?: HTMLElement\n rest?: ReturnType<typeof setTimeout>\n }\n | undefined\n\n window.addEventListener(\"pointermove\", onMove)\n window.addEventListener(\"pointerup\", onUp)\n window.addEventListener(\"pointercancel\", onCancel)\n window.addEventListener(\"blur\", cancel)\n menu?.addEventListener(CONTEXT_MENU_HOLD, onMenuHold)\n\n function onMenuHold(holdEvent: Event) {\n const hold = (holdEvent as CustomEvent<ContextMenuHold>).detail\n if (hold.pointerId !== pointerId || lifted || drag) return\n lifted = { x: pointer.x, y: pointer.y, close: hold.close }\n // The finger now holds the preview: moving it drags, the page under it stays\n window.addEventListener(\"touchmove\", blockScroll, { passive: false })\n }\n\n function onMove(event: PointerEvent) {\n if (event.pointerId !== pointerId) return\n if (!validSource()) { cancel(); return }\n const { clientX, clientY } = event\n pointer.x = clientX\n pointer.y = clientY\n if (drag) return\n if (lifted) {\n if (Math.hypot(clientX - lifted.x, clientY - lifted.y) < START_DISTANCE) return\n lifted.close()\n begin()\n return\n }\n const travel = Math.hypot(clientX - origin.x, clientY - origin.y)\n // Before the menu opens, a touch that moves as far as the menu lets it scrolls\n if (menu) {\n if (travel > CONTEXT_MENU_LONG_PRESS_SLOP) stopListening()\n return\n }\n // A finger drifts while it holds: as an iOS long press, a touch keeps its hold within the long press slop and scrolls\n // only past it. At 4 a hold that drifted 5 before the lift was dropped, so a row lifted one time and not the next.\n if (touch) {\n if (travel > CONTEXT_MENU_LONG_PRESS_SLOP) stopListening()\n return\n }\n if (travel >= START_DISTANCE) begin()\n }\n\n function onUp(event: PointerEvent) {\n if (event.pointerId === pointerId) finish(true)\n }\n\n function onCancel(event: PointerEvent) {\n if (event.pointerId === pointerId) cancel()\n }\n\n function onKey(keyEvent: KeyboardEvent) {\n if (keyEvent.key !== \"Escape\") return\n keyEvent.stopPropagation()\n finish(false)\n }\n\n function blockScroll(touchEvent: TouchEvent) {\n touchEvent.preventDefault()\n }\n\n function stopListening() {\n clearTimeout(holdTimer)\n menu?.removeEventListener(CONTEXT_MENU_HOLD, onMenuHold)\n window.removeEventListener(\"pointermove\", onMove)\n window.removeEventListener(\"pointerup\", onUp)\n window.removeEventListener(\"pointercancel\", onCancel)\n window.removeEventListener(\"blur\", cancel)\n if (activeDrags.get(doc) === cancel) activeDrags.delete(doc)\n window.removeEventListener(\"keydown\", onKey, true)\n window.removeEventListener(\"touchmove\", blockScroll)\n }\n\n // Only onto a target: the list has no gaps to drop in, so nothing parts, no line shows and a drop elsewhere puts\n // the item back\n const onlyTargets = reachOf(list) === \"targets\"\n\n function measure() {\n return listsOf(list).map((entry) => {\n const items = itemsOf(entry)\n entry.setAttribute(\"data-dragging\", \"\")\n return {\n list: entry, items,\n slots: onlyTargets ? [] : layout === \"grid\" ? gridSlots(entry, items) : listSlots(entry, items),\n scrollLeft: entry.scrollLeft, scrollTop: entry.scrollTop,\n }\n })\n }\n\n function begin() {\n if (!validSource()) { cancel(); return }\n const areas = measure()\n window.getSelection()?.removeAllRanges()\n document.documentElement.classList.add(s.Dragging)\n source.setAttribute(\"data-sortable-source\", \"\")\n window.addEventListener(\"keydown\", onKey, true)\n window.addEventListener(\"touchmove\", blockScroll, { passive: false })\n const chip = makeChip(source)\n const line = document.createElement(\"div\")\n line.className = s.Line\n line.hidden = true\n document.body.append(line)\n const { width, height } = chip.getBoundingClientRect()\n drag = { chip, line, width, height, areas }\n tick()\n }\n\n function tick() {\n if (!drag) return\n if (!validSource()) { cancel(); return }\n drag.under = targets ? document.elementFromPoint(pointer.x, pointer.y) : undefined\n autoScroll()\n update()\n drag.frame = requestAnimationFrame(tick)\n }\n\n /** A reachable list or target scrolls in its own pane, not the source pane. */\n function panelUnder() {\n const panel = drag?.under ? scrollParent(drag.under) : undefined\n if (!panel || panel === scroller) return undefined\n const acceptsList = drag?.areas.some(({ list: entry }) =>\n entry.isConnected && !entry.hasAttribute(\"data-disabled\") && panel.contains(entry))\n const acceptsTarget = targets && panel.querySelector(targets)\n return acceptsList || acceptsTarget ? panel : undefined\n }\n\n function autoScroll() {\n const area = panelUnder() ?? scroller\n const box = area?.getBoundingClientRect() ?? { top: 0, bottom: window.innerHeight }\n const above = box.top + SCROLL_EDGE - pointer.y\n const below = pointer.y - box.bottom + SCROLL_EDGE\n const step = above > 0 ? -scrollStep(above) : below > 0 ? scrollStep(below) : 0\n if (!step) return\n if (area) area.scrollTop += step\n else window.scrollBy(0, step)\n }\n\n function update() {\n if (!drag) return\n drag.chip.style.transform = `translate(${pointer.x - drag.width / 2}px, ${pointer.y - drag.height / 2}px)`\n const target = (targets && drag.under?.closest<HTMLElement>(targets)) || undefined\n if (target !== drag.target) pointAt(target)\n const box = source.getBoundingClientRect()\n const overSource = pointer.x >= box.left && pointer.x <= box.right && pointer.y >= box.top && pointer.y <= box.bottom\n source.toggleAttribute(\"data-sortable-away\", !overSource)\n showGap(target || overSource ? undefined : nearestSlot())\n }\n\n function pointAt(target: HTMLElement | undefined) {\n if (!drag) return\n clearTimeout(drag.rest)\n drag.target?.removeAttribute(\"data-over\")\n drag.target = target\n if (!target) return\n target.setAttribute(\"data-over\", \"\")\n drag.rest = setTimeout(() => {\n link?.hold?.(target.dataset.name as string)\n // What the hold changed is drawn two frames on: a list opened, the page jumped\n requestAnimationFrame(() => requestAnimationFrame(() => drag && (drag.areas = measure())))\n }, TARGET_HOLD)\n }\n\n // Slots retain their measured offsets while the list itself may scroll.\n function slotOrigin(area: Area, box = area.list.getBoundingClientRect()) {\n return {\n left: box.left + area.scrollLeft - area.list.scrollLeft,\n top: box.top + area.scrollTop - area.list.scrollTop,\n }\n }\n\n function distance(slot: Slot, box: { left: number; top: number }) {\n if (layout === \"list\") return Math.abs(pointer.y - (box.top + slot.y))\n const top = box.top + slot.y\n return Math.hypot(pointer.x - (box.left + slot.x), Math.max(top - pointer.y, 0, pointer.y - top - slot.length))\n }\n\n function nearestSlot() {\n if (!drag) return undefined\n let best: Found | undefined\n let closest = Infinity\n for (const area of drag.areas) {\n if (!area.list.isConnected || area.list.hasAttribute(\"data-disabled\")) continue\n const box = area.list.getBoundingClientRect()\n const near =\n pointer.x >= box.left - NEAR_LIST &&\n pointer.x <= box.right + NEAR_LIST &&\n pointer.y >= box.top - NEAR_LIST &&\n pointer.y <= box.bottom + NEAR_LIST\n if (!near) continue\n const origin = slotOrigin(area, box)\n for (const slot of area.slots) {\n const away = distance(slot, origin)\n if (away < closest) {\n closest = away\n best = { area, slot }\n }\n }\n }\n if (!best) return undefined\n const index = best.area.items.indexOf(source)\n return index >= 0 && (best.slot.gap === index || best.slot.gap === index + 1) ? undefined : best\n }\n\n function shift(slot: Slot | undefined, by: number) {\n const move = (item: Element | undefined, offset: number) => {\n if (!item || !part) return\n ;(item as HTMLElement).style.transform = by\n ? layout === \"grid\"\n ? `translateX(${offset}px)`\n : `translateY(${offset}px)`\n : \"\"\n }\n move(slot?.before, -by)\n move(slot?.after, by)\n }\n\n function showGap(found: Found | undefined) {\n if (!drag) return\n if (found?.slot !== drag.found?.slot) {\n shift(drag.found?.slot, 0)\n shift(found?.slot, part)\n }\n drag.found = found\n drag.line.hidden = !found\n if (!found) return\n const box = slotOrigin(found.area)\n if (layout === \"grid\") {\n drag.line.style.transform = `translate(${box.left + found.slot.x - 1}px, ${box.top + found.slot.y}px)`\n drag.line.style.height = `${found.slot.length}px`\n } else {\n drag.line.style.transform = `translate(${box.left + found.slot.x}px, ${box.top + found.slot.y - 1}px)`\n drag.line.style.width = `${found.slot.length}px`\n }\n }\n\n function restoreSource() {\n source.removeAttribute(\"data-sortable-source\")\n source.removeAttribute(\"data-sortable-away\")\n }\n\n function settle(chip: HTMLElement, item: HTMLElement | undefined = source) {\n const shown = item?.isConnected ? item : undefined\n flyChip(chip, shown?.getBoundingClientRect(), layout)\n if (!reduced() && shown) shown.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 250, easing: EASING })\n }\n\n async function land(chip: HTMLElement, areas: Area[], { area, slot: { gap } }: Found, clear: () => void) {\n const from = itemsOf(list).indexOf(source)\n restoreSource()\n if (area.list === list) {\n const to = gap > from ? gap - 1 : gap\n await flip(\n area.items,\n () => {\n clear()\n return commit(from, to)\n },\n source,\n )\n announce(`${nameOf(source)}, ${to + 1} / ${area.items.length}`)\n settle(chip)\n return\n }\n const name = nameOf(source)\n await flip(\n areas.flatMap(({ items }) => items),\n () => {\n clear()\n return link?.move(from, area.list.dataset.name as string, gap)\n },\n source,\n )\n announce(`${name}, ${gap + 1} / ${area.items.length + 1}`)\n // A framework builds the row anew under its new parent\n settle(chip, source.isConnected ? source : itemsOf(area.list)[gap])\n }\n\n async function dropOn(chip: HTMLElement, areas: Area[], name: string, clear: () => void) {\n const from = itemsOf(list).indexOf(source)\n restoreSource()\n await flip(\n areas.flatMap(({ items }) => items),\n () => {\n clear()\n return link?.move(from, name)\n },\n source,\n )\n flyChip(chip, undefined, layout)\n }\n\n function finish(drop: boolean, dispose = false) {\n const mayDrop = drop && validSource()\n stopListening()\n if (!drag) return\n const { chip, line, found, areas, frame, target, rest } = drag\n if (frame) cancelAnimationFrame(frame)\n clearTimeout(rest)\n target?.removeAttribute(\"data-over\")\n // The pointer lifts over a row: that click must not act on it\n window.addEventListener(\"click\", swallow, { capture: true, once: true })\n setTimeout(() => window.removeEventListener(\"click\", swallow, { capture: true }))\n line.remove()\n drag = undefined\n // On a drop this waits for the flip to read where the parted items stand\n const clear = () => {\n areas.forEach((area) => area.list.removeAttribute(\"data-dragging\"))\n document.documentElement.classList.remove(s.Dragging)\n shift(found?.slot, 0)\n }\n const targetName = target?.isConnected ? target.dataset.name : undefined\n if (mayDrop && targetName && targetName !== list.dataset.name) {\n void dropOn(chip, areas, targetName, clear)\n return\n }\n if (mayDrop && found && !target && found.area.list.isConnected && !found.area.list.hasAttribute(\"data-disabled\")) {\n void land(chip, areas, found, clear)\n return\n }\n clear()\n restoreSource()\n if (dispose) chip.remove()\n else settle(chip)\n }\n\n return cancel\n}\n\n/** Starts a drag from a press inside the list. Goes on the list's `pointerdown`. */\nexport function sortablePointerDown(\n event: PointerEvent,\n list: HTMLElement,\n layout: SortableLayout,\n commit: SortableCommit,\n link?: SortableLink,\n) {\n const target = event.target\n if (event.defaultPrevented || event.button || list.hasAttribute(\"data-disabled\")\n || activeDrags.has(list.ownerDocument) || !(target instanceof Element)\n || target.closest(\"[data-sortable]\") !== list) return\n const source = itemOf(list, target)\n if (!source || source.hasAttribute(STATIC)) return\n const handle = target.closest(HANDLE)\n const control = target.closest(INTERACTIVE)\n // A grip in sight is the only way to drag, otherwise anything but a control\n // starts it, and a control that opens its row on a click may let a pull through\n if (source.querySelector(HANDLE) && showsHandles(list) ? !handle : control && !control.closest(GRAB)) return\n return startDrag(event, list, source, layout, !!handle, commit, link)\n}\n\nconst KEY_STEPS: Record<string, number> = { ArrowUp: -1, ArrowLeft: -1, ArrowDown: 1, ArrowRight: 1 }\n\n/** Moves the focused handle's item with the arrow keys. Goes on the list's `keydown`. */\nexport async function sortableKeyDown(event: KeyboardEvent, list: HTMLElement, commit: SortableCommit, link?: SortableLink) {\n const step = KEY_STEPS[event.key]\n const target = event.target as HTMLElement\n if (!step || event.defaultPrevented || list.hasAttribute(\"data-disabled\") || target.closest(\"[data-sortable]\") !== list) return\n const source = itemOf(list, target)\n if (!source || source.hasAttribute(STATIC) || (target !== source && !target.closest(HANDLE))) return\n // A list that only hands its items to targets has no order to change\n if (reachOf(list) === \"targets\") return\n const items = itemsOf(list)\n const from = items.indexOf(source)\n const to = from + step\n if (to < 0 || to >= items.length) {\n // Past the end of the list: on to the next list of the group\n const lists = listsOf(list)\n const next = lists[lists.indexOf(list) + step]\n if (!next || !link) return\n event.preventDefault()\n const place = step > 0 ? 0 : itemsOf(next).length\n const name = nameOf(source)\n await flip(lists.flatMap(itemsOf), () => link.move(from, next.dataset.name as string, place))\n const landed = itemsOf(next)[place]\n ;(landed?.querySelector<HTMLElement>(HANDLE) ?? landed)?.focus()\n announce(`${name}, ${place + 1} / ${itemsOf(next).length}`)\n return\n }\n event.preventDefault()\n await flip(items, () => commit(from, to))\n // Moving an element in the document drops its focus\n if (target.isConnected && document.activeElement !== target) target.focus()\n announce(`${nameOf(source)}, ${to + 1} / ${items.length}`)\n}\n"]}
@@ -0,0 +1,74 @@
1
+ import { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type PropType } from "vue";
2
+ import type { LinkComponent } from "../PlexUIProvider/index.js";
3
+ type RouteTarget = string | Record<string, unknown>;
4
+ /**
5
+ * Vue port of `NavigationRow` from packages/ui/src/components/NavigationRow/NavigationRow.tsx: a FieldGroup row
6
+ * that opens what it holds, as an iOS Settings drill-in. Attributes (id, class, ARIA, data, listeners) fall through
7
+ * to the pressable. The `label`, `value` and `description` slots take the place of their props.
8
+ */
9
+ declare const NavigationRowComponent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
10
+ /** The row's name, where a row's label starts */
11
+ label: PropType<string | number>;
12
+ /** The current value, at the end of the row in the secondary label. `0` shows; `null`, `undefined` and `""` do not. */
13
+ value: PropType<string | number | null>;
14
+ /** A line under the label; the row grows from 52 to hold it */
15
+ description: PropType<string | number>;
16
+ /** Where the row goes. With it the row is a link (through `PlexUIProvider`'s `linkComponent`, or `as`). */
17
+ href: StringConstructor;
18
+ /** A router target; with it the row is a link through the provider's link component */
19
+ to: PropType<RouteTarget>;
20
+ /** Force external-link behavior */
21
+ external: {
22
+ type: BooleanConstructor;
23
+ default: undefined;
24
+ };
25
+ /** Link component override (e.g. a router link). */
26
+ as: PropType<LinkComponent>;
27
+ /** The row can't be pressed. A disabled link renders as a disabled button, so it never navigates. */
28
+ disabled: {
29
+ type: BooleanConstructor;
30
+ default: undefined;
31
+ };
32
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
33
+ [key: string]: any;
34
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
35
+ /** The row's name, where a row's label starts */
36
+ label: PropType<string | number>;
37
+ /** The current value, at the end of the row in the secondary label. `0` shows; `null`, `undefined` and `""` do not. */
38
+ value: PropType<string | number | null>;
39
+ /** A line under the label; the row grows from 52 to hold it */
40
+ description: PropType<string | number>;
41
+ /** Where the row goes. With it the row is a link (through `PlexUIProvider`'s `linkComponent`, or `as`). */
42
+ href: StringConstructor;
43
+ /** A router target; with it the row is a link through the provider's link component */
44
+ to: PropType<RouteTarget>;
45
+ /** Force external-link behavior */
46
+ external: {
47
+ type: BooleanConstructor;
48
+ default: undefined;
49
+ };
50
+ /** Link component override (e.g. a router link). */
51
+ as: PropType<LinkComponent>;
52
+ /** The row can't be pressed. A disabled link renders as a disabled button, so it never navigates. */
53
+ disabled: {
54
+ type: BooleanConstructor;
55
+ default: undefined;
56
+ };
57
+ }>> & Readonly<{}>, {
58
+ disabled: boolean;
59
+ external: boolean;
60
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
61
+ type NavigationRowOwnProps = InstanceType<typeof NavigationRowComponent>["$props"];
62
+ /** NavigationRow props plus the native button and link attributes and the click listener that fall through to the
63
+ * pressable, as in React. */
64
+ export type NavigationRowProps = NavigationRowOwnProps & Omit<ButtonHTMLAttributes, keyof NavigationRowOwnProps | "value" | "type"> & Pick<AnchorHTMLAttributes, "target" | "rel" | "download" | "hreflang" | "ping" | "referrerpolicy"> & {
65
+ onClick?: (event: MouseEvent) => void;
66
+ };
67
+ export declare const NavigationRow: typeof NavigationRowComponent & {
68
+ new (): {
69
+ $props: NavigationRowProps;
70
+ focus: (options?: FocusOptions) => void;
71
+ element: HTMLElement | null;
72
+ };
73
+ };
74
+ export {};
@@ -0,0 +1 @@
1
+ export { NavigationRow, type NavigationRowProps } from "./NavigationRow.js";
@@ -11,8 +11,16 @@ export type SwipeAction = {
11
11
  color?: SwipeActionColor;
12
12
  /** Called when the action is pressed, or by a full swipe when it is the first action of its side */
13
13
  onSelect?: () => void;
14
+ /** `"destructive"`: the action removes the row, so the row slides out and its height collapses, as iOS deletes a row, and `onSelect` comes at the end of that for the list to drop it. A row the list keeps comes back. */
15
+ role?: "destructive";
14
16
  };
15
17
  export type SwipeActionsSide = "leading" | "trailing";
18
+ /**
19
+ * Where a swipe that ended at `offset` settles: a flick (`velocity` px/ms, toward the trailing edge when positive)
20
+ * opens the side it moves toward and closes the row when it moves back; a slow one opens a side moved past half its
21
+ * `width`.
22
+ */
23
+ export declare const swipeActionsSettle: (offset: number, velocity: number, width: number) => boolean;
16
24
  /**
17
25
  * Where the content goes for a swipe of `raw` px toward the trailing edge (negative: toward the leading edge), and
18
26
  * whether that is a full swipe. A side without actions stays shut. Past its actions the content follows the finger
@@ -1 +1 @@
1
- export { SwipeActions, swipeActionsOffset, type SwipeAction, type SwipeActionColor, type SwipeActionsProps, type SwipeActionsSide, } from "./SwipeActions.js";
1
+ export { SwipeActions, swipeActionsOffset, swipeActionsSettle, type SwipeAction, type SwipeActionColor, type SwipeActionsProps, type SwipeActionsSide, } from "./SwipeActions.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/vue",
3
- "version": "0.32.0",
3
+ "version": "0.34.0",
4
4
  "description": "Plex UI components for Vue 3, built on Reka UI and the shared @plexui/styles CSS",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -77,7 +77,7 @@
77
77
  "@maskito/core": "5.2.2",
78
78
  "@maskito/kit": "5.2.2",
79
79
  "@maskito/vue": "5.2.2",
80
- "@plexui/styles": "^0.11.0",
80
+ "@plexui/styles": "^0.12.0",
81
81
  "@tanstack/table-core": "8.21.3",
82
82
  "@tanstack/vue-table": "8.21.3",
83
83
  "@tiptap/core": "3.21.0",