Skip to content

Commit

Permalink
Merge pull request #15 from CKylinMC/dev
Browse files Browse the repository at this point in the history
Version 1.1.0
  • Loading branch information
CKylinMC authored Feb 21, 2025
2 parents 5f1c761 + 0f62bf6 commit 2475f37
Show file tree
Hide file tree
Showing 15 changed files with 1,004 additions and 630 deletions.
1 change: 1 addition & 0 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
// biome-ignore lint: disable
export {}

/* prettier-ignore */
Expand Down
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pasteme",
"private": true,
"version": "1.0.0",
"version": "1.1.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -11,22 +11,22 @@
"bump": "tsx .scripts/bump.ts"
},
"dependencies": {
"@ai-sdk/openai": "^1.1.12",
"@ai-sdk/openai-compatible": "^0.1.10",
"@ai-sdk/vue": "^1.1.17",
"@tailwindcss/vite": "^4.0.6",
"@ai-sdk/openai": "^1.1.13",
"@ai-sdk/openai-compatible": "^0.1.11",
"@ai-sdk/vue": "^1.1.18",
"@tailwindcss/vite": "^4.0.8",
"@tauri-apps/api": "^2.2.0",
"@tauri-apps/plugin-autostart": "~2",
"@tauri-apps/plugin-clipboard-manager": "~2",
"@tauri-apps/plugin-global-shortcut": "~2",
"@tauri-apps/plugin-http": "~2",
"@tauri-apps/plugin-autostart": "~2.2.0",
"@tauri-apps/plugin-clipboard-manager": "~2.2.1",
"@tauri-apps/plugin-global-shortcut": "~2.2.0",
"@tauri-apps/plugin-http": "~2.3.0",
"@tauri-apps/plugin-opener": "^2.2.5",
"@tauri-apps/plugin-process": "^2.2.0",
"@tauri-apps/plugin-store": "~2",
"@tauri-apps/plugin-stronghold": "~2",
"@tauri-apps/plugin-updater": "~2",
"@tauri-apps/plugin-store": "~2.2.0",
"@tauri-apps/plugin-stronghold": "~2.2.0",
"@tauri-apps/plugin-updater": "~2.5.0",
"@tavily/core": "^0.3.1",
"ai": "^4.1.41",
"ai": "^4.1.45",
"marked": "^15.0.7",
"tailwindcss-animated": "^2.0.0",
"vue": "^3.5.13",
Expand All @@ -41,15 +41,15 @@
"@vitejs/plugin-vue": "^5.2.1",
"autoprefixer": "^10.4.20",
"naive-ui": "^2.41.0",
"postcss": "^8.5.2",
"postcss": "^8.5.3",
"semver": "^7.7.1",
"tailwindcss": "^4.0.6",
"tsx": "^4.19.2",
"tailwindcss": "^4.0.8",
"tsx": "^4.19.3",
"typescript": "~5.7.3",
"unplugin-icons": "^22.0.0",
"unplugin-vue-components": "^28.1.0",
"unplugin-icons": "^22.1.0",
"unplugin-vue-components": "^28.4.0",
"vfonts": "^0.1.0",
"vite": "^6.1.0",
"vite": "^6.1.1",
"vue-tsc": "^2.2.2",
"zod": "^3.24.2"
}
Expand Down
54 changes: 7 additions & 47 deletions src-tauri/Cargo.lock

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

3 changes: 1 addition & 2 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pasteme"
version = "1.0.0"
version = "1.1.0"
description = "A simple clipboard manager"
authors = ["CKylinMC"]
edition = "2021"
Expand All @@ -23,7 +23,6 @@ tauri-plugin-opener = "2"
window-vibrancy = "0.5.3"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
mouse_position = "0.1.3"
tauri-plugin-clipboard-manager = "2"
tauri-plugin-store = "2"
tauri-plugin-process = "2"
Expand Down
14 changes: 0 additions & 14 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
mod tray;

use enigo::{Direction, Enigo, Key, Keyboard, Settings};
use mouse_position::mouse_position::Mouse;
use tauri::{AppHandle, Manager};
use tauri_plugin_autostart::MacosLauncher;
use window_vibrancy::{apply_acrylic, apply_mica};

#[tauri::command]
fn get_mouse_position() -> Vec<i32> {
let position = Mouse::get_mouse_position();
match position {
Mouse::Position { x, y } => vec![x, y],
Mouse::Error => {
println!("Error getting mouse position");
vec![]
}
}
}

