add tauri controls

This commit is contained in:
Ren Amamiya 2023-07-29 15:42:44 +07:00
parent aca17f104e
commit 996ba3f82d
5 changed files with 73 additions and 15 deletions

View File

@ -39,6 +39,7 @@
"@tauri-apps/plugin-sql": "github:tauri-apps/tauri-plugin-sql#v2",
"@tauri-apps/plugin-stronghold": "github:tauri-apps/tauri-plugin-stronghold#v2",
"@tauri-apps/plugin-upload": "github:tauri-apps/tauri-plugin-upload#v2",
"@tauri-apps/plugin-window": "2.0.0-alpha.0",
"@tiptap/extension-image": "^2.0.4",
"@tiptap/extension-mention": "^2.0.4",
"@tiptap/extension-placeholder": "^2.0.4",
@ -67,7 +68,7 @@
"react-string-replace": "^1.1.1",
"react-virtuoso": "^4.4.2",
"remark-gfm": "^3.0.1",
"tailwind-merge": "^1.14.0",
"tauri-controls": "^0.0.5",
"tippy.js": "^6.3.7",
"zustand": "^4.3.9"
},
@ -84,6 +85,7 @@
"@typescript-eslint/parser": "^5.62.0",
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.14",
"clsx": "^2.0.0",
"cross-env": "^7.0.3",
"csstype": "^3.1.2",
"encoding": "^0.1.13",
@ -98,6 +100,7 @@
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.3.0",
"prop-types": "^15.8.1",
"tailwind-merge": "^1.14.0",
"tailwindcss": "^3.3.3",
"typescript": "^4.9.5",
"vite": "^4.4.7",

View File

