Compare commits

...

181 Commits

Author SHA1 Message Date
Fabian-Lars a61c7591bd apple 2026-05-01 14:36:03 +02:00
FabianLars f85c405b3a lockfile 2025-11-22 19:50:43 +01:00
FabianLars ad3212a159 switch to upstream linux backend again 2025-11-22 19:41:40 +01:00
FabianLars d3e07db4ad Merge remote-tracking branch 'origin/v2' into plugin/secure-storage 2025-11-22 19:34:38 +01:00
renovate[bot] 1db4b0719d chore(deps): update dependency typescript-eslint to v8.47.0 (#3117)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-21 10:47:11 +08:00
Andrew de Waal dff6fa986a feat(dialog) - Support picker mode for open dialog (#3030) (#3034)
Co-authored-by: Andrew de Waal <andrewldewaal@gmail.com>
2025-11-20 22:28:13 +01:00
Nazar Antoniuk a4aa53ab90 chore(shell): clarify that the code field in ExitStatus is intentionally left private (#3116)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-11-20 15:33:19 +01:00
liuzhch1 ae278ddf60 fix(log): custom writer to rotate log file when exceeds max_file_size (fix #707) (#3110) 2025-11-20 10:29:17 +01:00
Jacob Bolda e644f38673 remove token for oidc publishing (#3077) 2025-11-19 21:52:57 -06:00
Lucas Fernandes Nogueira 8bfa445023 chore(localhost): disable caching (#3112)
* chore(localhost): disable caching

mostly seeing this cache being a problem on CEF - the response is cached so app updates are not reflected properly

* fmt
2025-11-19 17:03:32 -03:00
Lucas Nogueira 14fb36e347 chore: remove test logs 2025-11-19 17:00:14 -03:00
Fabian-Lars 5767b848fa chore: add PR ref in updater changefile
Added reference to pull request for clarity on changes.
2025-11-18 12:11:12 +01:00
renovate[bot] 277a45f56c chore(deps): update dependency rollup to v4.53.2 (#3103)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-18 00:07:40 +08:00
renovate[bot] 8dbe7e3233 chore(deps): update dependency typescript-eslint to v8.46.4 (v2) (#3105)
* chore(deps): update dependency typescript-eslint to v8.46.4

* Fix audit (bump js-yaml)

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-11-17 23:44:02 +08:00
Blaine c23fa03f07 feat(dialog): add xdg-portal as an optional feature for rfd (#3098) 2025-11-17 14:56:02 +01:00
Kingsword 631d0e256a fix(barcode-scanner): fix the cameraView is not removed after scanning in iOS (#2440)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-11-16 22:31:30 +01:00
Ben Clarke b4348cee92 fix(nfc): Resolve boolean in isAvailable to agree with TypeScript API (#3101)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-11-13 20:38:15 +01:00
renovate[bot] 3019063ae1 chore(deps): update dependency rollup to v4.53.1 (#3093)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-12 22:06:11 +08:00
renovate[bot] 944614f46a chore(deps): update dependency @tauri-apps/cli to v2.9.4 (#3100)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-12 21:15:09 +08:00
Tony a368cef912 docs(updater): installer args and on_before_exit (#3099)
* docs(updater): installer args and `on_before_exit`

* Update plugins/updater/src/updater.rs

Co-authored-by: Fabian-Lars <github@fabianlars.de>

* Explicitly state there are internal args

* s
2025-11-12 20:49:41 +08:00
Fabian-Lars 27790aa67c chore: fix upload test on macos ci (#3097) 2025-11-11 22:56:09 +01:00
Matthew Richardson ad910b1135 feat(upload): Add HTTP method selection for upload (#2991)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-11-10 21:31:57 +01:00
Fabian-Lars 6b854421a1 docs(localhost): improve readme example, closes #3095 2025-11-10 21:27:39 +01:00
Fabian-Lars 5438a5cd22 chore: apply clippy fixes (#3092) 2025-11-09 18:43:17 +01:00
Fabian-Lars 5cd7778723 docs(dialog): add/fix doc item links, closes #3089 (#3091) 2025-11-09 17:07:35 +01:00
renovate[bot] 1a03e9761f chore(deps): update dependency @tauri-apps/cli to v2.9.3 (#3088)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-08 13:34:05 +08:00
renovate[bot] 1d4bffadda chore(deps): update eslint monorepo to v9.39.1 (#3086)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-08 12:36:37 +08:00
renovate[bot] b8794272ae chore(deps): update dependency typescript-eslint to v8.46.3 (#3083)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-08 12:02:18 +08:00
Michelle Tilley 2a625adff3 feat(log): Allow a log formatter per target (#3065)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-11-04 15:52:46 +01:00
FabianLars 371cd8227c chore(deps): update pino to 9.14 to remove fast-redact 2025-11-04 10:00:51 +01:00
renovate[bot] 70ef6f8d3e chore(deps): update eslint monorepo to v9.39.0 (#3079)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-04 09:54:50 +01:00
renovate[bot] 5f0ac1436f chore(deps): update dependency @tauri-apps/cli to v2.9.2 (#3078)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-02 09:50:14 +08:00
Fabian-Lars ea172bfa3c docs(global-shortcut): import Emitter instead of Manager in example 2025-10-29 11:46:16 +01:00
FabianLars 6aead24047 Revert "chore: temp delete updater changefile"
This reverts commit b5550a3b0d.
2025-10-27 11:43:23 +01:00
github-actions[bot] e7a68fa637 publish new versions (#3068)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-27 11:31:06 +01:00
FabianLars b5550a3b0d chore: temp delete updater changefile 2025-10-27 11:13:33 +01:00
FabianLars 93426f8512 fix: fix docsrs builds 2025-10-27 11:12:56 +01:00
FabianLars 4ee61e055e Revert "chore: temp delete updater changefile"
This reverts commit 6314b004ab.
2025-10-26 22:13:19 +01:00
github-actions[bot] 06124af8d6 publish new versions (#2972)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-26 22:02:33 +01:00
renovate[bot] 060219e597 chore(deps): update dependency @rollup/plugin-typescript to v12.3.0 (#3067)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-26 20:25:22 +01:00
renovate[bot] c7e9766ff5 chore(deps): update tauri monorepo (v2) (#3058)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-10-26 17:22:06 +01:00
renovate[bot] d4a8ce962b chore(deps): update rust crate tokio-tungstenite to 0.28 (#3016)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-26 14:07:12 +01:00
renovate[bot] cdc7eec415 chore(deps): update dependency @rollup/plugin-typescript to v12.2.0 (#3066)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-26 12:36:06 +01:00
Fabian-Lars 6314b004ab chore: temp delete updater changefile 2025-10-26 12:34:59 +01:00
renovate[bot] fb4c8ae54c chore(deps): update dependency typescript-eslint to v8.46.2 (#3060)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-24 16:46:50 +08:00
renovate[bot] fccc1cfb7e chore(deps): update eslint monorepo to v9.38.0 (#3044)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-21 17:17:32 +08:00
renovate[bot] 3702308e6f chore(deps): update dependency rollup to v4.52.5 (#3043)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-21 16:32:14 +08:00
renovate[bot] c9c8b39b56 chore(deps): update dependency typescript-eslint to v8.46.1 (#3025)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-21 16:31:31 +08:00
renovate[bot] 3c396feedf chore(deps): update dependency typescript to v5.9.3 (#3028)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-21 15:42:04 +08:00
renovate[bot] b514d482fa chore(deps): update dependency @rollup/plugin-node-resolve to v16.0.3 (#3036)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-21 15:41:37 +08:00
renovate[bot] 60e5714ceb chore(deps): update dependency vite to v7.1.11 [security] (#3040)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-21 15:28:07 +08:00
Daniel Mader 654bf4891a feat(barcode-scanner): update androidx.camera from 1.1.0 to 1.5.1 to support 16 KB memory page sizes (#3038) 2025-10-20 17:11:17 +02:00
Fabian-Lars 6c9b61fb65 chore: Update compileSdk to 36 (#3039) 2025-10-20 16:58:29 +02:00
FabianLars 403f54b78c binary -> bytes 2025-10-14 18:36:15 +02:00
FabianLars 28ea4dbadc format and lockfile 2025-10-14 18:00:19 +02:00
FabianLars 1771c6ed36 Merge remote-tracking branch 'origin/v2' into plugin/secure-storage 2025-10-14 17:52:34 +02:00
FabianLars f831b003c2 migrate to keyring-core 2025-10-14 17:42:04 +02:00
Amr Bashir 6b5b1053ba enhance(fs): improve error message when resolving path in debug builds (#1939)
* enhance(fs): improve error message when resolving path in debug builds

closes #11338

* fix compilation

* deduplicate read_file code

* fix compile

* fix compile again

* fmt

* comma

* add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-10-09 08:58:08 -03:00
Tony 67a7bf80f8 fix(opener): doesn't open same origin links (#3018) 2025-10-04 21:16:08 +08:00
Kevin Schoonover e25a9339f4 fix(deep-link): update the Exec= in handler if the executable path changes (#3019)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-10-01 12:01:09 +02:00
Tony 92f98a93b4 docs(fs): fs:scope usage (#2969)
* docs(fs): `fs:scope` usage

* Use APPDATA for the example instead

* `/**/*`
2025-10-01 17:24:04 +08:00
renovate[bot] c0f82e5a5e chore(deps): update dependency rollup to v4.52.3 (#3021)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-01 11:54:47 +08:00
renovate[bot] 5204145c6a chore(deps): update dependency typescript-eslint to v8.44.1 (#3011)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-27 22:45:12 +08:00
renovate[bot] b4ee33dd01 chore(deps): update dependency rollup to v4.52.2 (#3013)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-27 21:55:53 +08:00
Fabian-Lars e933acb004 fix(geolocation): use timeout for min,max,interval on android (#3010) 2025-09-25 15:41:03 +02:00
FabianLars e4a9154f4a ci(renovate): Group windows crates into one PR 2025-09-25 13:31:39 +02:00
renovate[bot] d44ac9afed chore(deps): update eslint monorepo to v9.36.0 (#3004)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-25 12:59:04 +02:00
renovate[bot] 1b197c2d4d chore(deps): update dependency rollup to v4.52.0 (#3003)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-25 12:57:57 +02:00
renovate[bot] 650ff5ff23 chore(deps): update dependency typescript-eslint to v8.44.0 (#2988)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-25 12:21:23 +02:00
Fabian-Lars 2930aa39a4 chore: set minimumReleaseAge to 3 days in renovate and pnpm (#2999) 2025-09-25 11:39:52 +02:00
frieddeeu 3e92ce260b fix(geolocation): remove logging of priority (#3002) 2025-09-25 11:38:49 +02:00
renovate[bot] 12da195fce chore(deps): update dependency rollup to v4.50.1 (#2986)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-08 17:47:39 +08:00
renovate[bot] 30dd109d9f chore(deps): update eslint monorepo to v9.35.0 (#2975)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-06 09:03:34 +08:00
renovate[bot] 5e5bc30ad0 chore(deps): update dependency typescript-eslint to v8.42.0 (v2) (#2973)
* chore(deps): update dependency typescript-eslint to v8.42.0

* Switch to `defineConfig`
2025-09-03 10:36:36 +08:00
renovate[bot] f6dca71343 chore(deps): update dependency @tauri-apps/cli to v2.8.4 (#2971)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-03 10:16:08 +08:00
FabianLars 021e573248 Revert "ci: delete .changes/updater-new-bundle-support.md"
This reverts commit 51b430be98.
2025-09-02 16:49:58 +02:00
Fabian-Lars 51b430be98 ci: delete .changes/updater-new-bundle-support.md 2025-09-02 15:43:40 +02:00
github-actions[bot] fd439b143e Publish New Versions (v2) (#2964)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-09-02 14:04:12 +02:00
Sean Wang 2522b71f6b fix(deep-link): revert the breaking change introduced by #2928 (#2970) 2025-09-02 13:50:10 +02:00
renovate[bot] 9021a73247 chore(deps): update dependency rollup to v4.50.0 (#2966)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-31 20:53:18 +08:00
Lucas Fernandes Nogueira 625bb1c096 feat(log): re-export the log crate (#2965)
* feat(log): re-export the log crate

* code review

* Move emit_trace

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-08-30 23:44:03 -03:00
renovate[bot] 6215afe023 chore(deps): update dependency rollup to v4.49.0 (#2962)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-29 10:40:39 +08:00
Fabian-Lars 8cf8eeab02 feat(updater): inject bundle_type into endpoint url (#2960)
* feat(updater): inject bundle_type into endpoint url

* Revert schemas

* replace with unknown if none
2025-08-27 15:52:17 -03:00
Amr Bashir 509eba8d44 feat: support message dialogs with 3 buttons (#2641)
* feat: support message dialogs with 3 buttons

* change file

* From<String>

* untagged & YesNoCancel

* revert package.json

* Update plugins/dialog/src/desktop.rs

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

* no optional

* Update desktop.rs

* Update plugins/dialog/src/models.rs

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

* change to an enum

* convert back into union

* regen

* update @since

* map buttons for linux

* enhance type

* Add examples

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-08-27 09:40:47 -03:00
kandrelczyk 9ac5fe84e7 feat(updater): support bundle-specific targets (#2624)
* fallback targets

* linux test

* linux ready

* RPM installation

* small error fix

* fix windows build

* windows tests

* add aider files to .gitignore

* get bundle type out of patched variable

* windows tests

* patch windows binary

* format

* fix bundler

* remove local tauri dependency

* remove print

* rever Cargo.lock

* move __TAURI_BUNDLE_TYPE to tauri::utils

* get_current_bundle_type

* update tauri

* fix macos integration test

* fix fallback logic

Signed-off-by: Krzysztof Andrelczyk <cristof@curiana.net>

* amend! fallback targets

fallback targets

* reformat

* fix tests

* reformat

* bump tari versio

* fix fallback logic

* restore Cargo.lock

* Bump tauri and add notes

* Rename some staffs

* move target logic

* Refactor the target fallback to a function

* Format and clippy

* Keep target in `Update` since it's public

* Keep updater/tests/app-updater/src/main.rs lf

* Revert changes in tests/app-updater/src/main.rs

* Clean up

* changefile

* Bump updater-js as well

* update pub fn target docs

* update pub fn target docs

* Update plugins/updater/src/error.rs

Co-authored-by: Fabian-Lars <github@fabianlars.de>

* Update plugins/updater/src/updater.rs

Co-authored-by: Fabian-Lars <github@fabianlars.de>

* Update plugins/updater/src/updater.rs

Co-authored-by: Fabian-Lars <github@fabianlars.de>

* suggestios

* add comment

* restore error

* Revert "Bump tauri and add notes"

This reverts commit 0a495ccc6a.

* Revert "bump tari versio"

This reverts commit 5b4c1c164b.

---------

Signed-off-by: Krzysztof Andrelczyk <cristof@curiana.net>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Tony <legendmastertony@gmail.com>
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-08-26 09:33:58 -03:00
renovate[bot] c247410319 chore(deps): update dependency typescript-eslint to v8.41.0 (#2956)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-26 09:37:44 +08:00
Fabian-Lars de45034082 docs(store): tauri-docs compatibility 2025-08-25 20:13:16 +02:00
renovate[bot] 50c6b7c644 chore(deps): update dependency rollup to v4.48.1 (#2952)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-25 18:55:07 +02:00
renovate[bot] b79d02d896 chore(deps): update dependency @tauri-apps/cli to v2.8.3 (#2955)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-25 18:54:23 +02:00
github-actions[bot] b75f9f5cd3 publish new versions (#2954)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-25 18:15:22 +02:00
Lucas Fernandes Nogueira d865ed4768 fix(shell): run sidecar with dots in filename, closes #2310 (#2950)
* fix(shell): run sidecar with dots in filename, closes #2310

* fix import

* remove dead code

* code review suggestions

* clippy

* clippy
2025-08-25 10:44:47 -03:00
renovate[bot] 1107c46425 chore(deps): update dependency @tauri-apps/cli to v2.8.2 (#2932)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-25 09:25:07 +08:00
renovate[bot] 23a3705857 chore(deps): update dependency rollup to v4.48.0 (#2948)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-23 17:43:32 +08:00
renovate[bot] 6f65e68340 chore(deps): update eslint monorepo to v9.34.0 (#2946)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-23 09:05:42 +08:00
github-actions[bot] 1a0b791650 publish new versions (#2942)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-21 10:07:03 -03:00
Keerthi 2d03e2eac2 Add sound support for desktop notifications in Tauri v2 (#2678)
* Add sound support for desktop notifications in Tauri v2

* ci

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-21 10:05:27 -03:00
Fabian-Lars 21d721a0c2 fix(deep-link): Add command name to linux errors (#2928) 2025-08-21 08:56:09 -03:00
Christian Pavilonis 8abb31ee59 fix(notifications): crash on ios when scheduling a notification (#2905)
* Converts NotificationSchedule enum to a dictionary to fix crash while
scheduleing notifications.

* change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-21 08:39:22 -03:00
renovate[bot] 0354046817 chore(deps): update dependency rollup to v4.47.1 (#2940)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-21 18:18:33 +08:00
Fabian-Lars 04a0954857 chore(example): Improve dialog/fs mobile examples (#2410) 2025-08-21 12:04:46 +02:00
renovate[bot] 9e4e859bea chore(deps): update dependency rollup to v4.47.0 (#2938)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-21 14:47:35 +08:00
github-actions[bot] 2371804172 publish new versions (#2888)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-20 11:42:19 +02:00
FabianLars 90f9b9310a chore: fix cli version in deep-link package.json 2025-08-20 11:36:09 +02:00
renovate[bot] 1c58f3372c chore(deps): update dependency rollup to v4.46.4 (v2) (#2935)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-08-20 11:33:19 +02:00
SoSweetHam 75617a6a92 fix(mobile): deeplinks (#2870)
* feat: android deeplinks

* feat: explicit app link declarations

* feat: add ios code

* fix: add ios deeplink adaptation

* feat: ios working

(some swift plugin api improvements needed)

* fix: revert ios to prior logic

* fix(cleanup): regen android files with old names

* fix: web link criteria

* fix: conditional auto verify intent filter for android app links

* fix: default to true

* fix: typo

* fix: pnpm version

* cleanup

* fix: web link regression

* trim androidmanifest update

* fix deep link validation broken due to appLink=true default

* implement update_info_plist

from https://github.com/tauri-apps/tauri/pull/13888

* fix: remove old patch crates

* fix: use latest patch tauri

* lint

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-19 13:09:56 -03:00
renovate[bot] 5a963a0496 chore(deps): update dependency @tauri-apps/cli to v2.8.1 (#2930)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-19 21:38:06 +08:00
renovate[bot] 76f4e7bb84 chore(deps): update eslint monorepo to v9.33.0 (#2903)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-19 21:37:24 +08:00
renovate[bot] 670ac1d7c1 chore(deps): update dependency typescript-eslint to v8.40.0 (#2923)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-19 21:20:48 +08:00
renovate[bot] ed0deef2cf chore(deps): update dependency @tauri-apps/api to v2.8.0 (#2929)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-19 21:20:29 +08:00
Lucas Fernandes Nogueira 50cebdb6d5 chore(deps): update to tauri 2.8.0 (#2925)
* chore(deps): update to tauri 2.8.0

* fmt

* uipdate build

* tauri 2.8.1 and bump toml in plugin-fs

* tauri 2.8.1

* 2.8.2

* clippy [skip ci]

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-08-19 10:09:44 -03:00
renovate[bot] dd2ea9cfa5 chore(deps): update dependency rollup to v4.46.3 (#2920)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-18 19:02:01 +08:00
Sam Hinshaw 515182a179 fix: Specify Generic for readFile ArrayBuffer (fix #2914) (#2915) 2025-08-17 17:19:44 +08:00
FabianLars d1edf783e1 re-enable isolation. fmt. default perms 2025-08-14 14:03:58 +02:00
Fabian-Lars d3d290ab8a fix(os): unlock serialize-to-javascript dependency version (#2912) 2025-08-12 19:13:46 +08:00
renovate[bot] b51c827b2c chore(deps): update dependency typescript-eslint to v8.39.1 (#2910)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-12 09:55:16 +08:00
Tony a4b71a1992 refactor(opener): rename to FailedToConvertPathToItemIdList (#2906) 2025-08-10 18:52:54 +08:00
Tony 4eb36b0ff5 fix(fs): writeFile with ReadableStream throws (#2907) 2025-08-10 18:44:33 +08:00
FabianLars 9804eeef03 hmm idk 2025-08-09 23:10:57 +02:00
FabianLars 829fd23b8e x 2025-08-09 22:29:33 +02:00
FabianLars 13bbb9cd3d fmt 2025-08-09 22:28:43 +02:00
FabianLars 9b162b51a6 rmrf 2025-08-09 22:24:59 +02:00
FabianLars 57f0422ae9 edition 2025-08-09 22:14:23 +02:00
FabianLars 581523244f how bout this 2025-08-09 22:10:32 +02:00
Petr b8056f484c feat(opener): reveal multiple items in dir (#2897)
* feature: reveal multiple items in dir

* feature: reveal multiple items in dir

* feature: reveal multiple items in dir

* feature: reveal multiple items in dir

* feature: reveal multiple items in dir

* feature: reveal multiple items in dir

* feature: reveal multiple items in dir

* Support multiple roots on Windows

* feature: reveal multiple items in dir

* feature: reveal multiple items in dir

* feature: reveal multiple items in dir

* feature: reveal multiple items in dir

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-08-09 09:06:56 +08:00
FabianLars f924ef16e4 clippy 2025-08-07 23:31:46 +02:00
FabianLars c9babc028a fmt 2025-08-07 23:27:44 +02:00
FabianLars fdcc15a5fe toolchain 2025-08-07 23:18:53 +02:00
Fabian-Lars 53bf0af9dd Update test-rust.yml 2025-08-07 22:56:55 +02:00
Fabian-Lars c4665050bb Delete _target/rust-analyzer/metadata/sysroot/Cargo.lock 2025-08-07 15:38:15 +02:00
Fabian-Lars 6f65edfd72 Delete _target/rust-analyzer/metadata/workspace/Cargo.lock 2025-08-07 15:37:59 +02:00
FabianLars 63f660996f fmt 2025-08-07 15:28:44 +02:00
FabianLars 8cb053f47c deprecate stronghold 2025-08-07 15:05:40 +02:00
FabianLars cac333b076 minimal readme 2025-08-07 14:56:00 +02:00
FabianLars 5ce3e45768 ci 2025-08-07 14:45:25 +02:00
FabianLars 88da3d26ad add android-keyring 2025-08-07 14:41:43 +02:00
FabianLars af5500caed remove execute command permissions 2025-08-07 13:20:53 +02:00
FabianLars dc55eb51ed Merge remote-tracking branch 'origin/v2' into plugin/secure-storage 2025-08-07 12:55:43 +02:00
Tony 5ac8fbb1fa feat(store): load override defaults (#2857)
* feat(store): load override defaults

* Update docs

* Update example

* Allow setting defaults from js

* Tweak resolve

* Merge remote-tracking branch 'upstream/v2' into store-load-override-defaults

* Merge branch 'v2' of https://github.com/tauri-apps/plugins-workspace into store-load-override-defaults

* Merge branch 'v2' into store-load-override-defaults

* Rename to ignore defaults

* Merge remote-tracking branch 'upstream/v2' into store-load-override-defaults
2025-08-05 18:45:09 +08:00
renovate[bot] e0323ec752 chore(deps): update dependency typescript-eslint to v8.39.0 (#2894)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-05 10:08:29 +08:00
Fabian-Lars cc98e6a892 docs: Remove mirror install instructions (#2893) 2025-08-04 12:30:18 +02:00
renovate[bot] af22ae0a97 chore(deps): update rust crate notify-debouncer-full to 0.6 (v2) (#2889)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-08-03 22:10:31 +02:00
Fabian-Lars 2f24c7a70c chore(deps): Update rand to 0.9 (#2367) 2025-08-03 21:22:23 +02:00
Ray fe23a5e013 fix(nfc): Ensure that Session is dropped when an error causes it to become invalid (#2885)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-08-01 20:49:49 +02:00
renovate[bot] ff6d23ede1 chore(deps): update dependency typescript to v5.9.2 (#2886)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-01 11:04:56 +08:00
renovate[bot] 449dd117a4 chore(deps): update dependency rollup to v4.46.2 (#2882)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-30 13:52:44 +08:00
github-actions[bot] 9b43f48856 publish new versions (#2880)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-28 17:14:41 +02:00
Fabian-Lars af08c66faa fix(dialog): remove use of ACTION_PICK (#2871) 2025-07-28 16:43:35 +02:00
renovate[bot] 7974acae22 chore(deps): update dependency rollup to v4.46.1 (#2878)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-28 15:19:17 +08:00
renovate[bot] a985359e69 chore(deps): update dependency rollup to v4.46.0 (#2876)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-27 20:39:56 +08:00
renovate[bot] 97bebcf6e8 chore(deps): update eslint monorepo to v9.32.0 (#2873)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-26 19:50:08 +08:00
FabianLars a132d8f3d5 initial rough impl 2025-07-24 00:27:59 +02:00
FabianLars a7af1a81b7 init 2025-07-23 12:25:45 +02:00
github-actions[bot] 27ddcd0abe publish new versions (#2869)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-22 23:32:16 +02:00
Fabian-Lars d7fb5623d6 docs(deep-link): update platform support wording
ref https://github.com/tauri-apps/tauri/issues/13877
2025-07-22 23:27:41 +02:00
yobson1 d4f8299b12 fix(deep-link): handler not set as default on linux (#2844)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-07-22 11:54:12 +02:00
Fabian-Lars 341919ed57 docs(shell): Remove left over tauri.conf.json > scope mentino 2025-07-22 09:58:00 +02:00
renovate[bot] 124f2191aa chore(deps): update dependency @tauri-apps/cli to v2.7.1 (#2867)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-22 14:50:50 +08:00
renovate[bot] 0970b94949 chore(deps): update dependency typescript-eslint to v8.38.0 (#2864)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-22 14:40:05 +08:00
renovate[bot] 7340242d4e chore(deps): update tauri monorepo to v2.7.0 (#2863)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-21 11:35:10 +02:00
github-actions[bot] d66aa6ff78 publish new versions (#2822)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-20 23:39:53 +02:00
Nick Müller 6f345870df fix(single-instance): disable dbus name replacement (#2860) 2025-07-20 23:05:09 +02:00
renovate[bot] 708fa4e2b7 chore(deps): update dependency eslint-config-prettier to v10.1.8 (#2858)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-19 17:41:02 +08:00
Matthew Richardson b729203059 fix(upload): fix download() locks main thread on Android (#2838)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-07-18 20:37:39 +02:00
renovate[bot] 2f9c71aae7 chore(deps): update dependency rollup to v4.45.1 (#2850)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-18 16:54:16 +08:00
renovate[bot] 80d4d8e128 chore(deps): update eslint monorepo to v9.31.0 (v2) (#2839)
* chore(deps): update eslint monorepo to v9.31.0

* Deduplicate

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-07-15 10:13:33 +08:00
renovate[bot] e7a98b0d2e chore(deps): update dependency typescript-eslint to v8.37.0 (#2848)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-15 09:51:41 +08:00
Tony 44a1f65912 fix(fs): writeFile create file by default (#2846) 2025-07-15 09:46:43 +08:00
renovate[bot] 6210cd31df chore(deps): update dependency rollup to v4.45.0 (#2841)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-12 15:00:21 +08:00
renovate[bot] 467f07b7de chore(deps): update dependency vite to v7 (v2) (#2800)
* chore(deps): update dependency vite to v7

* Bump unocss and svelte plugin

* Align @unocss/extractor-svelte

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-07-11 13:24:31 +08:00
renovate[bot] 7ba6e08a86 chore(deps): update dependency typescript-eslint to v8.36.0 (#2832)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-08 08:33:16 +08:00
renovate[bot] 989470f0d7 chore(deps): update dependency rollup to v4.44.2 (#2827)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-07 00:10:20 +08:00
renovate[bot] ca3c3aa28a chore(deps): update eslint monorepo to v9.30.1 (#2824)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-02 11:36:56 +08:00
Enkhjil Enkhbaatar aa9140e1ac feat(barcode-scanner): Add support for GS1 DataBar on iOS 15.4+ (#2437)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-07-01 16:40:22 +02:00
Tony 6a8f255878 feat(window-state): make flags optional in js side (#2619) 2025-07-01 21:21:58 +08:00
renovate[bot] 8ac494da7c chore(deps): update dependency @rollup/plugin-typescript to v12.1.4 (#2818)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-01 14:53:13 +02:00
renovate[bot] 1635282868 chore(deps): update dependency typescript-eslint to v8.35.1 (#2820)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-01 14:34:07 +08:00
renovate[bot] 4587e4a2b3 chore(deps): update eslint monorepo to v9.30.0 (#2816)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-29 10:49:14 +08:00
renovate[bot] 1135dc7ed3 chore(deps): update dependency @tauri-apps/cli to v2.6.2 (#2819)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-29 10:48:47 +08:00
renovate[bot] fe01894e7f chore(deps): update dependency prettier to v3.6.2 (#2814)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-27 14:06:34 +08:00
renovate[bot] 36400b5678 chore(deps): update dependency @tauri-apps/cli to v2.6.1 (#2813)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-27 08:46:11 +08:00
renovate[bot] ead3c268e1 chore(deps): update dependency rollup to v4.44.1 (#2811)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-26 13:11:34 +08:00
304 changed files with 6747 additions and 2739 deletions
@@ -0,0 +1,6 @@
---
"dialog-js": minor:feat
"dialog": minor:feat
---
Add `xdg-portal` as an optional feature for `rfd`
@@ -0,0 +1,6 @@
---
"log": "minor"
"log-js": "minor"
---
Allow specifying a log formatter per target using the `format` method on `Target`.
+10
View File
@@ -78,6 +78,7 @@
"notification", "notification",
"os", "os",
"process", "process",
"secure-storage",
"shell", "shell",
"store", "store",
"updater", "updater",
@@ -104,6 +105,7 @@
"notification-js", "notification-js",
"os-js", "os-js",
"process-js", "process-js",
"secure-storage-js",
"shell-js", "shell-js",
"store-js", "store-js",
"updater-js" "updater-js"
@@ -282,6 +284,14 @@
"path": "./plugins/process", "path": "./plugins/process",
"manager": "javascript" "manager": "javascript"
}, },
"secure-storage": {
"path": "./plugins/secure-storage",
"manager": "rust"
},
"secure-storage-js": {
"path": "./plugins/secure-storage",
"manager": "javascript"
},
"shell": { "shell": {
"path": "./plugins/shell", "path": "./plugins/shell",
"manager": "rust" "manager": "rust"
+6
View File
@@ -0,0 +1,6 @@
---
stronghold: patch
stronghold-js: patch
---
The `stronghold` plugin is now deprecated and will be removed in v3. The `secure-storage` plugin should be a replacement for most use-cases.
+6
View File
@@ -0,0 +1,6 @@
---
"dialog": minor
"dialog-js": minor
---
Add `pickerMode` option to file picker (currently only used on iOS)
@@ -0,0 +1,5 @@
---
"localhost": patch
---
Disable caching on responses.
@@ -0,0 +1,6 @@
---
"barcode-scanner": patch
"barcode-scanner-js": patch
---
Fix the `cameraView` is not removed after scanning in iOS.
+6
View File
@@ -0,0 +1,6 @@
---
"log": patch
"log-js": patch
---
Fix log file rotation when exceeding `max_file_size`.
+6
View File
@@ -0,0 +1,6 @@
---
"nfc": "patch"
"nfc-js": "patch"
---
Update return value of `isAvailable` to match TypeScript function signature
+6
View File
@@ -0,0 +1,6 @@
---
"updater": minor
"updater-js": minor
---
Updater plugin now supports all bundle types: Deb, Rpm and AppImage for Linux; NSiS, MSI for Windows. This was added in https://github.com/tauri-apps/plugins-workspace/pull/2624
+6
View File
@@ -0,0 +1,6 @@
---
"upload": minor
"upload-js": minor
---
Upload plugin now supports specifying an HTTP method i.e. POST, PUT etc.
@@ -101,6 +101,11 @@ jobs:
- pnpm-lock.yaml - pnpm-lock.yaml
- plugins/process/guest-js/** - plugins/process/guest-js/**
- plugins/process/src/api-iife.js - plugins/process/src/api-iife.js
secure-storage:
- .github/workflows/check-generated-files.yml
- pnpm-lock.yaml
- plugins/secure-storage/guest-js/**
- plugins/secure-storage/src/api-iife.js
shell: shell:
- .github/workflows/check-generated-files.yml - .github/workflows/check-generated-files.yml
- pnpm-lock.yaml - pnpm-lock.yaml
@@ -11,7 +11,7 @@ on:
- v2 - v2
permissions: permissions:
# required for npm provenance # required for oidc token
id-token: write id-token: write
# required to create the GitHub Release # required to create the GitHub Release
contents: write contents: write
@@ -62,7 +62,6 @@ jobs:
id: covector id: covector
env: env:
CARGO_TARGET_DIR: /mnt/target CARGO_TARGET_DIR: /mnt/target
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
command: 'version-or-publish' command: 'version-or-publish'
+4
View File
@@ -98,6 +98,9 @@ jobs:
tauri-plugin-process: tauri-plugin-process:
- .github/workflows/lint-rust.yml - .github/workflows/lint-rust.yml
- plugins/process/** - plugins/process/**
tauri-plugin-secure-storage:
- .github/workflows/lint-rust.yml
- plugins/secure-storage/**
tauri-plugin-shell: tauri-plugin-shell:
- .github/workflows/lint-rust.yml - .github/workflows/lint-rust.yml
- plugins/shell/** - plugins/shell/**
@@ -154,4 +157,5 @@ jobs:
run: cargo clippy --package ${{ matrix.package }} --all-targets -- -D warnings run: cargo clippy --package ${{ matrix.package }} --all-targets -- -D warnings
- name: clippy ${{ matrix.package }} --all-features - name: clippy ${{ matrix.package }} --all-features
if: matrix.package != 'tauri-plugin-dialog'
run: cargo clippy --package ${{ matrix.package }} --all-targets --all-features -- -D warnings run: cargo clippy --package ${{ matrix.package }} --all-targets --all-features -- -D warnings
+9 -4
View File
@@ -137,6 +137,11 @@ jobs:
- Cargo.toml - Cargo.toml
- Cargo.lock - Cargo.lock
- plugins/process/** - plugins/process/**
tauri-plugin-secure-storage:
- .github/workflows/test-rust.yml
- Cargo.toml
- Cargo.lock
- plugins/secure-storage/**
tauri-plugin-shell: tauri-plugin-shell:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml
- Cargo.toml - Cargo.toml
@@ -219,7 +224,7 @@ jobs:
target: aarch64-linux-android, target: aarch64-linux-android,
os: ubuntu-latest, os: ubuntu-latest,
runner: 'cross', runner: 'cross',
command: 'build' command: 'build --verbose'
} }
runs-on: ${{ matrix.platform.os }} runs-on: ${{ matrix.platform.os }}
@@ -233,7 +238,7 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev
- uses: dtolnay/rust-toolchain@1.77.2 - uses: dtolnay/rust-toolchain@1.85
with: with:
targets: ${{ matrix.platform.target }} targets: ${{ matrix.platform.target }}
@@ -246,9 +251,9 @@ jobs:
run: cargo +stable install cross --git https://github.com/cross-rs/cross run: cargo +stable install cross --git https://github.com/cross-rs/cross
- name: test ${{ matrix.package }} - name: test ${{ matrix.package }}
if: matrix.package != 'tauri-plugin-http' if: matrix.package != 'tauri-plugin-http' && matrix.package != 'tauri-plugin-secure-storage' && matrix.package != 'tauri-plugin-dialog'
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --all-features run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --all-features
- name: test ${{ matrix.package }} - name: test ${{ matrix.package }}
if: matrix.package == 'tauri-plugin-http' if: ${{ matrix.package == 'tauri-plugin-http' || matrix.package == 'tauri-plugin-dialog' }}
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets
+1 -1
View File
@@ -58,4 +58,4 @@ pids
.idea .idea
debug.log debug.log
TODO.md TODO.md
.aider* .aider.*
+1
View File
@@ -1,2 +1,3 @@
plugins/*/permissions/autogenerated/ plugins/*/permissions/autogenerated/
plugins/*/android/.tauri/tauri-api/build/ plugins/*/android/.tauri/tauri-api/build/
plugins/*/android/build/intermediates/
Generated
+378 -159
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -12,10 +12,10 @@ resolver = "2"
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
tracing = "0.1" tracing = "0.1"
log = "0.4" log = "0.4"
tauri = { version = "2.6", default-features = false } tauri = { version = "2.8.2", default-features = false }
tauri-build = "2.3" tauri-build = "2.4"
tauri-plugin = "2.3" tauri-plugin = "2.4"
tauri-utils = "2.5" tauri-utils = "2.7"
serde_json = "1" serde_json = "1"
thiserror = "2" thiserror = "2"
url = "2" url = "2"
@@ -23,7 +23,7 @@ schemars = "0.8"
dunce = "1" dunce = "1"
specta = "^2.0.0-rc.16" specta = "^2.0.0-rc.16"
glob = "0.3" glob = "0.3"
zbus = "5" zbus = "5.9"
[workspace.package] [workspace.package]
edition = "2021" edition = "2021"
+1 -1
View File
@@ -33,7 +33,7 @@ This repo and all plugins require a Rust version of at least **1.77.2**
| [store](plugins/store) | Persistent key value storage. | ✅ | ✅ | ✅ | ✅ | ✅ | | [store](plugins/store) | Persistent key value storage. | ✅ | ✅ | ✅ | ✅ | ✅ |
| [stronghold](plugins/stronghold) | Encrypted, secure database. | ✅ | ✅ | ✅ | ? | ? | | [stronghold](plugins/stronghold) | Encrypted, secure database. | ✅ | ✅ | ✅ | ? | ? |
| [updater](plugins/updater) | In-app updates for Tauri applications. | ✅ | ✅ | ✅ | ❌ | ❌ | | [updater](plugins/updater) | In-app updates for Tauri applications. | ✅ | ✅ | ✅ | ❌ | ❌ |
| [upload](plugins/upload) | Tauri plugin for file uploads through HTTP. | ✅ | ✅ | ✅ | ? | ? | | [upload](plugins/upload) | Tauri plugin for file uploads through HTTP. | ✅ | ✅ | ✅ | | |
| [websocket](plugins/websocket) | Open a WebSocket connection using a Rust client in JS. | ✅ | ✅ | ✅ | ? | ? | | [websocket](plugins/websocket) | Open a WebSocket connection using a Rust client in JS. | ✅ | ✅ | ✅ | ? | ? |
| [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ❌ | ❌ | | [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ❌ | ❌ |
+2 -1
View File
@@ -3,11 +3,12 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
import eslint from '@eslint/js' import eslint from '@eslint/js'
import { defineConfig } from 'eslint/config'
import eslintConfigPrettier from 'eslint-config-prettier' import eslintConfigPrettier from 'eslint-config-prettier'
import eslintPluginSecurity from 'eslint-plugin-security' import eslintPluginSecurity from 'eslint-plugin-security'
import tseslint from 'typescript-eslint' import tseslint from 'typescript-eslint'
export default tseslint.config( export default defineConfig(
{ {
ignores: [ ignores: [
'**/target', '**/target',
+82
View File
@@ -1,5 +1,87 @@
# Changelog # Changelog
## \[2.0.34]
### Dependencies
- Upgraded to `barcode-scanner-js@2.4.2`
- Upgraded to `biometric-js@2.3.2`
- Upgraded to `cli-js@2.4.1`
- Upgraded to `clipboard-manager-js@2.3.2`
- Upgraded to `dialog-js@2.4.2`
- Upgraded to `fs-js@2.4.4`
- Upgraded to `global-shortcut-js@2.3.1`
- Upgraded to `http-js@2.5.4`
- Upgraded to `log-js@2.7.1`
- Upgraded to `nfc-js@2.3.3`
- Upgraded to `notification-js@2.3.3`
- Upgraded to `opener-js@2.5.2`
- Upgraded to `os-js@2.3.2`
- Upgraded to `process-js@2.3.1`
- Upgraded to `shell-js@2.3.3`
- Upgraded to `store-js@2.4.1`
## \[2.0.33]
### Dependencies
- Upgraded to `barcode-scanner-js@2.4.1`
- Upgraded to `biometric-js@2.3.1`
- Upgraded to `clipboard-manager-js@2.3.1`
- Upgraded to `dialog-js@2.4.1`
- Upgraded to `fs-js@2.4.3`
- Upgraded to `nfc-js@2.3.2`
- Upgraded to `notification-js@2.3.2`
- Upgraded to `opener-js@2.5.1`
- Upgraded to `shell-js@2.3.2`
- Upgraded to `http-js@2.5.3`
## \[2.0.32]
### Dependencies
- Upgraded to `dialog-js@2.4.0`
- Upgraded to `log-js@2.7.0`
## \[2.0.31]
### Dependencies
- Upgraded to `shell-js@2.3.1`
## \[2.0.30]
### Dependencies
- Upgraded to `notification-js@2.3.1`
## \[2.0.29]
### Dependencies
- Upgraded to `fs-js@2.4.2`
- Upgraded to `nfc-js@2.3.1`
- Upgraded to `opener-js@2.5.0`
- Upgraded to `os-js@2.3.1`
- Upgraded to `store-js@2.4.0`
- Upgraded to `dialog-js@2.3.3`
- Upgraded to `http-js@2.5.2`
## \[2.0.28]
### Dependencies
- Upgraded to `dialog-js@2.3.2`
## \[2.0.27]
### Dependencies
- Upgraded to `barcode-scanner-js@2.4.0`
- Upgraded to `fs-js@2.4.1`
- Upgraded to `dialog-js@2.3.1`
- Upgraded to `http-js@2.5.1`
## \[2.0.26] ## \[2.0.26]
### Dependencies ### Dependencies
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta <meta
name="viewport" name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover" content="width=device-width, initial-scale=1.0, viewport-fit=cover, user-scalable=0"
/> />
<title>Svelte + Vite App</title> <title>Svelte + Vite App</title>
</head> </head>
+24 -22
View File
@@ -1,7 +1,7 @@
{ {
"name": "api", "name": "api",
"private": true, "private": true,
"version": "2.0.26", "version": "2.0.34",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite --clearScreen false", "dev": "vite --clearScreen false",
@@ -10,35 +10,37 @@
"tauri": "tauri" "tauri": "tauri"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.6.0", "@tauri-apps/api": "2.9.0",
"@tauri-apps/plugin-barcode-scanner": "^2.3.0", "@tauri-apps/plugin-barcode-scanner": "^2.4.2",
"@tauri-apps/plugin-biometric": "^2.3.0", "@tauri-apps/plugin-biometric": "^2.3.2",
"@tauri-apps/plugin-cli": "^2.4.0", "@tauri-apps/plugin-cli": "^2.4.1",
"@tauri-apps/plugin-clipboard-manager": "^2.3.0", "@tauri-apps/plugin-clipboard-manager": "^2.3.2",
"@tauri-apps/plugin-dialog": "^2.3.0", "@tauri-apps/plugin-dialog": "^2.4.2",
"@tauri-apps/plugin-fs": "^2.4.0", "@tauri-apps/plugin-fs": "^2.4.4",
"@tauri-apps/plugin-geolocation": "^2.2.0", "@tauri-apps/plugin-geolocation": "^2.2.0",
"@tauri-apps/plugin-global-shortcut": "^2.3.0", "@tauri-apps/plugin-global-shortcut": "^2.3.1",
"@tauri-apps/plugin-haptics": "^2.2.0", "@tauri-apps/plugin-haptics": "^2.2.0",
"@tauri-apps/plugin-http": "^2.5.0", "@tauri-apps/plugin-http": "^2.5.4",
"@tauri-apps/plugin-nfc": "^2.3.0", "@tauri-apps/plugin-nfc": "^2.3.3",
"@tauri-apps/plugin-notification": "^2.3.0", "@tauri-apps/plugin-notification": "^2.3.3",
"@tauri-apps/plugin-opener": "^2.4.0", "@tauri-apps/plugin-opener": "^2.5.2",
"@tauri-apps/plugin-os": "^2.3.0", "@tauri-apps/plugin-os": "^2.3.2",
"@tauri-apps/plugin-process": "^2.3.0", "@tauri-apps/plugin-process": "^2.3.1",
"@tauri-apps/plugin-shell": "^2.3.0", "@tauri-apps/plugin-secure-storage": "file:../../plugins/secure-storage",
"@tauri-apps/plugin-store": "^2.3.0", "@tauri-apps/plugin-shell": "^2.3.3",
"@tauri-apps/plugin-store": "^2.4.1",
"@tauri-apps/plugin-updater": "^2.9.0", "@tauri-apps/plugin-updater": "^2.9.0",
"@tauri-apps/plugin-upload": "^2.3.0",
"@zerodevx/svelte-json-view": "1.0.11" "@zerodevx/svelte-json-view": "1.0.11"
}, },
"devDependencies": { "devDependencies": {
"@iconify-json/codicon": "^1.2.12", "@iconify-json/codicon": "^1.2.12",
"@iconify-json/ph": "^1.2.2", "@iconify-json/ph": "^1.2.2",
"@sveltejs/vite-plugin-svelte": "^5.0.3", "@sveltejs/vite-plugin-svelte": "^6.0.0",
"@tauri-apps/cli": "2.6.0", "@tauri-apps/cli": "2.9.4",
"@unocss/extractor-svelte": "^66.0.0", "@unocss/extractor-svelte": "^66.3.3",
"svelte": "^5.20.4", "svelte": "^5.20.4",
"unocss": "^66.0.0", "unocss": "^66.3.3",
"vite": "^6.2.6" "vite": "^7.0.7"
} }
} }
+86
View File
@@ -1,5 +1,91 @@
# Changelog # Changelog
## \[2.0.38]
### Dependencies
- Upgraded to `barcode-scanner@2.4.2`
- Upgraded to `biometric@2.3.2`
- Upgraded to `cli@2.4.1`
- Upgraded to `clipboard-manager@2.3.2`
- Upgraded to `dialog@2.4.2`
- Upgraded to `fs@2.4.4`
- Upgraded to `geolocation@2.3.2`
- Upgraded to `global-shortcut@2.3.1`
- Upgraded to `haptics@2.3.2`
- Upgraded to `http@2.5.4`
- Upgraded to `log@2.7.1`
- Upgraded to `nfc@2.3.3`
- Upgraded to `notification@2.3.3`
- Upgraded to `opener@2.5.2`
- Upgraded to `os@2.3.2`
- Upgraded to `process@2.3.1`
- Upgraded to `shell@2.3.3`
- Upgraded to `store@2.4.1`
## \[2.0.37]
### Dependencies
- Upgraded to `barcode-scanner@2.4.1`
- Upgraded to `biometric@2.3.1`
- Upgraded to `clipboard-manager@2.3.1`
- Upgraded to `dialog@2.4.1`
- Upgraded to `fs@2.4.3`
- Upgraded to `geolocation@2.3.1`
- Upgraded to `haptics@2.3.1`
- Upgraded to `nfc@2.3.2`
- Upgraded to `notification@2.3.2`
- Upgraded to `opener@2.5.1`
- Upgraded to `shell@2.3.2`
- Upgraded to `http@2.5.3`
## \[2.0.36]
### Dependencies
- Upgraded to `dialog@2.4.0`
- Upgraded to `log@2.7.0`
## \[2.0.35]
### Dependencies
- Upgraded to `shell@2.3.1`
## \[2.0.34]
### Dependencies
- Upgraded to `notification@2.3.1`
## \[2.0.33]
### Dependencies
- Upgraded to `fs@2.4.2`
- Upgraded to `nfc@2.3.1`
- Upgraded to `opener@2.5.0`
- Upgraded to `os@2.3.1`
- Upgraded to `store@2.4.0`
- Upgraded to `dialog@2.3.3`
- Upgraded to `http@2.5.2`
## \[2.0.32]
### Dependencies
- Upgraded to `dialog@2.3.2`
## \[2.0.31]
### Dependencies
- Upgraded to `barcode-scanner@2.4.0`
- Upgraded to `fs@2.4.1`
- Upgraded to `dialog@2.3.1`
- Upgraded to `http@2.5.1`
## \[2.0.30] ## \[2.0.30]
### Dependencies ### Dependencies
+21 -19
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "api" name = "api"
publish = false publish = false
version = "2.0.30" version = "2.0.38"
description = "An example Tauri Application showcasing the api" description = "An example Tauri Application showcasing the api"
edition = "2021" edition = "2021"
rust-version = { workspace = true } rust-version = { workspace = true }
@@ -20,24 +20,26 @@ serde = { workspace = true }
tiny_http = "0.12" tiny_http = "0.12"
time = "0.3" time = "0.3"
log = { workspace = true } log = { workspace = true }
tauri-plugin-log = { path = "../../../plugins/log", version = "2.6.0" } tauri-plugin-log = { path = "../../../plugins/log", version = "2.7.1" }
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.4.0", features = [ tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.4.4", features = [
"watch", "watch",
] } ] }
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.3.0" } tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.3.2" }
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.3.0" } tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.4.2" }
tauri-plugin-http = { path = "../../../plugins/http", features = [ tauri-plugin-http = { path = "../../../plugins/http", features = [
"multipart", "multipart",
"cookies", "cookies",
], version = "2.5.0" } ], version = "2.5.4" }
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.3.0", features = [ tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.3.3", features = [
"windows7-compat", "windows7-compat",
] } ] }
tauri-plugin-os = { path = "../../../plugins/os", version = "2.3.0" } tauri-plugin-os = { path = "../../../plugins/os", version = "2.3.2" }
tauri-plugin-process = { path = "../../../plugins/process", version = "2.3.0" } tauri-plugin-process = { path = "../../../plugins/process", version = "2.3.1" }
tauri-plugin-opener = { path = "../../../plugins/opener", version = "2.4.0" } tauri-plugin-opener = { path = "../../../plugins/opener", version = "2.5.2" }
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.3.0" } tauri-plugin-secure-storage = { path = "../../../plugins/secure-storage" }
tauri-plugin-store = { path = "../../../plugins/store", version = "2.3.0" } tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.3.3" }
tauri-plugin-store = { path = "../../../plugins/store", version = "2.4.1" }
tauri-plugin-upload = { path = "../../../plugins/upload", version = "2.3.0" }
[dependencies.tauri] [dependencies.tauri]
workspace = true workspace = true
@@ -54,17 +56,17 @@ features = [
] ]
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.4.0" } tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.4.1" }
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.3.0" } tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.3.1" }
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.9.0" } tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.9.0" }
tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.2.0" } tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.2.0" }
[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies] [target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies]
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.3.0" } tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.4.2" }
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.3.0" } tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.3.3" }
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.3.0" } tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.3.2" }
tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.3.0" } tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.3.2" }
tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.3.0" } tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.3.2" }
[features] [features]
prod = ["tauri/custom-protocol"] prod = ["tauri/custom-protocol"]
+12 -1
View File
@@ -68,6 +68,9 @@
"fs:allow-rename", "fs:allow-rename",
"fs:allow-mkdir", "fs:allow-mkdir",
"fs:allow-remove", "fs:allow-remove",
"fs:allow-stat",
"fs:allow-fstat",
"fs:allow-lstat",
"fs:allow-write-text-file", "fs:allow-write-text-file",
"fs:read-meta", "fs:read-meta",
"fs:scope-download-recursive", "fs:scope-download-recursive",
@@ -75,6 +78,9 @@
{ {
"identifier": "fs:scope-appdata-recursive", "identifier": "fs:scope-appdata-recursive",
"allow": [ "allow": [
{
"path": "$APPDATA/db/"
},
{ {
"path": "$APPDATA/db/**" "path": "$APPDATA/db/**"
} }
@@ -95,6 +101,11 @@
{ {
"identifier": "opener:allow-open-path", "identifier": "opener:allow-open-path",
"allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**" }] "allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**" }]
} },
"upload:default",
"secure-storage:allow-get-string",
"secure-storage:allow-set-string",
"secure-storage:allow-get-binary",
"secure-storage:allow-set-binary"
] ]
} }
@@ -14,13 +14,13 @@ val tauriProperties = Properties().apply {
} }
android { android {
compileSdk = 34 compileSdk = 36
namespace = "com.tauri.api" namespace = "com.tauri.api"
defaultConfig { defaultConfig {
manifestPlaceholders["usesCleartextTraffic"] = "false" manifestPlaceholders["usesCleartextTraffic"] = "false"
applicationId = "com.tauri.api" applicationId = "com.tauri.api"
minSdk = 24 minSdk = 24
targetSdk = 34 targetSdk = 36
versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt() versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()
versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0") versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0")
} }
@@ -4,7 +4,7 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath("com.android.tools.build:gradle:8.5.1") classpath("com.android.tools.build:gradle:8.11.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25")
} }
} }
@@ -18,6 +18,6 @@ repositories {
dependencies { dependencies {
compileOnly(gradleApi()) compileOnly(gradleApi())
implementation("com.android.tools.build:gradle:8.5.1") implementation("com.android.tools.build:gradle:8.11.0")
} }
+2 -2
View File
@@ -14,11 +14,11 @@ pub struct RequestBody {
#[command] #[command]
pub fn log_operation(event: String, payload: Option<String>) { pub fn log_operation(event: String, payload: Option<String>) {
log::info!("{} {:?}", event, payload); log::info!("{event} {payload:?}");
} }
#[command] #[command]
pub fn perform_request(endpoint: String, body: RequestBody) -> String { pub fn perform_request(endpoint: String, body: RequestBody) -> String {
println!("{} {:?}", endpoint, body); println!("{endpoint} {body:?}");
"message response".into() "message response".into()
} }
+2
View File
@@ -38,7 +38,9 @@ pub fn run() {
.plugin(tauri_plugin_process::init()) .plugin(tauri_plugin_process::init())
.plugin(tauri_plugin_opener::init()) .plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_shell::init()) .plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_secure_storage::init())
.plugin(tauri_plugin_store::Builder::default().build()) .plugin(tauri_plugin_store::Builder::default().build())
.plugin(tauri_plugin_upload::init())
.setup(move |app| { .setup(move |app| {
#[cfg(desktop)] #[cfg(desktop)]
{ {
+18 -6
View File
@@ -16,12 +16,14 @@
import Opener from './views/Opener.svelte' import Opener from './views/Opener.svelte'
import Store from './views/Store.svelte' import Store from './views/Store.svelte'
import Updater from './views/Updater.svelte' import Updater from './views/Updater.svelte'
import Upload from './views/Upload.svelte'
import Clipboard from './views/Clipboard.svelte' import Clipboard from './views/Clipboard.svelte'
import WebRTC from './views/WebRTC.svelte' import WebRTC from './views/WebRTC.svelte'
import Scanner from './views/Scanner.svelte' import Scanner from './views/Scanner.svelte'
import Biometric from './views/Biometric.svelte' import Biometric from './views/Biometric.svelte'
import Geolocation from './views/Geolocation.svelte' import Geolocation from './views/Geolocation.svelte'
import Haptics from './views/Haptics.svelte' import Haptics from './views/Haptics.svelte'
import SecureStorage from './views/SecureStorage.svelte'
import { onMount, tick } from 'svelte' import { onMount, tick } from 'svelte'
import { ask } from '@tauri-apps/plugin-dialog' import { ask } from '@tauri-apps/plugin-dialog'
@@ -102,11 +104,21 @@
component: Store, component: Store,
icon: 'i-codicon-file-code' icon: 'i-codicon-file-code'
}, },
{
label: 'SecureStorage',
component: SecureStorage,
icon: 'i-codicon-file-code'
},
!isMobile && { !isMobile && {
label: 'Updater', label: 'Updater',
component: Updater, component: Updater,
icon: 'i-codicon-cloud-download' icon: 'i-codicon-cloud-download'
}, },
{
label: 'Upload',
component: Upload,
icon: 'i-codicon-cloud-upload'
},
{ {
label: 'Clipboard', label: 'Clipboard',
component: Clipboard, component: Clipboard,
@@ -207,9 +219,9 @@
...r, ...r,
{ {
html: html:
`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> ` + `<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> `
(typeof value === 'string' ? value : JSON.stringify(value, null, 1)) + + (typeof value === 'string' ? value : JSON.stringify(value, null, 1))
'</pre>' + '</pre>'
} }
]) ])
await tick() await tick()
@@ -223,9 +235,9 @@
...r, ...r,
{ {
html: html:
`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> ` + `<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> `
html + + html
'</pre>' + '</pre>'
} }
]) ])
await tick() await tick()
+25 -1
View File
@@ -8,6 +8,7 @@
let filter = null; let filter = null;
let multiple = false; let multiple = false;
let directory = false; let directory = false;
let pickerMode = "";
function arrayBufferToBase64(buffer, callback) { function arrayBufferToBase64(buffer, callback) {
var blob = new Blob([buffer], { var blob = new Blob([buffer], {
@@ -44,6 +45,13 @@
await message("Tauri is awesome!"); await message("Tauri is awesome!");
} }
async function msgCustom(result) {
const buttons = { yes: "awesome", no: "amazing", cancel: "stunning" };
await message(`Tauri is: `, { buttons })
.then((res) => onMessage(`Tauri is ${res}`))
.catch(onMessage);
}
function openDialog() { function openDialog() {
open({ open({
title: "My wonderful open dialog", title: "My wonderful open dialog",
@@ -58,6 +66,7 @@
: [], : [],
multiple, multiple,
directory, directory,
pickerMode: pickerMode === "" ? undefined : pickerMode,
}) })
.then(function (res) { .then(function (res) {
if (Array.isArray(res)) { if (Array.isArray(res)) {
@@ -87,7 +96,7 @@
onMessage(res); onMessage(res);
} }
}) })
.catch(onMessage(res)); .catch(onMessage);
} }
}) })
.catch(onMessage); .catch(onMessage);
@@ -135,7 +144,19 @@
<input type="checkbox" id="dialog-directory" bind:checked={directory} /> <input type="checkbox" id="dialog-directory" bind:checked={directory} />
<label for="dialog-directory">Directory</label> <label for="dialog-directory">Directory</label>
</div> </div>
<div>
<label for="dialog-picker-mode">Picker Mode:</label>
<select id="dialog-picker-mode" bind:value={pickerMode}>
<option value="">None</option>
<option value="media">Media</option>
<option value="image">Image</option>
<option value="video">Video</option>
<option value="document">Document</option>
</select>
</div>
<br /> <br />
<div class="flex flex-wrap flex-col md:flex-row gap-2 children:flex-shrink-0">
<button class="btn" id="open-dialog" on:click={openDialog}>Open dialog</button> <button class="btn" id="open-dialog" on:click={openDialog}>Open dialog</button>
<button class="btn" id="save-dialog" on:click={saveDialog} <button class="btn" id="save-dialog" on:click={saveDialog}
>Open save dialog</button >Open save dialog</button
@@ -145,3 +166,6 @@
>Prompt (custom)</button >Prompt (custom)</button
> >
<button class="btn" id="message-dialog" on:click={msg}>Message</button> <button class="btn" id="message-dialog" on:click={msg}>Message</button>
<button class="btn" id="message-dialog" on:click={msgCustom}>Message (custom)</button>
</div>
+114 -93
View File
@@ -1,194 +1,214 @@
<script> <script>
import * as fs from "@tauri-apps/plugin-fs"; import * as fs from '@tauri-apps/plugin-fs'
import { convertFileSrc } from "@tauri-apps/api/core"; import * as os from '@tauri-apps/plugin-os'
import { arrayBufferToBase64 } from "../lib/utils"; import { convertFileSrc } from '@tauri-apps/api/core'
import { onDestroy } from "svelte"; import { arrayBufferToBase64 } from '../lib/utils'
import { onDestroy, onMount } from 'svelte'
export let onMessage; const { onMessage, insecureRenderHtml } = $props()
export let insecureRenderHtml;
let path = ""; let path = $state('')
let img; let img
/** @type {fs.FileHandle} */ /** @type {fs.FileHandle} */
let file; let file = $state()
let renameTo; let renameTo = $state()
let watchPath = ""; let watchPath = $state('')
let watchDebounceDelay = "0"; let watchDebounceDelay = $state(0)
let watchRecursive = false; let watchRecursive = $state(false)
let unwatchFn; /** @type {fs.BaseDirectory | undefined} */
let unwatchPath = ""; let baseDir = $state()
let unwatchFn
let unwatchPath = ''
let isMobile = $state(false)
function getDir() { onMount(() => {
const dirSelect = document.getElementById("dir"); let platform = os.platform()
return dirSelect.value ? parseInt(dir.value) : null; isMobile = platform === 'android' || platform === 'ios'
} })
const DirOptions = Object.keys(fs.BaseDirectory) const dirOptions = Object.keys(fs.BaseDirectory).filter((key) =>
.filter((key) => isNaN(parseInt(key))) isNaN(parseInt(key))
.map((dir) => [dir, fs.BaseDirectory[dir]]); )
function open() { function open() {
fs.open(path, { fs.open(path, {
baseDir: getDir(), baseDir,
read: true, read: true,
write: true, write: true,
create: true, create: true
}) })
.then((f) => { .then((f) => {
file = f; file = f
onMessage(`Opened ${path}`); onMessage(`Opened ${path}`)
}) })
.catch(onMessage); .catch(onMessage)
} }
function mkdir() { function mkdir() {
fs.mkdir(path, { baseDir: getDir() }) fs.mkdir(path, { baseDir, recursive: true })
.then(() => { .then(() => {
onMessage(`Created dir ${path}`); onMessage(`Created dir ${path}`)
}) })
.catch(onMessage); .catch(onMessage)
} }
function remove() { function remove() {
fs.remove(path, { baseDir: getDir() }) fs.remove(path, { baseDir })
.then(() => { .then(() => {
onMessage(`Removed ${path}`); onMessage(`Removed ${path}`)
}) })
.catch(onMessage); .catch(onMessage)
} }
function rename() { function rename() {
fs.rename(path, renameTo, { fs.rename(path, renameTo, {
oldPathBaseDir: getDir(), oldPathBaseDir,
newPathBaseDir: getDir(), newPathBaseDir
}) })
.then(() => { .then(() => {
onMessage(`Renamed ${path} to ${renameTo}`); onMessage(`Renamed ${path} to ${renameTo}`)
}) })
.catch(onMessage); .catch(onMessage)
} }
function truncate() { function truncate() {
file file
.truncate(0) .truncate(0)
.then(() => { .then(() => {
onMessage(`Truncated file`); onMessage(`Truncated file`)
}) })
.catch(onMessage); .catch(onMessage)
}
function write() {
const encoder = new TextEncoder()
file
.write(encoder.encode('Hello from Tauri :)'))
.then(() => {
onMessage(`wrote to file`)
})
.catch(onMessage)
} }
function stat() { function stat() {
file file
.stat() .stat()
.then((stat) => { .then((stat) => {
onMessage(`File stat ${JSON.stringify(stat)}`); onMessage(`File stat ${JSON.stringify(stat)}`)
}) })
.catch(onMessage); .catch(onMessage)
} }
function read() { function read() {
const opts = { const opts = {
baseDir: getDir(), baseDir
}; }
fs.stat(path, opts) fs.stat(path, opts)
.then((stat) => { .then((stat) => {
const isFile = stat.isFile; const isFile = stat.isFile
const promise = isFile const promise = isFile
? fs.readFile(path, opts) ? fs.readFile(path, opts)
: fs.readDir(path, opts); : fs.readDir(path, opts)
promise promise
.then(function (response) { .then(function (response) {
if (isFile) { if (isFile) {
if (path.includes(".png") || path.includes(".jpg")) { if (path.includes('.png') || path.includes('.jpg')) {
arrayBufferToBase64( arrayBufferToBase64(
new Uint8Array(response), new Uint8Array(response),
function (base64) { function (base64) {
const src = "data:image/png;base64," + base64; const src = 'data:image/png;base64,' + base64
insecureRenderHtml('<img src="' + src + '"></img>'); insecureRenderHtml('<img src="' + src + '"></img>')
} }
); )
} else { } else {
const value = String.fromCharCode.apply(null, response); const value = String.fromCharCode.apply(null, response)
insecureRenderHtml( insecureRenderHtml(
'<textarea id="file-response"></textarea><button id="file-save">Save</button>' '<textarea id="file-response"></textarea><button id="file-save">Save</button>'
); )
setTimeout(() => { setTimeout(() => {
const fileInput = document.getElementById("file-response"); const fileInput = document.getElementById('file-response')
fileInput.value = value; fileInput.value = value
document document
.getElementById("file-save") .getElementById('file-save')
.addEventListener("click", function () { .addEventListener('click', function () {
fs.writeTextFile(path, fileInput.value, { fs.writeTextFile(path, fileInput.value, {
baseDir: getDir(), baseDir
}).catch(onMessage); }).catch(onMessage)
}); })
}); })
} }
} else { } else {
onMessage(response); onMessage(response)
} }
}) })
.catch(onMessage); .catch(onMessage)
}) })
.catch(onMessage); .catch(onMessage)
} }
function setSrc() { function setSrc() {
img.src = convertFileSrc(path); img.src = convertFileSrc(path)
} }
function watch() { function watch() {
unwatch(); unwatch()
if (watchPath) { if (watchPath) {
onMessage(`Watching ${watchPath} for changes`); onMessage(`Watching ${watchPath} for changes`)
let options = { let options = {
recursive: watchRecursive, recursive: watchRecursive,
delayMs: parseInt(watchDebounceDelay), delayMs: watchDebounceDelay
}; }
if (options.delayMs === 0) { if (options.delayMs === 0) {
fs.watchImmediate(watchPath, onMessage, options) fs.watchImmediate(watchPath, onMessage, options)
.then((fn) => { .then((fn) => {
unwatchFn = fn; unwatchFn = fn
unwatchPath = watchPath; unwatchPath = watchPath
}) })
.catch(onMessage); .catch(onMessage)
} else { } else {
fs.watch(watchPath, onMessage, options) fs.watch(watchPath, onMessage, options)
.then((fn) => { .then((fn) => {
unwatchFn = fn; unwatchFn = fn
unwatchPath = watchPath; unwatchPath = watchPath
}) })
.catch(onMessage); .catch(onMessage)
} }
} }
} }
function unwatch() { function unwatch() {
if (unwatchFn) { if (unwatchFn) {
onMessage(`Stopped watching ${unwatchPath} for changes`); onMessage(`Stopped watching ${unwatchPath} for changes`)
unwatchFn(); unwatchFn()
} }
unwatchFn = undefined; unwatchFn = undefined
unwatchPath = undefined; unwatchPath = undefined
} }
onDestroy(() => { onDestroy(() => {
if (file) { if (file) {
file.close(); file.close()
} }
if (unwatchFn) { if (unwatchFn) {
unwatchFn(); unwatchFn()
} }
}) })
</script> </script>
<div class="flex flex-col"> <div class="flex flex-col">
{#if isMobile}
<div>
On mobile, paths outside of App* paths require the use of dialogs
regardless of Tauri's scope mechanism.
</div>
<br />
{/if}
<div class="flex gap-1"> <div class="flex gap-1">
<select class="input" id="dir"> <select class="input" bind:value={baseDir}>
<option value="">None</option> <option value={undefined} selected>None</option>
{#each DirOptions as dir} {#each dirOptions as dir}
<option value={dir[1]}>{dir[0]}</option> <option value={fs.BaseDirectory[dir]}>{dir}</option>
{/each} {/each}
</select> </select>
<input <input
@@ -199,20 +219,21 @@
</div> </div>
<br /> <br />
<div> <div>
<button class="btn" on:click={open}>Open</button> <button class="btn" onclick={open}>Open</button>
<button class="btn" on:click={read}>Read</button> <button class="btn" onclick={read}>Read</button>
<button class="btn" on:click={mkdir}>Mkdir</button> <button class="btn" onclick={mkdir}>Mkdir</button>
<button class="btn" on:click={remove}>Remove</button> <button class="btn" onclick={remove}>Remove</button>
<div class="flex flex-row"> <div class="flex flex-row">
<button class="btn" on:click={rename}>Rename</button> <button class="btn" onclick={rename}>Rename</button>
<input class="input" bind:value={renameTo} placeholder="To" /> <input class="input" bind:value={renameTo} placeholder="To" />
</div> </div>
<button class="btn" type="button" on:click={setSrc}>Use as img src</button> <button class="btn" type="button" onclick={setSrc}>Use as img src</button>
</div> </div>
{#if file} {#if file}
<div> <div>
<button class="btn" on:click={truncate}>Truncate</button> <button class="btn" onclick={write}>Write</button>
<button class="btn" on:click={stat}>Stat</button> <button class="btn" onclick={truncate}>Truncate</button>
<button class="btn" onclick={stat}>Stat</button>
</div> </div>
{/if} {/if}
@@ -241,8 +262,8 @@
</div> </div>
<br /> <br />
<div> <div>
<button class="btn" on:click={watch}>Watch</button> <button class="btn" onclick={watch}>Watch</button>
<button class="btn" on:click={unwatch}>Unwatch</button> <button class="btn" onclick={unwatch}>Unwatch</button>
</div> </div>
</div> </div>
+14 -4
View File
@@ -1,16 +1,21 @@
<script> <script>
import { sendNotification } from '@tauri-apps/plugin-notification'
export let onMessage export let onMessage
let sound = ''
// send the notification directly // send the notification directly
// the backend is responsible for checking the permission // the backend is responsible for checking the permission
function _sendNotification() { function _sendNotification() {
new Notification('Notification title', { sendNotification({
body: 'This is the notification body' title: 'Notification title',
body: 'This is the notification body',
sound: sound || null
}) })
} }
// alternatively, check the permission ourselves // alternatively, check the permission ourselves
function sendNotification() { function triggerNotification() {
if (Notification.permission === 'default') { if (Notification.permission === 'default') {
Notification.requestPermission() Notification.requestPermission()
.then(function (response) { .then(function (response) {
@@ -29,6 +34,11 @@
} }
</script> </script>
<button class="btn" id="notification" on:click={sendNotification}> <input
class="input grow"
placeholder="Notification sound..."
bind:value={sound}
/>
<button class="btn" id="notification" on:click={triggerNotification}>
Send test notification Send test notification
</button> </button>
@@ -0,0 +1,54 @@
<script>
import { onMount } from 'svelte'
import { getString, setString } from '@tauri-apps/plugin-secure-storage'
export let onMessage
let key
let value
let output
async function read(key) {
try {
output = await getString(key)
} catch (error) {
onMessage(error)
}
}
async function write(key, value) {
try {
await setString(key, value)
} catch (error) {
onMessage(error)
}
}
function reset() {
output = ''
}
</script>
<div class="flex flex-col childre:grow gap-1">
<div class="flex flex-col flex-row-md gap-4">
<div class="flex items-center gap-1">
Key:
<input class="grow input" bind:value={key} />
</div>
<div class="flex items-center gap-1">
Value:
<input class="grow input" bind:value />
</div>
<div>
<button class="btn" on:click={() => write(key, value)}>Write</button>
<button class="btn" on:click={() => read(key)}>Read</button>
<button class="btn" on:click={() => reset()}>Reset Output</button>
</div>
</div>
<div>
Output: {output}
</div>
</div>
+49 -32
View File
@@ -1,71 +1,85 @@
<script> <script>
import { LazyStore } from "@tauri-apps/plugin-store"; import { appDataDir, resolve } from '@tauri-apps/api/path'
import { onMount } from "svelte"; import { LazyStore } from '@tauri-apps/plugin-store'
import { onMount } from 'svelte'
export let onMessage; let { onMessage } = $props()
let key; let key = $state()
let value; let value = $state()
let store = new LazyStore("cache.json"); const storeName = 'cache.json'
let cache = {};
let store = new LazyStore(storeName)
let path = $state('')
let cache = $state({})
async function refreshEntries() { async function refreshEntries() {
try { try {
const values = await store.entries(); const values = await store.entries()
cache = {}; cache = {}
for (const [key, value] of values) { for (const [key, value] of values) {
cache[key] = value; cache[key] = value
} }
} catch (error) { } catch (error) {
onMessage(error); onMessage(error)
} }
} }
onMount(async () => { onMount(async () => {
await refreshEntries(); path = await resolve(await appDataDir(), storeName)
}); await refreshEntries()
})
async function write(key, value) { async function write(key, value) {
try { try {
if (value) { if (value) {
await store.set(key, value); await store.set(key, value)
} else { } else {
await store.delete(key); await store.delete(key)
} }
const v = await store.get(key); const v = await store.get(key)
if (v === undefined) { if (v === undefined) {
delete cache[key]; delete cache[key]
cache = cache; cache = cache
} else { } else {
cache[key] = v; cache[key] = v
} }
} catch (error) { } catch (error) {
onMessage(error); onMessage(error)
} }
} }
async function reset() { async function reset() {
try { try {
await store.reset(); await store.reset()
} catch (error) { } catch (error) {
onMessage(error); onMessage(error)
} }
await refreshEntries(); await refreshEntries()
}
async function reload() {
try {
await store.reload({ overrideDefaults: true })
} catch (error) {
onMessage(error)
}
await refreshEntries()
} }
async function close() { async function close() {
try { try {
await store.close(); await store.close()
onMessage("Store is now closed, any new operations will error out"); onMessage('Store is now closed, any new operations will error out')
} catch (error) { } catch (error) {
onMessage(error); onMessage(error)
} }
} }
function reopen() { function reopen() {
store = new LazyStore("cache.json"); store = new LazyStore(storeName)
onMessage("We made a new `LazyStore` instance, operations will now work"); onMessage('We made a new `LazyStore` instance, operations will now work')
} }
</script> </script>
@@ -82,14 +96,17 @@
</div> </div>
<div> <div>
<button class="btn" on:click={() => write(key, value)}>Write</button> <button class="btn" onclick={() => write(key, value)}>Write</button>
<button class="btn" on:click={() => reset()}>Reset</button> <button class="btn" onclick={() => reset()}>Reset</button>
<button class="btn" on:click={() => close()}>Close</button> <button class="btn" onclick={() => reload()}>Reload</button>
<button class="btn" on:click={() => reopen()}>Re-open</button> <button class="btn" onclick={() => close()}>Close</button>
<button class="btn" onclick={() => reopen()}>Re-open</button>
</div> </div>
<div>Store at <code>{path}</code> on disk</div>
</div> </div>
<div> <div>
<h2>Store Values</h2>
{#each Object.entries(cache) as [k, v]} {#each Object.entries(cache) as [k, v]}
<div>{k} = {v}</div> <div>{k} = {v}</div>
{/each} {/each}
+417
View File
@@ -0,0 +1,417 @@
<script>
import { download, upload, HttpMethod } from '@tauri-apps/plugin-upload'
import { open } from '@tauri-apps/plugin-dialog'
import { JsonView } from '@zerodevx/svelte-json-view'
import { appDataDir } from '@tauri-apps/api/path'
import { onMount } from 'svelte'
export let onMessage
let downloadUrl = 'https://httpbin.org/json'
let downloadFolder = ''
let downloadPath = ''
let downloadProgress = null
let downloadResult = null
let isDownloading = false
let uploadUrl = 'https://httpbin.org/post'
let uploadFilePath = ''
let uploadMethod = HttpMethod.Post
// Update URL when method changes
$: {
switch (uploadMethod) {
case HttpMethod.Post:
uploadUrl = 'https://httpbin.org/post'
break
case HttpMethod.Put:
uploadUrl = 'https://httpbin.org/put'
break
case HttpMethod.Patch:
uploadUrl = 'https://httpbin.org/patch'
break
}
}
let uploadProgress = null
let uploadResult = null
let isUploading = false
onMount(async () => {
try {
const defaultDir = await appDataDir()
if (!downloadFolder) {
downloadFolder = defaultDir
updateDownloadPath()
}
} catch (error) {
onMessage({ error: `Failed to get default directory: ${error.toString()}` })
}
})
async function selectDownloadFolder() {
try {
const selected = await open({
directory: true,
multiple: false,
defaultPath: downloadFolder || undefined
})
if (selected) {
downloadFolder = selected
updateDownloadPath()
}
} catch (error) {
onMessage({ error: error.toString() })
}
}
function getFilenameFromUrl(url) {
try {
const urlObj = new URL(url)
let pathname = urlObj.pathname
// Remove leading slash
if (pathname.startsWith('/')) {
pathname = pathname.substring(1)
}
// If pathname is empty or ends with slash, use a default name
if (!pathname || pathname.endsWith('/')) {
return 'downloaded-file.json'
}
// Extract filename from pathname
const segments = pathname.split('/')
let filename = segments[segments.length - 1]
// If no extension, try to infer from URL or use default
if (!filename.includes('.')) {
// Check if URL suggests a file type
if (url.includes('json') || urlObj.searchParams.has('format') && urlObj.searchParams.get('format') === 'json') {
filename += '.json'
} else if (url.includes('xml')) {
filename += '.xml'
} else if (url.includes('csv')) {
filename += '.csv'
} else {
filename += '.txt'
}
}
return filename
} catch (error) {
return 'downloaded-file.json'
}
}
function updateDownloadPath() {
if (downloadFolder && downloadUrl) {
const filename = getFilenameFromUrl(downloadUrl)
downloadPath = `${downloadFolder}/${filename}`
} else {
downloadPath = ''
}
}
// Update download path when URL changes
$: if (downloadUrl) {
updateDownloadPath()
}
async function selectUploadFile() {
try {
const selected = await open({
directory: false,
multiple: false
})
if (selected) {
uploadFilePath = selected
}
} catch (error) {
onMessage({ error: error.toString() })
}
}
async function startDownload() {
if (!downloadUrl || !downloadFolder) {
onMessage({ error: 'Please provide both URL and download folder' })
return
}
// Ensure download path is updated
updateDownloadPath()
if (!downloadPath) {
onMessage({ error: 'Could not generate download path' })
return
}
isDownloading = true
downloadProgress = null
downloadResult = null
try {
await download(
downloadUrl,
downloadPath,
(progress) => {
downloadProgress = {
progress: progress.progress,
progressTotal: progress.progressTotal,
total: progress.total,
transferSpeed: progress.transferSpeed,
percentage: progress.total > 0 ? Math.round((progress.progressTotal / progress.total) * 100) : 0
}
},
new Map([
['User-Agent', 'Tauri Upload Plugin Demo']
])
)
downloadResult = {
success: true,
message: `File downloaded successfully to: ${downloadPath}`,
finalProgress: downloadProgress
}
onMessage({
type: 'download',
result: downloadResult
})
} catch (error) {
downloadResult = {
success: false,
error: error.toString()
}
onMessage({ error: error.toString() })
} finally {
isDownloading = false
}
}
async function startUpload() {
if (!uploadUrl || !uploadFilePath) {
onMessage({ error: 'Please provide both URL and file path' })
return
}
isUploading = true
uploadProgress = null
uploadResult = null
try {
const response = await upload(
uploadUrl,
uploadFilePath,
(progress) => {
uploadProgress = {
progress: progress.progress,
progressTotal: progress.progressTotal,
total: progress.total,
transferSpeed: progress.transferSpeed,
percentage: progress.total > 0 ? Math.round((progress.progressTotal / progress.total) * 100) : 0
}
},
new Map([
['User-Agent', 'Tauri Upload Plugin Demo']
]),
uploadMethod
)
uploadResult = {
success: true,
response: response,
finalProgress: uploadProgress
}
onMessage({
type: 'upload',
result: uploadResult
})
} catch (error) {
uploadResult = {
success: false,
error: error.toString()
}
onMessage({ error: error.toString() })
} finally {
isUploading = false
}
}
</script>
<div class="space-y-6">
<div class="bg-gray-50 p-4 rounded-lg">
<h3 class="text-lg font-semibold mb-4 text-gray-800">File Download</h3>
<div class="space-y-3">
<div>
<label for="download-url" class="block text-sm font-medium text-gray-700 mb-1">Download URL:</label>
<input
id="download-url"
bind:value={downloadUrl}
type="url"
placeholder="https://example.com/file.json"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
disabled={isDownloading}
/>
</div>
<div>
<label for="download-folder" class="block text-sm font-medium text-gray-700 mb-1">Download folder:</label>
<div class="flex gap-2">
<input
id="download-folder"
bind:value={downloadFolder}
type="text"
placeholder="Select download folder..."
class="flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
disabled={isDownloading}
/>
<button
on:click={selectDownloadFolder}
class="px-4 py-2 bg-gray-500 text-white rounded-md hover:bg-gray-600 disabled:opacity-50"
disabled={isDownloading}
>
Browse
</button>
</div>
</div>
{#if downloadPath}
<div class="bg-blue-50 border border-blue-200 p-3 rounded-md">
<div class="text-sm text-blue-800">
<strong>File will be saved as:</strong>
<div class="font-mono text-xs mt-1 break-all">{downloadPath}</div>
</div>
</div>
{/if}
<button
on:click={startDownload}
class="w-full px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed"
disabled={isDownloading || !downloadUrl || !downloadFolder}
>
{isDownloading ? 'Downloading...' : 'Download File'}
</button>
{#if downloadProgress}
<div class="bg-white p-3 rounded border">
<div class="flex justify-between text-sm text-gray-600 mb-1">
<span>Progress: {downloadProgress.percentage}%</span>
<span>Speed: {Math.round(downloadProgress.transferSpeed / 1024)} KB/s</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2">
<div
class="bg-blue-500 h-2 rounded-full transition-all duration-300"
style="width: {downloadProgress.percentage}%"
></div>
</div>
<div class="text-xs text-gray-500 mt-1">
{Math.round(downloadProgress.progressTotal / 1024)} KB / {Math.round(downloadProgress.total / 1024)} KB
</div>
</div>
{/if}
{#if downloadResult}
<div class="bg-white p-3 rounded border">
<JsonView json={downloadResult} />
</div>
{/if}
</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<h3 class="text-lg font-semibold mb-4 text-gray-800">File Upload</h3>
<div class="space-y-3">
<div>
<label for="upload-url" class="block text-sm font-medium text-gray-700 mb-1">Upload URL:</label>
<input
id="upload-url"
bind:value={uploadUrl}
type="url"
placeholder="https://httpbin.org/post"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
disabled={isUploading}
/>
</div>
<div>
<label for="upload-file" class="block text-sm font-medium text-gray-700 mb-1">File to upload:</label>
<div class="flex gap-2">
<input
id="upload-file"
bind:value={uploadFilePath}
type="text"
placeholder="Select file to upload..."
class="flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
disabled={isUploading}
/>
<button
on:click={selectUploadFile}
class="px-4 py-2 bg-gray-500 text-white rounded-md hover:bg-gray-600 disabled:opacity-50"
disabled={isUploading}
>
Browse
</button>
</div>
</div>
<div>
<label for="upload-method" class="block text-sm font-medium text-gray-700 mb-1">HTTP Method:</label>
<select
id="upload-method"
bind:value={uploadMethod}
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
disabled={isUploading}
>
<option value={HttpMethod.Post}>POST</option>
<option value={HttpMethod.Put}>PUT</option>
<option value={HttpMethod.Patch}>PATCH</option>
</select>
<p class="text-xs text-gray-500 mt-1">Choose the HTTP method for the upload request</p>
</div>
<div class="bg-blue-50 border border-blue-200 p-3 rounded-md">
<div class="text-sm text-blue-800">
<strong>Upload Configuration:</strong>
<div class="font-mono text-xs mt-1">
Method: {uploadMethod} | URL: {uploadUrl || 'Not set'}
</div>
</div>
</div>
<button
on:click={startUpload}
class="w-full px-4 py-2 bg-green-500 text-white rounded-md hover:bg-green-600 disabled:opacity-50 disabled:cursor-not-allowed"
disabled={isUploading || !uploadUrl || !uploadFilePath}
>
{isUploading ? `Uploading (${uploadMethod})...` : `Upload File (${uploadMethod})`}
</button>
{#if uploadProgress}
<div class="bg-white p-3 rounded border">
<div class="flex justify-between text-sm text-gray-600 mb-1">
<span>Progress: {uploadProgress.percentage}%</span>
<span>Speed: {Math.round(uploadProgress.transferSpeed / 1024)} KB/s</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2">
<div
class="bg-green-500 h-2 rounded-full transition-all duration-300"
style="width: {uploadProgress.percentage}%"
></div>
</div>
<div class="text-xs text-gray-500 mt-1">
{Math.round(uploadProgress.progressTotal / 1024)} KB / {Math.round(uploadProgress.total / 1024)} KB
</div>
</div>
{/if}
{#if uploadResult}
<div class="bg-white p-3 rounded border">
<JsonView json={uploadResult} />
</div>
{/if}
</div>
</div>
</div>
+11 -10
View File
@@ -11,20 +11,21 @@
"example:api:dev": "pnpm run --filter \"api\" tauri dev" "example:api:dev": "pnpm run --filter \"api\" tauri dev"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "9.29.0", "@eslint/js": "9.39.1",
"@rollup/plugin-node-resolve": "16.0.1", "@rollup/plugin-node-resolve": "16.0.3",
"@rollup/plugin-terser": "0.4.4", "@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "12.1.3", "@rollup/plugin-typescript": "12.3.0",
"covector": "^0.12.4", "covector": "^0.12.4",
"eslint": "9.29.0", "eslint": "9.39.1",
"eslint-config-prettier": "10.1.5", "eslint-config-prettier": "10.1.8",
"eslint-plugin-security": "3.0.1", "eslint-plugin-security": "3.0.1",
"prettier": "3.6.1", "prettier": "3.6.2",
"rollup": "4.44.0", "rollup": "4.53.2",
"tslib": "2.8.1", "tslib": "2.8.1",
"typescript": "5.8.3", "typescript": "5.9.3",
"typescript-eslint": "8.35.0" "typescript-eslint": "8.47.0"
}, },
"minimumReleaseAge": 4320,
"pnpm": { "pnpm": {
"overrides": { "overrides": {
"esbuild@<0.25.0": ">=0.25.0" "esbuild@<0.25.0": ">=0.25.0"
@@ -34,6 +35,6 @@
] ]
}, },
"engines": { "engines": {
"pnpm": "^10.0.0" "pnpm": "^10.16.0"
} }
} }
+4
View File
@@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.5.1]
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
## \[2.5.0] ## \[2.5.0]
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6 - [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
+1 -5
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-autostart" name = "tauri-plugin-autostart"
version = "2.5.0" version = "2.5.1"
description = "Automatically launch your application at startup." description = "Automatically launch your application at startup."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
@@ -9,10 +9,6 @@ rust-version = { workspace = true }
repository = { workspace = true } repository = { workspace = true }
links = "tauri-plugin-autostart" links = "tauri-plugin-autostart"
[package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
[package.metadata.platforms.support] [package.metadata.platforms.support]
windows = { level = "full", notes = "" } windows = { level = "full", notes = "" }
linux = { level = "full", notes = "" } linux = { level = "full", notes = "" }
-9
View File
@@ -33,21 +33,12 @@ tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspac
You can install the JavaScript Guest bindings using your preferred JavaScript package manager: You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
```sh ```sh
pnpm add @tauri-apps/plugin-autostart pnpm add @tauri-apps/plugin-autostart
# or # or
npm add @tauri-apps/plugin-autostart npm add @tauri-apps/plugin-autostart
# or # or
yarn add @tauri-apps/plugin-autostart yarn add @tauri-apps/plugin-autostart
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-autostart#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-autostart#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-autostart#v2
``` ```
## Usage ## Usage
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-autostart", "name": "@tauri-apps/plugin-autostart",
"version": "2.5.0", "version": "2.5.1",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"
@@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.6.0" "@tauri-apps/api": "^2.8.0"
} }
} }
@@ -331,10 +331,10 @@
"markdownDescription": "Denies the is_enabled command without any pre-configured scope." "markdownDescription": "Denies the is_enabled command without any pre-configured scope."
}, },
{ {
"description": "This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n\n#### This default permission set includes:\n\n- `allow-enable`\n- `allow-disable`\n- `allow-is-enabled`", "description": "This permission set configures if your\r\napplication can enable or disable auto\r\nstarting the application on boot.\r\n\r\n#### Granted Permissions\r\n\r\nIt allows all to check, enable and\r\ndisable the automatic start on boot.\r\n\r\n\n#### This default permission set includes:\n\n- `allow-enable`\n- `allow-disable`\n- `allow-is-enabled`",
"type": "string", "type": "string",
"const": "default", "const": "default",
"markdownDescription": "This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n\n#### This default permission set includes:\n\n- `allow-enable`\n- `allow-disable`\n- `allow-is-enabled`" "markdownDescription": "This permission set configures if your\r\napplication can enable or disable auto\r\nstarting the application on boot.\r\n\r\n#### Granted Permissions\r\n\r\nIt allows all to check, enable and\r\ndisable the automatic start on boot.\r\n\r\n\n#### This default permission set includes:\n\n- `allow-enable`\n- `allow-disable`\n- `allow-is-enabled`"
} }
] ]
} }
+13
View File
@@ -1,5 +1,18 @@
# Changelog # Changelog
## \[2.4.2]
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
## \[2.4.1]
- [`654bf489`](https://github.com/tauri-apps/plugins-workspace/commit/654bf4891a35769f7e82971641d3ad99974b2dfe) ([#3038](https://github.com/tauri-apps/plugins-workspace/pull/3038) by [@daniel-mader](https://github.com/tauri-apps/plugins-workspace/../../daniel-mader)) Update `androidx.camera` from `1.1.0` to `1.5.1` to support 16 KB memory page sizes.
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
## \[2.4.0]
- [`aa9140e1`](https://github.com/tauri-apps/plugins-workspace/commit/aa9140e1ac239ab9f015f92b2ed52bbf0eda7c12) ([#2437](https://github.com/tauri-apps/plugins-workspace/pull/2437) by [@enkhjile](https://github.com/tauri-apps/plugins-workspace/../../enkhjile)) Added support for GS1 DataBar on iOS 15.4+
## \[2.3.0] ## \[2.3.0]
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6 - [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
+1 -3
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-barcode-scanner" name = "tauri-plugin-barcode-scanner"
version = "2.3.0" version = "2.4.2"
description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS" description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS"
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@@ -10,8 +10,6 @@ repository = { workspace = true }
links = "tauri-plugin-barcode-scanner" links = "tauri-plugin-barcode-scanner"
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-linux-android"] targets = ["x86_64-linux-android"]
[package.metadata.platforms.support] [package.metadata.platforms.support]
-9
View File
@@ -33,21 +33,12 @@ tauri-plugin-barcode-scanner = { git = "https://github.com/tauri-apps/plugins-wo
You can install the JavaScript Guest bindings using your preferred JavaScript package manager: You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
```sh ```sh
pnpm add @tauri-apps/plugin-barcode-scanner pnpm add @tauri-apps/plugin-barcode-scanner
# or # or
npm add @tauri-apps/plugin-barcode-scanner npm add @tauri-apps/plugin-barcode-scanner
# or # or
yarn add @tauri-apps/plugin-barcode-scanner yarn add @tauri-apps/plugin-barcode-scanner
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-barcode-scanner#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-barcode-scanner#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-barcode-scanner#v2
``` ```
## Usage ## Usage
@@ -5,7 +5,7 @@ plugins {
android { android {
namespace = "app.tauri.barcodescanner" namespace = "app.tauri.barcodescanner"
compileSdk = 34 compileSdk = 36
defaultConfig { defaultConfig {
minSdk = 24 minSdk = 24
@@ -33,16 +33,14 @@ android {
} }
dependencies { dependencies {
val camerax_version = "1.5.1"
implementation("androidx.core:core-ktx:1.9.0") implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.6.0") implementation("androidx.appcompat:appcompat:1.6.0")
implementation("com.google.android.material:material:1.7.0") implementation("com.google.android.material:material:1.7.0")
implementation("androidx.camera:camera-core:1.1.0") implementation("androidx.camera:camera-core:${camerax_version}")
implementation("androidx.camera:camera-view:1.1.0") implementation("androidx.camera:camera-camera2:${camerax_version}")
implementation("androidx.camera:camera-lifecycle:1.1.0") implementation("androidx.camera:camera-lifecycle:${camerax_version}")
implementation("androidx.camera:camera-camera2:1.1.0") implementation("androidx.camera:camera-view:${camerax_version}")
implementation("androidx.camera:camera-lifecycle:1.1.0")
implementation("androidx.camera:camera-view:1.1.0")
implementation("com.google.android.gms:play-services-mlkit-barcode-scanning:18.1.0") implementation("com.google.android.gms:play-services-mlkit-barcode-scanning:18.1.0")
testImplementation("junit:junit:4.13.2") testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.ext:junit:1.1.5")
+1 -1
View File
@@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_BARCODE_SCANNER__=function(n){"use strict";async function e(n,e={},r){return window.__TAURI_INTERNALS__.invoke(n,e,r)}var r;return"function"==typeof SuppressedError&&SuppressedError,n.Format=void 0,(r=n.Format||(n.Format={})).QRCode="QR_CODE",r.UPC_A="UPC_A",r.UPC_E="UPC_E",r.EAN8="EAN_8",r.EAN13="EAN_13",r.Code39="CODE_39",r.Code93="CODE_93",r.Code128="CODE_128",r.Codabar="CODABAR",r.ITF="ITF",r.Aztec="AZTEC",r.DataMatrix="DATA_MATRIX",r.PDF417="PDF_417",n.cancel=async function(){await e("plugin:barcode-scanner|cancel")},n.checkPermissions=async function(){return await async function(n){return e(`plugin:${n}|check_permissions`)}("barcode-scanner").then((n=>n.camera))},n.openAppSettings=async function(){await e("plugin:barcode-scanner|open_app_settings")},n.requestPermissions=async function(){return await async function(n){return e(`plugin:${n}|request_permissions`)}("barcode-scanner").then((n=>n.camera))},n.scan=async function(n){return await e("plugin:barcode-scanner|scan",{...n})},n}({});Object.defineProperty(window.__TAURI__,"barcodeScanner",{value:__TAURI_PLUGIN_BARCODE_SCANNER__})} if("__TAURI__"in window){var __TAURI_PLUGIN_BARCODE_SCANNER__=function(n){"use strict";async function a(n,a={},e){return window.__TAURI_INTERNALS__.invoke(n,a,e)}var e;return"function"==typeof SuppressedError&&SuppressedError,n.Format=void 0,(e=n.Format||(n.Format={})).QRCode="QR_CODE",e.UPC_A="UPC_A",e.UPC_E="UPC_E",e.EAN8="EAN_8",e.EAN13="EAN_13",e.Code39="CODE_39",e.Code93="CODE_93",e.Code128="CODE_128",e.Codabar="CODABAR",e.ITF="ITF",e.Aztec="AZTEC",e.DataMatrix="DATA_MATRIX",e.PDF417="PDF_417",e.GS1DataBar="GS1_DATA_BAR",e.GS1DataBarLimited="GS1_DATA_BAR_LIMITED",e.GS1DataBarExpanded="GS1_DATA_BAR_EXPANDED",n.cancel=async function(){await a("plugin:barcode-scanner|cancel")},n.checkPermissions=async function(){return await async function(n){return a(`plugin:${n}|check_permissions`)}("barcode-scanner").then((n=>n.camera))},n.openAppSettings=async function(){await a("plugin:barcode-scanner|open_app_settings")},n.requestPermissions=async function(){return await async function(n){return a(`plugin:${n}|request_permissions`)}("barcode-scanner").then((n=>n.camera))},n.scan=async function(n){return await a("plugin:barcode-scanner|scan",{...n})},n}({});Object.defineProperty(window.__TAURI__,"barcodeScanner",{value:__TAURI_PLUGIN_BARCODE_SCANNER__})}
+19 -1
View File
@@ -12,6 +12,9 @@ export type { PermissionState } from '@tauri-apps/api/core'
export enum Format { export enum Format {
QRCode = 'QR_CODE', QRCode = 'QR_CODE',
/**
* Not supported on iOS.
*/
UPC_A = 'UPC_A', UPC_A = 'UPC_A',
UPC_E = 'UPC_E', UPC_E = 'UPC_E',
EAN8 = 'EAN_8', EAN8 = 'EAN_8',
@@ -19,11 +22,26 @@ export enum Format {
Code39 = 'CODE_39', Code39 = 'CODE_39',
Code93 = 'CODE_93', Code93 = 'CODE_93',
Code128 = 'CODE_128', Code128 = 'CODE_128',
/**
* Not supported on iOS.
*/
Codabar = 'CODABAR', Codabar = 'CODABAR',
ITF = 'ITF', ITF = 'ITF',
Aztec = 'AZTEC', Aztec = 'AZTEC',
DataMatrix = 'DATA_MATRIX', DataMatrix = 'DATA_MATRIX',
PDF417 = 'PDF_417' PDF417 = 'PDF_417',
/**
* Not supported on Android. Requires iOS 15.4+
*/
GS1DataBar = 'GS1_DATA_BAR',
/**
* Not supported on Android. Requires iOS 15.4+
*/
GS1DataBarLimited = 'GS1_DATA_BAR_LIMITED',
/**
* Not supported on Android. Requires iOS 15.4+
*/
GS1DataBarExpanded = 'GS1_DATA_BAR_EXPANDED'
} }
export interface ScanOptions { export interface ScanOptions {
@@ -27,8 +27,11 @@ enum SupportedFormat: String, CaseIterable, Decodable {
case DATA_MATRIX case DATA_MATRIX
case PDF_417 case PDF_417
case QR_CODE case QR_CODE
case GS1_DATA_BAR
case GS1_DATA_BAR_LIMITED
case GS1_DATA_BAR_EXPANDED
var value: AVMetadataObject.ObjectType { var value: AVMetadataObject.ObjectType? {
switch self { switch self {
case .UPC_E: return AVMetadataObject.ObjectType.upce case .UPC_E: return AVMetadataObject.ObjectType.upce
case .EAN_8: return AVMetadataObject.ObjectType.ean8 case .EAN_8: return AVMetadataObject.ObjectType.ean8
@@ -41,6 +44,24 @@ enum SupportedFormat: String, CaseIterable, Decodable {
case .DATA_MATRIX: return AVMetadataObject.ObjectType.dataMatrix case .DATA_MATRIX: return AVMetadataObject.ObjectType.dataMatrix
case .PDF_417: return AVMetadataObject.ObjectType.pdf417 case .PDF_417: return AVMetadataObject.ObjectType.pdf417
case .QR_CODE: return AVMetadataObject.ObjectType.qr case .QR_CODE: return AVMetadataObject.ObjectType.qr
case .GS1_DATA_BAR:
if #available(iOS 15.4, *) {
return AVMetadataObject.ObjectType.gs1DataBar
} else {
return nil
}
case .GS1_DATA_BAR_LIMITED:
if #available(iOS 15.4, *) {
return AVMetadataObject.ObjectType.gs1DataBarLimited
} else {
return nil
}
case .GS1_DATA_BAR_EXPANDED:
if #available(iOS 15.4, *) {
return AVMetadataObject.ObjectType.gs1DataBarExpanded
} else {
return nil
}
} }
} }
} }
@@ -170,6 +191,7 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate {
if self.captureSession != nil { if self.captureSession != nil {
self.captureSession!.stopRunning() self.captureSession!.stopRunning()
self.cameraView.removePreviewLayer() self.cameraView.removePreviewLayer()
self.cameraView.removeFromSuperview()
self.captureVideoPreviewLayer = nil self.captureVideoPreviewLayer = nil
self.metaOutput = nil self.metaOutput = nil
self.captureSession = nil self.captureSession = nil
@@ -242,12 +264,19 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate {
scanFormats = [AVMetadataObject.ObjectType]() scanFormats = [AVMetadataObject.ObjectType]()
(args.formats ?? []).forEach { format in (args.formats ?? []).forEach { format in
scanFormats.append(format.value) if let formatValue = format.value {
scanFormats.append(formatValue)
} else {
invoke.reject("Unsupported barcode format on this iOS version: \(format)")
return
}
} }
if scanFormats.count == 0 { if scanFormats.isEmpty {
for supportedFormat in SupportedFormat.allCases { for supportedFormat in SupportedFormat.allCases {
scanFormats.append(supportedFormat.value) if let formatValue = supportedFormat.value {
scanFormats.append(formatValue)
}
} }
} }
@@ -52,6 +52,15 @@ func discoverCaptureDevices() -> [AVCaptureDevice] {
} }
func formatStringFromMetadata(_ type: AVMetadataObject.ObjectType) -> String { func formatStringFromMetadata(_ type: AVMetadataObject.ObjectType) -> String {
if #available(iOS 15.4, *) {
if type == .gs1DataBar {
return "GS1_DATA_BAR"
} else if type == .gs1DataBarLimited {
return "GS1_DATA_BAR_LIMITED"
} else if type == .gs1DataBarExpanded {
return "GS1_DATA_BAR_EXPANDED"
}
}
switch type { switch type {
case AVMetadataObject.ObjectType.upce: case AVMetadataObject.ObjectType.upce:
return "UPC_E" return "UPC_E"
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-barcode-scanner", "name": "@tauri-apps/plugin-barcode-scanner",
"version": "2.3.0", "version": "2.4.2",
"description": "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS", "description": "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
@@ -25,6 +25,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.6.0" "@tauri-apps/api": "^2.8.0"
} }
} }
+8
View File
@@ -1,5 +1,13 @@
# Changelog # Changelog
## \[2.3.2]
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
## \[2.3.1]
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
## \[2.3.0] ## \[2.3.0]
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6 - [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
+1 -3
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-biometric" name = "tauri-plugin-biometric"
version = "2.3.0" version = "2.3.2"
description = "Prompt the user for biometric authentication on Android and iOS." description = "Prompt the user for biometric authentication on Android and iOS."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@@ -9,8 +9,6 @@ repository = { workspace = true }
links = "tauri-plugin-biometric" links = "tauri-plugin-biometric"
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-linux-android"] targets = ["x86_64-linux-android"]
[package.metadata.platforms.support] [package.metadata.platforms.support]
-9
View File
@@ -33,8 +33,6 @@ tauri-plugin-biometric = { git = "https://github.com/tauri-apps/plugins-workspac
You can install the JavaScript Guest bindings using your preferred JavaScript package manager: You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
<!-- Add the branch for installations using git! --> <!-- Add the branch for installations using git! -->
```sh ```sh
@@ -43,13 +41,6 @@ pnpm add @tauri-apps/plugin-biometric
npm add @tauri-apps/plugin-biometric npm add @tauri-apps/plugin-biometric
# or # or
yarn add @tauri-apps/plugin-biometric yarn add @tauri-apps/plugin-biometric
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-biometric#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-biometric#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-biometric#v2
``` ```
## Usage ## Usage
+1 -1
View File
@@ -5,7 +5,7 @@ plugins {
android { android {
namespace = "app.tauri.biometric" namespace = "app.tauri.biometric"
compileSdk = 34 compileSdk = 36
defaultConfig { defaultConfig {
minSdk = 24 minSdk = 24
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-biometric", "name": "@tauri-apps/plugin-biometric",
"version": "2.3.0", "version": "2.3.2",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"
@@ -25,6 +25,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.6.0" "@tauri-apps/api": "^2.8.0"
} }
} }
@@ -319,10 +319,10 @@
"markdownDescription": "Denies the status command without any pre-configured scope." "markdownDescription": "Denies the status command without any pre-configured scope."
}, },
{ {
"description": "This permission set configures which\nbiometric features are by default exposed.\n\n#### Granted Permissions\n\nIt allows acccess to all biometric commands.\n\n\n#### This default permission set includes:\n\n- `allow-authenticate`\n- `allow-status`", "description": "This permission set configures which\r\nbiometric features are by default exposed.\r\n\r\n#### Granted Permissions\r\n\r\nIt allows acccess to all biometric commands.\r\n\r\n\n#### This default permission set includes:\n\n- `allow-authenticate`\n- `allow-status`",
"type": "string", "type": "string",
"const": "default", "const": "default",
"markdownDescription": "This permission set configures which\nbiometric features are by default exposed.\n\n#### Granted Permissions\n\nIt allows acccess to all biometric commands.\n\n\n#### This default permission set includes:\n\n- `allow-authenticate`\n- `allow-status`" "markdownDescription": "This permission set configures which\r\nbiometric features are by default exposed.\r\n\r\n#### Granted Permissions\r\n\r\nIt allows acccess to all biometric commands.\r\n\r\n\n#### This default permission set includes:\n\n- `allow-authenticate`\n- `allow-status`"
} }
] ]
} }
+4
View File
@@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.4.1]
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
## \[2.4.0] ## \[2.4.0]
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6 - [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
+1 -5
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-cli" name = "tauri-plugin-cli"
version = "2.4.0" version = "2.4.1"
description = "Parse arguments from your Tauri application's command line interface." description = "Parse arguments from your Tauri application's command line interface."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@@ -9,10 +9,6 @@ rust-version = { workspace = true }
repository = { workspace = true } repository = { workspace = true }
links = "tauri-plugin-cli" links = "tauri-plugin-cli"
[package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
[package.metadata.platforms.support] [package.metadata.platforms.support]
windows = { level = "full", notes = "" } windows = { level = "full", notes = "" }
linux = { level = "full", notes = "" } linux = { level = "full", notes = "" }
-9
View File
@@ -34,21 +34,12 @@ tauri-plugin-cli = { git = "https://github.com/tauri-apps/plugins-workspace", br
You can install the JavaScript Guest bindings using your preferred JavaScript package manager: You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
```sh ```sh
pnpm add @tauri-apps/plugin-cli pnpm add @tauri-apps/plugin-cli
# or # or
npm add @tauri-apps/plugin-cli npm add @tauri-apps/plugin-cli
# or # or
yarn add @tauri-apps/plugin-cli yarn add @tauri-apps/plugin-cli
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-cli#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-cli#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-cli#v2
``` ```
## Usage ## Usage
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-cli", "name": "@tauri-apps/plugin-cli",
"version": "2.4.0", "version": "2.4.1",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"
@@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.6.0" "@tauri-apps/api": "^2.8.0"
} }
} }
+8
View File
@@ -1,5 +1,13 @@
# Changelog # Changelog
## \[2.3.2]
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
## \[2.3.1]
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
## \[2.3.0] ## \[2.3.0]
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6 - [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
+2 -3
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-clipboard-manager" name = "tauri-plugin-clipboard-manager"
version = "2.3.0" version = "2.3.2"
description = "Read and write to the system clipboard." description = "Read and write to the system clipboard."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@@ -10,8 +10,7 @@ repository = { workspace = true }
links = "tauri-plugin-clipboard-manager" links = "tauri-plugin-clipboard-manager"
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"] targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"]
[package.metadata.platforms.support] [package.metadata.platforms.support]
-9
View File
@@ -33,21 +33,12 @@ tauri-plugin-clipboard-manager = { git = "https://github.com/tauri-apps/plugins-
You can install the JavaScript Guest bindings using your preferred JavaScript package manager: You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
```sh ```sh
pnpm add @tauri-apps/plugin-clipboard-manager pnpm add @tauri-apps/plugin-clipboard-manager
# or # or
npm add @tauri-apps/plugin-clipboard-manager npm add @tauri-apps/plugin-clipboard-manager
# or # or
yarn add @tauri-apps/plugin-clipboard-manager yarn add @tauri-apps/plugin-clipboard-manager
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-clipboard-manager#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-clipboard-manager#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-clipboard-manager#v2
``` ```
## Usage ## Usage
@@ -5,7 +5,7 @@ plugins {
android { android {
namespace = "app.tauri.clipboard" namespace = "app.tauri.clipboard"
compileSdk = 34 compileSdk = 36
defaultConfig { defaultConfig {
minSdk = 24 minSdk = 24
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-clipboard-manager", "name": "@tauri-apps/plugin-clipboard-manager",
"version": "2.3.0", "version": "2.3.2",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"
@@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.6.0" "@tauri-apps/api": "^2.8.0"
} }
} }
@@ -367,10 +367,10 @@
"markdownDescription": "Denies the write_text command without any pre-configured scope." "markdownDescription": "Denies the write_text command without any pre-configured scope."
}, },
{ {
"description": "No features are enabled by default, as we believe\nthe clipboard can be inherently dangerous and it is \napplication specific if read and/or write access is needed.\n\nClipboard interaction needs to be explicitly enabled.\n", "description": "No features are enabled by default, as we believe\r\nthe clipboard can be inherently dangerous and it is\r\napplication specific if read and/or write access is needed.\r\n\r\nClipboard interaction needs to be explicitly enabled.\r\n",
"type": "string", "type": "string",
"const": "default", "const": "default",
"markdownDescription": "No features are enabled by default, as we believe\nthe clipboard can be inherently dangerous and it is \napplication specific if read and/or write access is needed.\n\nClipboard interaction needs to be explicitly enabled.\n" "markdownDescription": "No features are enabled by default, as we believe\r\nthe clipboard can be inherently dangerous and it is\r\napplication specific if read and/or write access is needed.\r\n\r\nClipboard interaction needs to be explicitly enabled.\r\n"
} }
] ]
} }
+22
View File
@@ -1,5 +1,27 @@
# Changelog # Changelog
## \[2.4.5]
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
## \[2.4.4]
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
- [`e25a9339`](https://github.com/tauri-apps/plugins-workspace/commit/e25a9339f46268f70dc9afd0c5ab3decbf79b330) ([#3019](https://github.com/tauri-apps/plugins-workspace/pull/3019) by [@kevinschoonover](https://github.com/tauri-apps/plugins-workspace/../../kevinschoonover)) Fix Exec= field in desktop handler if executable path changes
## \[2.4.3]
- [`2522b71f`](https://github.com/tauri-apps/plugins-workspace/commit/2522b71f6bcae65c03b24415eb9295c9e7c84ffc) ([#2970](https://github.com/tauri-apps/plugins-workspace/pull/2970) by [@WSH032](https://github.com/tauri-apps/plugins-workspace/../../WSH032)) Revert the breaking change introduced by [#2928](https://github.com/tauri-apps/plugins-workspace/pull/2928).
## \[2.4.2]
- [`21d721a0`](https://github.com/tauri-apps/plugins-workspace/commit/21d721a0c2731fc201872f5b99ea8bbdc61b0b60) ([#2928](https://github.com/tauri-apps/plugins-workspace/pull/2928) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Linux, improved error messages when OS commands fail.
## \[2.4.1]
- [`d4f8299b`](https://github.com/tauri-apps/plugins-workspace/commit/d4f8299b12f107718c70692840a63768d65baaf9) ([#2844](https://github.com/tauri-apps/plugins-workspace/pull/2844) by [@yobson1](https://github.com/tauri-apps/plugins-workspace/../../yobson1)) Fix deep link protocol handler not set as default on linux
Fix duplicate protocols added to MimeType section in .desktop files on linux
## \[2.4.0] ## \[2.4.0]
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6 - [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
+7 -6
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-deep-link" name = "tauri-plugin-deep-link"
version = "2.4.0" version = "2.4.5"
description = "Set your Tauri application as the default handler for an URL" description = "Set your Tauri application as the default handler for an URL"
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }
@@ -10,16 +10,14 @@ repository = { workspace = true }
links = "tauri-plugin-deep-link" links = "tauri-plugin-deep-link"
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-linux-android"] targets = ["x86_64-linux-android"]
[package.metadata.platforms.support] [package.metadata.platforms.support]
windows = { level = "full", notes = "" } windows = { level = "full", notes = "" }
linux = { level = "full", notes = "" } linux = { level = "full", notes = "" }
macos = { level = "partial", notes = "Runtime deep link registration is not supported" } macos = { level = "partial", notes = "Deep links must be registered in config. Dynamic registration at runtime is not supported." }
android = { level = "partial", notes = "Runtime deep link registration is not supported" } android = { level = "partial", notes = "Deep links must be registered in config. Dynamic registration at runtime is not supported." }
ios = { level = "partial", notes = "Runtime deep link registration is not supported" } ios = { level = "partial", notes = "Deep links must be registered in config. Dynamic registration at runtime is not supported." }
[build-dependencies] [build-dependencies]
serde = { workspace = true } serde = { workspace = true }
@@ -27,6 +25,9 @@ serde_json = { workspace = true }
tauri-utils = { workspace = true } tauri-utils = { workspace = true }
tauri-plugin = { workspace = true, features = ["build"] } tauri-plugin = { workspace = true, features = ["build"] }
[target."cfg(target_os = \"macos\")".build-dependencies]
plist = "1"
[dependencies] [dependencies]
serde = { workspace = true } serde = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
-9
View File
@@ -33,21 +33,12 @@ tauri-plugin-deep-link = { git = "https://github.com/tauri-apps/plugins-workspac
You can install the JavaScript Guest bindings using your preferred JavaScript package manager: You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
```sh ```sh
pnpm add @tauri-apps/plugin-deep-link pnpm add @tauri-apps/plugin-deep-link
# or # or
npm add @tauri-apps/plugin-deep-link npm add @tauri-apps/plugin-deep-link
# or # or
yarn add @tauri-apps/plugin-deep-link yarn add @tauri-apps/plugin-deep-link
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-deep-link#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-deep-link#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-deep-link#v2
``` ```
## Setting up ## Setting up
+1 -1
View File
@@ -5,7 +5,7 @@ plugins {
android { android {
namespace = "app.tauri.deep_link" namespace = "app.tauri.deep_link"
compileSdk = 34 compileSdk = 36
defaultConfig { defaultConfig {
minSdk = 24 minSdk = 24
+109 -16
View File
@@ -10,50 +10,64 @@ const COMMANDS: &[&str] = &["get_current", "register", "unregister", "is_registe
// TODO: Consider using activity-alias in case users may have multiple activities in their app. // TODO: Consider using activity-alias in case users may have multiple activities in their app.
fn intent_filter(domain: &AssociatedDomain) -> String { fn intent_filter(domain: &AssociatedDomain) -> String {
let host = domain
.host
.as_ref()
.map(|h| format!(r#"<data android:host="{h}" />"#))
.unwrap_or_default();
let auto_verify = if domain.is_app_link() {
r#"android:autoVerify="true" "#.to_string()
} else {
String::new()
};
format!( format!(
r#"<intent-filter android:autoVerify="true"> r#"<intent-filter {auto_verify}>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
{} {schemes}
<data android:host="{}" /> {host}
{} {domains}
{} {path_patterns}
{} {path_prefixes}
{} {path_suffixes}
</intent-filter>"#, </intent-filter>"#,
domain schemes = domain
.scheme .scheme
.iter() .iter()
.map(|scheme| format!(r#"<data android:scheme="{scheme}" />"#)) .map(|scheme| format!(r#"<data android:scheme="{scheme}" />"#))
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join("\n "), .join("\n "),
domain.host, host = host,
domain domains = domain
.path .path
.iter() .iter()
.map(|path| format!(r#"<data android:path="{path}" />"#)) .map(|path| format!(r#"<data android:path="{path}" />"#))
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join("\n "), .join("\n "),
domain path_patterns = domain
.path_pattern .path_pattern
.iter() .iter()
.map(|pattern| format!(r#"<data android:pathPattern="{pattern}" />"#)) .map(|pattern| format!(r#"<data android:pathPattern="{pattern}" />"#))
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join("\n "), .join("\n "),
domain path_prefixes = domain
.path_prefix .path_prefix
.iter() .iter()
.map(|prefix| format!(r#"<data android:pathPrefix="{prefix}" />"#)) .map(|prefix| format!(r#"<data android:pathPrefix="{prefix}" />"#))
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join("\n "), .join("\n "),
domain path_suffixes = domain
.path_suffix .path_suffix
.iter() .iter()
.map(|suffix| format!(r#"<data android:pathSuffix="{suffix}" />"#)) .map(|suffix| format!(r#"<data android:pathSuffix="{suffix}" />"#))
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join("\n "), .join("\n "),
) )
.trim()
.to_string()
} }
fn main() { fn main() {
@@ -68,6 +82,16 @@ fn main() {
} }
if let Some(config) = tauri_plugin::plugin_config::<Config>("deep-link") { if let Some(config) = tauri_plugin::plugin_config::<Config>("deep-link") {
let errors: Vec<String> = config
.mobile
.iter()
.filter_map(|d| d.validate().err())
.collect();
if !errors.is_empty() {
panic!("Deep link config validation failed:\n{}", errors.join("\n"));
}
tauri_plugin::mobile::update_android_manifest( tauri_plugin::mobile::update_android_manifest(
"DEEP LINK PLUGIN", "DEEP LINK PLUGIN",
"activity", "activity",
@@ -80,20 +104,89 @@ fn main() {
) )
.expect("failed to rewrite AndroidManifest.xml"); .expect("failed to rewrite AndroidManifest.xml");
#[cfg(target_os = "macos")] #[cfg(any(target_os = "macos", target_os = "ios"))]
{ {
// we need to ensure that the entitlements are only
// generated for explicit app links and not
// other deep links because then they
// are just going to complain and not be built or signed
let has_app_links = config.mobile.iter().any(|d| d.is_app_link());
if !has_app_links {
tauri_plugin::mobile::update_entitlements(|entitlements| {
entitlements.remove("com.apple.developer.associated-domains");
})
.expect("failed to update entitlements");
} else {
tauri_plugin::mobile::update_entitlements(|entitlements| { tauri_plugin::mobile::update_entitlements(|entitlements| {
entitlements.insert( entitlements.insert(
"com.apple.developer.associated-domains".into(), "com.apple.developer.associated-domains".into(),
config config
.mobile .mobile
.into_iter() .iter()
.map(|d| format!("applinks:{}", d.host).into()) .filter(|d| d.is_app_link())
.filter_map(|d| d.host.as_ref())
.map(|host| format!("applinks:{}", host).into())
.collect::<Vec<_>>() .collect::<Vec<_>>()
.into(), .into(),
); );
}) })
.expect("failed to update entitlements"); .expect("failed to update entitlements");
} }
let deep_link_domains = config
.mobile
.iter()
.filter_map(|domain| {
if domain.is_app_link() {
return None;
}
Some(domain)
})
.collect::<Vec<_>>();
if deep_link_domains.is_empty() {
tauri_plugin::mobile::update_info_plist(|info_plist| {
info_plist.remove("CFBundleURLTypes");
})
.expect("failed to update Info.plist");
} else {
tauri_plugin::mobile::update_info_plist(|info_plist| {
info_plist.insert(
"CFBundleURLTypes".into(),
deep_link_domains
.iter()
.map(|domain| {
let schemes = domain
.scheme
.iter()
.filter(|scheme| {
scheme.as_str() != "https" && scheme.as_str() != "http"
})
.collect::<Vec<_>>();
let mut dict = plist::Dictionary::new();
dict.insert(
"CFBundleURLSchemes".into(),
schemes
.iter()
.map(|s| s.to_string().into())
.collect::<Vec<_>>()
.into(),
);
dict.insert(
"CFBundleURLName".into(),
format!("{}", domain.scheme[0]).into(),
);
plist::Value::Dictionary(dict)
})
.collect::<Vec<_>>()
.into(),
);
})
.expect("failed to update Info.plist");
}
}
} }
} }
@@ -1,5 +1,35 @@
# Changelog # Changelog
## \[2.2.8]
### Dependencies
- Upgraded to `deep-link-js@2.4.5`
## \[2.2.7]
### Dependencies
- Upgraded to `deep-link-js@2.4.4`
## \[2.2.6]
### Dependencies
- Upgraded to `deep-link-js@2.4.3`
## \[2.2.5]
### Dependencies
- Upgraded to `deep-link-js@2.4.2`
## \[2.2.4]
### Dependencies
- Upgraded to `deep-link-js@2.4.1`
## \[2.2.3] ## \[2.2.3]
### Dependencies ### Dependencies
+5 -5
View File
@@ -1,7 +1,7 @@
{ {
"name": "deep-link-example", "name": "deep-link-example",
"private": true, "private": true,
"version": "2.2.3", "version": "2.2.8",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
@@ -10,12 +10,12 @@
"tauri": "tauri" "tauri": "tauri"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.6.0", "@tauri-apps/api": "2.9.0",
"@tauri-apps/plugin-deep-link": "2.4.0" "@tauri-apps/plugin-deep-link": "2.4.5"
}, },
"devDependencies": { "devDependencies": {
"@tauri-apps/cli": "2.6.0", "@tauri-apps/cli": "2.9.4",
"typescript": "^5.7.3", "typescript": "^5.7.3",
"vite": "^6.2.6" "vite": "^7.0.7"
} }
} }
@@ -14,13 +14,13 @@ val tauriProperties = Properties().apply {
} }
android { android {
compileSdk = 34 compileSdk = 36
namespace = "com.tauri.deep_link_example" namespace = "com.tauri.deep_link_example"
defaultConfig { defaultConfig {
manifestPlaceholders["usesCleartextTraffic"] = "false" manifestPlaceholders["usesCleartextTraffic"] = "false"
applicationId = "com.tauri.deep_link_example" applicationId = "com.tauri.deep_link_example"
minSdk = 24 minSdk = 24
targetSdk = 34 targetSdk = 36
versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt() versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()
versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0") versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0")
} }
@@ -58,9 +58,10 @@ rust {
} }
dependencies { dependencies {
implementation("androidx.webkit:webkit:1.6.1") implementation("androidx.webkit:webkit:1.14.0")
implementation("androidx.appcompat:appcompat:1.6.1") implementation("androidx.appcompat:appcompat:1.7.1")
implementation("com.google.android.material:material:1.8.0") implementation("androidx.activity:activity-ktx:1.10.1")
implementation("com.google.android.material:material:1.12.0")
testImplementation("junit:junit:4.13.2") testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.4") androidTestImplementation("androidx.test.ext:junit:1.1.4")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
@@ -27,19 +27,36 @@
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" /> <data android:scheme="https" />
<data android:scheme="http" />
<data android:host="fabianlars.de" /> <data android:host="fabianlars.de" />
<data android:pathPrefix="/intent" /> <data android:pathPrefix="/intent" />
</intent-filter> </intent-filter>
<intent-filter android:autoVerify="true" > <intent-filter android:autoVerify="true" >
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" /> <data android:scheme="https" />
<data android:scheme="http" />
<data android:host="tauri.app" /> <data android:host="tauri.app" />
</intent-filter>
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="taurideeplink" />
</intent-filter> </intent-filter>
<!-- DEEP LINK PLUGIN. AUTO-GENERATED. DO NOT REMOVE. --> <!-- DEEP LINK PLUGIN. AUTO-GENERATED. DO NOT REMOVE. -->
</activity> </activity>
@@ -1,7 +1,11 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
package com.tauri.deep_link_example package com.tauri.deep_link_example
class MainActivity : TauriActivity() import android.os.Bundle
import androidx.activity.enableEdgeToEdge
class MainActivity : TauriActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
}
}
@@ -4,7 +4,7 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath("com.android.tools.build:gradle:8.5.1") classpath("com.android.tools.build:gradle:8.11.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25")
} }
} }
@@ -18,6 +18,6 @@ repositories {
dependencies { dependencies {
compileOnly(gradleApi()) compileOnly(gradleApi())
implementation("com.android.tools.build:gradle:8.5.1") implementation("com.android.tools.build:gradle:8.11.0")
} }
@@ -1,6 +1,6 @@
#Tue May 10 19:22:52 CST 2022 #Tue May 10 19:22:52 CST 2022
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17150" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17150" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX">
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17122"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17122"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
@@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 56; objectVersion = 63;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@@ -167,6 +167,8 @@
dependencies = ( dependencies = (
); );
name = "deep-link-example_iOS"; name = "deep-link-example_iOS";
packageProductDependencies = (
);
productName = "deep-link-example_iOS"; productName = "deep-link-example_iOS";
productReference = 1CAAFA750FD735A285DC1238 /* deep-link-example.app */; productReference = 1CAAFA750FD735A285DC1238 /* deep-link-example.app */;
productType = "com.apple.product-type.application"; productType = "com.apple.product-type.application";
@@ -189,6 +191,7 @@
en, en,
); );
mainGroup = 1DC58B1705AA3ECC6B887FE7; mainGroup = 1DC58B1705AA3ECC6B887FE7;
minimizedProjectReferenceProxies = 1;
projectDirPath = ""; projectDirPath = "";
projectRoot = ""; projectRoot = "";
targets = ( targets = (
@@ -227,7 +230,6 @@
outputPaths = ( outputPaths = (
"$(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a", "$(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a",
"$(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a", "$(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a",
"$(SRCROOT)/Externals/arm64-sim/${CONFIGURATION}/libapp.a",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
@@ -314,18 +316,13 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ARCHS = ( ARCHS = arm64;
arm64,
"arm64-sim",
);
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "deep-link-example_iOS/deep-link-example_iOS.entitlements"; CODE_SIGN_ENTITLEMENTS = "deep-link-example_iOS/deep-link-example_iOS.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = "Q93MBH6S2F";
DEVELOPMENT_TEAM = Q93MBH6S2F;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphoneos*]" = "arm64-sim x86_64"; "EXCLUDED_ARCHS[sdk=iphoneos*]" = x86_64;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"\".\"", "\".\"",
@@ -335,13 +332,6 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
"LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = (
"$(inherited)",
"$(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION)",
"$(SDKROOT)/usr/lib/swift",
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
);
"LIBRARY_SEARCH_PATHS[arch=arm64]" = ( "LIBRARY_SEARCH_PATHS[arch=arm64]" = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION)", "$(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION)",
@@ -360,7 +350,7 @@
PRODUCT_NAME = "deep-link-example"; PRODUCT_NAME = "deep-link-example";
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = "arm64 arm64-sim"; VALID_ARCHS = arm64;
}; };
name = debug; name = debug;
}; };
@@ -424,18 +414,13 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ARCHS = ( ARCHS = arm64;
arm64,
"arm64-sim",
);
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "deep-link-example_iOS/deep-link-example_iOS.entitlements"; CODE_SIGN_ENTITLEMENTS = "deep-link-example_iOS/deep-link-example_iOS.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = "Q93MBH6S2F";
DEVELOPMENT_TEAM = Q93MBH6S2F;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphoneos*]" = "arm64-sim x86_64"; "EXCLUDED_ARCHS[sdk=iphoneos*]" = x86_64;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"\".\"", "\".\"",
@@ -445,13 +430,6 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
"LIBRARY_SEARCH_PATHS[arch=arm64-sim]" = (
"$(inherited)",
"$(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION)",
"$(SDKROOT)/usr/lib/swift",
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
);
"LIBRARY_SEARCH_PATHS[arch=arm64]" = ( "LIBRARY_SEARCH_PATHS[arch=arm64]" = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION)", "$(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION)",
@@ -470,7 +448,7 @@
PRODUCT_NAME = "deep-link-example"; PRODUCT_NAME = "deep-link-example";
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = "arm64 arm64-sim"; VALID_ARCHS = arm64;
}; };
name = release; name = release;
}; };
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.0.0</string> <string>0.1.0</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>0.1.0</string> <string>0.1.0</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
@@ -40,5 +40,16 @@
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>taurideeplink</string>
</array>
<key>CFBundleURLName</key>
<string>taurideeplink</string>
</dict>
</array>
</dict> </dict>
</plist> </plist>
@@ -1,7 +1,3 @@
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: deep-link-example name: deep-link-example
options: options:
bundleIdPrefix: com.tauri.deep-link-example bundleIdPrefix: com.tauri.deep-link-example
@@ -16,7 +12,6 @@ settingGroups:
base: base:
PRODUCT_NAME: deep-link-example PRODUCT_NAME: deep-link-example
PRODUCT_BUNDLE_IDENTIFIER: com.tauri.deep-link-example PRODUCT_BUNDLE_IDENTIFIER: com.tauri.deep-link-example
DEVELOPMENT_TEAM: Q93MBH6S2F
targetTemplates: targetTemplates:
app: app:
type: application type: application
@@ -56,8 +51,8 @@ targets:
- UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight - UIInterfaceOrientationLandscapeRight
CFBundleShortVersionString: 0.0.0 CFBundleShortVersionString: 0.1.0
CFBundleVersion: 0.0.0 CFBundleVersion: '0.1.0'
entitlements: entitlements:
path: deep-link-example_iOS/deep-link-example_iOS.entitlements path: deep-link-example_iOS/deep-link-example_iOS.entitlements
scheme: scheme:
@@ -67,14 +62,12 @@ targets:
settings: settings:
base: base:
ENABLE_BITCODE: false ENABLE_BITCODE: false
ARCHS: [arm64, arm64-sim] ARCHS: [arm64]
VALID_ARCHS: arm64 arm64-sim VALID_ARCHS: arm64
LIBRARY_SEARCH_PATHS[arch=x86_64]: $(inherited) $(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) LIBRARY_SEARCH_PATHS[arch=x86_64]: $(inherited) $(PROJECT_DIR)/Externals/x86_64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
LIBRARY_SEARCH_PATHS[arch=arm64]: $(inherited) $(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) LIBRARY_SEARCH_PATHS[arch=arm64]: $(inherited) $(PROJECT_DIR)/Externals/arm64/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
LIBRARY_SEARCH_PATHS[arch=arm64-sim]: $(inherited) $(PROJECT_DIR)/Externals/arm64-sim/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: true ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES: true
EXCLUDED_ARCHS[sdk=iphonesimulator*]: arm64 EXCLUDED_ARCHS[sdk=iphoneos*]: x86_64
EXCLUDED_ARCHS[sdk=iphoneos*]: arm64-sim x86_64
groups: [app] groups: [app]
dependencies: dependencies:
- framework: libapp.a - framework: libapp.a
@@ -93,4 +86,3 @@ targets:
outputFiles: outputFiles:
- $(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a - $(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a
- $(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a - $(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a
- $(SRCROOT)/Externals/arm64-sim/${CONFIGURATION}/libapp.a
@@ -35,6 +35,9 @@
}, },
{ {
"host": "tauri.app" "host": "tauri.app"
},
{
"scheme": ["taurideeplink"]
} }
], ],
"desktop": { "desktop": {
+5 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-deep-link", "name": "@tauri-apps/plugin-deep-link",
"version": "2.4.0", "version": "2.4.5",
"description": "Set your Tauri application as the default handler for an URL", "description": "Set your Tauri application as the default handler for an URL",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"authors": [ "authors": [
@@ -25,6 +25,9 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.6.0" "@tauri-apps/api": "^2.8.0"
},
"devDependencies": {
"@tauri-apps/cli": "2.9.4"
} }
} }
+45 -11
View File
@@ -11,10 +11,8 @@ use tauri_utils::config::DeepLinkProtocol;
pub struct AssociatedDomain { pub struct AssociatedDomain {
#[serde(default = "default_schemes")] #[serde(default = "default_schemes")]
pub scheme: Vec<String>, pub scheme: Vec<String>,
#[serde(default, deserialize_with = "deserialize_associated_host")]
#[serde(deserialize_with = "deserialize_associated_host")] pub host: Option<String>, // Optional custom uri schemes dont NEED a host (may have one still), but required for https/http schemes
pub host: String,
#[serde(default)] #[serde(default)]
pub path: Vec<String>, pub path: Vec<String>,
#[serde(default, alias = "path-pattern", rename = "pathPattern")] #[serde(default, alias = "path-pattern", rename = "pathPattern")]
@@ -23,6 +21,41 @@ pub struct AssociatedDomain {
pub path_prefix: Vec<String>, pub path_prefix: Vec<String>,
#[serde(default, alias = "path-suffix", rename = "pathSuffix")] #[serde(default, alias = "path-suffix", rename = "pathSuffix")]
pub path_suffix: Vec<String>, pub path_suffix: Vec<String>,
#[serde(default, alias = "app-link", rename = "appLink")]
pub app_link: Option<bool>,
}
impl AssociatedDomain {
/// Returns true if the domain uses http or https scheme.
pub fn is_web_link(&self) -> bool {
self.scheme.iter().any(|s| s == "https" || s == "http")
}
/// Returns true if the domain uses http or https scheme and has proper host configuration.
pub fn is_app_link(&self) -> bool {
self.app_link
.unwrap_or_else(|| self.is_web_link() && self.host.is_some())
}
pub fn validate(&self) -> Result<(), String> {
// Rule 1: All web links require a host.
if self.is_web_link() && self.host.is_none() {
return Err("Web link requires a host".into());
}
// Rule 2: If it's an App Link, ensure http(s) and host.
if self.is_app_link() {
if !self.is_web_link() {
return Err("AppLink must be a valid web link (https/http + host)".into());
}
if self.scheme.iter().any(|s| s == "http") && !self.scheme.iter().any(|s| s == "https")
{
eprintln!("Warning: AppLink uses only 'http' — allowed on Android but not secure for production.");
}
}
Ok(())
}
} }
// TODO: Consider removing this in v3 // TODO: Consider removing this in v3
@@ -30,19 +63,20 @@ fn default_schemes() -> Vec<String> {
vec!["https".to_string(), "http".to_string()] vec!["https".to_string(), "http".to_string()]
} }
fn deserialize_associated_host<'de, D>(deserializer: D) -> Result<String, D::Error> fn deserialize_associated_host<'de, D>(deserializer: D) -> Result<Option<String>, D::Error>
where where
D: Deserializer<'de>, D: Deserializer<'de>,
{ {
let host = String::deserialize(deserializer)?; let opt = Option::<String>::deserialize(deserializer)?;
if let Some((scheme, _host)) = host.split_once("://") { if let Some(ref host) = opt {
Err(serde::de::Error::custom(format!( if let Some((scheme, _)) = host.split_once("://") {
return Err(serde::de::Error::custom(format!(
"host `{host}` cannot start with a scheme, please remove the `{scheme}://` prefix" "host `{host}` cannot start with a scheme, please remove the `{scheme}://` prefix"
))) )));
} else {
Ok(host)
} }
} }
Ok(opt)
}
#[derive(Deserialize, Clone)] #[derive(Deserialize, Clone)]
pub struct Config { pub struct Config {
+10
View File
@@ -28,6 +28,16 @@ pub enum Error {
PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError), PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError),
} }
// TODO(v3): change this into an error in v3,
// see <https://github.com/tauri-apps/plugins-workspace/pull/2970#issuecomment-3244660138>.
#[inline]
#[cfg(target_os = "linux")]
pub(crate) fn inspect_command_error<'a>(command: &'a str) -> impl Fn(&std::io::Error) + 'a {
move |e| {
tracing::error!("Failed to run OS command `{command}`: {e}");
}
}
impl Serialize for Error { impl Serialize for Error {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error> fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where where
+36 -10
View File
@@ -254,6 +254,7 @@ mod imp {
/// ///
/// ## Platform-specific: /// ## Platform-specific:
/// ///
/// - **Linux**: Needs the `xdg-mime` and `update-desktop-database` commands available on the system.
/// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`). /// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`).
pub fn register<S: AsRef<str>>(&self, _protocol: S) -> crate::Result<()> { pub fn register<S: AsRef<str>>(&self, _protocol: S) -> crate::Result<()> {
#[cfg(windows)] #[cfg(windows)]
@@ -292,6 +293,7 @@ mod imp {
.unwrap_or_else(|| bin.into_os_string()) .unwrap_or_else(|| bin.into_os_string())
.to_string_lossy() .to_string_lossy()
.to_string(); .to_string();
let qualified_exec = format!("{} %u", exec);
let target = self.app.path().data_dir()?.join("applications"); let target = self.app.path().data_dir()?.join("applications");
@@ -303,13 +305,31 @@ mod imp {
if let Ok(mut desktop_file) = ini::Ini::load_from_file(&target_file) { if let Ok(mut desktop_file) = ini::Ini::load_from_file(&target_file) {
if let Some(section) = desktop_file.section_mut(Some("Desktop Entry")) { if let Some(section) = desktop_file.section_mut(Some("Desktop Entry")) {
let old_mimes = section.remove("MimeType"); let old_mimes = section.remove("MimeType").unwrap_or_default();
section.append( let mut change = false;
"MimeType",
format!("{mime_type};{}", old_mimes.unwrap_or_default()), // if the mime type is not present, append it to the list
); if !old_mimes.split(';').any(|mime| mime == mime_type) {
section.append("MimeType", format!("{mime_type};{old_mimes}"));
change = true;
} else {
section.insert("MimeType".to_string(), old_mimes);
}
// if the exec command doesnt match, update to the new one
let old_exec = section.remove("Exec").unwrap_or_default();
if old_exec != qualified_exec {
section.append("Exec", qualified_exec);
change = true;
} else {
section.insert("Exec".to_string(), old_exec.to_string());
}
// if any property has changed, rewrite the .desktop file
if change {
desktop_file.write_to_file(&target_file)?; desktop_file.write_to_file(&target_file)?;
} }
}
} else { } else {
let mut file = File::create(target_file)?; let mut file = File::create(target_file)?;
file.write_all( file.write_all(
@@ -321,7 +341,7 @@ mod imp {
.product_name .product_name
.clone() .clone()
.unwrap_or_else(|| file_name.clone()), .unwrap_or_else(|| file_name.clone()),
exec = exec, qualified_exec = qualified_exec,
mime_type = mime_type mime_type = mime_type
) )
.as_bytes(), .as_bytes(),
@@ -330,11 +350,15 @@ mod imp {
Command::new("update-desktop-database") Command::new("update-desktop-database")
.arg(target) .arg(target)
.status()?; .status()
.inspect_err(crate::error::inspect_command_error(
"update-desktop-database",
))?;
Command::new("xdg-mime") Command::new("xdg-mime")
.args(["default", &file_name, _protocol.as_ref()]) .args(["default", &file_name, mime_type.as_str()])
.status()?; .status()
.inspect_err(crate::error::inspect_command_error("xdg-mime"))?;
Ok(()) Ok(())
} }
@@ -403,6 +427,7 @@ mod imp {
/// ///
/// ## Platform-specific: /// ## Platform-specific:
/// ///
/// - **Linux**: Needs the `xdg-mime` command available on the system.
/// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`). /// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`).
pub fn is_registered<S: AsRef<str>>(&self, _protocol: S) -> crate::Result<bool> { pub fn is_registered<S: AsRef<str>>(&self, _protocol: S) -> crate::Result<bool> {
#[cfg(windows)] #[cfg(windows)]
@@ -437,7 +462,8 @@ mod imp {
"default", "default",
&format!("x-scheme-handler/{}", _protocol.as_ref()), &format!("x-scheme-handler/{}", _protocol.as_ref()),
]) ])
.output()?; .output()
.inspect_err(crate::error::inspect_command_error("xdg-mime"))?;
Ok(String::from_utf8_lossy(&output.stdout).contains(&file_name)) Ok(String::from_utf8_lossy(&output.stdout).contains(&file_name))
} }
+1 -1
View File
@@ -1,7 +1,7 @@
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Name={name} Name={name}
Exec={exec} %u Exec={qualified_exec}
Terminal=false Terminal=false
MimeType={mime_type} MimeType={mime_type}
NoDisplay=true NoDisplay=true
+36
View File
@@ -1,5 +1,41 @@
# Changelog # Changelog
## \[2.4.2]
- [`93426f85`](https://github.com/tauri-apps/plugins-workspace/commit/93426f85120f49beb9f40222bff45185a32d54a9) Fixed an issue that caused docs.rs builds to fail. No user facing changes.
### Dependencies
- Upgraded to `fs-js@2.4.4`
## \[2.4.1]
- [`6c9b61fb`](https://github.com/tauri-apps/plugins-workspace/commit/6c9b61fb658145d13893626112fc489f7458aa17) ([#3039](https://github.com/tauri-apps/plugins-workspace/pull/3039) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) On Android, updated compileSdk to 36.
### Dependencies
- Upgraded to `fs-js@2.4.3`
## \[2.4.0]
- [`509eba8d`](https://github.com/tauri-apps/plugins-workspace/commit/509eba8d441c4f6ecf0af77b572cb2afd69a752d) ([#2641](https://github.com/tauri-apps/plugins-workspace/pull/2641) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Add support for showing a message dialog with 3 buttons.
## \[2.3.3]
### Dependencies
- Upgraded to `fs-js@2.4.2`
## \[2.3.2]
- [`af08c66f`](https://github.com/tauri-apps/plugins-workspace/commit/af08c66faafe0dffc4b0a80aef030cd3f0f89a9c) ([#2871](https://github.com/tauri-apps/plugins-workspace/pull/2871) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed an issue that caused the file picker not to open on Android when extension filters were set.
## \[2.3.1]
### Dependencies
- Upgraded to `fs-js@2.4.1`
## \[2.3.0] ## \[2.3.0]
- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6 - [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
+8 -5
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-dialog" name = "tauri-plugin-dialog"
version = "2.3.0" version = "2.4.2"
description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application." description = "Native system dialogs for opening and saving files along with message dialogs on your Tauri application."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@@ -9,9 +9,12 @@ rust-version = { workspace = true }
repository = { workspace = true } repository = { workspace = true }
links = "tauri-plugin-dialog" links = "tauri-plugin-dialog"
[features]
default = ["gtk3"]
xdg-portal = ["rfd/xdg-portal"]
gtk3 = ["rfd/gtk3"]
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"] targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"]
[package.metadata.platforms.support] [package.metadata.platforms.support]
@@ -34,7 +37,7 @@ tauri = { workspace = true }
log = { workspace = true } log = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
url = { workspace = true } url = { workspace = true }
tauri-plugin-fs = { path = "../fs", version = "2.4.0" } tauri-plugin-fs = { path = "../fs", version = "2.4.4" }
[target.'cfg(target_os = "ios")'.dependencies] [target.'cfg(target_os = "ios")'.dependencies]
tauri = { workspace = true, features = ["wry"] } tauri = { workspace = true, features = ["wry"] }
@@ -42,7 +45,7 @@ tauri = { workspace = true, features = ["wry"] }
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
rfd = { version = "0.15", default-features = false, features = [ rfd = { version = "0.15", default-features = false, features = [
"tokio", "tokio",
"gtk3",
"common-controls-v6", "common-controls-v6",
] } ] }
raw-window-handle = "0.6" raw-window-handle = "0.6"
+18 -9
View File
@@ -31,9 +31,25 @@ tauri-plugin-dialog = "2.0.0"
tauri-plugin-dialog = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } tauri-plugin-dialog = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
``` ```
You can install the JavaScript Guest bindings using your preferred JavaScript package manager: ### Linux XDG Desktop Portal Support
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use. By default, this plugin uses gtk to show dialogs, however since `v2.5.0` you can switch to using [XDG Desktop Portal](https://flatpak.github.io/xdg-desktop-portal/) by adding the following to your `Cargo.toml` file:
```toml
[dependencies]
tauri-plugin-dialog = { version = "2.5.0", default-features = false, features = ["xdg-portal"] }
# alternatively with Git:
tauri-plugin-dialog = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2", default-features = false, features = ["xdg-portal"] }
```
Do note if you use the `xdg-portal` feature, you need to ensure that [`zenity`](https://gitlab.gnome.org/GNOME/zenity) and an [XDG Desktop Portal backend](https://flatpak.github.io/xdg-desktop-portal#using-portals) is installed with your program.
For more information, see [XDG Desktop Portal documentation](https://flatpak.github.io/xdg-desktop-portal/) and [`rfd` documentation](https://docs.rs/rfd/latest/rfd#xdg-desktop-portal-backend).
### JavaScript
You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
```sh ```sh
pnpm add @tauri-apps/plugin-dialog pnpm add @tauri-apps/plugin-dialog
@@ -41,13 +57,6 @@ pnpm add @tauri-apps/plugin-dialog
npm add @tauri-apps/plugin-dialog npm add @tauri-apps/plugin-dialog
# or # or
yarn add @tauri-apps/plugin-dialog yarn add @tauri-apps/plugin-dialog
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-dialog#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-dialog#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-dialog#v2
``` ```
## Usage ## Usage
+1 -1
View File
@@ -5,7 +5,7 @@ plugins {
android { android {
namespace = "app.tauri.dialog" namespace = "app.tauri.dialog"
compileSdk = 34 compileSdk = 36
defaultConfig { defaultConfig {
minSdk = 24 minSdk = 24
@@ -31,6 +31,7 @@ class Filter {
class FilePickerOptions { class FilePickerOptions {
lateinit var filters: Array<Filter> lateinit var filters: Array<Filter>
var multiple: Boolean? = null var multiple: Boolean? = null
var pickerMode: String? = null
} }
@InvokeArg @InvokeArg
@@ -38,6 +39,7 @@ class MessageOptions {
var title: String? = null var title: String? = null
lateinit var message: String lateinit var message: String
var okButtonLabel: String? = null var okButtonLabel: String? = null
var noButtonLabel: String? = null
var cancelButtonLabel: String? = null var cancelButtonLabel: String? = null
} }
@@ -57,15 +59,22 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
val args = invoke.parseArgs(FilePickerOptions::class.java) val args = invoke.parseArgs(FilePickerOptions::class.java)
val parsedTypes = parseFiltersOption(args.filters) val parsedTypes = parseFiltersOption(args.filters)
val intent = if (parsedTypes.isNotEmpty()) { // TODO: ACTION_OPEN_DOCUMENT ??
val intent = Intent(Intent.ACTION_PICK)
setIntentMimeTypes(intent, parsedTypes)
intent
} else {
val intent = Intent(Intent.ACTION_GET_CONTENT) val intent = Intent(Intent.ACTION_GET_CONTENT)
intent.addCategory(Intent.CATEGORY_OPENABLE) intent.addCategory(Intent.CATEGORY_OPENABLE)
if (args.pickerMode == "image") {
intent.type = "image/*"
} else if (args.pickerMode == "video") {
intent.type = "video/*"
} else if (args.pickerMode == "media") {
intent.type = "*/*"
intent.putExtra(Intent.EXTRA_MIME_TYPES, arrayOf("video/*", "image/*"))
} else if (parsedTypes.isNotEmpty()) {
intent.type = "*/*"
intent.putExtra(Intent.EXTRA_MIME_TYPES, parsedTypes)
} else {
intent.type = "*/*" intent.type = "*/*"
intent
} }
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, args.multiple ?: false) intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, args.multiple ?: false)
@@ -132,34 +141,6 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
return mimeTypes.toTypedArray() return mimeTypes.toTypedArray()
} }
private fun setIntentMimeTypes(intent: Intent, mimeTypes: Array<String>) {
if (mimeTypes.isNotEmpty()) {
var uniqueMimeKind = true
var mimeKind: String? = null
for (mime in mimeTypes) {
val kind = mime.split("/")[0]
if (mimeKind == null) {
mimeKind = kind
} else if (mimeKind != kind) {
uniqueMimeKind = false
}
}
if (uniqueMimeKind) {
if (mimeTypes.size > 1) {
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes)
intent.type = Intent.normalizeMimeType("$mimeKind/*")
} else {
intent.type = mimeTypes[0]
}
} else {
intent.type = "*/*"
}
} else {
intent.type = "*/*"
}
}
@Command @Command
fun showMessageDialog(invoke: Invoke) { fun showMessageDialog(invoke: Invoke) {
val args = invoke.parseArgs(MessageOptions::class.java) val args = invoke.parseArgs(MessageOptions::class.java)
@@ -169,9 +150,8 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
return return
} }
val handler = { cancelled: Boolean, value: Boolean -> val handler = { value: String ->
val ret = JSObject() val ret = JSObject()
ret.put("cancelled", cancelled)
ret.put("value", value) ret.put("value", value)
invoke.resolve(ret) invoke.resolve(ret)
} }
@@ -183,24 +163,34 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
if (args.title != null) { if (args.title != null) {
builder.setTitle(args.title) builder.setTitle(args.title)
} }
val okButtonLabel = args.okButtonLabel ?: "Ok"
builder builder
.setMessage(args.message) .setMessage(args.message)
.setPositiveButton( .setPositiveButton(okButtonLabel) { dialog, _ ->
args.okButtonLabel ?: "OK"
) { dialog, _ ->
dialog.dismiss() dialog.dismiss()
handler(false, true) handler(okButtonLabel)
} }
.setOnCancelListener { dialog -> .setOnCancelListener { dialog ->
dialog.dismiss() dialog.dismiss()
handler(true, false) handler(args.cancelButtonLabel ?: "Cancel")
} }
if (args.noButtonLabel != null) {
builder.setNeutralButton(args.noButtonLabel) { dialog, _ ->
dialog.dismiss()
handler(args.noButtonLabel!!)
}
}
if (args.cancelButtonLabel != null) { if (args.cancelButtonLabel != null) {
builder.setNegativeButton( args.cancelButtonLabel) { dialog, _ -> builder.setNegativeButton( args.cancelButtonLabel) { dialog, _ ->
dialog.dismiss() dialog.dismiss()
handler(false, false) handler(args.cancelButtonLabel!!)
} }
} }
val dialog = builder.create() val dialog = builder.create()
dialog.show() dialog.show()
} }
@@ -213,10 +203,14 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
val parsedTypes = parseFiltersOption(args.filters) val parsedTypes = parseFiltersOption(args.filters)
val intent = Intent(Intent.ACTION_CREATE_DOCUMENT) val intent = Intent(Intent.ACTION_CREATE_DOCUMENT)
setIntentMimeTypes(intent, parsedTypes)
intent.addCategory(Intent.CATEGORY_OPENABLE) intent.addCategory(Intent.CATEGORY_OPENABLE)
intent.putExtra(Intent.EXTRA_TITLE, args.fileName ?: "") intent.putExtra(Intent.EXTRA_TITLE, args.fileName ?: "")
intent.type = "*/*"
if (parsedTypes.isNotEmpty()) {
intent.putExtra(Intent.EXTRA_MIME_TYPES, parsedTypes)
}
startActivityForResult(invoke, intent, "saveFileDialogResult") startActivityForResult(invoke, intent, "saveFileDialogResult")
} catch (ex: Exception) { } catch (ex: Exception) {
val message = ex.message ?: "Failed to pick save file" val message = ex.message ?: "Failed to pick save file"
+1 -1
View File
@@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_DIALOG__=function(t){"use strict";async function n(t,n={},e){return window.__TAURI_INTERNALS__.invoke(t,n,e)}return"function"==typeof SuppressedError&&SuppressedError,t.ask=async function(t,e){const i="string"==typeof e?{title:e}:e;return await n("plugin:dialog|ask",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,yesButtonLabel:i?.okLabel?.toString(),noButtonLabel:i?.cancelLabel?.toString()})},t.confirm=async function(t,e){const i="string"==typeof e?{title:e}:e;return await n("plugin:dialog|confirm",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString(),cancelButtonLabel:i?.cancelLabel?.toString()})},t.message=async function(t,e){const i="string"==typeof e?{title:e}:e;await n("plugin:dialog|message",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString()})},t.open=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|open",{options:t})},t.save=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|save",{options:t})},t}({});Object.defineProperty(window.__TAURI__,"dialog",{value:__TAURI_PLUGIN_DIALOG__})} if("__TAURI__"in window){var __TAURI_PLUGIN_DIALOG__=function(t){"use strict";async function n(t,n={},e){return window.__TAURI_INTERNALS__.invoke(t,n,e)}function e(t){if(void 0!==t)return"string"==typeof t?t:"ok"in t&&"cancel"in t?{OkCancelCustom:[t.ok,t.cancel]}:"yes"in t&&"no"in t&&"cancel"in t?{YesNoCancelCustom:[t.yes,t.no,t.cancel]}:"ok"in t?{OkCustom:t.ok}:void 0}return"function"==typeof SuppressedError&&SuppressedError,t.ask=async function(t,e){const o="string"==typeof e?{title:e}:e;return await n("plugin:dialog|ask",{message:t.toString(),title:o?.title?.toString(),kind:o?.kind,yesButtonLabel:o?.okLabel?.toString(),noButtonLabel:o?.cancelLabel?.toString()})},t.confirm=async function(t,e){const o="string"==typeof e?{title:e}:e;return await n("plugin:dialog|confirm",{message:t.toString(),title:o?.title?.toString(),kind:o?.kind,okButtonLabel:o?.okLabel?.toString(),cancelButtonLabel:o?.cancelLabel?.toString()})},t.message=async function(t,o){const i="string"==typeof o?{title:o}:o;return n("plugin:dialog|message",{message:t.toString(),title:i?.title?.toString(),kind:i?.kind,okButtonLabel:i?.okLabel?.toString(),buttons:e(i?.buttons)})},t.open=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|open",{options:t})},t.save=async function(t={}){return"object"==typeof t&&Object.freeze(t),await n("plugin:dialog|save",{options:t})},t}({});Object.defineProperty(window.__TAURI__,"dialog",{value:__TAURI_PLUGIN_DIALOG__})}

Some files were not shown because too many files have changed in this diff Show More