Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions freewrite.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1610;
LastUpgradeCheck = 1610;
LastUpgradeCheck = 1640;
TargetAttributes = {
2857D46F2D5F8A8000EE1012 = {
CreatedOnToolsVersion = 16.1;
Expand Down Expand Up @@ -310,6 +310,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -371,6 +372,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -398,14 +400,16 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = freewrite/freewrite.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"freewrite/Preview Content\"";
DEVELOPMENT_TEAM = 2UDAY4J48G;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = freewrite/Info.plist;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
"INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES;
Expand Down Expand Up @@ -440,14 +444,16 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = freewrite/freewrite.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"freewrite/Preview Content\"";
DEVELOPMENT_TEAM = 2UDAY4J48G;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = freewrite/Info.plist;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
"INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES;
Expand Down Expand Up @@ -480,6 +486,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 6D7X9GGZAW;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.1;
Expand All @@ -503,6 +510,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 6D7X9GGZAW;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.1;
Expand All @@ -525,6 +533,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 6D7X9GGZAW;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.1;
Expand All @@ -547,6 +556,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 6D7X9GGZAW;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.1;
Expand Down
42 changes: 27 additions & 15 deletions freewrite/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ struct ContentView: View {
return colorScheme == .light ? Color.primary : Color.white
}

@State private var viewHeight: CGFloat = 0

var body: some View {
let buttonBackground = colorScheme == .light ? Color.white : Color.black
let navHeight: CGFloat = 68
Expand All @@ -394,25 +396,28 @@ struct ContentView: View {
Color(colorScheme == .light ? .white : .black)
.ignoresSafeArea()

TextEditor(text: Binding(
get: { text },
set: { newValue in
// Ensure the text always starts with two newlines
if !newValue.hasPrefix("\n\n") {
text = "\n\n" + newValue.trimmingCharacters(in: .newlines)
} else {
text = newValue

TextEditor(text: Binding(
get: { text },
set: { newValue in
// Ensure the text always starts with two newlines
if !newValue.hasPrefix("\n\n") {
text = "\n\n" + newValue.trimmingCharacters(in: .newlines)
} else {
text = newValue
}
}
}
))
))
.background(Color(colorScheme == .light ? .white : .black))
.font(.custom(selectedFont, size: fontSize))
.foregroundColor(colorScheme == .light ? Color(red: 0.20, green: 0.20, blue: 0.20) : Color(red: 0.9, green: 0.9, blue: 0.9))
.scrollContentBackground(.hidden)
.scrollIndicators(.never)
.lineSpacing(lineHeight)
.frame(maxWidth: 650)
.id("\(selectedFont)-\(fontSize)-\(colorScheme)")


.id("\(selectedFont)-\(fontSize)")
.padding(.bottom, bottomNavOpacity > 0 ? navHeight : 0)
.ignoresSafeArea()
.colorScheme(colorScheme)
Expand All @@ -426,13 +431,20 @@ struct ContentView: View {
Text(placeholderText)
.font(.custom(selectedFont, size: fontSize))
.foregroundColor(colorScheme == .light ? .gray.opacity(0.5) : .gray.opacity(0.6))
// .padding(.top, 8)
// .padding(.leading, 8)
// .padding(.top, 8)
// .padding(.leading, 8)
.allowsHitTesting(false)
.offset(x: 5, y: placeholderOffset)
}
}, alignment: .topLeading
)
.onGeometryChange(for: CGFloat.self) { proxy in
proxy.size.height
} action: { height in
viewHeight = height
}
.contentMargins(.bottom, viewHeight / 4)


VStack {
Spacer()
Expand Down Expand Up @@ -755,7 +767,7 @@ struct ContentView: View {
.cornerRadius(8)
.shadow(color: Color.black.opacity(0.1), radius: 4, y: 2)
// Reset copied state when popover dismisses
.onChange(of: showingChatMenu) { newValue in
.onChange(of: showingChatMenu) { _, newValue in
if !newValue {
didCopyPrompt = false
}
Expand Down Expand Up @@ -1399,4 +1411,4 @@ extension NSView {

#Preview {
ContentView()
}
}
26 changes: 26 additions & 0 deletions freewrite/info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs access to the microphone for voice dictation functionality.</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>This app uses speech recognition to convert your voice to text for dictation.</string>
</dict>
</plist>