-
-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add View Traits and transitions #426
Merged
Merged
Changes from 11 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
7e1296a
Add view traits and transitions
carson-katri 6cba0f2
Merge branch 'main' of https://github.com/swiftwasm/Tokamak into tran…
carson-katri ad6b8a5
Working animated transitions
carson-katri ebdc5cc
Working insertion/removal transitions and trait keys
carson-katri ec557c0
Add license and cleanup main.swift
carson-katri 6f614b3
Cleanup
carson-katri b84d127
Refactor
carson-katri b054b2b
Keep track of TransitionPhase to only transition root mounts/unmounts
carson-katri 2b0482a
Fix function lengths
carson-katri e0607e9
Prevent duplicate elements on quick unmount/mount
carson-katri afc8caf
Fix GTK build
carson-katri f22fada
Fix unowned crash
carson-katri e3dda95
Fix CanTransitionTraitKey being true when no animation is linked to t…
carson-katri 7b9424a
Fix slide-in
carson-katri ed7aa63
Remove recursion from UnmountTask
carson-katri da1aef8
Fix stack buffer overflow
carson-katri f859f57
Revise transition behavior
carson-katri 3ffadfb
Revise transition behavior
carson-katri 6fc10d8
Fix Package.swift
carson-katri 0613990
Merge branch 'main' of https://github.com/TokamakUI/Tokamak into tran…
carson-katri 2d5c80b
Allow root animation transitions to run when transaction.animation ==…
carson-katri c1e7f25
Attempt resolving linter warnings
carson-katri 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 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 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 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 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 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 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 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 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.
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.
Are these traits somehow different from SwiftUI accessibility traits? I can't find anything else about SwiftUI traits, just wondering what's used as a reference here.
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.
SwiftUI has
_ViewTraitKey
internally, and uses them fortransition
,onDelete
,onMove
and some other modifiers (I think drag & drop?). From what I can tell, a trait is data attached to a single view, and in many cases seems to be a way to get the trait out of SwiftUI and into the host platform (for instance, for UITableView swipe actions or NSItemProvider-based drag & drop).Although I'm really just speculating as to how SwiftUI uses them by looking at the
swiftinterface
. In Tokamak they are meant to be passed to the nearest host element so renderers can access them.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.
Traits are also used for
zIndex(_:)
andlayoutPriority(_:)
. I haven't look into whether Tokamak has implemented these modifiers. If they're not implemented, traits would be really helpful.