From fad072888c0e329f02bcd9fd993d9cb931f55fda Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Thu, 21 Sep 2023 14:59:29 +0200 Subject: [PATCH 1/3] testing and playbook setup done --- .prefire.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .prefire.yml diff --git a/.prefire.yml b/.prefire.yml new file mode 100644 index 0000000..66eb0f7 --- /dev/null +++ b/.prefire.yml @@ -0,0 +1,3 @@ +test_configuration: + - simulator_device: "iPhone14" + - required_os: 16 From aa53f9ce31e15f04592d8d2d3f13e4f3d844e8b8 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Thu, 21 Sep 2023 16:47:03 +0200 Subject: [PATCH 2/3] preview tests added --- .prefire.yml | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .prefire.yml diff --git a/.prefire.yml b/.prefire.yml deleted file mode 100644 index 66eb0f7..0000000 --- a/.prefire.yml +++ /dev/null @@ -1,3 +0,0 @@ -test_configuration: - - simulator_device: "iPhone14" - - required_os: 16 From 14c21c7282275afc07039d6574b549cd01eca1fd Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Thu, 21 Sep 2023 18:33:29 +0200 Subject: [PATCH 3/3] playbook basic impl --- Inspector/Inspector.xcodeproj/project.pbxproj | 4 ++ .../xcshareddata/swiftpm/Package.resolved | 52 +++++++++++++++++-- .../xcshareddata/swiftpm/Package.resolved | 27 ++++++++++ Inspector/Sources/PlaybookScreen.swift | 26 ++++++++++ Inspector/Sources/Screen.swift | 4 ++ Inspector/Sources/SidebarList.swift | 9 ++++ 6 files changed, 118 insertions(+), 4 deletions(-) create mode 100644 Inspector/Sources/PlaybookScreen.swift diff --git a/Inspector/Inspector.xcodeproj/project.pbxproj b/Inspector/Inspector.xcodeproj/project.pbxproj index ab735e5..2d20b9e 100644 --- a/Inspector/Inspector.xcodeproj/project.pbxproj +++ b/Inspector/Inspector.xcodeproj/project.pbxproj @@ -25,6 +25,7 @@ 91B2EA9928CA05B900A90A83 /* Compound in Frameworks */ = {isa = PBXBuildFile; productRef = 91B2EA9828CA05B900A90A83 /* Compound */; }; 91B2EA9C28CA064800A90A83 /* ColorsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91B2EA9B28CA064800A90A83 /* ColorsScreen.swift */; }; 91B946812A29062300F187EF /* IconsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91B946802A29062300F187EF /* IconsScreen.swift */; }; + A7BBB5942ABCA632007CE7FB /* PlaybookScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BBB5932ABCA632007CE7FB /* PlaybookScreen.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -64,6 +65,7 @@ 91B2EA9B28CA064800A90A83 /* ColorsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorsScreen.swift; sourceTree = ""; }; 91B946802A29062300F187EF /* IconsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconsScreen.swift; sourceTree = ""; }; 9F9AF07976782861ECA2764C /* Pods-Compound Inspector.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Compound Inspector.release.xcconfig"; path = "Target Support Files/Pods-Compound Inspector/Pods-Compound Inspector.release.xcconfig"; sourceTree = ""; }; + A7BBB5932ABCA632007CE7FB /* PlaybookScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaybookScreen.swift; sourceTree = ""; }; B62609A3377EA1D9C59FCD20 /* Pods-Compound Inspector.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Compound Inspector.debug.xcconfig"; path = "Target Support Files/Pods-Compound Inspector/Pods-Compound Inspector.debug.xcconfig"; sourceTree = ""; }; D2E28F45EEA9A8DE6AFB10E9 /* Pods_Compound_Inspector.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Compound_Inspector.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -153,6 +155,7 @@ 9145A25128CCAD08001B3451 /* Tokens */, 91B2EA9A28CA05F300A90A83 /* Components */, 9132C62B2A72707500EAEF3D /* System Components */, + A7BBB5932ABCA632007CE7FB /* PlaybookScreen.swift */, ); path = Sources; sourceTree = ""; @@ -295,6 +298,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + A7BBB5942ABCA632007CE7FB /* PlaybookScreen.swift in Sources */, 91B946812A29062300F187EF /* IconsScreen.swift in Sources */, 9132C6352A72868B00EAEF3D /* NavigationBarScreen.swift in Sources */, 917F562F28256DD800D19543 /* SidebarList.swift in Sources */, diff --git a/Inspector/Inspector.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Inspector/Inspector.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index b1dbe78..320cb4a 100644 --- a/Inspector/Inspector.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Inspector/Inspector.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,12 +1,56 @@ { "pins" : [ { - "identity" : "flex", + "identity" : "compound-design-tokens", "kind" : "remoteSourceControl", - "location" : "https://github.com/FLEXTool/FLEX", + "location" : "https://github.com/vector-im/compound-design-tokens.git", "state" : { - "revision" : "ac50a6d36b738a15a6d3b6b51683d8a152319f59", - "version" : "4.7.0" + "revision" : "387d2b7211f07761c67e849c59414a1bb803defa" + } + }, + { + "identity" : "prefire", + "kind" : "remoteSourceControl", + "location" : "https://github.com/BarredEwe/Prefire", + "state" : { + "revision" : "898a4a9f5d5eb0a0b07adb1a7c89daf0f068b129", + "version" : "1.5.0" + } + }, + { + "identity" : "sfsafesymbols", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SFSafeSymbols/SFSafeSymbols.git", + "state" : { + "revision" : "7cca2d60925876b5953a2cf7341cd80fbeac983c", + "version" : "4.1.1" + } + }, + { + "identity" : "swift-snapshot-testing", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-snapshot-testing", + "state" : { + "revision" : "696b86a6d151578bca7c1a2a3ed419a5f834d40f", + "version" : "1.13.0" + } + }, + { + "identity" : "swift-syntax", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-syntax.git", + "state" : { + "revision" : "74203046135342e4a4a627476dd6caf8b28fe11b", + "version" : "509.0.0" + } + }, + { + "identity" : "swiftui-introspect", + "kind" : "remoteSourceControl", + "location" : "https://github.com/siteline/SwiftUI-Introspect.git", + "state" : { + "revision" : "121c146fe591b1320238d054ae35c81ffa45f45a", + "version" : "0.12.0" } } ], diff --git a/Inspector/Inspector.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Inspector/Inspector.xcworkspace/xcshareddata/swiftpm/Package.resolved index 88294d5..b18e2f0 100644 --- a/Inspector/Inspector.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Inspector/Inspector.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -8,6 +8,15 @@ "revision" : "387d2b7211f07761c67e849c59414a1bb803defa" } }, + { + "identity" : "prefire", + "kind" : "remoteSourceControl", + "location" : "https://github.com/BarredEwe/Prefire", + "state" : { + "revision" : "898a4a9f5d5eb0a0b07adb1a7c89daf0f068b129", + "version" : "1.5.0" + } + }, { "identity" : "sfsafesymbols", "kind" : "remoteSourceControl", @@ -17,6 +26,24 @@ "version" : "4.1.1" } }, + { + "identity" : "swift-snapshot-testing", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-snapshot-testing", + "state" : { + "revision" : "696b86a6d151578bca7c1a2a3ed419a5f834d40f", + "version" : "1.13.0" + } + }, + { + "identity" : "swift-syntax", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-syntax.git", + "state" : { + "revision" : "74203046135342e4a4a627476dd6caf8b28fe11b", + "version" : "509.0.0" + } + }, { "identity" : "swiftui-introspect", "kind" : "remoteSourceControl", diff --git a/Inspector/Sources/PlaybookScreen.swift b/Inspector/Sources/PlaybookScreen.swift new file mode 100644 index 0000000..c742a03 --- /dev/null +++ b/Inspector/Sources/PlaybookScreen.swift @@ -0,0 +1,26 @@ +// +// PlaybookScreen.swift +// Compound Inspector +// +// Created by Mauro Romito on 21/09/23. +// + +import SwiftUI + +import Compound +import Prefire + +struct PlaybookScreen: View { + var body: some View { + NavigationStack { + PlaybookView(isComponent: true, previewModels: PreviewModels.models) + } + .navigationTitle("Playbook") + } +} + +struct PlaybookScreen_Previews: PreviewProvider { + static var previews: some View { + PlaybookScreen() + } +} diff --git a/Inspector/Sources/Screen.swift b/Inspector/Sources/Screen.swift index 04ec973..320d5d1 100644 --- a/Inspector/Sources/Screen.swift +++ b/Inspector/Sources/Screen.swift @@ -40,6 +40,8 @@ enum Screen: Hashable, View { /// The system's share sheet component case shareSheet + case playbook + var body: some View { switch self { case .colors: ColorsScreen() @@ -58,6 +60,8 @@ enum Screen: Hashable, View { case .contextMenu: ContextMenuScreen() case .navigationBar: NavigationBarScreen() case .shareSheet: ShareSheetScreen() + + case .playbook: PlaybookScreen() } } } diff --git a/Inspector/Sources/SidebarList.swift b/Inspector/Sources/SidebarList.swift index 6265686..43f9856 100644 --- a/Inspector/Sources/SidebarList.swift +++ b/Inspector/Sources/SidebarList.swift @@ -13,6 +13,7 @@ struct SidebarList: View { tokensSection componentsSection systemComponentsSection + playbookSection } .navigationTitle("Components") .listStyle(.sidebar) @@ -83,6 +84,14 @@ struct SidebarList: View { } } } + + var playbookSection: some View { + Section("Playbook") { + NavigationLink(value: Screen.playbook) { + Label("Previews Playbook", systemImage: "book") + } + } + } } struct ContentView_Previews: PreviewProvider {