In most of the cases users wouldn't need to create cell providers with more than one identifier or more than one section. We would like the most common cases to be as easy to use as possible, this PR renames `SimpleCellProvider` to `CellProvider` and old `CellProvider` to `IdentifiedCellProvider`. Old `Model` associated type is now renamed to `Section` with a default array-based sections type, while the new `Model` associated type allows setting the element type directly. This helps users avoid thinking about nested arrays in the cases where multiple `ListView` sections are not needed.
* Simplify CellProvider protocol
* Fix AppKitRenderer compilation issue
* Fix formatting
We had an existing `SizeConstraint` struct, which was correctly rendered to auto layout constraints, but there was no way for users to create `SizeConstraint` with the new auto layout syntax. This is fixed by adding extension functions on `Size` with the usual format. This now allows setting constraints for size with a constant value:
```swift
Size.equal(to: .init(width: 100, height: 200))
```
Or with a multiplier relative to other nodes:
```swift
Size.equal(to: .parent, multiplier: 0.5)
```
* Add factory functions creating `SizeConstraint`
* Apply fixes from new SwiftFormat
This also adds separate `TokamakDemo` module in the main project, which will host all examples that can be cross-platform. A few `Style` properties were removed, which were duplicated in UIKit and duplicated versions couldn't be cleanly mapped in AppKit. `contentMode` was moved from `Style` to `Image` as `NSView` doesn't have `contentMode` at all, and for UIKit the only use that I know of is related to `UIImage` anyway.
Resolves#1
* Mostly empty TokamakAppKit module, fix copyright text
* Add TokamakDemo module, working counter on macOS
* Fix layer props and accessibility for AppKit
* Fix linter issues, completely remove `center` prop
* Fix line length in NSViewComponent
* Remove unused and broken ScrollView for AppKit
* Add macOS column to StandardComponents.md
* Make contentMode on Image non-optional
* Fix missing initializer call in ImageView.swift
* Change the domain name for the docs dir
* Fix TokamakAppKit after text Children -> Props fix
When in the future we add more components that would be useful as children of `Button` and `Label`, for example components that render to `CAShapeLayer`, we won't be able to add them as children. The reason is that this node "slot" is taken by text of `String` type. I think it's better to make this API-breaking change before the initial release, even though we don't have a component for `CAShapeLayer` yet.
* Move `text` from Children to Props in Button/Label
* Fix unit-tests after text props change
* Init snake game
* Replace [Any] state with [UnsafeMutableRawPointer]
* Broke ux
* Add Width init function
* Update Snake Game
* Remove ability to switch move direction to opposite
* Fix game board bound
* Add game over condition
* Add color to snake target
* Refactor code
* Add Gamepad to Snake Game
* Remove infinity loop
* Refactor code
* Refactor code
* Add Gameboard to Snake
* Reduce render function size
* Add Gamemenu
* Rename Gamemenu to GameMenu
* Format code
* Refactor code
This allows adding props for components that accept images, for example `Switch` is now able to implement `onImage` and `offImage` props.
* Add separate (empty for now) Image prop
* Implement Image, add Switch {on,off}Image props
Also add `UIView.animate` animation effect to example code. Also removes redundant `Updatable` protocol.
Resolves#49
* Define and set RefTarget in TokamakUIKit
* Add animation example
* Rename backgroundColor to currentColor
* Add comments to Animation example
* Rename StyleProps to ViewProps
* Init new argument order
* Init accessibility
* Add Accessibility.swift to project
* Sort Style init arguments
* Reorder arguments in Example
* Add Props init to StackView
* Fix arguments order in test
* Expose accessibility configuration on view props
* Rename ViewProps to StyleProps