Skip to content

Commit

Permalink
Merge branch 'release/2.0.0_3'
Browse files Browse the repository at this point in the history
  • Loading branch information
bsorrentino committed Aug 27, 2023
2 parents 2575be1 + 7f2c0e6 commit 16c8045
Show file tree
Hide file tree
Showing 8 changed files with 322 additions and 10 deletions.
6 changes: 2 additions & 4 deletions PlantUML/PlantUMLApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ struct PlantUMLApp: App {
var body: some Scene {
DocumentGroup(newDocument: PlantUMLDocument()) { file in
if #available(iOS 16, *) {
PlantUMLContentView(
document: PlantUMLDocumentProxy( document: file.$document) )
PlantUMLContentView( document: PlantUMLDocumentProxy( document: file.$document) )
// [Document based app shows 2 back chevrons on iPad](https://stackoverflow.com/a/74245034/521197)
.toolbarRole(.navigationStack)
}
else {
PlantUMLContentView(
document: PlantUMLDocumentProxy( document: file.$document))
PlantUMLContentView( document: PlantUMLDocumentProxy( document: file.$document))
}
}
}
Expand Down
11 changes: 7 additions & 4 deletions PlantUML/PlantUMLContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ struct PlantUMLContentView: View {
@Environment(\.editMode) private var editMode
@Environment(\.openURL) private var openURL

@AppStorage("lightTheme") var lightTheme:String = CodeWebView.Theme.chrome.rawValue
@AppStorage("darkTheme") var darkTheme:String = CodeWebView.Theme.monokai.rawValue
@AppStorage("fontSize") var fontSize:Int = 20

@StateObject var document: PlantUMLDocumentProxy
@StateObject private var openAIService = OpenAIService()

Expand All @@ -40,7 +44,6 @@ struct PlantUMLContentView: View {

@State var keyboardTab: String = "general"
@State private var isScaleToFit = true
@State private var fontSize = CGFloat(15)
@State private var showLine:Bool = false
@State private var saving = false
@State private var diagramImage:UIImage?
Expand Down Expand Up @@ -147,10 +150,10 @@ extension PlantUMLContentView {

PlantUMLLineEditorView( content: $document.text,
mode: .plantuml,
darkTheme: .terminal,
lightTheme: .chrome,
darkTheme: CodeWebView.Theme(rawValue: darkTheme)!,
lightTheme: CodeWebView.Theme(rawValue: lightTheme)!,
isReadOnly: false,
fontSize: fontSize
fontSize: CGFloat(fontSize)
)

// PlantUMLLineEditorView( text: $document.text,
Expand Down
255 changes: 255 additions & 0 deletions PlantUML/Settings.bundle/Root.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
<?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>PreferenceSpecifiers</key>
<array>
<dict>
<key>Title</key>
<string>Editor</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<!--
<dict>
<key>Type</key>
<string>PSTitleValueSpecifier</string>
<key>Title</key>
<string>Font Size</string>
<key>Key</key>
<string>fontSize</string>
<key>DefaultValue</key>
<string>20</string>
</dict>
<dict>
<key>Type</key>
<string>PSSliderSpecifier</string>
<key>Key</key>
<string>fontSize</string>
<key>DefaultValue</key>
<integer>20</integer>
<key>Title</key>
<string></string>
<key>MaximumValue</key>
<integer>30</integer>
<key>MaximumValueImage</key>
<string>textformat_size_larger.png</string>
<key>MinimumValue</key>
<integer>10</integer>
<key>MinimumValueImage</key>
<string>textformat_size_smaller.png</string>
</dict>
-->
<dict>
<key>DefaultValue</key>
<string>chrome</string>
<key>Key</key>
<string>lightTheme</string>
<key>Title</key>
<string>Light Theme</string>
<key>Titles</key>
<array>
<string>ambiance</string>
<string>chrome</string>
<string>clouds</string>
<string>clouds_midnight</string>
<string>cobalt</string>
<string>crimson_editor</string>
<string>dawn</string>
<string>dracula</string>
<string>dreamweaver</string>
<string>chaos</string>
<string>eclipse</string>
<string>github</string>
<string>gob</string>
<string>gruvbox</string>
<string>idle_fingers</string>
<string>iplastic</string>
<string>katzenmilch</string>
<string>kr_theme</string>
<string>kuroir</string>
<string>merbivore</string>
<string>merbivore_soft</string>
<string>mono_industrial</string>
<string>monokai</string>
<string>nord_dark</string>
<string>pastel_on_dark</string>
<string>solarized_dark</string>
<string>solarized_light</string>
<string>sqlserver</string>
<string>terminal</string>
<string>textmate</string>
<string>tomorrow</string>
<string>tomorrow_night</string>
<string>tomorrow_night_blue</string>
<string>tomorrow_night_bright</string>
<string>tomorrow_night_eighties</string>
<string>twilight</string>
<string>vibrant_ink</string>
<string>xcode</string>
</array>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Values</key>
<array>
<string>ambiance</string>
<string>chrome</string>
<string>clouds</string>
<string>clouds_midnight</string>
<string>cobalt</string>
<string>crimson_editor</string>
<string>dawn</string>
<string>dracula</string>
<string>dreamweaver</string>
<string>chaos</string>
<string>eclipse</string>
<string>github</string>
<string>gob</string>
<string>gruvbox</string>
<string>idle_fingers</string>
<string>iplastic</string>
<string>katzenmilch</string>
<string>kr_theme</string>
<string>kuroir</string>
<string>merbivore</string>
<string>merbivore_soft</string>
<string>mono_industrial</string>
<string>monokai</string>
<string>nord_dark</string>
<string>pastel_on_dark</string>
<string>solarized_dark</string>
<string>solarized_light</string>
<string>sqlserver</string>
<string>terminal</string>
<string>textmate</string>
<string>tomorrow</string>
<string>tomorrow_night</string>
<string>tomorrow_night_blue</string>
<string>tomorrow_night_bright</string>
<string>tomorrow_night_eighties</string>
<string>twilight</string>
<string>vibrant_ink</string>
<string>xcode</string>
</array>
</dict>
<dict>
<key>DefaultValue</key>
<string>monokai</string>
<key>Key</key>
<string>darkTheme</string>
<key>Title</key>
<string>Dark Theme</string>
<key>Titles</key>
<array>
<string>ambiance</string>
<string>chrome</string>
<string>clouds</string>
<string>clouds_midnight</string>
<string>cobalt</string>
<string>crimson_editor</string>
<string>dawn</string>
<string>dracula</string>
<string>dreamweaver</string>
<string>chaos</string>
<string>eclipse</string>
<string>github</string>
<string>gob</string>
<string>gruvbox</string>
<string>idle_fingers</string>
<string>iplastic</string>
<string>katzenmilch</string>
<string>kr_theme</string>
<string>kuroir</string>
<string>merbivore</string>
<string>merbivore_soft</string>
<string>mono_industrial</string>
<string>monokai</string>
<string>nord_dark</string>
<string>pastel_on_dark</string>
<string>solarized_dark</string>
<string>solarized_light</string>
<string>sqlserver</string>
<string>terminal</string>
<string>textmate</string>
<string>tomorrow</string>
<string>tomorrow_night</string>
<string>tomorrow_night_blue</string>
<string>tomorrow_night_bright</string>
<string>tomorrow_night_eighties</string>
<string>twilight</string>
<string>vibrant_ink</string>
<string>xcode</string>
</array>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Values</key>
<array>
<string>ambiance</string>
<string>chrome</string>
<string>clouds</string>
<string>clouds_midnight</string>
<string>cobalt</string>
<string>crimson_editor</string>
<string>dawn</string>
<string>dracula</string>
<string>dreamweaver</string>
<string>chaos</string>
<string>eclipse</string>
<string>github</string>
<string>gob</string>
<string>gruvbox</string>
<string>idle_fingers</string>
<string>iplastic</string>
<string>katzenmilch</string>
<string>kr_theme</string>
<string>kuroir</string>
<string>merbivore</string>
<string>merbivore_soft</string>
<string>mono_industrial</string>
<string>monokai</string>
<string>nord_dark</string>
<string>pastel_on_dark</string>
<string>solarized_dark</string>
<string>solarized_light</string>
<string>sqlserver</string>
<string>terminal</string>
<string>textmate</string>
<string>tomorrow</string>
<string>tomorrow_night</string>
<string>tomorrow_night_blue</string>
<string>tomorrow_night_bright</string>
<string>tomorrow_night_eighties</string>
<string>twilight</string>
<string>vibrant_ink</string>
<string>xcode</string>
</array>
</dict>
<dict>
<key>Title</key>
<string>AI</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<string>text-davinci-edit-001</string>
<key>Key</key>
<string>openaiModel</string>
<key>Title</key>
<string>Model</string>
<key>Titles</key>
<array>
<string>code-davinci-edit-001</string>
<string>text-davinci-edit-001</string>
</array>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Values</key>
<array>
<string>code-davinci-edit-001</string>
<string>text-davinci-edit-001</string>
</array>
</dict>
</array>
</dict>
</plist>
Binary file added PlantUML/Settings.bundle/en.lproj/Root.strings
Binary file not shown.
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.
8 changes: 6 additions & 2 deletions PlantUMLApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
A074F6992A16D40500061398 /* OpenAI.prod.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = A074F6982A16D40500061398 /* OpenAI.prod.xcconfig */; };
A074F69A2A16D40500061398 /* OpenAI.prod.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = A074F6982A16D40500061398 /* OpenAI.prod.xcconfig */; };
A074F69B2A16D40500061398 /* OpenAI.prod.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = A074F6982A16D40500061398 /* OpenAI.prod.xcconfig */; };
A082CB002A9A68D80055D6D6 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = A082CAFF2A9A68D80055D6D6 /* Settings.bundle */; };
A0943A6F2944A44900342426 /* ScaleToFit+ToggleStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0943A6E2944A44900342426 /* ScaleToFit+ToggleStyle.swift */; };
A09F62DD29DDD08600650C9A /* PlantUMLFramework in Frameworks */ = {isa = PBXBuildFile; productRef = A09F62DC29DDD08600650C9A /* PlantUMLFramework */; };
A09F62DF29DDD08D00650C9A /* PlantUMLKeyboard in Frameworks */ = {isa = PBXBuildFile; productRef = A09F62DE29DDD08D00650C9A /* PlantUMLKeyboard */; };
Expand Down Expand Up @@ -75,6 +76,7 @@
A05F2E372A1FFC49007FDF36 /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = "<group>"; };
A068572D29D8B31100E82C2F /* View+Clipboard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Clipboard.swift"; sourceTree = "<group>"; };
A074F6982A16D40500061398 /* OpenAI.prod.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = OpenAI.prod.xcconfig; sourceTree = "<group>"; };
A082CAFF2A9A68D80055D6D6 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; };
A08AA78329561170004DE329 /* View+UIImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+UIImage.swift"; sourceTree = "<group>"; };
A0943A6D29448A1700342426 /* AppStore.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = AppStore.xcassets; sourceTree = "<group>"; };
A0943A6E2944A44900342426 /* ScaleToFit+ToggleStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ScaleToFit+ToggleStyle.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -201,6 +203,7 @@
A038DB5F29D489BA0032E312 /* PlantUML+OpenAI.swift */,
A0BFBA9C290D551F008340E3 /* Localizable.strings */,
A0D3C64F28984A10000838D7 /* Assets.xcassets */,
A082CAFF2A9A68D80055D6D6 /* Settings.bundle */,
A0D3C65428984A10000838D7 /* Info.plist */,
A0D3C65128984A10000838D7 /* Preview Content */,
);
Expand Down Expand Up @@ -355,6 +358,7 @@
A0BFBA9A290D551F008340E3 /* Localizable.strings in Resources */,
A038DB5C29D452880032E312 /* OpenAI.xcconfig in Resources */,
A074F6992A16D40500061398 /* OpenAI.prod.xcconfig in Resources */,
A082CB002A9A68D80055D6D6 /* Settings.bundle in Resources */,
A0D3C65028984A10000838D7 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -607,7 +611,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_ASSET_PATHS = "\"PlantUML/Preview Content\"";
DEVELOPMENT_TEAM = 48J595L9BX;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -644,7 +648,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_ASSET_PATHS = "\"PlantUML/Preview Content\"";
DEVELOPMENT_TEAM = 48J595L9BX;
ENABLE_PREVIEWS = YES;
Expand Down
Loading

0 comments on commit 16c8045

Please sign in to comment.