MacOS MVP Requirements

This commit is contained in:
Elizabeth Cray 2023-07-24 02:41:06 -04:00
parent 6e5e38abdc
commit 84b979a80a
8 changed files with 60 additions and 16 deletions

View File

@ -13,3 +13,7 @@ Allen Wrench is a desktop tool to aid [Hexcorp](https://hexcorp.net) Drones in t
* [ ] Auto-send `return` on paste completion for pre-determined phrases
* [ ] Ability to add custom types / phrases
* [ ] [Unicode "font" options](https://lingojam.com/DiscordFonts)
### Misc notes
[Use this as a guide for building for MacOS](https://thinkgo.io/post/2023/02/publish_tauri_to_apples_app_store/)

19
entitlements.plist Normal file
View File

@ -0,0 +1,19 @@
<?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.security.app-sandbox</key><true/>
<key>com.apple.security.network.client</key><true/>
<key>com.apple.application-identifier</key>
<string>W9ASV855X5.lgbt.cray.allenwrench</string>
<key>com.apple.developer.team-identifier</key>
<string>W9ASV855X5</string>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>

View File

@ -1,7 +1,7 @@
{
"name": "allenwrench-app",
"private": true,
"version": "0.0.0",
"version": "0.1.1",
"type": "module",
"scripts": {
"dev": "vite",

4
src-tauri/Cargo.lock generated
View File

@ -27,8 +27,8 @@ dependencies = [
]
[[package]]
name = "allenwrench-app"
version = "0.0.0"
name = "allenwrench"
version = "0.1.1"
dependencies = [
"arboard",
"enigo",

View File

@ -1,10 +1,10 @@
[package]
name = "allenwrench-app"
version = "0.0.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
name = "allenwrench"
version = "0.1.1"
description = "Hexcorp Drone Input Tool"
authors = ["Liz Cray", "4661"]
license = "Apache-2.0"
repository = "git@git.corrupt.link:liz/AllenWrench.git"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -1,6 +1,7 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use tauri::{Manager, Size, LogicalSize};
use enigo::{Enigo, Key, KeyboardControllable, MouseControllable};
use std::thread;
use std::time::Duration;
@ -73,8 +74,18 @@ fn type_str(input: String) {
fn main() {
tauri::Builder::default()
.setup(|app| {
let main_window = app.get_window("main").unwrap();
#[cfg(target_os = "macos")] {
let _ = main_window.set_size(Size::Logical(LogicalSize {width: 400.0, height: 352.0}));
}
Ok(())
})
.plugin(tauri_plugin_positioner::init())
.invoke_handler(tauri::generate_handler![type_str, get_mouse_pos])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

View File

@ -7,7 +7,7 @@
"withGlobalTauri": false
},
"package": {
"productName": "allenwrench-app",
"productName": "allenwrench",
"version": "0.1.1"
},
"tauri": {
@ -48,7 +48,9 @@
}
},
"bundle": {
"category": "Utility",
"active": true,
"copyright": "Copyright 2023 Elizabeth Cray",
"targets": "all",
"identifier": "lgbt.cray.allenwrench",
"icon": [
@ -59,7 +61,12 @@
],
"resources": [
"resources/*"
]
],
"macOS": {
"minimumSystemVersion": "10.11",
"license": "../LICENSE.txt",
"entitlements": "../entitlements.plist"
}
},
"security": {
"csp": null
@ -67,7 +74,7 @@
"windows": [
{
"fullscreen": false,
"resizable": false,
"resizable": true,
"maximizable": false,
"minimizable": false,
"alwaysOnTop": true,

View File

@ -23,6 +23,7 @@ type Code = {
};
// Set window to above the mouse cursor
// TODO: Fix for MacOS
invoke('get_mouse_pos', {}).then((posJson: any) => {
let pos = JSON.parse(posJson);
appWindow.innerSize().then((size: any) => {
@ -44,11 +45,13 @@ function App() {
return (storedId ? storedId : "0000");
});
resolveResource("resources/codes.json").then((path: string) => {
readTextFile(path).then((codesJson: string) => {
setCodes(JSON.parse(codesJson));
if (!codes){
resolveResource("resources/codes.json").then((path: string) => {
readTextFile(path).then((codesJson: string) => {
setCodes(JSON.parse(codesJson));
});
});
});
}
const getSubjects = (input: Array<Code>) => {
// TODO: Put all single-level elements at bottom