diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 9904ddc..f72cd41 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,2 @@ github: 0pandadev buy_me_a_coffee: pandadev_ -ko_fi: pandadev_ diff --git a/.github/scripts/macOS.sh b/.github/scripts/macOS.sh deleted file mode 100755 index 0800a69..0000000 --- a/.github/scripts/macOS.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -if [ -f .env ]; then - export $(cat .env | grep -v '^#' | xargs) -fi - -set -e - -required_vars=("APPLE_CERTIFICATE" "APPLE_CERTIFICATE_PASSWORD" "APPLE_ID" "APPLE_ID_PASSWORD" "KEYCHAIN_PASSWORD" "APP_BUNDLE_ID") -for var in "${required_vars[@]}"; do - if [ -z "${!var}" ]; then - exit 1 - fi -done - -bun run tauri build - -rm -f certificate.p12 -echo "$APPLE_CERTIFICATE" | base64 --decode > certificate.p12 2>/dev/null -security import certificate.p12 -P "$APPLE_CERTIFICATE_PASSWORD" -A 2>/dev/null - -SIGNING_IDENTITY=$(security find-identity -v -p codesigning | grep "Apple Development" | head -1 | awk -F '"' '{print $2}') - -if [ -z "$SIGNING_IDENTITY" ]; then - exit 1 -fi - -codesign --force --options runtime --sign "$SIGNING_IDENTITY" src-tauri/target/release/bundle/macos/*.app 2>/dev/null - -rm -f certificate.p12 - -hdiutil create -volname "Qopy" -srcfolder src-tauri/target/release/bundle/dmg -ov -format UDZO Qopy.dmg - -codesign --force --sign "$APPLE_CERTIFICATE" Qopy.dmg 2>/dev/null - -xcrun notarytool submit Qopy.dmg --apple-id "$APPLE_ID" --password "$APPLE_ID_PASSWORD" --team-id "$APPLE_CERTIFICATE" --wait - -xcrun stapler staple Qopy.dmg - -exit 0 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e4cc80..e975560 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,15 +22,14 @@ jobs: build-macos: needs: prepare - runs-on: macos-latest - timeout-minutes: 30 strategy: matrix: include: - args: "--target aarch64-apple-darwin" - arch: "arm64" + arch: "silicon" - args: "--target x86_64-apple-darwin" - arch: "x64" + arch: "intel" + runs-on: macos-latest env: APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} @@ -40,7 +39,7 @@ jobs: - name: Redact Sensitive Information run: | function redact_output { - sed -e "s/${{ secrets.APPLE_ID }}/REDACTED/g;s/${{ secrets.APPLE_ID_PASSWORD }}/REDACTED/g;s/${{ secrets.APPLE_CERTIFICATE }}/REDACTED/g;s/${{ secrets.APPLE_CERTIFICATE_PASSWORD }}/REDACTED/g;s/${{ secrets.KEYCHAIN_PASSWORD }}/REDACTED/g;s/${{ secrets.PAT }}/REDACTED/g;s/${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}/REDACTED/g" + sed -e "s/${{ secrets.REDACT_PATTERN }}/REDACTED/g" } exec > >(redact_output) 2>&1 - uses: actions/setup-node@v4 @@ -72,7 +71,6 @@ jobs: security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain security default-keychain -s build.keychain security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain - security set-keychain-settings -lut 7200 build.keychain security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain security find-identity -v -p codesigning build.keychain @@ -87,7 +85,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} - TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} + TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} APPLE_SIGNING_IDENTITY: ${{ env.CERT_ID }} with: @@ -96,43 +94,27 @@ jobs: if: failure() run: | echo "Attempting manual signing:" - timeout 300 codesign --force --options runtime --sign "$CERT_ID" --entitlements src-tauri/entitlements.plist src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/macos/Qopy.app + codesign --force --options runtime --sign "$CERT_ID" --entitlements src-tauri/entitlements.plist src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Qopy.app echo "Verifying signature:" - codesign -dv --verbose=4 "src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/macos/Qopy.app" | sed 's/.*Authority=.*/Authority=REDACTED/' - - name: Set architecture label - run: | - if [[ "${{ matrix.args }}" == "--target aarch64-apple-darwin" ]]; then - echo "ARCH_LABEL=aarch64-apple-darwin" >> $GITHUB_ENV - else - echo "ARCH_LABEL=x86_64-apple-darwin" >> $GITHUB_ENV - fi + codesign -dv --verbose=4 src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Qopy.app | sed 's/.*Authority=.*/Authority=REDACTED/' - name: Rename and Publish macOS Artifacts run: | - mv src-tauri/target/${{ env.ARCH_LABEL }}/release/bundle/dmg/*.dmg src-tauri/target/${{ env.ARCH_LABEL }}/release/bundle/dmg/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.dmg - mv src-tauri/target/${{ env.ARCH_LABEL }}/release/bundle/macos/*.app.tar.gz src-tauri/target/${{ env.ARCH_LABEL }}/release/bundle/macos/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.app.tar.gz - mv src-tauri/target/${{ env.ARCH_LABEL }}/release/bundle/macos/*.app.tar.gz.sig src-tauri/target/${{ env.ARCH_LABEL }}/release/bundle/macos/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.app.tar.gz.sig + mv src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/dmg/*.dmg src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/dmg/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.dmg + mv src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/macos/*.app.tar.gz src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/macos/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.app.tar.gz + mv src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/macos/*.app.tar.gz.sig src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/macos/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.app.tar.gz.sig - uses: actions/upload-artifact@v4 with: - name: macos-dmg-${{ matrix.arch }} - path: "src-tauri/target/${{ env.ARCH_LABEL }}/release/bundle/dmg/*.dmg" + name: build-macos-dmg-${{ matrix.arch }} + path: src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/dmg/*.dmg - uses: actions/upload-artifact@v4 with: - name: updater-macos-${{ matrix.arch }} + name: updater-files-macos-${{ matrix.arch }} path: | - src-tauri/target/${{ env.ARCH_LABEL }}/release/bundle/macos/*.app.tar.gz - src-tauri/target/${{ env.ARCH_LABEL }}/release/bundle/macos/*.app.tar.gz.sig + src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/macos/*.app.tar.gz + src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/macos/*.app.tar.gz.sig build-windows: needs: prepare - strategy: - matrix: - include: - - args: "--target x86_64-pc-windows-msvc" - arch: "x64" - target: "x86_64-pc-windows-msvc" - - args: "--target aarch64-pc-windows-msvc" - arch: "arm64" - target: "aarch64-pc-windows-msvc" runs-on: windows-latest env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} @@ -142,8 +124,6 @@ jobs: with: node-version: 20 - uses: dtolnay/rust-toolchain@stable - with: - targets: x86_64-pc-windows-msvc,aarch64-pc-windows-msvc - uses: swatinem/rust-cache@v2 with: workspaces: "src-tauri -> target" @@ -160,32 +140,20 @@ jobs: - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - args: ${{ matrix.args }} - - name: List Bundle Directory - shell: pwsh - run: | - Write-Output "Checking build directories..." - Get-ChildItem -Path "src-tauri/target" -Recurse -Directory | Where-Object { $_.Name -eq "msi" } | ForEach-Object { - Write-Output "Found MSI directory: $($_.FullName)" - Get-ChildItem -Path $_.FullName -Filter "*.msi" | ForEach-Object { - Write-Output "Found MSI file: $($_.FullName)" - } - } - name: Rename and Publish Windows Artifacts run: | - mv src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi src-tauri/target/${{ matrix.target }}/release/bundle/msi/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.msi - mv src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi.sig src-tauri/target/${{ matrix.target }}/release/bundle/msi/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.msi.sig + mv src-tauri/target/release/bundle/msi/*.msi src-tauri/target/release/bundle/msi/Qopy-${{ needs.prepare.outputs.version }}.msi + mv src-tauri/target/release/bundle/msi/*.msi.sig src-tauri/target/release/bundle/msi/Qopy-${{ needs.prepare.outputs.version }}.msi.sig - uses: actions/upload-artifact@v4 with: - name: windows-${{ matrix.arch }} - path: src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi + name: build-windows-msi + path: src-tauri/target/release/bundle/msi/*.msi - uses: actions/upload-artifact@v4 with: - name: updater-windows-${{ matrix.arch }} - path: | - src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi - src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi.sig + name: updater-files-windows + path: | + src-tauri/target/release/bundle/msi/*.msi + src-tauri/target/release/bundle/msi/*.msi.sig build-ubuntu: needs: prepare @@ -198,8 +166,6 @@ jobs: with: node-version: 20 - uses: dtolnay/rust-toolchain@stable - with: - targets: x86_64-unknown-linux-gnu - uses: swatinem/rust-cache@v2 with: workspaces: "src-tauri -> target" @@ -212,38 +178,36 @@ jobs: key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm- - - name: Install dependencies + - name: install dependencies run: | sudo apt update - sudo apt install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev rpm + sudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV - run: npm install -g pnpm && pnpm install - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - args: --target x86_64-unknown-linux-gnu - - name: Rename Linux Artifacts + - name: Rename and Publish Ubuntu Artifacts run: | - mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/Qopy-${{ needs.prepare.outputs.version }}.deb - mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/Qopy-${{ needs.prepare.outputs.version }}.AppImage - mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage.sig src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/Qopy-${{ needs.prepare.outputs.version }}.AppImage.sig - mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/*.rpm src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/Qopy-${{ needs.prepare.outputs.version }}.rpm + mv src-tauri/target/release/bundle/deb/*.deb src-tauri/target/release/bundle/deb/Qopy-${{ needs.prepare.outputs.version }}.deb + mv src-tauri/target/release/bundle/appimage/*.AppImage src-tauri/target/release/bundle/appimage/Qopy-${{ needs.prepare.outputs.version }}.AppImage + mv src-tauri/target/release/bundle/appimage/*.AppImage.sig src-tauri/target/release/bundle/appimage/Qopy-${{ needs.prepare.outputs.version }}.AppImage.sig + mv src-tauri/target/release/bundle/rpm/*.rpm src-tauri/target/release/bundle/rpm/Qopy-${{ needs.prepare.outputs.version }}.rpm - uses: actions/upload-artifact@v4 with: - name: ubuntu-deb - path: src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb + name: build-ubuntu-deb + path: src-tauri/target/release/bundle/deb/*.deb - uses: actions/upload-artifact@v4 with: - name: ubuntu-appimage - path: src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage + name: build-ubuntu-appimage + path: src-tauri/target/release/bundle/appimage/*.AppImage - uses: actions/upload-artifact@v4 with: - name: ubuntu-rpm - path: src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/*.rpm + name: build-ubuntu-rpm + path: src-tauri/target/release/bundle/rpm/*.rpm - uses: actions/upload-artifact@v4 with: - name: updater-ubuntu + name: updater-files-ubuntu path: | - src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage - src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage.sig \ No newline at end of file + src-tauri/target/release/bundle/appimage/*.AppImage + src-tauri/target/release/bundle/appimage/*.AppImage.sig diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index b3c8847..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,325 +0,0 @@ -name: "Release" - -on: - push: - tags: - - "v*" - workflow_dispatch: - -jobs: - prepare: - permissions: write-all - runs-on: ubuntu-latest - outputs: - version: ${{ steps.get_version.outputs.VERSION }} - steps: - - uses: actions/checkout@v4 - - name: Get version - id: get_version - run: | - VERSION=$(node -p 'require("./src-tauri/tauri.conf.json").version') - echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - - build-macos: - permissions: write-all - needs: prepare - strategy: - matrix: - include: - - args: "--target aarch64-apple-darwin" - arch: "silicon" - - args: "--target x86_64-apple-darwin" - arch: "intel" - runs-on: macos-latest - env: - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} - TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} - steps: - - uses: actions/checkout@v4 - - name: Redact Sensitive Information - run: | - function redact_output { - sed -e "s/${{ secrets.REDACT_PATTERN }}/REDACTED/g" - } - exec > >(redact_output) 2>&1 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - uses: dtolnay/rust-toolchain@stable - with: - targets: aarch64-apple-darwin,x86_64-apple-darwin - - uses: swatinem/rust-cache@v2 - with: - workspaces: "src-tauri -> target" - cache-directories: "~/.cargo/registry/index/,~/.cargo/registry/cache/,~/.cargo/git/db/" - shared-key: "macos-rust-cache" - save-if: "true" - - uses: actions/cache@v4 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm- - - run: npm install -g pnpm && pnpm install - - name: Import Apple Developer Certificate - env: - APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} - APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} - KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - run: | - echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12 - security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain - security default-keychain -s build.keychain - security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain - security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign - security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain - - uses: tauri-apps/tauri-action@v0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} - APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} - TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} - TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - with: - args: ${{ matrix.args }} - - - name: Rename macOS Artifacts - run: | - mv src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/dmg/*.dmg src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/dmg/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.dmg - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: macos-${{ matrix.arch }}-binaries - path: | - src-tauri/target/**/release/bundle/dmg/*.dmg - - build-windows: - permissions: write-all - needs: prepare - strategy: - matrix: - include: - - args: "--target x86_64-pc-windows-msvc" - arch: "x64" - target: "x86_64-pc-windows-msvc" - - args: "--target aarch64-pc-windows-msvc" - arch: "arm64" - target: "aarch64-pc-windows-msvc" - runs-on: windows-latest - env: - TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - uses: dtolnay/rust-toolchain@stable - with: - targets: x86_64-pc-windows-msvc,aarch64-pc-windows-msvc - - uses: swatinem/rust-cache@v2 - with: - workspaces: "src-tauri -> target" - cache-directories: "~/.cargo/registry/index/,~/.cargo/registry/cache/,~/.cargo/git/db/" - shared-key: "windows-rust-cache" - save-if: "true" - - uses: actions/cache@v4 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm- - - run: npm install -g pnpm && pnpm install - - uses: tauri-apps/tauri-action@v0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - args: ${{ matrix.args }} - - name: List Bundle Directory - shell: pwsh - run: | - $bundlePath = "src-tauri/target/${{ matrix.target }}/release/bundle/msi" - if (Test-Path $bundlePath) { - Write-Output "Contents of ${bundlePath}:" - Get-ChildItem -Path $bundlePath - } else { - Write-Output "Path ${bundlePath} does not exist." - } - - name: Rename Windows Artifacts - shell: pwsh - run: | - $bundlePath = "src-tauri/target/${{ matrix.target }}/release/bundle/msi" - $version = "${{ needs.prepare.outputs.version }}" - $arch = "${{ matrix.arch }}" - if (Test-Path $bundlePath) { - $msiFiles = Get-ChildItem -Path "$bundlePath/*.msi" - foreach ($file in $msiFiles) { - $newName = "Qopy-$version`_$arch.msi" - Rename-Item -Path $file.FullName -NewName $newName - } - } else { - Write-Error "Path ${bundlePath} does not exist." - exit 1 - } - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: windows-${{ matrix.arch }}-binaries - path: src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi - - build-linux: - permissions: write-all - needs: prepare - runs-on: ubuntu-latest - env: - TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - uses: dtolnay/rust-toolchain@stable - - uses: swatinem/rust-cache@v2 - with: - workspaces: "src-tauri -> target" - cache-directories: "~/.cargo/registry/index/,~/.cargo/registry/cache/,~/.cargo/git/db/" - shared-key: "linux-rust-cache" - save-if: "true" - - uses: actions/cache@v4 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm- - - name: Install dependencies - run: | - sudo apt update - sudo apt install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev rpm - echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV - - run: npm install -g pnpm && pnpm install - - name: Generate Changelog - id: changelog - run: | - CHANGELOG=$(git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"- %s") - echo "CHANGELOG<> $GITHUB_ENV - echo "$CHANGELOG" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - uses: tauri-apps/tauri-action@v0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - args: --target x86_64-unknown-linux-gnu - - name: Rename Linux Artifacts - run: | - mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/Qopy-${{ needs.prepare.outputs.version }}.deb - mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/Qopy-${{ needs.prepare.outputs.version }}.AppImage - mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/*.rpm src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/Qopy-${{ needs.prepare.outputs.version }}.rpm - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: linux-binaries - path: | - src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb - src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage - src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/*.rpm - - create-release: - permissions: write-all - needs: [prepare, build-macos, build-windows, build-linux] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.PAT }} - - - name: Check if release already exists - id: check_release - run: | - VERSION="${{ needs.prepare.outputs.version }}" - RELEASE_EXISTS=$(gh release view v$VERSION --json id --jq '.id' 2>/dev/null || echo "") - if [ -n "$RELEASE_EXISTS" ]; then - echo "SKIP_RELEASE=true" >> $GITHUB_ENV - else - echo "SKIP_RELEASE=false" >> $GITHUB_ENV - fi - env: - GITHUB_TOKEN: ${{ secrets.PAT }} - - - name: Download all artifacts - if: env.SKIP_RELEASE == 'false' - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Update CHANGELOG - if: env.SKIP_RELEASE == 'false' - id: changelog - uses: requarks/changelog-action@v1 - with: - token: ${{ github.token }} - tag: ${{ github.ref_name }} - - - name: Generate Release Body - if: env.SKIP_RELEASE == 'false' - id: release_body - run: | - VERSION="${{ needs.prepare.outputs.version }}" - - # Calculate hashes with corrected paths - WINDOWS_ARM_HASH=$(sha256sum "artifacts/windows-arm64-binaries/Qopy-${VERSION}_arm64.msi" | awk '{ print $1 }') - WINDOWS_64_HASH=$(sha256sum "artifacts/windows-x64-binaries/Qopy-${VERSION}_x64.msi" | awk '{ print $1 }') - MAC_SILICON_HASH=$(sha256sum "artifacts/macos-silicon-binaries/aarch64-apple-darwin/release/bundle/dmg/Qopy-${VERSION}_silicon.dmg" | awk '{ print $1 }') - MAC_INTEL_HASH=$(sha256sum "artifacts/macos-intel-binaries/x86_64-apple-darwin/release/bundle/dmg/Qopy-${VERSION}_intel.dmg" | awk '{ print $1 }') - DEBIAN_HASH=$(sha256sum "artifacts/linux-binaries/deb/Qopy-${VERSION}.deb" | awk '{ print $1 }') - APPIMAGE_HASH=$(sha256sum "artifacts/linux-binaries/appimage/Qopy-${VERSION}.AppImage" | awk '{ print $1 }') - REDHAT_HASH=$(sha256sum "artifacts/linux-binaries/rpm/Qopy-${VERSION}.rpm" | awk '{ print $1 }') - - # Debug output - echo "Calculated hashes:" - echo "Windows ARM: $WINDOWS_ARM_HASH" - echo "Windows x64: $WINDOWS_64_HASH" - echo "Mac Silicon: $MAC_SILICON_HASH" - echo "Mac Intel: $MAC_INTEL_HASH" - echo "Debian: $DEBIAN_HASH" - echo "AppImage: $APPIMAGE_HASH" - echo "Red Hat: $REDHAT_HASH" - - RELEASE_BODY=$(cat <<-EOF - - ${{ needs.create-release.outputs.changelog }} - - ## ⬇️ Downloads - - - [Windows (x64)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_x64.msi) - ${WINDOWS_64_HASH} - - [Windows (ARM64)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_arm64.msi) - ${WINDOWS_ARM_HASH} - - [macOS (Silicon)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_silicon.dmg) - ${MAC_SILICON_HASH} - - [macOS (Intel)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_intel.dmg) - ${MAC_INTEL_HASH} - - [Debian](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}.deb) - ${DEBIAN_HASH} - - [AppImage](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}.AppImage) - ${APPIMAGE_HASH} - - [Red Hat](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}.rpm) - ${REDHAT_HASH} - EOF - ) - - echo "RELEASE_BODY<> $GITHUB_ENV - echo "$RELEASE_BODY" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - - name: Create Release - if: env.SKIP_RELEASE == 'false' - uses: softprops/action-gh-release@v2 - env: - GITHUB_TOKEN: ${{ secrets.PAT }} - with: - draft: true - tag_name: v${{ needs.prepare.outputs.version }} - name: v${{ needs.prepare.outputs.version }} - files: | - artifacts/**/*.dmg - artifacts/**/*.msi - artifacts/**/*.deb - artifacts/**/*.AppImage - artifacts/**/*.rpm - body: ${{ env.RELEASE_BODY }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1e5c576..c000981 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,3 @@ logs bun.lockb .gitignore .vscode -bun.lock \ No newline at end of file diff --git a/GET_STARTED.md b/GET_STARTED.md index a793041..3807b7f 100644 --- a/GET_STARTED.md +++ b/GET_STARTED.md @@ -1,18 +1,17 @@ # Get Started -The default hotkey for Qopy is Windows+V which is also the hotkey for the default clipboard manager to turn that off follow [this guide](https://github.com/0PandaDEV/Qopy/blob/main/GET_STARTED.md#disable-windowsv-for-default-clipboard-manager). +The hotkey for Qopy is Windows+V which is also the hotkey for the default clipboard manager to turn that off follow [this guide](https://github.com/0PandaDEV/Qopy/blob/main/GET_STARTED.md#disable-windowsv-for-default-clipboard-manager). -All the data of Qopy is stored inside of a SQLite database. +All the data of Qopy is stored inside of a SQLite database. The location for the file differs for windows and linux. -| Operating System | Path | -|------------------|-----------------------------------------------------------------| -| Windows | `C:\Users\USERNAME\AppData\Roaming\net.pandadev.qopy` | -| macOS | `/Users/USERNAME/Library/Application Support/net.pandadev.qopy` | -| Linux | `/home/USERNAME/.local/share/net.pandadev.qopy` | +| Operating System | Path | +|------------------|-------------------------------------------------------| +| Windows | `C:\Users\USERNAME\AppData\Roaming\net.pandadev.qopy` | +| Linux | `` | ## Disable Windows+V for default clipboard manager - +https://github.com/user-attachments/assets/723f9e07-3190-46ec-9bb7-15dfc112f620 To disable the default clipboard manager popup from windows open Command prompt and run this command diff --git a/LICENSE b/LICENSE index 0ad25db..f288702 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies @@ -7,15 +7,17 @@ Preamble - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. + The GNU General Public License is a free, copyleft license for +software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to +the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free -software for all its users. +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you @@ -24,34 +26,44 @@ them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. @@ -60,7 +72,7 @@ modification follow. 0. Definitions. - "This License" refers to version 3 of the GNU Affero General Public License. + "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. @@ -537,45 +549,35 @@ to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. + 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single +under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General +Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published +GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's +versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. @@ -633,29 +635,40 @@ the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + GNU General Public License for more details. - You should have received a copy of the GNU Affero General Public License + You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see +For more information on this, and how to apply and follow the GNU GPL, see . + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md index 9e4f2d2..9b0067e 100644 --- a/README.md +++ b/README.md @@ -5,35 +5,24 @@ The fixed and simple clipboard manager for both Windows and Linux. - - Windows (x64) - -• - - Windows (arm64) - -
- - Linux (deb) - -• - - Linux (rpm) - -• - - Linux (AppImage) - -
- - macOS (Silicon) - -• - - macOS (Intel) - -
-
+ + + + + + + + +
Download for + + Windows + + + + Linux + +
+ Nightly releases can be found here @@ -46,9 +35,10 @@ The fixed and simple clipboard manager for both Windows and Linux.
Star History - + - + +
@@ -59,28 +49,22 @@ The fixed and simple clipboard manager for both Windows and Linux. Qopy is a fixed clipboard manager designed as a simple alternative to the standard clipboard on Windows. It aims to provide a faster, more reliable experience while providing an extensive set of features compared to its Windows counterpart. +🍎 macOS is currently not supported due to a library that is not compatible. + ## 🚧 Roadmap -- [x] [Setup guide](https://github.com/0PandaDEV/Qopy/blob/main/GET_STARTED.md) -- [ ] Sync Clipboard across devices https://github.com/0PandaDEV/Qopy/issues/8 -- [x] Settings https://github.com/0PandaDEV/Qopy/issues/2 -- [x] Metadata for copied items https://github.com/0PandaDEV/Qopy/issues/5 +- [ ] [Setup guide](https://github.com/0PandaDEV/Qopy/blob/main/GET_STARTED.md) +- [ ] Settings https://github.com/0PandaDEV/Qopy/issues/2 +- [ ] Option for custom keybind https://github.com/0PandaDEV/Qopy/issues/3 +- [ ] Metadata for copied items https://github.com/0PandaDEV/Qopy/issues/5 - [ ] Code highlighting https://github.com/0PandaDEV/Qopy/issues/7 - [ ] Streamshare integration https://github.com/0PandaDEV/Qopy/issues/4 -- [ ] Content type filter https://github.com/0PandaDEV/Qopy/issues/16 -- [ ] Preview for copied files https://github.com/0PandaDEV/Qopy/issues/15 -- [ ] Convert files to other formats https://github.com/0PandaDEV/Qopy/issues/17 -- [x] Option for custom keybind https://github.com/0PandaDEV/Qopy/issues/3 -- [x] macOS Support https://github.com/0PandaDEV/Qopy/issues/13 +- [ ] Cross-device clipboard sharing https://github.com/0PandaDEV/Qopy/issues/8 If you have ideas for features to include, please write a feature request [here](https://github.com/0pandadev/Qopy/issues). -## 📦 Concepts - -Here you can see a few concepts these might not be implemented: - -![Clipboard](https://github.com/user-attachments/assets/45a44a13-6ebd-4f2d-84d2-55178e303a54) -![Settings](https://github.com/user-attachments/assets/bff5456a-f413-4e62-a43d-22c8e453aa87) - +## 📦 Preview + + ## ❤️ Donations & Support @@ -94,13 +78,13 @@ You can use GitHub Codespaces for online development: [![][codespaces-shield]][codespaces-link] -Or to get Qopy set up on your machine, you'll need to have Rust and bun installed. Then, follow these steps: +Or to get Qopy set up on your machine, you'll need to have Rust and pnpm installed. Then, follow these steps: ```zsh git clone https://github.com/0pandadev/Qopy.git cd Qopy -bun i -bun dev +pnpm i +pnpm dev ``` > \[!TIP] @@ -112,7 +96,7 @@ bun dev To build for production simply execute: ```zsh -bun build +pnpm build ``` > \[!NOTE] @@ -123,7 +107,7 @@ bun build ## 📝 License -Qopy is licensed under AGPL-3. See the [LICENSE file](./LICENCE) for more information. +Qopy is licensed under GPL-3. See the [LICENSE file](./LICENCE) for more information. [codespaces-link]: https://codespaces.new/0pandadev/Qopy [codespaces-shield]: https://github.com/codespaces/badge.svg diff --git a/README_ru.md b/README_ru.md deleted file mode 100644 index e9f63ad..0000000 --- a/README_ru.md +++ /dev/null @@ -1,130 +0,0 @@ -
- - -