#[tauri::command]
async fn input_text(text: &str) -> Result<(), String> {
let mut enigo = Enigo::new(&Settings::default()).unwrap();
Expand Down Expand Up @@ -77,7 +64,6 @@ pub fn run() {
})
.plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![
get_mouse_position,
input_text,
simulate_paste
])
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "PasteMe",
"version": "1.0.0",
"version": "1.1.0",
"identifier": "in.ckyl.pasteme",
"build": {
"beforeDevCommand": "yarn dev",
Expand Down
2 changes: 1 addition & 1 deletion src/AppInfo.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const AppInfo = {
version: "1.0.0",
version: "1.1.0",
};
62 changes: 61 additions & 1 deletion src/composables/useConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ export interface AIConfig {
apiKey: string;
endpoint: string;
model: string;
enableToJson: boolean;
enableAskAI: boolean;
enableAICreation: boolean;
enableAIChat: boolean;
enableAISnipets: boolean;
persistChatHistory: boolean;
enableImage: boolean;
imageAIEndpoint: string;
imageApiKey:string;
imageApiKey: string;
imageModel: string;
enableWebsearch: boolean;
tavilyApiKey: string;
Expand All @@ -26,11 +31,25 @@ export interface Snippet {
prompt: string;
}

export interface CommonConfig {
enablePaste: boolean;
enableCalc: boolean;
enableEdit: boolean;
enableToText: boolean;
}

export interface DetectConfig {
enabled: boolean;
detectUrl: boolean;
}

export interface Config {
globalShortcut: string;
ai: AIConfig;
chatHistory?: CoreMessage[];
snippets: Snippet[];
common: CommonConfig;
detect: DetectConfig;
}

export function useConfig() {
Expand All @@ -42,6 +61,11 @@ export function useConfig() {
apiKey: '',
endpoint: 'https://api.openai.com/v1',
model: 'gpt-4o',
enableToJson: true,
enableAskAI: true,
enableAICreation: true,
enableAIChat: true,
enableAISnipets: true,
persistChatHistory: false,
enableImage: false,
imageAIEndpoint: 'https://api.openai.com/v1',
Expand All @@ -52,6 +76,16 @@ export function useConfig() {
enableWebCrawl: false,
jinaApiKey: '',
},
common: {
enablePaste: true,
enableCalc: true,
enableEdit: true,
enableToText: true,
},
detect: {
enabled: false,
detectUrl: false,
},
snippets: [],
chatHistory: []
});
Expand All @@ -67,6 +101,11 @@ export function useConfig() {
apiKey: (await store.get('ai.apiKey')) || '',
endpoint: (await store.get('ai.endpoint')) || 'https://api.openai.com/v1',
model: (await store.get('ai.model')) || 'gpt-4o',
enableToJson: !!(await store.get('ai.enableToJson') ?? true),
enableAskAI: !!(await store.get('ai.enableAskAI') ?? true),
enableAICreation: !!(await store.get('ai.enableAICreation') ?? true),
enableAIChat: !!(await store.get('ai.enableAIChat') ?? true),
enableAISnipets: !!(await store.get('ai.enableAISnipets') ?? true),
persistChatHistory: !!(await store.get('ai.persistChatHistory')),
enableImage: !!(await store.get('ai.enableImage')),
imageAIEndpoint: (await store.get('ai.imageAIEndpoint')) || 'https://api.openai.com/v1',
Expand All @@ -77,6 +116,16 @@ export function useConfig() {
enableWebCrawl: !!(await store.get('ai.enableWebCrawl')),
jinaApiKey: (await store.get('ai.jinaApiKey')) || '',
};
config.value.detect = {
enabled: !!(await store.get('detect.enabled') ?? true),
detectUrl: !!(await store.get('detect.detectUrl') ?? true),
};
config.value.common = {
enablePaste: !!(await store.get('common.enablePaste') ?? true),
enableCalc: !!(await store.get('common.enableCalc') ?? true),
enableEdit: !!(await store.get('common.enableEdit') ?? true),
enableToText: !!(await store.get('common.enableToText') ?? true),
};
config.value.snippets = tryParse(await store.get('snippets') || "[]", [
{
id: 'intro',
Expand All @@ -99,6 +148,11 @@ export function useConfig() {
await store.set('ai.apiKey', config.value.ai.apiKey);
await store.set('ai.endpoint', config.value.ai.endpoint);
await store.set('ai.model', config.value.ai.model);
await store.set('ai.enableToJson', config.value.ai.enableToJson);
await store.set('ai.enableAskAI', config.value.ai.enableAskAI);
await store.set('ai.enableAICreation', config.value.ai.enableAICreation);
await store.set('ai.enableAIChat', config.value.ai.enableAIChat);
await store.set('ai.enableAISnipets', config.value.ai.enableAISnipets);
await store.set('ai.persistChatHistory', config.value.ai.persistChatHistory);
await store.set('ai.enableImage', config.value.ai.enableImage);
await store.set('ai.imageAIEndpoint', config.value.ai.imageAIEndpoint);
Expand All @@ -108,6 +162,12 @@ export function useConfig() {
await store.set('ai.tavilyApiKey', config.value.ai.tavilyApiKey);
await store.set('ai.enableWebCrawl', config.value.ai.enableWebCrawl);
await store.set('ai.jinaApiKey', config.value.ai.jinaApiKey);
await store.set('detect.enabled', config.value.detect.enabled);
await store.set('detect.detectUrl', config.value.detect.detectUrl);
await store.set('common.enablePaste', config.value.common.enablePaste);
await store.set('common.enableCalc', config.value.common.enableCalc);
await store.set('common.enableEdit', config.value.common.enableEdit);
await store.set('common.enableToText', config.value.common.enableToText);
await store.set('snippets', JSON.stringify(Array.isArray(config.value.snippets) ? config.value.snippets : []));
await store.set('chatHistory', JSON.stringify(Array.isArray(config.value.chatHistory) ? config.value.chatHistory : []));
await store.save();
Expand Down
Loading

0 comments on commit 2475f37

Please sign in to comment.