feat: added code editor#50
Conversation
7d99f79 to
2b511e8
Compare
| defaultLocalization: "en", | ||
| platforms: [ | ||
| .macOS(.v10_15), | ||
| .macOS(.v11), |
There was a problem hiding this comment.
Why the choice to bump the OS version from 10.15 to 11?
It can be a great replacement for Xcode, since Xcode is (going) to require 11+.
Xcode 13 includes SDKs for iOS 15, iPadOS 15, tvOS 15, watchOS 8, and macOS Big Sur 11.3. The Xcode 13 release supports on-device debugging for iOS 9 and later, tvOS 9 and later, and watchOS 2 and later. Xcode 13 requires a Mac running macOS 11.3 or later.
There was a problem hiding this comment.
seems that the library needs v11. I think this can be a great starting point and I don't see us using this library in the future, so we are going to replace it anyway
| import SwiftUI | ||
|
|
||
| /// CodeEditor is just a wrapper of the `CodeViewer` dependency | ||
| public struct CodeFileView: View { |
There was a problem hiding this comment.
The name of the file does not match the struct name
There was a problem hiding this comment.
good catch thank you!
|
Do you have a screenshot of the build? |
2b511e8 to
0bdee6f
Compare
Added! |
0bdee6f to
f45c384
Compare
Are the colors customizable? |
There are a couple of themes we can choose from but by using this library we don't get a lot of customization... I've tried 5 different libraries and sadly this was the best. The intent of this PR is to have an usable code-editor that act as a starting point while in the mean-time we build our own solution |
|
Ok I think it's good enough as a starting point. |
f45c384 to
1fd06db
Compare
This PR adds a new code-editor feature which consumes the Code-Editor library. It's not the best one but it's not bad and could be a good starting point. It's able to highlight the texts and format the code. The code wrapped inside a module so that we can easily change it with a new library or our custom solution in the future.
I've also added a SnapshotTest for it!