-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added code editor #50
feat: added code editor #50
Conversation
7d99f79
to
2b511e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MacOS 11?
@@ -6,15 +6,30 @@ let package = Package( | |||
name: "CodeEditModules", | |||
defaultLocalization: "en", | |||
platforms: [ | |||
.macOS(.v10_15), | |||
.macOS(.v11), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the file does not match the struct name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!