@ -67,6 +67,9 @@ dependencies:
'@tauri-apps/plugin-upload':
specifier: github:tauri-apps/tauri-plugin-upload#v2
version: github.com/tauri-apps/tauri-plugin-upload/3c17e7170f54aa3bad3ee4c534f423ace2b06552
'@tauri-apps/plugin-window':
specifier: 2.0.0-alpha.0
version: 2.0.0-alpha.0
'@tiptap/extension-image':
specifier: ^2.0.4
version: 2.0.4(@tiptap/core@2.0.4)
@ -151,9 +154,9 @@ dependencies:
remark-gfm:
specifier: ^3.0.1
version: 3.0.1
tailwind-merge:
specifier: ^1.14.0
version: 1.14.0
tauri-controls:
specifier: ^0.0.5
version: 0.0.5(@tauri-apps/plugin-os@2.0.0-alpha.0)(@tauri-apps/plugin-window@2.0.0-alpha.0)(clsx@2.0.0)(react-dom@18.2.0)(react@18.2.0)(tailwind-merge@1.14.0)
tippy.js:
specifier: ^6.3.7
version: 6.3.7
@ -198,6 +201,9 @@ devDependencies:
autoprefixer:
specifier: ^10.4.14
version: 10.4.14(postcss@8.4.27)
clsx:
specifier: ^2.0.0
version: 2.0.0
cross-env:
specifier: ^7.0.3
version: 7.0.3
@ -240,6 +246,9 @@ devDependencies:
prop-types:
specifier: ^15.8.1
version: 15.8.1
tailwind-merge:
specifier: ^1.14.0
version: 1.14.0
tailwindcss:
specifier: ^3.3.3
version: 3.3.3
@ -1964,6 +1973,11 @@ packages:
resolution: {integrity: sha512-jtkwqdP2rY2iCCDVAFuaNBH3fiEi29aTn2RhtIoky8DTTiCdc48plpHHreLwmv1PICJ4AJUUESaq3xa8fZH8+g==}
dev: false
/@tauri-apps/api@2.0.0-alpha.4:
resolution: {integrity: sha512-gWe5fFHbwFM+dmdDPtlDvVDVtoMneGRM+S8mECevWhKpXYxId0yxznE56YGAvPSJXC3vgsXw16mOmkTnEVKnaw==}
engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
dev: false
/@tauri-apps/api@2.0.0-alpha.5:
resolution: {integrity: sha512-OqysC4c819itGxic50RoDMrmd+ofX+MMNkXKeRS0BV2rkKqrnuV17o3TrQXFI1xs/kXRmmPC+3Y42P9Y5uNvRg==}
engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
@ -2076,6 +2090,12 @@ packages:
'@tauri-apps/cli-win32-x64-msvc': 2.0.0-alpha.10
dev: true
/@tauri-apps/plugin-window@2.0.0-alpha.0:
resolution: {integrity: sha512-ZXFXOu9m8QiDB8d8LFFgwcfxIAbr0bhzj06YvmZDB3isuVtlFP9EyU4D+zmumWEWvNN2XP7xgpn68ivOVhmNNQ==}
dependencies:
'@tauri-apps/api': 2.0.0-alpha.4
dev: false
/@tiptap/core@2.0.4(@tiptap/pm@2.0.4):
resolution: {integrity: sha512-2YOMjRqoBGEP4YGgYpuPuBBJHMeqKOhLnS0WVwjVP84zOmMgZ7A8M6ILC9Xr7Q/qHZCvyBGWOSsI7+3HsEzzYQ==}
peerDependencies:
@ -2924,7 +2944,7 @@ packages:
hasBin: true
dependencies:
caniuse-lite: 1.0.30001517
electron-to-chromium: 1.4.476
electron-to-chromium: 1.4.477
node-releases: 2.0.13
update-browserslist-db: 1.0.11(browserslist@4.21.9)
@ -3094,6 +3114,10 @@ packages:
resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==}
dev: false
/clsx@2.0.0:
resolution: {integrity: sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==}
engines: {node: '>=6'}
/color-convert@1.9.3:
resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==}
dependencies:
@ -3397,8 +3421,8 @@ packages:
/eastasianwidth@0.2.0:
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
/electron-to-chromium@1.4.476:
resolution: {integrity: sha512-gzWl1m8pNy+5Kj17XcziNcbOhripjTqR2wAQmtdlFUngPYuFy7zUpJScVQAvCvQSFHNk3mS5fetNKW6BSpytFg==}
/electron-to-chromium@1.4.477:
resolution: {integrity: sha512-shUVy6Eawp33dFBFIoYbIwLHrX0IZ857AlH9ug2o4rvbWmpaCUdBpQ5Zw39HRrfzAFm4APJE9V+E2A/WB0YqJw==}
/emoji-regex@8.0.0:
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
@ -3721,7 +3745,7 @@ packages:
emoji-regex: 9.2.2
eslint: 8.46.0
has: 1.0.3
jsx-ast-utils: 3.3.4
jsx-ast-utils: 3.3.5
language-tags: 1.0.5
minimatch: 3.1.2
object.entries: 1.1.6
@ -3741,7 +3765,7 @@ packages:
doctrine: 2.1.0
eslint: 8.46.0
estraverse: 5.3.0
jsx-ast-utils: 3.3.4
jsx-ast-utils: 3.3.5
minimatch: 3.1.2
object.entries: 1.1.6
object.fromentries: 2.0.6
@ -3981,7 +4005,7 @@ packages:
engines: {node: '>=14'}
dependencies:
cross-spawn: 7.0.3
signal-exit: 4.0.3
signal-exit: 4.1.0
dev: false
/formdata-polyfill@4.0.10:
@ -4647,8 +4671,8 @@ packages:
hasBin: true
dev: false
/jsx-ast-utils@3.3.4:
resolution: {integrity: sha512-fX2TVdCViod6HwKEtSWGHs57oFhVfCMwieb9PuRDgjDPh5XeqJiHFFFJCHxU5cnTc3Bu/GRL+kPiFmw8XWOfKw==}
/jsx-ast-utils@3.3.5:
resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==}
engines: {node: '>=4.0'}
dependencies:
array-includes: 3.1.6
@ -6706,8 +6730,8 @@ packages:
/signal-exit@3.0.7:
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
/signal-exit@4.0.3:
resolution: {integrity: sha512-U97H1k7QQ8OQJ18ryc5lSI16ouK1a43nSNRkXz16OMcc5dTVz5TlQxgf2NbX+cF0luukRuy3/womPZqfpIucbw==}
/signal-exit@4.1.0:
resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
engines: {node: '>=14'}
dev: false
@ -6965,7 +6989,6 @@ packages:
/tailwind-merge@1.14.0:
resolution: {integrity: sha512-3mFKyCo/MBcgyOTlrY8T7odzZFx+w+qKSMAmdFzRvqBfLlSigU6TZnlFHK0lkMwj9Bj8OYU+9yW9lmGuS0QEnQ==}
dev: false
/tailwindcss@3.3.3:
resolution: {integrity: sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==}
@ -7010,6 +7033,25 @@ packages:
yallist: 4.0.0
dev: false
/tauri-controls@0.0.5(@tauri-apps/plugin-os@2.0.0-alpha.0)(@tauri-apps/plugin-window@2.0.0-alpha.0)(clsx@2.0.0)(react-dom@18.2.0)(react@18.2.0)(tailwind-merge@1.14.0):
resolution: {integrity: sha512-q/7UdIn0PSunaRuqsjWlLKNsWLYRaF8jLylDdKEK7Q+5E/galN/ZoK2YBd4frjLfbMfT9vI5kxq3wyo7Z4UGWA==}
peerDependencies:
'@tauri-apps/plugin-os': 2.0.0-alpha.0
'@tauri-apps/plugin-window': 2.0.0-alpha.0
clsx: ^2.0.0
react: '>=17.x'
react-dom: '>=17.x'
tailwind-merge: ^1.14.0
dependencies:
'@tauri-apps/api': 2.0.0-alpha.5
'@tauri-apps/plugin-os': github.com/tauri-apps/tauri-plugin-os/d235fbf70c53812c501f1d86a6b8c790bdf6bc8b
'@tauri-apps/plugin-window': 2.0.0-alpha.0
clsx: 2.0.0
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
tailwind-merge: 1.14.0
dev: false
/text-table@0.2.0:
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}

11
src-tauri/Cargo.lock generated
View File

@ -2585,6 +2585,7 @@ dependencies = [
"tauri-plugin-stronghold",
"tauri-plugin-updater",
"tauri-plugin-upload",
"tauri-plugin-window",
]
[[package]]
@ -5040,6 +5041,16 @@ dependencies = [
"tokio-util",
]
[[package]]
name = "tauri-plugin-window"
version = "2.0.0-alpha.0"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6f01bc11ab5be762d6cbe0ca924f15cdde47ce0d"
dependencies = [
"serde",
"tauri",
"thiserror",
]
[[package]]
name = "tauri-runtime"
version = "0.13.0-alpha.6"

View File

@ -30,6 +30,7 @@ tauri-plugin-notification = { git = "https://github.com/tauri-apps/plugins-works
tauri-plugin-app = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-process = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-os = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-window = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
sqlx-cli = { version = "0.7.0", default-features = false, features = [
"sqlite",
] }

View File

@ -143,6 +143,7 @@ fn main() {
.plugin(tauri_plugin_app::init())
.plugin(tauri_plugin_process::init())
.plugin(tauri_plugin_os::init())
.plugin(tauri_plugin_window::init())
.setup(|app| {
#[cfg(target_os = "macos")]
let main_window = app.get_window("main").unwrap();