-
-
Notifications
You must be signed in to change notification settings - Fork 8
Next #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Next #90
Changes from all commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
8b472a1
Replace scrl with a native scroll implementation
hirasso 4ef7212
Update Documentation
hirasso b37a793
Constrain scrolling to the maximum available scroll height
hirasso 7254062
Use `clientHeight` instead of `offsetHeight`
hirasso 4455472
Update packages
daun 1f5aadd
Extract explicit scrollTo method
daun 47dd30b
Recursively scroll nested elements into view
daun 8cfe02e
Revert linting on README.md
hirasso 83f674c
Add swup's `.editorconfig`
hirasso 7a8ea8e
Merge pull request #88 from swup/feat/native-scrolling
hirasso 0a75548
Repeat renaming of default branch to `main` 🤦♂️
hirasso 88ef463
Remove incorrect code comment
hirasso 12ccfb3
Formatting
hirasso 5c9a572
Setup e2e and unit tests
hirasso 493510d
Add test workflows
hirasso b95c46e
Cleanup test fixtures
hirasso 49edaac
Fix test workflows
hirasso 0db20bd
Optimize Readme
hirasso 845e5a9
Remove scrl related stuff from the readme
hirasso b9d8412
Merge pull request #91 from swup/add-tests
hirasso d92fb2b
Merge branch 'next' into feat/native-scrolling-details
daun 9c52a46
Pull in library for spec-compliant scrolling into view
daun c4fe40c
Clean up
daun bb62b87
Clarify naming between targets and containers
daun 77b187f
Merge pull request #89 from swup/feat/native-scrolling-details
daun effcd5b
Implement horizontal scroll
daun b708d0c
Scroll to top left
daun 96caa6c
Support vertical and horizontal offsets
daun cd52ba2
Ensure scroll position defaults
daun 93d691e
Fixtures WIP
hirasso fbcca30
Add nested scrolling links
hirasso 7d87bbb
WIP
hirasso 4947dc4
WIP
hirasso 1accd13
Cleanup
hirasso 9ba4951
Move `./tests/e2e/fixtures` to `./playground`
hirasso d560981
WIP
hirasso b272d1b
WIP
hirasso f1f9467
Add `data-swup-scroll-container` attributes for e2e tests
hirasso bd20bb6
Prepare for scroll preservation tests
hirasso 75bc131
Use an attribute `[data-preserve-scroll]` instead of a class name
hirasso fa2a05e
Clean up
hirasso 3800449
Remove unnessesary check for empty `scrollTarget`
hirasso bcf45c8
Set left to zero if the provided offset value is a number
hirasso 25ec9da
Communicate that `scrollTarget` and `scrollContainer` are never undef…
hirasso 729a72f
Simplify playground offset callback
hirasso de3ab2e
Pass the position to `OffsetCallback`
hirasso 363b3cd
Export the type `OffsetCallback`
hirasso b631bce
Merge pull request #93 from swup/feat/horizontal-scrolling
hirasso bb5959a
Untrack dynamic astro stuff
hirasso 71d7014
Update Astro
hirasso eb3a52d
playground: use a custom callback for `getAnchorElement`
hirasso c16c79f
playground: fix title
hirasso daa5eb0
Fix PlayWright UI mode
hirasso 35f7a1d
Git-Ignore test results
hirasso a904475
Cleanup basic hello world test
hirasso ebd100f
Add tests for anchor scrolling
hirasso a117eea
Add tests for resetting and restoring the scroll position
hirasso fa7af12
Add tests for `options.offset`
hirasso 26bbcfa
Test the option `animateScroll`
hirasso 912d7d7
Add test for `offset` as an object
hirasso 34333ab
Uninstall jsdom
hirasso 506781c
Add test for `getOffset` to always return an object
hirasso 44be347
Optimize code comments
hirasso 12716c2
Use `new Function` instead of `eval` for function deserialization
hirasso 735d659
Extract serialize and unserialize
hirasso 40b56c4
Ignore badges on swup docs
hirasso 1c17fb0
Merge pull request #97 from swup/feat/add-tests
hirasso eb47df4
Apply scroll position in scroll:apply hook
daun 8b7beec
Freeze left scroll on cancel
daun 6d52cbf
Update readme
daun c7d7653
Switch to scrollFunction option
daun df1cc20
Update readme
daun 7ae122c
Test custom scroll function call
daun dd5fb32
Unify readme spelling
daun 851da95
Resolve body to window event target
daun 19e1aa0
Update GSAP example
daun bb8d333
Fix comment spelling
daun 905f293
Remove unneccessary vite config
daun 9a8fef9
Merge pull request #99 from swup/feat/scroll-apply-hook
daun eca572b
Prepare CHANGELOG for v4
hirasso a563b84
Update version in CDN link
hirasso 2ca6c17
Add test for exposing `scrollTo` on the swup instance
hirasso 559d84e
Remove unnecessary boilerplate from unit tests
hirasso 7c3af9d
Update CHANGELOG
hirasso 6527485
Fix typo
hirasso df7113c
Merge pull request #100 from swup/feat/prepare-v4
hirasso 1d43d5a
Add `src` to the files downloaded from npm
hirasso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| trim_trailing_whitespace = true | ||
| insert_final_newline = true | ||
| max_line_length = 100 | ||
|
|
||
| [*.{js,mjs,ts}] | ||
| indent_style = tab | ||
| indent_size = 4 | ||
|
|
||
| [*.{json,md,yaml,yml}] | ||
| indent_style = space | ||
| indent_size = 2 | ||
|
|
||
| [*.md] | ||
| trim_trailing_whitespace = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: E2E tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, next] | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| run-tests: | ||
| name: E2E tests | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
|
|
||
| steps: | ||
| - name: Check out repo | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up node | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 18 | ||
|
|
||
| - run: npm ci | ||
| - run: npm run build | ||
| - run: npm run test:e2e:install | ||
|
|
||
| - name: Run tests | ||
| run: npm run test:e2e | ||
|
|
||
| - uses: daun/playwright-report-summary@v2 | ||
| with: | ||
| report-file: playwright-results.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| name: Redeploy Docs | ||
| on: | ||
| push: | ||
| branches: [master] | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| redeploy-docs: | ||
| uses: swup/.github/.github/workflows/redeploy-docs.yml@master | ||
| uses: swup/.github/.github/workflows/redeploy-docs.yml@main | ||
| secrets: inherit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: Unit tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, next] | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| run-tests: | ||
| name: Run unit tests | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
|
|
||
| steps: | ||
| - name: Check out repo | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up node | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 18 | ||
|
|
||
| - run: npm ci | ||
| - run: npm run build | ||
|
|
||
| - name: Run tests | ||
| run: npm run test:unit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hirasso We should also think of a way of hiding the readme badges from the docs site. They look a bit off in that context. Maybe an html comment type thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually like them:
But not hugely important :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like them too, but on GitHub 👨🏻💻 In the docs, learning that playwright and vitest are passing before learning what the plugin does is a bit distracting, I think?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd don't have a strong preference - might be my inside view... fine for me either way :)