@fragiola/primitives 0.0.0-stage → 0.1.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.
- package/CHANGELOG.md +63 -0
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/dist/async-list-Bv6ff5Oj.js +81 -0
- package/dist/async-list-Bv6ff5Oj.js.map +1 -0
- package/dist/async-list.d.ts +2 -0
- package/dist/async-list.js +1 -0
- package/dist/calendar-keys-DGYpjLwv.d.ts +12 -0
- package/dist/calendar-system-B5U5HcPQ.d.ts +415 -0
- package/dist/calendar-systems-Daa6Q_ca.js +659 -0
- package/dist/calendar-systems-Daa6Q_ca.js.map +1 -0
- package/dist/calendar-systems.d.ts +3 -0
- package/dist/calendar-systems.js +1 -0
- package/dist/carousel-LRbWqbAx.js +375 -0
- package/dist/carousel-LRbWqbAx.js.map +1 -0
- package/dist/carousel.d.ts +2 -0
- package/dist/carousel.js +1 -0
- package/dist/cascade-B155Xvvv.js +64 -0
- package/dist/cascade-B155Xvvv.js.map +1 -0
- package/dist/cascade.d.ts +2 -0
- package/dist/cascade.js +1 -0
- package/dist/clipboard-Cy2cbGEW.js +33 -0
- package/dist/clipboard-Cy2cbGEW.js.map +1 -0
- package/dist/clipboard.d.ts +2 -0
- package/dist/clipboard.js +1 -0
- package/dist/collection-Dbk-PB5S.js +609 -0
- package/dist/collection-Dbk-PB5S.js.map +1 -0
- package/dist/collection.d.ts +2 -0
- package/dist/collection.js +3 -0
- package/dist/color-sURV5Irg.js +699 -0
- package/dist/color-sURV5Irg.js.map +1 -0
- package/dist/color.d.ts +2 -0
- package/dist/color.js +1 -0
- package/dist/command-DueCXi65.js +104 -0
- package/dist/command-DueCXi65.js.map +1 -0
- package/dist/command.d.ts +2 -0
- package/dist/command.js +1 -0
- package/dist/date-CrbFSJKQ.js +215 -0
- package/dist/date-CrbFSJKQ.js.map +1 -0
- package/dist/date.d.ts +4 -0
- package/dist/date.js +1 -0
- package/dist/direction-CTnVLpmd.d.ts +8 -0
- package/dist/direction-DJDPvnxJ.js +13 -0
- package/dist/direction-DJDPvnxJ.js.map +1 -0
- package/dist/direction.d.ts +2 -0
- package/dist/direction.js +1 -0
- package/dist/drag-session-CSr06B5v.js +41 -0
- package/dist/drag-session-CSr06B5v.js.map +1 -0
- package/dist/file-DSLtfzbi.js +263 -0
- package/dist/file-DSLtfzbi.js.map +1 -0
- package/dist/file.d.ts +2 -0
- package/dist/file.js +1 -0
- package/dist/focus-BI-VvM0f.js +75 -0
- package/dist/focus-BI-VvM0f.js.map +1 -0
- package/dist/focus.d.ts +2 -0
- package/dist/focus.js +3 -0
- package/dist/form-DovwKtqz.js +501 -0
- package/dist/form-DovwKtqz.js.map +1 -0
- package/dist/form.d.ts +2 -0
- package/dist/form.js +1 -0
- package/dist/hover-BakyPYnC.js +62 -0
- package/dist/hover-BakyPYnC.js.map +1 -0
- package/dist/hover.d.ts +2 -0
- package/dist/hover.js +1 -0
- package/dist/id-B0Y8iZrc.js +13 -0
- package/dist/id-B0Y8iZrc.js.map +1 -0
- package/dist/id.d.ts +2 -0
- package/dist/id.js +1 -0
- package/dist/image-D4X_yRYw.js +44 -0
- package/dist/image-D4X_yRYw.js.map +1 -0
- package/dist/image.d.ts +2 -0
- package/dist/image.js +1 -0
- package/dist/index-B0rwIZw9.d.ts +51 -0
- package/dist/index-B4wF1isn.d.ts +128 -0
- package/dist/index-BHiBRE01.d.ts +20 -0
- package/dist/index-BNlMm-0u.d.ts +17 -0
- package/dist/index-BapNrjY9.d.ts +48 -0
- package/dist/index-Bd-tVb7C.d.ts +6 -0
- package/dist/index-BjE8nDiX.d.ts +125 -0
- package/dist/index-BpbT-FsX.d.ts +117 -0
- package/dist/index-CBgGcTeX.d.ts +37 -0
- package/dist/index-CGThV_Md.d.ts +100 -0
- package/dist/index-CMig3TXL.d.ts +28 -0
- package/dist/index-CWFRduRd.d.ts +212 -0
- package/dist/index-CkrHWyU_.d.ts +33 -0
- package/dist/index-Cwu6f7y1.d.ts +18 -0
- package/dist/index-D10LDdR6.d.ts +139 -0
- package/dist/index-D146vm21.d.ts +104 -0
- package/dist/index-DGKhEvNr.d.ts +107 -0
- package/dist/index-DbAu4s16.d.ts +48 -0
- package/dist/index-DdaCj6IO.d.ts +54 -0
- package/dist/index-DeHcNdjC.d.ts +68 -0
- package/dist/index-DeR4ncrW.d.ts +93 -0
- package/dist/index-HIksgK0e.d.ts +70 -0
- package/dist/index-IZB0mlZl.d.ts +71 -0
- package/dist/index-IfDZj87U.d.ts +28 -0
- package/dist/index-SrTuVBms.d.ts +75 -0
- package/dist/index-T9UcYvkf.d.ts +339 -0
- package/dist/index-fRTojAoR.d.ts +31 -0
- package/dist/index-fuLUke9n.d.ts +6 -0
- package/dist/index-l63esAck.d.ts +104 -0
- package/dist/index-raSUg9U7.d.ts +38 -0
- package/dist/index-twgzPKvZ.d.ts +278 -0
- package/dist/index-wBpjRykh.d.ts +125 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +42 -0
- package/dist/inert-DlGToy3q.js +80 -0
- package/dist/inert-DlGToy3q.js.map +1 -0
- package/dist/inert.d.ts +2 -0
- package/dist/inert.js +1 -0
- package/dist/layer-stack-BEtzaFC1.js +118 -0
- package/dist/layer-stack-BEtzaFC1.js.map +1 -0
- package/dist/layers-C-N4rrZX.js +24 -0
- package/dist/layers-C-N4rrZX.js.map +1 -0
- package/dist/layers.d.ts +2 -0
- package/dist/layers.js +3 -0
- package/dist/list-navigation-CbWv4DK5.js +40 -0
- package/dist/list-navigation-CbWv4DK5.js.map +1 -0
- package/dist/month-year-BG5imFUq.js +108 -0
- package/dist/month-year-BG5imFUq.js.map +1 -0
- package/dist/month-year.d.ts +3 -0
- package/dist/month-year.js +1 -0
- package/dist/number-BFUio97d.js +316 -0
- package/dist/number-BFUio97d.js.map +1 -0
- package/dist/number.d.ts +2 -0
- package/dist/number.js +1 -0
- package/dist/overlay-BwPyiM3T.js +78 -0
- package/dist/overlay-BwPyiM3T.js.map +1 -0
- package/dist/overlay.d.ts +2 -0
- package/dist/overlay.js +1 -0
- package/dist/pagination-BkVzaIGP.js +51 -0
- package/dist/pagination-BkVzaIGP.js.map +1 -0
- package/dist/pagination.d.ts +2 -0
- package/dist/pagination.js +1 -0
- package/dist/plain-date-idQH1P6X.d.ts +29 -0
- package/dist/plain-date-time-B8PGahhe.d.ts +99 -0
- package/dist/pointer-CuDtD9XA.js +189 -0
- package/dist/pointer-CuDtD9XA.js.map +1 -0
- package/dist/pointer.d.ts +2 -0
- package/dist/pointer.js +3 -0
- package/dist/positioning-DDUQ75mB.js +148 -0
- package/dist/positioning-DDUQ75mB.js.map +1 -0
- package/dist/positioning.d.ts +2 -0
- package/dist/positioning.js +1 -0
- package/dist/presence-BhKDOmII.js +86 -0
- package/dist/presence-BhKDOmII.js.map +1 -0
- package/dist/presence.d.ts +2 -0
- package/dist/presence.js +1 -0
- package/dist/range-o0_GBhyY.js +158 -0
- package/dist/range-o0_GBhyY.js.map +1 -0
- package/dist/range.d.ts +2 -0
- package/dist/range.js +1 -0
- package/dist/scroll-area-BYNhv36t.js +447 -0
- package/dist/scroll-area-BYNhv36t.js.map +1 -0
- package/dist/scroll-area.d.ts +2 -0
- package/dist/scroll-area.js +1 -0
- package/dist/scroll-lock-JzRNOA1O.js +42 -0
- package/dist/scroll-lock-JzRNOA1O.js.map +1 -0
- package/dist/scroll-lock.d.ts +2 -0
- package/dist/scroll-lock.js +1 -0
- package/dist/segments-eRu5G_Bd.js +587 -0
- package/dist/segments-eRu5G_Bd.js.map +1 -0
- package/dist/segments.d.ts +3 -0
- package/dist/segments.js +1 -0
- package/dist/selection-Cor67w_V.js +287 -0
- package/dist/selection-Cor67w_V.js.map +1 -0
- package/dist/selection.d.ts +2 -0
- package/dist/selection.js +1 -0
- package/dist/swipe.d.ts +2 -0
- package/dist/swipe.js +1 -0
- package/dist/tabbable-BPiLssIv.js +35 -0
- package/dist/tabbable-BPiLssIv.js.map +1 -0
- package/dist/time-Ct6oq9kt.js +208 -0
- package/dist/time-Ct6oq9kt.js.map +1 -0
- package/dist/time-zone-DegkzwST.js +305 -0
- package/dist/time-zone-DegkzwST.js.map +1 -0
- package/dist/time-zone.d.ts +2 -0
- package/dist/time-zone.js +1 -0
- package/dist/time.d.ts +2 -0
- package/dist/time.js +1 -0
- package/dist/toast-BjRpJalM.js +400 -0
- package/dist/toast-BjRpJalM.js.map +1 -0
- package/dist/toast.d.ts +2 -0
- package/dist/toast.js +1 -0
- package/dist/unit-grid-DJy8lb5D.d.ts +21 -0
- package/dist/virtual-BlX1RuHD.js +306 -0
- package/dist/virtual-BlX1RuHD.js.map +1 -0
- package/dist/virtual.d.ts +2 -0
- package/dist/virtual.js +1 -0
- package/dist/watch-swipe-BIucfr9O.js +301 -0
- package/dist/watch-swipe-BIucfr9O.js.map +1 -0
- package/package.json +234 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-swipe-BIucfr9O.js","names":[],"sources":["../src/swipe/swipe-release.ts","../src/swipe/watch-swipe.ts"],"sourcesContent":["import type { SwipeDirection, SwipeEnd, SwipeMovement } from \"./watch-swipe.ts\";\n\n/**\n * A snap point (spec/drawer.md, \"Snap points\"): a fraction of the viewport's height (`0` to `1`),\n * a height in px (a number above `1`), or a string in `px` or `rem`.\n */\nexport type SnapPoint = number | string;\n\n/** A snap point measured: its height, and the offset that shows that height of the popup. */\nexport interface ResolvedSnapPoint {\n value: SnapPoint;\n /** The height of the popup it shows, in px (at most the popup's and the viewport's). */\n height: number;\n /** How far the popup is moved towards its edge to show that height, in px (`0`: all of it). */\n offset: number;\n}\n\n/** The release of a swipe without snap points: dismiss past this share of the size... */\nexport const SWIPE_DISMISS_RATIO = 0.5;\n\n/** ...or past this distance at this velocity (px per ms), a flick. */\nexport const SWIPE_FLICK_DISTANCE = 10;\nexport const SWIPE_FLICK_VELOCITY = 0.5;\n\n/** A release at this velocity or faster moves the snap target by velocity × this (px). */\nconst SNAP_VELOCITY_PROJECTION = 300;\nconst SNAP_MAX_VELOCITY = 4;\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value));\n}\n\n/** The px height of a snap point in a viewport of `viewportHeight`, or `null` when invalid. */\nfunction snapPointHeight(\n point: SnapPoint,\n viewportHeight: number,\n rootFontSize: number,\n): number | null {\n if (typeof point === \"number\") {\n if (!Number.isFinite(point) || point < 0) {\n return null;\n }\n return point <= 1 ? point * viewportHeight : point;\n }\n const text = point.trim();\n const value = Number.parseFloat(text);\n if (!Number.isFinite(value)) {\n return null;\n }\n if (text.endsWith(\"rem\")) {\n return value * rootFontSize;\n }\n return text.endsWith(\"px\") ? value : null;\n}\n\n/**\n * Measures `points` for a popup of `popupHeight` in a viewport of `viewportHeight` (spec/drawer.md,\n * \"Snap points\"): each one's height (clamped to the popup and the viewport) and offset. Invalid\n * points are left out; two points within 1 px of each other count once (the earlier one).\n */\nexport function resolveSnapPoints(\n points: readonly SnapPoint[],\n sizes: {\n popupHeight: number;\n viewportHeight: number;\n rootFontSize?: number;\n },\n): ResolvedSnapPoint[] {\n const { popupHeight, viewportHeight, rootFontSize = 16 } = sizes;\n if (popupHeight <= 0 || viewportHeight <= 0) {\n return [];\n }\n const max = Math.min(popupHeight, viewportHeight);\n const resolved: ResolvedSnapPoint[] = [];\n for (const value of points) {\n const height = snapPointHeight(value, viewportHeight, rootFontSize);\n if (height === null) {\n continue;\n }\n const clamped = clamp(height, 0, max);\n // a point within 1 px of an earlier one is that one (the default, the first, stays)\n if (resolved.some((point) => Math.abs(point.height - clamped) <= 1)) {\n continue;\n }\n resolved.push({\n value,\n height: clamped,\n offset: Math.max(0, popupHeight - clamped),\n });\n }\n return resolved;\n}\n\n/** The movement of a swipe along `direction`: positive towards the edge it dismisses to. */\nexport function swipeDisplacement(\n direction: SwipeDirection,\n movement: SwipeMovement,\n): number {\n switch (direction) {\n case \"down\":\n return movement.deltaY;\n case \"up\":\n return -movement.deltaY;\n case \"right\":\n return movement.deltaX;\n case \"left\":\n return -movement.deltaX;\n }\n}\n\n/**\n * The movement to show while a swipe runs (spec/drawer.md, \"Swipe\"): along `direction` only, as\n * far as the pointer went towards the edge, and damped (the square root) past the fully open\n * position, where `baseOffset` (a snap point's offset) is `0`. Returns the x and y movement in px.\n */\nexport function swipeMovement(\n direction: SwipeDirection,\n movement: SwipeMovement,\n baseOffset = 0,\n): { x: number; y: number } {\n const along = swipeDisplacement(direction, movement);\n const next = baseOffset + along;\n const shown = next >= 0 ? along : -Math.sqrt(-next) - baseOffset;\n const sign = direction === \"down\" || direction === \"right\" ? 1 : -1;\n const value = shown * sign;\n return direction === \"up\" || direction === \"down\"\n ? { x: 0, y: value }\n : { x: value, y: 0 };\n}\n\n/** What a swipe's release does: dismiss, or settle (on a snap point's index, with snap points). */\nexport type SwipeOutcome =\n | { dismiss: true }\n | { dismiss: false; snapPoint: number | null };\n\n/**\n * What a released swipe does (spec/drawer.md, \"Swipe\" and \"Snap points\"). Without snap points, it\n * dismisses when it moved more than half the popup's `size` along `direction`, or at least 10 px\n * at a flick's velocity (0.5 px per ms) towards the edge; otherwise it settles back. With snap\n * points (the popup's `currentOffset` the active one's), the release's target is where it was let\n * go plus, at a flick's velocity or faster, a projection of that velocity (velocity × 300 px, the\n * velocity capped at 4); the closest of the snap points and the closed position (`size`) wins.\n */\nexport function swipeRelease(\n direction: SwipeDirection,\n end: SwipeEnd,\n size: number,\n snap?: { points: readonly ResolvedSnapPoint[]; currentOffset: number },\n): SwipeOutcome {\n const displacement = swipeDisplacement(direction, end);\n const velocity = swipeDisplacement(direction, {\n deltaX: end.velocityX,\n deltaY: end.velocityY,\n });\n if (snap === undefined || snap.points.length === 0) {\n if (displacement <= 0) {\n return { dismiss: false, snapPoint: null };\n }\n const flick =\n velocity >= SWIPE_FLICK_VELOCITY &&\n displacement >= SWIPE_FLICK_DISTANCE;\n return flick ||\n displacement >\n Math.max(size * SWIPE_DISMISS_RATIO, SWIPE_FLICK_DISTANCE)\n ? { dismiss: true }\n : { dismiss: false, snapPoint: null };\n }\n const projection =\n Math.abs(velocity) >= SWIPE_FLICK_VELOCITY\n ? clamp(velocity, -SNAP_MAX_VELOCITY, SNAP_MAX_VELOCITY) *\n SNAP_VELOCITY_PROJECTION\n : 0;\n const target = clamp(\n snap.currentOffset + displacement + projection,\n 0,\n size,\n );\n let closest = 0;\n snap.points.forEach((point, index) => {\n const best = snap.points[closest] as ResolvedSnapPoint;\n if (Math.abs(point.offset - target) < Math.abs(best.offset - target)) {\n closest = index;\n }\n });\n const best = snap.points[closest] as ResolvedSnapPoint;\n if (Math.abs(size - target) < Math.abs(best.offset - target)) {\n return { dismiss: true };\n }\n return { dismiss: false, snapPoint: closest };\n}\n\n/**\n * How far a running swipe has moved the popup towards its closed position, from `0` (where it\n * was, or fully open) to `1` (closed), for a recipe's `--drawer-swipe-progress` (spec/drawer.md).\n */\nexport function swipeProgress(\n direction: SwipeDirection,\n movement: SwipeMovement,\n size: number,\n baseOffset = 0,\n): number {\n if (size <= 0) {\n return 0;\n }\n const along = swipeDisplacement(direction, movement);\n return clamp((baseOffset + along) / size, 0, 1);\n}\n","/** A direction a swipe moves in: the edge it dismisses towards (spec/drawer.md, \"Swipe\"). */\nexport type SwipeDirection = \"up\" | \"down\" | \"left\" | \"right\";\n\n/** Where a swipe is, from where it went down, in px. */\nexport interface SwipeMovement {\n deltaX: number;\n deltaY: number;\n}\n\n/** How a swipe ended: its movement and its velocity over the last moves, in px per ms. */\nexport interface SwipeEnd extends SwipeMovement {\n velocityX: number;\n velocityY: number;\n}\n\nexport interface SwipeOptions {\n /**\n * The directions a swipe may move in: their axis is the one a swipe locks on (a drawer's\n * dismissal direction; both directions of that axis move it).\n */\n directions: readonly SwipeDirection[];\n /**\n * Whether a press on `target` may start a swipe, after the built-in rules (no swipe from a\n * text control, a range input, an editable element or an element marked\n * `data-swipe-ignore`; a mouse swipes from the primary button and never from an interactive\n * element). A drawer's Content lets the mouse select its text.\n */\n canStart?: (target: Element, event: PointerEvent) => boolean;\n /** The pointer moved past the lock distance along the swipe's axis. */\n onStart: (event: PointerEvent) => void;\n /** Every move of a started swipe. */\n onMove: (movement: SwipeMovement, event: PointerEvent) => void;\n /** The swipe ended: released (`end`), or canceled (`null`: a lost pointer, the cleanup). */\n onEnd: (end: SwipeEnd | null, event: PointerEvent | null) => void;\n}\n\n/** The distance a pointer moves before a swipe locks on an axis (or lets it go), in px. */\nexport const SWIPE_LOCK_DISTANCE = 6;\n\n/** How far a touch moves along the swipe's axis before its page scroll is held back, in px. */\nconst TOUCH_CLAIM_DISTANCE = 2;\n\n/** How far back the release velocity looks, in ms. */\nconst VELOCITY_WINDOW = 100;\n\n/** A release this long after the last move is a release at rest (velocity 0), in ms. */\nconst RELEASE_REST = 80;\n\nconst TEXT_CONTROLS =\n 'input:not([type=\"button\"],[type=\"checkbox\"],[type=\"radio\"],[type=\"submit\"],[type=\"reset\"]),textarea,select,[contenteditable]:not([contenteditable=\"false\"])';\n\nconst INTERACTIVE = 'button,a[href],label,[role=\"button\"],summary';\n\nfunction axisOf(directions: readonly SwipeDirection[]): \"x\" | \"y\" {\n return directions.some(\n (direction) => direction === \"up\" || direction === \"down\",\n )\n ? \"y\"\n : \"x\";\n}\n\n/**\n * Whether an element between `target` and `root` would scroll for a pointer moving by `delta`\n * along `axis`: a pointer moving down scrolls its content up (towards its start), so a scroller\n * that is not at its start takes it; moving up, one not at its end (scroll containment: a drawer's\n * content scrolls before the drawer moves).\n */\nfunction scrollsFirst(\n target: Element,\n root: Element,\n axis: \"x\" | \"y\",\n delta: number,\n): boolean {\n const view = root.ownerDocument.defaultView;\n for (\n let node: Element | null = target;\n node !== null && node !== root.parentElement;\n node = node.parentElement\n ) {\n if (!(node instanceof HTMLElement)) {\n continue;\n }\n const overflow =\n view?.getComputedStyle(node)[\n axis === \"y\" ? \"overflowY\" : \"overflowX\"\n ];\n if (overflow !== \"auto\" && overflow !== \"scroll\") {\n continue;\n }\n const position =\n axis === \"y\" ? node.scrollTop : Math.abs(node.scrollLeft);\n const max =\n axis === \"y\"\n ? node.scrollHeight - node.clientHeight\n : node.scrollWidth - node.clientWidth;\n if (max <= 0) {\n continue;\n }\n if (delta > 0 ? position > 0 : position < max - 1) {\n return true;\n }\n }\n return false;\n}\n\ninterface Sample {\n time: number;\n x: number;\n y: number;\n}\n\n/**\n * Watches `element` for swipes (spec/drawer.md, \"Swipe\"): a primary pointer goes down on it, and\n * once it moved `SWIPE_LOCK_DISTANCE` px, the gesture locks on the swipe's axis (it becomes a\n * swipe, with pointer capture) or is let go (the other axis, or a scroller under the pointer that\n * takes the move: scroll containment). A touch's moves are kept from scrolling the page while they\n * may be a swipe (a non-passive `touchmove`), so the browser does not cancel the pointer. It holds\n * no state of the component: it reports the movement and the release velocity, and the framework\n * decides what they mean (`swipeRelease`). Text selection is cleared and kept off while a swipe\n * runs. Returns the cleanup, which cancels a running swipe.\n */\nexport function watchSwipe(\n element: HTMLElement,\n options: SwipeOptions,\n): () => void {\n const doc = element.ownerDocument;\n const view = doc.defaultView;\n const axis = axisOf(options.directions);\n let gesture: {\n pointerId: number;\n pointerType: string;\n target: Element;\n x: number;\n y: number;\n started: boolean;\n samples: Sample[];\n restoreSelect: (() => void) | null;\n } | null = null;\n\n const movement = (event: PointerEvent): SwipeMovement => ({\n deltaX: gesture ? event.clientX - gesture.x : 0,\n deltaY: gesture ? event.clientY - gesture.y : 0,\n });\n\n const stopListening = () => {\n view?.removeEventListener(\"pointermove\", onMove);\n view?.removeEventListener(\"pointerup\", onUp);\n view?.removeEventListener(\"pointercancel\", onCancel);\n element.removeEventListener(\"lostpointercapture\", onLost);\n };\n\n const finish = (end: SwipeEnd | null, event: PointerEvent | null) => {\n const current = gesture;\n gesture = null;\n stopListening();\n if (current === null || !current.started) {\n return;\n }\n current.restoreSelect?.();\n try {\n if (element.hasPointerCapture(current.pointerId)) {\n element.releasePointerCapture(current.pointerId);\n }\n } catch {\n // already released\n }\n options.onEnd(end, event);\n };\n\n const velocity = (samples: Sample[], now: number) => {\n const last = samples.at(-1);\n if (last === undefined || now - last.time > RELEASE_REST) {\n return { velocityX: 0, velocityY: 0 };\n }\n const first =\n samples.find(\n (sample) => last.time - sample.time <= VELOCITY_WINDOW,\n ) ?? last;\n const elapsed = last.time - first.time;\n if (elapsed <= 0) {\n return { velocityX: 0, velocityY: 0 };\n }\n return {\n velocityX: (last.x - first.x) / elapsed,\n velocityY: (last.y - first.y) / elapsed,\n };\n };\n\n const onMove = (event: PointerEvent) => {\n if (gesture === null || event.pointerId !== gesture.pointerId) {\n return;\n }\n const { deltaX, deltaY } = movement(event);\n gesture.samples.push({\n time: event.timeStamp,\n x: event.clientX,\n y: event.clientY,\n });\n if (gesture.samples.length > 32) {\n gesture.samples.shift();\n }\n if (!gesture.started) {\n const along = axis === \"y\" ? deltaY : deltaX;\n const across = axis === \"y\" ? deltaX : deltaY;\n if (\n Math.max(Math.abs(along), Math.abs(across)) <\n SWIPE_LOCK_DISTANCE\n ) {\n return;\n }\n if (\n Math.abs(across) > Math.abs(along) ||\n scrollsFirst(gesture.target, element, axis, along)\n ) {\n // another axis, or a scroller under the pointer takes it: no swipe\n gesture = null;\n stopListening();\n return;\n }\n gesture.started = true;\n try {\n element.setPointerCapture(event.pointerId);\n } catch {\n // a synthetic pointer: the window listeners still follow it\n }\n doc.getSelection()?.removeAllRanges();\n const style = doc.documentElement.style;\n const previous = style.userSelect;\n style.userSelect = \"none\";\n gesture.restoreSelect = () => {\n style.userSelect = previous;\n };\n options.onStart(event);\n }\n options.onMove({ deltaX, deltaY }, event);\n };\n\n const onUp = (event: PointerEvent) => {\n if (gesture === null || event.pointerId !== gesture.pointerId) {\n return;\n }\n const end = {\n ...movement(event),\n ...velocity(gesture.samples, event.timeStamp),\n };\n finish(end, event);\n };\n\n const onCancel = (event: PointerEvent) => {\n if (gesture !== null && event.pointerId === gesture.pointerId) {\n finish(null, event);\n }\n };\n\n const onLost = (event: Event) => {\n // a release lets the capture go before `pointerup` reaches the window: that one ends it;\n // a touch's implicit capture by its target, which the swipe's own capture replaces, bubbles\n // here and ends nothing\n if (event.target === element && gesture?.started) {\n view?.setTimeout(() => {\n if (gesture?.started) {\n finish(null, event as PointerEvent);\n }\n }, 0);\n }\n };\n\n const onDown = (event: PointerEvent) => {\n if (gesture !== null || !event.isPrimary) {\n return;\n }\n const target = event.target;\n if (!(target instanceof Element) || !element.contains(target)) {\n return;\n }\n if (event.pointerType === \"mouse\" && event.button !== 0) {\n return;\n }\n if (\n target.closest(\"[data-swipe-ignore]\") !== null ||\n target.closest(TEXT_CONTROLS) !== null ||\n target.closest('input[type=\"range\"]') !== null ||\n (event.pointerType === \"mouse\" &&\n target.closest(INTERACTIVE) !== null)\n ) {\n return;\n }\n if (options.canStart && !options.canStart(target, event)) {\n return;\n }\n gesture = {\n pointerId: event.pointerId,\n pointerType: event.pointerType,\n target,\n x: event.clientX,\n y: event.clientY,\n started: false,\n samples: [\n { time: event.timeStamp, x: event.clientX, y: event.clientY },\n ],\n restoreSelect: null,\n };\n view?.addEventListener(\"pointermove\", onMove);\n view?.addEventListener(\"pointerup\", onUp);\n view?.addEventListener(\"pointercancel\", onCancel);\n element.addEventListener(\"lostpointercapture\", onLost);\n };\n\n // a touch that may be a swipe does not scroll the page: the browser would cancel the pointer\n const onTouchMove = (event: TouchEvent) => {\n if (\n gesture === null ||\n gesture.pointerType !== \"touch\" ||\n !event.cancelable\n ) {\n return;\n }\n if (gesture.started) {\n event.preventDefault();\n return;\n }\n const touch = event.touches[0];\n if (touch === undefined) {\n return;\n }\n const along =\n axis === \"y\"\n ? touch.clientY - gesture.y\n : touch.clientX - gesture.x;\n const across =\n axis === \"y\"\n ? touch.clientX - gesture.x\n : touch.clientY - gesture.y;\n // only a move that already leans on the swipe's axis: a jitter or a move along the other\n // axis is left to the browser (a carousel in a bottom sheet still scrolls)\n if (\n Math.abs(along) >= TOUCH_CLAIM_DISTANCE &&\n Math.abs(along) > Math.abs(across) &&\n !scrollsFirst(gesture.target, element, axis, along)\n ) {\n event.preventDefault();\n }\n };\n\n element.addEventListener(\"pointerdown\", onDown);\n element.addEventListener(\"touchmove\", onTouchMove, { passive: false });\n return () => {\n element.removeEventListener(\"pointerdown\", onDown);\n element.removeEventListener(\"touchmove\", onTouchMove);\n finish(null, null);\n };\n}\n"],"mappings":"AAsBA,MAAa,uBAAuB;;AAGpC,MAAM,2BAA2B;AACjC,MAAM,oBAAoB;AAE1B,SAAS,MAAM,OAAe,KAAa,KAAqB;CAC5D,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC7C;;AAGA,SAAS,gBACL,OACA,gBACA,cACa;CACb,IAAI,OAAO,UAAU,UAAU;EAC3B,IAAI,CAAC,OAAO,SAAS,KAAK,KAAK,QAAQ,GACnC,OAAO;EAEX,OAAO,SAAS,IAAI,QAAQ,iBAAiB;CACjD;CACA,MAAM,OAAO,MAAM,KAAK;CACxB,MAAM,QAAQ,OAAO,WAAW,IAAI;CACpC,IAAI,CAAC,OAAO,SAAS,KAAK,GACtB,OAAO;CAEX,IAAI,KAAK,SAAS,KAAK,GACnB,OAAO,QAAQ;CAEnB,OAAO,KAAK,SAAS,IAAI,IAAI,QAAQ;AACzC;;;;;;AAOA,SAAgB,kBACZ,QACA,OAKmB;CACnB,MAAM,EAAE,aAAa,gBAAgB,eAAe,OAAO;CAC3D,IAAI,eAAe,KAAK,kBAAkB,GACtC,OAAO,CAAC;CAEZ,MAAM,MAAM,KAAK,IAAI,aAAa,cAAc;CAChD,MAAM,WAAgC,CAAC;CACvC,KAAK,MAAM,SAAS,QAAQ;EACxB,MAAM,SAAS,gBAAgB,OAAO,gBAAgB,YAAY;EAClE,IAAI,WAAW,MACX;EAEJ,MAAM,UAAU,MAAM,QAAQ,GAAG,GAAG;EAEpC,IAAI,SAAS,MAAM,UAAU,KAAK,IAAI,MAAM,SAAS,OAAO,KAAK,CAAC,GAC9D;EAEJ,SAAS,KAAK;GACV;GACA,QAAQ;GACR,QAAQ,KAAK,IAAI,GAAG,cAAc,O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aAAa,QAAQ,QAAQ,SAAS,MAAM,KAAK,GAElD,MAAM,eAAe;CAE7B;CAEA,QAAQ,iBAAiB,eAAe,MAAM;CAC9C,QAAQ,iBAAiB,aAAa,aAAa,EAAE,SAAS,MAAM,CAAC;CACrE,aAAa;EACT,QAAQ,oBAAoB,eAAe,MAAM;EACjD,QAAQ,oBAAoB,aAAa,WAAW;EACpD,OAAO,MAAM,IAAI;CACrB;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,237 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fragiola/primitives",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The framework-free DOM toolkit of Fragiola Primitives: overlays, layers, focus, scroll lock, positioning, collections, dates and more, one entry per mechanism.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"headless",
|
|
7
|
+
"accessibility",
|
|
8
|
+
"aria",
|
|
9
|
+
"dom",
|
|
10
|
+
"focus-trap",
|
|
11
|
+
"overlay",
|
|
12
|
+
"positioning",
|
|
13
|
+
"primitives"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"author": {
|
|
18
|
+
"name": "Mauro de Souza",
|
|
19
|
+
"email": "maurodesouza.me@gmail.com",
|
|
20
|
+
"url": "https://github.com/maurodesouza"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/fragiola/primitives.git",
|
|
25
|
+
"directory": "packages/primitives"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://fragiola.com/primitives",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/fragiola/primitives/issues"
|
|
30
|
+
},
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"import": "./dist/index.js",
|
|
36
|
+
"default": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./async-list": {
|
|
39
|
+
"types": "./dist/async-list.d.ts",
|
|
40
|
+
"import": "./dist/async-list.js",
|
|
41
|
+
"default": "./dist/async-list.js"
|
|
42
|
+
},
|
|
43
|
+
"./calendar-systems": {
|
|
44
|
+
"types": "./dist/calendar-systems.d.ts",
|
|
45
|
+
"import": "./dist/calendar-systems.js",
|
|
46
|
+
"default": "./dist/calendar-systems.js"
|
|
47
|
+
},
|
|
48
|
+
"./carousel": {
|
|
49
|
+
"types": "./dist/carousel.d.ts",
|
|
50
|
+
"import": "./dist/carousel.js",
|
|
51
|
+
"default": "./dist/carousel.js"
|
|
52
|
+
},
|
|
53
|
+
"./cascade": {
|
|
54
|
+
"types": "./dist/cascade.d.ts",
|
|
55
|
+
"import": "./dist/cascade.js",
|
|
56
|
+
"default": "./dist/cascade.js"
|
|
57
|
+
},
|
|
58
|
+
"./clipboard": {
|
|
59
|
+
"types": "./dist/clipboard.d.ts",
|
|
60
|
+
"import": "./dist/clipboard.js",
|
|
61
|
+
"default": "./dist/clipboard.js"
|
|
62
|
+
},
|
|
63
|
+
"./collection": {
|
|
64
|
+
"types": "./dist/collection.d.ts",
|
|
65
|
+
"import": "./dist/collection.js",
|
|
66
|
+
"default": "./dist/collection.js"
|
|
67
|
+
},
|
|
68
|
+
"./color": {
|
|
69
|
+
"types": "./dist/color.d.ts",
|
|
70
|
+
"import": "./dist/color.js",
|
|
71
|
+
"default": "./dist/color.js"
|
|
72
|
+
},
|
|
73
|
+
"./command": {
|
|
74
|
+
"types": "./dist/command.d.ts",
|
|
75
|
+
"import": "./dist/command.js",
|
|
76
|
+
"default": "./dist/command.js"
|
|
77
|
+
},
|
|
78
|
+
"./date": {
|
|
79
|
+
"types": "./dist/date.d.ts",
|
|
80
|
+
"import": "./dist/date.js",
|
|
81
|
+
"default": "./dist/date.js"
|
|
82
|
+
},
|
|
83
|
+
"./direction": {
|
|
84
|
+
"types": "./dist/direction.d.ts",
|
|
85
|
+
"import": "./dist/direction.js",
|
|
86
|
+
"default": "./dist/direction.js"
|
|
87
|
+
},
|
|
88
|
+
"./file": {
|
|
89
|
+
"types": "./dist/file.d.ts",
|
|
90
|
+
"import": "./dist/file.js",
|
|
91
|
+
"default": "./dist/file.js"
|
|
92
|
+
},
|
|
93
|
+
"./focus": {
|
|
94
|
+
"types": "./dist/focus.d.ts",
|
|
95
|
+
"import": "./dist/focus.js",
|
|
96
|
+
"default": "./dist/focus.js"
|
|
97
|
+
},
|
|
98
|
+
"./form": {
|
|
99
|
+
"types": "./dist/form.d.ts",
|
|
100
|
+
"import": "./dist/form.js",
|
|
101
|
+
"default": "./dist/form.js"
|
|
102
|
+
},
|
|
103
|
+
"./hover": {
|
|
104
|
+
"types": "./dist/hover.d.ts",
|
|
105
|
+
"import": "./dist/hover.js",
|
|
106
|
+
"default": "./dist/hover.js"
|
|
107
|
+
},
|
|
108
|
+
"./id": {
|
|
109
|
+
"types": "./dist/id.d.ts",
|
|
110
|
+
"import": "./dist/id.js",
|
|
111
|
+
"default": "./dist/id.js"
|
|
112
|
+
},
|
|
113
|
+
"./image": {
|
|
114
|
+
"types": "./dist/image.d.ts",
|
|
115
|
+
"import": "./dist/image.js",
|
|
116
|
+
"default": "./dist/image.js"
|
|
117
|
+
},
|
|
118
|
+
"./inert": {
|
|
119
|
+
"types": "./dist/inert.d.ts",
|
|
120
|
+
"import": "./dist/inert.js",
|
|
121
|
+
"default": "./dist/inert.js"
|
|
122
|
+
},
|
|
123
|
+
"./layers": {
|
|
124
|
+
"types": "./dist/layers.d.ts",
|
|
125
|
+
"import": "./dist/layers.js",
|
|
126
|
+
"default": "./dist/layers.js"
|
|
127
|
+
},
|
|
128
|
+
"./month-year": {
|
|
129
|
+
"types": "./dist/month-year.d.ts",
|
|
130
|
+
"import": "./dist/month-year.js",
|
|
131
|
+
"default": "./dist/month-year.js"
|
|
132
|
+
},
|
|
133
|
+
"./number": {
|
|
134
|
+
"types": "./dist/number.d.ts",
|
|
135
|
+
"import": "./dist/number.js",
|
|
136
|
+
"default": "./dist/number.js"
|
|
137
|
+
},
|
|
138
|
+
"./overlay": {
|
|
139
|
+
"types": "./dist/overlay.d.ts",
|
|
140
|
+
"import": "./dist/overlay.js",
|
|
141
|
+
"default": "./dist/overlay.js"
|
|
142
|
+
},
|
|
143
|
+
"./pagination": {
|
|
144
|
+
"types": "./dist/pagination.d.ts",
|
|
145
|
+
"import": "./dist/pagination.js",
|
|
146
|
+
"default": "./dist/pagination.js"
|
|
147
|
+
},
|
|
148
|
+
"./pointer": {
|
|
149
|
+
"types": "./dist/pointer.d.ts",
|
|
150
|
+
"import": "./dist/pointer.js",
|
|
151
|
+
"default": "./dist/pointer.js"
|
|
152
|
+
},
|
|
153
|
+
"./positioning": {
|
|
154
|
+
"types": "./dist/positioning.d.ts",
|
|
155
|
+
"import": "./dist/positioning.js",
|
|
156
|
+
"default": "./dist/positioning.js"
|
|
157
|
+
},
|
|
158
|
+
"./presence": {
|
|
159
|
+
"types": "./dist/presence.d.ts",
|
|
160
|
+
"import": "./dist/presence.js",
|
|
161
|
+
"default": "./dist/presence.js"
|
|
162
|
+
},
|
|
163
|
+
"./range": {
|
|
164
|
+
"types": "./dist/range.d.ts",
|
|
165
|
+
"import": "./dist/range.js",
|
|
166
|
+
"default": "./dist/range.js"
|
|
167
|
+
},
|
|
168
|
+
"./scroll-area": {
|
|
169
|
+
"types": "./dist/scroll-area.d.ts",
|
|
170
|
+
"import": "./dist/scroll-area.js",
|
|
171
|
+
"default": "./dist/scroll-area.js"
|
|
172
|
+
},
|
|
173
|
+
"./scroll-lock": {
|
|
174
|
+
"types": "./dist/scroll-lock.d.ts",
|
|
175
|
+
"import": "./dist/scroll-lock.js",
|
|
176
|
+
"default": "./dist/scroll-lock.js"
|
|
177
|
+
},
|
|
178
|
+
"./segments": {
|
|
179
|
+
"types": "./dist/segments.d.ts",
|
|
180
|
+
"import": "./dist/segments.js",
|
|
181
|
+
"default": "./dist/segments.js"
|
|
182
|
+
},
|
|
183
|
+
"./selection": {
|
|
184
|
+
"types": "./dist/selection.d.ts",
|
|
185
|
+
"import": "./dist/selection.js",
|
|
186
|
+
"default": "./dist/selection.js"
|
|
187
|
+
},
|
|
188
|
+
"./swipe": {
|
|
189
|
+
"types": "./dist/swipe.d.ts",
|
|
190
|
+
"import": "./dist/swipe.js",
|
|
191
|
+
"default": "./dist/swipe.js"
|
|
192
|
+
},
|
|
193
|
+
"./time": {
|
|
194
|
+
"types": "./dist/time.d.ts",
|
|
195
|
+
"import": "./dist/time.js",
|
|
196
|
+
"default": "./dist/time.js"
|
|
197
|
+
},
|
|
198
|
+
"./time-zone": {
|
|
199
|
+
"types": "./dist/time-zone.d.ts",
|
|
200
|
+
"import": "./dist/time-zone.js",
|
|
201
|
+
"default": "./dist/time-zone.js"
|
|
202
|
+
},
|
|
203
|
+
"./toast": {
|
|
204
|
+
"types": "./dist/toast.d.ts",
|
|
205
|
+
"import": "./dist/toast.js",
|
|
206
|
+
"default": "./dist/toast.js"
|
|
207
|
+
},
|
|
208
|
+
"./virtual": {
|
|
209
|
+
"types": "./dist/virtual.d.ts",
|
|
210
|
+
"import": "./dist/virtual.js",
|
|
211
|
+
"default": "./dist/virtual.js"
|
|
212
|
+
},
|
|
213
|
+
"./package.json": "./package.json"
|
|
214
|
+
},
|
|
215
|
+
"files": [
|
|
216
|
+
"dist",
|
|
217
|
+
"README.md",
|
|
218
|
+
"CHANGELOG.md",
|
|
219
|
+
"LICENSE"
|
|
220
|
+
],
|
|
221
|
+
"dependencies": {
|
|
222
|
+
"@floating-ui/dom": "1.8.0"
|
|
223
|
+
},
|
|
224
|
+
"devDependencies": {
|
|
225
|
+
"@types/node": "26.6.6",
|
|
226
|
+
"jsdom": "31.0.1",
|
|
227
|
+
"rolldown": "1.3.2",
|
|
228
|
+
"tsdown": "0.23.7",
|
|
229
|
+
"typescript": "7.0.2",
|
|
230
|
+
"vitest": "5.1.0"
|
|
231
|
+
},
|
|
232
|
+
"scripts": {
|
|
233
|
+
"build": "tsdown",
|
|
234
|
+
"typecheck": "tsc --noEmit",
|
|
235
|
+
"test": "vitest run"
|
|
236
|
+
}
|
|
6
237
|
}
|