├── .github └── workflows │ └── publish.yml ├── .gitignore ├── LICENSE ├── README.md ├── builds └── cdn.js ├── dist ├── alpine-auto-animate.js ├── alpine-auto-animate.js.map ├── alpine-auto-animate.min.js └── alpine-auto-animate.min.js.map ├── examples └── index.html ├── package.json ├── rollup.config.js └── src └── index.js /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | update-dist: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - uses: actions/setup-node@v1 13 | with: 14 | node-version: ^16.0.0 15 | - run: npm install 16 | - run: npm run build 17 | - uses: stefanzweifel/git-auto-commit-action@v4 18 | with: 19 | commit_message: 📦 Update compiled files 20 | file_pattern: dist/**/* 21 | publish-npm: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v2 25 | - uses: actions/setup-node@v1 26 | with: 27 | node-version: ^16.0.0 28 | registry-url: https://registry.npmjs.org/ 29 | - name: Check package version 30 | uses: technote-space/package-version-check-action@v1 31 | with: 32 | COMMIT_DISABLED: 1 33 | - run: npm install 34 | - run: npm run build 35 | - run: npm publish --access public 36 | env: 37 | NODE_AUTH_TOKEN: ${{ secrets.npm_token }} 38 | publish-github: 39 | runs-on: ubuntu-latest 40 | steps: 41 | - uses: actions/checkout@v2 42 | - uses: actions/setup-node@v1 43 | with: 44 | node-version: ^16.0.0 45 | - name: Check package version 46 | uses: technote-space/package-version-check-action@v1 47 | with: 48 | COMMIT_DISABLED: 1 49 | - run: npm install 50 | - run: npm run build 51 | - uses: actions/setup-node@v2 52 | with: 53 | node-version: ^16.0.0 54 | registry-url: 'https://npm.pkg.github.com' 55 | - run: npm publish 56 | env: 57 | NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 58 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /.idea 3 | marcreichel-alpine-auto-animate-*.tgz 4 | package-lock.json 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Marc Reichel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

💫 Alpine AutoAnimate 💫

2 | 3 |

4 | An Alpine.js wrapper for @formkit/auto-animate. 5 |

6 | 7 |

8 | 9 | version 10 | 11 | 12 | Build size 13 | 14 | 15 | downloads 16 | 17 | 18 | JSDelivr 19 | 20 | 21 | GitHub 22 | 23 | 24 | Gitmoji 25 | 26 |

