Skip to content

Commit 91f3201

Browse files
justin-schroeder94726iabiimarshallswainWingSMC
authored
Release/0.9.0 (#226)
* test(e2e): add Playwright visual tests (video + pixel diffs); stabilize animation waits; upload videos in CI * fix: jumping when aligned at bottom (#69) (#211) * fix: jumping when aligned at bottom (#69) * chore: use const instead of let * test(e2e): add Playwright visual tests (video + pixel diffs); stabilize animation waits; upload videos in CI --------- Co-authored-by: Justin Schroeder <[email protected]> * fix: #69 — nice * Adding bun to installation instructions (#205) * feat: allow useAutoAnimate with Vue component ref (#186) This adds support for using `useAutoAnimate` with a component as the parent. When you add `ref="parent"` to a component, the element is found at `parent.value.$el`. This update checks for component elements or a plain HTML element ref. * feat: adds component support to useAutoAnimate for Vue * Investigate and resolve auto-animate issues (#225) * Improve offscreen handling, Vue integration, and cleanup in AutoAnimate Co-authored-by: justin <[email protected]> * Add e2e tests for various autoAnimate scenarios and behaviors Co-authored-by: justin <[email protected]> * chore: remove playwright report * Angular 17.1+ support (#206) * Angular >v17.1 support * angular example rewrite * Angular docs change * Update package.json * angular pnpm-lock & usage import fix * ' -> " typo fix --------- Co-authored-by: Gergely Dremak <[email protected]> Co-authored-by: Justin Schroeder <[email protected]> * chore: lockfile bump * fix: bottom anchored animations * chore: remove local claude * fix: restore bottom-aligned animation fix from PR #211 and fix CI test failures - Restored deltaBottom/deltaRight checks to detect anchored elements - Fixed immediate position updates after animations (debounce=false) - Restored proper parent coordinate calculations in deletePosition - Added named export for autoAnimate to fix exports test - Fixed flaky framework animation tests by ensuring elements are visible - Added scrollIntoViewIfNeeded and increased wait times for CI reliability All bottom-jump-fix tests now pass across all browsers * fix: add build step to CI and make tests more robust for slow environments - Added 'pnpm build' step to GitHub Actions workflow before running tests - Fixed exports test by ensuring dist files are built in CI - Made framework animation tests more robust with polling approach - Added browser-specific timeouts for WebKit compatibility - Increased wait times and retry attempts for slow CI environments * fix: no nuxt build on ci * chore: gh caching --------- Co-authored-by: Maik Kowol <[email protected]> Co-authored-by: Abi <[email protected]> Co-authored-by: Marshall Thompson <[email protected]> Co-authored-by: Gergely Dremák <[email protected]> Co-authored-by: Gergely Dremak <[email protected]>
1 parent 9bad0a6 commit 91f3201

30 files changed

+1207
-550
lines changed

.claude/settings.local.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,58 @@ jobs:
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v4
19+
1920
- name: Setup pnpm
2021
uses: pnpm/action-setup@v4
2122
# version is read from package.json#packageManager
23+
2224
- name: Setup Node.js
2325
uses: actions/setup-node@v4
2426
with:
2527
node-version: 20
2628
cache: 'pnpm'
29+
30+
- name: Get pnpm store directory
31+
id: pnpm-cache
32+
shell: bash
33+
run: |
34+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
35+
36+
- name: Setup pnpm cache
37+
uses: actions/cache@v4
38+
with:
39+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
40+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
41+
restore-keys: |
42+
${{ runner.os }}-pnpm-store-
43+
44+
- name: Get Playwright version
45+
id: playwright-version
46+
run: echo "PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --json | jq -r '.[0].devDependencies."@playwright/test".version')" >> $GITHUB_OUTPUT
47+
48+
- name: Cache Playwright browsers
49+
id: playwright-cache
50+
uses: actions/cache@v4
51+
with:
52+
path: ~/.cache/ms-playwright
53+
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}
54+
restore-keys: |
55+
${{ runner.os }}-playwright-
56+
2757
- name: Install dependencies
2858
run: pnpm install --frozen-lockfile=false
59+
2960
- name: Install Playwright Browsers
61+
if: steps.playwright-cache.outputs.cache-hit != 'true'
3062
run: pnpm exec playwright install --with-deps
63+
64+
- name: Install Playwright dependencies only
65+
if: steps.playwright-cache.outputs.cache-hit == 'true'
66+
run: pnpm exec playwright install-deps
67+
68+
- name: Build project
69+
run: NO_NUXT=1 pnpm build
70+
3171
- name: Run Playwright tests
3272
run: pnpm test:e2e
3373
- name: Upload Playwright report
@@ -36,3 +76,9 @@ jobs:
3676
with:
3777
name: playwright-report
3878
path: playwright-report
79+
- name: Upload Playwright videos (visual)
80+
if: always()
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: playwright-videos
84+
path: test-results/**/video.webm

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@ dist
55

66
# Playwright artifacts
77
playwright-report/
8+
playwright-report/index.html
89
test-results/
910

10-
# Cypress artifacts (legacy)
11-
cypress/videos/
12-
cypress/screenshots/
13-
1411
dist
1512
.DS_Store
1613
node_modules
@@ -22,3 +19,4 @@ temp
2219
.yalc
2320
.idea
2421
.nuxt
22+
*.local.json

build/bundle.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ async function main() {
287287
// await qwikBuild()
288288
await declarationsBuild()
289289
await bundleDeclarations()
290-
await nuxtBuild()
290+
// Skip nuxt module build in CI or when NO_NUXT is set
291+
if (!process.env.NO_NUXT) {
292+
await nuxtBuild()
293+
}
291294
await addPackageJSON()
292295
await addAssets()
293296
await outputSize()

docs/src/components/CodeExample.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import IconJavaScript from "./IconJavaScript.vue"
1212
import IconSvelte from "./IconSvelte.vue"
1313
import IconAngular from "./IconAngular.vue"
1414
import IconNuxt from "./IconNuxt.vue"
15+
import IconBun from "./IconBun.vue"
1516
import { computed, ref } from "vue"
1617
import { vAutoAnimate } from "../../../src"
1718
import "../../assets/prism.css"
@@ -30,6 +31,7 @@ type LanguageOption =
3031
| "npm"
3132
| "pnpm"
3233
| "nuxt"
34+
| "bun"
3335
3436
type Language = {
3537
ext: "jsx" | "vue" | "html"
@@ -194,6 +196,13 @@ function copyCode(value: string) {
194196
>
195197
<IconPNPM />pnpm
196198
</li>
199+
<li
200+
v-if="'bun' in props.examples"
201+
@click="current = 'bun'"
202+
:data-selected="current === 'bun' || null"
203+
>
204+
<IconBun />bun
205+
</li>
197206
<li
198207
v-if="'nuxt' in props.examples"
199208
@click="current = 'nuxt'"

docs/src/components/IconBun.vue

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<template>
2+
<svg id="Bun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 70">
3+
<title>Bun Logo</title>
4+
<path
5+
id="Shadow"
6+
d="M71.09,20.74c-.16-.17-.33-.34-.5-.5s-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5A26.46,26.46,0,0,1,75.5,35.7c0,16.57-16.82,30.05-37.5,30.05-11.58,0-21.94-4.23-28.83-10.86l.5.5.5.5.5.5.5.5.5.5.5.5.5.5C19.55,65.3,30.14,69.75,42,69.75c20.68,0,37.5-13.48,37.5-30C79.5,32.69,76.46,26,71.09,20.74Z"
7+
/>
8+
<g id="Body">
9+
<path
10+
id="Background"
11+
d="M73,35.7c0,15.21-15.67,27.54-35,27.54S3,50.91,3,35.7C3,26.27,9,17.94,18.22,13S33.18,3,38,3s8.94,4.13,19.78,10C67,17.94,73,26.27,73,35.7Z"
12+
style="fill: #fbf0df"
13+
/>
14+
<path
15+
id="Bottom_Shadow"
16+
data-name="Bottom Shadow"
17+
d="M73,35.7a21.67,21.67,0,0,0-.8-5.78c-2.73,33.3-43.35,34.9-59.32,24.94A40,40,0,0,0,38,63.24C57.3,63.24,73,50.89,73,35.7Z"
18+
style="fill: #f6dece"
19+
/>
20+
<path
21+
id="Light_Shine"
22+
data-name="Light Shine"
23+
d="M24.53,11.17C29,8.49,34.94,3.46,40.78,3.45A9.29,9.29,0,0,0,38,3c-2.42,0-5,1.25-8.25,3.13-1.13.66-2.3,1.39-3.54,2.15-2.33,1.44-5,3.07-8,4.7C8.69,18.13,3,26.62,3,35.7c0,.4,0,.8,0,1.19C9.06,15.48,20.07,13.85,24.53,11.17Z"
24+
style="fill: #fffefc"
25+
/>
26+
<path
27+
id="Top"
28+
d="M35.12,5.53A16.41,16.41,0,0,1,29.49,18c-.28.25-.06.73.3.59,3.37-1.31,7.92-5.23,6-13.14C35.71,5,35.12,5.12,35.12,5.53Zm2.27,0A16.24,16.24,0,0,1,39,19c-.12.35.31.65.55.36C41.74,16.56,43.65,11,37.93,5,37.64,4.74,37.19,5.14,37.39,5.49Zm2.76-.17A16.42,16.42,0,0,1,47,17.12a.33.33,0,0,0,.65.11c.92-3.49.4-9.44-7.17-12.53C40.08,4.54,39.82,5.08,40.15,5.32ZM21.69,15.76a16.94,16.94,0,0,0,10.47-9c.18-.36.75-.22.66.18-1.73,8-7.52,9.67-11.12,9.45C21.32,16.4,21.33,15.87,21.69,15.76Z"
29+
style="fill: #ccbea7; fill-rule: evenodd"
30+
/>
31+
<path
32+
id="Outline"
33+
d="M38,65.75C17.32,65.75.5,52.27.5,35.7c0-10,6.18-19.33,16.53-24.92,3-1.6,5.57-3.21,7.86-4.62,1.26-.78,2.45-1.51,3.6-2.19C32,1.89,35,.5,38,.5s5.62,1.2,8.9,3.14c1,.57,2,1.19,3.07,1.87,2.49,1.54,5.3,3.28,9,5.27C69.32,16.37,75.5,25.69,75.5,35.7,75.5,52.27,58.68,65.75,38,65.75ZM38,3c-2.42,0-5,1.25-8.25,3.13-1.13.66-2.3,1.39-3.54,2.15-2.33,1.44-5,3.07-8,4.7C8.69,18.13,3,26.62,3,35.7,3,50.89,18.7,63.25,38,63.25S73,50.89,73,35.7C73,26.62,67.31,18.13,57.78,13,54,11,51.05,9.12,48.66,7.64c-1.09-.67-2.09-1.29-3-1.84C42.63,4,40.42,3,38,3Z"
34+
/>
35+
</g>
36+
<g id="Mouth">
37+
<g id="Background-2" data-name="Background">
38+
<path
39+
d="M45.05,43a8.93,8.93,0,0,1-2.92,4.71,6.81,6.81,0,0,1-4,1.88A6.84,6.84,0,0,1,34,47.71,8.93,8.93,0,0,1,31.12,43a.72.72,0,0,1,.8-.81H44.26A.72.72,0,0,1,45.05,43Z"
40+
style="fill: #b71422"
41+
/>
42+
</g>
43+
<g id="Tongue">
44+
<path
45+
id="Background-3"
46+
data-name="Background"
47+
d="M34,47.79a6.91,6.91,0,0,0,4.12,1.9,6.91,6.91,0,0,0,4.11-1.9,10.63,10.63,0,0,0,1-1.07,6.83,6.83,0,0,0-4.9-2.31,6.15,6.15,0,0,0-5,2.78C33.56,47.4,33.76,47.6,34,47.79Z"
48+
style="fill: #ff6164"
49+
/>
50+
<path
51+
id="Outline-2"
52+
data-name="Outline"
53+
d="M34.16,47a5.36,5.36,0,0,1,4.19-2.08,6,6,0,0,1,4,1.69c.23-.25.45-.51.66-.77a7,7,0,0,0-4.71-1.93,6.36,6.36,0,0,0-4.89,2.36A9.53,9.53,0,0,0,34.16,47Z"
54+
/>
55+
</g>
56+
<path
57+
id="Outline-3"
58+
data-name="Outline"
59+
d="M38.09,50.19a7.42,7.42,0,0,1-4.45-2,9.52,9.52,0,0,1-3.11-5.05,1.2,1.2,0,0,1,.26-1,1.41,1.41,0,0,1,1.13-.51H44.26a1.44,1.44,0,0,1,1.13.51,1.19,1.19,0,0,1,.25,1h0a9.52,9.52,0,0,1-3.11,5.05A7.42,7.42,0,0,1,38.09,50.19Zm-6.17-7.4c-.16,0-.2.07-.21.09a8.29,8.29,0,0,0,2.73,4.37A6.23,6.23,0,0,0,38.09,49a6.28,6.28,0,0,0,3.65-1.73,8.3,8.3,0,0,0,2.72-4.37.21.21,0,0,0-.2-.09Z"
60+
/>
61+
</g>
62+
<g id="Face">
63+
<ellipse
64+
id="Right_Blush"
65+
data-name="Right Blush"
66+
cx="53.22"
67+
cy="40.18"
68+
rx="5.85"
69+
ry="3.44"
70+
style="fill: #febbd0"
71+
/>
72+
<ellipse
73+
id="Left_Bluch"
74+
data-name="Left Bluch"
75+
cx="22.95"
76+
cy="40.18"
77+
rx="5.85"
78+
ry="3.44"
79+
style="fill: #febbd0"
80+
/>
81+
<path
82+
id="Eyes"
83+
d="M25.7,38.8a5.51,5.51,0,1,0-5.5-5.51A5.51,5.51,0,0,0,25.7,38.8Zm24.77,0A5.51,5.51,0,1,0,45,33.29,5.5,5.5,0,0,0,50.47,38.8Z"
84+
style="fill-rule: evenodd"
85+
/>
86+
<path
87+
id="Iris"
88+
d="M24,33.64a2.07,2.07,0,1,0-2.06-2.07A2.07,2.07,0,0,0,24,33.64Zm24.77,0a2.07,2.07,0,1,0-2.06-2.07A2.07,2.07,0,0,0,48.75,33.64Z"
89+
style="fill: #fff; fill-rule: evenodd"
90+
/>
91+
</g>
92+
</svg>
93+
</template>

docs/src/examples/angular/index.ts

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,35 @@
11
const angularDirectiveMain = {
2-
angular: {
3-
ext: "angular",
4-
language: "jsx",
5-
example: `import { NgModule } from '@angular/core';
6-
import { AutoAnimateModule } from '@formkit/auto-animate/angular'
7-
8-
@NgModule({
9-
declarations: [AppComponent],
10-
imports: [BrowserModule, AutoAnimateModule],
11-
bootstrap: [AppComponent],
12-
})
13-
export class AppModule {}
14-
`,
15-
},
16-
}
17-
18-
const angularDirectiveApp = {
192
angular: {
203
ext: "angular",
214
language: "jsx",
225
example: `import { Component } from '@angular/core';
6+
import { AutoAnimateDirective } from '@formkit/auto-animate/angular';
237
248
@Component({
259
selector: 'app-root',
10+
standalone: true,
11+
imports: [AutoAnimateDirective],
2612
template: \`
27-
<div *ngFor="let story of stories">
28-
<div class="story-card" auto-animate>
29-
<h2>{{ story.title }}</h2>
30-
<div *ngIf="story.showStory">{{ story.story }}</div>
31-
<button (click)="story.showStory = !story.showStory">Toggle story</button>
13+
@for (story of stories; track story.title) {
14+
<div>
15+
<div class="story-card" auto-animate>
16+
<h2>{{ story.title }}</h2>
17+
@if (story.showStory) {
18+
<div>{{ story.story }}</div>
19+
}
20+
<button (click)="story.showStory = !story.showStory">Toggle story</button>
21+
</div>
3222
</div>
33-
</div>
34-
\`
23+
}
24+
\`,
3525
})
3626
export class AppComponent {
37-
stories = [
27+
readonly stories = [
3828
{title: 'The Ant and The Grasshopper', showStory: false, story: "The ant and the grasshopper were good friends..."},
3929
{title: 'The Boy Who Cried Wolf', showStory: false, story: "There was once a shepherd boy who liked to play tricks..."},
4030
];
41-
}`,
31+
}
32+
`,
4233
},
4334
}
44-
export { angularDirectiveMain, angularDirectiveApp }
35+
export { angularDirectiveMain }

docs/src/examples/installation/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@ export default {
1414
language: "shell",
1515
title: "~/my-app",
1616
},
17+
bun:{
18+
example:"bun install @formkit/auto-animate",
19+
language:"shell",
20+
title:"~/my-app",
21+
},
1722
}

docs/src/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ const routes: RouteRecordRaw[] = [
1313
path: "/tests-keep-alive",
1414
component: () => import("./pages/PageTestKeepAlive.vue"),
1515
},
16+
{
17+
path: "/bottom-jump-test",
18+
component: () => import("./pages/PageBottomJumpTest.vue"),
19+
},
1620
{
1721
path: "/:catchAll(.*)",
1822
redirect: "/",

0 commit comments

Comments
 (0)