From cbfdc3479325d748e3659e67672651b0c8ccb5cd Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 23 Nov 2021 15:31:28 +0100 Subject: [PATCH] Update for JSKit 0.11.1, add async `task` modifier (#457) I've also moved sources in `TokamakDemo` directory into their respective subdirectories for easier navigation. * Update for JSKit 0.11.0, add async `task` modifier * Add back new file locations to `NativeDemo` * Add compiler `#if` check to `TaskDemo` * Update to JavaScriptKit 0.11.1 * Restrict `TaskDemo` with `compiler(>=5.5)` check * Replace `compiler` with `swift` in some places * Revert "Replace `compiler` with `swift` in some places" This reverts commit 534784ca7bf73b5116567edb761b779126f45c62. * Use Xcode 13.2 on GitHub Actions hosts * Find `TokamakPackageTests` in the build directory * Fix macOS tests bundle path * Make `task` modifier available only on macOS Monterey * Revert "Use Xcode 13.2 on GitHub Actions hosts" This reverts commit 63d044f2d54a74bf1a916e5b2e1cffdd16e41759. * Revert "Fix macOS tests bundle path" This reverts commit 3ccbc98a2d70f3ea7d4e3a4e9a4d7aa2ccb49e6e. * Revert "Find `TokamakPackageTests` in the build directory" This reverts commit 68c845bc1917dd4a734ec89813bf40395f090320. * Use `canImport(Concurrency)` as an ultimate check * Use `compiler(>=5.5) && canImport(Concurrency)` * Clarify new browser version requirements in `README.md` * Account for `_Concurrency` naming * Update `README.md` * Update README.md Co-authored-by: ezraberch <49635435+ezraberch@users.noreply.github.com> --- .../TokamakDemo.xcodeproj/project.pbxproj | 418 ++++++++++-------- Package.resolved | 8 +- Package.swift | 44 +- README.md | 21 +- .../TokamakCore/Modifiers/TaskModifier.swift | 32 ++ .../TokamakCore/Shapes/Path/PathLayout.swift | 2 +- Sources/TokamakDOM/DOMNode.swift | 4 +- Sources/TokamakDOM/DOMRenderer.swift | 8 + Sources/TokamakDOM/Views/Canvas/Canvas.swift | 16 +- .../{ => Buttons}/ButtonStyleDemo.swift | 6 +- .../TokamakDemo/{ => Buttons}/Counter.swift | 0 .../{ => Containers}/ForEachDemo.swift | 0 .../{ => Containers}/ListDemo.swift | 0 .../{ => Containers}/OutlineGroupDemo.swift | 0 .../{ => Containers}/SidebarDemo.swift | 0 .../TokamakDemo/{ => DOM}/DOMRefDemo.swift | 0 .../TokamakDemo/{ => DOM}/URLHashDemo.swift | 2 + .../{ => Drawing}/CanvasDemo.swift | 0 .../TokamakDemo/{ => Drawing}/ColorDemo.swift | 0 .../TokamakDemo/{ => Drawing}/PathDemo.swift | 0 .../{ => Drawing}/ShapeStyleDemo.swift | 0 .../{ => Layout}/GeometryReaderDemo.swift | 0 .../TokamakDemo/{ => Layout}/GridDemo.swift | 0 .../TokamakDemo/{ => Layout}/SpacerDemo.swift | 0 .../TokamakDemo/{ => Layout}/StackDemo.swift | 0 .../{ => Misc}/AnimationDemo.swift | 0 .../{ => Misc}/AppStorageDemo.swift | 0 .../{ => Misc}/EnvironmentDemo.swift | 0 .../{ => Misc}/PreferenceKeyDemo.swift | 0 .../{ => Misc}/ProgressViewDemo.swift | 0 .../TokamakDemo/{ => Misc}/RedactDemo.swift | 0 .../{ => Misc}/TransitionDemo.swift | 0 .../TokamakDemo/Modifiers/ShadowDemo.swift | 22 + Sources/TokamakDemo/Modifiers/TaskDemo.swift | 61 +++ .../{ => Selectors}/DatePickerDemo.swift | 0 .../{ => Selectors}/PickerDemo.swift | 0 .../{ => Selectors}/SliderDemo.swift | 0 .../{ => Selectors}/ToggleDemo.swift | 0 Sources/TokamakDemo/ShadowDemo.swift | 8 - Sources/TokamakDemo/{ => Text}/TextDemo.swift | 4 +- .../{ => Text}/TextEditorDemo.swift | 0 .../{ => Text}/TextFieldDemo.swift | 0 Sources/TokamakDemo/TokamakDemo.swift | 3 + Sources/TokamakGTK/GSignal.swift | 4 +- .../Modifiers/LayoutModifiers.swift | 2 +- Sources/TokamakStaticHTML/Views/HTML.swift | 2 +- 46 files changed, 442 insertions(+), 225 deletions(-) create mode 100644 Sources/TokamakCore/Modifiers/TaskModifier.swift rename Sources/TokamakDemo/{ => Buttons}/ButtonStyleDemo.swift (97%) rename Sources/TokamakDemo/{ => Buttons}/Counter.swift (100%) rename Sources/TokamakDemo/{ => Containers}/ForEachDemo.swift (100%) rename Sources/TokamakDemo/{ => Containers}/ListDemo.swift (100%) rename Sources/TokamakDemo/{ => Containers}/OutlineGroupDemo.swift (100%) rename Sources/TokamakDemo/{ => Containers}/SidebarDemo.swift (100%) rename Sources/TokamakDemo/{ => DOM}/DOMRefDemo.swift (100%) rename Sources/TokamakDemo/{ => DOM}/URLHashDemo.swift (96%) rename Sources/TokamakDemo/{ => Drawing}/CanvasDemo.swift (100%) rename Sources/TokamakDemo/{ => Drawing}/ColorDemo.swift (100%) rename Sources/TokamakDemo/{ => Drawing}/PathDemo.swift (100%) rename Sources/TokamakDemo/{ => Drawing}/ShapeStyleDemo.swift (100%) rename Sources/TokamakDemo/{ => Layout}/GeometryReaderDemo.swift (100%) rename Sources/TokamakDemo/{ => Layout}/GridDemo.swift (100%) rename Sources/TokamakDemo/{ => Layout}/SpacerDemo.swift (100%) rename Sources/TokamakDemo/{ => Layout}/StackDemo.swift (100%) rename Sources/TokamakDemo/{ => Misc}/AnimationDemo.swift (100%) rename Sources/TokamakDemo/{ => Misc}/AppStorageDemo.swift (100%) rename Sources/TokamakDemo/{ => Misc}/EnvironmentDemo.swift (100%) rename Sources/TokamakDemo/{ => Misc}/PreferenceKeyDemo.swift (100%) rename Sources/TokamakDemo/{ => Misc}/ProgressViewDemo.swift (100%) rename Sources/TokamakDemo/{ => Misc}/RedactDemo.swift (100%) rename Sources/TokamakDemo/{ => Misc}/TransitionDemo.swift (100%) create mode 100644 Sources/TokamakDemo/Modifiers/ShadowDemo.swift create mode 100644 Sources/TokamakDemo/Modifiers/TaskDemo.swift rename Sources/TokamakDemo/{ => Selectors}/DatePickerDemo.swift (100%) rename Sources/TokamakDemo/{ => Selectors}/PickerDemo.swift (100%) rename Sources/TokamakDemo/{ => Selectors}/SliderDemo.swift (100%) rename Sources/TokamakDemo/{ => Selectors}/ToggleDemo.swift (100%) delete mode 100644 Sources/TokamakDemo/ShadowDemo.swift rename Sources/TokamakDemo/{ => Text}/TextDemo.swift (97%) rename Sources/TokamakDemo/{ => Text}/TextEditorDemo.swift (100%) rename Sources/TokamakDemo/{ => Text}/TextFieldDemo.swift (100%) diff --git a/NativeDemo/TokamakDemo.xcodeproj/project.pbxproj b/NativeDemo/TokamakDemo.xcodeproj/project.pbxproj index 8590c37b..433b6c6f 100644 --- a/NativeDemo/TokamakDemo.xcodeproj/project.pbxproj +++ b/NativeDemo/TokamakDemo.xcodeproj/project.pbxproj @@ -7,73 +7,75 @@ objects = { /* Begin PBXBuildFile section */ - 207C05702610E16E00BBBE54 /* DatePickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 207C056F2610E16E00BBBE54 /* DatePickerDemo.swift */; }; - 207C05712610E16E00BBBE54 /* DatePickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 207C056F2610E16E00BBBE54 /* DatePickerDemo.swift */; }; - 26136823269E8EB5006F372E /* TransitionDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26136822269E8EB5006F372E /* TransitionDemo.swift */; }; - 26136824269E8EB5006F372E /* TransitionDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26136822269E8EB5006F372E /* TransitionDemo.swift */; }; - 262DA7B32695D99500CABEAE /* ShapeStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 262DA7B22695D99500CABEAE /* ShapeStyleDemo.swift */; }; - 262DA7B42695D99500CABEAE /* ShapeStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 262DA7B22695D99500CABEAE /* ShapeStyleDemo.swift */; }; - 2681096D26F7715400078F4E /* CanvasDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2681096C26F7715400078F4E /* CanvasDemo.swift */; }; - 2681096E26F7715400078F4E /* CanvasDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2681096C26F7715400078F4E /* CanvasDemo.swift */; }; - 26A3BFB0269BD18A0004DA16 /* AnimationDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26A3BFAF269BD18A0004DA16 /* AnimationDemo.swift */; }; - 26A3BFB1269BD18A0004DA16 /* AnimationDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26A3BFAF269BD18A0004DA16 /* AnimationDemo.swift */; }; - 26AC04B62698D33A0057784E /* ProgressViewDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26AC04B52698D33A0057784E /* ProgressViewDemo.swift */; }; - 26AC04B72698D33A0057784E /* ProgressViewDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26AC04B52698D33A0057784E /* ProgressViewDemo.swift */; }; - 3DCDE44424CA6AD400910F17 /* SidebarDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DCDE44324CA6AD400910F17 /* SidebarDemo.swift */; }; - 3DCDE44524CA6AD400910F17 /* SidebarDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DCDE44324CA6AD400910F17 /* SidebarDemo.swift */; }; - 4550BD5225B642B80088F4EA /* ShadowDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4550BD5125B642B80088F4EA /* ShadowDemo.swift */; }; - 4550BD5325B642B80088F4EA /* ShadowDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4550BD5125B642B80088F4EA /* ShadowDemo.swift */; }; - 8500293F24D2FF3E001A2E84 /* SliderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8500293E24D2FF3E001A2E84 /* SliderDemo.swift */; }; - 8500294024D2FF3E001A2E84 /* SliderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8500293E24D2FF3E001A2E84 /* SliderDemo.swift */; }; - 854A1A9124B3E3630027BC32 /* ToggleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85CBD5DE24B3BF090066468A /* ToggleDemo.swift */; }; - 854A1A9324B3F28F0027BC32 /* ToggleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85CBD5DE24B3BF090066468A /* ToggleDemo.swift */; }; 85ED186A24AD38F20085DFA0 /* UIAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED186924AD38F20085DFA0 /* UIAppDelegate.swift */; }; 85ED188A24AD3CD60085DFA0 /* macOS.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 85ED188724AD3CC30085DFA0 /* macOS.storyboard */; }; 85ED188C24AD3CF10085DFA0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 85ED188B24AD3CF10085DFA0 /* LaunchScreen.storyboard */; }; - 85ED18A324AD425E0085DFA0 /* SpacerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189A24AD425E0085DFA0 /* SpacerDemo.swift */; }; - 85ED18A424AD425E0085DFA0 /* SpacerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189A24AD425E0085DFA0 /* SpacerDemo.swift */; }; - 85ED18A524AD425E0085DFA0 /* TextDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189B24AD425E0085DFA0 /* TextDemo.swift */; }; - 85ED18A624AD425E0085DFA0 /* TextDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189B24AD425E0085DFA0 /* TextDemo.swift */; }; - 85ED18A724AD425E0085DFA0 /* ForEachDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189C24AD425E0085DFA0 /* ForEachDemo.swift */; }; - 85ED18A824AD425E0085DFA0 /* ForEachDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189C24AD425E0085DFA0 /* ForEachDemo.swift */; }; 85ED18A924AD425E0085DFA0 /* TokamakDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189D24AD425E0085DFA0 /* TokamakDemo.swift */; }; 85ED18AA24AD425E0085DFA0 /* TokamakDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189D24AD425E0085DFA0 /* TokamakDemo.swift */; }; - 85ED18AB24AD425E0085DFA0 /* Counter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189E24AD425E0085DFA0 /* Counter.swift */; }; - 85ED18AC24AD425E0085DFA0 /* Counter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189E24AD425E0085DFA0 /* Counter.swift */; }; - 85ED18AD24AD425E0085DFA0 /* TextFieldDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189F24AD425E0085DFA0 /* TextFieldDemo.swift */; }; - 85ED18AE24AD425E0085DFA0 /* TextFieldDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189F24AD425E0085DFA0 /* TextFieldDemo.swift */; }; - 85ED18AF24AD425E0085DFA0 /* EnvironmentDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED18A024AD425E0085DFA0 /* EnvironmentDemo.swift */; }; - 85ED18B024AD425E0085DFA0 /* EnvironmentDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED18A024AD425E0085DFA0 /* EnvironmentDemo.swift */; }; 85ED18B624AD42D70085DFA0 /* NSAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189424AD41B90085DFA0 /* NSAppDelegate.swift */; }; - B51F215024B920B400CF2583 /* PathDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51F214F24B920B400CF2583 /* PathDemo.swift */; }; - B51F215124B920B400CF2583 /* PathDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51F214F24B920B400CF2583 /* PathDemo.swift */; }; - B56F22E024BC89FD001738DF /* ColorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56F22DF24BC89FD001738DF /* ColorDemo.swift */; }; - B56F22E124BC89FD001738DF /* ColorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56F22DF24BC89FD001738DF /* ColorDemo.swift */; }; - B56F22E324BD1C26001738DF /* GridDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56F22E224BD1C26001738DF /* GridDemo.swift */; }; - B56F22E424BD1C26001738DF /* GridDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56F22E224BD1C26001738DF /* GridDemo.swift */; }; - B5C76E4A24C73ED5003EABB2 /* AppStorageDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5C76E4924C73ED4003EABB2 /* AppStorageDemo.swift */; }; - B5C76E4B24C73ED5003EABB2 /* AppStorageDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5C76E4924C73ED4003EABB2 /* AppStorageDemo.swift */; }; - B5DBA22B24D509B4003D3347 /* RedactDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DBA22A24D509B4003D3347 /* RedactDemo.swift */; }; - B5DBA22C24D509B4003D3347 /* RedactDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DBA22A24D509B4003D3347 /* RedactDemo.swift */; }; - B5F2BE032571443D00FB3653 /* PreferenceKeyDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F2BE022571443D00FB3653 /* PreferenceKeyDemo.swift */; }; - B5F2BE042571443D00FB3653 /* PreferenceKeyDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F2BE022571443D00FB3653 /* PreferenceKeyDemo.swift */; }; - D120FDDB257E7145008FFBAD /* TextEditorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D120FDDA257E7145008FFBAD /* TextEditorDemo.swift */; }; - D120FDDC257E7145008FFBAD /* TextEditorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D120FDDA257E7145008FFBAD /* TextEditorDemo.swift */; }; - D1316F202500352200224A67 /* StackDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1316F1F2500352200224A67 /* StackDemo.swift */; }; - D1316F212500352200224A67 /* StackDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1316F1F2500352200224A67 /* StackDemo.swift */; }; - D1B4229024B3B9BB00682F74 /* ListDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B4228E24B3B9BB00682F74 /* ListDemo.swift */; }; - D1B4229124B3B9BB00682F74 /* ListDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B4228E24B3B9BB00682F74 /* ListDemo.swift */; }; - D1B4229224B3B9BB00682F74 /* OutlineGroupDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B4228F24B3B9BB00682F74 /* OutlineGroupDemo.swift */; }; - D1B4229324B3B9BB00682F74 /* OutlineGroupDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B4228F24B3B9BB00682F74 /* OutlineGroupDemo.swift */; }; - D1C726F324CB63C6003B576D /* ButtonStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1C726F224CB63C6003B576D /* ButtonStyleDemo.swift */; }; - D1C726F424CB63C6003B576D /* ButtonStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1C726F224CB63C6003B576D /* ButtonStyleDemo.swift */; }; - D1D6B62324D817350041E1D9 /* GeometryReaderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1D6B62224D817350041E1D9 /* GeometryReaderDemo.swift */; }; - D1D6B62424D817350041E1D9 /* GeometryReaderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1D6B62224D817350041E1D9 /* GeometryReaderDemo.swift */; }; + D107874E274BD1E5003E787B /* SpacerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078726274BD1E5003E787B /* SpacerDemo.swift */; }; + D107874F274BD1E5003E787B /* SpacerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078726274BD1E5003E787B /* SpacerDemo.swift */; }; + D1078750274BD1E5003E787B /* GeometryReaderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078727274BD1E5003E787B /* GeometryReaderDemo.swift */; }; + D1078751274BD1E5003E787B /* GeometryReaderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078727274BD1E5003E787B /* GeometryReaderDemo.swift */; }; + D1078752274BD1E5003E787B /* GridDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078728274BD1E5003E787B /* GridDemo.swift */; }; + D1078753274BD1E5003E787B /* GridDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078728274BD1E5003E787B /* GridDemo.swift */; }; + D1078754274BD1E5003E787B /* StackDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078729274BD1E5003E787B /* StackDemo.swift */; }; + D1078755274BD1E5003E787B /* StackDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078729274BD1E5003E787B /* StackDemo.swift */; }; + D1078756274BD1E5003E787B /* DatePickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872B274BD1E5003E787B /* DatePickerDemo.swift */; }; + D1078757274BD1E5003E787B /* DatePickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872B274BD1E5003E787B /* DatePickerDemo.swift */; }; + D1078758274BD1E5003E787B /* SliderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872C274BD1E5003E787B /* SliderDemo.swift */; }; + D1078759274BD1E5003E787B /* SliderDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872C274BD1E5003E787B /* SliderDemo.swift */; }; + D107875A274BD1E5003E787B /* PickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872D274BD1E5003E787B /* PickerDemo.swift */; }; + D107875B274BD1E5003E787B /* PickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872D274BD1E5003E787B /* PickerDemo.swift */; }; + D107875C274BD1E5003E787B /* ToggleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872E274BD1E5003E787B /* ToggleDemo.swift */; }; + D107875D274BD1E5003E787B /* ToggleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107872E274BD1E5003E787B /* ToggleDemo.swift */; }; + D107875E274BD1E5003E787B /* OutlineGroupDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078730274BD1E5003E787B /* OutlineGroupDemo.swift */; }; + D107875F274BD1E5003E787B /* OutlineGroupDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078730274BD1E5003E787B /* OutlineGroupDemo.swift */; }; + D1078760274BD1E5003E787B /* ForEachDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078731274BD1E5003E787B /* ForEachDemo.swift */; }; + D1078761274BD1E5003E787B /* ForEachDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078731274BD1E5003E787B /* ForEachDemo.swift */; }; + D1078762274BD1E5003E787B /* ListDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078732274BD1E5003E787B /* ListDemo.swift */; }; + D1078763274BD1E5003E787B /* ListDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078732274BD1E5003E787B /* ListDemo.swift */; }; + D1078764274BD1E5003E787B /* SidebarDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078733274BD1E5003E787B /* SidebarDemo.swift */; }; + D1078765274BD1E5003E787B /* SidebarDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078733274BD1E5003E787B /* SidebarDemo.swift */; }; + D1078766274BD1E5003E787B /* TaskDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078735274BD1E5003E787B /* TaskDemo.swift */; }; + D1078767274BD1E5003E787B /* TaskDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078735274BD1E5003E787B /* TaskDemo.swift */; }; + D1078768274BD1E5003E787B /* ShadowDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078736274BD1E5003E787B /* ShadowDemo.swift */; }; + D1078769274BD1E5003E787B /* ShadowDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078736274BD1E5003E787B /* ShadowDemo.swift */; }; + D107876E274BD1E5003E787B /* PathDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873B274BD1E5003E787B /* PathDemo.swift */; }; + D107876F274BD1E5003E787B /* PathDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873B274BD1E5003E787B /* PathDemo.swift */; }; + D1078770274BD1E5003E787B /* CanvasDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873C274BD1E5003E787B /* CanvasDemo.swift */; }; + D1078771274BD1E5003E787B /* CanvasDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873C274BD1E5003E787B /* CanvasDemo.swift */; }; + D1078772274BD1E5003E787B /* ColorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873D274BD1E5003E787B /* ColorDemo.swift */; }; + D1078773274BD1E5003E787B /* ColorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873D274BD1E5003E787B /* ColorDemo.swift */; }; + D1078774274BD1E5003E787B /* ShapeStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873E274BD1E5003E787B /* ShapeStyleDemo.swift */; }; + D1078775274BD1E5003E787B /* ShapeStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107873E274BD1E5003E787B /* ShapeStyleDemo.swift */; }; + D1078776274BD1E5003E787B /* AnimationDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078740274BD1E5003E787B /* AnimationDemo.swift */; }; + D1078777274BD1E5003E787B /* AnimationDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078740274BD1E5003E787B /* AnimationDemo.swift */; }; + D1078778274BD1E5003E787B /* PreferenceKeyDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078741274BD1E5003E787B /* PreferenceKeyDemo.swift */; }; + D1078779274BD1E5003E787B /* PreferenceKeyDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078741274BD1E5003E787B /* PreferenceKeyDemo.swift */; }; + D107877A274BD1E5003E787B /* TransitionDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078742274BD1E5003E787B /* TransitionDemo.swift */; }; + D107877B274BD1E5003E787B /* TransitionDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078742274BD1E5003E787B /* TransitionDemo.swift */; }; + D107877C274BD1E5003E787B /* ProgressViewDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078743274BD1E5003E787B /* ProgressViewDemo.swift */; }; + D107877D274BD1E5003E787B /* ProgressViewDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078743274BD1E5003E787B /* ProgressViewDemo.swift */; }; + D107877E274BD1E5003E787B /* AppStorageDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078744274BD1E5003E787B /* AppStorageDemo.swift */; }; + D107877F274BD1E5003E787B /* AppStorageDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078744274BD1E5003E787B /* AppStorageDemo.swift */; }; + D1078780274BD1E5003E787B /* EnvironmentDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078745274BD1E5003E787B /* EnvironmentDemo.swift */; }; + D1078781274BD1E5003E787B /* EnvironmentDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078745274BD1E5003E787B /* EnvironmentDemo.swift */; }; + D1078782274BD1E5003E787B /* RedactDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078746274BD1E5003E787B /* RedactDemo.swift */; }; + D1078783274BD1E5003E787B /* RedactDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078746274BD1E5003E787B /* RedactDemo.swift */; }; + D1078784274BD1E5003E787B /* TextDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078748274BD1E5003E787B /* TextDemo.swift */; }; + D1078785274BD1E5003E787B /* TextDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078748274BD1E5003E787B /* TextDemo.swift */; }; + D1078786274BD1E5003E787B /* TextEditorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078749274BD1E5003E787B /* TextEditorDemo.swift */; }; + D1078787274BD1E5003E787B /* TextEditorDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1078749274BD1E5003E787B /* TextEditorDemo.swift */; }; + D1078788274BD1E5003E787B /* TextFieldDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107874A274BD1E5003E787B /* TextFieldDemo.swift */; }; + D1078789274BD1E5003E787B /* TextFieldDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107874A274BD1E5003E787B /* TextFieldDemo.swift */; }; + D107878A274BD1E5003E787B /* Counter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107874C274BD1E5003E787B /* Counter.swift */; }; + D107878B274BD1E5003E787B /* Counter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107874C274BD1E5003E787B /* Counter.swift */; }; + D107878C274BD1E5003E787B /* ButtonStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107874D274BD1E5003E787B /* ButtonStyleDemo.swift */; }; + D107878D274BD1E5003E787B /* ButtonStyleDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D107874D274BD1E5003E787B /* ButtonStyleDemo.swift */; }; D1E5FDAD24C1D57000E7485E /* TokamakShim.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1E5FDAC24C1D57000E7485E /* TokamakShim.swift */; }; D1E5FDAF24C1D58E00E7485E /* libTokamakShim.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D1E5FDA424C1D54B00E7485E /* libTokamakShim.a */; }; D1E5FDB224C1D59400E7485E /* libTokamakShim.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D1E5FDA424C1D54B00E7485E /* libTokamakShim.a */; }; - D1EE7EA724C0DD2100C0D127 /* PickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1EE7EA624C0DD2100C0D127 /* PickerDemo.swift */; }; - D1EE7EA824C0DD2100C0D127 /* PickerDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1EE7EA624C0DD2100C0D127 /* PickerDemo.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -106,47 +108,48 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 207C056F2610E16E00BBBE54 /* DatePickerDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatePickerDemo.swift; sourceTree = ""; }; - 26136822269E8EB5006F372E /* TransitionDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransitionDemo.swift; sourceTree = ""; }; - 262DA7B22695D99500CABEAE /* ShapeStyleDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShapeStyleDemo.swift; sourceTree = ""; }; - 2681096C26F7715400078F4E /* CanvasDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CanvasDemo.swift; sourceTree = ""; }; - 26A3BFAF269BD18A0004DA16 /* AnimationDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationDemo.swift; sourceTree = ""; }; - 26AC04B52698D33A0057784E /* ProgressViewDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProgressViewDemo.swift; sourceTree = ""; }; - 3DCDE44324CA6AD400910F17 /* SidebarDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SidebarDemo.swift; sourceTree = ""; }; - 4550BD5125B642B80088F4EA /* ShadowDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShadowDemo.swift; sourceTree = ""; }; - 8500293E24D2FF3E001A2E84 /* SliderDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderDemo.swift; sourceTree = ""; }; 8587DF5524D4B9A40033EF43 /* TokamakDemo Native.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "TokamakDemo Native.entitlements"; sourceTree = ""; }; - 85CBD5DE24B3BF090066468A /* ToggleDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToggleDemo.swift; sourceTree = ""; }; 85ED184A24AD379A0085DFA0 /* TokamakDemo Native.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "TokamakDemo Native.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 85ED185224AD379A0085DFA0 /* TokamakDemo Native.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "TokamakDemo Native.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 85ED186924AD38F20085DFA0 /* UIAppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIAppDelegate.swift; sourceTree = ""; }; 85ED188724AD3CC30085DFA0 /* macOS.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = macOS.storyboard; sourceTree = ""; }; 85ED188B24AD3CF10085DFA0 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; 85ED189424AD41B90085DFA0 /* NSAppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSAppDelegate.swift; sourceTree = ""; }; - 85ED189A24AD425E0085DFA0 /* SpacerDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpacerDemo.swift; sourceTree = ""; }; - 85ED189B24AD425E0085DFA0 /* TextDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextDemo.swift; sourceTree = ""; }; - 85ED189C24AD425E0085DFA0 /* ForEachDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ForEachDemo.swift; sourceTree = ""; }; 85ED189D24AD425E0085DFA0 /* TokamakDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = TokamakDemo.swift; sourceTree = ""; tabWidth = 2; }; - 85ED189E24AD425E0085DFA0 /* Counter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Counter.swift; sourceTree = ""; }; - 85ED189F24AD425E0085DFA0 /* TextFieldDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextFieldDemo.swift; sourceTree = ""; }; - 85ED18A024AD425E0085DFA0 /* EnvironmentDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EnvironmentDemo.swift; sourceTree = ""; }; 85ED18BD24AD46340085DFA0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 85ED18BF24AD464B0085DFA0 /* iOS Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "iOS Info.plist"; sourceTree = ""; }; - B51F214F24B920B400CF2583 /* PathDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PathDemo.swift; sourceTree = ""; }; - B56F22DF24BC89FD001738DF /* ColorDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = ColorDemo.swift; sourceTree = ""; tabWidth = 2; }; - B56F22E224BD1C26001738DF /* GridDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GridDemo.swift; sourceTree = ""; }; - B5C76E4924C73ED4003EABB2 /* AppStorageDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppStorageDemo.swift; sourceTree = ""; }; - B5DBA22A24D509B4003D3347 /* RedactDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RedactDemo.swift; sourceTree = ""; }; - B5F2BE022571443D00FB3653 /* PreferenceKeyDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreferenceKeyDemo.swift; sourceTree = ""; }; - D120FDDA257E7145008FFBAD /* TextEditorDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextEditorDemo.swift; sourceTree = ""; }; - D1316F1F2500352200224A67 /* StackDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StackDemo.swift; sourceTree = ""; }; - D1B4228E24B3B9BB00682F74 /* ListDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListDemo.swift; sourceTree = ""; }; - D1B4228F24B3B9BB00682F74 /* OutlineGroupDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OutlineGroupDemo.swift; sourceTree = ""; }; - D1C726F224CB63C6003B576D /* ButtonStyleDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = ButtonStyleDemo.swift; sourceTree = ""; tabWidth = 2; }; - D1D6B62224D817350041E1D9 /* GeometryReaderDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeometryReaderDemo.swift; sourceTree = ""; }; + D1078726274BD1E5003E787B /* SpacerDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpacerDemo.swift; sourceTree = ""; }; + D1078727274BD1E5003E787B /* GeometryReaderDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeometryReaderDemo.swift; sourceTree = ""; }; + D1078728274BD1E5003E787B /* GridDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GridDemo.swift; sourceTree = ""; }; + D1078729274BD1E5003E787B /* StackDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StackDemo.swift; sourceTree = ""; }; + D107872B274BD1E5003E787B /* DatePickerDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatePickerDemo.swift; sourceTree = ""; }; + D107872C274BD1E5003E787B /* SliderDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderDemo.swift; sourceTree = ""; }; + D107872D274BD1E5003E787B /* PickerDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PickerDemo.swift; sourceTree = ""; }; + D107872E274BD1E5003E787B /* ToggleDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToggleDemo.swift; sourceTree = ""; }; + D1078730274BD1E5003E787B /* OutlineGroupDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OutlineGroupDemo.swift; sourceTree = ""; }; + D1078731274BD1E5003E787B /* ForEachDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ForEachDemo.swift; sourceTree = ""; }; + D1078732274BD1E5003E787B /* ListDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListDemo.swift; sourceTree = ""; }; + D1078733274BD1E5003E787B /* SidebarDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SidebarDemo.swift; sourceTree = ""; }; + D1078735274BD1E5003E787B /* TaskDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TaskDemo.swift; sourceTree = ""; }; + D1078736274BD1E5003E787B /* ShadowDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShadowDemo.swift; sourceTree = ""; }; + D107873B274BD1E5003E787B /* PathDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PathDemo.swift; sourceTree = ""; }; + D107873C274BD1E5003E787B /* CanvasDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CanvasDemo.swift; sourceTree = ""; }; + D107873D274BD1E5003E787B /* ColorDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorDemo.swift; sourceTree = ""; }; + D107873E274BD1E5003E787B /* ShapeStyleDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShapeStyleDemo.swift; sourceTree = ""; }; + D1078740274BD1E5003E787B /* AnimationDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationDemo.swift; sourceTree = ""; }; + D1078741274BD1E5003E787B /* PreferenceKeyDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreferenceKeyDemo.swift; sourceTree = ""; }; + D1078742274BD1E5003E787B /* TransitionDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransitionDemo.swift; sourceTree = ""; }; + D1078743274BD1E5003E787B /* ProgressViewDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProgressViewDemo.swift; sourceTree = ""; }; + D1078744274BD1E5003E787B /* AppStorageDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppStorageDemo.swift; sourceTree = ""; }; + D1078745274BD1E5003E787B /* EnvironmentDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EnvironmentDemo.swift; sourceTree = ""; }; + D1078746274BD1E5003E787B /* RedactDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RedactDemo.swift; sourceTree = ""; }; + D1078748274BD1E5003E787B /* TextDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextDemo.swift; sourceTree = ""; }; + D1078749274BD1E5003E787B /* TextEditorDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextEditorDemo.swift; sourceTree = ""; }; + D107874A274BD1E5003E787B /* TextFieldDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextFieldDemo.swift; sourceTree = ""; }; + D107874C274BD1E5003E787B /* Counter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Counter.swift; sourceTree = ""; }; + D107874D274BD1E5003E787B /* ButtonStyleDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ButtonStyleDemo.swift; sourceTree = ""; }; D1E5FDA424C1D54B00E7485E /* libTokamakShim.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libTokamakShim.a; sourceTree = BUILT_PRODUCTS_DIR; }; D1E5FDAC24C1D57000E7485E /* TokamakShim.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokamakShim.swift; sourceTree = ""; }; - D1EE7EA624C0DD2100C0D127 /* PickerDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PickerDemo.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -206,41 +209,106 @@ 85ED189924AD425E0085DFA0 /* TokamakDemo */ = { isa = PBXGroup; children = ( - 26136822269E8EB5006F372E /* TransitionDemo.swift */, - 26A3BFAF269BD18A0004DA16 /* AnimationDemo.swift */, - 262DA7B22695D99500CABEAE /* ShapeStyleDemo.swift */, - D120FDDA257E7145008FFBAD /* TextEditorDemo.swift */, - B5C76E4924C73ED4003EABB2 /* AppStorageDemo.swift */, - D1C726F224CB63C6003B576D /* ButtonStyleDemo.swift */, - 2681096C26F7715400078F4E /* CanvasDemo.swift */, - B56F22DF24BC89FD001738DF /* ColorDemo.swift */, - 85ED189E24AD425E0085DFA0 /* Counter.swift */, - 207C056F2610E16E00BBBE54 /* DatePickerDemo.swift */, - 85ED18A024AD425E0085DFA0 /* EnvironmentDemo.swift */, - 85ED189C24AD425E0085DFA0 /* ForEachDemo.swift */, - D1D6B62224D817350041E1D9 /* GeometryReaderDemo.swift */, - B56F22E224BD1C26001738DF /* GridDemo.swift */, - D1B4228E24B3B9BB00682F74 /* ListDemo.swift */, - D1B4228F24B3B9BB00682F74 /* OutlineGroupDemo.swift */, - B51F214F24B920B400CF2583 /* PathDemo.swift */, - D1EE7EA624C0DD2100C0D127 /* PickerDemo.swift */, - B5F2BE022571443D00FB3653 /* PreferenceKeyDemo.swift */, - 26AC04B52698D33A0057784E /* ProgressViewDemo.swift */, - B5DBA22A24D509B4003D3347 /* RedactDemo.swift */, - 3DCDE44324CA6AD400910F17 /* SidebarDemo.swift */, - 8500293E24D2FF3E001A2E84 /* SliderDemo.swift */, - 85ED189A24AD425E0085DFA0 /* SpacerDemo.swift */, - D1316F1F2500352200224A67 /* StackDemo.swift */, - 85ED189B24AD425E0085DFA0 /* TextDemo.swift */, - 85ED189F24AD425E0085DFA0 /* TextFieldDemo.swift */, - 85CBD5DE24B3BF090066468A /* ToggleDemo.swift */, + D107874B274BD1E5003E787B /* Buttons */, + D107872F274BD1E5003E787B /* Containers */, + D107873A274BD1E5003E787B /* Drawing */, + D1078725274BD1E5003E787B /* Layout */, + D107873F274BD1E5003E787B /* Misc */, + D1078734274BD1E5003E787B /* Modifiers */, + D107872A274BD1E5003E787B /* Selectors */, + D1078747274BD1E5003E787B /* Text */, 85ED189D24AD425E0085DFA0 /* TokamakDemo.swift */, - 4550BD5125B642B80088F4EA /* ShadowDemo.swift */, ); name = TokamakDemo; path = ../Sources/TokamakDemo; sourceTree = ""; }; + D1078725274BD1E5003E787B /* Layout */ = { + isa = PBXGroup; + children = ( + D1078726274BD1E5003E787B /* SpacerDemo.swift */, + D1078727274BD1E5003E787B /* GeometryReaderDemo.swift */, + D1078728274BD1E5003E787B /* GridDemo.swift */, + D1078729274BD1E5003E787B /* StackDemo.swift */, + ); + path = Layout; + sourceTree = ""; + }; + D107872A274BD1E5003E787B /* Selectors */ = { + isa = PBXGroup; + children = ( + D107872B274BD1E5003E787B /* DatePickerDemo.swift */, + D107872C274BD1E5003E787B /* SliderDemo.swift */, + D107872D274BD1E5003E787B /* PickerDemo.swift */, + D107872E274BD1E5003E787B /* ToggleDemo.swift */, + ); + path = Selectors; + sourceTree = ""; + }; + D107872F274BD1E5003E787B /* Containers */ = { + isa = PBXGroup; + children = ( + D1078730274BD1E5003E787B /* OutlineGroupDemo.swift */, + D1078731274BD1E5003E787B /* ForEachDemo.swift */, + D1078732274BD1E5003E787B /* ListDemo.swift */, + D1078733274BD1E5003E787B /* SidebarDemo.swift */, + ); + path = Containers; + sourceTree = ""; + }; + D1078734274BD1E5003E787B /* Modifiers */ = { + isa = PBXGroup; + children = ( + D1078735274BD1E5003E787B /* TaskDemo.swift */, + D1078736274BD1E5003E787B /* ShadowDemo.swift */, + ); + path = Modifiers; + sourceTree = ""; + }; + D107873A274BD1E5003E787B /* Drawing */ = { + isa = PBXGroup; + children = ( + D107873B274BD1E5003E787B /* PathDemo.swift */, + D107873C274BD1E5003E787B /* CanvasDemo.swift */, + D107873D274BD1E5003E787B /* ColorDemo.swift */, + D107873E274BD1E5003E787B /* ShapeStyleDemo.swift */, + ); + path = Drawing; + sourceTree = ""; + }; + D107873F274BD1E5003E787B /* Misc */ = { + isa = PBXGroup; + children = ( + D1078740274BD1E5003E787B /* AnimationDemo.swift */, + D1078741274BD1E5003E787B /* PreferenceKeyDemo.swift */, + D1078742274BD1E5003E787B /* TransitionDemo.swift */, + D1078743274BD1E5003E787B /* ProgressViewDemo.swift */, + D1078744274BD1E5003E787B /* AppStorageDemo.swift */, + D1078745274BD1E5003E787B /* EnvironmentDemo.swift */, + D1078746274BD1E5003E787B /* RedactDemo.swift */, + ); + path = Misc; + sourceTree = ""; + }; + D1078747274BD1E5003E787B /* Text */ = { + isa = PBXGroup; + children = ( + D1078748274BD1E5003E787B /* TextDemo.swift */, + D1078749274BD1E5003E787B /* TextEditorDemo.swift */, + D107874A274BD1E5003E787B /* TextFieldDemo.swift */, + ); + path = Text; + sourceTree = ""; + }; + D107874B274BD1E5003E787B /* Buttons */ = { + isa = PBXGroup; + children = ( + D107874C274BD1E5003E787B /* Counter.swift */, + D107874D274BD1E5003E787B /* ButtonStyleDemo.swift */, + ); + path = Buttons; + sourceTree = ""; + }; D1E5FDAB24C1D57000E7485E /* TokamakShim */ = { isa = PBXGroup; children = ( @@ -379,37 +447,38 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + D107875C274BD1E5003E787B /* ToggleDemo.swift in Sources */, + D1078784274BD1E5003E787B /* TextDemo.swift in Sources */, + D107878A274BD1E5003E787B /* Counter.swift in Sources */, + D1078752274BD1E5003E787B /* GridDemo.swift in Sources */, + D1078774274BD1E5003E787B /* ShapeStyleDemo.swift in Sources */, 85ED186A24AD38F20085DFA0 /* UIAppDelegate.swift in Sources */, - 207C05702610E16E00BBBE54 /* DatePickerDemo.swift in Sources */, - B56F22E324BD1C26001738DF /* GridDemo.swift in Sources */, - D1B4229224B3B9BB00682F74 /* OutlineGroupDemo.swift in Sources */, - D1D6B62324D817350041E1D9 /* GeometryReaderDemo.swift in Sources */, - B5DBA22B24D509B4003D3347 /* RedactDemo.swift in Sources */, - B56F22E024BC89FD001738DF /* ColorDemo.swift in Sources */, - 26A3BFB0269BD18A0004DA16 /* AnimationDemo.swift in Sources */, - 26136823269E8EB5006F372E /* TransitionDemo.swift in Sources */, - B51F215024B920B400CF2583 /* PathDemo.swift in Sources */, - 85ED18AF24AD425E0085DFA0 /* EnvironmentDemo.swift in Sources */, - 85ED18A324AD425E0085DFA0 /* SpacerDemo.swift in Sources */, - D1B4229024B3B9BB00682F74 /* ListDemo.swift in Sources */, - D1EE7EA724C0DD2100C0D127 /* PickerDemo.swift in Sources */, - D120FDDB257E7145008FFBAD /* TextEditorDemo.swift in Sources */, - B5F2BE032571443D00FB3653 /* PreferenceKeyDemo.swift in Sources */, - D1316F202500352200224A67 /* StackDemo.swift in Sources */, - 8500293F24D2FF3E001A2E84 /* SliderDemo.swift in Sources */, - 4550BD5225B642B80088F4EA /* ShadowDemo.swift in Sources */, - 2681096D26F7715400078F4E /* CanvasDemo.swift in Sources */, + D107875E274BD1E5003E787B /* OutlineGroupDemo.swift in Sources */, + D1078770274BD1E5003E787B /* CanvasDemo.swift in Sources */, 85ED18A924AD425E0085DFA0 /* TokamakDemo.swift in Sources */, - B5C76E4A24C73ED5003EABB2 /* AppStorageDemo.swift in Sources */, - 3DCDE44424CA6AD400910F17 /* SidebarDemo.swift in Sources */, - 85ED18AD24AD425E0085DFA0 /* TextFieldDemo.swift in Sources */, - 262DA7B32695D99500CABEAE /* ShapeStyleDemo.swift in Sources */, - 85ED18A724AD425E0085DFA0 /* ForEachDemo.swift in Sources */, - D1C726F324CB63C6003B576D /* ButtonStyleDemo.swift in Sources */, - 854A1A9124B3E3630027BC32 /* ToggleDemo.swift in Sources */, - 85ED18A524AD425E0085DFA0 /* TextDemo.swift in Sources */, - 26AC04B62698D33A0057784E /* ProgressViewDemo.swift in Sources */, - 85ED18AB24AD425E0085DFA0 /* Counter.swift in Sources */, + D1078758274BD1E5003E787B /* SliderDemo.swift in Sources */, + D107877A274BD1E5003E787B /* TransitionDemo.swift in Sources */, + D1078768274BD1E5003E787B /* ShadowDemo.swift in Sources */, + D107877E274BD1E5003E787B /* AppStorageDemo.swift in Sources */, + D1078782274BD1E5003E787B /* RedactDemo.swift in Sources */, + D1078786274BD1E5003E787B /* TextEditorDemo.swift in Sources */, + D1078772274BD1E5003E787B /* ColorDemo.swift in Sources */, + D1078776274BD1E5003E787B /* AnimationDemo.swift in Sources */, + D1078756274BD1E5003E787B /* DatePickerDemo.swift in Sources */, + D1078780274BD1E5003E787B /* EnvironmentDemo.swift in Sources */, + D107876E274BD1E5003E787B /* PathDemo.swift in Sources */, + D1078764274BD1E5003E787B /* SidebarDemo.swift in Sources */, + D1078754274BD1E5003E787B /* StackDemo.swift in Sources */, + D1078778274BD1E5003E787B /* PreferenceKeyDemo.swift in Sources */, + D107874E274BD1E5003E787B /* SpacerDemo.swift in Sources */, + D1078766274BD1E5003E787B /* TaskDemo.swift in Sources */, + D1078760274BD1E5003E787B /* ForEachDemo.swift in Sources */, + D1078750274BD1E5003E787B /* GeometryReaderDemo.swift in Sources */, + D107875A274BD1E5003E787B /* PickerDemo.swift in Sources */, + D1078788274BD1E5003E787B /* TextFieldDemo.swift in Sources */, + D107878C274BD1E5003E787B /* ButtonStyleDemo.swift in Sources */, + D1078762274BD1E5003E787B /* ListDemo.swift in Sources */, + D107877C274BD1E5003E787B /* ProgressViewDemo.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -417,37 +486,38 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + D107875D274BD1E5003E787B /* ToggleDemo.swift in Sources */, + D1078785274BD1E5003E787B /* TextDemo.swift in Sources */, + D107878B274BD1E5003E787B /* Counter.swift in Sources */, + D1078753274BD1E5003E787B /* GridDemo.swift in Sources */, + D1078775274BD1E5003E787B /* ShapeStyleDemo.swift in Sources */, 85ED18AA24AD425E0085DFA0 /* TokamakDemo.swift in Sources */, - 207C05712610E16E00BBBE54 /* DatePickerDemo.swift in Sources */, - D1316F212500352200224A67 /* StackDemo.swift in Sources */, - B56F22E424BD1C26001738DF /* GridDemo.swift in Sources */, - D1B4229324B3B9BB00682F74 /* OutlineGroupDemo.swift in Sources */, - D1D6B62424D817350041E1D9 /* GeometryReaderDemo.swift in Sources */, - B5DBA22C24D509B4003D3347 /* RedactDemo.swift in Sources */, - 26A3BFB1269BD18A0004DA16 /* AnimationDemo.swift in Sources */, - 26136824269E8EB5006F372E /* TransitionDemo.swift in Sources */, - B56F22E124BC89FD001738DF /* ColorDemo.swift in Sources */, - B51F215124B920B400CF2583 /* PathDemo.swift in Sources */, - 85ED18A424AD425E0085DFA0 /* SpacerDemo.swift in Sources */, - 85ED18B024AD425E0085DFA0 /* EnvironmentDemo.swift in Sources */, - D1B4229124B3B9BB00682F74 /* ListDemo.swift in Sources */, - D1EE7EA824C0DD2100C0D127 /* PickerDemo.swift in Sources */, - D120FDDC257E7145008FFBAD /* TextEditorDemo.swift in Sources */, - B5F2BE042571443D00FB3653 /* PreferenceKeyDemo.swift in Sources */, - 8500294024D2FF3E001A2E84 /* SliderDemo.swift in Sources */, - 4550BD5325B642B80088F4EA /* ShadowDemo.swift in Sources */, - 2681096E26F7715400078F4E /* CanvasDemo.swift in Sources */, + D107875F274BD1E5003E787B /* OutlineGroupDemo.swift in Sources */, + D1078771274BD1E5003E787B /* CanvasDemo.swift in Sources */, 85ED18B624AD42D70085DFA0 /* NSAppDelegate.swift in Sources */, - B5C76E4B24C73ED5003EABB2 /* AppStorageDemo.swift in Sources */, - 3DCDE44524CA6AD400910F17 /* SidebarDemo.swift in Sources */, - 85ED18AC24AD425E0085DFA0 /* Counter.swift in Sources */, - 262DA7B42695D99500CABEAE /* ShapeStyleDemo.swift in Sources */, - 85ED18A824AD425E0085DFA0 /* ForEachDemo.swift in Sources */, - D1C726F424CB63C6003B576D /* ButtonStyleDemo.swift in Sources */, - 854A1A9324B3F28F0027BC32 /* ToggleDemo.swift in Sources */, - 85ED18AE24AD425E0085DFA0 /* TextFieldDemo.swift in Sources */, - 26AC04B72698D33A0057784E /* ProgressViewDemo.swift in Sources */, - 85ED18A624AD425E0085DFA0 /* TextDemo.swift in Sources */, + D1078759274BD1E5003E787B /* SliderDemo.swift in Sources */, + D107877B274BD1E5003E787B /* TransitionDemo.swift in Sources */, + D1078769274BD1E5003E787B /* ShadowDemo.swift in Sources */, + D107877F274BD1E5003E787B /* AppStorageDemo.swift in Sources */, + D1078783274BD1E5003E787B /* RedactDemo.swift in Sources */, + D1078787274BD1E5003E787B /* TextEditorDemo.swift in Sources */, + D1078773274BD1E5003E787B /* ColorDemo.swift in Sources */, + D1078777274BD1E5003E787B /* AnimationDemo.swift in Sources */, + D1078757274BD1E5003E787B /* DatePickerDemo.swift in Sources */, + D1078781274BD1E5003E787B /* EnvironmentDemo.swift in Sources */, + D107876F274BD1E5003E787B /* PathDemo.swift in Sources */, + D1078765274BD1E5003E787B /* SidebarDemo.swift in Sources */, + D1078755274BD1E5003E787B /* StackDemo.swift in Sources */, + D1078779274BD1E5003E787B /* PreferenceKeyDemo.swift in Sources */, + D107874F274BD1E5003E787B /* SpacerDemo.swift in Sources */, + D1078767274BD1E5003E787B /* TaskDemo.swift in Sources */, + D1078761274BD1E5003E787B /* ForEachDemo.swift in Sources */, + D1078751274BD1E5003E787B /* GeometryReaderDemo.swift in Sources */, + D107875B274BD1E5003E787B /* PickerDemo.swift in Sources */, + D1078789274BD1E5003E787B /* TextFieldDemo.swift in Sources */, + D107878D274BD1E5003E787B /* ButtonStyleDemo.swift in Sources */, + D1078763274BD1E5003E787B /* ListDemo.swift in Sources */, + D107877D274BD1E5003E787B /* ProgressViewDemo.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Package.resolved b/Package.resolved index cab685ee..284a7af5 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/swiftwasm/JavaScriptKit.git", "state": { "branch": null, - "revision": "b19e7c8b10a2750ed47753e31ed13613171f3294", - "version": "0.10.1" + "revision": "309e63c03d8116210ad0437f5d1f09a26d4de48b", + "version": "0.11.1" } }, { @@ -24,8 +24,8 @@ "repositoryURL": "https://github.com/swiftwasm/OpenCombineJS.git", "state": { "branch": null, - "revision": "eaf324ce78710f53b52fb82e9a8de4693633e33a", - "version": "0.1.1" + "revision": "f1f1799ddbb9876a0ef8c5700a3b78d352d0b969", + "version": "0.1.2" } }, { diff --git a/Package.swift b/Package.swift index 704ee759..65f4064b 100644 --- a/Package.swift +++ b/Package.swift @@ -4,6 +4,31 @@ import PackageDescription +var tokamakDOMDependencies: [Target.Dependency] = [ + "TokamakCore", + "TokamakStaticHTML", + .product( + name: "OpenCombineShim", + package: "OpenCombine" + ), + .product( + name: "JavaScriptKit", + package: "JavaScriptKit", + condition: .when(platforms: [.wasi]) + ), + "OpenCombineJS", +] + +#if compiler(>=5.5) && (canImport(Concurrency) || canImport(_Concurrency)) +tokamakDOMDependencies.append( + .product( + name: "JavaScriptEventLoop", + package: "JavaScriptKit", + condition: .when(platforms: [.wasi]) + ) +) +#endif + let package = Package( name: "Tokamak", platforms: [ @@ -51,7 +76,7 @@ let package = Package( // .package(url: /* package url */, from: "1.0.0"), .package( url: "https://github.com/swiftwasm/JavaScriptKit.git", - .upToNextMinor(from: "0.10.0") + .upToNextMinor(from: "0.11.1") ), .package( url: "https://github.com/OpenCombine/OpenCombine.git", @@ -59,7 +84,7 @@ let package = Package( ), .package( url: "https://github.com/swiftwasm/OpenCombineJS.git", - .upToNextMinor(from: "0.1.1") + .upToNextMinor(from: "0.1.2") ), .package( name: "Benchmark", @@ -152,20 +177,7 @@ let package = Package( ), .target( name: "TokamakDOM", - dependencies: [ - "TokamakCore", - "TokamakStaticHTML", - .product( - name: "OpenCombineShim", - package: "OpenCombine" - ), - .product( - name: "JavaScriptKit", - package: "JavaScriptKit", - condition: .when(platforms: [.wasi]) - ), - "OpenCombineJS", - ] + dependencies: tokamakDOMDependencies ), .executableTarget( name: "TokamakDemo", diff --git a/README.md b/README.md index 7264d7bc..9fd3358c 100644 --- a/README.md +++ b/README.md @@ -113,20 +113,33 @@ app. ## Requirements for app developers -- macOS 11 and Xcode 13.0. *Xcode 13.1 is currently not supported.* +- macOS 11 and Xcode 13.0 or later. Xcode 13.2 or later is recommended if you're developing +multi-platform apps that target WebAssembly and macOS at the same time, as these versions support +Swift concurrency back-deployment. - [Swift 5.4 or later](https://swift.org/download/) and Ubuntu 18.04 if you'd like to use Linux. Other Linux distributions are currently not supported. ## Requirements for app users -Any browser that [supports WebAssembly](https://caniuse.com/#feat=wasm) should work, which currently includes: +Any recent browser that [supports WebAssembly](https://caniuse.com/#feat=wasm) and [required +JavaScript features](https://caniuse.com/?search=finalizationregistry) should work, which currently includes: + +- Edge 84+ +- Firefox 79+ +- Chrome 84+ +- Desktop Safari 14.1+ +- Mobile Safari 14.8+ + +If you need to support older browser versions, you'll have to build with +`JAVASCRIPTKIT_WITHOUT_WEAKREFS` flag, passing `-Xswiftc -DJAVASCRIPTKIT_WITHOUT_WEAKREFS` flags +when compiling. This should lower browser requirements to these versions: - Edge 16+ - Firefox 61+ - Chrome 66+ - (Mobile) Safari 12+ -Not all of these were tested though, compatibility reports are very welcome! +Not all of these versions are tested on regular basis though, compatibility reports are very welcome! ## Getting started @@ -141,7 +154,7 @@ app by following these steps: brew install swiftwasm/tap/carton ``` -If you had `carton` installed before this, make sure you have version 0.11.0 or greater: +If you had `carton` installed before this, make sure you have version 0.12.0 or greater: ``` carton --version diff --git a/Sources/TokamakCore/Modifiers/TaskModifier.swift b/Sources/TokamakCore/Modifiers/TaskModifier.swift new file mode 100644 index 00000000..304203eb --- /dev/null +++ b/Sources/TokamakCore/Modifiers/TaskModifier.swift @@ -0,0 +1,32 @@ +// Copyright 2021 Tokamak contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#if compiler(>=5.5) && (canImport(Concurrency) || canImport(_Concurrency)) + +public extension View { + func task( + priority: TaskPriority = .userInitiated, + _ action: @escaping @Sendable () async -> () + ) -> some View { + var task: Task<(), Never>? + return onAppear { + task = Task(priority: priority, operation: action) + } + .onDisappear { + task?.cancel() + } + } +} + +#endif diff --git a/Sources/TokamakCore/Shapes/Path/PathLayout.swift b/Sources/TokamakCore/Shapes/Path/PathLayout.swift index 72fc48a0..efea4f1b 100644 --- a/Sources/TokamakCore/Shapes/Path/PathLayout.swift +++ b/Sources/TokamakCore/Shapes/Path/PathLayout.swift @@ -223,7 +223,7 @@ public extension Path { func applying(_ transform: CGAffineTransform) -> Path { guard transform != .identity else { return self } - let elements = self.elements.map { transform.transform(element: $0) } + let elements = elements.map { transform.transform(element: $0) } let box = _PathBox(elements: elements) return Path(storage: .path(box), sizing: .fixed) } diff --git a/Sources/TokamakDOM/DOMNode.swift b/Sources/TokamakDOM/DOMNode.swift index e0b1a348..fbe2b9d7 100644 --- a/Sources/TokamakDOM/DOMNode.swift +++ b/Sources/TokamakDOM/DOMNode.swift @@ -60,7 +60,7 @@ extension AnyHTML { additionalAttributes: [HTMLAttribute: String], transaction: Transaction ) { - let attributes = self.attributes.merging(additionalAttributes, uniquingKeysWith: +) + let attributes = attributes.merging(additionalAttributes, uniquingKeysWith: +) dom.applyAttributes(attributes, with: transaction) @@ -109,7 +109,9 @@ final class DOMNode: Target { func reinstall(_ listeners: [String: Listener]) { for (event, jsClosure) in self.listeners { _ = ref.removeEventListener!(event, jsClosure) + #if JAVASCRIPTKIT_WITHOUT_WEAKREFS jsClosure.release() + #endif } self.listeners = [:] diff --git a/Sources/TokamakDOM/DOMRenderer.swift b/Sources/TokamakDOM/DOMRenderer.swift index 78d4b9a7..c57f745e 100644 --- a/Sources/TokamakDOM/DOMRenderer.swift +++ b/Sources/TokamakDOM/DOMRenderer.swift @@ -20,6 +20,10 @@ import OpenCombineJS @_spi(TokamakCore) import TokamakCore import TokamakStaticHTML +#if compiler(>=5.5) && (canImport(Concurrency) || canImport(_Concurrency)) +import JavaScriptEventLoop +#endif + public typealias Sanitizers = TokamakStaticHTML.Sanitizers extension EnvironmentValues { @@ -87,6 +91,10 @@ final class DOMRenderer: Renderer { rootRef = ref appendRootStyle(ref) + #if compiler(>=5.5) && (canImport(Concurrency) || canImport(_Concurrency)) + JavaScriptEventLoop.installGlobalExecutor() + #endif + let scheduler = JSScheduler() self.scheduler = scheduler reconciler = StackReconciler( diff --git a/Sources/TokamakDOM/Views/Canvas/Canvas.swift b/Sources/TokamakDOM/Views/Canvas/Canvas.swift index ebcb53f5..a6f10c85 100644 --- a/Sources/TokamakDOM/Views/Canvas/Canvas.swift +++ b/Sources/TokamakDOM/Views/Canvas/Canvas.swift @@ -62,15 +62,15 @@ struct _Canvas: View { HTML("canvas", [ "style": "width: 100%; height: 100%;", ]) - ._domRef($coordinator.canvas) - .onAppear { draw(in: proxy.size) } - ._onUpdate { - // Cancel the previous animation loop. - if let currentDrawLoop = coordinator.currentDrawLoop { - _ = JSObject.global.cancelAnimationFrame!(currentDrawLoop) - } - draw(in: proxy.size) + ._domRef($coordinator.canvas) + .onAppear { draw(in: proxy.size) } + ._onUpdate { + // Cancel the previous animation loop. + if let currentDrawLoop = coordinator.currentDrawLoop { + _ = JSObject.global.cancelAnimationFrame!(currentDrawLoop) } + draw(in: proxy.size) + } } } diff --git a/Sources/TokamakDemo/ButtonStyleDemo.swift b/Sources/TokamakDemo/Buttons/ButtonStyleDemo.swift similarity index 97% rename from Sources/TokamakDemo/ButtonStyleDemo.swift rename to Sources/TokamakDemo/Buttons/ButtonStyleDemo.swift index 6a49b8fa..6b353403 100644 --- a/Sources/TokamakDemo/ButtonStyleDemo.swift +++ b/Sources/TokamakDemo/Buttons/ButtonStyleDemo.swift @@ -75,9 +75,9 @@ public struct ButtonStyleDemo: View { Text("Label").padding(.leading, 5) } }) - .buttonStyle( - PressedButtonStyle(pressedColor: Color.red) - ) + .buttonStyle( + PressedButtonStyle(pressedColor: Color.red) + ) if #available(iOS 15.0, macOS 12.0, *) { Button("Prominent") {} .buttonStyle(BorderedProminentButtonStyle()) diff --git a/Sources/TokamakDemo/Counter.swift b/Sources/TokamakDemo/Buttons/Counter.swift similarity index 100% rename from Sources/TokamakDemo/Counter.swift rename to Sources/TokamakDemo/Buttons/Counter.swift diff --git a/Sources/TokamakDemo/ForEachDemo.swift b/Sources/TokamakDemo/Containers/ForEachDemo.swift similarity index 100% rename from Sources/TokamakDemo/ForEachDemo.swift rename to Sources/TokamakDemo/Containers/ForEachDemo.swift diff --git a/Sources/TokamakDemo/ListDemo.swift b/Sources/TokamakDemo/Containers/ListDemo.swift similarity index 100% rename from Sources/TokamakDemo/ListDemo.swift rename to Sources/TokamakDemo/Containers/ListDemo.swift diff --git a/Sources/TokamakDemo/OutlineGroupDemo.swift b/Sources/TokamakDemo/Containers/OutlineGroupDemo.swift similarity index 100% rename from Sources/TokamakDemo/OutlineGroupDemo.swift rename to Sources/TokamakDemo/Containers/OutlineGroupDemo.swift diff --git a/Sources/TokamakDemo/SidebarDemo.swift b/Sources/TokamakDemo/Containers/SidebarDemo.swift similarity index 100% rename from Sources/TokamakDemo/SidebarDemo.swift rename to Sources/TokamakDemo/Containers/SidebarDemo.swift diff --git a/Sources/TokamakDemo/DOMRefDemo.swift b/Sources/TokamakDemo/DOM/DOMRefDemo.swift similarity index 100% rename from Sources/TokamakDemo/DOMRefDemo.swift rename to Sources/TokamakDemo/DOM/DOMRefDemo.swift diff --git a/Sources/TokamakDemo/URLHashDemo.swift b/Sources/TokamakDemo/DOM/URLHashDemo.swift similarity index 96% rename from Sources/TokamakDemo/URLHashDemo.swift rename to Sources/TokamakDemo/DOM/URLHashDemo.swift index 6345d9fc..39dcb8a0 100644 --- a/Sources/TokamakDemo/URLHashDemo.swift +++ b/Sources/TokamakDemo/DOM/URLHashDemo.swift @@ -36,7 +36,9 @@ private final class HashState: ObservableObject { deinit { window.onhashchange = .undefined + #if JAVASCRIPTKIT_WITHOUT_WEAKREFS onHashChange.release() + #endif } } diff --git a/Sources/TokamakDemo/CanvasDemo.swift b/Sources/TokamakDemo/Drawing/CanvasDemo.swift similarity index 100% rename from Sources/TokamakDemo/CanvasDemo.swift rename to Sources/TokamakDemo/Drawing/CanvasDemo.swift diff --git a/Sources/TokamakDemo/ColorDemo.swift b/Sources/TokamakDemo/Drawing/ColorDemo.swift similarity index 100% rename from Sources/TokamakDemo/ColorDemo.swift rename to Sources/TokamakDemo/Drawing/ColorDemo.swift diff --git a/Sources/TokamakDemo/PathDemo.swift b/Sources/TokamakDemo/Drawing/PathDemo.swift similarity index 100% rename from Sources/TokamakDemo/PathDemo.swift rename to Sources/TokamakDemo/Drawing/PathDemo.swift diff --git a/Sources/TokamakDemo/ShapeStyleDemo.swift b/Sources/TokamakDemo/Drawing/ShapeStyleDemo.swift similarity index 100% rename from Sources/TokamakDemo/ShapeStyleDemo.swift rename to Sources/TokamakDemo/Drawing/ShapeStyleDemo.swift diff --git a/Sources/TokamakDemo/GeometryReaderDemo.swift b/Sources/TokamakDemo/Layout/GeometryReaderDemo.swift similarity index 100% rename from Sources/TokamakDemo/GeometryReaderDemo.swift rename to Sources/TokamakDemo/Layout/GeometryReaderDemo.swift diff --git a/Sources/TokamakDemo/GridDemo.swift b/Sources/TokamakDemo/Layout/GridDemo.swift similarity index 100% rename from Sources/TokamakDemo/GridDemo.swift rename to Sources/TokamakDemo/Layout/GridDemo.swift diff --git a/Sources/TokamakDemo/SpacerDemo.swift b/Sources/TokamakDemo/Layout/SpacerDemo.swift similarity index 100% rename from Sources/TokamakDemo/SpacerDemo.swift rename to Sources/TokamakDemo/Layout/SpacerDemo.swift diff --git a/Sources/TokamakDemo/StackDemo.swift b/Sources/TokamakDemo/Layout/StackDemo.swift similarity index 100% rename from Sources/TokamakDemo/StackDemo.swift rename to Sources/TokamakDemo/Layout/StackDemo.swift diff --git a/Sources/TokamakDemo/AnimationDemo.swift b/Sources/TokamakDemo/Misc/AnimationDemo.swift similarity index 100% rename from Sources/TokamakDemo/AnimationDemo.swift rename to Sources/TokamakDemo/Misc/AnimationDemo.swift diff --git a/Sources/TokamakDemo/AppStorageDemo.swift b/Sources/TokamakDemo/Misc/AppStorageDemo.swift similarity index 100% rename from Sources/TokamakDemo/AppStorageDemo.swift rename to Sources/TokamakDemo/Misc/AppStorageDemo.swift diff --git a/Sources/TokamakDemo/EnvironmentDemo.swift b/Sources/TokamakDemo/Misc/EnvironmentDemo.swift similarity index 100% rename from Sources/TokamakDemo/EnvironmentDemo.swift rename to Sources/TokamakDemo/Misc/EnvironmentDemo.swift diff --git a/Sources/TokamakDemo/PreferenceKeyDemo.swift b/Sources/TokamakDemo/Misc/PreferenceKeyDemo.swift similarity index 100% rename from Sources/TokamakDemo/PreferenceKeyDemo.swift rename to Sources/TokamakDemo/Misc/PreferenceKeyDemo.swift diff --git a/Sources/TokamakDemo/ProgressViewDemo.swift b/Sources/TokamakDemo/Misc/ProgressViewDemo.swift similarity index 100% rename from Sources/TokamakDemo/ProgressViewDemo.swift rename to Sources/TokamakDemo/Misc/ProgressViewDemo.swift diff --git a/Sources/TokamakDemo/RedactDemo.swift b/Sources/TokamakDemo/Misc/RedactDemo.swift similarity index 100% rename from Sources/TokamakDemo/RedactDemo.swift rename to Sources/TokamakDemo/Misc/RedactDemo.swift diff --git a/Sources/TokamakDemo/TransitionDemo.swift b/Sources/TokamakDemo/Misc/TransitionDemo.swift similarity index 100% rename from Sources/TokamakDemo/TransitionDemo.swift rename to Sources/TokamakDemo/Misc/TransitionDemo.swift diff --git a/Sources/TokamakDemo/Modifiers/ShadowDemo.swift b/Sources/TokamakDemo/Modifiers/ShadowDemo.swift new file mode 100644 index 00000000..786db721 --- /dev/null +++ b/Sources/TokamakDemo/Modifiers/ShadowDemo.swift @@ -0,0 +1,22 @@ +// Copyright 2021 Tokamak contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import TokamakShim + +struct ShadowDemo: View { + var body: some View { + Color.red.frame(width: 60, height: 60, alignment: .center) + .shadow(color: .black, radius: 5, x: 0, y: 10) + } +} diff --git a/Sources/TokamakDemo/Modifiers/TaskDemo.swift b/Sources/TokamakDemo/Modifiers/TaskDemo.swift new file mode 100644 index 00000000..c37784d8 --- /dev/null +++ b/Sources/TokamakDemo/Modifiers/TaskDemo.swift @@ -0,0 +1,61 @@ +// Copyright 2021 Tokamak contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#if os(WASI) && compiler(>=5.5) && (canImport(Concurrency) || canImport(_Concurrency)) +import JavaScriptKit +import TokamakDOM + +private let jsFetch = JSObject.global.fetch.function! +private func fetch(_ url: String) -> JSPromise { + JSPromise(jsFetch(url).object!)! +} + +private struct Response: Decodable { + let uuid: String +} + +struct TaskDemo: View { + @State private var response: Result? + + var body: some View { + VStack { + switch response { + case let .success(response): + Text("Fetched UUID is \(response.uuid)") + case let .failure(error): + Text("Error is \(error)") + default: + Text("Response not available yet") + } + + Button("Fetch new UUID asynchronously") { + response = nil + Task { await fetchResponse() } + } + }.task { + await fetchResponse() + } + } + + func fetchResponse() async { + do { + let fetchResult = try await fetch("https://httpbin.org/uuid").value + let json = try await JSPromise(fetchResult.json().object!)!.value + response = Result { try JSValueDecoder().decode(Response.self, from: json) } + } catch { + response = .failure(error) + } + } +} +#endif diff --git a/Sources/TokamakDemo/DatePickerDemo.swift b/Sources/TokamakDemo/Selectors/DatePickerDemo.swift similarity index 100% rename from Sources/TokamakDemo/DatePickerDemo.swift rename to Sources/TokamakDemo/Selectors/DatePickerDemo.swift diff --git a/Sources/TokamakDemo/PickerDemo.swift b/Sources/TokamakDemo/Selectors/PickerDemo.swift similarity index 100% rename from Sources/TokamakDemo/PickerDemo.swift rename to Sources/TokamakDemo/Selectors/PickerDemo.swift diff --git a/Sources/TokamakDemo/SliderDemo.swift b/Sources/TokamakDemo/Selectors/SliderDemo.swift similarity index 100% rename from Sources/TokamakDemo/SliderDemo.swift rename to Sources/TokamakDemo/Selectors/SliderDemo.swift diff --git a/Sources/TokamakDemo/ToggleDemo.swift b/Sources/TokamakDemo/Selectors/ToggleDemo.swift similarity index 100% rename from Sources/TokamakDemo/ToggleDemo.swift rename to Sources/TokamakDemo/Selectors/ToggleDemo.swift diff --git a/Sources/TokamakDemo/ShadowDemo.swift b/Sources/TokamakDemo/ShadowDemo.swift deleted file mode 100644 index d328a6a3..00000000 --- a/Sources/TokamakDemo/ShadowDemo.swift +++ /dev/null @@ -1,8 +0,0 @@ -import TokamakShim - -struct ShadowDemo: View { - var body: some View { - Color.red.frame(width: 60, height: 60, alignment: .center) - .shadow(color: .black, radius: 5, x: 0, y: 10) - } -} diff --git a/Sources/TokamakDemo/TextDemo.swift b/Sources/TokamakDemo/Text/TextDemo.swift similarity index 97% rename from Sources/TokamakDemo/TextDemo.swift rename to Sources/TokamakDemo/Text/TextDemo.swift index 71b9c078..d3935346 100644 --- a/Sources/TokamakDemo/TextDemo.swift +++ b/Sources/TokamakDemo/Text/TextDemo.swift @@ -53,8 +53,8 @@ struct TextDemo: View { .heavy, .black, ], id: \.self) { weight in - Text("a") - .fontWeight(weight) + Text("a") + .fontWeight(weight) } } VStack { diff --git a/Sources/TokamakDemo/TextEditorDemo.swift b/Sources/TokamakDemo/Text/TextEditorDemo.swift similarity index 100% rename from Sources/TokamakDemo/TextEditorDemo.swift rename to Sources/TokamakDemo/Text/TextEditorDemo.swift diff --git a/Sources/TokamakDemo/TextFieldDemo.swift b/Sources/TokamakDemo/Text/TextFieldDemo.swift similarity index 100% rename from Sources/TokamakDemo/TextFieldDemo.swift rename to Sources/TokamakDemo/Text/TextFieldDemo.swift diff --git a/Sources/TokamakDemo/TokamakDemo.swift b/Sources/TokamakDemo/TokamakDemo.swift index 4f72b85a..2a6452ac 100644 --- a/Sources/TokamakDemo/TokamakDemo.swift +++ b/Sources/TokamakDemo/TokamakDemo.swift @@ -133,6 +133,9 @@ struct TokamakDemoView: View { } Section(header: Text("Modifiers")) { NavItem("Shadow", destination: ShadowDemo()) + #if os(WASI) && compiler(>=5.5) && (canImport(Concurrency) || canImport(_Concurrency)) + NavItem("Task", destination: TaskDemo()) + #endif } Section(header: Text("Selectors")) { NavItem("DatePicker", destination: DatePickerDemo()) diff --git a/Sources/TokamakGTK/GSignal.swift b/Sources/TokamakGTK/GSignal.swift index 7e6b7cf2..397c3a0a 100644 --- a/Sources/TokamakGTK/GSignal.swift +++ b/Sources/TokamakGTK/GSignal.swift @@ -114,7 +114,7 @@ extension UnsafeMutablePointer where Pointee == GtkWidget { OpaquePointer, () >> - .fromOpaque(closureBox) + .fromOpaque(closureBox) if let widget = widget { unpackedAction.takeUnretainedValue().closure(widget, context) } @@ -125,7 +125,7 @@ extension UnsafeMutablePointer where Pointee == GtkWidget { OpaquePointer, () >> - .fromOpaque(closureBox) + .fromOpaque(closureBox) unpackedAction.release() }) } diff --git a/Sources/TokamakStaticHTML/Modifiers/LayoutModifiers.swift b/Sources/TokamakStaticHTML/Modifiers/LayoutModifiers.swift index cdf90475..4a2f1c06 100644 --- a/Sources/TokamakStaticHTML/Modifiers/LayoutModifiers.swift +++ b/Sources/TokamakStaticHTML/Modifiers/LayoutModifiers.swift @@ -119,7 +119,7 @@ extension _PaddingLayout: DOMViewModifier { public var isOrderDependent: Bool { true } public var attributes: [HTMLAttribute: String] { var padding = [(String, CGFloat)]() - let insets = self.insets ?? .init(_all: 10) + let insets = insets ?? .init(_all: 10) for edge in Edge.allCases { if edges.contains(.init(edge)) { padding.append((edge.cssValue, insets.inset(for: edge))) diff --git a/Sources/TokamakStaticHTML/Views/HTML.swift b/Sources/TokamakStaticHTML/Views/HTML.swift index db2df39f..916e4c4c 100644 --- a/Sources/TokamakStaticHTML/Views/HTML.swift +++ b/Sources/TokamakStaticHTML/Views/HTML.swift @@ -58,7 +58,7 @@ public extension AnyHTML { additonalAttributes: [HTMLAttribute: String] = [:], children: [HTMLTarget] ) -> String { - let attributes = self.attributes.merging(additonalAttributes, uniquingKeysWith: +) + let attributes = attributes.merging(additonalAttributes, uniquingKeysWith: +) let renderedAttributes: String if attributes.isEmpty { renderedAttributes = ""