27 | 28 | ## 🚀 Installation 29 | 30 | ### CDN 31 | 32 | Include the following ` 36 | ``` 37 | 38 | ### NPM 39 | 40 | ```shell 41 | npm install @marcreichel/alpine-auto-animate 42 | ``` 43 | 44 | Add the `x-auto-animate` directive to your project by importing the package **before** starting Alpine. 45 | 46 | ```js 47 | import Alpine from 'alpinejs'; 48 | import AutoAnimate from '@marcreichel/alpine-auto-animate'; 49 | 50 | Alpine.plugin(AutoAnimate); 51 | 52 | Alpine.start(); 53 | ``` 54 | 55 | ## 🪄 Usage 56 | 57 | Add the `x-auto-animate` directive to any element where you want to apply animations (including their direct children). 58 | 59 | ```html 60 | 64 | ``` 65 | 66 | ### Duration 67 | 68 | To adjust the animation duration add a modifier like so: 69 | 70 | ```html 71 | 74 | ``` 75 | 76 | or 77 | 78 | ```html 79 | 82 | ``` 83 | 84 | ### Easing function 85 | 86 | To adjust the easing function add it as a modifier: 87 | 88 | ```html 89 | 92 | ``` 93 | 94 | ### Toggle animations 95 | 96 | In some situations it may be necessary to disable animations and re-enable them later. 97 | 98 | For this you can provide a boolean to the directive like so: 99 | 100 | ```html 101 |
102 | 105 | 108 |
109 | ``` 110 | 111 | ## Global config 112 | 113 | If you are using the `npm` installation method for this package or the ESM distribution, you can use the 114 | `AutoAnimate.configure` method to provide a configuration: 115 | 116 | ```javascript 117 | import AutoAnimate from '@marcreichel/alpine-auto-animate'; 118 | 119 | Alpine.plugin(AutoAnimate.configure({ 120 | duration: 1000, 121 | easing: 'linear', 122 | disrespectUserMotionPreference: true, 123 | })); 124 | ``` 125 | 126 | ## 📄 License 127 | 128 | Copyright (c) 2022 Marc Reichel and contributors. 129 | 130 | Licensed under the MIT license, see [LICENSE](LICENSE) for details. 131 | -------------------------------------------------------------------------------- /builds/cdn.js: -------------------------------------------------------------------------------- 1 | import AutoAnimate from "../src/index.js"; 2 | 3 | document.addEventListener('alpine:init', () => { 4 | AutoAnimate(window.Alpine); 5 | }); 6 | -------------------------------------------------------------------------------- /dist/alpine-auto-animate.js: -------------------------------------------------------------------------------- 1 | (function (factory) { 2 | typeof define === 'function' && define.amd ? define(factory) : 3 | factory(); 4 | })((function () { 'use strict'; 5 | 6 | /** 7 | * A set of all the parents currently being observe. This is the only non weak 8 | * registry. 9 | */ 10 | const parents = new Set(); 11 | /** 12 | * Element coordinates that is constantly kept up to date. 13 | */ 14 | const coords = new WeakMap(); 15 | /** 16 | * Siblings of elements that have been removed from the dom. 17 | */ 18 | const siblings = new WeakMap(); 19 | /** 20 | * Animations that are currently running. 21 | */ 22 | const animations = new WeakMap(); 23 | /** 24 | * A map of existing intersection observers used to track element movements. 25 | */ 26 | const intersections = new WeakMap(); 27 | /** 28 | * Intervals for automatically checking the position of elements occasionally. 29 | */ 30 | const intervals = new WeakMap(); 31 | /** 32 | * The configuration options for each group of elements. 33 | */ 34 | const options = new WeakMap(); 35 | /** 36 | * Debounce counters by id, used to debounce calls to update positions. 37 | */ 38 | const debounces = new WeakMap(); 39 | /** 40 | * All parents that are currently enabled are tracked here. 41 | */ 42 | const enabled = new WeakSet(); 43 | /** 44 | * The document used to calculate transitions. 45 | */ 46 | let root; 47 | /** 48 | * Used to sign an element as the target. 49 | */ 50 | const TGT = "__aa_tgt"; 51 | /** 52 | * Used to sign an element as being part of a removal. 53 | */ 54 | const DEL = "__aa_del"; 55 | /** 56 | * Callback for handling all mutations. 57 | * @param mutations - A mutation list 58 | */ 59 | const handleMutations = (mutations) => { 60 | const elements = getElements(mutations); 61 | // If elements is "false" that means this mutation that should be ignored. 62 | if (elements) { 63 | elements.forEach((el) => animate(el)); 64 | } 65 | }; 66 | /** 67 | * 68 | * @param entries - Elements that have been resized. 69 | */ 70 | const handleResizes = (entries) => { 71 | entries.forEach((entry) => { 72 | if (entry.target === root) 73 | updateAllPos(); 74 | if (coords.has(entry.target)) 75 | updatePos(entry.target); 76 | }); 77 | }; 78 | /** 79 | * Observe this elements position. 80 | * @param el - The element to observe the position of. 81 | */ 82 | function observePosition(el) { 83 | const oldObserver = intersections.get(el); 84 | oldObserver === null || oldObserver === void 0 ? void 0 : oldObserver.disconnect(); 85 | let rect = coords.get(el); 86 | let invocations = 0; 87 | const buffer = 5; 88 | if (!rect) { 89 | rect = getCoords(el); 90 | coords.set(el, rect); 91 | } 92 | const { offsetWidth, offsetHeight } = root; 93 | const rootMargins = [ 94 | rect.top - buffer, 95 | offsetWidth - (rect.left + buffer + rect.width), 96 | offsetHeight - (rect.top + buffer + rect.height), 97 | rect.left - buffer, 98 | ]; 99 | const rootMargin = rootMargins 100 | .map((px) => `${-1 * Math.floor(px)}px`) 101 | .join(" "); 102 | const observer = new IntersectionObserver(() => { 103 | ++invocations > 1 && updatePos(el); 104 | }, { 105 | root, 106 | threshold: 1, 107 | rootMargin, 108 | }); 109 | observer.observe(el); 110 | intersections.set(el, observer); 111 | } 112 | /** 113 | * Update the exact position of a given element. 114 | * @param el - An element to update the position of. 115 | */ 116 | function updatePos(el) { 117 | clearTimeout(debounces.get(el)); 118 | const optionsOrPlugin = getOptions(el); 119 | const delay = typeof optionsOrPlugin === "function" ? 500 : optionsOrPlugin.duration; 120 | debounces.set(el, setTimeout(async () => { 121 | const currentAnimation = animations.get(el); 122 | if (!currentAnimation || (await currentAnimation.finished)) { 123 | coords.set(el, getCoords(el)); 124 | observePosition(el); 125 | } 126 | }, delay)); 127 | } 128 | /** 129 | * Updates all positions that are currently being tracked. 130 | */ 131 | function updateAllPos() { 132 | clearTimeout(debounces.get(root)); 133 | debounces.set(root, setTimeout(() => { 134 | parents.forEach((parent) => forEach(parent, (el) => lowPriority(() => updatePos(el)))); 135 | }, 100)); 136 | } 137 | /** 138 | * Its possible for a quick scroll or other fast events to get past the 139 | * intersection observer, so occasionally we need want "cold-poll" for the 140 | * latests and greatest position. We try to do this in the most non-disruptive 141 | * fashion possible. First we only do this ever couple seconds, staggard by a 142 | * random offset. 143 | * @param el - Element 144 | */ 145 | function poll(el) { 146 | setTimeout(() => { 147 | intervals.set(el, setInterval(() => lowPriority(updatePos.bind(null, el)), 2000)); 148 | }, Math.round(2000 * Math.random())); 149 | } 150 | /** 151 | * Perform some operation that is non critical at some point. 152 | * @param callback 153 | */ 154 | function lowPriority(callback) { 155 | if (typeof requestIdleCallback === "function") { 156 | requestIdleCallback(() => callback()); 157 | } 158 | else { 159 | requestAnimationFrame(() => callback()); 160 | } 161 | } 162 | /** 163 | * The mutation observer responsible for watching each root element. 164 | */ 165 | let mutations; 166 | /** 167 | * A resize observer, responsible for recalculating elements on resize. 168 | */ 169 | let resize; 170 | /** 171 | * If this is in a browser, initialize our Web APIs 172 | */ 173 | if (typeof window !== "undefined") { 174 | root = document.documentElement; 175 | mutations = new MutationObserver(handleMutations); 176 | resize = new ResizeObserver(handleResizes); 177 | resize.observe(root); 178 | } 179 | /** 180 | * Retrieves all the elements that may have been affected by the last mutation 181 | * including ones that have been removed and are no longer in the DOM. 182 | * @param mutations - A mutation list. 183 | * @returns 184 | */ 185 | function getElements(mutations) { 186 | return mutations.reduce((elements, mutation) => { 187 | // Short circuit if we find a purposefully deleted node. 188 | if (elements === false) 189 | return false; 190 | if (mutation.target instanceof Element) { 191 | target(mutation.target); 192 | if (!elements.has(mutation.target)) { 193 | elements.add(mutation.target); 194 | for (let i = 0; i < mutation.target.children.length; i++) { 195 | const child = mutation.target.children.item(i); 196 | if (!child) 197 | continue; 198 | if (DEL in child) 199 | return false; 200 | target(mutation.target, child); 201 | elements.add(child); 202 | } 203 | } 204 | if (mutation.removedNodes.length) { 205 | for (let i = 0; i < mutation.removedNodes.length; i++) { 206 | const child = mutation.removedNodes[i]; 207 | if (DEL in child) 208 | return false; 209 | if (child instanceof Element) { 210 | elements.add(child); 211 | target(mutation.target, child); 212 | siblings.set(child, [ 213 | mutation.previousSibling, 214 | mutation.nextSibling, 215 | ]); 216 | } 217 | } 218 | } 219 | } 220 | return elements; 221 | }, new Set()); 222 | } 223 | /** 224 | * Assign the target to an element. 225 | * @param el - The root element 226 | * @param child 227 | */ 228 | function target(el, child) { 229 | if (!child && !(TGT in el)) 230 | Object.defineProperty(el, TGT, { value: el }); 231 | else if (child && !(TGT in child)) 232 | Object.defineProperty(child, TGT, { value: el }); 233 | } 234 | /** 235 | * Determines what kind of change took place on the given element and then 236 | * performs the proper animation based on that. 237 | * @param el - The specific element to animate. 238 | */ 239 | function animate(el) { 240 | var _a; 241 | const isMounted = root.contains(el); 242 | const preExisting = coords.has(el); 243 | if (isMounted && siblings.has(el)) 244 | siblings.delete(el); 245 | if (animations.has(el)) { 246 | (_a = animations.get(el)) === null || _a === void 0 ? void 0 : _a.cancel(); 247 | } 248 | if (preExisting && isMounted) { 249 | remain(el); 250 | } 251 | else if (preExisting && !isMounted) { 252 | remove(el); 253 | } 254 | else { 255 | add(el); 256 | } 257 | } 258 | /** 259 | * Removes all non-digits from a string and casts to a number. 260 | * @param str - A string containing a pixel value. 261 | * @returns 262 | */ 263 | function raw(str) { 264 | return Number(str.replace(/[^0-9.\-]/g, "")); 265 | } 266 | /** 267 | * Get the coordinates of elements adjusted for scroll position. 268 | * @param el - Element 269 | * @returns 270 | */ 271 | function getCoords(el) { 272 | const rect = el.getBoundingClientRect(); 273 | return { 274 | top: rect.top + window.scrollY, 275 | left: rect.left + window.scrollX, 276 | width: rect.width, 277 | height: rect.height, 278 | }; 279 | } 280 | /** 281 | * Returns the width/height that the element should be transitioned between. 282 | * This takes into account box-sizing. 283 | * @param el - Element being animated 284 | * @param oldCoords - Old set of Coordinates coordinates 285 | * @param newCoords - New set of Coordinates coordinates 286 | * @returns 287 | */ 288 | function getTransitionSizes(el, oldCoords, newCoords) { 289 | let widthFrom = oldCoords.width; 290 | let heightFrom = oldCoords.height; 291 | let widthTo = newCoords.width; 292 | let heightTo = newCoords.height; 293 | const styles = getComputedStyle(el); 294 | const sizing = styles.getPropertyValue("box-sizing"); 295 | if (sizing === "content-box") { 296 | const paddingY = raw(styles.paddingTop) + 297 | raw(styles.paddingBottom) + 298 | raw(styles.borderTopWidth) + 299 | raw(styles.borderBottomWidth); 300 | const paddingX = raw(styles.paddingLeft) + 301 | raw(styles.paddingRight) + 302 | raw(styles.borderRightWidth) + 303 | raw(styles.borderLeftWidth); 304 | widthFrom -= paddingX; 305 | widthTo -= paddingX; 306 | heightFrom -= paddingY; 307 | heightTo -= paddingY; 308 | } 309 | return [widthFrom, widthTo, heightFrom, heightTo].map(Math.round); 310 | } 311 | /** 312 | * Retrieves animation options for the current element. 313 | * @param el - Element to retrieve options for. 314 | * @returns 315 | */ 316 | function getOptions(el) { 317 | return TGT in el && options.has(el[TGT]) 318 | ? options.get(el[TGT]) 319 | : { duration: 250, easing: "ease-in-out" }; 320 | } 321 | /** 322 | * Returns the target of a given animation (generally the parent). 323 | * @param el - An element to check for a target 324 | * @returns 325 | */ 326 | function getTarget(el) { 327 | if (TGT in el) 328 | return el[TGT]; 329 | return undefined; 330 | } 331 | /** 332 | * Checks if animations are enabled or disabled for a given element. 333 | * @param el - Any element 334 | * @returns 335 | */ 336 | function isEnabled(el) { 337 | const target = getTarget(el); 338 | return target ? enabled.has(target) : false; 339 | } 340 | /** 341 | * Iterate over the children of a given parent. 342 | * @param parent - A parent element 343 | * @param callback - A callback 344 | */ 345 | function forEach(parent, ...callbacks) { 346 | callbacks.forEach((callback) => callback(parent, options.has(parent))); 347 | for (let i = 0; i < parent.children.length; i++) { 348 | const child = parent.children.item(i); 349 | if (child) { 350 | callbacks.forEach((callback) => callback(child, options.has(child))); 351 | } 352 | } 353 | } 354 | /** 355 | * The element in question is remaining in the DOM. 356 | * @param el - Element to flip 357 | * @returns 358 | */ 359 | function remain(el) { 360 | const oldCoords = coords.get(el); 361 | const newCoords = getCoords(el); 362 | if (!isEnabled(el)) 363 | return coords.set(el, newCoords); 364 | let animation; 365 | if (!oldCoords) 366 | return; 367 | const pluginOrOptions = getOptions(el); 368 | if (typeof pluginOrOptions !== "function") { 369 | const deltaX = oldCoords.left - newCoords.left; 370 | const deltaY = oldCoords.top - newCoords.top; 371 | const [widthFrom, widthTo, heightFrom, heightTo] = getTransitionSizes(el, oldCoords, newCoords); 372 | const start = { 373 | transform: `translate(${deltaX}px, ${deltaY}px)`, 374 | }; 375 | const end = { 376 | transform: `translate(0, 0)`, 377 | }; 378 | if (widthFrom !== widthTo) { 379 | start.width = `${widthFrom}px`; 380 | end.width = `${widthTo}px`; 381 | } 382 | if (heightFrom !== heightTo) { 383 | start.height = `${heightFrom}px`; 384 | end.height = `${heightTo}px`; 385 | } 386 | animation = el.animate([start, end], { 387 | duration: pluginOrOptions.duration, 388 | easing: pluginOrOptions.easing, 389 | }); 390 | } 391 | else { 392 | animation = new Animation(pluginOrOptions(el, "remain", oldCoords, newCoords)); 393 | animation.play(); 394 | } 395 | animations.set(el, animation); 396 | coords.set(el, newCoords); 397 | animation.addEventListener("finish", updatePos.bind(null, el)); 398 | } 399 | /** 400 | * Adds the element with a transition. 401 | * @param el - Animates the element being added. 402 | */ 403 | function add(el) { 404 | const newCoords = getCoords(el); 405 | coords.set(el, newCoords); 406 | const pluginOrOptions = getOptions(el); 407 | if (!isEnabled(el)) 408 | return; 409 | let animation; 410 | if (typeof pluginOrOptions !== "function") { 411 | animation = el.animate([ 412 | { transform: "scale(.98)", opacity: 0 }, 413 | { transform: "scale(0.98)", opacity: 0, offset: 0.5 }, 414 | { transform: "scale(1)", opacity: 1 }, 415 | ], { 416 | duration: pluginOrOptions.duration * 1.5, 417 | easing: "ease-in", 418 | }); 419 | } 420 | else { 421 | animation = new Animation(pluginOrOptions(el, "add", newCoords)); 422 | animation.play(); 423 | } 424 | animations.set(el, animation); 425 | animation.addEventListener("finish", updatePos.bind(null, el)); 426 | } 427 | /** 428 | * Animates the removal of an element. 429 | * @param el - Element to remove 430 | */ 431 | function remove(el) { 432 | var _a; 433 | if (!siblings.has(el) || !coords.has(el)) 434 | return; 435 | const [prev, next] = siblings.get(el); 436 | Object.defineProperty(el, DEL, { value: true }); 437 | if (next && next.parentNode && next.parentNode instanceof Element) { 438 | next.parentNode.insertBefore(el, next); 439 | } 440 | else if (prev && prev.parentNode) { 441 | prev.parentNode.appendChild(el); 442 | } 443 | else { 444 | (_a = getTarget(el)) === null || _a === void 0 ? void 0 : _a.appendChild(el); 445 | } 446 | function cleanUp() { 447 | var _a; 448 | el.remove(); 449 | coords.delete(el); 450 | siblings.delete(el); 451 | animations.delete(el); 452 | (_a = intersections.get(el)) === null || _a === void 0 ? void 0 : _a.disconnect(); 453 | } 454 | if (!isEnabled(el)) 455 | return cleanUp(); 456 | const [top, left, width, height] = deletePosition(el); 457 | const optionsOrPlugin = getOptions(el); 458 | const oldCoords = coords.get(el); 459 | let animation; 460 | Object.assign(el.style, { 461 | position: "absolute", 462 | top: `${top}px`, 463 | left: `${left}px`, 464 | width: `${width}px`, 465 | height: `${height}px`, 466 | margin: 0, 467 | pointerEvents: "none", 468 | transformOrigin: "center", 469 | zIndex: 100, 470 | }); 471 | if (typeof optionsOrPlugin !== "function") { 472 | animation = el.animate([ 473 | { 474 | transform: "scale(1)", 475 | opacity: 1, 476 | }, 477 | { 478 | transform: "scale(.98)", 479 | opacity: 0, 480 | }, 481 | ], { duration: optionsOrPlugin.duration, easing: "ease-out" }); 482 | } 483 | else { 484 | animation = new Animation(optionsOrPlugin(el, "remove", oldCoords)); 485 | animation.play(); 486 | } 487 | animations.set(el, animation); 488 | animation.addEventListener("finish", cleanUp); 489 | } 490 | function deletePosition(el) { 491 | const oldCoords = coords.get(el); 492 | const [width, , height] = getTransitionSizes(el, oldCoords, getCoords(el)); 493 | let offsetParent = el.parentElement; 494 | while (offsetParent && 495 | (getComputedStyle(offsetParent).position === "static" || 496 | offsetParent instanceof HTMLBodyElement)) { 497 | offsetParent = offsetParent.parentElement; 498 | } 499 | if (!offsetParent) 500 | offsetParent = document.body; 501 | const parentStyles = getComputedStyle(offsetParent); 502 | const parentCoords = coords.get(offsetParent) || getCoords(offsetParent); 503 | const top = Math.round(oldCoords.top - parentCoords.top) - 504 | raw(parentStyles.borderTopWidth); 505 | const left = Math.round(oldCoords.left - parentCoords.left) - 506 | raw(parentStyles.borderLeftWidth); 507 | return [top, left, width, height]; 508 | } 509 | /** 510 | * A function that automatically adds animation effects to itself and its 511 | * immediate children. Specifically it adds effects for adding, moving, and 512 | * removing DOM elements. 513 | * @param el - A parent element to add animations to. 514 | * @param options - An optional object of options. 515 | */ 516 | function autoAnimate(el, config = {}) { 517 | if (mutations && resize) { 518 | const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)"); 519 | const isDisabledDueToReduceMotion = mediaQuery.matches && 520 | typeof config !== "function" && 521 | !config.disrespectUserMotionPreference; 522 | if (!isDisabledDueToReduceMotion) { 523 | enabled.add(el); 524 | if (getComputedStyle(el).position === "static") { 525 | Object.assign(el.style, { position: "relative" }); 526 | } 527 | forEach(el, updatePos, poll, (element) => resize === null || resize === void 0 ? void 0 : resize.observe(element)); 528 | if (typeof config === "function") { 529 | options.set(el, config); 530 | } 531 | else { 532 | options.set(el, { duration: 250, easing: "ease-in-out", ...config }); 533 | } 534 | mutations.observe(el, { childList: true }); 535 | parents.add(el); 536 | } 537 | } 538 | return Object.freeze({ 539 | parent: el, 540 | enable: () => { 541 | enabled.add(el); 542 | }, 543 | disable: () => { 544 | enabled.delete(el); 545 | }, 546 | isEnabled: () => enabled.has(el), 547 | }); 548 | } 549 | 550 | let autoAnimateConfig = {}; 551 | 552 | function AutoAnimate(Alpine) { 553 | Alpine.directive('auto-animate', (el, { 554 | expression, 555 | modifiers 556 | }, { 557 | evaluateLater, 558 | effect 559 | }) => { 560 | let config = {}; 561 | const durationModifier = modifiers.filter(modifier => modifier.match(/^\d+m?s$/))[0] || null; 562 | 563 | if (durationModifier) { 564 | const inMilliseconds = !!durationModifier.match(/ms$/); 565 | const matchedDuration = +durationModifier.match(/^\d+/); 566 | config.duration = matchedDuration * (inMilliseconds ? 1 : 1000); 567 | } 568 | 569 | const easingModifier = modifiers.filter(modifier => !modifier.match(/^\d+m?s$/))[0] || null; 570 | 571 | if (easingModifier) { 572 | config.easing = easingModifier; 573 | } 574 | 575 | const controller = autoAnimate(el, { ...autoAnimateConfig, 576 | ...config 577 | }); 578 | 579 | if (expression) { 580 | const isEnabled = evaluateLater(expression); 581 | effect(() => { 582 | isEnabled(enabled => { 583 | if (enabled) { 584 | controller.enable(); 585 | } else { 586 | controller.disable(); 587 | } 588 | }); 589 | }); 590 | } 591 | }); 592 | } 593 | 594 | AutoAnimate.configure = config => { 595 | autoAnimateConfig = config; 596 | }; 597 | 598 | document.addEventListener('alpine:init', () => { 599 | AutoAnimate(window.Alpine); 600 | }); 601 | 602 | })); 603 | //# sourceMappingURL=alpine-auto-animate.js.map 604 | -------------------------------------------------------------------------------- /dist/alpine-auto-animate.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"alpine-auto-animate.js","sources":["../node_modules/@formkit/auto-animate/index.mjs","../src/index.js","../builds/cdn.js"],"sourcesContent":["/**\n * A set of all the parents currently being observe. This is the only non weak\n * registry.\n */\nconst parents = new Set();\n/**\n * Element coordinates that is constantly kept up to date.\n */\nconst coords = new WeakMap();\n/**\n * Siblings of elements that have been removed from the dom.\n */\nconst siblings = new WeakMap();\n/**\n * Animations that are currently running.\n */\nconst animations = new WeakMap();\n/**\n * A map of existing intersection observers used to track element movements.\n */\nconst intersections = new WeakMap();\n/**\n * Intervals for automatically checking the position of elements occasionally.\n */\nconst intervals = new WeakMap();\n/**\n * The configuration options for each group of elements.\n */\nconst options = new WeakMap();\n/**\n * Debounce counters by id, used to debounce calls to update positions.\n */\nconst debounces = new WeakMap();\n/**\n * All parents that are currently enabled are tracked here.\n */\nconst enabled = new WeakSet();\n/**\n * The document used to calculate transitions.\n */\nlet root;\n/**\n * Used to sign an element as the target.\n */\nconst TGT = \"__aa_tgt\";\n/**\n * Used to sign an element as being part of a removal.\n */\nconst DEL = \"__aa_del\";\n/**\n * Callback for handling all mutations.\n * @param mutations - A mutation list\n */\nconst handleMutations = (mutations) => {\n const elements = getElements(mutations);\n // If elements is \"false\" that means this mutation that should be ignored.\n if (elements) {\n elements.forEach((el) => animate(el));\n }\n};\n/**\n *\n * @param entries - Elements that have been resized.\n */\nconst handleResizes = (entries) => {\n entries.forEach((entry) => {\n if (entry.target === root)\n updateAllPos();\n if (coords.has(entry.target))\n updatePos(entry.target);\n });\n};\n/**\n * Observe this elements position.\n * @param el - The element to observe the position of.\n */\nfunction observePosition(el) {\n const oldObserver = intersections.get(el);\n oldObserver === null || oldObserver === void 0 ? void 0 : oldObserver.disconnect();\n let rect = coords.get(el);\n let invocations = 0;\n const buffer = 5;\n if (!rect) {\n rect = getCoords(el);\n coords.set(el, rect);\n }\n const { offsetWidth, offsetHeight } = root;\n const rootMargins = [\n rect.top - buffer,\n offsetWidth - (rect.left + buffer + rect.width),\n offsetHeight - (rect.top + buffer + rect.height),\n rect.left - buffer,\n ];\n const rootMargin = rootMargins\n .map((px) => `${-1 * Math.floor(px)}px`)\n .join(\" \");\n const observer = new IntersectionObserver(() => {\n ++invocations > 1 && updatePos(el);\n }, {\n root,\n threshold: 1,\n rootMargin,\n });\n observer.observe(el);\n intersections.set(el, observer);\n}\n/**\n * Update the exact position of a given element.\n * @param el - An element to update the position of.\n */\nfunction updatePos(el) {\n clearTimeout(debounces.get(el));\n const optionsOrPlugin = getOptions(el);\n const delay = typeof optionsOrPlugin === \"function\" ? 500 : optionsOrPlugin.duration;\n debounces.set(el, setTimeout(async () => {\n const currentAnimation = animations.get(el);\n if (!currentAnimation || (await currentAnimation.finished)) {\n coords.set(el, getCoords(el));\n observePosition(el);\n }\n }, delay));\n}\n/**\n * Updates all positions that are currently being tracked.\n */\nfunction updateAllPos() {\n clearTimeout(debounces.get(root));\n debounces.set(root, setTimeout(() => {\n parents.forEach((parent) => forEach(parent, (el) => lowPriority(() => updatePos(el))));\n }, 100));\n}\n/**\n * Its possible for a quick scroll or other fast events to get past the\n * intersection observer, so occasionally we need want \"cold-poll\" for the\n * latests and greatest position. We try to do this in the most non-disruptive\n * fashion possible. First we only do this ever couple seconds, staggard by a\n * random offset.\n * @param el - Element\n */\nfunction poll(el) {\n setTimeout(() => {\n intervals.set(el, setInterval(() => lowPriority(updatePos.bind(null, el)), 2000));\n }, Math.round(2000 * Math.random()));\n}\n/**\n * Perform some operation that is non critical at some point.\n * @param callback\n */\nfunction lowPriority(callback) {\n if (typeof requestIdleCallback === \"function\") {\n requestIdleCallback(() => callback());\n }\n else {\n requestAnimationFrame(() => callback());\n }\n}\n/**\n * The mutation observer responsible for watching each root element.\n */\nlet mutations;\n/**\n * A resize observer, responsible for recalculating elements on resize.\n */\nlet resize;\n/**\n * If this is in a browser, initialize our Web APIs\n */\nif (typeof window !== \"undefined\") {\n root = document.documentElement;\n mutations = new MutationObserver(handleMutations);\n resize = new ResizeObserver(handleResizes);\n resize.observe(root);\n}\n/**\n * Retrieves all the elements that may have been affected by the last mutation\n * including ones that have been removed and are no longer in the DOM.\n * @param mutations - A mutation list.\n * @returns\n */\nfunction getElements(mutations) {\n return mutations.reduce((elements, mutation) => {\n // Short circuit if we find a purposefully deleted node.\n if (elements === false)\n return false;\n if (mutation.target instanceof Element) {\n target(mutation.target);\n if (!elements.has(mutation.target)) {\n elements.add(mutation.target);\n for (let i = 0; i < mutation.target.children.length; i++) {\n const child = mutation.target.children.item(i);\n if (!child)\n continue;\n if (DEL in child)\n return false;\n target(mutation.target, child);\n elements.add(child);\n }\n }\n if (mutation.removedNodes.length) {\n for (let i = 0; i < mutation.removedNodes.length; i++) {\n const child = mutation.removedNodes[i];\n if (DEL in child)\n return false;\n if (child instanceof Element) {\n elements.add(child);\n target(mutation.target, child);\n siblings.set(child, [\n mutation.previousSibling,\n mutation.nextSibling,\n ]);\n }\n }\n }\n }\n return elements;\n }, new Set());\n}\n/**\n * Assign the target to an element.\n * @param el - The root element\n * @param child\n */\nfunction target(el, child) {\n if (!child && !(TGT in el))\n Object.defineProperty(el, TGT, { value: el });\n else if (child && !(TGT in child))\n Object.defineProperty(child, TGT, { value: el });\n}\n/**\n * Determines what kind of change took place on the given element and then\n * performs the proper animation based on that.\n * @param el - The specific element to animate.\n */\nfunction animate(el) {\n var _a;\n const isMounted = root.contains(el);\n const preExisting = coords.has(el);\n if (isMounted && siblings.has(el))\n siblings.delete(el);\n if (animations.has(el)) {\n (_a = animations.get(el)) === null || _a === void 0 ? void 0 : _a.cancel();\n }\n if (preExisting && isMounted) {\n remain(el);\n }\n else if (preExisting && !isMounted) {\n remove(el);\n }\n else {\n add(el);\n }\n}\n/**\n * Removes all non-digits from a string and casts to a number.\n * @param str - A string containing a pixel value.\n * @returns\n */\nfunction raw(str) {\n return Number(str.replace(/[^0-9.\\-]/g, \"\"));\n}\n/**\n * Get the coordinates of elements adjusted for scroll position.\n * @param el - Element\n * @returns\n */\nfunction getCoords(el) {\n const rect = el.getBoundingClientRect();\n return {\n top: rect.top + window.scrollY,\n left: rect.left + window.scrollX,\n width: rect.width,\n height: rect.height,\n };\n}\n/**\n * Returns the width/height that the element should be transitioned between.\n * This takes into account box-sizing.\n * @param el - Element being animated\n * @param oldCoords - Old set of Coordinates coordinates\n * @param newCoords - New set of Coordinates coordinates\n * @returns\n */\nfunction getTransitionSizes(el, oldCoords, newCoords) {\n let widthFrom = oldCoords.width;\n let heightFrom = oldCoords.height;\n let widthTo = newCoords.width;\n let heightTo = newCoords.height;\n const styles = getComputedStyle(el);\n const sizing = styles.getPropertyValue(\"box-sizing\");\n if (sizing === \"content-box\") {\n const paddingY = raw(styles.paddingTop) +\n raw(styles.paddingBottom) +\n raw(styles.borderTopWidth) +\n raw(styles.borderBottomWidth);\n const paddingX = raw(styles.paddingLeft) +\n raw(styles.paddingRight) +\n raw(styles.borderRightWidth) +\n raw(styles.borderLeftWidth);\n widthFrom -= paddingX;\n widthTo -= paddingX;\n heightFrom -= paddingY;\n heightTo -= paddingY;\n }\n return [widthFrom, widthTo, heightFrom, heightTo].map(Math.round);\n}\n/**\n * Retrieves animation options for the current element.\n * @param el - Element to retrieve options for.\n * @returns\n */\nfunction getOptions(el) {\n return TGT in el && options.has(el[TGT])\n ? options.get(el[TGT])\n : { duration: 250, easing: \"ease-in-out\" };\n}\n/**\n * Returns the target of a given animation (generally the parent).\n * @param el - An element to check for a target\n * @returns\n */\nfunction getTarget(el) {\n if (TGT in el)\n return el[TGT];\n return undefined;\n}\n/**\n * Checks if animations are enabled or disabled for a given element.\n * @param el - Any element\n * @returns\n */\nfunction isEnabled(el) {\n const target = getTarget(el);\n return target ? enabled.has(target) : false;\n}\n/**\n * Iterate over the children of a given parent.\n * @param parent - A parent element\n * @param callback - A callback\n */\nfunction forEach(parent, ...callbacks) {\n callbacks.forEach((callback) => callback(parent, options.has(parent)));\n for (let i = 0; i < parent.children.length; i++) {\n const child = parent.children.item(i);\n if (child) {\n callbacks.forEach((callback) => callback(child, options.has(child)));\n }\n }\n}\n/**\n * The element in question is remaining in the DOM.\n * @param el - Element to flip\n * @returns\n */\nfunction remain(el) {\n const oldCoords = coords.get(el);\n const newCoords = getCoords(el);\n if (!isEnabled(el))\n return coords.set(el, newCoords);\n let animation;\n if (!oldCoords)\n return;\n const pluginOrOptions = getOptions(el);\n if (typeof pluginOrOptions !== \"function\") {\n const deltaX = oldCoords.left - newCoords.left;\n const deltaY = oldCoords.top - newCoords.top;\n const [widthFrom, widthTo, heightFrom, heightTo] = getTransitionSizes(el, oldCoords, newCoords);\n const start = {\n transform: `translate(${deltaX}px, ${deltaY}px)`,\n };\n const end = {\n transform: `translate(0, 0)`,\n };\n if (widthFrom !== widthTo) {\n start.width = `${widthFrom}px`;\n end.width = `${widthTo}px`;\n }\n if (heightFrom !== heightTo) {\n start.height = `${heightFrom}px`;\n end.height = `${heightTo}px`;\n }\n animation = el.animate([start, end], {\n duration: pluginOrOptions.duration,\n easing: pluginOrOptions.easing,\n });\n }\n else {\n animation = new Animation(pluginOrOptions(el, \"remain\", oldCoords, newCoords));\n animation.play();\n }\n animations.set(el, animation);\n coords.set(el, newCoords);\n animation.addEventListener(\"finish\", updatePos.bind(null, el));\n}\n/**\n * Adds the element with a transition.\n * @param el - Animates the element being added.\n */\nfunction add(el) {\n const newCoords = getCoords(el);\n coords.set(el, newCoords);\n const pluginOrOptions = getOptions(el);\n if (!isEnabled(el))\n return;\n let animation;\n if (typeof pluginOrOptions !== \"function\") {\n animation = el.animate([\n { transform: \"scale(.98)\", opacity: 0 },\n { transform: \"scale(0.98)\", opacity: 0, offset: 0.5 },\n { transform: \"scale(1)\", opacity: 1 },\n ], {\n duration: pluginOrOptions.duration * 1.5,\n easing: \"ease-in\",\n });\n }\n else {\n animation = new Animation(pluginOrOptions(el, \"add\", newCoords));\n animation.play();\n }\n animations.set(el, animation);\n animation.addEventListener(\"finish\", updatePos.bind(null, el));\n}\n/**\n * Animates the removal of an element.\n * @param el - Element to remove\n */\nfunction remove(el) {\n var _a;\n if (!siblings.has(el) || !coords.has(el))\n return;\n const [prev, next] = siblings.get(el);\n Object.defineProperty(el, DEL, { value: true });\n if (next && next.parentNode && next.parentNode instanceof Element) {\n next.parentNode.insertBefore(el, next);\n }\n else if (prev && prev.parentNode) {\n prev.parentNode.appendChild(el);\n }\n else {\n (_a = getTarget(el)) === null || _a === void 0 ? void 0 : _a.appendChild(el);\n }\n function cleanUp() {\n var _a;\n el.remove();\n coords.delete(el);\n siblings.delete(el);\n animations.delete(el);\n (_a = intersections.get(el)) === null || _a === void 0 ? void 0 : _a.disconnect();\n }\n if (!isEnabled(el))\n return cleanUp();\n const [top, left, width, height] = deletePosition(el);\n const optionsOrPlugin = getOptions(el);\n const oldCoords = coords.get(el);\n let animation;\n Object.assign(el.style, {\n position: \"absolute\",\n top: `${top}px`,\n left: `${left}px`,\n width: `${width}px`,\n height: `${height}px`,\n margin: 0,\n pointerEvents: \"none\",\n transformOrigin: \"center\",\n zIndex: 100,\n });\n if (typeof optionsOrPlugin !== \"function\") {\n animation = el.animate([\n {\n transform: \"scale(1)\",\n opacity: 1,\n },\n {\n transform: \"scale(.98)\",\n opacity: 0,\n },\n ], { duration: optionsOrPlugin.duration, easing: \"ease-out\" });\n }\n else {\n animation = new Animation(optionsOrPlugin(el, \"remove\", oldCoords));\n animation.play();\n }\n animations.set(el, animation);\n animation.addEventListener(\"finish\", cleanUp);\n}\nfunction deletePosition(el) {\n const oldCoords = coords.get(el);\n const [width, , height] = getTransitionSizes(el, oldCoords, getCoords(el));\n let offsetParent = el.parentElement;\n while (offsetParent &&\n (getComputedStyle(offsetParent).position === \"static\" ||\n offsetParent instanceof HTMLBodyElement)) {\n offsetParent = offsetParent.parentElement;\n }\n if (!offsetParent)\n offsetParent = document.body;\n const parentStyles = getComputedStyle(offsetParent);\n const parentCoords = coords.get(offsetParent) || getCoords(offsetParent);\n const top = Math.round(oldCoords.top - parentCoords.top) -\n raw(parentStyles.borderTopWidth);\n const left = Math.round(oldCoords.left - parentCoords.left) -\n raw(parentStyles.borderLeftWidth);\n return [top, left, width, height];\n}\n/**\n * A function that automatically adds animation effects to itself and its\n * immediate children. Specifically it adds effects for adding, moving, and\n * removing DOM elements.\n * @param el - A parent element to add animations to.\n * @param options - An optional object of options.\n */\nfunction autoAnimate(el, config = {}) {\n if (mutations && resize) {\n const mediaQuery = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n const isDisabledDueToReduceMotion = mediaQuery.matches &&\n typeof config !== \"function\" &&\n !config.disrespectUserMotionPreference;\n if (!isDisabledDueToReduceMotion) {\n enabled.add(el);\n if (getComputedStyle(el).position === \"static\") {\n Object.assign(el.style, { position: \"relative\" });\n }\n forEach(el, updatePos, poll, (element) => resize === null || resize === void 0 ? void 0 : resize.observe(element));\n if (typeof config === \"function\") {\n options.set(el, config);\n }\n else {\n options.set(el, { duration: 250, easing: \"ease-in-out\", ...config });\n }\n mutations.observe(el, { childList: true });\n parents.add(el);\n }\n }\n return Object.freeze({\n parent: el,\n enable: () => {\n enabled.add(el);\n },\n disable: () => {\n enabled.delete(el);\n },\n isEnabled: () => enabled.has(el),\n });\n}\n/**\n * The vue directive.\n */\nconst vAutoAnimate = {\n mounted: (el, binding) => {\n autoAnimate(el, binding.value || {});\n },\n};\n\nexport { autoAnimate as default, getTransitionSizes, vAutoAnimate };\n","import autoAnimate from '@formkit/auto-animate';\n\nlet autoAnimateConfig = {};\n\nfunction AutoAnimate(Alpine) {\n Alpine.directive('auto-animate', (el, { expression, modifiers }, { evaluateLater, effect }) => {\n let config = {};\n const durationModifier = modifiers.filter((modifier) => modifier.match(/^\\d+m?s$/))[0] || null;\n if (durationModifier) {\n const inMilliseconds = !!durationModifier.match(/ms$/);\n const matchedDuration = + durationModifier.match(/^\\d+/);\n config.duration = matchedDuration * (inMilliseconds ? 1 : 1000);\n }\n const easingModifier = modifiers.filter((modifier) => !modifier.match(/^\\d+m?s$/))[0] || null;\n if (easingModifier) {\n config.easing = easingModifier;\n }\n const controller = autoAnimate(el, { ...autoAnimateConfig, ...config });\n if (expression) {\n const isEnabled = evaluateLater(expression);\n effect(() => {\n isEnabled((enabled) => {\n if (enabled) {\n controller.enable();\n } else {\n controller.disable();\n }\n });\n })\n }\n });\n}\n\nAutoAnimate.configure = (config) => {\n autoAnimateConfig = config;\n};\n\nexport default AutoAnimate;\n","import AutoAnimate from \"../src/index.js\";\n\ndocument.addEventListener('alpine:init', () => {\n AutoAnimate(window.Alpine);\n});\n"],"names":["autoAnimateConfig","AutoAnimate","Alpine","directive","el","expression","modifiers","evaluateLater","effect","config","durationModifier","filter","modifier","match","inMilliseconds","matchedDuration","duration","easingModifier","easing","controller","autoAnimate","isEnabled","enabled","enable","disable","configure","document","addEventListener","window"],"mappings":";;;;;IAAA;IACA;IACA;IACA;IACA,MAAM,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAC1B;IACA;IACA;IACA,MAAM,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;IAC7B;IACA;IACA;IACA,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAE,CAAC;IAC/B;IACA;IACA;IACA,MAAM,UAAU,GAAG,IAAI,OAAO,EAAE,CAAC;IACjC;IACA;IACA;IACA,MAAM,aAAa,GAAG,IAAI,OAAO,EAAE,CAAC;IACpC;IACA;IACA;IACA,MAAM,SAAS,GAAG,IAAI,OAAO,EAAE,CAAC;IAChC;IACA;IACA;IACA,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B;IACA;IACA;IACA,MAAM,SAAS,GAAG,IAAI,OAAO,EAAE,CAAC;IAChC;IACA;IACA;IACA,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC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,EAAA,CAAA;IACH,WAFD,MAEO;IACHJ,YAAAA,UAAU,CAACK,OAAX,EAAA,CAAA;IACH,WAAA;IACJ,SANQ,CAAT,CAAA;IAOH,OARK,CAAN,CAAA;IASH,KAAA;OAxBL,CAAA,CAAA;IA0BH,CAAA;;IAEDvB,WAAW,CAACwB,SAAZ,GAAyBhB,MAAD,IAAY;IAChCT,EAAAA,iBAAiB,GAAGS,MAApB,CAAA;IACH,CAFD;;IC/BAiB,QAAQ,CAACC,gBAAT,CAA0B,aAA1B,EAAyC,MAAM;IAC3C1B,EAAAA,WAAW,CAAC2B,MAAM,CAAC1B,MAAR,CAAX,CAAA;IACH,CAFD,CAAA;;;;;;"} -------------------------------------------------------------------------------- /dist/alpine-auto-animate.min.js: -------------------------------------------------------------------------------- 1 | !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e=new Set,t=new WeakMap,n=new WeakMap,i=new WeakMap,o=new WeakMap,a=new WeakMap,r=new WeakMap,s=new WeakMap,d=new WeakSet;let c;const l="__aa_tgt",f="__aa_del",u=e=>{const a=function(e){return e.reduce(((e,t)=>{if(!1===e)return!1;if(t.target instanceof Element){if(v(t.target),!e.has(t.target)){e.add(t.target);for(let n=0;nfunction(e){var a;const r=c.contains(e),s=t.has(e);r&&n.has(e)&&n.delete(e);i.has(e)&&(null===(a=i.get(e))||void 0===a||a.cancel());s&&r?function(e){const n=t.get(e),o=E(e);if(!$(e))return t.set(e,o);let a;if(!n)return;const r=x(e);if("function"!=typeof r){const t=n.left-o.left,i=n.top-o.top,[s,d,c,l]=M(e,n,o),f={transform:`translate(${t}px, ${i}px)`},u={transform:"translate(0, 0)"};s!==d&&(f.width=`${s}px`,u.width=`${d}px`),c!==l&&(f.height=`${c}px`,u.height=`${l}px`),a=e.animate([f,u],{duration:r.duration,easing:r.easing})}else a=new Animation(r(e,"remain",n,o)),a.play();i.set(e,a),t.set(e,o),a.addEventListener("finish",h.bind(null,e))}(e):s&&!r?function(e){var a;if(!n.has(e)||!t.has(e))return;const[r,s]=n.get(e);Object.defineProperty(e,f,{value:!0}),s&&s.parentNode&&s.parentNode instanceof Element?s.parentNode.insertBefore(e,s):r&&r.parentNode?r.parentNode.appendChild(e):null===(a=W(e))||void 0===a||a.appendChild(e);function d(){var a;e.remove(),t.delete(e),n.delete(e),i.delete(e),null===(a=o.get(e))||void 0===a||a.disconnect()}if(!$(e))return d();const[c,l,u,p]=function(e){const n=t.get(e),[i,,o]=M(e,n,E(e));let a=e.parentElement;for(;a&&("static"===getComputedStyle(a).position||a instanceof HTMLBodyElement);)a=a.parentElement;a||(a=document.body);const r=getComputedStyle(a),s=t.get(a)||E(a),d=Math.round(n.top-s.top)-y(r.borderTopWidth),c=Math.round(n.left-s.left)-y(r.borderLeftWidth);return[d,c,i,o]}(e),h=x(e),g=t.get(e);let m;Object.assign(e.style,{position:"absolute",top:`${c}px`,left:`${l}px`,width:`${u}px`,height:`${p}px`,margin:0,pointerEvents:"none",transformOrigin:"center",zIndex:100}),"function"!=typeof h?m=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:h.duration,easing:"ease-out"}):(m=new Animation(h(e,"remove",g)),m.play());i.set(e,m),m.addEventListener("finish",d)}(e):function(e){const n=E(e);t.set(e,n);const o=x(e);if(!$(e))return;let a;"function"!=typeof o?a=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:1.5*o.duration,easing:"ease-in"}):(a=new Animation(o(e,"add",n)),a.play());i.set(e,a),a.addEventListener("finish",h.bind(null,e))}(e)}(e)))},p=n=>{n.forEach((n=>{n.target===c&&(clearTimeout(s.get(c)),s.set(c,setTimeout((()=>{e.forEach((e=>k(e,(e=>m((()=>h(e)))))))}),100))),t.has(n.target)&&h(n.target)}))};function h(e){clearTimeout(s.get(e));const n=x(e),a="function"==typeof n?500:n.duration;s.set(e,setTimeout((async()=>{const n=i.get(e);n&&!await n.finished||(t.set(e,E(e)),function(e){const n=o.get(e);null==n||n.disconnect();let i=t.get(e),a=0;i||(i=E(e),t.set(e,i));const{offsetWidth:r,offsetHeight:s}=c,d=[i.top-5,r-(i.left+5+i.width),s-(i.top+5+i.height),i.left-5].map((e=>-1*Math.floor(e)+"px")).join(" "),l=new IntersectionObserver((()=>{++a>1&&h(e)}),{root:c,threshold:1,rootMargin:d});l.observe(e),o.set(e,l)}(e))}),a))}function g(e){setTimeout((()=>{a.set(e,setInterval((()=>m(h.bind(null,e))),2e3))}),Math.round(2e3*Math.random()))}function m(e){"function"==typeof requestIdleCallback?requestIdleCallback((()=>e())):requestAnimationFrame((()=>e()))}let b,w;function v(e,t){t||l in e?t&&!(l in t)&&Object.defineProperty(t,l,{value:e}):Object.defineProperty(e,l,{value:e})}function y(e){return Number(e.replace(/[^0-9.\-]/g,""))}function E(e){const t=e.getBoundingClientRect();return{top:t.top+window.scrollY,left:t.left+window.scrollX,width:t.width,height:t.height}}function M(e,t,n){let i=t.width,o=t.height,a=n.width,r=n.height;const s=getComputedStyle(e);if("content-box"===s.getPropertyValue("box-sizing")){const e=y(s.paddingTop)+y(s.paddingBottom)+y(s.borderTopWidth)+y(s.borderBottomWidth),t=y(s.paddingLeft)+y(s.paddingRight)+y(s.borderRightWidth)+y(s.borderLeftWidth);i-=t,a-=t,o-=e,r-=e}return[i,a,o,r].map(Math.round)}function x(e){return l in e&&r.has(e[l])?r.get(e[l]):{duration:250,easing:"ease-in-out"}}function W(e){if(l in e)return e[l]}function $(e){const t=W(e);return!!t&&d.has(t)}function k(e,...t){t.forEach((t=>t(e,r.has(e))));for(let n=0;ne(i,r.has(i))))}}"undefined"!=typeof window&&(c=document.documentElement,b=new MutationObserver(u),w=new ResizeObserver(p),w.observe(c));let L={};function O(t){t.directive("auto-animate",((t,{expression:n,modifiers:i},{evaluateLater:o,effect:a})=>{let s={};const c=i.filter((e=>e.match(/^\d+m?s$/)))[0]||null;if(c){const e=!!c.match(/ms$/),t=+c.match(/^\d+/);s.duration=t*(e?1:1e3)}const l=i.filter((e=>!e.match(/^\d+m?s$/)))[0]||null;l&&(s.easing=l);const f=function(t,n={}){b&&w&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&"function"!=typeof n&&!n.disrespectUserMotionPreference||(d.add(t),"static"===getComputedStyle(t).position&&Object.assign(t.style,{position:"relative"}),k(t,h,g,(e=>null==w?void 0:w.observe(e))),"function"==typeof n?r.set(t,n):r.set(t,{duration:250,easing:"ease-in-out",...n}),b.observe(t,{childList:!0}),e.add(t)));return Object.freeze({parent:t,enable:()=>{d.add(t)},disable:()=>{d.delete(t)},isEnabled:()=>d.has(t)})}(t,{...L,...s});if(n){const e=o(n);a((()=>{e((e=>{e?f.enable():f.disable()}))}))}}))}O.configure=e=>{L=e},document.addEventListener("alpine:init",(()=>{O(window.Alpine)}))})); 2 | //# sourceMappingURL=alpine-auto-animate.min.js.map 3 | -------------------------------------------------------------------------------- /dist/alpine-auto-animate.min.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"alpine-auto-animate.min.js","sources":["../node_modules/@formkit/auto-animate/index.mjs","../src/index.js","../builds/cdn.js"],"sourcesContent":["/**\n * A set of all the parents currently being observe. This is the only non weak\n * registry.\n */\nconst parents = new Set();\n/**\n * Element coordinates that is constantly kept up to date.\n */\nconst coords = new WeakMap();\n/**\n * Siblings of elements that have been removed from the dom.\n */\nconst siblings = new WeakMap();\n/**\n * Animations that are currently running.\n */\nconst animations = new WeakMap();\n/**\n * A map of existing intersection observers used to track element movements.\n */\nconst intersections = new WeakMap();\n/**\n * Intervals for automatically checking the position of elements occasionally.\n */\nconst intervals = new WeakMap();\n/**\n * The configuration options for each group of elements.\n */\nconst options = new WeakMap();\n/**\n * Debounce counters by id, used to debounce calls to update positions.\n */\nconst debounces = new WeakMap();\n/**\n * All parents that are currently enabled are tracked here.\n */\nconst enabled = new WeakSet();\n/**\n * The document used to calculate transitions.\n */\nlet root;\n/**\n * Used to sign an element as the target.\n */\nconst TGT = \"__aa_tgt\";\n/**\n * Used to sign an element as being part of a removal.\n */\nconst DEL = \"__aa_del\";\n/**\n * Callback for handling all mutations.\n * @param mutations - A mutation list\n */\nconst handleMutations = (mutations) => {\n const elements = getElements(mutations);\n // If elements is \"false\" that means this mutation that should be ignored.\n if (elements) {\n elements.forEach((el) => animate(el));\n }\n};\n/**\n *\n * @param entries - Elements that have been resized.\n */\nconst handleResizes = (entries) => {\n entries.forEach((entry) => {\n if (entry.target === root)\n updateAllPos();\n if (coords.has(entry.target))\n updatePos(entry.target);\n });\n};\n/**\n * Observe this elements position.\n * @param el - The element to observe the position of.\n */\nfunction observePosition(el) {\n const oldObserver = intersections.get(el);\n oldObserver === null || oldObserver === void 0 ? void 0 : oldObserver.disconnect();\n let rect = coords.get(el);\n let invocations = 0;\n const buffer = 5;\n if (!rect) {\n rect = getCoords(el);\n coords.set(el, rect);\n }\n const { offsetWidth, offsetHeight } = root;\n const rootMargins = [\n rect.top - buffer,\n offsetWidth - (rect.left + buffer + rect.width),\n offsetHeight - (rect.top + buffer + rect.height),\n rect.left - buffer,\n ];\n const rootMargin = rootMargins\n .map((px) => `${-1 * Math.floor(px)}px`)\n .join(\" \");\n const observer = new IntersectionObserver(() => {\n ++invocations > 1 && updatePos(el);\n }, {\n root,\n threshold: 1,\n rootMargin,\n });\n observer.observe(el);\n intersections.set(el, observer);\n}\n/**\n * Update the exact position of a given element.\n * @param el - An element to update the position of.\n */\nfunction updatePos(el) {\n clearTimeout(debounces.get(el));\n const optionsOrPlugin = getOptions(el);\n const delay = typeof optionsOrPlugin === \"function\" ? 500 : optionsOrPlugin.duration;\n debounces.set(el, setTimeout(async () => {\n const currentAnimation = animations.get(el);\n if (!currentAnimation || (await currentAnimation.finished)) {\n coords.set(el, getCoords(el));\n observePosition(el);\n }\n }, delay));\n}\n/**\n * Updates all positions that are currently being tracked.\n */\nfunction updateAllPos() {\n clearTimeout(debounces.get(root));\n debounces.set(root, setTimeout(() => {\n parents.forEach((parent) => forEach(parent, (el) => lowPriority(() => updatePos(el))));\n }, 100));\n}\n/**\n * Its possible for a quick scroll or other fast events to get past the\n * intersection observer, so occasionally we need want \"cold-poll\" for the\n * latests and greatest position. We try to do this in the most non-disruptive\n * fashion possible. First we only do this ever couple seconds, staggard by a\n * random offset.\n * @param el - Element\n */\nfunction poll(el) {\n setTimeout(() => {\n intervals.set(el, setInterval(() => lowPriority(updatePos.bind(null, el)), 2000));\n }, Math.round(2000 * Math.random()));\n}\n/**\n * Perform some operation that is non critical at some point.\n * @param callback\n */\nfunction lowPriority(callback) {\n if (typeof requestIdleCallback === \"function\") {\n requestIdleCallback(() => callback());\n }\n else {\n requestAnimationFrame(() => callback());\n }\n}\n/**\n * The mutation observer responsible for watching each root element.\n */\nlet mutations;\n/**\n * A resize observer, responsible for recalculating elements on resize.\n */\nlet resize;\n/**\n * If this is in a browser, initialize our Web APIs\n */\nif (typeof window !== \"undefined\") {\n root = document.documentElement;\n mutations = new MutationObserver(handleMutations);\n resize = new ResizeObserver(handleResizes);\n resize.observe(root);\n}\n/**\n * Retrieves all the elements that may have been affected by the last mutation\n * including ones that have been removed and are no longer in the DOM.\n * @param mutations - A mutation list.\n * @returns\n */\nfunction getElements(mutations) {\n return mutations.reduce((elements, mutation) => {\n // Short circuit if we find a purposefully deleted node.\n if (elements === false)\n return false;\n if (mutation.target instanceof Element) {\n target(mutation.target);\n if (!elements.has(mutation.target)) {\n elements.add(mutation.target);\n for (let i = 0; i < mutation.target.children.length; i++) {\n const child = mutation.target.children.item(i);\n if (!child)\n continue;\n if (DEL in child)\n return false;\n target(mutation.target, child);\n elements.add(child);\n }\n }\n if (mutation.removedNodes.length) {\n for (let i = 0; i < mutation.removedNodes.length; i++) {\n const child = mutation.removedNodes[i];\n if (DEL in child)\n return false;\n if (child instanceof Element) {\n elements.add(child);\n target(mutation.target, child);\n siblings.set(child, [\n mutation.previousSibling,\n mutation.nextSibling,\n ]);\n }\n }\n }\n }\n return elements;\n }, new Set());\n}\n/**\n * Assign the target to an element.\n * @param el - The root element\n * @param child\n */\nfunction target(el, child) {\n if (!child && !(TGT in el))\n Object.defineProperty(el, TGT, { value: el });\n else if (child && !(TGT in child))\n Object.defineProperty(child, TGT, { value: el });\n}\n/**\n * Determines what kind of change took place on the given element and then\n * performs the proper animation based on that.\n * @param el - The specific element to animate.\n */\nfunction animate(el) {\n var _a;\n const isMounted = root.contains(el);\n const preExisting = coords.has(el);\n if (isMounted && siblings.has(el))\n siblings.delete(el);\n if (animations.has(el)) {\n (_a = animations.get(el)) === null || _a === void 0 ? void 0 : _a.cancel();\n }\n if (preExisting && isMounted) {\n remain(el);\n }\n else if (preExisting && !isMounted) {\n remove(el);\n }\n else {\n add(el);\n }\n}\n/**\n * Removes all non-digits from a string and casts to a number.\n * @param str - A string containing a pixel value.\n * @returns\n */\nfunction raw(str) {\n return Number(str.replace(/[^0-9.\\-]/g, \"\"));\n}\n/**\n * Get the coordinates of elements adjusted for scroll position.\n * @param el - Element\n * @returns\n */\nfunction getCoords(el) {\n const rect = el.getBoundingClientRect();\n return {\n top: rect.top + window.scrollY,\n left: rect.left + window.scrollX,\n width: rect.width,\n height: rect.height,\n };\n}\n/**\n * Returns the width/height that the element should be transitioned between.\n * This takes into account box-sizing.\n * @param el - Element being animated\n * @param oldCoords - Old set of Coordinates coordinates\n * @param newCoords - New set of Coordinates coordinates\n * @returns\n */\nfunction getTransitionSizes(el, oldCoords, newCoords) {\n let widthFrom = oldCoords.width;\n let heightFrom = oldCoords.height;\n let widthTo = newCoords.width;\n let heightTo = newCoords.height;\n const styles = getComputedStyle(el);\n const sizing = styles.getPropertyValue(\"box-sizing\");\n if (sizing === \"content-box\") {\n const paddingY = raw(styles.paddingTop) +\n raw(styles.paddingBottom) +\n raw(styles.borderTopWidth) +\n raw(styles.borderBottomWidth);\n const paddingX = raw(styles.paddingLeft) +\n raw(styles.paddingRight) +\n raw(styles.borderRightWidth) +\n raw(styles.borderLeftWidth);\n widthFrom -= paddingX;\n widthTo -= paddingX;\n heightFrom -= paddingY;\n heightTo -= paddingY;\n }\n return [widthFrom, widthTo, heightFrom, heightTo].map(Math.round);\n}\n/**\n * Retrieves animation options for the current element.\n * @param el - Element to retrieve options for.\n * @returns\n */\nfunction getOptions(el) {\n return TGT in el && options.has(el[TGT])\n ? options.get(el[TGT])\n : { duration: 250, easing: \"ease-in-out\" };\n}\n/**\n * Returns the target of a given animation (generally the parent).\n * @param el - An element to check for a target\n * @returns\n */\nfunction getTarget(el) {\n if (TGT in el)\n return el[TGT];\n return undefined;\n}\n/**\n * Checks if animations are enabled or disabled for a given element.\n * @param el - Any element\n * @returns\n */\nfunction isEnabled(el) {\n const target = getTarget(el);\n return target ? enabled.has(target) : false;\n}\n/**\n * Iterate over the children of a given parent.\n * @param parent - A parent element\n * @param callback - A callback\n */\nfunction forEach(parent, ...callbacks) {\n callbacks.forEach((callback) => callback(parent, options.has(parent)));\n for (let i = 0; i < parent.children.length; i++) {\n const child = parent.children.item(i);\n if (child) {\n callbacks.forEach((callback) => callback(child, options.has(child)));\n }\n }\n}\n/**\n * The element in question is remaining in the DOM.\n * @param el - Element to flip\n * @returns\n */\nfunction remain(el) {\n const oldCoords = coords.get(el);\n const newCoords = getCoords(el);\n if (!isEnabled(el))\n return coords.set(el, newCoords);\n let animation;\n if (!oldCoords)\n return;\n const pluginOrOptions = getOptions(el);\n if (typeof pluginOrOptions !== \"function\") {\n const deltaX = oldCoords.left - newCoords.left;\n const deltaY = oldCoords.top - newCoords.top;\n const [widthFrom, widthTo, heightFrom, heightTo] = getTransitionSizes(el, oldCoords, newCoords);\n const start = {\n transform: `translate(${deltaX}px, ${deltaY}px)`,\n };\n const end = {\n transform: `translate(0, 0)`,\n };\n if (widthFrom !== widthTo) {\n start.width = `${widthFrom}px`;\n end.width = `${widthTo}px`;\n }\n if (heightFrom !== heightTo) {\n start.height = `${heightFrom}px`;\n end.height = `${heightTo}px`;\n }\n animation = el.animate([start, end], {\n duration: pluginOrOptions.duration,\n easing: pluginOrOptions.easing,\n });\n }\n else {\n animation = new Animation(pluginOrOptions(el, \"remain\", oldCoords, newCoords));\n animation.play();\n }\n animations.set(el, animation);\n coords.set(el, newCoords);\n animation.addEventListener(\"finish\", updatePos.bind(null, el));\n}\n/**\n * Adds the element with a transition.\n * @param el - Animates the element being added.\n */\nfunction add(el) {\n const newCoords = getCoords(el);\n coords.set(el, newCoords);\n const pluginOrOptions = getOptions(el);\n if (!isEnabled(el))\n return;\n let animation;\n if (typeof pluginOrOptions !== \"function\") {\n animation = el.animate([\n { transform: \"scale(.98)\", opacity: 0 },\n { transform: \"scale(0.98)\", opacity: 0, offset: 0.5 },\n { transform: \"scale(1)\", opacity: 1 },\n ], {\n duration: pluginOrOptions.duration * 1.5,\n easing: \"ease-in\",\n });\n }\n else {\n animation = new Animation(pluginOrOptions(el, \"add\", newCoords));\n animation.play();\n }\n animations.set(el, animation);\n animation.addEventListener(\"finish\", updatePos.bind(null, el));\n}\n/**\n * Animates the removal of an element.\n * @param el - Element to remove\n */\nfunction remove(el) {\n var _a;\n if (!siblings.has(el) || !coords.has(el))\n return;\n const [prev, next] = siblings.get(el);\n Object.defineProperty(el, DEL, { value: true });\n if (next && next.parentNode && next.parentNode instanceof Element) {\n next.parentNode.insertBefore(el, next);\n }\n else if (prev && prev.parentNode) {\n prev.parentNode.appendChild(el);\n }\n else {\n (_a = getTarget(el)) === null || _a === void 0 ? void 0 : _a.appendChild(el);\n }\n function cleanUp() {\n var _a;\n el.remove();\n coords.delete(el);\n siblings.delete(el);\n animations.delete(el);\n (_a = intersections.get(el)) === null || _a === void 0 ? void 0 : _a.disconnect();\n }\n if (!isEnabled(el))\n return cleanUp();\n const [top, left, width, height] = deletePosition(el);\n const optionsOrPlugin = getOptions(el);\n const oldCoords = coords.get(el);\n let animation;\n Object.assign(el.style, {\n position: \"absolute\",\n top: `${top}px`,\n left: `${left}px`,\n width: `${width}px`,\n height: `${height}px`,\n margin: 0,\n pointerEvents: \"none\",\n transformOrigin: \"center\",\n zIndex: 100,\n });\n if (typeof optionsOrPlugin !== \"function\") {\n animation = el.animate([\n {\n transform: \"scale(1)\",\n opacity: 1,\n },\n {\n transform: \"scale(.98)\",\n opacity: 0,\n },\n ], { duration: optionsOrPlugin.duration, easing: \"ease-out\" });\n }\n else {\n animation = new Animation(optionsOrPlugin(el, \"remove\", oldCoords));\n animation.play();\n }\n animations.set(el, animation);\n animation.addEventListener(\"finish\", cleanUp);\n}\nfunction deletePosition(el) {\n const oldCoords = coords.get(el);\n const [width, , height] = getTransitionSizes(el, oldCoords, getCoords(el));\n let offsetParent = el.parentElement;\n while (offsetParent &&\n (getComputedStyle(offsetParent).position === \"static\" ||\n offsetParent instanceof HTMLBodyElement)) {\n offsetParent = offsetParent.parentElement;\n }\n if (!offsetParent)\n offsetParent = document.body;\n const parentStyles = getComputedStyle(offsetParent);\n const parentCoords = coords.get(offsetParent) || getCoords(offsetParent);\n const top = Math.round(oldCoords.top - parentCoords.top) -\n raw(parentStyles.borderTopWidth);\n const left = Math.round(oldCoords.left - parentCoords.left) -\n raw(parentStyles.borderLeftWidth);\n return [top, left, width, height];\n}\n/**\n * A function that automatically adds animation effects to itself and its\n * immediate children. Specifically it adds effects for adding, moving, and\n * removing DOM elements.\n * @param el - A parent element to add animations to.\n * @param options - An optional object of options.\n */\nfunction autoAnimate(el, config = {}) {\n if (mutations && resize) {\n const mediaQuery = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n const isDisabledDueToReduceMotion = mediaQuery.matches &&\n typeof config !== \"function\" &&\n !config.disrespectUserMotionPreference;\n if (!isDisabledDueToReduceMotion) {\n enabled.add(el);\n if (getComputedStyle(el).position === \"static\") {\n Object.assign(el.style, { position: \"relative\" });\n }\n forEach(el, updatePos, poll, (element) => resize === null || resize === void 0 ? void 0 : resize.observe(element));\n if (typeof config === \"function\") {\n options.set(el, config);\n }\n else {\n options.set(el, { duration: 250, easing: \"ease-in-out\", ...config });\n }\n mutations.observe(el, { childList: true });\n parents.add(el);\n }\n }\n return Object.freeze({\n parent: el,\n enable: () => {\n enabled.add(el);\n },\n disable: () => {\n enabled.delete(el);\n },\n isEnabled: () => enabled.has(el),\n });\n}\n/**\n * The vue directive.\n */\nconst vAutoAnimate = {\n mounted: (el, binding) => {\n autoAnimate(el, binding.value || {});\n },\n};\n\nexport { autoAnimate as default, getTransitionSizes, vAutoAnimate };\n","import autoAnimate from '@formkit/auto-animate';\n\nlet autoAnimateConfig = {};\n\nfunction AutoAnimate(Alpine) {\n Alpine.directive('auto-animate', (el, { expression, modifiers }, { evaluateLater, effect }) => {\n let config = {};\n const durationModifier = modifiers.filter((modifier) => modifier.match(/^\\d+m?s$/))[0] || null;\n if (durationModifier) {\n const inMilliseconds = !!durationModifier.match(/ms$/);\n const matchedDuration = + durationModifier.match(/^\\d+/);\n config.duration = matchedDuration * (inMilliseconds ? 1 : 1000);\n }\n const easingModifier = modifiers.filter((modifier) => !modifier.match(/^\\d+m?s$/))[0] || null;\n if (easingModifier) {\n config.easing = easingModifier;\n }\n const controller = autoAnimate(el, { ...autoAnimateConfig, ...config });\n if (expression) {\n const isEnabled = evaluateLater(expression);\n effect(() => {\n isEnabled((enabled) => {\n if (enabled) {\n controller.enable();\n } else {\n controller.disable();\n }\n });\n })\n }\n });\n}\n\nAutoAnimate.configure = (config) => {\n autoAnimateConfig = config;\n};\n\nexport default AutoAnimate;\n","import AutoAnimate from \"../src/index.js\";\n\ndocument.addEventListener('alpine:init', () => {\n AutoAnimate(window.Alpine);\n});\n"],"names":["parents","Set","coords","WeakMap","siblings","animations","intersections","intervals","options","debounces","enabled","WeakSet","root","TGT","DEL","handleMutations","mutations","elements","reduce","mutation","target","Element","has","add","i","children","length","child","item","removedNodes","set","previousSibling","nextSibling","getElements","forEach","el","_a","isMounted","contains","preExisting","delete","get","cancel","oldCoords","newCoords","getCoords","isEnabled","animation","pluginOrOptions","getOptions","deltaX","left","deltaY","top","widthFrom","widthTo","heightFrom","heightTo","getTransitionSizes","start","transform","end","width","height","animate","duration","easing","Animation","play","addEventListener","updatePos","bind","remain","prev","next","Object","defineProperty","value","parentNode","insertBefore","appendChild","getTarget","cleanUp","remove","disconnect","offsetParent","parentElement","getComputedStyle","position","HTMLBodyElement","document","body","parentStyles","parentCoords","Math","round","raw","borderTopWidth","borderLeftWidth","deletePosition","optionsOrPlugin","assign","style","margin","pointerEvents","transformOrigin","zIndex","opacity","offset","handleResizes","entries","entry","clearTimeout","setTimeout","parent","lowPriority","delay","async","currentAnimation","finished","oldObserver","rect","invocations","offsetWidth","offsetHeight","rootMargin","map","px","floor","join","observer","IntersectionObserver","threshold","observe","observePosition","poll","setInterval","random","callback","requestIdleCallback","requestAnimationFrame","resize","str","Number","replace","getBoundingClientRect","window","scrollY","scrollX","styles","getPropertyValue","paddingY","paddingTop","paddingBottom","borderBottomWidth","paddingX","paddingLeft","paddingRight","borderRightWidth","callbacks","documentElement","MutationObserver","ResizeObserver","autoAnimateConfig","AutoAnimate","Alpine","directive","expression","modifiers","evaluateLater","effect","config","durationModifier","filter","modifier","match","inMilliseconds","matchedDuration","easingModifier","controller","matchMedia","matches","disrespectUserMotionPreference","element","childList","freeze","enable","disable","autoAnimate","configure"],"mappings":"2FAIA,MAAMA,EAAU,IAAIC,IAIdC,EAAS,IAAIC,QAIbC,EAAW,IAAID,QAIfE,EAAa,IAAIF,QAIjBG,EAAgB,IAAIH,QAIpBI,EAAY,IAAIJ,QAIhBK,EAAU,IAAIL,QAIdM,EAAY,IAAIN,QAIhBO,EAAU,IAAIC,QAIpB,IAAIC,EAIJ,MAAMC,EAAM,WAINC,EAAM,WAKNC,EAAmBC,IACrB,MAAMC,EA6HV,SAAqBD,GACjB,OAAOA,EAAUE,QAAO,CAACD,EAAUE,KAE/B,IAAiB,IAAbF,EACA,OAAO,EACX,GAAIE,EAASC,kBAAkBC,QAAS,CAEpC,GADAD,EAAOD,EAASC,SACXH,EAASK,IAAIH,EAASC,QAAS,CAChCH,EAASM,IAAIJ,EAASC,QACtB,IAAK,IAAII,EAAI,E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GAAO,KACH5H,GAAWpC,IACHA,EACAyK,EAAWO,SAEXP,EAAWQ,SACd,GALL,GAQP,IAER,CAEDvB,EAAYyB,UAAalB,IACrBR,EAAoBQ,CAApB,EChCJjF,SAASrB,iBAAiB,eAAe,KACrC+F,EAAYlB,OAAOmB,OAAnB"} -------------------------------------------------------------------------------- /examples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | Alpine Auto Animate Examples 9 | 10 | 30 | 31 | 32 | 33 | 34 | 35 |
36 |
    37 | 40 |
41 | 42 | 43 | 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@marcreichel/alpine-auto-animate", 3 | "version": "0.0.0", 4 | "description": "An Alpine.js wrapper for @formkit/auto-animate.", 5 | "license": "MIT", 6 | "author": { 7 | "name": "Marc Reichel", 8 | "url": "https://marcreichel.dev/" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/marcreichel/alpine-auto-animate.git" 13 | }, 14 | "main": "src/index.js", 15 | "scripts": { 16 | "build": "rollup -c", 17 | "watch": "rollup -c -w" 18 | }, 19 | "bugs": { 20 | "url": "https://github.com/marcreichel/alpine-auto-animate/issues" 21 | }, 22 | "homepage": "https://github.com/marcreichel/alpine-auto-animate#readme", 23 | "dependencies": { 24 | "@formkit/auto-animate": "^1.0.0-beta.3" 25 | }, 26 | "devDependencies": { 27 | "@babel/core": "^7.19.1", 28 | "@babel/preset-env": "^7.19.1", 29 | "rollup": "^2.79.0", 30 | "rollup-plugin-babel": "^4.4.0", 31 | "rollup-plugin-filesize": "^9.1.2", 32 | "rollup-plugin-node-resolve": "^5.2.0", 33 | "rollup-plugin-terser": "^7.0.2" 34 | }, 35 | "files": [ 36 | "LICENSE", 37 | "README.md", 38 | "src/index.js", 39 | "package.json", 40 | "dist" 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import babel from 'rollup-plugin-babel'; 2 | import filesize from 'rollup-plugin-filesize'; 3 | import resolve from 'rollup-plugin-node-resolve'; 4 | import { terser } from 'rollup-plugin-terser'; 5 | 6 | export default { 7 | input: 'builds/cdn.js', 8 | output: [ 9 | { 10 | file: 'dist/alpine-auto-animate.js', 11 | format: 'umd', 12 | sourcemap: true, 13 | }, 14 | { 15 | file: 'dist/alpine-auto-animate.min.js', 16 | format: 'umd', 17 | plugins: [terser()], 18 | sourcemap: true, 19 | } 20 | ], 21 | plugins: [ 22 | resolve(), 23 | filesize(), 24 | babel({ 25 | babelrc: false, 26 | exclude: 'node_modules/**', 27 | presets: [ 28 | [ 29 | '@babel/preset-env', 30 | { 31 | targets: { 32 | node: 'current', 33 | }, 34 | }, 35 | ], 36 | ], 37 | }), 38 | ], 39 | }; 40 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import autoAnimate from '@formkit/auto-animate'; 2 | 3 | let autoAnimateConfig = {}; 4 | 5 | function AutoAnimate(Alpine) { 6 | Alpine.directive('auto-animate', (el, { expression, modifiers }, { evaluateLater, effect }) => { 7 | let config = {}; 8 | const durationModifier = modifiers.filter((modifier) => modifier.match(/^\d+m?s$/))[0] || null; 9 | if (durationModifier) { 10 | const inMilliseconds = !!durationModifier.match(/ms$/); 11 | const matchedDuration = + durationModifier.match(/^\d+/); 12 | config.duration = matchedDuration * (inMilliseconds ? 1 : 1000); 13 | } 14 | const easingModifier = modifiers.filter((modifier) => !modifier.match(/^\d+m?s$/))[0] || null; 15 | if (easingModifier) { 16 | config.easing = easingModifier; 17 | } 18 | const controller = autoAnimate(el, { ...autoAnimateConfig, ...config }); 19 | if (expression) { 20 | const isEnabled = evaluateLater(expression); 21 | effect(() => { 22 | isEnabled((enabled) => { 23 | if (enabled) { 24 | controller.enable(); 25 | } else { 26 | controller.disable(); 27 | } 28 | }); 29 | }) 30 | } 31 | }); 32 | } 33 | 34 | AutoAnimate.configure = (config) => { 35 | autoAnimateConfig = config; 36 | }; 37 | 38 | export default AutoAnimate; 39 | --------------------------------------------------------------------------------