chore: upgrade to tauri v2 stable

This commit is contained in:
reya 2024-10-03 09:00:48 +07:00
parent e098743d43
commit fe60f75e96
23 changed files with 1500 additions and 894 deletions

View File

@ -12,37 +12,37 @@
"dependencies": { "dependencies": {
"@getalby/bitcoin-connect-react": "^3.6.2", "@getalby/bitcoin-connect-react": "^3.6.2",
"@phosphor-icons/react": "^2.1.7", "@phosphor-icons/react": "^2.1.7",
"@radix-ui/react-avatar": "^1.1.0", "@radix-ui/react-avatar": "^1.1.1",
"@radix-ui/react-checkbox": "^1.1.1", "@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-popover": "^1.1.1", "@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-scroll-area": "^1.1.0", "@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-switch": "^1.1.0", "@radix-ui/react-switch": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.0", "@radix-ui/react-tabs": "^1.1.1",
"@radix-ui/react-tooltip": "^1.1.2", "@radix-ui/react-tooltip": "^1.1.3",
"@tanstack/query-persist-client-core": "^5.56.2", "@tanstack/query-persist-client-core": "^5.59.0",
"@tanstack/react-query": "^5.56.2", "@tanstack/react-query": "^5.59.0",
"@tanstack/react-router": "^1.58.3", "@tanstack/react-router": "^1.58.16",
"@tanstack/react-store": "^0.5.5", "@tanstack/react-store": "^0.5.5",
"@tanstack/store": "^0.5.5", "@tanstack/store": "^0.5.5",
"@tauri-apps/api": "2.0.0-rc.4", "@tauri-apps/api": "^2.0.1",
"@tauri-apps/plugin-clipboard-manager": "2.0.0-rc.1", "@tauri-apps/plugin-clipboard-manager": "^2.0.0",
"@tauri-apps/plugin-dialog": "2.0.0-rc.1", "@tauri-apps/plugin-dialog": "^2.0.0",
"@tauri-apps/plugin-fs": "2.0.0-rc.2", "@tauri-apps/plugin-fs": "^2.0.0",
"@tauri-apps/plugin-http": "2.0.0-rc.2", "@tauri-apps/plugin-http": "^2.0.0",
"@tauri-apps/plugin-os": "2.0.0-rc.1", "@tauri-apps/plugin-os": "^2.0.0",
"@tauri-apps/plugin-process": "2.0.0-rc.1", "@tauri-apps/plugin-process": "^2.0.0",
"@tauri-apps/plugin-shell": "2.0.0-rc.1", "@tauri-apps/plugin-shell": "^2.0.0",
"@tauri-apps/plugin-store": "2.0.0-rc.1", "@tauri-apps/plugin-store": "^2.0.0",
"@tauri-apps/plugin-updater": "2.0.0-rc.1", "@tauri-apps/plugin-updater": "^2.0.0",
"@tauri-apps/plugin-upload": "2.0.0-rc.1", "@tauri-apps/plugin-upload": "^2.0.0",
"@tauri-apps/plugin-window-state": "2.0.0-rc.1", "@tauri-apps/plugin-window-state": "^2.0.0",
"bitcoin-units": "^1.0.0", "bitcoin-units": "^1.0.0",
"boring-avatars": "^1.11.2", "boring-avatars": "^1.11.2",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"embla-carousel-react": "^8.3.0", "embla-carousel-react": "^8.3.0",
"i18next": "^23.15.1", "i18next": "^23.15.1",
"i18next-resources-to-backend": "^1.2.1", "i18next-resources-to-backend": "^1.2.1",
"light-bolt11-decoder": "^3.1.1", "light-bolt11-decoder": "^3.2.0",
"minidenticons": "^4.2.1", "minidenticons": "^4.2.1",
"nanoid": "^5.0.7", "nanoid": "^5.0.7",
"nostr-tools": "^2.7.2", "nostr-tools": "^2.7.2",
@ -54,30 +54,30 @@
"react-string-replace": "^1.1.1", "react-string-replace": "^1.1.1",
"rich-textarea": "^0.26.3", "rich-textarea": "^0.26.3",
"use-debounce": "^10.0.3", "use-debounce": "^10.0.3",
"virtua": "^0.33.7" "virtua": "^0.34.2"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^1.9.2", "@biomejs/biome": "^1.9.3",
"@evilmartians/harmony": "^1.2.0", "@evilmartians/harmony": "^1.2.0",
"@tailwindcss/forms": "^0.5.9", "@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15", "@tailwindcss/typography": "^0.5.15",
"@tanstack/router-devtools": "^1.58.3", "@tanstack/router-devtools": "^1.58.16",
"@tanstack/router-plugin": "^1.58.4", "@tanstack/router-plugin": "^1.58.12",
"@tauri-apps/cli": "2.0.0-rc.8", "@tauri-apps/cli": "^2.0.0",
"@types/react": "npm:types-react@19.0.0-rc.1", "@types/react": "npm:types-react@19.0.0-rc.1",
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1", "@types/react-dom": "npm:types-react-dom@19.0.0-rc.1",
"@vitejs/plugin-react": "^4.3.1", "@vitejs/plugin-react": "^4.3.2",
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"babel-plugin-react-compiler": "0.0.0-experimental-696af53-20240625", "babel-plugin-react-compiler": "0.0.0-experimental-b4db8c3-20241001",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"postcss": "^8.4.47", "postcss": "^8.4.47",
"tailwind-gradient-mask-image": "^1.2.0", "tailwind-gradient-mask-image": "^1.2.0",
"tailwind-merge": "^2.5.2", "tailwind-merge": "^2.5.2",
"tailwind-scrollbar": "^3.1.0", "tailwind-scrollbar": "^3.1.0",
"tailwindcss": "^3.4.12", "tailwindcss": "^3.4.13",
"tailwindcss-content-visibility": "^0.2.0", "tailwindcss-content-visibility": "^1.0.0",
"typescript": "^5.6.2", "typescript": "^5.6.2",
"vite": "^5.4.6", "vite": "^5.4.8",
"vite-tsconfig-paths": "^5.0.1" "vite-tsconfig-paths": "^5.0.1"
}, },
"overrides": { "overrides": {

1132
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

636
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -8,29 +8,29 @@ edition = "2021"
rust-version = "1.70" rust-version = "1.70"
[build-dependencies] [build-dependencies]
tauri-build = { version = "2.0.0-rc", features = [] } tauri-build = { version = "2.0.0", features = [] }
[dependencies] [dependencies]
tauri = { version = "2.0.0-rc", features = [ tauri = { version = "2.0.0", features = [
"unstable", "unstable",
"tray-icon", "tray-icon",
"macos-private-api", "macos-private-api",
"protocol-asset", "protocol-asset",
] } ] }
tauri-plugin-window-state = "2.0.0-rc" tauri-plugin-window-state = "2.0.0"
tauri-plugin-clipboard-manager = "2.0.0-rc" tauri-plugin-clipboard-manager = "2.0.0"
tauri-plugin-dialog = "2.0.0-rc" tauri-plugin-dialog = "2.0.0"
tauri-plugin-fs = "2.0.0-rc" tauri-plugin-fs = "2.0.0"
tauri-plugin-http = "2.0.0-rc" tauri-plugin-http = "2.0.0"
tauri-plugin-notification = "2.0.0-rc" tauri-plugin-notification = "2.0.0"
tauri-plugin-os = "2.0.0-rc" tauri-plugin-os = "2.0.0"
tauri-plugin-process = "2.0.0-rc" tauri-plugin-process = "2.0.0"
tauri-plugin-shell = "2.0.0-rc" tauri-plugin-shell = "2.0.0"
tauri-plugin-updater = "2.0.0-rc" tauri-plugin-updater = "2.0.0"
tauri-plugin-upload = "2.0.0-rc" tauri-plugin-upload = "2.0.0"
tauri-plugin-store = "2.0.0-rc" tauri-plugin-store = "2.0.0"
tauri-plugin-decorum = { git = "https://github.com/clearlysid/tauri-plugin-decorum.git" } tauri-plugin-decorum = { git = "https://github.com/clearlysid/tauri-plugin-decorum.git" }
tauri-plugin-prevent-default = "0.4" tauri-plugin-prevent-default = "0.6"
tauri-specta = { version = "2.0.0-rc.15", features = ["derive", "typescript"] } tauri-specta = { version = "2.0.0-rc.15", features = ["derive", "typescript"] }
nostr-sdk = { git = "https://github.com/rust-nostr/nostr", features = ["lmdb"] } nostr-sdk = { git = "https://github.com/rust-nostr/nostr", features = ["lmdb"] }

View File

@ -60,9 +60,7 @@
"core:menu:allow-new", "core:menu:allow-new",
"core:menu:allow-popup", "core:menu:allow-popup",
"shell:allow-open", "shell:allow-open",
"store:allow-get", "store:default",
"store:allow-set",
"store:allow-delete",
"prevent-default:default", "prevent-default:default",
{ {
"identifier": "http:default", "identifier": "http:default",

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"column":{"identifier":"column","description":"Capability for the column","local":true,"windows":["column-*"],"permissions":["core:resources:default","core:tray:default","os:allow-locale","os:allow-os-type","clipboard-manager:allow-write-text","dialog:allow-open","dialog:allow-ask","dialog:allow-message","fs:allow-read-file","core:menu:default","core:menu:allow-new","core:menu:allow-popup","http:default","shell:allow-open","store:allow-get","store:allow-set","store:allow-delete",{"identifier":"http:default","allow":[{"url":"http://**/"},{"url":"https://**/"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"$RESOURCE/locales/*"},{"path":"$RESOURCE/resources/*"}]}],"platforms":["linux","macOS","windows"]},"window":{"identifier":"window","description":"Capability for the desktop","local":true,"windows":["main","panel","settings","search-*","zap-*","event-*","user-*","editor-*"],"permissions":["core:path:default","core:event:default","core:window:default","core:app:default","core:resources:default","core:menu:default","core:tray:default","notification:allow-is-permission-granted","notification:allow-request-permission","notification:default","os:allow-locale","os:allow-platform","os:allow-os-type","updater:default","updater:allow-check","updater:allow-download-and-install","core:window:allow-create","core:window:allow-close","core:window:allow-destroy","core:window:allow-set-focus","core:window:allow-center","core:window:allow-minimize","core:window:allow-maximize","core:window:allow-set-size","core:window:allow-start-dragging","core:window:allow-toggle-maximize","decorum:allow-show-snap-overlay","clipboard-manager:allow-write-text","clipboard-manager:allow-read-text","core:webview:allow-create-webview-window","core:webview:allow-create-webview","core:webview:allow-set-webview-size","core:webview:allow-set-webview-position","core:webview:allow-webview-close","dialog:allow-open","dialog:allow-ask","dialog:allow-message","process:allow-restart","process:allow-exit","fs:allow-read-file","core:menu:allow-new","core:menu:allow-popup","shell:allow-open","store:allow-get","store:allow-set","store:allow-delete","prevent-default:default",{"identifier":"http:default","allow":[{"url":"http://**/"},{"url":"https://**/"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"$RESOURCE/locales/*"},{"path":"$RESOURCE/resources/*"}]}],"platforms":["macOS","windows"]}} {"column":{"identifier":"column","description":"Capability for the column","local":true,"windows":["column-*"],"permissions":["core:resources:default","core:tray:default","os:allow-locale","os:allow-os-type","clipboard-manager:allow-write-text","dialog:allow-open","dialog:allow-ask","dialog:allow-message","fs:allow-read-file","core:menu:default","core:menu:allow-new","core:menu:allow-popup","http:default","shell:allow-open","store:allow-get","store:allow-set","store:allow-delete",{"identifier":"http:default","allow":[{"url":"http://**/"},{"url":"https://**/"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"$RESOURCE/locales/*"},{"path":"$RESOURCE/resources/*"}]}],"platforms":["linux","macOS","windows"]},"window":{"identifier":"window","description":"Capability for the desktop","local":true,"windows":["main","panel","settings","search-*","zap-*","event-*","user-*","editor-*"],"permissions":["core:path:default","core:event:default","core:window:default","core:app:default","core:resources:default","core:menu:default","core:tray:default","notification:allow-is-permission-granted","notification:allow-request-permission","notification:default","os:allow-locale","os:allow-platform","os:allow-os-type","updater:default","updater:allow-check","updater:allow-download-and-install","core:window:allow-create","core:window:allow-close","core:window:allow-destroy","core:window:allow-set-focus","core:window:allow-center","core:window:allow-minimize","core:window:allow-maximize","core:window:allow-set-size","core:window:allow-start-dragging","core:window:allow-toggle-maximize","decorum:allow-show-snap-overlay","clipboard-manager:allow-write-text","clipboard-manager:allow-read-text","core:webview:allow-create-webview-window","core:webview:allow-create-webview","core:webview:allow-set-webview-size","core:webview:allow-set-webview-position","core:webview:allow-webview-close","dialog:allow-open","dialog:allow-ask","dialog:allow-message","process:allow-restart","process:allow-exit","fs:allow-read-file","core:menu:allow-new","core:menu:allow-popup","shell:allow-open","store:default","prevent-default:default",{"identifier":"http:default","allow":[{"url":"http://**/"},{"url":"https://**/"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"$RESOURCE/locales/*"},{"path":"$RESOURCE/resources/*"}]}],"platforms":["macOS","windows"]}}

View File

@ -1821,72 +1821,122 @@
"properties": { "properties": {
"allow": { "allow": {
"items": { "items": {
"title": "Entry", "title": "ShellScopeEntry",
"description": "A command allowed to be executed by the webview API.", "description": "Shell scope entry.",
"type": "object", "anyOf": [
"required": [ {
"args", "type": "object",
"cmd", "required": [
"name", "cmd",
"sidecar" "name"
], ],
"properties": { "properties": {
"args": { "args": {
"description": "The allowed arguments for the command execution.", "description": "The allowed arguments for the command execution.",
"allOf": [ "allOf": [
{ {
"$ref": "#/definitions/ShellAllowedArgs" "$ref": "#/definitions/ShellScopeEntryAllowedArgs"
}
]
},
"cmd": {
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
"type": "string"
},
"name": {
"description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.",
"type": "string"
} }
] },
"additionalProperties": false
}, },
"cmd": { {
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "type": "object",
"type": "string" "required": [
}, "name",
"name": { "sidecar"
"description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", ],
"type": "string" "properties": {
}, "args": {
"sidecar": { "description": "The allowed arguments for the command execution.",
"description": "If this command is a sidecar command.", "allOf": [
"type": "boolean" {
"$ref": "#/definitions/ShellScopeEntryAllowedArgs"
}
]
},
"name": {
"description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.",
"type": "string"
},
"sidecar": {
"description": "If this command is a sidecar command.",
"type": "boolean"
}
},
"additionalProperties": false
} }
} ]
} }
}, },
"deny": { "deny": {
"items": { "items": {
"title": "Entry", "title": "ShellScopeEntry",
"description": "A command allowed to be executed by the webview API.", "description": "Shell scope entry.",
"type": "object", "anyOf": [
"required": [ {
"args", "type": "object",
"cmd", "required": [
"name", "cmd",
"sidecar" "name"
], ],
"properties": { "properties": {
"args": { "args": {
"description": "The allowed arguments for the command execution.", "description": "The allowed arguments for the command execution.",
"allOf": [ "allOf": [
{ {
"$ref": "#/definitions/ShellAllowedArgs" "$ref": "#/definitions/ShellScopeEntryAllowedArgs"
}
]
},
"cmd": {
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
"type": "string"
},
"name": {
"description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.",
"type": "string"
} }
] },
"additionalProperties": false
}, },
"cmd": { {
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "type": "object",
"type": "string" "required": [
}, "name",
"name": { "sidecar"
"description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", ],
"type": "string" "properties": {
}, "args": {
"sidecar": { "description": "The allowed arguments for the command execution.",
"description": "If this command is a sidecar command.", "allOf": [
"type": "boolean" {
"$ref": "#/definitions/ShellScopeEntryAllowedArgs"
}
]
},
"name": {
"description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.",
"type": "string"
},
"sidecar": {
"description": "If this command is a sidecar command.",
"type": "boolean"
}
},
"additionalProperties": false
} }
} ]
} }
} }
} }
@ -5394,6 +5444,11 @@
"type": "string", "type": "string",
"const": "store:allow-clear" "const": "store:allow-clear"
}, },
{
"description": "Enables the create_store command without any pre-configured scope.",
"type": "string",
"const": "store:allow-create-store"
},
{ {
"description": "Enables the delete command without any pre-configured scope.", "description": "Enables the delete command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5454,6 +5509,11 @@
"type": "string", "type": "string",
"const": "store:deny-clear" "const": "store:deny-clear"
}, },
{
"description": "Denies the create_store command without any pre-configured scope.",
"type": "string",
"const": "store:deny-create-store"
},
{ {
"description": "Denies the delete command without any pre-configured scope.", "description": "Denies the delete command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5710,7 +5770,7 @@
} }
] ]
}, },
"ShellAllowedArg": { "ShellScopeEntryAllowedArg": {
"description": "A command argument allowed to be executed by the webview API.", "description": "A command argument allowed to be executed by the webview API.",
"anyOf": [ "anyOf": [
{ {
@ -5738,18 +5798,18 @@
} }
] ]
}, },
"ShellAllowedArgs": { "ShellScopeEntryAllowedArgs": {
"description": "A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.", "description": "A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.",
"anyOf": [ "anyOf": [
{ {
"description": "Use a simple boolean to allow all or disable all arguments to this command configuration.", "description": "Use a simple boolean to allow all or disable all arguments to this command configuration.",
"type": "boolean" "type": "boolean"
}, },
{ {
"description": "A specific set of [`ShellAllowedArg`] that are valid to call for the command configuration.", "description": "A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.",
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/ShellAllowedArg" "$ref": "#/definitions/ShellScopeEntryAllowedArg"
} }
} }
] ]

