* GTK shape support
* Support for ellipsis
* Allow drawing 'outside' of current frame. Experimental.
* Correctly support Capsules (rounded rects with nil cornerSize)
* Use boundingRect.size for Path size
* Refactored GdkRGBA from AnyColorBox.ResolvedValue to be reusable
* Added 'resolveToCairo(in environment:)' extension on Color
* Create slightly lighter View type hierarchies.
* Add a "bug report" issue template
We currently receive bug reports that don't always provide a self-contained code sample or screenshots to help us reproduce issues quickly or to add test cases. I hope that this issue template alleviates that.
* Apply suggestions from code review
Co-authored-by: Jed Fox <git@jedfox.com>
Co-authored-by: Jed Fox <git@jedfox.com>
Re-created #340.
* Added background modifier support for color backgrounds
* Fix indentation
* Allow WidgetView to be initialized with an update closure in order to fix updates to children of WidgetViews
* Fix indentation
Co-authored-by: Morten Bek Ditlevsen <morten@ka-ching.dk>
Based on the work discussed in #306.
* TokamakGTK implementation
* Fix macOS GTK Renderer impl
* Always release text in Picker. Use 'destroy_data' parameter to release closure boxes in GSignal.swift
* Revert commenting out this code
* Specify the product explicitly in Makefile
* Add GTK renderer build for macOS on CI
* Prevent xcodebuild from seeing GTK code
Co-authored-by: Carson Katri <carson.katri@gmail.com>
Co-authored-by: Morten Bek Ditlevsen <morten@ka-ching.dk>
This code had a missing `document` reference, and was plain outdated and not working with the latest version of JavaScriptKit.
Also, it turns out that `insertAdjacentHTML` does not work for script injection, although it does seem to work for styles injection. Separate `createElement`, `setAttribute`, and `appendChild` calls do seem to work for scripts.
* Add `TextEditor` implementation
Resolves#173.
* Clean up and bump requirements in the demo project
* Use a single `_tokamak-formcontrol` CSS class
* Add missing CSS class to `TextEditor.swift`
Co-authored-by: Jed Fox <git@jedfox.com>
Co-authored-by: Jed Fox <git@jedfox.com>
* Add `PreviewProvider` protocol
No functionality behind, just makes it easier to integrate with existing SwiftUI projects.
* Update PreviewProvider.swift
* Add missing preview-related types and modifiers
* Add Image view
* Add image to demo
* Update progress.md
* Alt text
* Use Bundle type to load images, remove systemName
* Add `logo-header.png` resource to `TokamakDemo`
* Reduce image size in the demo
* Allow bundles passed to `Image` to be optional
* Pass `nil` as a default `bundle` to `Image`
Co-authored-by: Max Desiatov <max@desiatov.com>
Resolve#287.
The `checked` attribute is a peculiar one, as any value on it keeps the checkbox checked. Attribute updates in `DOMRenderer` don't handle removals of attributes, but this seems to be the only case where this is relevant. I've added special handling for this attribute and checkbox inputs, and also had to declare `HTMLAttribute.checked` to set `isUpdatedAsProperty: true` on it for it to fully work.
Resolves, but adds no tests cases to the test suite for #294. See the issue for the detailed description of the problem.
I will add end-to-end tests for this in future PRs.
I've tested these cases manually so far:
```swift
struct Choice: View {
@State private var choice = false
var body: some View {
HStack {
Button("Trigger") {
choice.toggle()
}
if choice {
Group {
Text("true")
Text("true")
}
} else {
VStack {
Text("false")
}
}
Text("end")
}
}
}
```
Note the `Group` view with multiple children in this one, it uncovered required checks for `GroupView` conformance.
Also tested these more simple cases:
```swift
struct Choice: View {
@State private var choice = false
var body: some View {
HStack {
Button("Trigger") {
choice.toggle()
}
if choice {
Group {
// single child
Text("true")
}
} else {
VStack {
Text("false")
}
}
Text("end")
}
}
}
```
and
```swift
struct Choice: View {
@State private var choice = false
var body: some View {
HStack {
Button("Trigger") {
choice.toggle()
}
if choice {
// single child, no nesting
Text("true")
} else {
VStack {
Text("false")
}
}
Text("end")
}
}
}
```
* Ignore xcodeproj generated by SwiftPM
* Update to use official OpenCombine to avoid Xcode build error
* Use forked version with ObservableObject implementation
* Fix ambigious error
* Ignore SwiftPM edit mode package
* Update toolchain version
Requires #276 to be merged, as earlier versions of JavaScriptKit can't be depended on in macOS builds due to unsafe flags.
* Add Link View
* Add Publish support
* Remove #if checks
* Upgrade swift snapshot
* Try swiftwasm-action@main
* Remove Publish support from this repo
* Remove TokamakPublish target
* Allow tests to be run on macOS
* Update `ci.yml` to build and run the test product
* Trigger CI on all PRs without branch restrictions
* Rename linux_build to swiftwasm_build in ci.yml
Co-authored-by: Carson Katri <carson.katri@gmail.com>
* Add Link View
* Add Publish support
* Remove #if checks
* Upgrade swift snapshot
* Try swiftwasm-action@main
* Remove Publish support from this repo
* Remove TokamakPublish target
Looks like the Danger action duplicates warning comments. The new SwiftLint action does not, although warnings only show up in the diff view, which I think is an acceptable trade-off.