Commit Graph

25 Commits

Author SHA1 Message Date
Max Desiatov 73a00afc04
Remove irrelevant padding modifier 2021-02-14 21:23:54 +00:00
Max Desiatov e05110825a
Remove irrelevant modifiers from reproduction code 2021-02-09 16:36:41 +00:00
Max Desiatov 1f48d27c88
Add `print` statements to reproduce the issue 2021-02-05 17:57:56 +00:00
Max Desiatov 1271281b75
Fix environment changes causing remounted scenes with lost state (#223)
Implements support for custom scenes by adding the new `MountedScene` type and fixes environment propagation from mounted parent to mounted child elements.

This will unblock https://github.com/swiftwasm/Tokamak/pull/136 and potentially https://github.com/swiftwasm/Tokamak/pull/214. In the former scenes are always completely unmounted and remounted from scratch when root environment changes, which causes descendants to lose all `@State` values. I saw some environment propagation issues in the latter, but not sure if those were caused by the lack of correct scene updates, just wanted to tackle the usual suspects first.

I've also improved reconciler-related doc comments to clarify some of the design desicions and naming.

Resolves #222.
2020-07-29 21:37:38 +01:00
Carson Katri 2b93f37d64
Add SwiftUI App Lifecycle (#195) 2020-07-22 16:57:33 -04:00
Jed Fox e65269189a
Add Xcode project and native targets (#142)
* Match the Color API to the native one

* Extract the demo view to its own file

* Add Xcode project and native targets

* Fix Color

* Delete UISceneDelegate.swift

* Fix line length

* Tokamak Native → TokamakDemo Native

* Add exports for styles, fix typo
2020-07-02 13:04:29 -04:00
Carson Katri 525cefe6bc
Allow @Environment on all MountedViews (#146) 2020-07-02 09:36:16 -04:00
Jed Fox 17463c43ed
Add TextFieldStyle (#125)
* Add TextFieldStyle

* oops

* Comment out the Semantic UI CSS

* Move the DOM-specific stuff to TokamakDOM

* SecureFIeld is implemented!

* Remove commented-out code

Co-authored-by: Max Desiatov <max@desiatov.com>

* Remove unncessary underscore and proxy method

* Enable building on Xcode for access to IDE tools

* Add an environment variable for TextField style

* Remove mandatory init()

* Update Sources/TokamakCore/CGStubs.swift

Co-authored-by: Max Desiatov <max@desiatov.com>

* Update Sources/TokamakCore/CGStubs.swift

Co-authored-by: Max Desiatov <max@desiatov.com>

* Remove the lock

* Move file to sources folder

Co-authored-by: Max Desiatov <max@desiatov.com>
2020-07-01 14:43:09 -04:00
Carson Katri 1d71fe0c7d
Implement Environment (#135)
* Environment impl

* Fix line lengths

* Danger and review fixes

* rename _modifyEnvironment to modifyEnvironment
2020-07-01 08:28:09 -04:00
Carson Katri f9f11a0113
Shape, Path, and some related modifiers (#119)
* Initial Shape support

* Border modifier

* Better demo

* Make Path conform to Shape

* Implement clipShape

* Add shapes/path/shapestyles to progress.md
2020-06-30 15:00:16 -04:00
Carson Katri 98a107f7fe
Add ScrollView (#128)
* Add ScrollView
* Root styles for ScrollView and Stack
2020-06-30 12:29:06 -04:00
Carson Katri e40a701752
Add Spacer support (#122)
1. If a Stack has a Spacer as a child, we need to fill the width or height of the parent so the Spacer's flex-grow: 1; works.
2. If a Stack has a child Stack along the cross axis (HStack with a nested VStack and vice vera) we need to fill the cross axis
3. If a Stack has a child Stack along the same axis (HStack with a nested HStack) we need to fill the axis.
2020-06-30 09:31:25 -04:00
Jed Fox b2b5ec2ae5
Add TextField, SecureField, and a progress document (#116)
I’ve added two TextFields to the demo, which are supposed to have their values synced. Pressing enter in the second one will increment the commit counter.
2020-06-29 17:52:22 +01:00
Carson Katri 4b3b377c82
Add layout modifiers (#118)
* frame and padding modifiers
2020-06-29 10:33:27 -04:00
Carson Katri b7d7b125b2
Add support for Text Modifiers (#114)
* Text styles and Environment setup for View font

* Text modifiers and demo

* Format Source files

* Fix font-size and add font-family when no Font is specified

* Add TextStyle

* PR fixes

* Format files

* Add note about Text modifiers
2020-06-28 18:05:53 -04:00
Max Desiatov 429bf3b58c
Increase counter limit in TokamakDemo/main.swift 2020-06-28 16:09:10 +01:00
Carson Katri 0aedd15f8a
ForEach (#113)
* Add ForEach and demo
* Add better demo for ForEach
* Fix formatting

Co-authored-by: Max Desiatov <max@desiatov.com>
2020-06-27 16:12:55 -04:00
Carson Katri e06a5b4308
Add ZStack and modifier support for setting zIndex (#112)
* Add ZStack and modifier support for setting zIndex

* Improve ViewModifier to support custom modifiers correctly

* ModifiedContent and PR fixes
2020-06-27 20:33:15 +01:00
Max Desiatov fcbf9f6d49
Clean up example code in README.md/main.swift 2020-06-23 12:14:43 +01:00
Max Desiatov 96ef5d123a
Add inline SVG and styles/scripts to example code 2020-06-23 11:41:59 +01:00
Max Desiatov c8f75e32af
Use Semantic UI CSS in TokamakDemo 2020-06-22 18:00:02 +01:00
Max Desiatov 3accd32b5b
Fix early deallocation of root ref, refine Counter 2020-06-19 01:34:54 +01:00
Max Desiatov 61baa5e1d4
Add license headers, add example code to README.md 2020-06-18 14:50:54 +01:00
Max Desiatov 76de3eab74
Implement simple DOM updates 2020-06-17 21:50:22 +01:00
Max Desiatov 426bb999c5
Add basic DOM renderer 2020-06-17 00:58:10 +01:00