View File

@ -1821,72 +1821,122 @@
"properties": { "properties": {
"allow": { "allow": {
"items": { "items": {
"title": "Entry", "title": "ShellScopeEntry",
"description": "A command allowed to be executed by the webview API.", "description": "Shell scope entry.",
"type": "object", "anyOf": [
"required": [ {
"args", "type": "object",
"cmd", "required": [
"name", "cmd",
"sidecar" "name"
], ],
"properties": { "properties": {
"args": { "args": {
"description": "The allowed arguments for the command execution.", "description": "The allowed arguments for the command execution.",
"allOf": [ "allOf": [
{ {
"$ref": "#/definitions/ShellAllowedArgs" "$ref": "#/definitions/ShellScopeEntryAllowedArgs"
}
]
},
"cmd": {
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
"type": "string"
},
"name": {
"description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.",
"type": "string"
} }
] },
"additionalProperties": false
}, },
"cmd": { {
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "type": "object",
"type": "string" "required": [
}, "name",
"name": { "sidecar"
"description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", ],
"type": "string" "properties": {
}, "args": {
"sidecar": { "description": "The allowed arguments for the command execution.",
"description": "If this command is a sidecar command.", "allOf": [
"type": "boolean" {
"$ref": "#/definitions/ShellScopeEntryAllowedArgs"
}
]
},
"name": {
"description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.",
"type": "string"
},
"sidecar": {
"description": "If this command is a sidecar command.",
"type": "boolean"
}
},
"additionalProperties": false
} }
} ]
} }
}, },
"deny": { "deny": {
"items": { "items": {
"title": "Entry", "title": "ShellScopeEntry",
"description": "A command allowed to be executed by the webview API.", "description": "Shell scope entry.",
"type": "object", "anyOf": [
"required": [ {
"args", "type": "object",
"cmd", "required": [
"name", "cmd",
"sidecar" "name"
], ],
"properties": { "properties": {
"args": { "args": {
"description": "The allowed arguments for the command execution.", "description": "The allowed arguments for the command execution.",
"allOf": [ "allOf": [
{ {
"$ref": "#/definitions/ShellAllowedArgs" "$ref": "#/definitions/ShellScopeEntryAllowedArgs"
}
]
},
"cmd": {
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
"type": "string"
},
"name": {
"description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.",
"type": "string"
} }
] },
"additionalProperties": false
}, },
"cmd": { {
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "type": "object",
"type": "string" "required": [
}, "name",
"name": { "sidecar"
"description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", ],
"type": "string" "properties": {
}, "args": {
"sidecar": { "description": "The allowed arguments for the command execution.",
"description": "If this command is a sidecar command.", "allOf": [
"type": "boolean" {
"$ref": "#/definitions/ShellScopeEntryAllowedArgs"
}
]
},
"name": {
"description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.",
"type": "string"
},
"sidecar": {
"description": "If this command is a sidecar command.",
"type": "boolean"
}
},
"additionalProperties": false
} }
} ]
} }
} }
} }
@ -5394,6 +5444,11 @@
"type": "string", "type": "string",
"const": "store:allow-clear" "const": "store:allow-clear"
}, },
{
"description": "Enables the create_store command without any pre-configured scope.",
"type": "string",
"const": "store:allow-create-store"
},
{ {
"description": "Enables the delete command without any pre-configured scope.", "description": "Enables the delete command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5454,6 +5509,11 @@
"type": "string", "type": "string",
"const": "store:deny-clear" "const": "store:deny-clear"
}, },
{
"description": "Denies the create_store command without any pre-configured scope.",
"type": "string",
"const": "store:deny-create-store"
},
{ {
"description": "Denies the delete command without any pre-configured scope.", "description": "Denies the delete command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5710,7 +5770,7 @@
} }
] ]
}, },
"ShellAllowedArg": { "ShellScopeEntryAllowedArg": {
"description": "A command argument allowed to be executed by the webview API.", "description": "A command argument allowed to be executed by the webview API.",
"anyOf": [ "anyOf": [
{ {
@ -5738,18 +5798,18 @@
} }
] ]
}, },
"ShellAllowedArgs": { "ShellScopeEntryAllowedArgs": {
"description": "A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.", "description": "A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.",
"anyOf": [ "anyOf": [
{ {
"description": "Use a simple boolean to allow all or disable all arguments to this command configuration.", "description": "Use a simple boolean to allow all or disable all arguments to this command configuration.",
"type": "boolean" "type": "boolean"
}, },
{ {
"description": "A specific set of [`ShellAllowedArg`] that are valid to call for the command configuration.", "description": "A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.",
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/ShellAllowedArg" "$ref": "#/definitions/ShellScopeEntryAllowedArg"
} }
} }
] ]

