-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e463eab
Showing
89 changed files
with
3,333 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## General | ||
.DS_Store | ||
*.moved-aside | ||
*.xccheckout | ||
*.xcscmblueprint | ||
|
||
## Build generated | ||
build/ | ||
DerivedData/ | ||
|
||
## Various settings | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata/ | ||
|
||
## fastlane | ||
fastlane/report.xml | ||
fastlane/Preview.html | ||
fastlane/screenshots | ||
fastlane/test_output | ||
fastlane/gems |
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
Canvas.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Canvas.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
95 changes: 95 additions & 0 deletions
95
Canvas.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ | ||
"pins" : [ | ||
{ | ||
"identity" : "appinfo", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/kevinhermawan/AppInfo", | ||
"state" : { | ||
"revision" : "4b60b10c94c327083cb5fe5e73cdff21d1082b4c", | ||
"version" : "1.0.2" | ||
} | ||
}, | ||
{ | ||
"identity" : "chatfield", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/kevinhermawan/ChatField.git", | ||
"state" : { | ||
"revision" : "36833e4ddc23308c3754083d4bdcfa837fa17799", | ||
"version" : "1.0.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "defaults", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/sindresorhus/Defaults.git", | ||
"state" : { | ||
"revision" : "3efef5a28ebdbbe922d4a2049493733ed14475a6", | ||
"version" : "7.3.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "keychainaccess", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/kishikawakatsumi/KeychainAccess.git", | ||
"state" : { | ||
"revision" : "84e546727d66f1adc5439debad16270d0fdd04e7", | ||
"version" : "4.2.2" | ||
} | ||
}, | ||
{ | ||
"identity" : "nuke", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/kean/Nuke.git", | ||
"state" : { | ||
"revision" : "1694798e876113d44f6ec6ead965d7286695981d", | ||
"version" : "12.2.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "openai", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/MacPaw/OpenAI.git", | ||
"state" : { | ||
"branch" : "main", | ||
"revision" : "497266a278de1f32a609981e0012faabcf2091b4" | ||
} | ||
}, | ||
{ | ||
"identity" : "sparkle", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/sparkle-project/Sparkle.git", | ||
"state" : { | ||
"revision" : "47d3d90aee3c52b6f61d04ceae426e607df62347", | ||
"version" : "2.5.2" | ||
} | ||
}, | ||
{ | ||
"identity" : "swiftui-introspect", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/siteline/swiftui-introspect.git", | ||
"state" : { | ||
"revision" : "9e1cc02a65b22e09a8251261cccbccce02731fc5", | ||
"version" : "1.1.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "viewcondition", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/kevinhermawan/ViewCondition.git", | ||
"state" : { | ||
"revision" : "a3d0aaf943271247dfd4870a2a0696693165c884", | ||
"version" : "1.0.5" | ||
} | ||
}, | ||
{ | ||
"identity" : "viewstate", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/kevinhermawan/ViewState.git", | ||
"state" : { | ||
"revision" : "8e5a5efbbf3fb5a2d2621533a115a9da031214cb", | ||
"version" : "1.2.1" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// AppUpdater.swift | ||
// Canvas | ||
// | ||
// Created by Kevin Hermawan on 26/12/23. | ||
// | ||
|
||
import Combine | ||
import Sparkle | ||
import SwiftUI | ||
|
||
@Observable | ||
final class AppUpdater { | ||
private var cancellable: AnyCancellable? | ||
var canCheckForUpdates = false | ||
|
||
init(_ updater: SPUUpdater) { | ||
cancellable = updater.publisher(for: \.canCheckForUpdates) | ||
.assign(to: \.canCheckForUpdates, on: self) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// CanvasApp.swift | ||
// Canvas | ||
// | ||
// Created by Kevin Hermawan on 25/12/23. | ||
// | ||
|
||
import AppInfo | ||
import CoreViewModels | ||
import Sparkle | ||
import SwiftUI | ||
|
||
@main | ||
struct CanvasApp: App { | ||
@State private var appUpdater: AppUpdater | ||
private var updater: SPUUpdater | ||
|
||
@State private var apiKeyViewModel: APIKeyViewModel | ||
@State private var dalleViewModel: DalleViewModel | ||
|
||
init() { | ||
self._apiKeyViewModel = State(initialValue: APIKeyViewModel()) | ||
self._dalleViewModel = State(initialValue: DalleViewModel()) | ||
|
||
let updaterController = SPUStandardUpdaterController(startingUpdater: true, updaterDelegate: nil, userDriverDelegate: nil) | ||
updater = updaterController.updater | ||
|
||
let appUpdater = AppUpdater(updater) | ||
_appUpdater = State(initialValue: appUpdater) | ||
} | ||
|
||
var body: some Scene { | ||
WindowGroup { | ||
AppView() | ||
.environment(apiKeyViewModel) | ||
.environment(dalleViewModel) | ||
} | ||
.commands { | ||
CommandGroup(after: .appInfo) { | ||
Button("Check for Updates...") { | ||
updater.checkForUpdates() | ||
} | ||
.disabled(appUpdater.canCheckForUpdates == false) | ||
} | ||
|
||
CommandGroup(replacing: .help) { | ||
if let helpURL = AppInfo.value(for: "HELP_URL"), let url = URL(string: helpURL) { | ||
Link("Canvas Help", destination: url) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// AppSidebar.swift | ||
// Canvas | ||
// | ||
// Created by Kevin Hermawan on 25/12/23. | ||
// | ||
|
||
import Foundation | ||
|
||
enum AppSidebar: String, CaseIterable { | ||
case dalle | ||
case dalle2 | ||
|
||
var title: String { | ||
switch self { | ||
case .dalle: | ||
return "DALL·E" | ||
case .dalle2: | ||
return "DALL·E 2" | ||
} | ||
} | ||
} | ||
|
||
extension AppSidebar: Identifiable { | ||
var id: String { | ||
self.rawValue | ||
} | ||
} | ||
|
||
extension AppSidebar { | ||
var items: [AppSidebarItem] { | ||
switch self { | ||
case .dalle: | ||
return [.imageGeneration] | ||
case .dalle2: | ||
return [.imageEdit, .imageVariation] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// AppSidebarItem.swift | ||
// Canvas | ||
// | ||
// Created by Kevin Hermawan on 25/12/23. | ||
// | ||
|
||
import Foundation | ||
|
||
enum AppSidebarItem: String, CaseIterable { | ||
case imageGeneration | ||
case imageEdit | ||
case imageVariation | ||
|
||
var title: String { | ||
switch self { | ||
case .imageGeneration: | ||
return "Image Generation" | ||
case .imageEdit: | ||
return "Image Edit" | ||
case .imageVariation: | ||
return "Image Variation" | ||
} | ||
} | ||
|
||
var systemImage: String { | ||
switch self { | ||
case .imageGeneration: | ||
return "paintbrush" | ||
case .imageEdit: | ||
return "theatermask.and.paintbrush" | ||
case .imageVariation: | ||
return "paintpalette" | ||
} | ||
} | ||
} | ||
|
||
extension AppSidebarItem: Identifiable { | ||
var id: String { | ||
self.rawValue | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// Defaults+Keys.swift | ||
// Canvas | ||
// | ||
// Created by Kevin Hermawan on 25/12/23. | ||
// | ||
|
||
import CoreModels | ||
import Defaults | ||
import Foundation | ||
|
||
extension Defaults.Keys { | ||
static let ig_selectedModel = Key<DalleModel>("ig_selectedModel", default: .dalle2) | ||
static let ig_selectedNumber = Key<Int>("ig_selectedNumber", default: DalleModel.dalle2.numbers[0]) | ||
static let ig_selectedSize = Key<String>("ig_selectedSize", default: DalleModel.dalle2.sizes[0]) | ||
static let ig_selectedQuality = Key<DalleModel.Quality?>("ig_selectedQuality", default: .standard) | ||
static let ig_selectedStyle = Key<DalleModel.Style?>("ig_selectedStyle", default: .vivid) | ||
|
||
static let ie_selectedNumber = Key<Int>("ie_selectedNumber", default: DalleModel.dalle2.numbers[0]) | ||
static let ie_selectedSize = Key<String>("ie_selectedSize", default: DalleModel.dalle2.sizes[0]) | ||
|
||
|
||
static let iv_selectedNumber = Key<Int>("iv_selectedNumber", default: DalleModel.dalle2.numbers[0]) | ||
static let iv_selectedSize = Key<String>("iv_selectedSize", default: DalleModel.dalle2.sizes[0]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Canvas/Resources/Assets.xcassets/AccentColor.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"color" : { | ||
"platform" : "universal", | ||
"reference" : "systemBlueColor" | ||
}, | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.34 KB
Canvas/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-256 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+574 Bytes
Canvas/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-32 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.8 KB
Canvas/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-512 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.