Skip to content
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

feat: add node and isInViewport to props of action functions #34

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

paoloricciuti
Copy link
Owner

@paoloricciuti paoloricciuti commented Sep 28, 2023

Closes #33

@changeset-bot
Copy link

changeset-bot bot commented Sep 28, 2023

🦋 Changeset detected

Latest commit: 6c32491

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sveltekit-view-transition Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Sep 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sveltekit-view-transition ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 28, 2023 7:49pm
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
svt-list-and-details ⬜️ Ignored (Inspect) Visit Preview Sep 28, 2023 7:49pm
svt-sveltegram ⬜️ Ignored (Inspect) Visit Preview Sep 28, 2023 7:49pm

@coderabbitai
Copy link

coderabbitai bot commented Sep 28, 2023

Walkthrough

This update enhances the 'sveltekit-view-transition' package by adding new arguments to action functions and exporting additional types. It also introduces a feature to skip transitions if an element is not in the viewport, improving performance and user experience.

Changes

File Summary
.changeset/soft-phones-sip.md Adds a new minor version of the 'sveltekit-view-transition' package with enhanced action functions.
README.md Updates documentation to reflect changes in function parameters and usage examples.
src/lib/index.ts Exports new types related to options, events, transition actions, and function props.
src/lib/sveltekit-view-transition.ts Modifies TransitionAction and TransitionActionFunctions types and adds logic to skip transitions for elements not in the viewport.

🐇💻

"In the land of code where the shadows lie,
A rabbit hops, its gaze held high.
With each keystroke, it weaves a spell,
In the heart of software, where transitions dwell.

Now elements rest when out of sight,
Saving power with all their might.
The rabbit grins, its work complete,
Celebrating this feat so neat!" 🎉🥕


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • Mention @coderabbitai in any review comment for bot assistance.
  • Note: Review comments are made on code diffs or files, not on the PR overview.

Pause Incremental Reviews

  • Insert @coderabbitai: ignore in the PR description to halt the bot's ongoing reviews. Remove the line to resume.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 2

Commits Files that changed from the base of the PR and between 0396d2a and 6c32491.
Files selected for processing (4)
  • .changeset/soft-phones-sip.md (1 hunks)
  • README.md (4 hunks)
  • src/lib/index.ts (1 hunks)
  • src/lib/sveltekit-view-transition.ts (4 hunks)
Files skipped from review due to trivial changes (2)
  • README.md
  • src/lib/index.ts
Additional comments (Suppressed): 3
.changeset/soft-phones-sip.md (1)
  • 1-5: The changeset file correctly indicates a minor version update for the 'sveltekit-view-transition' package and provides a brief description of the changes. Ensure that this description accurately reflects the changes made in the code.
src/lib/sveltekit-view-transition.ts (2)
  • 7-26: The new TransitionActionFunctionProps type and the modifications to the TransitionAction and TransitionActionFunctions types are well done. They incorporate the new node and isInViewport properties, which will be passed to callback functions. This change enhances the flexibility of the package by allowing developers to make decisions based on whether an element is currently in the viewport.

  • 299-305: The changes here look good. The props.classes function now receives the new props_for_callback object, which includes the node and isInViewport properties. This allows developers to conditionally apply classes based on whether an element is in the viewport.

src/lib/sveltekit-view-transition.ts Show resolved Hide resolved
src/lib/sveltekit-view-transition.ts Show resolved Hide resolved
@paoloricciuti paoloricciuti merged commit b2c4f99 into main Sep 28, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pass node to actions parameters and eventually an isInViewport parameter
1 participant