Skip to content
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

Esse 2.0 #21

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1fdc037
Swift UI rewrite begins
melonamin Jun 13, 2023
d71b6d8
Fix SwiftFormat errors and change bundle id
melonamin Jun 16, 2023
dcabaa3
✨Working on new footer view
melonamin Sep 23, 2023
1a84675
Add applied functions view, fix Share action for multieditor mode
melonamin Sep 23, 2023
51cb47b
Simplify main view, removing sidebar
melonamin Sep 23, 2023
4c342bc
Add Menu Commands, restrict app to a single window, refactor Library
melonamin Sep 24, 2023
687b594
Implement search in Library, add app icons
melonamin Sep 24, 2023
4cf2f54
Added Start at Login #20
melonamin Sep 24, 2023
e23d9d6
Switch Quick Open to dark theme, tweak Inspector view
melonamin Sep 24, 2023
eb53bbd
Add CLI
melonamin Oct 1, 2023
11ae35c
Fix project config, archiving now works as expected
melonamin Nov 11, 2023
b2a08d6
Update version to satisfy xcode ci
melonamin Nov 11, 2023
d37e40b
Add Appearance Setting
melonamin Jan 1, 2024
da77b4a
Update App Icon
melonamin Jan 1, 2024
46da350
Work on adopting Document App model
melonamin Jan 1, 2024
528c33d
Add About Screen in Settings
melonamin Jan 2, 2024
e2f7ce4
Add default document to open when there is nothing else
melonamin Jul 24, 2024
b78d148
Fix attribution year in About View
melonamin Jul 24, 2024
3407a48
Command Pallete should be presented only in active window
melonamin Jul 24, 2024
003ac53
Start migration to STTextview, formatting
melonamin Jul 24, 2024
6a5b300
Improvements to STTextView integration
melonamin Jul 25, 2024
8dfbc15
Add support for external scripts in main app and cli
melonamin Jul 26, 2024
d611927
Remove syntax highlight support
melonamin Aug 9, 2024
47f6722
Add show line numbers and highlight selected line settings
melonamin Aug 9, 2024
847eb0d
Settings clean up
melonamin Aug 9, 2024
dd90386
Package version and project update
melonamin Aug 9, 2024
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
xcuserdata
789 changes: 789 additions & 0 deletions Esse/Esse.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"pins" : [
{
"identity" : "dsfappearancemanager",
"kind" : "remoteSourceControl",
"location" : "https://github.com/dagronf/DSFAppearanceManager",
"state" : {
"revision" : "676cfd4e6aaa3cf6422990734c22544373db5c1a",
"version" : "3.3.0"
}
},
{
"identity" : "dsfquickactionbar",
"kind" : "remoteSourceControl",
"location" : "https://github.com/dagronf/DSFQuickActionBar.git",
"state" : {
"revision" : "eebbaec76cf6ab8404971f952da90ae9be29adac",
"version" : "6.0.1"
}
},
{
"identity" : "launchatlogin-modern",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sindresorhus/LaunchAtLogin-Modern",
"state" : {
"branch" : "main",
"revision" : "9c41991631605c8ccfe0347bbcb5c659169f2ec5"
}
},
{
"identity" : "neon",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ChimeHQ/Neon.git",
"state" : {
"revision" : "7df7d080a271cfa4dc87f94cccc024665a75047e",
"version" : "0.6.0"
}
},
{
"identity" : "rearrange",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ChimeHQ/Rearrange",
"state" : {
"revision" : "5ff7f3363f7a08f77e0d761e38e6add31c2136e1",
"version" : "1.8.1"
}
},
{
"identity" : "sttextkitplus",
"kind" : "remoteSourceControl",
"location" : "https://github.com/krzyzanowskim/STTextKitPlus",
"state" : {
"revision" : "73970cbd47bdf3d640afdad9a16edb1521b708a3",
"version" : "0.1.2"
}
},
{
"identity" : "sttextview",
"kind" : "remoteSourceControl",
"location" : "https://github.com/krzyzanowskim/STTextView",
"state" : {
"revision" : "8c4b880259f122c5ff4283adc698ac0d5d4b9027",
"version" : "0.9.6"
}
},
{
"identity" : "sttextview-plugin-neon",
"kind" : "remoteSourceControl",
"location" : "https://github.com/krzyzanowskim/STTextView-Plugin-Neon",
"state" : {
"revision" : "dc37eb270e2763f59dacc9559252fd1bb641a329",
"version" : "0.2.0"
}
},
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531",
"version" : "1.2.3"
}
},
{
"identity" : "swifttreesitter",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ChimeHQ/SwiftTreeSitter",
"state" : {
"revision" : "2599e95310b3159641469d8a21baf2d3d200e61f",
"version" : "0.8.0"
}
},
{
"identity" : "tree-sitter-xcframework",
"kind" : "remoteSourceControl",
"location" : "https://github.com/krzyzanowskim/tree-sitter-xcframework",
"state" : {
"revision" : "8c11cc2d299a5afed6d8ae77b29c8204743b1c4f",
"version" : "0.208.5"
}
}
],
"version" : 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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>SchemeUserState</key>
<dict>
<key>Esse.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>EsseCommandLine.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>FA853DCA2A33AD71007D6889</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
21 changes: 21 additions & 0 deletions Esse/Esse/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Cocoa
import SwiftUI