View File

@ -1,24 +1,27 @@
import { experimental_createPersister } from "@tanstack/query-persist-client-core";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { RouterProvider, createRouter } from "@tanstack/react-router"; import { RouterProvider, createRouter } from "@tanstack/react-router";
import { type } from "@tauri-apps/plugin-os"; import { type } from "@tauri-apps/plugin-os";
import { StrictMode } from "react"; import { StrictMode } from "react";
import ReactDOM from "react-dom/client"; import ReactDOM from "react-dom/client";
import { routeTree } from "./routes.gen"; // auto generated file
import type { LumeEvent } from "./system";
import "./app.css";
import { experimental_createPersister } from "@tanstack/query-persist-client-core";
import { Store } from "@tauri-apps/plugin-store";
import { newQueryStorage } from "./commons"; import { newQueryStorage } from "./commons";
import type { LumeEvent } from "./system";
import "./app.css"; // global styles
import { createStore } from "@tauri-apps/plugin-store";
import { routeTree } from "./routes.gen"; // auto generated file
const platform = type(); const platform = type();
const store = new Store(".cache"); // @ts-ignore, https://github.com/tauri-apps/plugins-workspace/pull/1860
const store = await createStore(".cache", { autoSave: 100 });
const queryClient = new QueryClient({ const queryClient = new QueryClient({
defaultOptions: { defaultOptions: {
queries: { queries: {
gcTime: 1000 * 30, gcTime: 1000 * 30,
persister: experimental_createPersister({ persister: experimental_createPersister({
storage: newQueryStorage(store), storage: newQueryStorage(store),
maxAge: 1000 * 60 * 60 * 12, // 12 hours maxAge: 1000 * 60 * 60 * 12,
}), }),
}, },
}, },

View File

@ -0,0 +1,20 @@
import type { SVGProps } from "react";
export const ReplyIcon = (props: SVGProps<SVGSVGElement>) => (
<svg
width={24}
height={24}
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path
d="M21.75 12c0-5.156-3.792-8.25-9.75-8.25S2.25 6.844 2.25 12c0 1.337.92 3.605 1.064 3.952l.038.091c.099.27.505 1.71-1.102 3.84 2.167 1.031 4.468-.664 4.468-.664 1.592.84 3.486 1.031 5.282 1.031 5.958 0 9.75-3.094 9.75-8.25z"
stroke="currentColor"
strokeWidth={1.5}
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);

View File

@ -0,0 +1,20 @@
import type { SVGProps } from "react";
export const RepostIcon = (props: SVGProps<SVGSVGElement>) => (
<svg
width={24}
height={24}
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path
d="M10.75 1.5l3.5 3.25L10.75 8m2.5 8l-3.5 3.25 3.5 3.25m-2.5-3.25H14a7.25 7.25 0 004.755-12.723M13.25 4.75H10a7.25 7.25 0 00-4.754 12.724"
stroke="currentColor"
strokeWidth={1.5}
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);

View File

@ -0,0 +1,20 @@
import type { SVGProps } from "react";
export const ZapIcon = (props: SVGProps<SVGSVGElement>) => (
<svg
width={24}
height={24}
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path
d="M3.861 11.252l4.6-8a1 1 0 01.867-.502h7.053a1 1 0 01.895 1.447l-1.303 2.606a1 1 0 00.895 1.447h2.467c.891 0 1.337 1.077.707 1.707L9.103 20.897c-.701.7-1.885.063-1.687-.908l1.235-6.039a1 1 0 00-.98-1.2H4.728a1 1 0 01-.867-1.498z"
stroke="currentColor"
strokeWidth={1.5}
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);

View File

@ -13,3 +13,8 @@ export * from "./reply";
// Global components // Global components
export * from "./note"; export * from "./note";
export * from "./user"; export * from "./user";
// Icons
export * from "./icons/reply";
export * from "./icons/repost";
export * from "./icons/zap";

View File

@ -1,10 +1,13 @@
import { cn } from "@/commons"; import { cn } from "@/commons";
import { ReplyIcon } from "@/components";
import { LumeWindow } from "@/system"; import { LumeWindow } from "@/system";
import { ShareFat } from "@phosphor-icons/react";
import * as Tooltip from "@radix-ui/react-tooltip"; import * as Tooltip from "@radix-ui/react-tooltip";
import { useNoteContext } from "../provider"; import { useNoteContext } from "../provider";
export function NoteReply({ large = false }: { large?: boolean }) { export function NoteReply({
label = false,
smol = false,
}: { label?: boolean; smol?: boolean }) {
const event = useNoteContext(); const event = useNoteContext();
return ( return (
@ -16,13 +19,13 @@ export function NoteReply({ large = false }: { large?: boolean }) {
onClick={() => LumeWindow.openEditor(event.id)} onClick={() => LumeWindow.openEditor(event.id)}
className={cn( className={cn(
"inline-flex items-center justify-center text-neutral-800 dark:text-neutral-200", "inline-flex items-center justify-center text-neutral-800 dark:text-neutral-200",
large label
? "rounded-full h-7 gap-1.5 w-20 text-sm font-medium hover:bg-black/10 dark:hover:bg-white/10" ? "rounded-full h-7 gap-1.5 w-20 text-sm font-medium hover:bg-black/10 dark:hover:bg-white/10"
: "size-7", : "size-7",
)} )}
> >
<ShareFat className="shrink-0 size-4" /> <ReplyIcon className={cn("shrink-0", smol ? "size-4" : "size-5")} />
{large ? "Reply" : null} {label ? "Reply" : null}
</button> </button>
</Tooltip.Trigger> </Tooltip.Trigger>
<Tooltip.Portal> <Tooltip.Portal>

View File

@ -1,14 +1,16 @@
import { appSettings, cn } from "@/commons"; import { appSettings, cn } from "@/commons";
import { Spinner } from "@/components"; import { RepostIcon, Spinner } from "@/components";
import { LumeWindow } from "@/system"; import { LumeWindow } from "@/system";
import { Repeat } from "@phosphor-icons/react";
import { useStore } from "@tanstack/react-store"; import { useStore } from "@tanstack/react-store";
import { Menu, MenuItem } from "@tauri-apps/api/menu"; import { Menu, MenuItem } from "@tauri-apps/api/menu";
import { message } from "@tauri-apps/plugin-dialog"; import { message } from "@tauri-apps/plugin-dialog";
import { useCallback, useState } from "react"; import { useCallback, useState } from "react";
import { useNoteContext } from "../provider"; import { useNoteContext } from "../provider";
export function NoteRepost({ large = false }: { large?: boolean }) { export function NoteRepost({
label = false,
smol = false,
}: { label?: boolean; smol?: boolean }) {
const visible = useStore(appSettings, (state) => state.display_repost_button); const visible = useStore(appSettings, (state) => state.display_repost_button);
const event = useNoteContext(); const event = useNoteContext();
@ -65,7 +67,7 @@ export function NoteRepost({ large = false }: { large?: boolean }) {
onClick={(e) => showContextMenu(e)} onClick={(e) => showContextMenu(e)}
className={cn( className={cn(
"inline-flex items-center justify-center text-neutral-800 dark:text-neutral-200", "inline-flex items-center justify-center text-neutral-800 dark:text-neutral-200",
large label
? "rounded-full h-7 gap-1.5 w-24 text-sm font-medium hover:bg-black/10 dark:hover:bg-white/10" ? "rounded-full h-7 gap-1.5 w-24 text-sm font-medium hover:bg-black/10 dark:hover:bg-white/10"
: "size-7", : "size-7",
)} )}
@ -73,9 +75,14 @@ export function NoteRepost({ large = false }: { large?: boolean }) {
{loading ? ( {loading ? (
<Spinner className="size-4" /> <Spinner className="size-4" />
) : ( ) : (
<Repeat className={cn("size-4", isRepost ? "text-blue-500" : "")} /> <RepostIcon
className={cn(
smol ? "size-4" : "size-5",
isRepost ? "text-blue-500" : "",
)}
/>
)} )}
{large ? "Repost" : null} {label ? "Repost" : null}
</button> </button>
); );
} }

View File

@ -1,11 +1,14 @@
import { appSettings, cn } from "@/commons"; import { appSettings, cn } from "@/commons";
import { ZapIcon } from "@/components";
import { LumeWindow } from "@/system"; import { LumeWindow } from "@/system";
import { Lightning } from "@phosphor-icons/react";
import { useSearch } from "@tanstack/react-router"; import { useSearch } from "@tanstack/react-router";
import { useStore } from "@tanstack/react-store"; import { useStore } from "@tanstack/react-store";
import { useNoteContext } from "../provider"; import { useNoteContext } from "../provider";
export function NoteZap({ large = false }: { large?: boolean }) { export function NoteZap({
label = false,
smol = false,
}: { label?: boolean; smol?: boolean }) {
const search = useSearch({ strict: false }); const search = useSearch({ strict: false });
const visible = useStore(appSettings, (state) => state.display_zap_button); const visible = useStore(appSettings, (state) => state.display_zap_button);
const event = useNoteContext(); const event = useNoteContext();
@ -18,13 +21,13 @@ export function NoteZap({ large = false }: { large?: boolean }) {
onClick={() => LumeWindow.openZap(event.id, search.account)} onClick={() => LumeWindow.openZap(event.id, search.account)}
className={cn( className={cn(
"inline-flex items-center justify-center text-neutral-800 dark:text-neutral-200", "inline-flex items-center justify-center text-neutral-800 dark:text-neutral-200",
large label
? "rounded-full h-7 gap-1.5 w-20 text-sm font-medium hover:bg-black/10 dark:hover:bg-white/10" ? "rounded-full h-7 gap-1.5 w-20 text-sm font-medium hover:bg-black/10 dark:hover:bg-white/10"
: "size-7", : "size-7",
)} )}
> >
<Lightning className="size-4" /> <ZapIcon className={smol ? "size-4" : "size-5"} />
{large ? "Zap" : null} {label ? "Zap" : null}
</button> </button>
); );
} }

View File

@ -99,10 +99,10 @@ export const ReplyNote = memo(function ReplyNote({
<span className="text-sm text-neutral-500"> <span className="text-sm text-neutral-500">
{replyTime(event.created_at)} {replyTime(event.created_at)}
</span> </span>
<div className="flex items-center justify-end gap-3"> <div className="flex items-center justify-end gap-5">
<Note.Reply /> <Note.Reply smol />
<Note.Repost /> <Note.Repost smol />
<Note.Zap /> <Note.Zap smol />
</div> </div>
</div> </div>
{event.replies?.length ? ( {event.replies?.length ? (
@ -180,10 +180,10 @@ function ChildReply({ event }: { event: LumeEvent }) {
<span className="text-sm text-neutral-500"> <span className="text-sm text-neutral-500">
{replyTime(event.created_at)} {replyTime(event.created_at)}
</span> </span>
<div className="invisible group-hover:visible flex items-center justify-end gap-3"> <div className="invisible group-hover:visible flex items-center justify-end gap-5">
<Note.Reply /> <Note.Reply smol />
<Note.Repost /> <Note.Repost smol />
<Note.Zap /> <Note.Zap smol />
</div> </div>
</div> </div>
{event.replies?.length ? ( {event.replies?.length ? (

View File

@ -41,7 +41,7 @@ export const RepostNote = memo(function RepostNote({
</div> </div>
<Note.Content className="px-3" /> <Note.Content className="px-3" />
<div className="flex items-center justify-between px-3 mt-3 h-14"> <div className="flex items-center justify-between px-3 mt-3 h-14">
<div className="inline-flex items-center gap-3"> <div className="inline-flex items-center gap-6">
<Note.Open /> <Note.Open />
<Note.Reply /> <Note.Reply />
<Note.Repost /> <Note.Repost />

View File

@ -23,7 +23,7 @@ export const TextNote = memo(function TextNote({
<Note.Menu /> <Note.Menu />
</div> </div>
<Note.Content className="px-3" /> <Note.Content className="px-3" />
<div className="flex items-center gap-4 px-3 mt-3 h-14"> <div className="flex items-center gap-6 px-3 mt-3 h-14">
<Note.Open /> <Note.Open />
<Note.Reply /> <Note.Reply />
<Note.Repost /> <Note.Repost />

View File

@ -82,9 +82,9 @@ function RootEvent() {
</div> </div>
<Note.ContentLarge className="px-3" /> <Note.ContentLarge className="px-3" />
<div className="flex items-center gap-2 px-3 mt-6 h-12 rounded-b-xl bg-neutral-50 dark:bg-white/5"> <div className="flex items-center gap-2 px-3 mt-6 h-12 rounded-b-xl bg-neutral-50 dark:bg-white/5">
<Note.Reply large /> <Note.Reply label />
<Note.Repost large /> <Note.Repost label />
<Note.Zap large /> <Note.Zap label />
</div> </div>
</Note.Root> </Note.Root>
</Note.Provider> </Note.Provider>

View File

@ -17,6 +17,8 @@ export const Route = createFileRoute("/")({
}); });
} }
return { accounts: accounts.filter((account) => !account.endsWith("Lume")) }; return {
accounts: accounts.filter((account) => !account.endsWith("Lume")),
};
}, },
}); });

View File

@ -19,6 +19,7 @@ export default defineConfig({
], ],
build: { build: {
outDir: "./dist", outDir: "./dist",
target: "esnext",
}, },
server: { server: {
strictPort: true, strictPort: true,