Qopy

- -Простой и исправленный менеджер буфера обмена как для Windows, так и для Linux. - - - Windows (x64) - -• - - Windows (arm64) - -
- - Linux (deb) - -• - - Linux (rpm) - -• - - Linux (AppImage) - -
- - macOS (Silicon) - -• - - macOS (Intel) - -
-
-Тестовые версии можно найти тут - -
- -[discord »](https://discord.gg/invite/Y7SbYphVw9) - -> \[!IMPORTANT] -> -> **Нажав на звезду**, Вы будете получать все уведомления от Github о новых версиях без задержек \~ ⭐️ - -
- Star History - - - - - - -
- -[![wakatime](https://wakatime.com/badge/user/018ce503-097f-4057-9599-db20b190920c/project/fe76359d-56c2-4a13-8413-55207b6ad298.svg?style=flat_square)](https://wakatime.com/badge/user/018ce503-097f-4057-9599-db20b190920c/project/fe76359d-56c2-4a13-8413-55207b6ad298) - -## 📋 Что такое Qopy - -Qopy представляет собой исправленный менеджер буфера обмена, разработанный как простая альтернатива стандартному буферу обмена в Windows. Его цель - обеспечить более быструю и надежную работу, предоставляя при этом обширный набор функций по сравнению со своим аналогом в Windows. - -## 🚧 Дорожная карта -- [ ] [Руководство по установке](https://github.com/0PandaDEV/Qopy/blob/main/GET_STARTED.md) -- [ ] Синхронизация буфера обмена между устройствами https://github.com/0PandaDEV/Qopy/issues/8 -- [ ] Настройки https://github.com/0PandaDEV/Qopy/issues/2 -- [x] Метаданные для скопированных элементов https://github.com/0PandaDEV/Qopy/issues/5 -- [ ] Выделение кода https://github.com/0PandaDEV/Qopy/issues/7 -- [ ] Интеграция Streamshare https://github.com/0PandaDEV/Qopy/issues/4 -- [ ] Фильтр типов контента https://github.com/0PandaDEV/Qopy/issues/16 -- [ ] Превью для скопированных файлов https://github.com/0PandaDEV/Qopy/issues/15 -- [ ] Конвертация файлов в другие форматы https://github.com/0PandaDEV/Qopy/issues/17 -- [x] Опция для пользовательской привязки клавиш https://github.com/0PandaDEV/Qopy/issues/3 -- [x] Поддержка macOS https://github.com/0PandaDEV/Qopy/issues/13 - -Если у вас есть идеи для функций, которые можно добавить в будущем, пожалуйста, напишите об этом [здесь](https://github.com/0pandadev/Qopy/issues). - -## 📦 Концепты - -Здесь вы можете увидеть несколько концепцов, которые могут быть не реализованы: - -![Clipboard](https://github.com/user-attachments/assets/45a44a13-6ebd-4f2d-84d2-55178e303a54) -![Settings](https://github.com/user-attachments/assets/bff5456a-f413-4e62-a43d-22c8e453aa87) - - -## ❤️ Пожертвования и Поддержка - -Qopy имеет открытый исходный код и бесплатен для использования. Я ценю пожертвования в поддержку постоянной разработки и улучшений. Ваши взносы являются добровольными и помогают мне улучшить приложение для всех. - - - -## ⌨️ Локальная разработка - -Вы можете использовать GitHub Codespaces для онлайн-разработки: - -[![][codespaces-shield]][codespaces-link] - -Или, чтобы настроить Qopy на вашем компьютере, вам необходимо установить Rust и bun. Затем выполните следующие действия: - -```zsh -git clone https://github.com/0pandadev/Qopy.git -cd Qopy -bun i -bun dev -``` - -> \[!Tip] -> -> Если вы заинтересованы во внесении кода, не стесняйтесь смотреть здесь [Issues](https://github.com/0pandadev/Qopy/issues). - -## 🔨 Сборка для продакшена - -Чтобы собрать для продакшена,просто выполните: - -```zsh -bun build -``` - -> \[!NOTE] -> -> Не волнуйтесь, в конце произойдет сбой, потому что он не сможет обнаружить Приватный ключ, но установочные файлы будут сгенерированы независимо от этого. -> -> Вы можете найти его в `src-tauri/target/release/bundle`. - -## 📝 Лицензия - -Qopy лицензирован под GPL-3. Смотрите [LICENSE file](./LICENCE) для дополнительной информации. - -[codespaces-link]: https://codespaces.new/0pandadev/Qopy -[codespaces-shield]: https://github.com/codespaces/badge.svg diff --git a/app.vue b/app.vue index 6b9f531..a54b0c0 100644 --- a/app.vue +++ b/app.vue @@ -1,107 +1,77 @@ + \ No newline at end of file diff --git a/assets/css/index.scss b/assets/css/index.scss new file mode 100644 index 0000000..3390c53 --- /dev/null +++ b/assets/css/index.scss @@ -0,0 +1,300 @@ +$primary: #2E2D2B; +$accent: #FEB453; +$divider: #ffffff0d; + +$text: #E5DFD5; +$text2: #ADA9A1; +$mutedtext: #78756F; + +.bg { + width: 750px; + height: 474px; + background-color: $primary; + border: 1px solid $divider; + border-radius: 12px; + z-index: -1; + position: fixed; + outline: none; +} + +.search { + width: 100%; + position: fixed; + top: 0; + left: 0; + height: 54px; + background-color: transparent; + outline: none; + border: none; + font-size: 18px; + color: $mutedtext; + padding-inline: 16px; + border-bottom: 1px solid $divider; + font-family: SFRoundedMedium; +} + +.results { + position: absolute; + width: 284px; + top: 53px; + left: 0; + height: calc(100vh - 95px); + border-right: 1px solid $divider; + display: flex; + flex-direction: column; + padding-inline: 8px; + padding-bottom: 8px; + overflow-y: auto; + overflow-x: hidden; + + .result { + height: 40px; + font-size: 14px; + align-items: center; + display: flex; + padding: 10px; + padding-inline: 10px; + letter-spacing: 0.5px; + gap: 10px; + overflow: hidden; + text-overflow: clip; + white-space: nowrap; + } + + .result { + cursor: pointer; + + &.selected { + background-color: $divider; + } + } + + .time-separator { + font-size: 12px; + color: $text2; + font-family: SFRoundedSemiBold; + padding-left: 8px; + padding-bottom: 8px; + padding-top: 14px; + } + + .favicon { + width: 18px; + height: 18px; + } + + .image { + width: 18px; + height: 18px; + } + + .icon { + width: 20px; + height: 18px; + } +} + +.content { + position: absolute; + top: 53px; + left: 284px; + padding: 8px; + height: calc(100vh - 96px); + font-family: CommitMono !important; + font-size: 14px; + letter-spacing: 1; + border-radius: 10px; + width: calc(100vw - 286px); + white-space: pre-wrap; + word-wrap: break-word; + + div { + border-radius: 10px; + font-family: CommitMono !important; + } + + .full-image { + width: 100%; + aspect-ratio: 16 / 9; + object-fit: cover; + object-position: center; + } + + .image { + max-width: 100%; + max-height: 100%; + object-fit: contain; + object-position: top left; + } +} + +.bottom-bar { + height: 40px; + width: calc(100vw - 2px); + backdrop-filter: blur(18px); + background-color: hsla(40, 3%, 16%, 0.8); + position: fixed; + bottom: 1px; + left: 1px; + z-index: 100; + border-radius: 0 0 12px 12px; + display: flex; + flex-direction: row; + justify-content: space-between; + padding-inline: 12px; + padding-right: 6px; + padding-top: 1px; + align-items: center; + font-size: 14px; + border-top: 1px solid $divider; + + p { + color: $text2; + } + + .left { + display: flex; + align-items: center; + gap: 8px; + + .logo { + width: 18px; + height: 18px; + } + } + + .right { + display: flex; + align-items: center; + + .paste p { + color: $text; + } + + .actions div { + display: flex; + align-items: center; + gap: 2px; + } + + .divider { + width: 2px; + height: 12px; + background-color: $divider; + margin-left: 8px; + margin-right: 4px; + transition: all .2s; + } + + .paste, + .actions { + padding: 4px; + padding-left: 8px; + display: flex; + align-items: center; + gap: 8px; + border-radius: 7px; + background-color: transparent; + transition: all .2s; + cursor: pointer; + } + + .paste:hover, + .actions:hover { + background-color: $divider; + } + + &:hover .paste:hover~.divider, + &:hover .actions:hover~.divider { + opacity: 0; + } + } +} + +.clothoid-corner { + clip-path: polygon(13.890123px 0px, + calc(100% - 13.890123px) 0px, + calc(100% - 12.723414px) 0.004211px, + calc(100% - 11.556933px) 0.025635px, + calc(100% - 10.391895px) 0.085062px, + calc(100% - 9.231074px) 0.199291px, + calc(100% - 8.079275px) 0.382298px, + calc(100% - 6.947448px) 0.662609px, + calc(100% - 5.844179px) 1.039291px, + calc(100% - 4.793324px) 1.542842px, + calc(100% - 3.811369px) 2.169728px, + calc(100% - 2.926417px) 2.926417px, + calc(100% - 2.169728px) 3.811369px, + calc(100% - 1.542842px) 4.793324px, + calc(100% - 1.039291px) 5.844179px, + calc(100% - 0.662609px) 6.947448px, + calc(100% - 0.382298px) 8.079275px, + calc(100% - 0.199291px) 9.231074px, + calc(100% - 0.085062px) 10.391895px, + calc(100% - 0.025635px) 11.556933px, + calc(100% - 0.004211px) 12.723414px, + 100% 13.890123px, + 100% calc(100% - 13.890123px), + calc(100% - 0.004211px) calc(100% - 12.723414px), + calc(100% - 0.025635px) calc(100% - 11.556933px), + calc(100% - 0.085062px) calc(100% - 10.391895px), + calc(100% - 0.199291px) calc(100% - 9.231074px), + calc(100% - 0.382298px) calc(100% - 8.079275px), + calc(100% - 0.662609px) calc(100% - 6.947448px), + calc(100% - 1.039291px) calc(100% - 5.844179px), + calc(100% - 1.542842px) calc(100% - 4.793324px), + calc(100% - 2.169728px) calc(100% - 3.811369px), + calc(100% - 2.926417px) calc(100% - 2.926417px), + calc(100% - 3.811369px) calc(100% - 2.169728px), + calc(100% - 4.793324px) calc(100% - 1.542842px), + calc(100% - 5.844179px) calc(100% - 1.039291px), + calc(100% - 6.947448px) calc(100% - 0.662609px), + calc(100% - 8.079275px) calc(100% - 0.382298px), + calc(100% - 9.231074px) calc(100% - 0.199291px), + calc(100% - 10.391895px) calc(100% - 0.085062px), + calc(100% - 11.556933px) calc(100% - 0.025635px), + calc(100% - 12.723414px) calc(100% - 0.004211px), + calc(100% - 13.890123px) 100%, + 13.890123px 100%, + 12.723414px calc(100% - 0.004211px), + 11.556933px calc(100% - 0.025635px), + 10.391895px calc(100% - 0.085062px), + 9.231074px calc(100% - 0.199291px), + 8.079275px calc(100% - 0.382298px), + 6.947448px calc(100% - 0.662609px), + 5.844179px calc(100% - 1.039291px), + 4.793324px calc(100% - 1.542842px), + 3.811369px calc(100% - 2.169728px), + 2.926417px calc(100% - 2.926417px), + 2.169728px calc(100% - 3.811369px), + 1.542842px calc(100% - 4.793324px), + 1.039291px calc(100% - 5.844179px), + 0.662609px calc(100% - 6.947448px), + 0.382298px calc(100% - 8.079275px), + 0.199291px calc(100% - 9.231074px), + 0.085062px calc(100% - 10.391895px), + 0.025635px calc(100% - 11.556933px), + 0.004211px calc(100% - 12.723414px), + 0px calc(100% - 13.890123px), + 0px 13.890123px, + 0.004211px 12.723414px, + 0.025635px 11.556933px, + 0.085062px 10.391895px, + 0.199291px 9.231074px, + 0.382298px 8.079275px, + 0.662609px 6.947448px, + 1.039291px 5.844179px, + 1.542842px 4.793324px, + 2.169728px 3.811369px, + 2.926417px 2.926417px, + 3.811369px 2.169728px, + 4.793324px 1.542842px, + 5.844179px 1.039291px, + 6.947448px 0.662609px, + 8.079275px 0.382298px, + 9.231074px 0.199291px, + 10.391895px 0.085062px, + 11.556933px 0.025635px, + 12.723414px 0.004211px, + 13.890123px 0px); +} \ No newline at end of file diff --git a/assets/css/keybind.scss b/assets/css/keybind.scss new file mode 100644 index 0000000..c3ad9d4 --- /dev/null +++ b/assets/css/keybind.scss @@ -0,0 +1,149 @@ +$primary: #2E2D2B; +$accent: #FEB453; +$divider: #ffffff0d; + +$text: #E5DFD5; +$text2: #ADA9A1; +$mutedtext: #78756F; + +.bg { + width: 750px; + height: 474px; + background-color: $primary; + border: 1px solid $divider; + border-radius: 12px; + z-index: -1; + position: fixed; + outline: none; +} + +.back { + position: absolute; + top: 16px; + left: 16px; + display: flex; + gap: 8px; + align-items: center; + + img{ + background-color: $divider; + border-radius: 6px; + padding: 8px 6px; + } + + p { + color: $text2; + } +} + +.keybind-container { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100vh; + gap: 6px; + + .title { + font-size: 20px; + font-weight: 800; + } + + .keybind-input { + padding: 6px; + border: 1px solid $divider; + color: $text2; + display: flex; + border-radius: 13px; + outline: none; + gap: 6px; + + .key { + color: $text2; + font-family: SFRoundedMedium; + background-color: $divider; + padding: 6px 8px; + border-radius: 8px; + } + } + + .keybind-input:focus { + border: 1px solid rgba(255, 255, 255, 0.2); + } +} + +.bottom-bar { + height: 40px; + width: calc(100vw - 2px); + backdrop-filter: blur(18px); + background-color: hsla(40, 3%, 16%, 0.8); + position: fixed; + bottom: 1px; + left: 1px; + z-index: 100; + border-radius: 0 0 12px 12px; + display: flex; + flex-direction: row; + justify-content: space-between; + padding-inline: 12px; + padding-right: 6px; + padding-top: 1px; + align-items: center; + font-size: 14px; + border-top: 1px solid $divider; + + p { + color: $text2; + } + + .left { + display: flex; + align-items: center; + gap: 8px; + + .logo { + width: 18px; + height: 18px; + } + } + + .right { + display: flex; + align-items: center; + + .actions div { + display: flex; + align-items: center; + gap: 2px; + } + + .divider { + width: 2px; + height: 12px; + background-color: $divider; + margin-left: 8px; + margin-right: 4px; + transition: all .2s; + } + + .actions { + padding: 4px; + padding-left: 8px; + display: flex; + align-items: center; + gap: 8px; + border-radius: 7px; + background-color: transparent; + transition: all .2s; + cursor: pointer; + } + + .actions:hover { + background-color: $divider; + } + + &:hover .actions:hover~.divider { + opacity: 0; + } + } +} \ No newline at end of file diff --git a/fonts/CommitMono.woff2 b/assets/fonts/CommitMono.woff2 similarity index 100% rename from fonts/CommitMono.woff2 rename to assets/fonts/CommitMono.woff2 diff --git a/fonts/SFRoundedMedium.otf b/assets/fonts/SFRoundedMedium.otf similarity index 100% rename from fonts/SFRoundedMedium.otf rename to assets/fonts/SFRoundedMedium.otf diff --git a/fonts/SFRoundedRegular.otf b/assets/fonts/SFRoundedRegular.otf similarity index 100% rename from fonts/SFRoundedRegular.otf rename to assets/fonts/SFRoundedRegular.otf diff --git a/fonts/SFRoundedSemiBold.otf b/assets/fonts/SFRoundedSemiBold.otf similarity index 100% rename from fonts/SFRoundedSemiBold.otf rename to assets/fonts/SFRoundedSemiBold.otf diff --git a/components/BottomBar.vue b/components/BottomBar.vue deleted file mode 100644 index 2ec32ed..0000000 --- a/components/BottomBar.vue +++ /dev/null @@ -1,124 +0,0 @@ - - - - - diff --git a/components/Icons/Cmd.vue b/components/Icons/Cmd.vue deleted file mode 100644 index 7b18f3e..0000000 --- a/components/Icons/Cmd.vue +++ /dev/null @@ -1,39 +0,0 @@ - diff --git a/components/Icons/Code.vue b/components/Icons/Code.vue deleted file mode 100644 index 975d5c2..0000000 --- a/components/Icons/Code.vue +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/components/Icons/Ctrl.vue b/components/Icons/Ctrl.vue deleted file mode 100644 index 60163bd..0000000 --- a/components/Icons/Ctrl.vue +++ /dev/null @@ -1,32 +0,0 @@ - diff --git a/components/Icons/Enter.vue b/components/Icons/Enter.vue deleted file mode 100644 index e6e50a0..0000000 --- a/components/Icons/Enter.vue +++ /dev/null @@ -1,41 +0,0 @@ - diff --git a/components/Icons/File.vue b/components/Icons/File.vue deleted file mode 100644 index 1f64eba..0000000 --- a/components/Icons/File.vue +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/components/Icons/Image.vue b/components/Icons/Image.vue deleted file mode 100644 index ed67dbe..0000000 --- a/components/Icons/Image.vue +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/components/Icons/K.vue b/components/Icons/K.vue deleted file mode 100644 index 8bdc675..0000000 --- a/components/Icons/K.vue +++ /dev/null @@ -1,29 +0,0 @@ - diff --git a/components/Icons/Link.vue b/components/Icons/Link.vue deleted file mode 100644 index 2036f60..0000000 --- a/components/Icons/Link.vue +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/components/Icons/Text.vue b/components/Icons/Text.vue deleted file mode 100644 index 3b9eb2d..0000000 --- a/components/Icons/Text.vue +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/components/Noise.vue b/components/Noise.vue index 9be572c..41bb879 100644 --- a/components/Noise.vue +++ b/components/Noise.vue @@ -6,18 +6,16 @@ .noise { position: absolute; overflow: hidden; - top: 1px; - left: 1px; - width: calc(100vw - 2px); - height: calc(100vh - 2px); + top: 0; + left: 0; + width: 100vw; + height: 100vh; pointer-events: none; user-select: none; - background-image: url("/noise.webp"); + z-index: 0; + background-image: url('/noise.png'); background-repeat: repeat; image-rendering: pixelated; overflow: hidden; - mix-blend-mode: multiply; - opacity: .5; - border-radius: 12px; } - + \ No newline at end of file diff --git a/components/Result.vue b/components/Result.vue deleted file mode 100644 index 515f9f1..0000000 --- a/components/Result.vue +++ /dev/null @@ -1,122 +0,0 @@ - - - - - diff --git a/components/TopBar.vue b/components/TopBar.vue deleted file mode 100644 index 91924ec..0000000 --- a/components/TopBar.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - - - diff --git a/lib/selectedResult.ts b/lib/selectedResult.ts deleted file mode 100644 index e53411b..0000000 --- a/lib/selectedResult.ts +++ /dev/null @@ -1,54 +0,0 @@ -import type { HistoryItem } from '~/types/types' - -interface GroupedHistory { - label: string - items: HistoryItem[] -} - -export const selectedGroupIndex = ref(0) -export const selectedItemIndex = ref(0) -export const selectedElement = ref(null) - -export const useSelectedResult = (groupedHistory: Ref) => { - const selectedItem = computed(() => { - const group = groupedHistory.value[selectedGroupIndex.value] - return group?.items[selectedItemIndex.value] ?? null - }) - - const isSelected = (groupIndex: number, itemIndex: number): boolean => { - return selectedGroupIndex.value === groupIndex && selectedItemIndex.value === itemIndex - } - - const selectNext = (): void => { - const currentGroup = groupedHistory.value[selectedGroupIndex.value] - if (selectedItemIndex.value < currentGroup.items.length - 1) { - selectedItemIndex.value++ - } else if (selectedGroupIndex.value < groupedHistory.value.length - 1) { - selectedGroupIndex.value++ - selectedItemIndex.value = 0 - } - } - - const selectPrevious = (): void => { - if (selectedItemIndex.value > 0) { - selectedItemIndex.value-- - } else if (selectedGroupIndex.value > 0) { - selectedGroupIndex.value-- - selectedItemIndex.value = groupedHistory.value[selectedGroupIndex.value].items.length - 1 - } - } - - const selectItem = (groupIndex: number, itemIndex: number): void => { - selectedGroupIndex.value = groupIndex - selectedItemIndex.value = itemIndex - } - - return { - selectedItem, - isSelected, - selectNext, - selectPrevious, - selectItem, - selectedElement - } -} \ No newline at end of file diff --git a/nuxt.config.ts b/nuxt.config.ts index b10de45..071a2b2 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -3,13 +3,6 @@ export default defineNuxtConfig({ devtools: { enabled: false }, compatibilityDate: "2024-07-04", ssr: false, - app: { - head: { - charset: "utf-8", - viewport: - "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0", - }, - }, vite: { css: { preprocessorOptions: { diff --git a/package.json b/package.json index 2dbe25d..2ace70a 100644 --- a/package.json +++ b/package.json @@ -10,19 +10,17 @@ "postinstall": "nuxt prepare" }, "dependencies": { - "@tauri-apps/api": "2.3.0", - "@tauri-apps/cli": "2.3.1", - "@tauri-apps/plugin-autostart": "2.2.0", - "@tauri-apps/plugin-os": "2.2.1", - "nuxt": "3.16.0", - "overlayscrollbars": "2.11.1", + "@tauri-apps/api": "2.1.1", + "@tauri-apps/cli": "2.1.0", + "@tauri-apps/plugin-autostart": "2.0.0", + "@tauri-apps/plugin-fs": "2.0.2", + "@tauri-apps/plugin-os": "2.0.0", + "@tauri-apps/plugin-sql": "2.0.1", + "nuxt": "3.14.159", + "nuxt-build-cache": "0.1.1", + "overlayscrollbars": "2.10.0", "overlayscrollbars-vue": "0.5.9", - "sass-embedded": "1.85.1", - "uuid": "11.1.0", - "vue": "3.5.13", - "wrdu-keyboard": "github:0PandaDEV/keyboard" - }, - "overrides": { - "chokidar": "^3.6.0" + "sass": "1.81.0", + "vue": "3.5.12" } } diff --git a/pages/index.vue b/pages/index.vue index 0accd10..fd456d2 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1,595 +1,378 @@ +@use '~/assets/css/index.scss'; + \ No newline at end of file diff --git a/pages/keybind.vue b/pages/keybind.vue new file mode 100644 index 0000000..c097a2e --- /dev/null +++ b/pages/keybind.vue @@ -0,0 +1,176 @@ + + + + + \ No newline at end of file diff --git a/pages/settings.vue b/pages/settings.vue deleted file mode 100644 index f67a52b..0000000 --- a/pages/settings.vue +++ /dev/null @@ -1,232 +0,0 @@ - - - - - diff --git a/plugins/history.ts b/plugins/history.ts deleted file mode 100644 index 2bd84c2..0000000 --- a/plugins/history.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { invoke } from "@tauri-apps/api/core"; -import type { HistoryItem } from "~/types/types"; - -export default defineNuxtPlugin(() => { - return { - provide: { - history: { - async getHistory(): Promise { - return await invoke("get_history"); - }, - - async addHistoryItem(item: HistoryItem): Promise { - await invoke("add_history_item", { item }); - }, - - async searchHistory(query: string): Promise { - try { - return await invoke("search_history", { query }); - } catch (error) { - console.error("Error searching history:", error); - return []; - } - }, - - async loadHistoryChunk( - offset: number, - limit: number - ): Promise { - try { - return await invoke("load_history_chunk", { - offset, - limit, - }); - } catch (error) { - console.error("Error loading history chunk:", error); - return []; - } - }, - - async deleteHistoryItem(id: string): Promise { - await invoke("delete_history_item", { id }); - }, - - async clearHistory(): Promise { - await invoke("clear_history"); - }, - - async writeAndPaste(data: { - content: string; - contentType: string; - }): Promise { - await invoke("write_and_paste", data); - }, - - async readImage(data: { filename: string }): Promise { - return await invoke("read_image", data); - }, - }, - }, - }; -}); diff --git a/plugins/settings.ts b/plugins/settings.ts deleted file mode 100644 index 8e2fcf2..0000000 --- a/plugins/settings.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { invoke } from "@tauri-apps/api/core"; - -export default defineNuxtPlugin(() => { - return { - provide: { - settings: { - async getSetting(key: string): Promise { - return await invoke("get_setting", { key }); - }, - - async saveSetting(key: string, value: string): Promise { - await invoke("save_setting", { key, value }); - }, - }, - }, - }; -}); diff --git a/public/apple.png b/public/apple.png deleted file mode 100644 index f9bd6d9..0000000 Binary files a/public/apple.png and /dev/null differ diff --git a/public/cmd.svg b/public/cmd.svg new file mode 100644 index 0000000..fc2ea77 --- /dev/null +++ b/public/cmd.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/ctrl.svg b/public/ctrl.svg new file mode 100644 index 0000000..91c0d68 --- /dev/null +++ b/public/ctrl.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/public/enter.svg b/public/enter.svg new file mode 100644 index 0000000..7ede06c --- /dev/null +++ b/public/enter.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/icons/Code.svg b/public/icons/Code.svg new file mode 100644 index 0000000..b5c1a42 --- /dev/null +++ b/public/icons/Code.svg @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/public/icons/File.svg b/public/icons/File.svg new file mode 100644 index 0000000..a0b4fdd --- /dev/null +++ b/public/icons/File.svg @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/public/icons/Image.svg b/public/icons/Image.svg new file mode 100644 index 0000000..c177239 --- /dev/null +++ b/public/icons/Image.svg @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/public/icons/Text.svg b/public/icons/Text.svg new file mode 100644 index 0000000..83f8532 --- /dev/null +++ b/public/icons/Text.svg @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/public/k.svg b/public/k.svg new file mode 100644 index 0000000..64eb413 --- /dev/null +++ b/public/k.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/public/noise.png b/public/noise.png new file mode 100644 index 0000000..2a0223e Binary files /dev/null and b/public/noise.png differ diff --git a/public/noise.webp b/public/noise.webp deleted file mode 100644 index b0e8845..0000000 Binary files a/public/noise.webp and /dev/null differ diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index add115b..65205ee 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -17,6 +17,18 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -74,40 +86,11 @@ version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" -[[package]] -name = "applications" -version = "0.3.0" -source = "git+https://github.com/HuakunShen/applications-rs?branch=fix/win-app-detection#ddcec7cdc3cc4f6678f1b1b525b3e509987b21ae" -dependencies = [ - "anyhow", - "cocoa 0.25.0", - "core-foundation 0.9.4", - "env_logger", - "glob", - "image", - "ini", - "lnk", - "log", - "objc", - "parselnk", - "plist", - "regex", - "serde", - "serde_derive", - "serde_json", - "tauri-icns", - "thiserror 1.0.63", - "walkdir", - "winapi", - "windows-icons", - "winreg 0.52.0", -] - [[package]] name = "arbitrary" -version = "1.4.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" dependencies = [ "derive_arbitrary", ] @@ -381,21 +364,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - [[package]] name = "bit_field" version = "0.10.2" @@ -410,9 +378,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "serde", ] @@ -438,41 +406,13 @@ dependencies = [ "generic-array", ] -[[package]] -name = "block-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" -dependencies = [ - "objc-sys", -] - -[[package]] -name = "block2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e58aa60e59d8dbfcc36138f5f18be5f24394d33b38b24f7fd0b1caa33095f22f" -dependencies = [ - "block-sys", - "objc2 0.5.2", -] - [[package]] name = "block2" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" dependencies = [ - "objc2 0.5.2", -] - -[[package]] -name = "block2" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d59b4c170e16f0405a2e95aff44432a0d41aa97675f3d52623effe95792a037" -dependencies = [ - "objc2 0.6.0", + "objc2", ] [[package]] @@ -509,17 +449,6 @@ dependencies = [ "alloc-stdlib", ] -[[package]] -name = "bstr" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" -dependencies = [ - "lazy_static", - "memchr", - "regex-automata 0.1.10", -] - [[package]] name = "built" version = "0.7.4" @@ -565,7 +494,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "cairo-sys-rs", "glib", "libc", @@ -604,37 +533,36 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.19.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8769706aad5d996120af43197bf46ef6ad0fda35216b4505f926a365a232d924" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", "semver", "serde", "serde_json", - "thiserror 2.0.3", + "thiserror 1.0.63", ] [[package]] name = "cargo_toml" -version = "0.21.0" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" +checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719" dependencies = [ "serde", - "toml", + "toml 0.8.2", ] [[package]] name = "cc" -version = "1.2.16" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" dependencies = [ "jobserver", "libc", - "shlex", ] [[package]] @@ -678,17 +606,15 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.40" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", - "js-sys", "num-traits", "serde", - "wasm-bindgen", - "windows-link", + "windows-targets 0.52.6", ] [[package]] @@ -699,9 +625,9 @@ checksum = "bd61885ce9f906c60f40d384b132fed04685f51d3da3576d27b8e4f274b6100d" dependencies = [ "clipboard-win", "image", - "objc2 0.5.2", - "objc2-app-kit 0.2.2", - "objc2-foundation 0.2.2", + "objc2", + "objc2-app-kit", + "objc2-foundation", "x11rb", ] @@ -738,7 +664,7 @@ checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" dependencies = [ "bitflags 1.3.2", "block", - "cocoa-foundation", + "cocoa-foundation 0.1.2", "core-foundation 0.9.4", "core-graphics 0.23.2", "foreign-types 0.5.0", @@ -746,6 +672,22 @@ dependencies = [ "objc", ] +[[package]] +name = "cocoa" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79398230a6e2c08f5c9760610eb6924b52aa9e7950a619602baba59dcbbdbb2" +dependencies = [ + "bitflags 2.6.0", + "block", + "cocoa-foundation 0.2.0", + "core-foundation 0.10.0", + "core-graphics 0.24.0", + "foreign-types 0.5.0", + "libc", + "objc", +] + [[package]] name = "cocoa-foundation" version = "0.1.2" @@ -760,6 +702,20 @@ dependencies = [ "objc", ] +[[package]] +name = "cocoa-foundation" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14045fb83be07b5acf1c0884b2180461635b433455fa35d1cd6f17f1450679d" +dependencies = [ + "bitflags 2.6.0", + "block", + "core-foundation 0.10.0", + "core-graphics-types 0.2.0", + "libc", + "objc", +] + [[package]] name = "color_quant" version = "1.1.0" @@ -785,12 +741,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "configparser" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe1d7dcda7d1da79e444bdfba1465f2f849a58b07774e1df473ee77030cb47a7" - [[package]] name = "const-oid" version = "0.9.6" @@ -898,7 +848,7 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "core-foundation 0.10.0", "core-graphics-types 0.2.0", "foreign-types 0.5.0", @@ -922,7 +872,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "core-foundation 0.10.0", "libc", ] @@ -999,9 +949,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.21" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -1125,9 +1075,9 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.4.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", @@ -1170,11 +1120,11 @@ dependencies = [ [[package]] name = "dirs" -version = "6.0.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "dirs-sys 0.5.0", + "dirs-sys 0.4.1", ] [[package]] @@ -1184,20 +1134,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", - "redox_users 0.4.5", + "redox_users", "winapi", ] [[package]] name = "dirs-sys" -version = "0.5.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", "option-ext", - "redox_users 0.5.0", - "windows-sys 0.59.0", + "redox_users", + "windows-sys 0.48.0", ] [[package]] @@ -1223,7 +1173,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.6", + "libloading", ] [[package]] @@ -1308,14 +1258,14 @@ dependencies = [ [[package]] name = "embed-resource" -version = "3.0.2" +version = "2.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fbc6e0d8e0c03a655b53ca813f0463d2c956bc4db8138dbc89f120b066551e3" +checksum = "4edcacde9351c33139a41e3c97eb2334351a81a2791bebb0b243df837128f602" dependencies = [ "cc", "memchr", "rustc_version", - "toml", + "toml 0.8.2", "vswhom", "winreg 0.52.0", ] @@ -1362,19 +1312,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "env_logger" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" -dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -1519,12 +1456,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foldhash" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" - [[package]] name = "foreign-types" version = "0.3.2" @@ -1586,26 +1517,11 @@ dependencies = [ "new_debug_unreachable", ] -[[package]] -name = "futures" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - [[package]] name = "futures-channel" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1613,15 +1529,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1641,9 +1557,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -1660,9 +1576,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", @@ -1671,23 +1587,22 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ - "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -1829,9 +1744,9 @@ dependencies = [ [[package]] name = "gethostname" -version = "1.0.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fd4b8790c0792e3b11895efdf5f289ebe8b59107a6624f1cce68f24ff8c7035" +checksum = "dc3655aa6818d65bc620d6911f05aa7b6aeb596291e1e9f79e52df85583d1e30" dependencies = [ "rustix", "windows-targets 0.52.6", @@ -1859,18 +1774,6 @@ dependencies = [ "wasi 0.11.0+wasi-snapshot-preview1", ] -[[package]] -name = "getrandom" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets 0.52.6", -] - [[package]] name = "gif" version = "0.13.1" @@ -1925,7 +1828,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "futures-channel", "futures-core", "futures-executor", @@ -1949,7 +1852,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" dependencies = [ "heck 0.4.1", - "proc-macro-crate 2.0.0", + "proc-macro-crate 2.0.2", "proc-macro-error", "proc-macro2", "quote", @@ -1968,23 +1871,23 @@ dependencies = [ [[package]] name = "glob" -version = "0.3.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "global-hotkey" -version = "0.6.4" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fbb3a4e56c901ee66c190fdb3fa08344e6d09593cc6c61f8eb9add7144b271" +checksum = "b00d88f1be7bf4cd2e61623ce08e84be2dfa4eab458e5d632d3dab95f16c1f64" dependencies = [ "crossbeam-channel", "keyboard-types", - "objc2 0.6.0", - "objc2-app-kit 0.3.0", + "objc2", + "objc2-app-kit", "once_cell", "serde", - "thiserror 2.0.3", + "thiserror 1.0.63", "windows-sys 0.59.0", "x11-dl", ] @@ -2092,25 +1995,18 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hashbrown" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ + "ahash", "allocator-api2", - "equivalent", - "foldhash", ] [[package]] name = "hashlink" -version = "0.10.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ - "hashbrown 0.15.2", + "hashbrown 0.14.5", ] [[package]] @@ -2137,12 +2033,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" -[[package]] -name = "hermit-abi" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbd780fe5cc30f81464441920d82ac8740e2e46b29a6fad543ddd075229ce37e" - [[package]] name = "hex" version = "0.4.3" @@ -2230,12 +2120,6 @@ version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" -[[package]] -name = "humantime" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" - [[package]] name = "hyper" version = "1.4.1" @@ -2292,9 +2176,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" dependencies = [ "bytes", "futures-channel", @@ -2305,6 +2189,7 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", + "tower", "tower-service", "tracing", ] @@ -2334,24 +2219,14 @@ dependencies = [ [[package]] name = "ico" -version = "0.4.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc50b891e4acf8fe0e71ef88ec43ad82ee07b3810ad09de10f1d01f072ed4b98" +checksum = "e3804960be0bb5e4edb1e1ad67afd321a9ecfd875c3e65c099468fd2717d7cae" dependencies = [ "byteorder", "png", ] -[[package]] -name = "icrate" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb69199826926eb864697bddd27f73d9fddcffc004f5733131e15b465e30642" -dependencies = [ - "block2 0.4.0", - "objc2 0.5.2", -] - [[package]] name = "icu_collections" version = "1.5.0" @@ -2536,25 +2411,6 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44feda355f4159a7c757171a77de25daf6411e217b4cabd03bd6650690468126" -[[package]] -name = "include_dir" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" -dependencies = [ - "include_dir_macros", -] - -[[package]] -name = "include_dir_macros" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" -dependencies = [ - "proc-macro2", - "quote", -] - [[package]] name = "indexmap" version = "1.9.3" @@ -2579,20 +2435,20 @@ dependencies = [ [[package]] name = "infer" -version = "0.19.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7" +checksum = "bc150e5ce2330295b8616ce0e3f53250e53af31759a9dbedad1621ba29151847" dependencies = [ "cfb", ] [[package]] -name = "ini" -version = "1.3.0" +name = "instant" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a9271a5dfd4228fa56a78d7508a35c321639cc71f783bb7a5723552add87bce" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ - "configparser", + "cfg-if", ] [[package]] @@ -2612,17 +2468,6 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" -[[package]] -name = "is-terminal" -version = "0.4.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" -dependencies = [ - "hermit-abi 0.5.0", - "libc", - "windows-sys 0.59.0", -] - [[package]] name = "itertools" version = "0.12.1" @@ -2634,9 +2479,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.14.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -2715,11 +2560,10 @@ checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ - "once_cell", "wasm-bindgen", ] @@ -2751,7 +2595,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "serde", "unicode-segmentation", ] @@ -2804,15 +2648,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" dependencies = [ "gtk-sys", - "libloading 0.7.4", + "libloading", "once_cell", ] [[package]] name = "libc" -version = "0.2.169" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libfuzzer-sys" @@ -2835,16 +2679,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "libloading" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" -dependencies = [ - "cfg-if", - "windows-targets 0.48.5", -] - [[package]] name = "libm" version = "0.2.8" @@ -2857,7 +2691,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "libc", "redox_syscall 0.5.3", ] @@ -2885,20 +2719,6 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" -[[package]] -name = "lnk" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e066ce29d4da51727b57c404c1270e3fa2a5ded0db1a4cb67c61f7a132421b2c" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "chrono", - "log", - "num-derive 0.3.3", - "num-traits", -] - [[package]] name = "lock_api" version = "0.4.12" @@ -2911,9 +2731,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.26" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "loop9" @@ -2953,18 +2773,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "markup5ever_rcdom" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9521dd6750f8e80ee6c53d65e2e4656d7de37064f3a7a5d2d11d05df93839c2" -dependencies = [ - "html5ever", - "markup5ever", - "tendril", - "xml5ever", -] - [[package]] name = "matches" version = "0.1.10" @@ -3006,18 +2814,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "meta_fetcher" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9da2f9745ec127e7852cb4ee6d4ab6c7125e029b7a69db6010b1fe538b77cb" -dependencies = [ - "anyhow", - "select", - "texting_robots", - "ureq", -] - [[package]] name = "mime" version = "0.3.17" @@ -3060,22 +2856,21 @@ dependencies = [ [[package]] name = "muda" -version = "0.16.1" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de14a9b5d569ca68d7c891d613b390cf5ab4f851c77aaa2f9e435555d3d9492" +checksum = "b8123dfd4996055ac9b15a60ad263b44b01e539007523ad7a4a533a3d93b0591" dependencies = [ "crossbeam-channel", "dpi", "gtk", "keyboard-types", - "objc2 0.6.0", - "objc2-app-kit 0.3.0", - "objc2-core-foundation", - "objc2-foundation 0.3.0", + "objc2", + "objc2-app-kit", + "objc2-foundation", "once_cell", "png", "serde", - "thiserror 2.0.3", + "thiserror 1.0.63", "windows-sys 0.59.0", ] @@ -3102,7 +2897,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "jni-sys", "log", "ndk-sys", @@ -3138,7 +2933,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "cfg-if", "libc", "memoffset", @@ -3199,17 +2994,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-derive" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "num-derive" version = "0.4.2" @@ -3277,7 +3061,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 2.0.2", "proc-macro2", "quote", "syn 2.0.87", @@ -3297,6 +3081,9 @@ name = "objc-sys" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" +dependencies = [ + "cc", +] [[package]] name = "objc2" @@ -3308,60 +3095,44 @@ dependencies = [ "objc2-encode", ] -[[package]] -name = "objc2" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3531f65190d9cff863b77a99857e74c314dd16bf56c538c4b57c7cbc3f3a6e59" -dependencies = [ - "objc2-encode", - "objc2-exception-helper", -] - [[package]] name = "objc2-app-kit" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "bitflags 2.8.0", - "block2 0.5.1", + "bitflags 2.6.0", + "block2", "libc", - "objc2 0.5.2", - "objc2-core-data 0.2.2", - "objc2-core-image 0.2.2", - "objc2-foundation 0.2.2", - "objc2-quartz-core 0.2.2", -] - -[[package]] -name = "objc2-app-kit" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5906f93257178e2f7ae069efb89fbd6ee94f0592740b5f8a1512ca498814d0fb" -dependencies = [ - "bitflags 2.8.0", - "block2 0.6.0", - "libc", - "objc2 0.6.0", - "objc2-cloud-kit", - "objc2-core-data 0.3.0", - "objc2-core-foundation", - "objc2-core-graphics", - "objc2-core-image 0.3.0", - "objc2-foundation 0.3.0", - "objc2-quartz-core 0.3.0", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", ] [[package]] name = "objc2-cloud-kit" -version = "0.3.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c1948a9be5f469deadbd6bcb86ad7ff9e47b4f632380139722f7d9840c0d42c" +checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" dependencies = [ - "bitflags 2.8.0", - "objc2 0.6.0", - "objc2-foundation 0.3.0", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + +[[package]] +name = "objc2-contacts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", ] [[package]] @@ -3370,43 +3141,10 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "bitflags 2.8.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", -] - -[[package]] -name = "objc2-core-data" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f860f8e841f6d32f754836f51e6bc7777cd7e7053cf18528233f6811d3eceb4" -dependencies = [ - "bitflags 2.8.0", - "objc2 0.6.0", - "objc2-foundation 0.3.0", -] - -[[package]] -name = "objc2-core-foundation" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daeaf60f25471d26948a1c2f840e3f7d86f4109e3af4e8e4b5cd70c39690d925" -dependencies = [ - "bitflags 2.8.0", - "objc2 0.6.0", -] - -[[package]] -name = "objc2-core-graphics" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dca602628b65356b6513290a21a6405b4d4027b8b250f0b98dddbb28b7de02" -dependencies = [ - "bitflags 2.8.0", - "objc2 0.6.0", - "objc2-core-foundation", - "objc2-io-surface", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", ] [[package]] @@ -3415,36 +3153,29 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", + "block2", + "objc2", + "objc2-foundation", "objc2-metal", ] [[package]] -name = "objc2-core-image" -version = "0.3.0" +name = "objc2-core-location" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ffa6bea72bf42c78b0b34e89c0bafac877d5f80bf91e159a5d96ea7f693ca56" +checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" dependencies = [ - "objc2 0.6.0", - "objc2-foundation 0.3.0", + "block2", + "objc2", + "objc2-contacts", + "objc2-foundation", ] [[package]] name = "objc2-encode" -version = "4.1.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" - -[[package]] -name = "objc2-exception-helper" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a" -dependencies = [ - "cc", -] +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" [[package]] name = "objc2-foundation" @@ -3452,35 +3183,23 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.8.0", - "block2 0.5.1", + "bitflags 2.6.0", + "block2", "dispatch", "libc", - "objc2 0.5.2", + "objc2", ] [[package]] -name = "objc2-foundation" -version = "0.3.0" +name = "objc2-link-presentation" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a21c6c9014b82c39515db5b396f91645182611c97d24637cf56ac01e5f8d998" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" dependencies = [ - "bitflags 2.8.0", - "block2 0.6.0", - "libc", - "objc2 0.6.0", - "objc2-core-foundation", -] - -[[package]] -name = "objc2-io-surface" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "161a8b87e32610086e1a7a9e9ec39f84459db7b3a0881c1f16ca5a2605581c19" -dependencies = [ - "bitflags 2.8.0", - "objc2 0.6.0", - "objc2-core-foundation", + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", ] [[package]] @@ -3489,22 +3208,10 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.8.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", -] - -[[package]] -name = "objc2-osa-kit" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6788b04a18ea31e3dc3ab256b8546639e5bbae07c1a0dc4ea8615252bc6aee9a" -dependencies = [ - "bitflags 2.8.0", - "objc2 0.5.2", - "objc2-app-kit 0.2.2", - "objc2-foundation 0.2.2", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", ] [[package]] @@ -3513,48 +3220,79 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.8.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation 0.2.2", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", "objc2-metal", ] [[package]] -name = "objc2-quartz-core" -version = "0.3.0" +name = "objc2-symbols" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb3794501bb1bee12f08dcad8c61f2a5875791ad1c6f47faa71a0f033f20071" +checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" dependencies = [ - "bitflags 2.8.0", - "objc2 0.6.0", - "objc2-foundation 0.3.0", + "objc2", + "objc2-foundation", ] [[package]] name = "objc2-ui-kit" -version = "0.3.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777a571be14a42a3990d4ebedaeb8b54cd17377ec21b92e8200ac03797b3bee1" +checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ - "bitflags 2.8.0", - "objc2 0.6.0", - "objc2-core-foundation", - "objc2-foundation 0.3.0", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-image", + "objc2-core-location", + "objc2-foundation", + "objc2-link-presentation", + "objc2-quartz-core", + "objc2-symbols", + "objc2-uniform-type-identifiers", + "objc2-user-notifications", +] + +[[package]] +name = "objc2-uniform-type-identifiers" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", ] [[package]] name = "objc2-web-kit" -version = "0.3.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b717127e4014b0f9f3e8bba3d3f2acec81f1bde01f656823036e823ed2c94dce" +checksum = "68bc69301064cebefc6c4c90ce9cba69225239e4b8ff99d445a2b5563797da65" dependencies = [ - "bitflags 2.8.0", - "block2 0.6.0", - "objc2 0.6.0", - "objc2-app-kit 0.3.0", - "objc2-core-foundation", - "objc2-foundation 0.3.0", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", ] [[package]] @@ -3568,17 +3306,17 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde51589ab56b20a6f686b2c68f7a0bd6add753d697abf720d63f8db3ab7b1ad" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.71" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "cfg-if", "foreign-types 0.3.2", "libc", @@ -3606,9 +3344,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.106" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -3634,29 +3372,15 @@ dependencies = [ [[package]] name = "os_info" -version = "3.9.2" +version = "3.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e6520c8cc998c5741ee68ec1dc369fc47e5f0ea5320018ecf2a1ccd6328f48b" +checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" dependencies = [ "log", "serde", "windows-sys 0.52.0", ] -[[package]] -name = "osakit" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35366a452fce3f8947eb2f33226a133aaf0cacedef2af67ade348d58be7f85d0" -dependencies = [ - "icrate", - "objc2-foundation 0.2.2", - "objc2-osa-kit", - "serde", - "serde_json", - "thiserror 1.0.63", -] - [[package]] name = "pango" version = "0.18.3" @@ -3711,19 +3435,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "parselnk" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0088616e6efe53ab79907b9313f4743eb3f8a16eb1e0014af810164808906dc3" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "chrono", - "thiserror 1.0.63", - "widestring", -] - [[package]] name = "paste" version = "1.0.15" @@ -3879,6 +3590,26 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "pin-project-lite" version = "0.2.14" @@ -3982,7 +3713,7 @@ version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "zerocopy 0.7.35", + "zerocopy", ] [[package]] @@ -4003,10 +3734,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" dependencies = [ + "toml_datetime", "toml_edit 0.20.2", ] @@ -4079,20 +3811,13 @@ dependencies = [ [[package]] name = "qopy" -version = "0.4.0" +version = "0.2.0" dependencies = [ - "applications", "base64 0.22.1", - "chrono", - "glob", "global-hotkey", "image", - "include_dir", "lazy_static", - "log", - "meta_fetcher", - "parking_lot", - "rand 0.9.0", + "rand 0.8.5", "rdev", "regex", "reqwest", @@ -4102,7 +3827,6 @@ dependencies = [ "sqlx", "tauri", "tauri-build", - "tauri-plugin-aptabase", "tauri-plugin-autostart", "tauri-plugin-clipboard", "tauri-plugin-dialog", @@ -4115,7 +3839,6 @@ dependencies = [ "time", "tokio", "url", - "uuid", ] [[package]] @@ -4224,17 +3947,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "rand" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" -dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.0", - "zerocopy 0.8.14", -] - [[package]] name = "rand_chacha" version = "0.2.2" @@ -4255,16 +3967,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.0", -] - [[package]] name = "rand_core" version = "0.5.1" @@ -4283,16 +3985,6 @@ dependencies = [ "getrandom 0.2.15", ] -[[package]] -name = "rand_core" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff" -dependencies = [ - "getrandom 0.3.1", - "zerocopy 0.8.14", -] - [[package]] name = "rand_hc" version = "0.2.0" @@ -4332,7 +4024,7 @@ dependencies = [ "maybe-rayon", "new_debug_unreachable", "noop_proc_macro", - "num-derive 0.4.2", + "num-derive", "num-traits", "once_cell", "paste", @@ -4418,7 +4110,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", ] [[package]] @@ -4432,17 +4124,6 @@ dependencies = [ "thiserror 1.0.63", ] -[[package]] -name = "redox_users" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" -dependencies = [ - "getrandom 0.2.15", - "libredox", - "thiserror 2.0.3", -] - [[package]] name = "regex" version = "1.11.1" @@ -4451,16 +4132,10 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata", "regex-syntax", ] -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" - [[package]] name = "regex-automata" version = "0.4.8" @@ -4480,9 +4155,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.14" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e327e510263980e231de548a33e63d34962d29ae61b467389a1a09627a254" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "base64 0.22.1", "bytes", @@ -4519,7 +4194,6 @@ dependencies = [ "tokio-native-tls", "tokio-rustls", "tokio-util", - "tower", "tower-service", "url", "wasm-bindgen", @@ -4537,15 +4211,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8af382a047821a08aa6bfc09ab0d80ff48d45d8726f7cd8e44891f7cb4a4278e" dependencies = [ "ashpd", - "block2 0.5.1", + "block2", "glib-sys", "gobject-sys", "gtk-sys", "js-sys", "log", - "objc2 0.5.2", - "objc2-app-kit 0.2.2", - "objc2-foundation 0.2.2", + "objc2", + "objc2-app-kit", + "objc2-foundation", "raw-window-handle", "wasm-bindgen", "wasm-bindgen-futures", @@ -4561,14 +4235,15 @@ checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" [[package]] name = "ring" -version = "0.17.14" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", "getrandom 0.2.15", "libc", + "spin", "untrusted", "windows-sys 0.52.0", ] @@ -4620,7 +4295,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -4633,7 +4308,6 @@ version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ - "log", "once_cell", "ring", "rustls-pki-types", @@ -4744,7 +4418,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "core-foundation 0.9.4", "core-foundation-sys 0.8.7", "libc", @@ -4761,17 +4435,6 @@ dependencies = [ "libc", ] -[[package]] -name = "select" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f9da09dc3f4dfdb6374cbffff7a2cffcec316874d4429899eefdc97b3b94dcd" -dependencies = [ - "bit-set", - "html5ever", - "markup5ever_rcdom", -] - [[package]] name = "selectors" version = "0.22.0" @@ -4803,9 +4466,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.219" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] @@ -4823,9 +4486,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", @@ -4845,9 +4508,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa 1.0.11", "memchr", @@ -4971,12 +4634,6 @@ dependencies = [ "digest", ] -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -5057,10 +4714,10 @@ dependencies = [ "foreign-types 0.5.0", "js-sys", "log", - "objc2 0.5.2", - "objc2-app-kit 0.2.2", - "objc2-foundation 0.2.2", - "objc2-quartz-core 0.2.2", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-quartz-core", "raw-window-handle", "redox_syscall 0.5.3", "wasm-bindgen", @@ -5114,10 +4771,20 @@ dependencies = [ ] [[package]] -name = "sqlx" -version = "0.8.3" +name = "sqlformat" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4410e73b3c0d8442c5f99b425d7a435b5ee0ae4167b3196771dd3f7a01be745f" +checksum = "f895e3734318cc55f1fe66258926c9b910c124d47520339efecbb6c59cec7c1f" +dependencies = [ + "nom", + "unicode_categories", +] + +[[package]] +name = "sqlx" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93334716a037193fac19df402f8571269c84a00852f6a7066b5d2616dcd64d3e" dependencies = [ "sqlx-core", "sqlx-macros", @@ -5128,33 +4795,38 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.8.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a007b6936676aa9ab40207cde35daab0a04b823be8ae004368c0793b96a61e0" +checksum = "d4d8060b456358185f7d50c55d9b5066ad956956fddec42ee2e8567134a8936e" dependencies = [ + "atoi", + "byteorder", "bytes", - "chrono", "crc", "crossbeam-queue", "either", "event-listener", + "futures-channel", "futures-core", "futures-intrusive", "futures-io", "futures-util", - "hashbrown 0.15.2", + "hashbrown 0.14.5", "hashlink", + "hex", "indexmap 2.3.0", "log", "memchr", "native-tls", "once_cell", + "paste", "percent-encoding", "serde", "serde_json", "sha2", "smallvec", - "thiserror 2.0.3", + "sqlformat", + "thiserror 1.0.63", "time", "tokio", "tokio-stream", @@ -5164,9 +4836,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.8.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3112e2ad78643fef903618d78cf0aec1cb3134b019730edb039b69eaf531f310" +checksum = "cac0692bcc9de3b073e8d747391827297e075c7710ff6276d9f7a1f3d58c6657" dependencies = [ "proc-macro2", "quote", @@ -5177,9 +4849,9 @@ dependencies = [ [[package]] name = "sqlx-macros-core" -version = "0.8.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9f90acc5ab146a99bf5061a7eb4976b573f560bc898ef3bf8435448dd5e7ad" +checksum = "1804e8a7c7865599c9c79be146dc8a9fd8cc86935fa641d3ea58e5f0688abaa5" dependencies = [ "dotenvy", "either", @@ -5203,16 +4875,15 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.8.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4560278f0e00ce64938540546f59f590d60beee33fffbd3b9cd47851e5fff233" +checksum = "64bb4714269afa44aef2755150a0fc19d756fb580a67db8885608cf02f47d06a" dependencies = [ "atoi", "base64 0.22.1", - "bitflags 2.8.0", + "bitflags 2.6.0", "byteorder", "bytes", - "chrono", "crc", "digest", "dotenvy", @@ -5239,7 +4910,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 2.0.3", + "thiserror 1.0.63", "time", "tracing", "whoami", @@ -5247,20 +4918,20 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.8.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5b98a57f363ed6764d5b3a12bfedf62f07aa16e1856a7ddc2a0bb190a959613" +checksum = "6fa91a732d854c5d7726349bb4bb879bb9478993ceb764247660aee25f67c2f8" dependencies = [ "atoi", "base64 0.22.1", - "bitflags 2.8.0", + "bitflags 2.6.0", "byteorder", - "chrono", "crc", "dotenvy", "etcetera", "futures-channel", "futures-core", + "futures-io", "futures-util", "hex", "hkdf", @@ -5278,7 +4949,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 2.0.3", + "thiserror 1.0.63", "time", "tracing", "whoami", @@ -5286,12 +4957,11 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.8.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f85ca71d3a5b24e64e1d08dd8fe36c6c95c339a896cc33068148906784620540" +checksum = "d5b2cf34a45953bfd3daaf3db0f7a7878ab9b7a6b91b422d24a7a9e4c857b680" dependencies = [ "atoi", - "chrono", "flume", "futures-channel", "futures-core", @@ -5366,18 +5036,18 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.27.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.27.1" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -5447,9 +5117,9 @@ dependencies = [ [[package]] name = "sys-locale" -version = "0.3.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +checksum = "e801cf239ecd6ccd71f03d270d67dd53d13e90aab208bf4b8fe4ad957ea949b0" dependencies = [ "libc", ] @@ -5460,7 +5130,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "core-foundation 0.9.4", "system-configuration-sys", ] @@ -5484,17 +5154,18 @@ dependencies = [ "cfg-expr", "heck 0.5.0", "pkg-config", - "toml", + "toml 0.8.2", "version-compare", ] [[package]] name = "tao" -version = "0.32.8" +version = "0.30.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63c8b1020610b9138dd7b1e06cf259ae91aa05c30f3bd0d6b42a03997b92dec1" +checksum = "6682a07cf5bab0b8a2bd20d0a542917ab928b5edb75ebd4eda6b05cbaab872da" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", + "cocoa 0.26.0", "core-foundation 0.10.0", "core-graphics 0.24.0", "crossbeam-channel", @@ -5504,6 +5175,7 @@ dependencies = [ "gdkwayland-sys", "gdkx11-sys", "gtk", + "instant", "jni", "lazy_static", "libc", @@ -5511,9 +5183,7 @@ dependencies = [ "ndk", "ndk-context", "ndk-sys", - "objc2 0.6.0", - "objc2-app-kit 0.3.0", - "objc2-foundation 0.3.0", + "objc", "once_cell", "parking_lot", "raw-window-handle", @@ -5521,8 +5191,8 @@ dependencies = [ "tao-macros", "unicode-segmentation", "url", - "windows 0.60.0", - "windows-core 0.60.1", + "windows", + "windows-core 0.58.0", "windows-version", "x11-dl", ] @@ -5557,13 +5227,13 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.3.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be747b26bf28674977fac47bdf6963fd9c7578271c3fbeb25d8686de6596f35" +checksum = "e545de0a2dfe296fa67db208266cd397c5a55ae782da77973ef4c4fac90e9f2c" dependencies = [ "anyhow", "bytes", - "dirs 6.0.0", + "dirs 5.0.1", "dunce", "embed_plist", "futures-util", @@ -5578,9 +5248,9 @@ dependencies = [ "log", "mime", "muda", - "objc2 0.6.0", - "objc2-app-kit 0.3.0", - "objc2-foundation 0.3.0", + "objc2", + "objc2-app-kit", + "objc2-foundation", "percent-encoding", "plist", "raw-window-handle", @@ -5603,18 +5273,18 @@ dependencies = [ "webkit2gtk", "webview2-com", "window-vibrancy", - "windows 0.60.0", + "windows", ] [[package]] name = "tauri-build" -version = "2.0.6" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51a2e96f3c0baa0581656bb58e6fdd0f7c9c31eaf6721a0c08689d938fe85f2d" +checksum = "7bd2a4bcfaf5fb9f4be72520eefcb61ae565038f8ccba2a497d8c28f463b8c01" dependencies = [ "anyhow", "cargo_toml", - "dirs 6.0.0", + "dirs 5.0.1", "glob", "heck 0.5.0", "json-patch", @@ -5624,15 +5294,15 @@ dependencies = [ "serde_json", "tauri-utils", "tauri-winres", - "toml", + "toml 0.8.2", "walkdir", ] [[package]] name = "tauri-codegen" -version = "2.0.5" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e357ec3daf8faad1029bc7109e7f5b308ceb63b6073d110d7388923a4cce5e55" +checksum = "bf79faeecf301d3e969b1fae977039edb77a4c1f25cc0a961be298b54bff97cf" dependencies = [ "base64 0.22.1", "brotli", @@ -5655,21 +5325,11 @@ dependencies = [ "walkdir", ] -[[package]] -name = "tauri-icns" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b7eb4d0d43724ba9ba6a6717420ee68aee377816a3edbb45db8c18862b1431" -dependencies = [ - "byteorder", - "png", -] - [[package]] name = "tauri-macros" -version = "2.0.5" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447ee4dd94690d77f1422f2b57e783c654ba75c535ad6f6e727887330804fff2" +checksum = "c52027c8c5afb83166dacddc092ee8fff50772f9646d461d8c33ee887e447a03" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -5681,9 +5341,9 @@ dependencies = [ [[package]] name = "tauri-plugin" -version = "2.0.4" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5841b9a0200e954ef7457f8d327091424328891e267a97b641dc246cc54d0dec" +checksum = "b2e6660a409963e4d57b9bfab4addd141eeff41bd3a7fb14e13004a832cf7ef6" dependencies = [ "anyhow", "glob", @@ -5692,41 +5352,23 @@ dependencies = [ "serde", "serde_json", "tauri-utils", - "toml", + "toml 0.8.2", "walkdir", ] -[[package]] -name = "tauri-plugin-aptabase" -version = "0.5.1" -source = "git+https://github.com/aptabase/tauri-plugin-aptabase?branch=v2#8085ab1e03707236bae8865fedc5114631bdbb2f" -dependencies = [ - "futures", - "log", - "os_info", - "rand 0.9.0", - "reqwest", - "serde", - "serde_json", - "sys-locale", - "tauri", - "tauri-plugin", - "time", - "tokio", -] - [[package]] name = "tauri-plugin-autostart" -version = "2.2.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c13f843e5e5df3eed270fc42b02923cc1a6b5c7e56b0f3ac1d858ab2c8b5fb" +checksum = "bba6bb936e0fd0a58ed958b49e2e423dd40949c9d9425cc991be996959e3838e" dependencies = [ "auto-launch", + "log", "serde", "serde_json", "tauri", "tauri-plugin", - "thiserror 2.0.3", + "thiserror 1.0.63", ] [[package]] @@ -5746,9 +5388,9 @@ dependencies = [ [[package]] name = "tauri-plugin-dialog" -version = "2.2.0" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b59fd750551b1066744ab956a1cd6b1ea3e1b3763b0b9153ac27a044d596426" +checksum = "4307310e1d2c09ab110235834722e7c2b85099b683e1eb7342ab351b0be5ada3" dependencies = [ "log", "raw-window-handle", @@ -5758,15 +5400,15 @@ dependencies = [ "tauri", "tauri-plugin", "tauri-plugin-fs", - "thiserror 2.0.3", + "thiserror 1.0.63", "url", ] [[package]] name = "tauri-plugin-fs" -version = "2.2.0" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a1edf18000f02903a7c2e5997fb89aca455ecbc0acc15c6535afbb883be223" +checksum = "96ba7d46e86db8c830d143ef90ab5a453328365b0cc834c24edea4267b16aba0" dependencies = [ "anyhow", "dunce", @@ -5778,18 +5420,16 @@ dependencies = [ "serde_repr", "tauri", "tauri-plugin", - "tauri-utils", - "thiserror 2.0.3", - "toml", + "thiserror 1.0.63", "url", "uuid", ] [[package]] name = "tauri-plugin-global-shortcut" -version = "2.2.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f646a09511e8d283267dcdaa08c2ef27c4116bf271d9114849d9ca215606c3" +checksum = "2c15fb7f5e4c80a73ce97217dcff27e423f496178cbcb87e13b4efe99eebb550" dependencies = [ "global-hotkey", "log", @@ -5797,16 +5437,16 @@ dependencies = [ "serde_json", "tauri", "tauri-plugin", - "thiserror 2.0.3", + "thiserror 1.0.63", ] [[package]] name = "tauri-plugin-os" -version = "2.2.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "424f19432397850c2ddd42aa58078630c15287bbce3866eb1d90e7dbee680637" +checksum = "fbc5f23a86f37687c7f4fecfdc706b279087bc44f7a46702f7307ff1551ee03a" dependencies = [ - "gethostname 1.0.0", + "gethostname 0.5.0", "log", "os_info", "serde", @@ -5815,29 +5455,29 @@ dependencies = [ "sys-locale", "tauri", "tauri-plugin", - "thiserror 2.0.3", + "thiserror 1.0.63", ] [[package]] name = "tauri-plugin-prevent-default" -version = "1.2.1" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68c872b8d017f6f10ff5d44ce315e28c8848a302a2eff0ed6768aa80214ea5d6" +checksum = "00b2ef597fc50a30affa58c86e10b89d64caf4b4f650d412146c16cbf2200e35" dependencies = [ - "bitflags 2.8.0", - "itertools 0.14.0", + "bitflags 2.6.0", + "itertools 0.13.0", "serde", "strum", "tauri", "tauri-plugin", - "thiserror 2.0.3", + "thiserror 1.0.63", ] [[package]] name = "tauri-plugin-sql" -version = "2.2.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6ccca89ded6bd2ff49fdad9a5b34bcd624aa223fdfddbab83c85706ee3a4948" +checksum = "eb7022ccbcd1799dcf7acb97805f1a5fc7f046b4cf67518296a2e8921bab613a" dependencies = [ "futures-core", "indexmap 2.3.0", @@ -5847,26 +5487,24 @@ dependencies = [ "sqlx", "tauri", "tauri-plugin", - "thiserror 2.0.3", + "thiserror 1.0.63", "time", "tokio", ] [[package]] name = "tauri-plugin-updater" -version = "2.6.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cd78a6cbd1255e989e96eedec004e9e8949e6c6359b41f861279aba64ea306" +checksum = "1dd3d2fe0f02bf52eebb5a9d23b987fffac6684646ab6fd683d706dafb18da87" dependencies = [ "base64 0.22.1", - "dirs 6.0.0", + "dirs 5.0.1", "flate2", "futures-util", "http", "infer", - "log", "minisign-verify", - "osakit", "percent-encoding", "reqwest", "semver", @@ -5876,7 +5514,7 @@ dependencies = [ "tauri", "tauri-plugin", "tempfile", - "thiserror 2.0.3", + "thiserror 1.0.63", "time", "tokio", "url", @@ -5886,9 +5524,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.4.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e758a405ab39e25f4d1235c5f06fe563f44b01ee18bbe38ddec5356d4f581908" +checksum = "cce18d43f80d4aba3aa8a0c953bbe835f3d0f2370aca75e8dbb14bd4bab27958" dependencies = [ "dpi", "gtk", @@ -5900,23 +5538,22 @@ dependencies = [ "tauri-utils", "thiserror 2.0.3", "url", - "windows 0.60.0", + "windows", ] [[package]] name = "tauri-runtime-wry" -version = "2.4.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b2beb90decade4c71e8b09c9e4a9245837a8a97693f945b77e32baf13f51fec" +checksum = "9f442a38863e10129ffe2cec7bd09c2dcf8a098a3a27801a476a304d5bb991d2" dependencies = [ "gtk", "http", "jni", "log", - "objc2 0.6.0", - "objc2-app-kit 0.3.0", - "objc2-foundation 0.3.0", - "once_cell", + "objc2", + "objc2-app-kit", + "objc2-foundation", "percent-encoding", "raw-window-handle", "softbuffer", @@ -5926,15 +5563,15 @@ dependencies = [ "url", "webkit2gtk", "webview2-com", - "windows 0.60.0", + "windows", "wry", ] [[package]] name = "tauri-utils" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "107a959dbd5ff53d89a98f6f2e3e987c611334141a43630caae1d80e79446dd6" +checksum = "9271a88f99b4adea0dc71d0baca4505475a0bbd139fb135f62958721aaa8fe54" dependencies = [ "brotli", "cargo_metadata", @@ -5960,7 +5597,7 @@ dependencies = [ "serde_with", "swift-rs", "thiserror 2.0.3", - "toml", + "toml 0.8.2", "url", "urlpattern", "uuid", @@ -5969,12 +5606,12 @@ dependencies = [ [[package]] name = "tauri-winres" -version = "0.3.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56eaa45f707bedf34d19312c26d350bc0f3c59a47e58e8adbeecdc850d2c13a0" +checksum = "5993dc129e544393574288923d1ec447c857f3f644187f4fbf7d9a875fbfc4fb" dependencies = [ "embed-resource", - "toml", + "toml 0.7.8", ] [[package]] @@ -6001,31 +5638,6 @@ dependencies = [ "utf-8", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "texting_robots" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82a718a28dda2e67ad6e0464597b58eae39e2e4d0451e03d1028d71e81bb4a" -dependencies = [ - "anyhow", - "bstr", - "lazy_static", - "nom", - "percent-encoding", - "regex", - "thiserror 1.0.63", - "url", -] - [[package]] name = "thin-slice" version = "0.1.1" @@ -6085,9 +5697,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.39" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa 1.0.11", @@ -6100,15 +5712,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.3" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.20" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -6141,9 +5753,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.44.1" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -6160,9 +5772,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", @@ -6216,21 +5828,33 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.22", + "toml_edit 0.19.15", +] + +[[package]] +name = "toml" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.20.2", ] [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] @@ -6242,8 +5866,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.3.0", + "serde", + "serde_spanned", "toml_datetime", - "winnow 0.5.40", + "winnow", ] [[package]] @@ -6251,35 +5877,24 @@ name = "toml_edit" version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" -dependencies = [ - "indexmap 2.3.0", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap 2.3.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.24", + "winnow", ] [[package]] name = "tower" -version = "0.5.2" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", + "pin-project", "pin-project-lite", - "sync_wrapper", "tokio", "tower-layer", "tower-service", @@ -6287,15 +5902,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] name = "tower-service" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" @@ -6331,23 +5946,22 @@ dependencies = [ [[package]] name = "tray-icon" -version = "0.20.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d433764348e7084bad2c5ea22c96c71b61b17afe3a11645710f533bd72b6a2b5" +checksum = "533fc2d4105e0e3d96ce1c71f2d308c9fbbe2ef9c587cab63dd627ab5bde218f" dependencies = [ + "core-graphics 0.24.0", "crossbeam-channel", - "dirs 6.0.0", + "dirs 5.0.1", "libappindicator", "muda", - "objc2 0.6.0", - "objc2-app-kit 0.3.0", - "objc2-core-foundation", - "objc2-core-graphics", - "objc2-foundation 0.3.0", + "objc2", + "objc2-app-kit", + "objc2-foundation", "once_cell", "png", "serde", - "thiserror 2.0.3", + "thiserror 1.0.63", "windows-sys 0.59.0", ] @@ -6454,33 +6068,23 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + [[package]] name = "untrusted" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" -[[package]] -name = "ureq" -version = "2.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b74fc6b57825be3373f7054754755f03ac3a8f5d70015ccad699ba2029956f4a" -dependencies = [ - "base64 0.22.1", - "flate2", - "log", - "once_cell", - "rustls", - "rustls-pki-types", - "url", - "webpki-roots", -] - [[package]] name = "url" -version = "2.5.4" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", "idna", @@ -6520,11 +6124,11 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.16.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ - "getrandom 0.3.1", + "getrandom 0.2.15", "serde", ] @@ -6608,15 +6212,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wasi" -version = "0.13.3+wasi-0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" -dependencies = [ - "wit-bindgen-rt", -] - [[package]] name = "wasite" version = "0.1.0" @@ -6625,24 +6220,23 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", - "once_cell", - "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.100" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", + "once_cell", "proc-macro2", "quote", "syn 2.0.87", @@ -6663,9 +6257,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6673,9 +6267,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -6686,12 +6280,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-streams" @@ -6726,7 +6317,7 @@ version = "0.31.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3f45d1222915ef1fd2057220c1d9d9624b7654443ea35c3877f7a52bd0a5a2d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "rustix", "wayland-backend", "wayland-scanner", @@ -6738,7 +6329,7 @@ version = "0.32.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b5755d77ae9040bb872a25026555ce4cb0ae75fd923e90d25fba07d81057de0" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -6831,14 +6422,14 @@ dependencies = [ [[package]] name = "webview2-com" -version = "0.36.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d606f600e5272b514dbb66539dd068211cc20155be8d3958201b4b5bd79ed3" +checksum = "6f61ff3d9d0ee4efcb461b14eb3acfda2702d10dc329f339303fc3e57215ae2c" dependencies = [ "webview2-com-macros", "webview2-com-sys", - "windows 0.60.0", - "windows-core 0.60.1", + "windows", + "windows-core 0.58.0", "windows-implement", "windows-interface", ] @@ -6856,13 +6447,13 @@ dependencies = [ [[package]] name = "webview2-com-sys" -version = "0.36.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb27fccd3c27f68e9a6af1bcf48c2d82534b8675b83608a4d81446d095a17ac" +checksum = "a3a3e2eeb58f82361c93f9777014668eb3d07e7d174ee4c819575a9208011886" dependencies = [ - "thiserror 2.0.3", - "windows 0.60.0", - "windows-core 0.60.1", + "thiserror 1.0.63", + "windows", + "windows-core 0.58.0", ] [[package]] @@ -6881,12 +6472,6 @@ dependencies = [ "wasite", ] -[[package]] -name = "widestring" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" - [[package]] name = "winapi" version = "0.3.9" @@ -6920,49 +6505,25 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window-vibrancy" -version = "0.6.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bec5a31f3f9362f2258fd0e9c9dd61a9ca432e7306cc78c444258f0dce9a9c" +checksum = "33082acd404763b315866e14a0d5193f3422c81086657583937a750cdd3ec340" dependencies = [ - "objc2 0.6.0", - "objc2-app-kit 0.3.0", - "objc2-core-foundation", - "objc2-foundation 0.3.0", + "cocoa 0.25.0", + "objc", "raw-window-handle", - "windows-sys 0.59.0", + "windows-sys 0.52.0", "windows-version", ] [[package]] name = "windows" -version = "0.59.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f919aee0a93304be7f62e8e5027811bbba96bcb1de84d6618be56e43f8a32a1" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ - "windows-core 0.59.0", - "windows-targets 0.53.0", -] - -[[package]] -name = "windows" -version = "0.60.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf874e74c7a99773e62b1c671427abf01a425e77c3d3fb9fb1e4883ea934529" -dependencies = [ - "windows-collections", - "windows-core 0.60.1", - "windows-future", - "windows-link", - "windows-numerics", -] - -[[package]] -name = "windows-collections" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5467f79cc1ba3f52ebb2ed41dbb459b8e7db636cc3429458d9a852e15bc24dec" -dependencies = [ - "windows-core 0.60.1", + "windows-core 0.58.0", + "windows-targets 0.52.6", ] [[package]] @@ -6976,58 +6537,22 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.59.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "810ce18ed2112484b0d4e15d022e5f598113e220c53e373fb31e67e21670c1ce" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" dependencies = [ "windows-implement", "windows-interface", "windows-result", "windows-strings", - "windows-targets 0.53.0", -] - -[[package]] -name = "windows-core" -version = "0.60.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca21a92a9cae9bf4ccae5cf8368dce0837100ddf6e6d57936749e85f152f6247" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link", - "windows-result", - "windows-strings", -] - -[[package]] -name = "windows-future" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a787db4595e7eb80239b74ce8babfb1363d8e343ab072f2ffe901400c03349f0" -dependencies = [ - "windows-core 0.60.1", - "windows-link", -] - -[[package]] -name = "windows-icons" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42db1b1d99853c231d69b7fdc9782e90fa3004afed14a94c2eba79cac43b5f5a" -dependencies = [ - "base64 0.22.1", - "glob", - "image", - "winapi", - "windows 0.59.0", + "windows-targets 0.52.6", ] [[package]] name = "windows-implement" -version = "0.59.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", @@ -7036,58 +6561,43 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.59.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb26fd936d991781ea39e87c3a27285081e3c0da5ca0fcbc02d368cc6f52ff01" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", "syn 2.0.87", ] -[[package]] -name = "windows-link" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" - -[[package]] -name = "windows-numerics" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "005dea54e2f6499f2cee279b8f703b3cf3b5734a2d8d21867c8f44003182eeed" -dependencies = [ - "windows-core 0.60.1", - "windows-link", -] - [[package]] name = "windows-registry" -version = "0.4.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ "windows-result", "windows-strings", - "windows-targets 0.53.0", + "windows-targets 0.52.6", ] [[package]] name = "windows-result" -version = "0.3.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" dependencies = [ - "windows-link", + "windows-targets 0.52.6", ] [[package]] name = "windows-strings" -version = "0.3.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ - "windows-link", + "windows-result", + "windows-targets 0.52.6", ] [[package]] @@ -7165,29 +6675,13 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", + "windows_i686_gnullvm", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] -[[package]] -name = "windows-targets" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" -dependencies = [ - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", -] - [[package]] name = "windows-version" version = "0.1.1" @@ -7224,12 +6718,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" - [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -7248,12 +6736,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" - [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -7272,24 +6754,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -[[package]] -name = "windows_i686_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" - [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" - [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -7308,12 +6778,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" - [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -7332,12 +6796,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" - [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -7356,12 +6814,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" - [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -7380,12 +6832,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" - [[package]] name = "winnow" version = "0.5.40" @@ -7395,15 +6841,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winnow" -version = "0.6.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" -dependencies = [ - "memchr", -] - [[package]] name = "winreg" version = "0.10.1" @@ -7423,15 +6860,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "wit-bindgen-rt" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" -dependencies = [ - "bitflags 2.8.0", -] - [[package]] name = "write16" version = "1.0.0" @@ -7446,12 +6874,12 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "wry" -version = "0.50.4" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804a7d1613bd699beccaa60f3b3c679acee21cebba1945a693f5eab95c08d1fa" +checksum = "553ca1ce149982123962fac2506aa75b8b76288779a77e72b12fa2fc34938647" dependencies = [ "base64 0.22.1", - "block2 0.6.0", + "block2", "cookie", "crossbeam-channel", "dpi", @@ -7465,10 +6893,9 @@ dependencies = [ "kuchikiki", "libc", "ndk", - "objc2 0.6.0", - "objc2-app-kit 0.3.0", - "objc2-core-foundation", - "objc2-foundation 0.3.0", + "objc2", + "objc2-app-kit", + "objc2-foundation", "objc2-ui-kit", "objc2-web-kit", "once_cell", @@ -7477,13 +6904,13 @@ dependencies = [ "sha2", "soup3", "tao-macros", - "thiserror 2.0.3", + "thiserror 1.0.63", "url", "webkit2gtk", "webkit2gtk-sys", "webview2-com", - "windows 0.60.0", - "windows-core 0.60.1", + "windows", + "windows-core 0.58.0", "windows-version", "x11-dl", ] @@ -7547,17 +6974,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "xml5ever" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4034e1d05af98b51ad7214527730626f019682d797ba38b51689212118d8e650" -dependencies = [ - "log", - "mac", - "markup5ever", -] - [[package]] name = "yoke" version = "0.7.4" @@ -7648,16 +7064,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "byteorder", - "zerocopy-derive 0.7.35", -] - -[[package]] -name = "zerocopy" -version = "0.8.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468" -dependencies = [ - "zerocopy-derive 0.8.14", + "zerocopy-derive", ] [[package]] @@ -7671,17 +7078,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "zerocopy-derive" -version = "0.8.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "zerofrom" version = "0.1.4" @@ -7733,9 +7129,9 @@ dependencies = [ [[package]] name = "zip" -version = "2.4.1" +version = "2.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938cc23ac49778ac8340e366ddc422b2227ea176edb447e23fc0627608dddadd" +checksum = "40dd8c92efc296286ce1fbd16657c5dbefff44f1b4ca01cc5f517d8b7b3d3e2e" dependencies = [ "arbitrary", "crc32fast", @@ -7743,7 +7139,7 @@ dependencies = [ "displaydoc", "indexmap 2.3.0", "memchr", - "thiserror 2.0.3", + "thiserror 1.0.63", ] [[package]] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index d8eddea..5f4e589 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,58 +1,44 @@ [package] name = "qopy" -version = "0.4.0" +version = "0.2.0" description = "Qopy" authors = ["pandadev"] edition = "2021" rust-version = "1.70" [build-dependencies] -tauri-build = { version = "2.0.6", features = [] } +tauri-build = { version = "2.0.3", features = [] } [dependencies] -tauri = { version = "2.3.1", features = [ +tauri = { version = "2.0.1", features = [ "macos-private-api", "tray-icon", "image-png", ] } -tauri-plugin-sql = { version = "2.2.0", features = ["sqlite"] } -tauri-plugin-autostart = "2.2.0" -tauri-plugin-os = "2.2.1" -tauri-plugin-updater = "2.6.0" -tauri-plugin-dialog = "2.2.0" -tauri-plugin-fs = "2.2.0" +tauri-plugin-sql = { version = "2.0.2", features = ["sqlite"] } +tauri-plugin-autostart = "2.0.1" +tauri-plugin-os = "2.0.1" +tauri-plugin-updater = "2.0.2" +tauri-plugin-dialog = "2.0.3" +tauri-plugin-fs = "2.0.3" tauri-plugin-clipboard = "2.1.11" -tauri-plugin-prevent-default = "1.2.1" -tauri-plugin-global-shortcut = "2.2.0" -tauri-plugin-aptabase = { git = "https://github.com/aptabase/tauri-plugin-aptabase", branch = "v2" } -sqlx = { version = "0.8.3", features = [ - "runtime-tokio-native-tls", - "sqlite", - "chrono", -] } -serde = { version = "1.0.219", features = ["derive"] } -tokio = { version = "1.44.1", features = ["full"] } -serde_json = "1.0.140" +tauri-plugin-prevent-default = "0.7.5" +tauri-plugin-global-shortcut = "2.0.1" +sqlx = { version = "0.8.2", features = ["runtime-tokio-native-tls", "sqlite"] } +serde = { version = "1.0.215", features = ["derive"] } +tokio = { version = "1.41.1", features = ["full"] } +serde_json = "1.0.132" rdev = "0.5.3" -rand = "0.9.0" +rand = "0.8" base64 = "0.22.1" image = "0.25.5" -reqwest = { version = "0.12.14", features = ["json", "blocking"] } -url = "2.5.4" +reqwest = { version = "0.12.9", features = ["blocking"] } +url = "2.5.3" regex = "1.11.1" -sha2 = "0.10.8" -lazy_static = "1.5.0" -time = "0.3.39" -global-hotkey = "0.6.4" -chrono = { version = "0.4.40", features = ["serde"] } -log = { version = "0.4.26", features = ["std"] } -uuid = "1.16.0" -include_dir = "0.7.4" -# hyperpolyglot = { git = "https://github.com/0pandadev/hyperpolyglot" } -applications = { git = "https://github.com/HuakunShen/applications-rs", branch = "fix/win-app-detection" } -glob = "0.3.2" -meta_fetcher = "0.1.1" -parking_lot = "0.12.3" +sha2 = "0.10.6" +lazy_static = "1.4.0" +time = "0.3" +global-hotkey = "0.6.3" [features] custom-protocol = ["tauri/custom-protocol"] diff --git a/src-tauri/src/api/clipboard.rs b/src-tauri/src/api/clipboard.rs index f06881c..c587cb4 100644 --- a/src-tauri/src/api/clipboard.rs +++ b/src-tauri/src/api/clipboard.rs @@ -1,42 +1,51 @@ -use tauri_plugin_aptabase::EventTracker; -use base64::{ engine::general_purpose::STANDARD, Engine }; -// use hyperpolyglot; +use base64::engine::general_purpose::STANDARD; +use base64::Engine; +use image::ImageFormat; use lazy_static::lazy_static; -use rdev::{ simulate, EventType, Key }; +use rand::Rng; +use rdev::{simulate, EventType, Key}; use regex::Regex; +use sha2::{Digest, Sha256}; use sqlx::SqlitePool; -use std::fs; -use std::sync::atomic::{ AtomicBool, Ordering }; -use std::{ thread, time::Duration }; -use tauri::{ AppHandle, Emitter, Listener, Manager }; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::{fs, sync::Mutex, thread, time::Duration}; +use tauri::{AppHandle, Emitter, Listener, Manager, Runtime}; use tauri_plugin_clipboard::Clipboard; use tokio::runtime::Runtime as TokioRuntime; -use url::Url; -use uuid::Uuid; - -use crate::db; -use crate::utils::commands::get_app_info; -use crate::utils::favicon::fetch_favicon_as_base64; -use crate::utils::types::{ ContentType, HistoryItem }; lazy_static! { + static ref APP_DATA_DIR: Mutex> = Mutex::new(None); static ref IS_PROGRAMMATIC_PASTE: AtomicBool = AtomicBool::new(false); } +pub fn set_app_data_dir(path: std::path::PathBuf) { + let mut dir = APP_DATA_DIR.lock().unwrap(); + *dir = Some(path); +} + #[tauri::command] -pub async fn write_and_paste( - app_handle: AppHandle, +pub fn read_image(filename: String) -> Result { + let app_data_dir = APP_DATA_DIR.lock().unwrap(); + let app_data_dir = app_data_dir.as_ref().expect("App data directory not set"); + let image_path = app_data_dir.join("images").join(filename); + let image_data = fs::read(image_path).map_err(|e| e.to_string())?; + Ok(STANDARD.encode(image_data)) +} + +#[tauri::command] +pub async fn write_and_paste( + app_handle: tauri::AppHandle, content: String, - content_type: String + content_type: String, ) -> Result<(), String> { let clipboard = app_handle.state::(); match content_type.as_str() { "text" => clipboard.write_text(content).map_err(|e| e.to_string())?, - "link" => clipboard.write_text(content).map_err(|e| e.to_string())?, - "color" => clipboard.write_text(content).map_err(|e| e.to_string())?, "image" => { - clipboard.write_image_base64(content).map_err(|e| e.to_string())?; + clipboard + .write_image_base64(content) + .map_err(|e| e.to_string())?; } "files" => { clipboard @@ -44,237 +53,253 @@ pub async fn write_and_paste( content .split(", ") .map(|file| file.to_string()) - .collect::>() + .collect::>(), ) .map_err(|e| e.to_string())?; } - _ => { - return Err("Unsupported content type".to_string()); - } + _ => return Err("Unsupported content type".to_string()), } IS_PROGRAMMATIC_PASTE.store(true, Ordering::SeqCst); - thread::spawn(|| { - thread::sleep(Duration::from_millis(100)); - - #[cfg(target_os = "macos")] - let modifier_key = Key::MetaLeft; - #[cfg(not(target_os = "macos"))] - let modifier_key = Key::ControlLeft; - - let events = vec![ - EventType::KeyPress(modifier_key), - EventType::KeyPress(Key::KeyV), - EventType::KeyRelease(Key::KeyV), - EventType::KeyRelease(modifier_key) - ]; - - for event in events { - if let Err(e) = simulate(&event) { - println!("Simulation error: {:?}", e); - } - thread::sleep(Duration::from_millis(20)); - } - }); + simulate_paste(); tokio::spawn(async { tokio::time::sleep(tokio::time::Duration::from_millis(500)).await; IS_PROGRAMMATIC_PASTE.store(false, Ordering::SeqCst); }); - let _ = app_handle.track_event( - "clipboard_paste", - Some(serde_json::json!({ - "content_type": content_type - })) - ); - Ok(()) } -pub fn setup(app: &AppHandle) { - let app_handle = app.clone(); - let runtime = TokioRuntime::new().expect("Failed to create Tokio runtime"); +fn simulate_paste() { + let mut events = vec![ + EventType::KeyPress(Key::ControlLeft), + EventType::KeyPress(Key::KeyV), + EventType::KeyRelease(Key::KeyV), + EventType::KeyRelease(Key::ControlLeft), + ]; - app_handle.clone().listen("plugin:clipboard://clipboard-monitor/update", move |_event| { - let app_handle = app_handle.clone(); - runtime.block_on(async move { - if IS_PROGRAMMATIC_PASTE.load(Ordering::SeqCst) { - return; - } + thread::sleep(Duration::from_millis(100)); - let clipboard = app_handle.state::(); - let available_types = clipboard.available_types().unwrap(); - - let (app_name, app_icon) = get_app_info(); - - match get_pool(&app_handle).await { - Ok(pool) => { - if available_types.image { - println!("Handling image change"); - if let Ok(image_data) = clipboard.read_image_base64() { - let file_path = save_image_to_file(&app_handle, &image_data).await - .map_err(|e| e.to_string()) - .unwrap_or_else(|e| e); - let _ = db::history::add_history_item( - app_handle.clone(), - pool, - HistoryItem::new( - app_name, - ContentType::Image, - file_path, - None, - app_icon, - None - ) - ).await; - } - } else if available_types.files { - println!("Handling files change"); - if let Ok(files) = clipboard.read_files() { - for file in files { - let _ = db::history::add_history_item( - app_handle.clone(), - pool.clone(), - HistoryItem::new( - app_name.clone(), - ContentType::File, - file, - None, - app_icon.clone(), - None - ) - ).await; - } - } - } else if available_types.text { - println!("Handling text change"); - if let Ok(text) = clipboard.read_text() { - let text = text.to_string(); - let url_regex = Regex::new( - r"^https?://(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&//=]*)$" - ).unwrap(); - - if url_regex.is_match(&text) { - if let Ok(url) = Url::parse(&text) { - let favicon = match fetch_favicon_as_base64(url).await { - Ok(Some(f)) => Some(f), - _ => None, - }; - - let _ = db::history::add_history_item( - app_handle.clone(), - pool, - HistoryItem::new( - app_name, - ContentType::Link, - text, - favicon, - app_icon, - None - ) - ).await; - } - } else { - if text.is_empty() { - return; - } - - // Temporarily disabled code detection - /*if let Some(detection) = hyperpolyglot::detect_from_text(&text) { - let language = match detection { - hyperpolyglot::Detection::Heuristics(lang) => lang.to_string(), - _ => detection.language().to_string(), - }; - - let _ = db::history::add_history_item( - pool, - HistoryItem::new(app_name, ContentType::Code, text, None, app_icon, Some(language)) - ).await; - } else*/ if crate::utils::commands::detect_color(&text) { - let _ = db::history::add_history_item( - app_handle.clone(), - pool, - HistoryItem::new( - app_name, - ContentType::Color, - text, - None, - app_icon, - None - ) - ).await; - } else { - let _ = db::history::add_history_item( - app_handle.clone(), - pool, - HistoryItem::new( - app_name, - ContentType::Text, - text.clone(), - None, - app_icon, - None - ) - ).await; - } - } - } - } else { - println!("Unknown clipboard content type"); - } - } - Err(e) => { - println!("Failed to get database pool: {}", e); - } - } - - let _ = app_handle.emit("clipboard-content-updated", ()); - let _ = app_handle.track_event( - "clipboard_copied", - Some( - serde_json::json!({ - "content_type": if available_types.image { "image" } - else if available_types.files { "files" } - else if available_types.text { "text" } - else { "unknown" } - }) - ) - ); - }); - }); + for event in events.drain(..) { + simulate(&event).unwrap(); + thread::sleep(Duration::from_millis(20)); + } } -async fn get_pool( - app_handle: &AppHandle -) -> Result, Box> { - Ok(app_handle.state::()) +#[tauri::command] +pub fn get_image_path(app_handle: tauri::AppHandle, filename: String) -> String { + let app_data_dir = app_handle + .path() + .app_data_dir() + .expect("Failed to get app data directory"); + let image_path = app_data_dir.join("images").join(filename); + image_path.to_str().unwrap_or("").to_string() +} + +pub fn setup(app: &AppHandle) { + let app = app.clone(); + let runtime = TokioRuntime::new().expect("Failed to create Tokio runtime"); + + app.clone().listen( + "plugin:clipboard://clipboard-monitor/update", + move |_event| { + let app = app.clone(); + runtime.block_on(async move { + if IS_PROGRAMMATIC_PASTE.load(Ordering::SeqCst) { + return; + } + + let clipboard = app.state::(); + let available_types = clipboard.available_types().unwrap(); + + match get_pool(&app).await { + Ok(pool) => { + if available_types.image { + println!("Handling image change"); + if let Ok(image_data) = clipboard.read_image_base64() { + insert_content_if_not_exists( + app.clone(), + pool.clone(), + "image", + image_data, + ) + .await; + } + let _ = app.emit("plugin:clipboard://image-changed", ()); + } else if available_types.files { + println!("Handling files change"); + if let Ok(files) = clipboard.read_files() { + let files_str = files.join(", "); + insert_content_if_not_exists( + app.clone(), + pool.clone(), + "files", + files_str, + ) + .await; + } + let _ = app.emit("plugin:clipboard://files-changed", ()); + } else if available_types.text { + println!("Handling text change"); + if let Ok(text) = clipboard.read_text() { + insert_content_if_not_exists( + app.clone(), + pool.clone(), + "text", + text, + ) + .await; + } + let _ = app.emit("plugin:clipboard://text-changed", ()); + } else { + println!("Unknown clipboard content type"); + } + } + Err(e) => { + println!("Failed to get database pool: {}", e); + } + } + }); + }, + ); +} + +async fn get_pool( + app_handle: &AppHandle, +) -> Result> { + let app_data_dir = app_handle + .path() + .app_data_dir() + .expect("Failed to get app data directory"); + let db_path = app_data_dir.join("data.db"); + let database_url = format!("sqlite:{}", db_path.to_str().unwrap()); + SqlitePool::connect(&database_url) + .await + .map_err(|e| Box::new(e) as Box) +} + +async fn insert_content_if_not_exists( + app_handle: AppHandle, + pool: SqlitePool, + content_type: &str, + content: String, +) { + let last_content: Option = sqlx::query_scalar( + "SELECT content FROM history WHERE content_type = ? ORDER BY timestamp DESC LIMIT 1", + ) + .bind(content_type) + .fetch_one(&pool) + .await + .unwrap_or(None); + + let content = if content_type == "image" { + match save_image(&app_handle, &content).await { + Ok(path) => path, + Err(e) => { + println!("Failed to save image: {}", e); + content + } + } + } else { + content + }; + + if last_content.as_deref() != Some(&content) { + let id: String = rand::thread_rng() + .sample_iter(&rand::distributions::Alphanumeric) + .take(16) + .map(char::from) + .collect(); + + let favicon_base64 = if content_type == "text" { + let url_regex = Regex::new(r"^https?://(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&//=]*)$").unwrap(); + if url_regex.is_match(&content) { + match url::Url::parse(&content) { + Ok(url) => match fetch_favicon_as_base64(url).await { + Ok(Some(favicon)) => Some(favicon), + Ok(None) => None, + Err(e) => { + println!("Failed to fetch favicon: {}", e); + None + } + }, + Err(e) => { + println!("Failed to parse URL: {}", e); + None + } + } + } else { + None + } + } else { + None + }; + + let _ = sqlx::query( + "INSERT INTO history (id, content_type, content, favicon) VALUES (?, ?, ?, ?)", + ) + .bind(id) + .bind(content_type) + .bind(&content) + .bind(favicon_base64) + .execute(&pool) + .await; + } +} + +async fn save_image( + app_handle: &AppHandle, + base64_image: &str, +) -> Result> { + let image_data = STANDARD.decode(base64_image)?; + let mut hasher = Sha256::new(); + hasher.update(&image_data); + let hash = hasher.finalize(); + let filename = format!("{:x}.png", hash); + + let app_data_dir = app_handle + .path() + .app_data_dir() + .expect("Failed to get app data directory"); + let images_dir = app_data_dir.join("images"); + let path = images_dir.join(&filename); + + if !path.exists() { + fs::create_dir_all(&images_dir)?; + fs::write(&path, &image_data)?; + } + + Ok(path.to_str().unwrap().to_string()) +} + +async fn fetch_favicon_as_base64( + url: url::Url, +) -> Result, Box> { + let client = reqwest::Client::new(); + let favicon_url = format!("https://favicone.com/{}", url.host_str().unwrap()); + let response = client.get(&favicon_url).send().await?; + + if response.status().is_success() { + let bytes = response.bytes().await?; + let img = image::load_from_memory(&bytes)?; + let mut png_bytes: Vec = Vec::new(); + img.write_to(&mut std::io::Cursor::new(&mut png_bytes), ImageFormat::Png)?; + Ok(Some(STANDARD.encode(&png_bytes))) + } else { + Ok(None) + } } #[tauri::command] pub fn start_monitor(app_handle: AppHandle) -> Result<(), String> { let clipboard = app_handle.state::(); - clipboard.start_monitor(app_handle.clone()).map_err(|e| e.to_string())?; + clipboard + .start_monitor(app_handle.clone()) + .map_err(|e| e.to_string())?; app_handle .emit("plugin:clipboard://clipboard-monitor/status", true) .map_err(|e| e.to_string())?; Ok(()) -} - -async fn save_image_to_file( - app_handle: &AppHandle, - base64_data: &str -) -> Result> { - let app_data_dir = app_handle.path().app_data_dir().unwrap(); - let images_dir = app_data_dir.join("images"); - fs::create_dir_all(&images_dir)?; - - let file_name = format!("{}.png", Uuid::new_v4()); - let file_path = images_dir.join(&file_name); - - let bytes = STANDARD.decode(base64_data)?; - fs::write(&file_path, bytes)?; - - Ok(file_path.to_string_lossy().into_owned()) -} +} \ No newline at end of file diff --git a/src-tauri/src/api/database.rs b/src-tauri/src/api/database.rs new file mode 100644 index 0000000..06e6391 --- /dev/null +++ b/src-tauri/src/api/database.rs @@ -0,0 +1,161 @@ +use rand::distributions::Alphanumeric; +use rand::{thread_rng, Rng}; +use serde::{Deserialize, Serialize}; +use serde_json; +use sqlx::sqlite::{SqlitePool, SqlitePoolOptions}; +use std::fs; +use tauri::{Manager, Emitter}; +use tokio::runtime::Runtime; + +#[derive(Deserialize, Serialize)] +struct KeybindSetting { + keybind: Vec, +} + +pub fn setup(app: &mut tauri::App) -> Result<(), Box> { + let rt = Runtime::new().expect("Failed to create Tokio runtime"); + + let app_data_dir = app.path().app_data_dir().unwrap(); + fs::create_dir_all(&app_data_dir).expect("Failed to create app data directory"); + + let db_path = app_data_dir.join("data.db"); + let is_new_db = !db_path.exists(); + if is_new_db { + fs::File::create(&db_path).expect("Failed to create database file"); + } + + let db_url = format!("sqlite:{}", db_path.to_str().unwrap()); + let pool = rt.block_on(async { + SqlitePoolOptions::new() + .max_connections(5) + .connect(&db_url) + .await + .expect("Failed to create pool") + }); + + rt.block_on(async { + // Setup settings table + sqlx::query( + "CREATE TABLE IF NOT EXISTS settings ( + key TEXT PRIMARY KEY, + value TEXT NOT NULL + )" + ) + .execute(&pool) + .await + .expect("Failed to create settings table"); + + let existing_keybind = sqlx::query_scalar::<_, Option>( + "SELECT value FROM settings WHERE key = 'keybind'" + ) + .fetch_one(&pool) + .await; + + match existing_keybind { + Ok(Some(_)) => { + }, + Ok(None) => { + let default_keybind = KeybindSetting { + keybind: vec!["Meta".to_string(), "V".to_string()], + }; + let json = serde_json::to_string(&default_keybind).unwrap(); + + sqlx::query( + "INSERT INTO settings (key, value) VALUES ('keybind', ?)" + ) + .bind(json) + .execute(&pool) + .await + .expect("Failed to insert default keybind"); + }, + Err(e) => { + eprintln!("Failed to check existing keybind: {}", e); + } + } + + // Setup history table + sqlx::query( + "CREATE TABLE IF NOT EXISTS history ( + id TEXT PRIMARY KEY, + content_type TEXT NOT NULL, + content TEXT NOT NULL, + favicon TEXT, + timestamp DATETIME DEFAULT CURRENT_TIMESTAMP + )" + ) + .execute(&pool) + .await + .expect("Failed to create history table"); + + sqlx::query( + "CREATE INDEX IF NOT EXISTS idx_timestamp ON history (timestamp)" + ) + .execute(&pool) + .await + .expect("Failed to create index"); + + if is_new_db { + let id: String = thread_rng() + .sample_iter(&Alphanumeric) + .take(16) + .map(char::from) + .collect(); + sqlx::query("INSERT INTO history (id, content_type, content, timestamp) VALUES (?, ?, ?, CURRENT_TIMESTAMP)") + .bind(id) + .bind("text") + .bind("Welcome to your clipboard history!") + .execute(&pool) + .await + .expect("Failed to insert welcome message"); + } + }); + + app.manage(pool); + app.manage(rt); + + Ok(()) +} + +#[tauri::command] +pub async fn save_keybind( + app_handle: tauri::AppHandle, + keybind: Vec, + pool: tauri::State<'_, SqlitePool>, +) -> Result<(), String> { + let json = serde_json::to_string(&keybind).map_err(|e| e.to_string())?; + + sqlx::query("INSERT OR REPLACE INTO settings (key, value) VALUES ('keybind', ?)") + .bind(json) + .execute(&*pool) + .await + .map_err(|e| e.to_string())?; + + let keybind_str = keybind.join("+"); + app_handle + .emit("update-shortcut", keybind_str) + .map_err(|e| e.to_string())?; + + Ok(()) +} + +#[tauri::command] +pub async fn get_keybind(app_handle: tauri::AppHandle) -> Result, String> { + let pool = app_handle.state::(); + + let result = + sqlx::query_scalar::<_, String>("SELECT value FROM settings WHERE key = 'keybind'") + .fetch_optional(&*pool) + .await + .map_err(|e| e.to_string())?; + + match result { + Some(json) => { + let keybind: Vec = serde_json::from_str(&json).map_err(|e| e.to_string())?; + Ok(keybind) + } + None => { + let default_keybind = vec!["Meta".to_string(), "V".to_string()]; + Ok(default_keybind) + } + } +} diff --git a/src-tauri/src/api/hotkeys.rs b/src-tauri/src/api/hotkeys.rs index 6152ea0..fc33e73 100644 --- a/src-tauri/src/api/hotkeys.rs +++ b/src-tauri/src/api/hotkeys.rs @@ -1,128 +1,123 @@ use crate::utils::commands::center_window_on_current_monitor; -use crate::utils::keys::KeyCode; use global_hotkey::{ - hotkey::{ Code, HotKey, Modifiers }, - GlobalHotKeyEvent, - GlobalHotKeyManager, - HotKeyState, + hotkey::{Code, HotKey, Modifiers}, + GlobalHotKeyEvent, GlobalHotKeyManager, HotKeyState, }; -use parking_lot::Mutex; use std::str::FromStr; -use std::sync::Arc; -use tauri::{ AppHandle, Manager, Listener }; -use tauri_plugin_aptabase::EventTracker; +use std::cell::RefCell; +use tauri::{AppHandle, Manager, Listener}; -#[derive(Default)] -struct HotkeyState { - manager: Option, - registered_hotkey: Option, +thread_local! { + static HOTKEY_MANAGER: RefCell> = RefCell::new(None); } -unsafe impl Send for HotkeyState {} - pub fn setup(app_handle: tauri::AppHandle) { - let state = Arc::new(Mutex::new(HotkeyState::default())); - let manager = match GlobalHotKeyManager::new() { - Ok(manager) => manager, - Err(err) => { - eprintln!("Failed to initialize hotkey manager: {:?}", err); - return; - } - }; + let app_handle_clone = app_handle.clone(); - { - let mut hotkey_state = state.lock(); - hotkey_state.manager = Some(manager); - } + let manager = GlobalHotKeyManager::new().expect("Failed to initialize hotkey manager"); + HOTKEY_MANAGER.with(|m| *m.borrow_mut() = Some(manager)); let rt = app_handle.state::(); - let initial_keybind = rt - .block_on(crate::db::settings::get_keybind(app_handle.clone())) + let initial_keybind = rt.block_on(crate::api::database::get_keybind(app_handle_clone.clone())) .expect("Failed to get initial keybind"); - - if let Err(e) = register_shortcut(&state, &initial_keybind) { + let initial_shortcut = initial_keybind.join("+"); + + let initial_shortcut_for_update = initial_shortcut.clone(); + let initial_shortcut_for_save = initial_shortcut.clone(); + + if let Err(e) = register_shortcut(&initial_shortcut) { eprintln!("Error registering initial shortcut: {:?}", e); } - let state_clone = Arc::clone(&state); app_handle.listen("update-shortcut", move |event| { - let payload_str = event.payload().replace("\\\"", "\""); - let trimmed_str = payload_str.trim_matches('"'); - unregister_current_hotkey(&state_clone); + let payload_str = event.payload().to_string(); - let payload: Vec = serde_json::from_str(trimmed_str).unwrap_or_default(); - if let Err(e) = register_shortcut(&state_clone, &payload) { + if let Ok(old_hotkey) = parse_hotkey(&initial_shortcut_for_update) { + HOTKEY_MANAGER.with(|manager| { + if let Some(manager) = manager.borrow().as_ref() { + let _ = manager.unregister(old_hotkey); + } + }); + } + + if let Err(e) = register_shortcut(&payload_str) { eprintln!("Error re-registering shortcut: {:?}", e); } }); - let state_clone = Arc::clone(&state); app_handle.listen("save_keybind", move |event| { let payload_str = event.payload().to_string(); - unregister_current_hotkey(&state_clone); - let payload: Vec = serde_json::from_str(&payload_str).unwrap_or_default(); - if let Err(e) = register_shortcut(&state_clone, &payload) { + if let Ok(old_hotkey) = parse_hotkey(&initial_shortcut_for_save) { + HOTKEY_MANAGER.with(|manager| { + if let Some(manager) = manager.borrow().as_ref() { + let _ = manager.unregister(old_hotkey); + } + }); + } + + if let Err(e) = register_shortcut(&payload_str) { eprintln!("Error registering saved shortcut: {:?}", e); } }); - setup_hotkey_receiver(app_handle); -} - -fn setup_hotkey_receiver(app_handle: AppHandle) { - std::thread::spawn(move || { + let app_handle_for_hotkey = app_handle.clone(); + tauri::async_runtime::spawn(async move { loop { match GlobalHotKeyEvent::receiver().recv() { Ok(event) => { if event.state == HotKeyState::Released { continue; } - handle_hotkey_event(&app_handle); + handle_hotkey_event(&app_handle_for_hotkey); + } + Err(e) => { + eprintln!("Error receiving hotkey event: {:?}", e); } - Err(e) => eprintln!("Error receiving hotkey event: {:?}", e), } } }); } -fn unregister_current_hotkey(state: &Arc>) { - let mut hotkey_state = state.lock(); - if let Some(old_hotkey) = hotkey_state.registered_hotkey.take() { - if let Some(manager) = &hotkey_state.manager { - let _ = manager.unregister(old_hotkey); - } - } -} - -fn register_shortcut(state: &Arc>, shortcut: &[String]) -> Result<(), Box> { +fn register_shortcut(shortcut: &str) -> Result<(), Box> { let hotkey = parse_hotkey(shortcut)?; - let mut hotkey_state = state.lock(); - - if let Some(manager) = &hotkey_state.manager { - manager.register(hotkey.clone())?; - hotkey_state.registered_hotkey = Some(hotkey); + HOTKEY_MANAGER.with(|manager| { + if let Some(manager) = manager.borrow().as_ref() { + manager.register(hotkey)?; + } Ok(()) - } else { - Err("Hotkey manager not initialized".into()) - } + }) } -fn parse_hotkey(shortcut: &[String]) -> Result> { +fn parse_hotkey(shortcut: &str) -> Result> { let mut modifiers = Modifiers::empty(); let mut code = None; - for part in shortcut { + let shortcut = shortcut.replace("\"", ""); + + for part in shortcut.split('+') { + let part = part.trim().to_lowercase(); match part.as_str() { - "ControlLeft" => modifiers |= Modifiers::CONTROL, - "AltLeft" => modifiers |= Modifiers::ALT, - "ShiftLeft" => modifiers |= Modifiers::SHIFT, - "MetaLeft" => modifiers |= Modifiers::META, - key => code = Some(Code::from(KeyCode::from_str(key)?)), + "ctrl" | "control" | "controlleft" => modifiers |= Modifiers::CONTROL, + "alt" | "altleft" | "optionleft" => modifiers |= Modifiers::ALT, + "shift" | "shiftleft" => modifiers |= Modifiers::SHIFT, + "super" | "meta" | "cmd" | "metaleft" => modifiers |= Modifiers::META, + key => { + let key_code = if key.starts_with("key") { + "Key".to_string() + &key[3..].to_uppercase() + } else if key.len() == 1 && key.chars().next().unwrap().is_alphabetic() { + "Key".to_string() + &key.to_uppercase() + } else { + key.to_string() + }; + + code = Some(Code::from_str(&key_code) + .map_err(|_| format!("Invalid key code: {}", key_code))?); + } } } - let key_code = code.ok_or_else(|| "No valid key code found".to_string())?; + let key_code = code.ok_or_else(|| format!("No valid key code found in shortcut: {}", shortcut))?; Ok(HotKey::new(Some(modifiers), key_code)) } @@ -143,13 +138,4 @@ fn handle_hotkey_event(app_handle: &AppHandle) { center_window_on_current_monitor(&window); } - - let _ = app_handle.track_event( - "hotkey_triggered", - Some( - serde_json::json!({ - "action": if window.is_visible().unwrap() { "hide" } else { "show" } - }) - ) - ); -} \ No newline at end of file +} diff --git a/src-tauri/src/api/mod.rs b/src-tauri/src/api/mod.rs index e3f7afa..b513b8d 100644 --- a/src-tauri/src/api/mod.rs +++ b/src-tauri/src/api/mod.rs @@ -1,4 +1,5 @@ -pub mod clipboard; -pub mod hotkeys; -pub mod tray; pub mod updater; +pub mod clipboard; +pub mod database; +pub mod tray; +pub mod hotkeys; diff --git a/src-tauri/src/api/tray.rs b/src-tauri/src/api/tray.rs index 2ae2bfa..6b78b8c 100644 --- a/src-tauri/src/api/tray.rs +++ b/src-tauri/src/api/tray.rs @@ -1,15 +1,10 @@ -use tauri::{ menu::{ MenuBuilder, MenuItemBuilder }, tray::TrayIconBuilder, Emitter, Manager }; -use tauri_plugin_aptabase::EventTracker; +use tauri::{ + menu::{MenuBuilder, MenuItemBuilder}, tray::TrayIconBuilder, Emitter, Manager +}; pub fn setup(app: &mut tauri::App) -> Result<(), Box> { let window = app.get_webview_window("main").unwrap(); - let is_visible = window.is_visible().unwrap(); - let _ = app.track_event( - "tray_toggle", - Some(serde_json::json!({ - "action": if is_visible { "hide" } else { "show" } - })) - ); + let window_clone_for_tray = window.clone(); let icon_bytes = include_bytes!("../../icons/Square71x71Logo.png"); let icon = tauri::image::Image::from_bytes(icon_bytes).unwrap(); @@ -17,42 +12,32 @@ pub fn setup(app: &mut tauri::App) -> Result<(), Box> { let _tray = TrayIconBuilder::new() .menu( &MenuBuilder::new(app) - .items(&[&MenuItemBuilder::with_id("app_name", "Qopy").enabled(false).build(app)?]) + .items(&[&MenuItemBuilder::with_id("app_name", "Qopy") + .enabled(false) + .build(app)?]) .items(&[&MenuItemBuilder::with_id("show", "Show/Hide").build(app)?]) - .items(&[&MenuItemBuilder::with_id("settings", "Settings").build(app)?]) + .items(&[&MenuItemBuilder::with_id("keybind", "Change keybind").build(app)?]) .items(&[&MenuItemBuilder::with_id("quit", "Quit").build(app)?]) - .build()? + .build()?, ) - .on_menu_event(move |_app, event| { - match event.id().as_ref() { - "quit" => { - let _ = _app.track_event("app_quit", None); - std::process::exit(0); - } - "show" => { - let _ = _app.track_event( - "tray_toggle", - Some( - serde_json::json!({ - "action": if is_visible { "hide" } else { "show" } - }) - ) - ); - let is_visible = window.is_visible().unwrap(); - if is_visible { - window.hide().unwrap(); - } else { - window.show().unwrap(); - window.set_focus().unwrap(); - } - window.emit("main_route", ()).unwrap(); - } - "settings" => { - let _ = _app.track_event("tray_settings", None); - window.emit("settings", ()).unwrap(); - } - _ => (), + .on_menu_event(move |_app, event| match event.id().as_ref() { + "quit" => { + std::process::exit(0); } + "show" => { + let is_visible = window_clone_for_tray.is_visible().unwrap(); + if is_visible { + window_clone_for_tray.hide().unwrap(); + } else { + window_clone_for_tray.show().unwrap(); + window_clone_for_tray.set_focus().unwrap(); + } + window_clone_for_tray.emit("main_route", ()).unwrap(); + } + "keybind" => { + window_clone_for_tray.emit("change_keybind", ()).unwrap(); + } + _ => (), }) .icon(icon) .build(app)?; diff --git a/src-tauri/src/api/updater.rs b/src-tauri/src/api/updater.rs index da8737e..b8ef00e 100644 --- a/src-tauri/src/api/updater.rs +++ b/src-tauri/src/api/updater.rs @@ -1,8 +1,8 @@ -use tauri::{ async_runtime, AppHandle, Manager }; -use tauri_plugin_dialog::{ DialogExt, MessageDialogButtons, MessageDialogKind }; +use tauri::{AppHandle, async_runtime}; +use tauri_plugin_dialog::{DialogExt, MessageDialogKind, MessageDialogButtons}; use tauri_plugin_updater::UpdaterExt; -pub async fn check_for_updates(app: AppHandle, prompted: bool) { +pub async fn check_for_updates(app: AppHandle) { println!("Checking for updates..."); let updater = app.updater().unwrap(); @@ -18,42 +18,21 @@ pub async fn check_for_updates(app: AppHandle, prompted: bool) { "Would you like to install it now?", ]); - let window = app.get_webview_window("main").unwrap(); - window.show().unwrap(); - window.set_focus().unwrap(); - app.dialog() .message(msg) - .title("Qopy Update Available") - .buttons( - MessageDialogButtons::OkCancelCustom( - String::from("Install"), - String::from("Cancel") - ) - ) + .title("Update Available") + .buttons(MessageDialogButtons::OkCancelCustom(String::from("Install"), String::from("Cancel"))) .show(move |response| { if !response { return; } async_runtime::spawn(async move { - match - update.download_and_install( - |_, _| {}, - || {} - ).await - { + match update.download_and_install(|_, _| {}, || {}).await { Ok(_) => { app.dialog() - .message( - "Update installed successfully. The application needs to restart to apply the changes." - ) - .title("Qopy Update Installed") - .buttons( - MessageDialogButtons::OkCancelCustom( - String::from("Restart"), - String::from("Cancel") - ) - ) + .message("Update installed successfully. The application needs to restart to apply the changes.") + .title("Update Installed") + .buttons(MessageDialogButtons::OkCancelCustom(String::from("Restart"), String::from("Cancel"))) .show(move |response| { if response { app.restart(); @@ -63,9 +42,7 @@ pub async fn check_for_updates(app: AppHandle, prompted: bool) { Err(e) => { println!("Error installing new update: {:?}", e); app.dialog() - .message( - "Failed to install new update. The new update can be downloaded from Github" - ) + .message("Failed to install new update. The new update can be downloaded from Github") .kind(MessageDialogKind::Error) .show(|_| {}); } @@ -73,22 +50,9 @@ pub async fn check_for_updates(app: AppHandle, prompted: bool) { }); }); } - Ok(None) => { - println!("No updates available."); - } + Ok(None) => println!("No updates available."), Err(e) => { - if prompted { - let window = app.get_webview_window("main").unwrap(); - window.show().unwrap(); - window.set_focus().unwrap(); - - app.dialog() - .message("No updates available.") - .title("Qopy Update Check") - .show(|_| {}); - } - - println!("No updates available. {}", e.to_string()); + println!("Failed to check for updates: {:?}", e); } } } diff --git a/src-tauri/src/db/database.rs b/src-tauri/src/db/database.rs deleted file mode 100644 index 264d308..0000000 --- a/src-tauri/src/db/database.rs +++ /dev/null @@ -1,107 +0,0 @@ -use include_dir::{ include_dir, Dir }; -use sqlx::sqlite::{ SqlitePool, SqlitePoolOptions }; -use std::fs; -use tauri::Manager; -use tokio::runtime::Runtime as TokioRuntime; - -static MIGRATIONS_DIR: Dir = include_dir!("$CARGO_MANIFEST_DIR/src/db/migrations"); - -pub fn setup(app: &mut tauri::App) -> Result<(), Box> { - let rt = TokioRuntime::new().expect("Failed to create Tokio runtime"); - app.manage(rt); - - let rt = app.state::(); - - let app_data_dir = app.path().app_data_dir().unwrap(); - fs::create_dir_all(&app_data_dir).expect("Failed to create app data directory"); - - let db_path = app_data_dir.join("data.db"); - let is_new_db = !db_path.exists(); - if is_new_db { - fs::File::create(&db_path).expect("Failed to create database file"); - } - - let db_url = format!("sqlite:{}", db_path.to_str().unwrap()); - let pool = rt.block_on(async { - SqlitePoolOptions::new() - .max_connections(5) - .connect(&db_url).await - .expect("Failed to create pool") - }); - - app.manage(pool.clone()); - - rt.block_on(async { - apply_migrations(&pool).await?; - if is_new_db { - if let Err(e) = super::history::initialize_history(&pool).await { - eprintln!("Failed to initialize history: {}", e); - } - if let Err(e) = super::settings::initialize_settings(&pool).await { - eprintln!("Failed to initialize settings: {}", e); - } - } - Ok::<(), Box>(()) - })?; - - Ok(()) -} - -async fn apply_migrations(pool: &SqlitePool) -> Result<(), Box> { - sqlx - ::query( - "CREATE TABLE IF NOT EXISTS schema_version ( - version INTEGER PRIMARY KEY, - applied_at DATETIME DEFAULT CURRENT_TIMESTAMP - );" - ) - .execute(pool).await?; - - let current_version: Option = sqlx - ::query_scalar("SELECT MAX(version) FROM schema_version") - .fetch_one(pool).await?; - - let current_version = current_version.unwrap_or(0); - - let mut migration_files: Vec<(i64, &str)> = MIGRATIONS_DIR.files() - .filter_map(|file| { - let file_name = file.path().file_name()?.to_str()?; - if file_name.ends_with(".sql") && file_name.starts_with("v") { - let version: i64 = file_name - .trim_start_matches("v") - .trim_end_matches(".sql") - .parse() - .ok()?; - Some((version, file.contents_utf8()?)) - } else { - None - } - }) - .collect(); - - migration_files.sort_by_key(|(version, _)| *version); - - for (version, content) in migration_files { - if version > current_version { - let statements: Vec<&str> = content - .split(';') - .map(|s| s.trim()) - .filter(|s| !s.is_empty()) - .collect(); - - for statement in statements { - sqlx - ::query(statement) - .execute(pool).await - .map_err(|e| format!("Failed to execute migration {}: {}", version, e))?; - } - - sqlx - ::query("INSERT INTO schema_version (version) VALUES (?)") - .bind(version) - .execute(pool).await?; - } - } - - Ok(()) -} diff --git a/src-tauri/src/db/history.rs b/src-tauri/src/db/history.rs deleted file mode 100644 index 4f70310..0000000 --- a/src-tauri/src/db/history.rs +++ /dev/null @@ -1,217 +0,0 @@ -use crate::utils::types::{ ContentType, HistoryItem }; -use base64::{ engine::general_purpose::STANDARD, Engine }; -use rand::{ rng, Rng }; -use rand::distr::Alphanumeric; -use sqlx::{ Row, SqlitePool }; -use std::fs; -use tauri_plugin_aptabase::EventTracker; - -pub async fn initialize_history(pool: &SqlitePool) -> Result<(), Box> { - let id: String = rng() - .sample_iter(&Alphanumeric) - .take(16) - .map(char::from) - .collect(); - - sqlx::query( - "INSERT INTO history (id, source, content_type, content, timestamp) VALUES (?, ?, ?, ?, CURRENT_TIMESTAMP)" - ) - .bind(id) - .bind("System") - .bind("text") - .bind("Welcome to your clipboard history!") - .execute(pool).await?; - - Ok(()) -} - -#[tauri::command] -pub async fn get_history(pool: tauri::State<'_, SqlitePool>) -> Result, String> { - let rows = sqlx - ::query( - "SELECT id, source, source_icon, content_type, content, favicon, timestamp, language FROM history ORDER BY timestamp DESC" - ) - .fetch_all(&*pool).await - .map_err(|e| e.to_string())?; - - let items = rows - .iter() - .map(|row| HistoryItem { - id: row.get("id"), - source: row.get("source"), - source_icon: row.get("source_icon"), - content_type: ContentType::from(row.get::("content_type")), - content: row.get("content"), - favicon: row.get("favicon"), - timestamp: row.get("timestamp"), - language: row.get("language"), - }) - .collect(); - - Ok(items) -} - -#[tauri::command] -pub async fn add_history_item( - app_handle: tauri::AppHandle, - pool: tauri::State<'_, SqlitePool>, - item: HistoryItem -) -> Result<(), String> { - let (id, source, source_icon, content_type, content, favicon, timestamp, language) = - item.to_row(); - - let existing = sqlx - ::query("SELECT id FROM history WHERE content = ? AND content_type = ?") - .bind(&content) - .bind(&content_type) - .fetch_optional(&*pool).await - .map_err(|e| e.to_string())?; - - match existing { - Some(_) => { - sqlx - ::query( - "UPDATE history SET timestamp = strftime('%Y-%m-%dT%H:%M:%f+00:00', 'now') WHERE content = ? AND content_type = ?" - ) - .bind(&content) - .bind(&content_type) - .execute(&*pool).await - .map_err(|e| e.to_string())?; - } - None => { - sqlx - ::query( - "INSERT INTO history (id, source, source_icon, content_type, content, favicon, timestamp, language) VALUES (?, ?, ?, ?, ?, ?, ?, ?)" - ) - .bind(id) - .bind(source) - .bind(source_icon) - .bind(content_type) - .bind(content) - .bind(favicon) - .bind(timestamp) - .bind(language) - .execute(&*pool).await - .map_err(|e| e.to_string())?; - } - } - - let _ = app_handle.track_event( - "history_item_added", - Some(serde_json::json!({ - "content_type": item.content_type.to_string() - })) - ); - - Ok(()) -} - -#[tauri::command] -pub async fn search_history( - pool: tauri::State<'_, SqlitePool>, - query: String -) -> Result, String> { - if query.trim().is_empty() { - return Ok(Vec::new()); - } - - let query = format!("%{}%", query); - - let rows = sqlx - ::query( - "SELECT id, source, source_icon, content_type, content, favicon, timestamp, language - FROM history - WHERE content LIKE ? - ORDER BY timestamp DESC - LIMIT 100" - ) - .bind(query) - .fetch_all(&*pool).await - .map_err(|e| e.to_string())?; - - let mut items = Vec::with_capacity(rows.len()); - for row in rows.iter() { - items.push(HistoryItem { - id: row.get("id"), - source: row.get("source"), - source_icon: row.get("source_icon"), - content_type: ContentType::from(row.get::("content_type")), - content: row.get("content"), - favicon: row.get("favicon"), - timestamp: row.get("timestamp"), - language: row.get("language"), - }); - } - - Ok(items) -} - -#[tauri::command] -pub async fn load_history_chunk( - pool: tauri::State<'_, SqlitePool>, - offset: i64, - limit: i64 -) -> Result, String> { - let rows = sqlx - ::query( - "SELECT id, source, source_icon, content_type, content, favicon, timestamp, language FROM history ORDER BY timestamp DESC LIMIT ? OFFSET ?" - ) - .bind(limit) - .bind(offset) - .fetch_all(&*pool).await - .map_err(|e| e.to_string())?; - - let items = rows - .iter() - .map(|row| HistoryItem { - id: row.get("id"), - source: row.get("source"), - source_icon: row.get("source_icon"), - content_type: ContentType::from(row.get::("content_type")), - content: row.get("content"), - favicon: row.get("favicon"), - timestamp: row.get("timestamp"), - language: row.get("language"), - }) - .collect(); - - Ok(items) -} - -#[tauri::command] -pub async fn delete_history_item( - app_handle: tauri::AppHandle, - pool: tauri::State<'_, SqlitePool>, - id: String -) -> Result<(), String> { - sqlx - ::query("DELETE FROM history WHERE id = ?") - .bind(id) - .execute(&*pool).await - .map_err(|e| e.to_string())?; - - let _ = app_handle.track_event("history_item_deleted", None); - - Ok(()) -} - -#[tauri::command] -pub async fn clear_history( - app_handle: tauri::AppHandle, - pool: tauri::State<'_, SqlitePool> -) -> Result<(), String> { - sqlx - ::query("DELETE FROM history") - .execute(&*pool).await - .map_err(|e| e.to_string())?; - - let _ = app_handle.track_event("history_cleared", None); - - Ok(()) -} - -#[tauri::command] -pub async fn read_image(filename: String) -> Result { - let bytes = fs::read(filename).map_err(|e| e.to_string())?; - Ok(STANDARD.encode(bytes)) -} diff --git a/src-tauri/src/db/migrations/v1.sql b/src-tauri/src/db/migrations/v1.sql deleted file mode 100644 index e2028ae..0000000 --- a/src-tauri/src/db/migrations/v1.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE IF NOT EXISTS settings ( - key TEXT PRIMARY KEY, - value TEXT NOT NULL -); - -CREATE TABLE IF NOT EXISTS history ( - id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))), - content_type TEXT NOT NULL, - content TEXT NOT NULL, - favicon TEXT, - timestamp DATETIME DEFAULT CURRENT_TIMESTAMP -); \ No newline at end of file diff --git a/src-tauri/src/db/migrations/v2.sql b/src-tauri/src/db/migrations/v2.sql deleted file mode 100644 index 312c5ef..0000000 --- a/src-tauri/src/db/migrations/v2.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE history ADD COLUMN source TEXT DEFAULT 'System' NOT NULL; -ALTER TABLE history ADD COLUMN source_icon TEXT; -ALTER TABLE history ADD COLUMN language TEXT; diff --git a/src-tauri/src/db/migrations/v3.sql b/src-tauri/src/db/migrations/v3.sql deleted file mode 100644 index e299cae..0000000 --- a/src-tauri/src/db/migrations/v3.sql +++ /dev/null @@ -1 +0,0 @@ -INSERT INTO settings (key, value) VALUES ('autostart', 'true'); diff --git a/src-tauri/src/db/mod.rs b/src-tauri/src/db/mod.rs deleted file mode 100644 index 8c147c6..0000000 --- a/src-tauri/src/db/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod database; -pub mod history; -pub mod settings; diff --git a/src-tauri/src/db/settings.rs b/src-tauri/src/db/settings.rs deleted file mode 100644 index 2539ab7..0000000 --- a/src-tauri/src/db/settings.rs +++ /dev/null @@ -1,87 +0,0 @@ -use serde::{ Deserialize, Serialize }; -use serde_json; -use sqlx::Row; -use sqlx::SqlitePool; -use tauri::{ Emitter, Manager }; -use tauri_plugin_aptabase::EventTracker; - -#[derive(Deserialize, Serialize)] -struct KeybindSetting { - keybind: Vec, -} - -pub async fn initialize_settings(pool: &SqlitePool) -> Result<(), Box> { - let default_keybind = KeybindSetting { - keybind: vec!["Meta".to_string(), "V".to_string()], - }; - let json = serde_json::to_string(&default_keybind)?; - - sqlx - ::query("INSERT INTO settings (key, value) VALUES ('keybind', ?)") - .bind(json) - .execute(pool).await?; - - Ok(()) -} - -#[tauri::command] -pub async fn get_setting( - pool: tauri::State<'_, SqlitePool>, - key: String -) -> Result { - let row = sqlx - ::query("SELECT value FROM settings WHERE key = ?") - .bind(key) - .fetch_optional(&*pool).await - .map_err(|e| e.to_string())?; - - Ok(row.map(|r| r.get("value")).unwrap_or_default()) -} - -#[tauri::command] -pub async fn save_setting( - app_handle: tauri::AppHandle, - pool: tauri::State<'_, SqlitePool>, - key: String, - value: String -) -> Result<(), String> { - sqlx - ::query("INSERT OR REPLACE INTO settings (key, value) VALUES (?, ?)") - .bind(key.clone()) - .bind(value.clone()) - .execute(&*pool).await - .map_err(|e| e.to_string())?; - - let _ = app_handle.track_event( - "setting_saved", - Some(serde_json::json!({ - "key": key - })) - ); - - if key == "keybind" { - let _ = app_handle.emit("update-shortcut", &value).map_err(|e| e.to_string())?; - } - - Ok(()) -} - -#[tauri::command] -pub async fn get_keybind(app_handle: tauri::AppHandle) -> Result, String> { - let pool = app_handle.state::(); - - let row = sqlx - ::query("SELECT value FROM settings WHERE key = 'keybind'") - .fetch_optional(&*pool).await - .map_err(|e| e.to_string())?; - - let json = row - .map(|r| r.get::("value")) - .unwrap_or_else(|| { - serde_json - ::to_string(&vec!["MetaLeft".to_string(), "KeyV".to_string()]) - .expect("Failed to serialize default keybind") - }); - - serde_json::from_str::>(&json).map_err(|e| e.to_string()) -} diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 3629212..ac84c7b 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -1,108 +1,75 @@ -#![cfg_attr(all(not(debug_assertions), target_os = "windows"), windows_subsystem = "windows")] +#![cfg_attr( + all(not(debug_assertions), target_os = "windows"), + windows_subsystem = "windows" +)] mod api; -mod db; mod utils; -use sqlx::sqlite::SqlitePoolOptions; -use std::fs; use tauri::Manager; -use tauri_plugin_aptabase::{ EventTracker, InitOptions }; +use tauri::WebviewUrl; +use tauri::WebviewWindow; use tauri_plugin_autostart::MacosLauncher; use tauri_plugin_prevent_default::Flags; fn main() { - let runtime = tokio::runtime::Runtime::new().expect("Failed to create Tokio runtime"); - let _guard = runtime.enter(); - - tauri::Builder - ::default() + tauri::Builder::default() .plugin(tauri_plugin_clipboard::init()) .plugin(tauri_plugin_os::init()) .plugin(tauri_plugin_sql::Builder::default().build()) .plugin(tauri_plugin_dialog::init()) .plugin(tauri_plugin_fs::init()) .plugin(tauri_plugin_updater::Builder::default().build()) + .plugin(tauri_plugin_autostart::init( + MacosLauncher::LaunchAgent, + Some(vec![]), + )) .plugin( - tauri_plugin_aptabase::Builder - ::new("A-SH-8937252746") - .with_options(InitOptions { - host: Some("https://aptabase.pandadev.net".to_string()), - flush_interval: None, - }) - .with_panic_hook( - Box::new(|client, info, msg| { - let location = info - .location() - .map(|loc| format!("{}:{}:{}", loc.file(), loc.line(), loc.column())) - .unwrap_or_else(|| "".to_string()); - - let _ = client.track_event( - "panic", - Some( - serde_json::json!({ - "info": format!("{} ({})", msg, location), - }) - ) - ); - }) - ) - .build() - ) - .plugin(tauri_plugin_autostart::init(MacosLauncher::LaunchAgent, Some(vec![]))) - .plugin( - tauri_plugin_prevent_default::Builder - ::new() + tauri_plugin_prevent_default::Builder::new() .with_flags(Flags::all().difference(Flags::CONTEXT_MENU)) - .build() + .build(), ) .setup(|app| { - #[cfg(target_os = "macos")] - app.set_activation_policy(tauri::ActivationPolicy::Accessory); - - let app_data_dir = app.path().app_data_dir().unwrap(); - utils::logger::init_logger(&app_data_dir).expect("Failed to initialize logger"); - - fs::create_dir_all(&app_data_dir).expect("Failed to create app data directory"); - - let db_path = app_data_dir.join("data.db"); - let is_new_db = !db_path.exists(); - if is_new_db { - fs::File::create(&db_path).expect("Failed to create database file"); - } - - let db_url = format!("sqlite:{}", db_path.to_str().unwrap()); - let app_handle = app.handle().clone(); - let app_handle_clone = app_handle.clone(); - tauri::async_runtime::spawn(async move { - let pool = SqlitePoolOptions::new() - .max_connections(5) - .connect(&db_url).await - .expect("Failed to create pool"); + let main_window = if let Some(window) = app.get_webview_window("main") { + window + } else { + WebviewWindow::builder( + app.handle(), + "main", + WebviewUrl::App("index.html".into()) + ) + .title("Qopy") + .resizable(false) + .fullscreen(false) + .inner_size(750.0, 474.0) + .focused(true) + .skip_taskbar(true) + .visible(false) + .decorations(false) + .transparent(true) + .always_on_top(false) + .build()? + }; - app_handle_clone.manage(pool); - }); - - let main_window = app.get_webview_window("main"); - - let _ = db::database::setup(app); + let _ = api::database::setup(app); api::hotkeys::setup(app_handle.clone()); api::tray::setup(app)?; api::clipboard::setup(app.handle()); let _ = api::clipboard::start_monitor(app_handle.clone()); - utils::commands::center_window_on_current_monitor(main_window.as_ref().unwrap()); - main_window - .as_ref() - .map(|w| w.hide()) - .unwrap_or(Ok(()))?; + utils::commands::center_window_on_current_monitor(&main_window); + main_window.hide()?; - let _ = app.track_event("app_started", None); + let app_data_dir = app + .path() + .app_data_dir() + .expect("Failed to get app data directory"); + api::clipboard::set_app_data_dir(app_data_dir); tauri::async_runtime::spawn(async move { - api::updater::check_for_updates(app_handle, false).await; + api::updater::check_for_updates(app_handle).await; }); Ok(()) @@ -115,21 +82,13 @@ fn main() { } } }) - .invoke_handler( - tauri::generate_handler![ - api::clipboard::write_and_paste, - db::history::get_history, - db::history::add_history_item, - db::history::search_history, - db::history::load_history_chunk, - db::history::delete_history_item, - db::history::clear_history, - db::history::read_image, - db::settings::get_setting, - db::settings::save_setting, - utils::commands::fetch_page_meta - ] - ) + .invoke_handler(tauri::generate_handler![ + api::clipboard::get_image_path, + api::clipboard::write_and_paste, + api::clipboard::read_image, + api::database::save_keybind, + api::database::get_keybind + ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); -} \ No newline at end of file +} diff --git a/src-tauri/src/utils/commands.rs b/src-tauri/src/utils/commands.rs index ebf71b1..5b1a736 100644 --- a/src-tauri/src/utils/commands.rs +++ b/src-tauri/src/utils/commands.rs @@ -1,137 +1,30 @@ -use applications::{AppInfoContext, AppInfo, AppTrait, utils::image::RustImage}; -use base64::{ engine::general_purpose::STANDARD, Engine }; -use image::codecs::png::PngEncoder; use tauri::PhysicalPosition; -use meta_fetcher; pub fn center_window_on_current_monitor(window: &tauri::WebviewWindow) { - if - let Some(monitor) = window - .available_monitors() + if let Some(monitor) = window.available_monitors().unwrap().iter().find(|m| { + let primary_monitor = window + .primary_monitor() .unwrap() - .iter() - .find(|m| { - let primary_monitor = window - .primary_monitor() - .unwrap() - .expect("Failed to get primary monitor"); - let mouse_position = primary_monitor.position(); - let monitor_position = m.position(); - let monitor_size = m.size(); - mouse_position.x >= monitor_position.x && - mouse_position.x < monitor_position.x + (monitor_size.width as i32) && - mouse_position.y >= monitor_position.y && - mouse_position.y < monitor_position.y + (monitor_size.height as i32) - }) - { + .expect("Failed to get primary monitor"); + let mouse_position = primary_monitor.position(); + let monitor_position = m.position(); + let monitor_size = m.size(); + mouse_position.x >= monitor_position.x + && mouse_position.x < monitor_position.x + monitor_size.width as i32 + && mouse_position.y >= monitor_position.y + && mouse_position.y < monitor_position.y + monitor_size.height as i32 + }) { let monitor_size = monitor.size(); let window_size = window.outer_size().unwrap(); - let x = ((monitor_size.width as i32) - (window_size.width as i32)) / 2; - let y = ((monitor_size.height as i32) - (window_size.height as i32)) / 2; + let x = (monitor_size.width as i32 - window_size.width as i32) / 2; + let y = (monitor_size.height as i32 - window_size.height as i32) / 2; window - .set_position(PhysicalPosition::new(monitor.position().x + x, monitor.position().y + y)) + .set_position(PhysicalPosition::new( + monitor.position().x + x, + monitor.position().y + y, + )) .unwrap(); } -} - -pub fn get_app_info() -> (String, Option) { - println!("Getting app info"); - let mut ctx = AppInfoContext::new(vec![]); - println!("Created AppInfoContext"); - ctx.refresh_apps().unwrap(); - println!("Refreshed apps"); - match ctx.get_frontmost_application() { - Ok(window) => { - println!("Found frontmost application: {}", window.name); - let name = window.name.clone(); - let icon = window - .load_icon() - .ok() - .map(|i| { - println!("Loading icon for {}", name); - let png = i.to_png().unwrap(); - let encoded = STANDARD.encode(png.get_bytes()); - println!("Icon encoded successfully"); - encoded - }); - println!("Returning app info: {} with icon: {}", name, icon.is_some()); - (name, icon) - } - Err(e) => { - println!("Failed to get frontmost application: {:?}", e); - ("System".to_string(), None) - } - } -} - -fn _process_icon_to_base64(path: &str) -> Result> { - let img = image::open(path)?; - let resized = img.resize(128, 128, image::imageops::FilterType::Lanczos3); - let mut png_buffer = Vec::new(); - resized.write_with_encoder(PngEncoder::new(&mut png_buffer))?; - Ok(STANDARD.encode(png_buffer)) -} - -pub fn detect_color(color: &str) -> bool { - let color = color.trim().to_lowercase(); - - // hex - if color.starts_with('#') && color.len() == color.trim_end_matches(char::is_whitespace).len() { - let hex = &color[1..]; - return match hex.len() { - 3 | 6 | 8 => hex.chars().all(|c| c.is_ascii_hexdigit()), - _ => false, - }; - } - - // rgb/rgba - if - (color.starts_with("rgb(") || color.starts_with("rgba(")) && - color.ends_with(")") && - !color[..color.len() - 1].contains(")") - { - let values = color - .trim_start_matches("rgba(") - .trim_start_matches("rgb(") - .trim_end_matches(')') - .split(',') - .collect::>(); - - return match values.len() { - 3 | 4 => values.iter().all(|v| v.trim().parse::().is_ok()), - _ => false, - }; - } - - // hsl/hsla - if - (color.starts_with("hsl(") || color.starts_with("hsla(")) && - color.ends_with(")") && - !color[..color.len() - 1].contains(")") - { - let values = color - .trim_start_matches("hsla(") - .trim_start_matches("hsl(") - .trim_end_matches(')') - .split(',') - .collect::>(); - - return match values.len() { - 3 | 4 => values.iter().all(|v| v.trim().parse::().is_ok()), - _ => false, - }; - } - - false -} - -#[tauri::command] -pub async fn fetch_page_meta(url: String) -> Result<(String, Option), String> { - let metadata = meta_fetcher - ::fetch_metadata(&url) - .map_err(|e| format!("Failed to fetch metadata: {}", e))?; - - Ok((metadata.title.unwrap_or_else(|| "No title found".to_string()), metadata.image)) -} +} \ No newline at end of file diff --git a/src-tauri/src/utils/favicon.rs b/src-tauri/src/utils/favicon.rs deleted file mode 100644 index 45568dc..0000000 --- a/src-tauri/src/utils/favicon.rs +++ /dev/null @@ -1,23 +0,0 @@ -use base64::engine::general_purpose::STANDARD; -use base64::Engine; -use image::ImageFormat; -use reqwest; -use url::Url; - -pub async fn fetch_favicon_as_base64( - url: Url -) -> Result, Box> { - let client = reqwest::Client::new(); - let favicon_url = format!("https://favicone.com/{}", url.host_str().unwrap()); - let response = client.get(&favicon_url).send().await?; - - if response.status().is_success() { - let bytes = response.bytes().await?; - let img = image::load_from_memory(&bytes)?; - let mut png_bytes: Vec = Vec::new(); - img.write_to(&mut std::io::Cursor::new(&mut png_bytes), ImageFormat::Png)?; - Ok(Some(STANDARD.encode(&png_bytes))) - } else { - Ok(None) - } -} diff --git a/src-tauri/src/utils/keys.rs b/src-tauri/src/utils/keys.rs deleted file mode 100644 index 01b6836..0000000 --- a/src-tauri/src/utils/keys.rs +++ /dev/null @@ -1,120 +0,0 @@ -use global_hotkey::hotkey::Code; -use std::str::FromStr; - -pub struct KeyCode(Code); - -impl FromStr for KeyCode { - type Err = String; - - fn from_str(s: &str) -> Result { - let code = match s { - "Backquote" => Code::Backquote, - "Backslash" => Code::Backslash, - "BracketLeft" => Code::BracketLeft, - "BracketRight" => Code::BracketRight, - "Comma" => Code::Comma, - "Digit0" => Code::Digit0, - "Digit1" => Code::Digit1, - "Digit2" => Code::Digit2, - "Digit3" => Code::Digit3, - "Digit4" => Code::Digit4, - "Digit5" => Code::Digit5, - "Digit6" => Code::Digit6, - "Digit7" => Code::Digit7, - "Digit8" => Code::Digit8, - "Digit9" => Code::Digit9, - "Equal" => Code::Equal, - "KeyA" => Code::KeyA, - "KeyB" => Code::KeyB, - "KeyC" => Code::KeyC, - "KeyD" => Code::KeyD, - "KeyE" => Code::KeyE, - "KeyF" => Code::KeyF, - "KeyG" => Code::KeyG, - "KeyH" => Code::KeyH, - "KeyI" => Code::KeyI, - "KeyJ" => Code::KeyJ, - "KeyK" => Code::KeyK, - "KeyL" => Code::KeyL, - "KeyM" => Code::KeyM, - "KeyN" => Code::KeyN, - "KeyO" => Code::KeyO, - "KeyP" => Code::KeyP, - "KeyQ" => Code::KeyQ, - "KeyR" => Code::KeyR, - "KeyS" => Code::KeyS, - "KeyT" => Code::KeyT, - "KeyU" => Code::KeyU, - "KeyV" => Code::KeyV, - "KeyW" => Code::KeyW, - "KeyX" => Code::KeyX, - "KeyY" => Code::KeyY, - "KeyZ" => Code::KeyZ, - "Minus" => Code::Minus, - "Period" => Code::Period, - "Quote" => Code::Quote, - "Semicolon" => Code::Semicolon, - "Slash" => Code::Slash, - "Backspace" => Code::Backspace, - "CapsLock" => Code::CapsLock, - "Delete" => Code::Delete, - "Enter" => Code::Enter, - "Space" => Code::Space, - "Tab" => Code::Tab, - "End" => Code::End, - "Home" => Code::Home, - "Insert" => Code::Insert, - "PageDown" => Code::PageDown, - "PageUp" => Code::PageUp, - "ArrowDown" => Code::ArrowDown, - "ArrowLeft" => Code::ArrowLeft, - "ArrowRight" => Code::ArrowRight, - "ArrowUp" => Code::ArrowUp, - "NumLock" => Code::NumLock, - "Numpad0" => Code::Numpad0, - "Numpad1" => Code::Numpad1, - "Numpad2" => Code::Numpad2, - "Numpad3" => Code::Numpad3, - "Numpad4" => Code::Numpad4, - "Numpad5" => Code::Numpad5, - "Numpad6" => Code::Numpad6, - "Numpad7" => Code::Numpad7, - "Numpad8" => Code::Numpad8, - "Numpad9" => Code::Numpad9, - "NumpadAdd" => Code::NumpadAdd, - "NumpadDecimal" => Code::NumpadDecimal, - "NumpadDivide" => Code::NumpadDivide, - "NumpadMultiply" => Code::NumpadMultiply, - "NumpadSubtract" => Code::NumpadSubtract, - "Escape" => Code::Escape, - "PrintScreen" => Code::PrintScreen, - "ScrollLock" => Code::ScrollLock, - "Pause" => Code::Pause, - "AudioVolumeDown" => Code::AudioVolumeDown, - "AudioVolumeMute" => Code::AudioVolumeMute, - "AudioVolumeUp" => Code::AudioVolumeUp, - "F1" => Code::F1, - "F2" => Code::F2, - "F3" => Code::F3, - "F4" => Code::F4, - "F5" => Code::F5, - "F6" => Code::F6, - "F7" => Code::F7, - "F8" => Code::F8, - "F9" => Code::F9, - "F10" => Code::F10, - "F11" => Code::F11, - "F12" => Code::F12, - _ => { - return Err(format!("Unknown key code: {}", s)); - } - }; - Ok(KeyCode(code)) - } -} - -impl From for Code { - fn from(key_code: KeyCode) -> Self { - key_code.0 - } -} diff --git a/src-tauri/src/utils/logger.rs b/src-tauri/src/utils/logger.rs deleted file mode 100644 index d0e95c6..0000000 --- a/src-tauri/src/utils/logger.rs +++ /dev/null @@ -1,84 +0,0 @@ -use chrono; -use log::{ LevelFilter, SetLoggerError }; -use std::fs::{ File, OpenOptions }; -use std::io::Write; -use std::panic; - -pub struct FileLogger { - file: File, -} - -impl log::Log for FileLogger { - fn enabled(&self, _metadata: &log::Metadata) -> bool { - true - } - - fn log(&self, record: &log::Record) { - if self.enabled(record.metadata()) { - let mut file = self.file.try_clone().expect("Failed to clone file handle"); - - writeln!( - file, - "{} [{:<5}] {}: {} ({}:{})", - chrono::Local::now().format("%Y-%m-%d %H:%M:%S"), - record.level(), - record.target(), - record.args(), - record.file().unwrap_or("unknown"), - record.line().unwrap_or(0) - ).expect("Failed to write to log file"); - } - } - - fn flush(&self) { - self.file.sync_all().expect("Failed to flush log file"); - } -} - -pub fn init_logger(app_data_dir: &std::path::Path) -> Result<(), SetLoggerError> { - let logs_dir = app_data_dir.join("logs"); - std::fs::create_dir_all(&logs_dir).expect("Failed to create logs directory"); - - let log_path = logs_dir.join("app.log"); - let file = OpenOptions::new() - .create(true) - .append(true) - .open(&log_path) - .expect("Failed to open log file"); - - let panic_file = file.try_clone().expect("Failed to clone file handle"); - panic::set_hook( - Box::new(move |panic_info| { - let mut file = panic_file.try_clone().expect("Failed to clone file handle"); - - let location = panic_info - .location() - .map(|loc| format!("{}:{}:{}", loc.file(), loc.line(), loc.column())) - .unwrap_or_else(|| "unknown location".to_string()); - - let message = match panic_info.payload().downcast_ref::<&str>() { - Some(s) => *s, - None => - match panic_info.payload().downcast_ref::() { - Some(s) => s.as_str(), - None => "Unknown panic message", - } - }; - - let _ = writeln!( - file, - "{} [PANIC] rust_panic: {} ({})", - chrono::Local::now().format("%Y-%m-%d %H:%M:%S"), - message, - location - ); - }) - ); - - let logger = Box::new(FileLogger { file }); - unsafe { - log::set_logger_racy(Box::leak(logger))?; - } - log::set_max_level(LevelFilter::Debug); - Ok(()) -} diff --git a/src-tauri/src/utils/mod.rs b/src-tauri/src/utils/mod.rs index 78e50cb..6be336e 100644 --- a/src-tauri/src/utils/mod.rs +++ b/src-tauri/src/utils/mod.rs @@ -1,5 +1 @@ -pub mod commands; -pub mod favicon; -pub mod types; -pub mod logger; -pub mod keys; +pub mod commands; \ No newline at end of file diff --git a/src-tauri/src/utils/types.rs b/src-tauri/src/utils/types.rs deleted file mode 100644 index 4e6886f..0000000 --- a/src-tauri/src/utils/types.rs +++ /dev/null @@ -1,155 +0,0 @@ -use chrono::{ DateTime, Utc }; -use serde::{ Deserialize, Serialize }; -use std::fmt; -use uuid::Uuid; - -#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)] -pub struct HistoryItem { - pub id: String, - pub source: String, - pub source_icon: Option, - pub content_type: ContentType, - pub content: String, - pub favicon: Option, - pub timestamp: DateTime, - pub language: Option, -} - -#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)] -#[serde(rename_all = "lowercase")] -pub enum ContentType { - Text, - Image, - File, - Link, - Color, - Code, -} - -#[derive(Debug, Deserialize, Serialize)] -pub struct InfoText { - pub source: String, - pub content_type: ContentType, - pub characters: i32, - pub words: i32, - pub copied: DateTime, -} - -#[derive(Debug, Deserialize, Serialize)] -pub struct InfoImage { - pub source: String, - pub content_type: ContentType, - pub dimensions: String, - pub size: i64, - pub copied: DateTime, -} - -#[derive(Debug, Deserialize, Serialize)] -pub struct InfoFile { - pub source: String, - pub content_type: ContentType, - pub path: String, - pub filesize: i64, - pub copied: DateTime, -} - -#[derive(Debug, Deserialize, Serialize)] -pub struct InfoLink { - pub source: String, - pub content_type: ContentType, - pub title: Option, - pub url: String, - pub characters: i32, - pub copied: DateTime, -} - -#[derive(Debug, Deserialize, Serialize)] -pub struct InfoColor { - pub source: String, - pub content_type: ContentType, - pub hex: String, - pub rgb: String, - pub copied: DateTime, -} - -#[derive(Debug, Deserialize, Serialize)] -pub struct InfoCode { - pub source: String, - pub content_type: ContentType, - pub language: String, - pub lines: i32, - pub copied: DateTime, -} - -impl fmt::Display for ContentType { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - ContentType::Text => write!(f, "text"), - ContentType::Image => write!(f, "image"), - ContentType::File => write!(f, "file"), - ContentType::Link => write!(f, "link"), - ContentType::Color => write!(f, "color"), - ContentType::Code => write!(f, "code"), - } - } -} - -impl From for ContentType { - fn from(s: String) -> Self { - match s.to_lowercase().as_str() { - "text" => ContentType::Text, - "image" => ContentType::Image, - "file" => ContentType::File, - "link" => ContentType::Link, - "color" => ContentType::Color, - "code" => ContentType::Code, - _ => ContentType::Text, - } - } -} - -impl HistoryItem { - pub fn new( - source: String, - content_type: ContentType, - content: String, - favicon: Option, - source_icon: Option, - language: Option - ) -> Self { - Self { - id: Uuid::new_v4().to_string(), - source, - source_icon, - content_type, - content, - favicon, - timestamp: Utc::now(), - language, - } - } - - pub fn to_row( - &self - ) -> ( - String, - String, - Option, - String, - String, - Option, - DateTime, - Option, - ) { - ( - self.id.clone(), - self.source.clone(), - self.source_icon.clone(), - self.content_type.to_string(), - self.content.clone(), - self.favicon.clone(), - self.timestamp, - self.language.clone(), - ) - } -} diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index c6acd3e..a277188 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,6 +1,6 @@ { "productName": "Qopy", - "version": "0.4.0", + "version": "0.2.0", "identifier": "net.pandadev.qopy", "build": { "frontendDist": "../dist", @@ -51,7 +51,9 @@ "plugins": { "updater": { "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDExNDIzNjA1QjE0NjU1OTkKUldTWlZVYXhCVFpDRWNvNmt0UE5lQmZkblEyZGZiZ2tHelJvT2YvNVpLU1RIM1RKZFQrb2tzWWwK", - "endpoints": ["https://qopy.pandadev.net/"] + "endpoints": [ + "https://qopy.pandadev.net/" + ] } }, "$schema": "../node_modules/@tauri-apps/cli/schema.json" diff --git a/styles/index.scss b/styles/index.scss deleted file mode 100644 index 20a154d..0000000 --- a/styles/index.scss +++ /dev/null @@ -1,186 +0,0 @@ -$primary: #2e2d2b; -$accent: #feb453; -$divider: #ffffff0d; - -$text: #e5dfd5; -$text2: #ada9a1; -$mutedtext: #78756f; - -$search-height: 56px; -$sidebar-width: 286px; -$bottom-bar-height: 39px; -$info-panel-height: 160px; -$content-view-height: calc( - 100% - $search-height - $info-panel-height - $bottom-bar-height -); - -main { - width: 100vw; - height: 100vh; - background-color: $primary; - border: 1px solid $divider; - display: flex; - flex-direction: column; - border-radius: 12px; - justify-content: space-between; -} - -.container { - height: 376px; - width: 100%; - display: flex; -} - -.results { - display: flex; - flex-direction: column; - padding: 14px 8px; - gap: 8px; - min-width: 286px; - border-right: 1px solid var(--border); - - .time-separator { - font-size: 12px; - color: $text2; - font-family: SFRoundedSemiBold; - padding-left: 8px; - } - - .group { - & + .group { - margin-top: 16px; - } - - .time-separator { - margin-bottom: 8px; - } - - .results-group { - display: flex; - flex-direction: column; - } - } - - .favicon, - .image, - .icon { - width: 18px; - height: 18px; - } -} - -.right { - display: flex; - flex-direction: column; - width: 100%; -} - -.content { - height: 100%; - font-family: CommitMono !important; - font-size: 12px; - letter-spacing: 1; - border-radius: 10px; - width: 462px; - display: flex; - flex-direction: column; - align-items: flex-start; - overflow: hidden; - z-index: 2; - color: $text; - - &:not(:has(.image)) { - padding: 8px; - } - - span.content-text { - font-family: CommitMono !important; - white-space: pre-wrap; - word-wrap: break-word; - word-break: break-word; - max-width: 100%; - } - - .image { - width: 100%; - height: 100%; - object-fit: contain; - object-position: center; - } -} - -.information { - min-height: 160px; - width: 462px; - border-top: 1px solid $divider; - padding: 14px; - z-index: 1; - display: flex; - flex-direction: column; - gap: 14px; - - .title { - font-family: SFRoundedSemiBold; - font-size: 12px; - letter-spacing: 0.6px; - color: $text; - } - - .info-content { - display: flex; - gap: 0; - flex-direction: column; - - .info-row { - display: flex; - width: 100%; - font-size: 12px; - justify-content: space-between; - padding: 8px 0; - border-bottom: 1px solid $divider; - line-height: 1; - - &:last-child { - border-bottom: none; - padding-bottom: 0; - } - - &:first-child { - padding-top: 22px; - } - - p { - font-family: SFRoundedMedium; - color: $text2; - font-weight: 500; - flex-shrink: 0; - } - - span { - font-family: CommitMono; - color: $text; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - margin-left: 32px; - display: flex; - align-items: center; - gap: 4px; - - img { - width: 13px; - height: 13px; - object-fit: contain; - } - } - } - } -} - -.search-loading { - display: flex; - justify-content: center; - padding: 20px; - font-size: 16px; - color: var(--text-secondary); -} \ No newline at end of file diff --git a/styles/settings.scss b/styles/settings.scss deleted file mode 100644 index 1f0b682..0000000 --- a/styles/settings.scss +++ /dev/null @@ -1,235 +0,0 @@ -$primary: #2e2d2b; -$accent: #feb453; -$divider: #ffffff0d; - -$text: #e5dfd5; -$text2: #ada9a1; -$mutedtext: #78756f; - -main { - width: 100vw; - height: 100vh; - background-color: $primary; - border: 1px solid $divider; - display: flex; - flex-direction: column; - border-radius: 12px; - justify-content: space-between; -} - -.back { - position: absolute; - top: 16px; - left: 16px; - display: flex; - gap: 8px; - align-items: center; - - img { - background-color: $divider; - border-radius: 6px; - padding: 8px 6px; - } - - p { - color: $text2; - } -} - -p { - font-family: SFRoundedMedium; -} - -.settings-container { - width: 100%; - height: 100%; - margin-top: 26px; - position: relative; - font-size: 12px; - font-family: SFRoundedMedium; - - .settings { - position: absolute; - left: 50%; - transform: translateX(-50%); - margin-left: -26px; - display: flex; - gap: 24px; - - .names { - display: flex; - flex-direction: column; - gap: 16px; - - p { - font-family: SFRoundedSemiBold; - color: $text2; - display: flex; - justify-content: right; - } - } - - .actions { - display: flex; - flex-direction: column; - gap: 16px; - color: $mutedtext; - } - } -} - -.launch { - display: flex; - align-items: center; - gap: 6px; - - input[type="checkbox"] { - appearance: none; - width: 14px; - height: 14px; - background-color: transparent; - border-radius: 5px; - border: 1px solid $mutedtext; - position: relative; - cursor: pointer; - transition: background-color 0.2s; - - &:checked { - ~ .checkmark { - opacity: 1; - } - } - } - - .checkmark { - height: 14px; - width: 14px; - position: absolute; - opacity: 0; - transition: opacity 0.2s; - } - - p { - color: $text2; - } -} - -.keybind-input { - width: min-content; - white-space: nowrap; - padding: 6px; - border: 1px solid $divider; - color: $text2; - display: flex; - border-radius: 10px; - outline: none; - gap: 4px; - - .key { - color: $text2; - font-family: SFRoundedMedium; - background-color: $divider; - padding: 2px 6px; - border-radius: 6px; - font-size: 14px; - } -} - -.keybind-input:focus { - border: 1px solid rgba(255, 255, 255, 0.2); -} - -.empty-keybind { - border-color: rgba(255, 82, 82, 0.298); -} - -.top-bar { - width: 100%; - min-height: 56px; - border-bottom: 1px solid $divider; -} - -.bottom-bar { - height: 40px; - width: calc(100vw - 2px); - backdrop-filter: blur(18px); - background-color: hsla(40, 3%, 16%, 0.8); - position: fixed; - bottom: 1px; - left: 1px; - z-index: 100; - border-radius: 0 0 12px 12px; - display: flex; - flex-direction: row; - justify-content: space-between; - padding-inline: 12px; - padding-right: 6px; - padding-top: 1px; - align-items: center; - font-size: 14px; - border-top: 1px solid $divider; - - p { - color: $text2; - } - - .left { - display: flex; - align-items: center; - gap: 8px; - - .logo { - width: 18px; - height: 18px; - } - } - - .right { - display: flex; - align-items: center; - - .actions div { - display: flex; - align-items: center; - gap: 2px; - } - - .divider { - width: 2px; - height: 12px; - background-color: $divider; - margin-left: 8px; - margin-right: 4px; - transition: all 0.2s; - } - - .actions { - padding: 4px; - padding-left: 8px; - display: flex; - align-items: center; - gap: 8px; - border-radius: 7px; - background-color: transparent; - transition: all 0.2s; - cursor: pointer; - - p { - color: $text; - } - - &.disabled { - pointer-events: none; - opacity: 0.5; - } - } - - .actions:hover { - background-color: $divider; - } - - &:hover .actions:hover ~ .divider { - opacity: 0; - } - } -} diff --git a/types/keys.ts b/types/keys.ts deleted file mode 100644 index d81454f..0000000 --- a/types/keys.ts +++ /dev/null @@ -1,217 +0,0 @@ -export enum KeyValues { - Backquote = 'Backquote', - Backslash = 'Backslash', - BracketLeft = 'BracketLeft', - BracketRight = 'BracketRight', - Comma = 'Comma', - Digit0 = 'Digit0', - Digit1 = 'Digit1', - Digit2 = 'Digit2', - Digit3 = 'Digit3', - Digit4 = 'Digit4', - Digit5 = 'Digit5', - Digit6 = 'Digit6', - Digit7 = 'Digit7', - Digit8 = 'Digit8', - Digit9 = 'Digit9', - Equal = 'Equal', - KeyA = 'KeyA', - KeyB = 'KeyB', - KeyC = 'KeyC', - KeyD = 'KeyD', - KeyE = 'KeyE', - KeyF = 'KeyF', - KeyG = 'KeyG', - KeyH = 'KeyH', - KeyI = 'KeyI', - KeyJ = 'KeyJ', - KeyK = 'KeyK', - KeyL = 'KeyL', - KeyM = 'KeyM', - KeyN = 'KeyN', - KeyO = 'KeyO', - KeyP = 'KeyP', - KeyQ = 'KeyQ', - KeyR = 'KeyR', - KeyS = 'KeyS', - KeyT = 'KeyT', - KeyU = 'KeyU', - KeyV = 'KeyV', - KeyW = 'KeyW', - KeyX = 'KeyX', - KeyY = 'KeyY', - KeyZ = 'KeyZ', - Minus = 'Minus', - Period = 'Period', - Quote = 'Quote', - Semicolon = 'Semicolon', - Slash = 'Slash', - AltLeft = 'AltLeft', - AltRight = 'AltRight', - Backspace = 'Backspace', - CapsLock = 'CapsLock', - ContextMenu = 'ContextMenu', - ControlLeft = 'ControlLeft', - ControlRight = 'ControlRight', - Enter = 'Enter', - MetaLeft = 'MetaLeft', - MetaRight = 'MetaRight', - ShiftLeft = 'ShiftLeft', - ShiftRight = 'ShiftRight', - Space = 'Space', - Tab = 'Tab', - Delete = 'Delete', - End = 'End', - Home = 'Home', - Insert = 'Insert', - PageDown = 'PageDown', - PageUp = 'PageUp', - ArrowDown = 'ArrowDown', - ArrowLeft = 'ArrowLeft', - ArrowRight = 'ArrowRight', - ArrowUp = 'ArrowUp', - NumLock = 'NumLock', - Numpad0 = 'Numpad0', - Numpad1 = 'Numpad1', - Numpad2 = 'Numpad2', - Numpad3 = 'Numpad3', - Numpad4 = 'Numpad4', - Numpad5 = 'Numpad5', - Numpad6 = 'Numpad6', - Numpad7 = 'Numpad7', - Numpad8 = 'Numpad8', - Numpad9 = 'Numpad9', - NumpadAdd = 'NumpadAdd', - NumpadDecimal = 'NumpadDecimal', - NumpadDivide = 'NumpadDivide', - NumpadMultiply = 'NumpadMultiply', - NumpadSubtract = 'NumpadSubtract', - Escape = 'Escape', - PrintScreen = 'PrintScreen', - ScrollLock = 'ScrollLock', - Pause = 'Pause', - AudioVolumeDown = 'AudioVolumeDown', - AudioVolumeMute = 'AudioVolumeMute', - AudioVolumeUp = 'AudioVolumeUp', - F1 = 'F1', - F2 = 'F2', - F3 = 'F3', - F4 = 'F4', - F5 = 'F5', - F6 = 'F6', - F7 = 'F7', - F8 = 'F8', - F9 = 'F9', - F10 = 'F10', - F11 = 'F11', - F12 = 'F12', -} - -export enum KeyLabels { - Backquote = '`', - Backslash = '\\', - BracketLeft = '[', - BracketRight = ']', - Comma = ',', - Digit0 = '0', - Digit1 = '1', - Digit2 = '2', - Digit3 = '3', - Digit4 = '4', - Digit5 = '5', - Digit6 = '6', - Digit7 = '7', - Digit8 = '8', - Digit9 = '9', - Equal = '=', - KeyA = 'A', - KeyB = 'B', - KeyC = 'C', - KeyD = 'D', - KeyE = 'E', - KeyF = 'F', - KeyG = 'G', - KeyH = 'H', - KeyI = 'I', - KeyJ = 'J', - KeyK = 'K', - KeyL = 'L', - KeyM = 'M', - KeyN = 'N', - KeyO = 'O', - KeyP = 'P', - KeyQ = 'Q', - KeyR = 'R', - KeyS = 'S', - KeyT = 'T', - KeyU = 'U', - KeyV = 'V', - KeyW = 'W', - KeyX = 'X', - KeyY = 'Y', - KeyZ = 'Z', - Minus = '-', - Period = '.', - Quote = "'", - Semicolon = ';', - Slash = '/', - AltLeft = 'Alt', - AltRight = 'Alt (Right)', - Backspace = 'Backspace', - CapsLock = 'Caps Lock', - ContextMenu = 'Context Menu', - ControlLeft = 'Ctrl', - ControlRight = 'Ctrl (Right)', - Enter = 'Enter', - MetaLeft = 'Meta', - MetaRight = 'Meta (Right)', - ShiftLeft = 'Shift', - ShiftRight = 'Shift (Right)', - Space = 'Space', - Tab = 'Tab', - Delete = 'Delete', - End = 'End', - Home = 'Home', - Insert = 'Insert', - PageDown = 'Page Down', - PageUp = 'Page Up', - ArrowDown = '↓', - ArrowLeft = '←', - ArrowRight = '→', - ArrowUp = '↑', - NumLock = 'Num Lock', - Numpad0 = 'Numpad 0', - Numpad1 = 'Numpad 1', - Numpad2 = 'Numpad 2', - Numpad3 = 'Numpad 3', - Numpad4 = 'Numpad 4', - Numpad5 = 'Numpad 5', - Numpad6 = 'Numpad 6', - Numpad7 = 'Numpad 7', - Numpad8 = 'Numpad 8', - Numpad9 = 'Numpad 9', - NumpadAdd = 'Numpad +', - NumpadDecimal = 'Numpad .', - NumpadDivide = 'Numpad /', - NumpadMultiply = 'Numpad *', - NumpadSubtract = 'Numpad -', - Escape = 'Esc', - PrintScreen = 'Print Screen', - ScrollLock = 'Scroll Lock', - Pause = 'Pause', - AudioVolumeDown = 'Volume Down', - AudioVolumeMute = 'Volume Mute', - AudioVolumeUp = 'Volume Up', - F1 = 'F1', - F2 = 'F2', - F3 = 'F3', - F4 = 'F4', - F5 = 'F5', - F6 = 'F6', - F7 = 'F7', - F8 = 'F8', - F9 = 'F9', - F10 = 'F10', - F11 = 'F11', - F12 = 'F12', -} \ No newline at end of file diff --git a/types/types.ts b/types/types.ts deleted file mode 100644 index 43cdb16..0000000 --- a/types/types.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { v4 as uuidv4 } from "uuid"; - -export enum ContentType { - Text = "text", - Image = "image", - File = "file", - Link = "link", - Color = "color", - Code = "code", -} - -export class HistoryItem { - id: string; - source: string; - source_icon?: string; - content_type: ContentType; - content: string; - favicon?: string; - timestamp: Date; - language?: string; - - constructor( - source: string, - content_type: ContentType, - content: string, - favicon?: string, - source_icon?: string, - language?: string - ) { - this.id = uuidv4(); - this.source = source; - this.source_icon = source_icon; - this.content_type = content_type; - this.content = content; - this.favicon = favicon; - this.timestamp = new Date(); - this.language = language; - } - - toRow(): [ - string, - string, - string | undefined, - string, - string, - string | undefined, - Date, - string | undefined - ] { - return [ - this.id, - this.source, - this.source_icon, - this.content_type, - this.content, - this.favicon, - this.timestamp, - this.language, - ]; - } -} - -export interface Settings { - key: string; - value: string; -} - -export interface InfoText { - source: string; - content_type: ContentType.Text; - characters: number; - words: number; - copied: Date; -} - -export interface InfoImage { - source: string; - content_type: ContentType.Image; - dimensions: string; - size: number; - copied: Date; -} - -export interface InfoFile { - source: string; - content_type: ContentType.File; - path: string; - filesize: number; - copied: Date; -} - -export interface InfoLink { - source: string; - content_type: ContentType.Link; - title?: string; - url: string; - characters: number; - copied: Date; -} - -export interface InfoColor { - source: string; - content_type: ContentType.Color; - hex: string; - rgb: string; - hsl: string; - copied: Date; -} - -export interface InfoCode { - source: string; - content_type: ContentType.Code; - language: string; - lines: number; - copied: Date; -}