final class AppDelegate: NSObject, NSApplicationDelegate {
private var documentController: DocumentController!

func applicationWillFinishLaunching(_: Notification) {
@AppStorage("appearance") var appearance: AppearanceOptions = .System
appearance.applyAppearance()
}

func applicationDidFinishLaunching(_: Notification) {
NSWindow.allowsAutomaticWindowTabbing = true
documentController = DocumentController()
DispatchQueue.main.async {
if NSDocumentController.shared.documents.isEmpty {
self.documentController.createAndOpenDefaultDocument()
}
}
}
}
11 changes: 11 additions & 0 deletions Esse/Esse/Assets.xcassets/AccentColor.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
74 changes: 74 additions & 0 deletions Esse/Esse/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"images" : [
{
"idiom" : "ios-marketing",
"filename" : "icon_1024.png",
"scale" : "1x",
"size" : "1024x1024"
},
{
"scale" : "1x",
"size" : "16x16",
"filename" : "icon_16.png",
"idiom" : "mac"
},
{
"scale" : "2x",
"size" : "16x16",
"filename" : "icon_32.png",
"idiom" : "mac"
},
{
"idiom" : "mac",
"scale" : "1x",
"filename" : "icon_32.png",
"size" : "32x32"
},
{
"size" : "32x32",
"filename" : "icon_64.png",
"idiom" : "mac",
"scale" : "2x"
},
{
"scale" : "1x",
"idiom" : "mac",
"size" : "128x128",
"filename" : "icon_128.png"
},
{
"scale" : "2x",
"filename" : "icon_256.png",
"idiom" : "mac",
"size" : "128x128"
},
{
"filename" : "icon_256.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"filename" : "icon_512.png",
"size" : "256x256",
"scale" : "2x",
"idiom" : "mac"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "1x",
"filename" : "icon_512.png"
},
{
"filename" : "icon_1024.png",
"size" : "512x512",
"idiom" : "mac",
"scale" : "2x"
}
]
}
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Esse/Esse/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
18 changes: 18 additions & 0 deletions Esse/Esse/Esse.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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>com.apple.developer.icloud-container-identifiers</key>
<array/>
<key>com.apple.developer.icloud-services</key>
<array/>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>$(TeamIdentifierPrefix)com.ameba.esse</string>
</array>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
</dict>
</plist>
53 changes: 53 additions & 0 deletions Esse/Esse/EsseApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import SwiftUI

@main
struct EsseApp: App {
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
@AppStorage("showMenubarExtra") private var showMenuBarExtra = true

var body: some Scene {
DocumentGroup(newDocument: EsseDocument()) { file in
MacMainView(document: file.$document)
}
.commands {
CustomFileCommands()
CustomViewCommands()
LibraryCommands()
}
Window("Library", id: "library") {
LibraryView()
}
Settings {
SettingsView()
}
}
}

class DocumentController: ObservableObject {
func createAndOpenDefaultDocument() {
let document = EsseDocument()
let documentURL = getAppSupportDirectory().appendingPathComponent("Esse.txt")
do {
let data = String(document.text.characters).data(using: .utf8)!
try data.write(to: documentURL)
NSDocumentController.shared.openDocument(withContentsOf: documentURL, display: true) { _, _, _ in }
} catch {
print("Failed to create default document: \(error)")
}
}

private func getAppSupportDirectory() -> URL {
let paths = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask)
let appSupportDirectory = paths[0]

if !FileManager.default.fileExists(atPath: appSupportDirectory.path) {
do {
try FileManager.default.createDirectory(at: appSupportDirectory, withIntermediateDirectories: true, attributes: nil)
} catch {
print("Failed to create Application Support directory: \(error)")
}
}

return appSupportDirectory
}
}
Loading