mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-03 12:15:11 +02:00
Compare commits
451 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b75f9f5cd3 | |||
| d865ed4768 | |||
| 1107c46425 | |||
| 23a3705857 | |||
| 6f65e68340 | |||
| 1a0b791650 | |||
| 2d03e2eac2 | |||
| 21d721a0c2 | |||
| 8abb31ee59 | |||
| 0354046817 | |||
| 04a0954857 | |||
| 9e4e859bea | |||
| 2371804172 | |||
| 90f9b9310a | |||
| 1c58f3372c | |||
| 75617a6a92 | |||
| 5a963a0496 | |||
| 76f4e7bb84 | |||
| 670ac1d7c1 | |||
| ed0deef2cf | |||
| 50cebdb6d5 | |||
| dd2ea9cfa5 | |||
| 515182a179 | |||
| d3d290ab8a | |||
| b51c827b2c | |||
| a4b71a1992 | |||
| 4eb36b0ff5 | |||
| b8056f484c | |||
| 5ac8fbb1fa | |||
| e0323ec752 | |||
| cc98e6a892 | |||
| af22ae0a97 | |||
| 2f24c7a70c | |||
| fe23a5e013 | |||
| ff6d23ede1 | |||
| 449dd117a4 | |||
| 9b43f48856 | |||
| af08c66faa | |||
| 7974acae22 | |||
| a985359e69 | |||
| 97bebcf6e8 | |||
| 27ddcd0abe | |||
| d7fb5623d6 | |||
| d4f8299b12 | |||
| 341919ed57 | |||
| 124f2191aa | |||
| 0970b94949 | |||
| 7340242d4e | |||
| d66aa6ff78 | |||
| 6f345870df | |||
| 708fa4e2b7 | |||
| b729203059 | |||
| 2f9c71aae7 | |||
| 80d4d8e128 | |||
| e7a98b0d2e | |||
| 44a1f65912 | |||
| 6210cd31df | |||
| 467f07b7de | |||
| 7ba6e08a86 | |||
| 989470f0d7 | |||
| ca3c3aa28a | |||
| aa9140e1ac | |||
| 6a8f255878 | |||
| 8ac494da7c | |||
| 1635282868 | |||
| 4587e4a2b3 | |||
| 1135dc7ed3 | |||
| fe01894e7f | |||
| 36400b5678 | |||
| ead3c268e1 | |||
| adc23d6c4f | |||
| fc573b35a7 | |||
| 901ddfb73d | |||
| f209b2f23c | |||
| 19ed1bd3cc | |||
| 5779099688 | |||
| 2aec8ff4c4 | |||
| 9799f0dbab | |||
| 8cdaacdc6e | |||
| d46778e80b | |||
| a0288648f8 | |||
| f6e11282a7 | |||
| 5642283dba | |||
| 37c2fb4120 | |||
| 27c2193d42 | |||
| eea363625a | |||
| 735d209d5d | |||
| e008434504 | |||
| 3eebea2a17 | |||
| 6bc3e81dc6 | |||
| f634e5248e | |||
| 9841ff81ce | |||
| 2e680620c4 | |||
| 041b93f46b | |||
| a05698ac24 | |||
| 0acca18f65 | |||
| ce9888a2d4 | |||
| 106e46ed51 | |||
| 8b63de9dfe | |||
| 73ff15de5d | |||
| ff19affa7b | |||
| f501bc2f1c | |||
| 87afa23cad | |||
| d40190721c | |||
| 909bc1f9ca | |||
| 9bc4b2230e | |||
| b9dc03d5ce | |||
| cd8fbf834a | |||
| 764e8f7719 | |||
| 85635a2807 | |||
| 848e703b78 | |||
| b768b0623b | |||
| 047081c3d5 | |||
| 7cd8c7806e | |||
| 6c9e08dccb | |||
| a6b854032d | |||
| 494d1fea13 | |||
| 4a29dd6cc6 | |||
| fa778d602a | |||
| 323afd1b6d | |||
| 682bb47cda | |||
| 98e268a98f | |||
| 4d10acee61 | |||
| 2448e717e5 | |||
| 91d1521a4c | |||
| dce04b7d72 | |||
| d8e627522c | |||
| 5cb158983c | |||
| dde6f3c31c | |||
| dac4d53724 | |||
| 5e78988f72 | |||
| 4089002880 | |||
| dc84f8d8bb | |||
| ff384cbabe | |||
| 4bb51b3cc8 | |||
| c5b0f51cfd | |||
| 10f9e66e32 | |||
| c97e9c511d | |||
| 60075f0fb6 | |||
| f81e8003c0 | |||
| 686a839c96 | |||
| db7baff3fc | |||
| c9b21f6f43 | |||
| c698e72594 | |||
| 4ec8716155 | |||
| 2445e103f2 | |||
| 4cd625049d | |||
| d88387ace6 | |||
| ba611e4341 | |||
| 60fc35d35c | |||
| 9629c2f4f9 | |||
| d1609913be | |||
| c2fd60ab3f | |||
| 996975ce52 | |||
| 20770a96ae | |||
| efe3f88acd | |||
| 8b39aefb1b | |||
| beab018b21 | |||
| 9cf0390a52 | |||
| 4dd5c51436 | |||
| d2aef2fddb | |||
| 02e886b21a | |||
| d78930cdd4 | |||
| a35fea5015 | |||
| a77b1353e9 | |||
| 6fa388d0b2 | |||
| 2d731f8022 | |||
| 0bc5d58874 | |||
| 517a29a1a1 | |||
| 8ecb418a1a | |||
| 286e3c6252 | |||
| 174b31b8b1 | |||
| 35c1cd9aa5 | |||
| 37c0477afe | |||
| 831c35ff39 | |||
| a9cbefc910 | |||
| 43f0f95da6 | |||
| 38deef43dc | |||
| c245f123ea | |||
| 8c540d54a1 | |||
| 9ebbfb2e3c | |||
| 4bbcdbd556 | |||
| 12c4537b8e | |||
| a15eedf378 | |||
| 5347de8db9 | |||
| d3183aa99d | |||
| 1e9e496b06 | |||
| 1bb1ced538 | |||
| 68eb74353b | |||
| 95e8f909b1 | |||
| 8882dea3b9 | |||
| b40a02c525 | |||
| a1b3fa27f1 | |||
| e54cfcb261 | |||
| 22ba197b80 | |||
| 77520a3587 | |||
| dbc5fe120a | |||
| faefcc9fd8 | |||
| ac60d589ec | |||
| cb38f54f4a | |||
| d37bbdef8d | |||
| 3a750c7300 | |||
| 5c9cf52e75 | |||
| 02df0421d6 | |||
| f7f5bbf259 | |||
| 561cf39f64 | |||
| 024815018f | |||
| e90cd9fab1 | |||
| 1b86af8e26 | |||
| 1dba334f00 | |||
| 54e7864507 | |||
| 45c7848714 | |||
| 393e956728 | |||
| 1a9846599b | |||
| 71f95c9f05 | |||
| 8b3cd9e827 | |||
| 39c022eea2 | |||
| 7527a3465a | |||
| abca2ebc0d | |||
| ddcfad46f9 | |||
| fbd4d28920 | |||
| 0af367f7d4 | |||
| 1ab5f15763 | |||
| c10d5bfb54 | |||
| f6838d507f | |||
| 5b3a1aaf73 | |||
| 3276d65801 | |||
| e0900f0451 | |||
| 4d38066ef9 | |||
| 3b37ce1508 | |||
| 6f881293fc | |||
| 9229f991fe | |||
| b3bf74212e | |||
| c5da9d2579 | |||
| 7a5495963b | |||
| 7d3869ced8 | |||
| fa8c544479 | |||
| 14660b6230 | |||
| 6b4c391738 | |||
| d5d9f7c970 | |||
| 63f9449c9a | |||
| e0cff9bcf4 | |||
| 5411db68a8 | |||
| 80804adc68 | |||
| 93edbd1434 | |||
| 3ebec74983 | |||
| 51f5aff58a | |||
| 5369898db7 | |||
| a7497b0aeb | |||
| aaa88fa45f | |||
| ca7395a5ce | |||
| 6ae853c2e6 | |||
| d5fb5337a0 | |||
| 512a188c7a | |||
| ad17266273 | |||
| 78acfa456f | |||
| 0b3b3a22d2 | |||
| 384b598fcf | |||
| b2fe305a84 | |||
| 68d8f3be38 | |||
| 9ac2aa88e6 | |||
| 18700f1e82 | |||
| 0afc9b6be0 | |||
| bda803fbdd | |||
| 105136494c | |||
| ce11079f19 | |||
| 784a54a390 | |||
| bdb7febf9c | |||
| e76272b619 | |||
| cf0dff049b | |||
| 28f5c33d65 | |||
| 5b82118158 | |||
| 125ec1dbcf | |||
| c545fcf896 | |||
| 0ec895c378 | |||
| 406e6f484c | |||
| b63d724e85 | |||
| c73b773724 | |||
| d467313d0c | |||
| efc7bb19a8 | |||
| c9c13a0fe7 | |||
| da5c59e2fe | |||
| f555d2981d | |||
| 4c7cb96bbd | |||
| 0ad53785ab | |||
| e2203b760f | |||
| b0d9b3b4eb | |||
| 8a5813940c | |||
| ba6d0f1a63 | |||
| a431d63b96 | |||
| 5ab167f419 | |||
| fb67ab2b92 | |||
| ec548035ff | |||
| 6112867735 | |||
| c21eda24a9 | |||
| 05cca602d9 | |||
| 3a826fb6bf | |||
| 86bae64a52 | |||
| 8d4c925a62 | |||
| 6149e70916 | |||
| a9ac1e3c93 | |||
| 3461a7ae2c | |||
| 7a83d4f7e1 | |||
| 1fe70dc61c | |||
| b21915938f | |||
| 57efb47c11 | |||
| c4d50aa9ec | |||
| 768b72acf8 | |||
| 8d6c992661 | |||
| 83b6507269 | |||
| da64d9b665 | |||
| aa2f2bfba0 | |||
| 51919fb26c | |||
| ee0f65de5c | |||
| 319ef556cd | |||
| 802399a969 | |||
| c9acff99c6 | |||
| 18dffc9dfe | |||
| 829b632650 | |||
| 501eae173b | |||
| 3ff5ccd8fb | |||
| eb94dda28a | |||
| 6fcb2f5f40 | |||
| 3a79266b8c | |||
| 0469f025b2 | |||
| 77b855074a | |||
| 6b1a6d62f0 | |||
| ae002af2d6 | |||
| f7ad349ed2 | |||
| 5b8efde906 | |||
| 69d508ee69 | |||
| fe610d6759 | |||
| a7e58f5654 | |||
| 715a0477be | |||
| 05c62d731f | |||
| ce83d53775 | |||
| 6dbc304c28 | |||
| ab8cf45bb9 | |||
| 3ef756f4ce | |||
| 664c452697 | |||
| 82fa1e1f45 | |||
| 3195646996 | |||
| 6f6a178ae4 | |||
| 28935b65be | |||
| 1f5ed2fbb0 | |||
| de4808f96d | |||
| 59076b0a35 | |||
| 484eadaf33 | |||
| 2572018e3f | |||
| ab9a24b89b | |||
| 33e924574a | |||
| 76f99ce999 | |||
| 241319ae1d | |||
| 40ea6e0b4e | |||
| 3fa0fc09bb | |||
| fef76bd504 | |||
| f8f2eefe03 | |||
| c665818395 | |||
| 2ba68760b9 | |||
| 5070476816 | |||
| 51cd283a5f | |||
| d44f0ee7a7 | |||
| b1b0565d12 | |||
| db526a1c97 | |||
| a3b553ddb4 | |||
| fecfd5533a | |||
| ed981027dd | |||
| 5092ea5e89 | |||
| ac2edc2159 | |||
| 59dd5f105a | |||
| 4db626354c | |||
| 383e636a8e | |||
| 1051db406a | |||
| ee3fb1dba6 | |||
| c34b2ea824 | |||
| 8a33595bbe | |||
| ff05a59e60 | |||
| bea474c550 | |||
| e5476aac94 | |||
| 7f025e5240 | |||
| 5700bd2213 | |||
| d402c3865a | |||
| 90ef77c872 | |||
| 51856e9e0a | |||
| 9741b97e8c | |||
| e421b9a2c0 | |||
| 371a2f7361 | |||
| 52c093ac9d | |||
| 6d6508f18e | |||
| 3fa814d1f0 | |||
| 1fe3dab64c | |||
| 5dadd205f5 | |||
| 3e15acea9a | |||
| 3e78173df9 | |||
| 64fac08bfb | |||
| fdc382dff0 | |||
| b2aea04567 | |||
| 3449dd5a8f | |||
| 57f69c6615 | |||
| cfb3ec0e21 | |||
| b8bf4ad360 | |||
| 87cc58527d | |||
| e0d2e2c53f | |||
| 9a7092ca44 | |||
| 606fa08dae | |||
| 62f1e40682 | |||
| c8e5614063 | |||
| 03c255ae20 | |||
| a706748dd3 | |||
| 7c1046d239 | |||
| a90f36b07e | |||
| e5249cff0b | |||
| d57df4debe | |||
| 1f649c7f1f | |||
| 0ca4cc914c | |||
| 9dcad78f44 | |||
| 4341d7f500 | |||
| 77149dc432 | |||
| 525abc4be5 | |||
| 14cee64c82 | |||
| 3fd283121f | |||
| ae8024565f | |||
| 2302c2db1c | |||
| 44c50c1275 | |||
| 415bf2abc3 | |||
| 36207a93f3 | |||
| 854754e10b | |||
| 1c2f137a8a | |||
| 8c67d44aef | |||
| cfd48b3b2e | |||
| 558e14bb4c | |||
| aef5dd6157 | |||
| 74ee7edc43 | |||
| 7e1c17a635 | |||
| 3c1f3874f4 | |||
| 51ddf6a715 | |||
| 62082b7086 | |||
| aee14ed426 | |||
| 9b2840db94 | |||
| 60064fce52 | |||
| 0058583583 | |||
| fb676626f1 | |||
| f445c704a1 | |||
| fd785ab5de | |||
| a1a82208ed | |||
| dc49de5341 | |||
| 4c2454d410 | |||
| fe6dd0ff9e | |||
| ab8d089b2b | |||
| ee02ea7746 | |||
| 9501cfa5f5 |
+26
-4
@@ -14,10 +14,20 @@
|
||||
"command": "pnpm build",
|
||||
"dryRunCommand": "pnpm build"
|
||||
},
|
||||
{
|
||||
"command": "echo '<details>\n<summary><em><h4>PNPM Publish</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "npm publish --provenance --access public",
|
||||
"dryRunCommand": "npm publish --provenance --access public --dry-run",
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```\n\n</details>\n'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -56,12 +66,13 @@
|
||||
"dependencies": [
|
||||
"barcode-scanner",
|
||||
"biometric",
|
||||
"log-plugin",
|
||||
"log",
|
||||
"cli",
|
||||
"clipboard-manager",
|
||||
"dialog",
|
||||
"fs",
|
||||
"global-shortcut",
|
||||
"opener",
|
||||
"http",
|
||||
"nfc",
|
||||
"notification",
|
||||
@@ -87,6 +98,7 @@
|
||||
"dialog-js",
|
||||
"fs-js",
|
||||
"global-shortcut-js",
|
||||
"opener-js",
|
||||
"http-js",
|
||||
"nfc-js",
|
||||
"notification-js",
|
||||
@@ -168,7 +180,8 @@
|
||||
},
|
||||
"dialog-js": {
|
||||
"path": "./plugins/dialog",
|
||||
"manager": "javascript"
|
||||
"manager": "javascript",
|
||||
"dependencies": ["fs-js"]
|
||||
},
|
||||
"geolocation": {
|
||||
"path": "./plugins/geolocation",
|
||||
@@ -186,6 +199,14 @@
|
||||
"path": "./plugins/global-shortcut",
|
||||
"manager": "javascript"
|
||||
},
|
||||
"opener": {
|
||||
"path": "./plugins/opener",
|
||||
"manager": "rust"
|
||||
},
|
||||
"opener-js": {
|
||||
"path": "./plugins/opener",
|
||||
"manager": "javascript"
|
||||
},
|
||||
"haptics": {
|
||||
"path": "./plugins/haptics",
|
||||
"manager": "rust"
|
||||
@@ -201,13 +222,14 @@
|
||||
},
|
||||
"http-js": {
|
||||
"path": "./plugins/http",
|
||||
"manager": "javascript"
|
||||
"manager": "javascript",
|
||||
"dependencies": ["fs-js"]
|
||||
},
|
||||
"localhost": {
|
||||
"path": "./plugins/localhost",
|
||||
"manager": "rust"
|
||||
},
|
||||
"log-plugin": {
|
||||
"log": {
|
||||
"path": "./plugins/log",
|
||||
"manager": "rust"
|
||||
},
|
||||
|
||||
@@ -6,6 +6,8 @@ As you create PRs and make changes that require a version bump, please add a new
|
||||
|
||||
When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process.
|
||||
|
||||
**Note, that in this repository, even if only the Rust code or only the JavaScript code of a plugin changed, both packages need to be bumped with the same increment!**
|
||||
|
||||
Use the following format:
|
||||
|
||||
```md
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
# Tauri Contributing Guide
|
||||
|
||||
Hi! We, the maintainers, are really excited that you are interested in contributing to Tauri. Before submitting your contribution though, please make sure to take a moment and read through the [Code of Conduct](CODE_OF_CONDUCT.md), as well as the appropriate section for the contribution you intend to make:
|
||||
|
||||
- [Issue Reporting Guidelines](#issue-reporting-guidelines)
|
||||
- [Pull Request Guidelines](#pull-request-guidelines)
|
||||
- [Development Guide](#development-guide)
|
||||
|
||||
## Issue Reporting Guidelines
|
||||
|
||||
- The issue list of this repo is **exclusively** for bug reports and feature requests. Non-conforming issues will be closed immediately.
|
||||
|
||||
- If you have a question, you can get quick answers from the [Tauri Discord chat](https://discord.com/invite/tauri).
|
||||
|
||||
- Try to search for your issue, it may have already been answered or even fixed in the development branch (`v2`).
|
||||
|
||||
- Check if the issue is reproducible with the latest stable version of Tauri. If you are using a pre-release, please indicate the specific version you are using.
|
||||
|
||||
- It is **required** that you clearly describe the steps necessary to reproduce the issue you are running into. Although we would love to help our users as much as possible, diagnosing issues without clear reproduction steps is extremely time-consuming and simply not sustainable.
|
||||
|
||||
- Use only the minimum amount of code necessary to reproduce the unexpected behavior. A good bug report should isolate specific methods that exhibit unexpected behavior and precisely define how expectations were violated. What did you expect the method or methods to do, and how did the observed behavior differ? The more precisely you isolate the issue, the faster we can investigate.
|
||||
|
||||
- Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed.
|
||||
|
||||
- If your issue is resolved but still open, don't hesitate to close it. In case you found a solution by yourself, it could be helpful for others to explain how you fixed it.
|
||||
|
||||
- Most importantly, we beg your patience: the team must balance your request against many other responsibilities — fixing other bugs, answering other questions, new features, new documentation, etc. The issue list is not paid support and we cannot make guarantees about how fast your issue can be resolved.
|
||||
|
||||
## Pull Request Guidelines
|
||||
|
||||
- You have to [sign your commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits).
|
||||
|
||||
- It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging.
|
||||
|
||||
- If adding new feature:
|
||||
- Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it.
|
||||
|
||||
- If fixing a bug:
|
||||
- If you are resolving a special issue, add `(fix: #xxxx[,#xxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `fix: update entities encoding/decoding (fix #3899)`.
|
||||
- Provide detailed description of the bug in the PR, or link to an issue that does.
|
||||
|
||||
- If the PR is meant to be released, follow the instructions in `.changes/readme.md` to log your changes. ie. [readme.md](https://github.com/tauri-apps/plugins-workspace/blob/v2/.changes/readme.md)
|
||||
|
||||
## Development Guide
|
||||
|
||||
**NOTE: If you have any question don't hesitate to ask in our Discord server. We try to keep this guide to up guide, but if something doesn't work let us know.**
|
||||
|
||||
### General Setup
|
||||
|
||||
First, [join our Discord server](https://discord.com/invite/tauri) and let us know that you want to contribute. This way we can point you in the right direction and help ensure your contribution will be as helpful as possible.
|
||||
|
||||
To set up your machine for development, follow the [Tauri setup guide](https://v2.tauri.app/start/prerequisites/) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [PNPM](https://pnpm.io/).
|
||||
|
||||
Next, [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) and clone [this repository](https://github.com/tauri-apps/plugins-workspace/tree/v2).
|
||||
|
||||
### Developing and testing
|
||||
|
||||
The easiest way to test your changes is to use the [example app](https://github.com/tauri-apps/plugins-workspace/tree/v2/examples/api) example app. It automatically rebuilds and uses your local copy of the plugins. To run it follow the instructions inside [README.md](https://github.com/tauri-apps/plugins-workspace/blob/v2/examples/api/README.md).
|
||||
|
||||
To test local changes against your own application simply point the plugin create to your local repository, for example:
|
||||
|
||||
`tauri-plugin-sample = { path = "path/to/local/tauri-plugin-sample/" }`
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
node-version: 'lts/*'
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.x.x
|
||||
version: 10.x.x
|
||||
run_install: true
|
||||
- name: audit
|
||||
run: pnpm audit
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: check change files
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.changes/*.md'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: check change files end with .md
|
||||
run: |
|
||||
for file in .changes/*
|
||||
do
|
||||
if [[ ! "$file" =~ \.(md|json)$ ]]; then
|
||||
echo ".changes directory should only contain files that end with .md"
|
||||
echo "found an invalid file in .changes directory:"
|
||||
echo "$file"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
list-files: shell
|
||||
filters: |
|
||||
changes:
|
||||
- added|modified: '.changes/*.md'
|
||||
|
||||
- name: check
|
||||
run: node ./.scripts/ci/check-change-files.js ${{ steps.filter.outputs.changes_files }}
|
||||
if: ${{ steps.filter.outputs.changes == 'true' }}
|
||||
@@ -8,6 +8,7 @@ on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/check-generated-files.yml'
|
||||
- pnpm-lock.yaml
|
||||
- '**/guest-js/**'
|
||||
|
||||
concurrency:
|
||||
@@ -27,90 +28,117 @@ jobs:
|
||||
filters: |
|
||||
autostart:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/autostart/guest-js/**
|
||||
- plugins/autostart/src/api-iife.js
|
||||
cli:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/cli/guest-js/**
|
||||
- plugins/cli/src/api-iife.js
|
||||
clipboard-manager:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/clipboard-manager/guest-js/**
|
||||
- plugins/clipboard-manager/src/api-iife.js
|
||||
dialog:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/dialog/guest-js/**
|
||||
- plugins/dialog/src/api-iife.js
|
||||
fs:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/fs/guest-js/**
|
||||
- plugins/fs/src/api-iife.js
|
||||
geolocation:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/geolocation/guest-js/**
|
||||
- plugins/geolocation/src/api-iife.js
|
||||
global-shortcut:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/global-shortcut/guest-js/**
|
||||
- plugins/global-shortcut/src/api-iife.js
|
||||
opener:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/opener/guest-js/**
|
||||
- plugins/opener/src/api-iife.js
|
||||
haptics:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/haptics/guest-js/**
|
||||
- plugins/haptics/src/api-iife.js
|
||||
http:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/http/guest-js/**
|
||||
- plugins/http/src/api-iife.js
|
||||
log:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/log/guest-js/**
|
||||
- plugins/log/src/api-iife.js
|
||||
notification:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/notification/guest-js/**
|
||||
- plugins/notification/src/api-iife.js
|
||||
os:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/os/guest-js/**
|
||||
- plugins/os/src/api-iife.js
|
||||
positioner:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/positioner/guest-js/**
|
||||
- plugins/positioner/src/api-iife.js
|
||||
process:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/process/guest-js/**
|
||||
- plugins/process/src/api-iife.js
|
||||
shell:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/shell/guest-js/**
|
||||
- plugins/shell/src/api-iife.js
|
||||
sql:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/sql/guest-js/**
|
||||
- plugins/sql/src/api-iife.js
|
||||
store:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/store/guest-js/**
|
||||
- plugins/store/src/api-iife.js
|
||||
stronghold:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/stronghold/guest-js/**
|
||||
- plugins/stronghold/src/api-iife.js
|
||||
updater:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/updater/guest-js/**
|
||||
- plugins/updater/src/api-iife.js
|
||||
upload:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/upload/guest-js/**
|
||||
- plugins/upload/src/api-iife.js
|
||||
websocket:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/websocket/guest-js/**
|
||||
- plugins/websocket/src/api-iife.js
|
||||
window-state:
|
||||
- .github/workflows/check-generated-files.yml
|
||||
- pnpm-lock.yaml
|
||||
- plugins/window-state/guest-js/**
|
||||
- plugins/window-state/src/api-iife.js
|
||||
|
||||
@@ -139,7 +167,7 @@ jobs:
|
||||
node-version: 'lts/*'
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.x.x
|
||||
version: 10.x.x
|
||||
run_install: true
|
||||
|
||||
- name: build api
|
||||
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.x.x
|
||||
version: 10.x.x
|
||||
run_install: true
|
||||
|
||||
- name: cargo login
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
|
||||
- name: Create Pull Request With Versions Bumped
|
||||
id: cpr
|
||||
uses: tauri-apps/create-pull-request@v3
|
||||
uses: peter-evans/create-pull-request@dd2324fc52d5d43c699a5636bcf19fceaa70c284 # 7.0.7
|
||||
if: steps.covector.outputs.commandRan == 'version'
|
||||
with:
|
||||
title: 'Publish New Versions (${{ github.ref_name }})'
|
||||
@@ -83,3 +83,4 @@ jobs:
|
||||
labels: 'version updates'
|
||||
branch: 'ci/release-${{ github.ref_name }}'
|
||||
body: ${{ steps.covector.outputs.change }}
|
||||
sign-commits: true
|
||||
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
node-version: 'lts/*'
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.x.x
|
||||
version: 10.x.x
|
||||
run_install: true
|
||||
- run: pnpm format:check
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
node-version: 'lts/*'
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.x.x
|
||||
version: 10.x.x
|
||||
run_install: true
|
||||
- name: eslint
|
||||
run: pnpm lint
|
||||
|
||||
@@ -66,6 +66,9 @@ jobs:
|
||||
tauri-plugin-global-shortcut:
|
||||
- .github/workflows/lint-rust.yml
|
||||
- plugins/global-shortcut/**
|
||||
tauri-plugin-opener:
|
||||
- .github/workflows/lint-rust.yml
|
||||
- plugins/opener/**
|
||||
tauri-plugin-haptics:
|
||||
- .github/workflows/lint-rust.yml
|
||||
- plugins/haptics/**
|
||||
@@ -126,7 +129,7 @@ jobs:
|
||||
clippy:
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }}
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.x.x
|
||||
version: 10.x.x
|
||||
run_install: true
|
||||
|
||||
- name: Build packages
|
||||
|
||||
@@ -47,109 +47,140 @@ jobs:
|
||||
tauri-plugin-autostart:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/autostart/**
|
||||
tauri-plugin-cli:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/cli/**
|
||||
tauri-plugin-clipboard-manager:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/clipboard-manager/**
|
||||
tauri-plugin-deep-link:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/deep-link/**
|
||||
tauri-plugin-dialog:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/dialog/**
|
||||
- plugins/fs/**
|
||||
tauri-plugin-fs:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/fs/**
|
||||
tauri-plugin-geolocation:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/geolocation/**
|
||||
tauri-plugin-global-shortcut:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/global-shortcut/**
|
||||
tauri-plugin-opener:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/opener/**
|
||||
tauri-plugin-haptics:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/haptics/**
|
||||
tauri-plugin-http:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/http/**
|
||||
- plugins/fs/**
|
||||
tauri-plugin-localhost:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/localhost/**
|
||||
tauri-plugin-log:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/log/**
|
||||
tauri-plugin-notification:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/notification/**
|
||||
tauri-plugin-os:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/os/**
|
||||
tauri-plugin-persisted-scope:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/persisted-scope/**
|
||||
- plugins/fs/**
|
||||
tauri-plugin-positioner:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/positioner/**
|
||||
tauri-plugin-process:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/process/**
|
||||
tauri-plugin-shell:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/shell/**
|
||||
tauri-plugin-single-instance:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/single-instance/**
|
||||
tauri-plugin-sql:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/sql/**
|
||||
tauri-plugin-store:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/store/**
|
||||
tauri-plugin-stronghold:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/stronghold/**
|
||||
tauri-plugin-updater:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/updater/**
|
||||
tauri-plugin-upload:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/upload/**
|
||||
tauri-plugin-websocket:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/websocket/**
|
||||
tauri-plugin-window-state:
|
||||
- .github/workflows/test-rust.yml
|
||||
- Cargo.toml
|
||||
- Cargo.lock
|
||||
- plugins/window-state/**
|
||||
|
||||
test:
|
||||
@@ -168,7 +199,7 @@ jobs:
|
||||
}
|
||||
- {
|
||||
target: x86_64-unknown-linux-gnu,
|
||||
os: ubuntu-latest,
|
||||
os: ubuntu-22.04,
|
||||
runner: 'cargo',
|
||||
command: 'test'
|
||||
}
|
||||
@@ -202,7 +233,7 @@ jobs:
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev
|
||||
|
||||
- uses: dtolnay/rust-toolchain@1.78.0
|
||||
- uses: dtolnay/rust-toolchain@1.77.2
|
||||
with:
|
||||
targets: ${{ matrix.platform.target }}
|
||||
|
||||
|
||||
+4
-1
@@ -14,6 +14,8 @@ target/
|
||||
|
||||
# .vscode workspace settings file
|
||||
.vscode/settings.json
|
||||
.vscode/launch.json
|
||||
.vscode/tasks.json
|
||||
|
||||
# npm, yarn and bun lock files
|
||||
package-lock.json
|
||||
@@ -55,4 +57,5 @@ pids
|
||||
*.sublime*
|
||||
.idea
|
||||
debug.log
|
||||
TODO.md
|
||||
TODO.md
|
||||
.aider*
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"semi": false,
|
||||
"trailingComma": "none"
|
||||
"trailingComma": "none",
|
||||
"experimentalOperatorPosition": "start"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { readFileSync, readdirSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
|
||||
/* const ignorePackages = [
|
||||
'api-example',
|
||||
'api-example-js',
|
||||
'deep-link-example',
|
||||
'deep-link-example-js'
|
||||
] */
|
||||
|
||||
const rsOnly = ['localhost', 'persisted-scope', 'single-instance']
|
||||
|
||||
function checkChangeFiles(changeFiles) {
|
||||
let code = 0
|
||||
|
||||
for (const file of changeFiles) {
|
||||
const content = readFileSync(file, 'utf8')
|
||||
const [frontMatter] = /^---[\s\S.]*---\n/i.exec(content)
|
||||
const packages = frontMatter
|
||||
.split('\n')
|
||||
.filter((l) => !(l === '---' || !l))
|
||||
.map((l) => l.replace(/('|")/g, '').split(':'))
|
||||
|
||||
const rsPackages = Object.fromEntries(
|
||||
packages
|
||||
.filter((v) => !v[0].endsWith('-js'))
|
||||
.map((v) => [v[0], v[1].trim()])
|
||||
)
|
||||
const jsPackages = Object.fromEntries(
|
||||
packages
|
||||
.filter((v) => v[0].endsWith('-js'))
|
||||
.map((v) => [v[0].slice(0, -3), v[1].trim()])
|
||||
)
|
||||
|
||||
for (const pkg in rsPackages) {
|
||||
if (rsOnly.includes(pkg)) continue
|
||||
|
||||
if (!jsPackages[pkg]) {
|
||||
console.error(
|
||||
`Missing "${rsPackages[pkg]}" bump for JS package "${pkg}-js" in ${file}.`
|
||||
)
|
||||
code = 1
|
||||
} else if (rsPackages[pkg] != jsPackages[pkg]) {
|
||||
console.error(
|
||||
`"${pkg}" and "${pkg}-js" have different version bumps in ${file}.`
|
||||
)
|
||||
code = 1
|
||||
}
|
||||
}
|
||||
|
||||
for (const pkg in jsPackages) {
|
||||
if (!rsPackages[pkg]) {
|
||||
console.error(
|
||||
`Missing "${jsPackages[pkg]}" bump for Rust package "${pkg}" in ${file}.`
|
||||
)
|
||||
code = 1
|
||||
} else if (rsPackages[pkg] != jsPackages[pkg]) {
|
||||
console.error(
|
||||
`"${pkg}" and "${pkg}-js" have different version bumps in ${file}.`
|
||||
)
|
||||
code = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
process.exit(code)
|
||||
}
|
||||
|
||||
const [_bin, _script, ...files] = process.argv
|
||||
|
||||
if (files.length > 0) {
|
||||
checkChangeFiles(
|
||||
files.filter((f) => f.toLowerCase() !== '.changes/readme.md')
|
||||
)
|
||||
} else {
|
||||
const changeFiles = readdirSync('.changes')
|
||||
.filter((f) => f.endsWith('.md') && f.toLowerCase() !== 'readme.md')
|
||||
.map((p) => join('.changes', p))
|
||||
checkChangeFiles(changeFiles)
|
||||
}
|
||||
@@ -32,8 +32,8 @@ const ignore = [
|
||||
|
||||
async function checkFile(file) {
|
||||
if (
|
||||
extensions.some((e) => file.endsWith(e)) &&
|
||||
!ignore.some((i) => file.includes(`${path.sep}${i}`))
|
||||
extensions.some((e) => file.endsWith(e))
|
||||
&& !ignore.some((i) => file.includes(`${path.sep}${i}`))
|
||||
) {
|
||||
const fileStream = fs.createReadStream(file)
|
||||
const rl = readline.createInterface({
|
||||
@@ -46,10 +46,10 @@ async function checkFile(file) {
|
||||
for await (let line of rl) {
|
||||
// ignore empty lines, allow shebang, swift-tools-version and bundler license
|
||||
if (
|
||||
line.length === 0 ||
|
||||
line.startsWith('#!') ||
|
||||
line.startsWith('// swift-tools-version:') ||
|
||||
ignoredLicenses.includes(line)
|
||||
line.length === 0
|
||||
|| line.startsWith('#!')
|
||||
|| line.startsWith('// swift-tools-version:')
|
||||
|| ignoredLicenses.includes(line)
|
||||
) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
plugins/*/permissions/autogenerated/
|
||||
plugins/*/android/.tauri/tauri-api/build/
|
||||
Generated
+2021
-1808
File diff suppressed because it is too large
Load Diff
+10
-8
@@ -10,24 +10,26 @@ resolver = "2"
|
||||
|
||||
[workspace.dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
tracing = "0.1"
|
||||
log = "0.4"
|
||||
tauri = { version = "2.0.0", default-features = false }
|
||||
tauri-build = "2.0.0"
|
||||
tauri-plugin = "2.0.0"
|
||||
tauri-utils = "2.0.0"
|
||||
tauri = { version = "2.8.2", default-features = false }
|
||||
tauri-build = "2.4"
|
||||
tauri-plugin = "2.4"
|
||||
tauri-utils = "2.7"
|
||||
serde_json = "1"
|
||||
thiserror = "1"
|
||||
thiserror = "2"
|
||||
url = "2"
|
||||
schemars = "0.8"
|
||||
dunce = "1"
|
||||
specta = "=2.0.0-rc.20"
|
||||
#tauri-specta = "=2.0.0-rc.11"
|
||||
specta = "^2.0.0-rc.16"
|
||||
glob = "0.3"
|
||||
zbus = "5.9"
|
||||
|
||||
[workspace.package]
|
||||
edition = "2021"
|
||||
authors = ["Tauri Programme within The Commons Conservancy"]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
rust-version = "1.78"
|
||||
rust-version = "1.77.2"
|
||||
repository = "https://github.com/tauri-apps/plugins-workspace"
|
||||
|
||||
# default to small, optimized release binaries
|
||||
|
||||
@@ -1,36 +1,45 @@
|
||||
# Official Tauri Plugins
|
||||
|
||||
This repo and all plugins require a Rust version of at least **1.77.2**
|
||||
|
||||
## Plugins Found Here
|
||||
|
||||
| | | Win | Mac | Lin | iOS | And |
|
||||
| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- | --- | --- | --- |
|
||||
| [autostart](plugins/autostart) | Automatically launch your app at system startup. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [autostart](plugins/autostart) | Automatically launch your app at system startup. | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||
| [barcode-scanner](plugins/barcode-scanner) | Allows your mobile application to use the camera to scan QR codes, EAN-13 and other kinds of barcodes. | ? | ? | ? | ✅ | ✅ |
|
||||
| [biometric](plugins/biometric) | Prompt the user for biometric authentication on Android and iOS. | ? | ? | ? | ✅ | ✅ |
|
||||
| [cli](plugins/cli) | Parse arguments from your Command Line Interface | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [cli](plugins/cli) | Parse arguments from your Command Line Interface | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||
| [clipboard-manager](plugins/clipboard-manager) | Read and write to the system clipboard. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [deep-link](plugins/deep-link) | Set your Tauri application as the default handler for an URL. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [dialog](plugins/dialog) | Native system dialogs for opening and saving files along with message dialogs. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [fs](plugins/fs) | Access the file system. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [geolocation](plugins/geolocation) | Get and track current device position. | ? | ? | ? | ✅ | ✅ |
|
||||
| [global-shortcut](plugins/global-shortcut) | Register global shortcuts. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [haptics](plugins/haptics) | Haptic feedback and vibrations. | ? | ? | ? | ✅ | ✅ |
|
||||
| [http](plugins/http) | Access the HTTP client written in Rust. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [localhost](plugins/localhost) | Use a localhost server in production apps. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [log](plugins/log) | Configurable logging. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [nfc](plugins/nfc) | Read and write NFC tags on Android and iOS. | ? | ? | ? | ✅ | ✅ |
|
||||
| [notification](plugins/notification) | Send message notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [opener](plugins/opener) | Open files and URLs using their default application. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [os](plugins/os) | Read information about the operating system. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [persisted-scope](plugins/persisted-scope) | Persist runtime scope changes on the filesystem. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [positioner](plugins/positioner) | Move windows to common locations. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [positioner](plugins/positioner) | Move windows to common locations. | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||
| [process](plugins/process) | This plugin provides APIs to access the current process. To spawn child processes, see the [`shell`](https://github.com/tauri-apps/tauri-plugin-shell) plugin. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [shell](plugins/shell) | Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [single-instance](plugins/single-instance) | Ensure a single instance of your tauri app is running. | ✅ | ? | ✅ | ? | ? |
|
||||
| [sql](plugins/sql) | Interface with SQL databases. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [single-instance](plugins/single-instance) | Ensure a single instance of your tauri app is running. | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||
| [sql](plugins/sql) | Interface with SQL databases. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [store](plugins/store) | Persistent key value storage. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [stronghold](plugins/stronghold) | Encrypted, secure database. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [updater](plugins/updater) | In-app updates for Tauri applications. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [upload](plugins/upload) | Tauri plugin for file uploads through HTTP. | ✅ | ✅ | ✅ | ? | ? |
|
||||
| [updater](plugins/updater) | In-app updates for Tauri applications. | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||
| [upload](plugins/upload) | Tauri plugin for file uploads through HTTP. | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| [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. | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||
|
||||
_This repo and all plugins require a Rust version of at least **1.78**_
|
||||
- ✅: (Partially) Supported
|
||||
- ❌: Not supported
|
||||
- `?` : Unknown/Untested or Planned
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
@@ -1,5 +1,280 @@
|
||||
# Changelog
|
||||
|
||||
## \[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]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `barcode-scanner-js@2.3.0`
|
||||
- Upgraded to `biometric-js@2.3.0`
|
||||
- Upgraded to `cli-js@2.4.0`
|
||||
- Upgraded to `clipboard-manager-js@2.3.0`
|
||||
- Upgraded to `fs-js@2.4.0`
|
||||
- Upgraded to `dialog-js@2.3.0`
|
||||
- Upgraded to `global-shortcut-js@2.3.0`
|
||||
- Upgraded to `opener-js@2.4.0`
|
||||
- Upgraded to `http-js@2.5.0`
|
||||
- Upgraded to `log-js@2.6.0`
|
||||
- Upgraded to `nfc-js@2.3.0`
|
||||
- Upgraded to `notification-js@2.3.0`
|
||||
- Upgraded to `os-js@2.3.0`
|
||||
- Upgraded to `process-js@2.3.0`
|
||||
- Upgraded to `shell-js@2.3.0`
|
||||
- Upgraded to `store-js@2.3.0`
|
||||
- Upgraded to `updater-js@2.9.0`
|
||||
|
||||
## \[2.0.25]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `cli-js@2.3.0`
|
||||
- Upgraded to `log-js@2.5.1`
|
||||
- Upgraded to `opener-js@2.3.1`
|
||||
|
||||
## \[2.0.24]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `updater-js@2.8.1`
|
||||
|
||||
## \[2.0.23]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `updater-js@2.8.0`
|
||||
- Upgraded to `barcode-scanner-js@2.2.1`
|
||||
- Upgraded to `biometric-js@2.2.2`
|
||||
- Upgraded to `cli-js@2.2.1`
|
||||
- Upgraded to `clipboard-manager-js@2.2.3`
|
||||
- Upgraded to `nfc-js@2.2.1`
|
||||
- Upgraded to `notification-js@2.2.3`
|
||||
- Upgraded to `os-js@2.2.2`
|
||||
- Upgraded to `process-js@2.2.2`
|
||||
- Upgraded to `shell-js@2.2.2`
|
||||
- Upgraded to `store-js@2.2.1`
|
||||
- Upgraded to `log-js@2.5.0`
|
||||
- Upgraded to `opener-js@2.3.0`
|
||||
|
||||
## \[2.0.22]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs-js@2.3.0`
|
||||
- Upgraded to `global-shortcut-js@2.2.1`
|
||||
- Upgraded to `http-js@2.4.4`
|
||||
- Upgraded to `opener-js@2.2.7`
|
||||
- Upgraded to `dialog-js@2.2.2`
|
||||
|
||||
## \[2.0.21]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `log-js@2.4.0`
|
||||
- Upgraded to `biometric-js@2.2.1`
|
||||
- Upgraded to `updater-js@2.7.1`
|
||||
|
||||
## \[2.0.20]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `http-js@2.4.3`
|
||||
- Upgraded to `shell-js@2.2.1`
|
||||
- Upgraded to `fs-js@2.2.1`
|
||||
- Upgraded to `process-js@2.2.1`
|
||||
- Upgraded to `updater-js@2.7.0`
|
||||
- Upgraded to `dialog-js@2.2.1`
|
||||
|
||||
## \[2.0.19]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `http-js@2.4.2`
|
||||
- Upgraded to `updater-js@2.6.1`
|
||||
|
||||
## \[2.0.18]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `http-js@2.4.1`
|
||||
|
||||
## \[2.0.17]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `log-js@2.3.1`
|
||||
|
||||
## \[2.0.16]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `clipboard-manager-js@2.2.2`
|
||||
- Upgraded to `notification-js@2.2.2`
|
||||
- Upgraded to `os-js@2.2.1`
|
||||
- Upgraded to `http-js@2.4.0`
|
||||
- Upgraded to `log-js@2.3.0`
|
||||
- Upgraded to `updater-js@2.6.0`
|
||||
|
||||
## \[2.0.15]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `log-js@2.2.3`
|
||||
- Upgraded to `opener-js@2.2.6`
|
||||
|
||||
## \[2.0.14]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `log-js@2.2.2`
|
||||
- Upgraded to `updater-js@2.5.1`
|
||||
|
||||
## \[2.0.13]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `updater-js@2.5.0`
|
||||
|
||||
## \[2.0.12]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `clipboard-manager-js@2.2.1`
|
||||
- Upgraded to `http-js@2.3.0`
|
||||
- Upgraded to `log-js@2.2.1`
|
||||
- Upgraded to `updater-js@2.4.0`
|
||||
|
||||
## \[2.0.11]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `opener-js@2.2.5`
|
||||
|
||||
## \[2.0.10]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `notification-js@2.2.1`
|
||||
- Upgraded to `opener-js@2.2.4`
|
||||
|
||||
## \[2.0.9]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `opener-js@2.2.3`
|
||||
- Upgraded to `updater-js@2.3.1`
|
||||
|
||||
## \[2.0.8]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `opener-js@2.2.2`
|
||||
|
||||
## \[2.0.7]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `updater-js@2.3.0`
|
||||
- Upgraded to `opener-js@2.2.1`
|
||||
|
||||
## \[2.0.6]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `barcode-scanner-js@2.1.0`
|
||||
- Upgraded to `biometric-js@2.1.0`
|
||||
- Upgraded to `cli-js@2.1.0`
|
||||
- Upgraded to `clipboard-manager-js@2.1.0`
|
||||
- Upgraded to `dialog-js@2.1.0`
|
||||
- Upgraded to `fs-js@2.1.0`
|
||||
- Upgraded to `global-shortcut-js@2.1.0`
|
||||
- Upgraded to `http-js@2.1.0`
|
||||
- Upgraded to `log-js@2.1.0`
|
||||
- Upgraded to `nfc-js@2.1.0`
|
||||
- Upgraded to `notification-js@2.1.0`
|
||||
- Upgraded to `opener-js@2.1.0`
|
||||
- Upgraded to `os-js@2.1.0`
|
||||
- Upgraded to `process-js@2.1.0`
|
||||
- Upgraded to `shell-js@2.1.0`
|
||||
- Upgraded to `store-js@2.2.0`
|
||||
- Upgraded to `updater-js@2.1.0`
|
||||
|
||||
## \[2.0.5]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs-js@2.0.4`
|
||||
- Upgraded to `dialog-js@2.0.2`
|
||||
- Upgraded to `http-js@2.0.2`
|
||||
|
||||
## \[2.0.4]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `log-js@2.0.2`
|
||||
|
||||
## \[2.0.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `clipboard-manager-js@2.0.1`
|
||||
- Upgraded to `log-js@2.0.1`
|
||||
- Upgraded to `fs-js@2.0.3`
|
||||
- Upgraded to `opener-js@2.0.0`
|
||||
|
||||
## \[2.0.2]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs-js@2.0.2`
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `dialog-js@2.0.1`
|
||||
- Upgraded to `fs-js@2.0.1`
|
||||
- Upgraded to `http-js@2.0.1`
|
||||
- Upgraded to `shell-js@2.0.1`
|
||||
- Upgraded to `store-js@2.1.0`
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta
|
||||
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>
|
||||
</head>
|
||||
|
||||
+32
-29
@@ -1,42 +1,45 @@
|
||||
{
|
||||
"name": "svelte-app",
|
||||
"name": "api",
|
||||
"private": true,
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.31",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --clearScreen false",
|
||||
"build": "vite build",
|
||||
"serve": "vite preview"
|
||||
"serve": "vite preview",
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0",
|
||||
"@tauri-apps/plugin-barcode-scanner": "2.0.0",
|
||||
"@tauri-apps/plugin-biometric": "2.0.0",
|
||||
"@tauri-apps/plugin-cli": "2.0.0",
|
||||
"@tauri-apps/plugin-clipboard-manager": "2.0.0",
|
||||
"@tauri-apps/plugin-dialog": "2.0.0",
|
||||
"@tauri-apps/plugin-fs": "2.0.0",
|
||||
"@tauri-apps/plugin-geolocation": "2.0.0",
|
||||
"@tauri-apps/plugin-global-shortcut": "2.0.0",
|
||||
"@tauri-apps/plugin-haptics": "2.0.0",
|
||||
"@tauri-apps/plugin-http": "2.0.0",
|
||||
"@tauri-apps/plugin-nfc": "2.0.0",
|
||||
"@tauri-apps/plugin-notification": "2.0.0",
|
||||
"@tauri-apps/plugin-os": "2.0.0",
|
||||
"@tauri-apps/plugin-process": "2.0.0",
|
||||
"@tauri-apps/plugin-shell": "2.0.0",
|
||||
"@tauri-apps/plugin-store": "2.0.0",
|
||||
"@tauri-apps/plugin-updater": "2.0.0",
|
||||
"@tauri-apps/api": "2.8.0",
|
||||
"@tauri-apps/plugin-barcode-scanner": "^2.4.0",
|
||||
"@tauri-apps/plugin-biometric": "^2.3.0",
|
||||
"@tauri-apps/plugin-cli": "^2.4.0",
|
||||
"@tauri-apps/plugin-clipboard-manager": "^2.3.0",
|
||||
"@tauri-apps/plugin-dialog": "^2.3.3",
|
||||
"@tauri-apps/plugin-fs": "^2.4.2",
|
||||
"@tauri-apps/plugin-geolocation": "^2.2.0",
|
||||
"@tauri-apps/plugin-global-shortcut": "^2.3.0",
|
||||
"@tauri-apps/plugin-haptics": "^2.2.0",
|
||||
"@tauri-apps/plugin-http": "^2.5.2",
|
||||
"@tauri-apps/plugin-nfc": "^2.3.1",
|
||||
"@tauri-apps/plugin-notification": "^2.3.1",
|
||||
"@tauri-apps/plugin-opener": "^2.5.0",
|
||||
"@tauri-apps/plugin-os": "^2.3.1",
|
||||
"@tauri-apps/plugin-process": "^2.3.0",
|
||||
"@tauri-apps/plugin-shell": "^2.3.1",
|
||||
"@tauri-apps/plugin-store": "^2.4.0",
|
||||
"@tauri-apps/plugin-updater": "^2.9.0",
|
||||
"@tauri-apps/plugin-upload": "^2.3.0",
|
||||
"@zerodevx/svelte-json-view": "1.0.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@iconify-json/codicon": "^1.1.37",
|
||||
"@iconify-json/ph": "^1.1.8",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.1",
|
||||
"@tauri-apps/cli": "2.0.0",
|
||||
"@unocss/extractor-svelte": "^0.63.0",
|
||||
"svelte": "^4.2.19",
|
||||
"unocss": "^0.63.0",
|
||||
"vite": "^5.4.7"
|
||||
"@iconify-json/codicon": "^1.2.12",
|
||||
"@iconify-json/ph": "^1.2.2",
|
||||
"@sveltejs/vite-plugin-svelte": "^6.0.0",
|
||||
"@tauri-apps/cli": "2.8.2",
|
||||
"@unocss/extractor-svelte": "^66.3.3",
|
||||
"svelte": "^5.20.4",
|
||||
"unocss": "^66.3.3",
|
||||
"vite": "^7.0.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,341 @@
|
||||
# Changelog
|
||||
|
||||
## \[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]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `barcode-scanner@2.3.0`
|
||||
- Upgraded to `biometric@2.3.0`
|
||||
- Upgraded to `cli@2.4.0`
|
||||
- Upgraded to `clipboard-manager@2.3.0`
|
||||
- Upgraded to `fs@2.4.0`
|
||||
- Upgraded to `dialog@2.3.0`
|
||||
- Upgraded to `geolocation@2.3.0`
|
||||
- Upgraded to `global-shortcut@2.3.0`
|
||||
- Upgraded to `opener@2.4.0`
|
||||
- Upgraded to `haptics@2.3.0`
|
||||
- Upgraded to `http@2.5.0`
|
||||
- Upgraded to `log@2.6.0`
|
||||
- Upgraded to `nfc@2.3.0`
|
||||
- Upgraded to `notification@2.3.0`
|
||||
- Upgraded to `os@2.3.0`
|
||||
- Upgraded to `process@2.3.0`
|
||||
- Upgraded to `shell@2.3.0`
|
||||
- Upgraded to `store@2.3.0`
|
||||
- Upgraded to `updater@2.9.0`
|
||||
|
||||
## \[2.0.29]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `cli@2.3.0`
|
||||
- Upgraded to `log@2.5.1`
|
||||
- Upgraded to `opener@2.3.1`
|
||||
|
||||
## \[2.0.28]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `updater@2.8.1`
|
||||
|
||||
## \[2.0.27]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `updater@2.8.0`
|
||||
- Upgraded to `barcode-scanner@2.2.1`
|
||||
- Upgraded to `biometric@2.2.2`
|
||||
- Upgraded to `cli@2.2.1`
|
||||
- Upgraded to `clipboard-manager@2.2.3`
|
||||
- Upgraded to `geolocation@2.2.5`
|
||||
- Upgraded to `haptics@2.2.5`
|
||||
- Upgraded to `nfc@2.2.1`
|
||||
- Upgraded to `notification@2.2.3`
|
||||
- Upgraded to `os@2.2.2`
|
||||
- Upgraded to `process@2.2.2`
|
||||
- Upgraded to `shell@2.2.2`
|
||||
- Upgraded to `store@2.2.1`
|
||||
- Upgraded to `log@2.5.0`
|
||||
- Upgraded to `opener@2.3.0`
|
||||
|
||||
## \[2.0.26]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.3.0`
|
||||
- Upgraded to `global-shortcut@2.2.1`
|
||||
- Upgraded to `http@2.4.4`
|
||||
- Upgraded to `opener@2.2.7`
|
||||
- Upgraded to `dialog@2.2.2`
|
||||
|
||||
## \[2.0.25]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `log@2.4.0`
|
||||
- Upgraded to `biometric@2.2.1`
|
||||
- Upgraded to `updater@2.7.1`
|
||||
|
||||
## \[2.0.24]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `http@2.4.3`
|
||||
- Upgraded to `shell@2.2.1`
|
||||
- Upgraded to `fs@2.2.1`
|
||||
- Upgraded to `process@2.2.1`
|
||||
- Upgraded to `updater@2.7.0`
|
||||
- Upgraded to `dialog@2.2.1`
|
||||
|
||||
## \[2.0.23]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `http@2.4.2`
|
||||
- Upgraded to `updater@2.6.1`
|
||||
|
||||
## \[2.0.22]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `http@2.4.1`
|
||||
|
||||
## \[2.0.21]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `log@2.3.1`
|
||||
|
||||
## \[2.0.20]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `clipboard-manager@2.2.2`
|
||||
- Upgraded to `geolocation@2.2.4`
|
||||
- Upgraded to `haptics@2.2.4`
|
||||
- Upgraded to `notification@2.2.2`
|
||||
- Upgraded to `os@2.2.1`
|
||||
- Upgraded to `http@2.4.0`
|
||||
- Upgraded to `log@2.3.0`
|
||||
- Upgraded to `updater@2.6.0`
|
||||
|
||||
## \[2.0.19]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `log@2.2.3`
|
||||
- Upgraded to `opener@2.2.6`
|
||||
|
||||
## \[2.0.18]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `log@2.2.2`
|
||||
- Upgraded to `updater@2.5.1`
|
||||
|
||||
## \[2.0.17]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `updater@2.5.0`
|
||||
|
||||
## \[2.0.16]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `clipboard-manager@2.2.1`
|
||||
- Upgraded to `http@2.3.0`
|
||||
- Upgraded to `log@2.2.1`
|
||||
- Upgraded to `updater@2.4.0`
|
||||
|
||||
## \[2.0.15]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `haptics@2.2.3`
|
||||
- Upgraded to `geolocation@2.2.3`
|
||||
- Upgraded to `opener@2.2.5`
|
||||
|
||||
## \[2.0.14]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `geolocation@2.2.2`
|
||||
- Upgraded to `haptics@2.2.2`
|
||||
- Upgraded to `notification@2.2.1`
|
||||
- Upgraded to `opener@2.2.4`
|
||||
|
||||
## \[2.0.13]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `geolocation@2.2.1`
|
||||
- Upgraded to `haptics@2.2.1`
|
||||
|
||||
## \[2.0.12]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `opener@2.2.3`
|
||||
- Upgraded to `updater@2.3.1`
|
||||
|
||||
## \[2.0.11]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `opener@2.2.2`
|
||||
|
||||
## \[2.0.10]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `updater@2.3.0`
|
||||
- Upgraded to `opener@2.2.1`
|
||||
|
||||
## \[2.0.9]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `barcode-scanner@2.1.0`
|
||||
- Upgraded to `biometric@2.1.0`
|
||||
- Upgraded to `cli@2.1.0`
|
||||
- Upgraded to `clipboard-manager@2.1.0`
|
||||
- Upgraded to `dialog@2.1.0`
|
||||
- Upgraded to `fs@2.2.0`
|
||||
- Upgraded to `geolocation@2.1.0`
|
||||
- Upgraded to `global-shortcut@2.1.0`
|
||||
- Upgraded to `haptics@2.1.0`
|
||||
- Upgraded to `http@2.1.0`
|
||||
- Upgraded to `log@2.1.0`
|
||||
- Upgraded to `nfc@2.1.0`
|
||||
- Upgraded to `notification@2.1.0`
|
||||
- Upgraded to `opener@2.1.0`
|
||||
- Upgraded to `os@2.1.0`
|
||||
- Upgraded to `process@2.1.0`
|
||||
- Upgraded to `shell@2.1.0`
|
||||
- Upgraded to `store@2.2.0`
|
||||
- Upgraded to `updater@2.2.0`
|
||||
|
||||
## \[2.0.8]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.1.1`
|
||||
- Upgraded to `dialog@2.0.5`
|
||||
- Upgraded to `http@2.0.5`
|
||||
|
||||
## \[2.0.7]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `log@2.0.4`
|
||||
|
||||
## \[2.0.6]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.1.0`
|
||||
- Upgraded to `updater@2.1.0`
|
||||
- Upgraded to `dialog@2.0.4`
|
||||
- Upgraded to `log-plugin@2.0.3`
|
||||
- Upgraded to `http@2.0.4`
|
||||
- Upgraded to `opener@2.0.0`
|
||||
|
||||
## \[2.0.5]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `clipboard-manager@2.0.2`
|
||||
- Upgraded to `log-plugin@2.0.2`
|
||||
|
||||
## \[2.0.4]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `fs@2.0.3`
|
||||
- Upgraded to `dialog@2.0.3`
|
||||
- Upgraded to `http@2.0.3`
|
||||
|
||||
## \[2.0.3]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `dialog@2.0.2`
|
||||
- Upgraded to `fs@2.0.2`
|
||||
- Upgraded to `http@2.0.2`
|
||||
- Upgraded to `shell@2.0.2`
|
||||
- Upgraded to `store@2.1.0`
|
||||
|
||||
## \[2.0.2]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `barcode-scanner@2.0.1`
|
||||
- Upgraded to `biometric@2.0.1`
|
||||
- Upgraded to `cli@2.0.1`
|
||||
- Upgraded to `clipboard-manager@2.0.1`
|
||||
- Upgraded to `fs@2.0.1`
|
||||
- Upgraded to `dialog@2.0.1`
|
||||
- Upgraded to `geolocation@2.0.1`
|
||||
- Upgraded to `global-shortcut@2.0.1`
|
||||
- Upgraded to `haptics@2.0.1`
|
||||
- Upgraded to `http@2.0.1`
|
||||
- Upgraded to `log-plugin@2.0.1`
|
||||
- Upgraded to `nfc@2.0.1`
|
||||
- Upgraded to `notification@2.0.1`
|
||||
- Upgraded to `os@2.0.1`
|
||||
- Upgraded to `process@2.0.1`
|
||||
- Upgraded to `shell@2.0.1`
|
||||
- Upgraded to `store@2.0.1`
|
||||
- Upgraded to `updater@2.0.2`
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Upgraded to `updater@2.0.1`
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "api"
|
||||
publish = false
|
||||
version = "2.0.0"
|
||||
version = "2.0.35"
|
||||
description = "An example Tauri Application showcasing the api"
|
||||
edition = "2021"
|
||||
rust-version = { workspace = true }
|
||||
@@ -18,29 +18,34 @@ tauri-build = { workspace = true, features = ["codegen", "isolation"] }
|
||||
serde_json = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
tiny_http = "0.12"
|
||||
time = "0.3"
|
||||
log = { workspace = true }
|
||||
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0" }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0", features = [
|
||||
tauri-plugin-log = { path = "../../../plugins/log", version = "2.6.0" }
|
||||
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.4.2", features = [
|
||||
"watch",
|
||||
] }
|
||||
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.0" }
|
||||
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0" }
|
||||
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.3.0" }
|
||||
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.3.3" }
|
||||
tauri-plugin-http = { path = "../../../plugins/http", features = [
|
||||
"multipart",
|
||||
], version = "2.0.0" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0", features = [
|
||||
"cookies",
|
||||
], version = "2.5.2" }
|
||||
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.3.1", features = [
|
||||
"windows7-compat",
|
||||
] }
|
||||
tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0" }
|
||||
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0" }
|
||||
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0" }
|
||||
tauri-plugin-store = { path = "../../../plugins/store", version = "2.0.0" }
|
||||
tauri-plugin-os = { path = "../../../plugins/os", version = "2.3.1" }
|
||||
tauri-plugin-process = { path = "../../../plugins/process", version = "2.3.0" }
|
||||
tauri-plugin-opener = { path = "../../../plugins/opener", version = "2.5.0" }
|
||||
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.3.1" }
|
||||
tauri-plugin-store = { path = "../../../plugins/store", version = "2.4.0" }
|
||||
tauri-plugin-upload = { path = "../../../plugins/upload", version = "2.3.0" }
|
||||
|
||||
[dependencies.tauri]
|
||||
workspace = true
|
||||
features = [
|
||||
"wry",
|
||||
"compression",
|
||||
"common-controls-v6",
|
||||
"x11",
|
||||
"image-ico",
|
||||
"image-png",
|
||||
"isolation",
|
||||
@@ -50,17 +55,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]
|
||||
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.0" }
|
||||
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0" }
|
||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0" }
|
||||
tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.0.0" }
|
||||
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.4.0" }
|
||||
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.3.0" }
|
||||
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.9.0" }
|
||||
tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.2.0" }
|
||||
|
||||
[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies]
|
||||
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.0" }
|
||||
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.0" }
|
||||
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.0" }
|
||||
tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.0.0" }
|
||||
tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.0.0" }
|
||||
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.4.0" }
|
||||
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.3.1" }
|
||||
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.3.0" }
|
||||
tauri-plugin-geolocation = { path = "../../../plugins/geolocation/", version = "2.3.0" }
|
||||
tauri-plugin-haptics = { path = "../../../plugins/haptics/", version = "2.3.0" }
|
||||
|
||||
[features]
|
||||
prod = ["tauri/custom-protocol"]
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"shell:default",
|
||||
"shell:allow-kill",
|
||||
"shell:allow-stdin-write",
|
||||
"process:allow-exit",
|
||||
@@ -67,22 +68,40 @@
|
||||
"fs:allow-rename",
|
||||
"fs:allow-mkdir",
|
||||
"fs:allow-remove",
|
||||
"fs:allow-stat",
|
||||
"fs:allow-fstat",
|
||||
"fs:allow-lstat",
|
||||
"fs:allow-write-text-file",
|
||||
"fs:read-meta",
|
||||
"fs:scope-download-recursive",
|
||||
"fs:scope-resource-recursive",
|
||||
{
|
||||
"identifier": "fs:scope-appdata-recursive",
|
||||
"allow": [
|
||||
{
|
||||
"path": "$APPDATA/db/"
|
||||
},
|
||||
{
|
||||
"path": "$APPDATA/db/**"
|
||||
}
|
||||
],
|
||||
"deny": ["$APPDATA/db/*.stronghold"]
|
||||
},
|
||||
"store:allow-entries",
|
||||
"store:allow-get",
|
||||
"store:allow-set",
|
||||
"store:allow-save",
|
||||
"store:allow-load"
|
||||
"store:default",
|
||||
"opener:default",
|
||||
{
|
||||
"identifier": "opener:allow-open-url",
|
||||
"allow": [
|
||||
{
|
||||
"url": "https://*",
|
||||
"app": "inAppBrowser"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "opener:allow-open-path",
|
||||
"allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**" }]
|
||||
},
|
||||
"upload:default"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
"updater:default",
|
||||
"global-shortcut:allow-unregister",
|
||||
"global-shortcut:allow-register",
|
||||
"global-shortcut:allow-unregister-all"
|
||||
"global-shortcut:allow-unregister-all",
|
||||
{ "identifier": "fs:allow-watch", "allow": ["*", "**/*"] },
|
||||
"fs:allow-unwatch"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
"geolocation:allow-check-permissions",
|
||||
"geolocation:allow-request-permissions",
|
||||
"geolocation:allow-watch-position",
|
||||
"geolocation:allow-get-current-position"
|
||||
"geolocation:allow-get-current-position",
|
||||
"haptics:allow-impact-feedback",
|
||||
"haptics:allow-notification-feedback",
|
||||
"haptics:allow-selection-feedback",
|
||||
"haptics:allow-vibrate"
|
||||
]
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="17" />
|
||||
<bytecodeTargetLevel target="21" />
|
||||
</component>
|
||||
</project>
|
||||
+6
-2
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
@@ -14,11 +15,12 @@
|
||||
</builds>
|
||||
</compositeBuild>
|
||||
</compositeConfiguration>
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$USER_HOME$/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tauri-2.0.0-rc.7/mobile/android" />
|
||||
<option value="$USER_HOME$/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tauri-2.5.0/mobile/android" />
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/buildSrc" />
|
||||
@@ -27,12 +29,14 @@
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/clipboard-manager/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/dialog/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/fs/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/geolocation/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/haptics/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/nfc/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/notification/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/opener/android" />
|
||||
<option value="$PROJECT_DIR$/../../../../../plugins/shell/android" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveExternalAnnotations" value="false" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -1,116 +1,116 @@
|
||||
{
|
||||
"images": [
|
||||
"images" : [
|
||||
{
|
||||
"size": "20x20",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-20x20@2x.png",
|
||||
"scale": "2x"
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size": "20x20",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-20x20@3x.png",
|
||||
"scale": "3x"
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-29x29@2x-1.png",
|
||||
"scale": "2x"
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-29x29@2x-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-29x29@3x.png",
|
||||
"scale": "3x"
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-40x40@2x.png",
|
||||
"scale": "2x"
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-40x40@3x.png",
|
||||
"scale": "3x"
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size": "60x60",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-60x60@2x.png",
|
||||
"scale": "2x"
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size": "60x60",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-60x60@3x.png",
|
||||
"scale": "3x"
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size": "20x20",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-20x20@1x.png",
|
||||
"scale": "1x"
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-20x20@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size": "20x20",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-20x20@2x-1.png",
|
||||
"scale": "2x"
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-20x20@2x-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-29x29@1x.png",
|
||||
"scale": "1x"
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-29x29@2x.png",
|
||||
"scale": "2x"
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-40x40@1x.png",
|
||||
"scale": "1x"
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-40x40@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-40x40@2x-1.png",
|
||||
"scale": "2x"
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-40x40@2x-1.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size": "76x76",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-76x76@1x.png",
|
||||
"scale": "1x"
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-76x76@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size": "76x76",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-76x76@2x.png",
|
||||
"scale": "2x"
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-76x76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size": "83.5x83.5",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-83.5x83.5@2x.png",
|
||||
"scale": "2x"
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-83.5x83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size": "1024x1024",
|
||||
"idiom": "ios-marketing",
|
||||
"filename": "AppIcon-512@2x.png",
|
||||
"scale": "1x"
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "AppIcon-512@2x.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?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>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17122"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Uncomment the next line to define a global platform for your project
|
||||
|
||||
target 'api_iOS' do
|
||||
platform :ios, '13.0'
|
||||
platform :ios, '14.0'
|
||||
# Pods for api_iOS
|
||||
end
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 56;
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
@@ -22,26 +22,26 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0E96CE07CD20273DD46BF325 /* main.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = main.rs; sourceTree = "<group>"; };
|
||||
1C1AB1B414CA2795AFBEDDB9 /* tray.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = tray.rs; sourceTree = "<group>"; };
|
||||
0E96CE07CD20273DD46BF325 /* main.rs */ = {isa = PBXFileReference; path = main.rs; sourceTree = "<group>"; };
|
||||
1C1AB1B414CA2795AFBEDDB9 /* tray.rs */ = {isa = PBXFileReference; path = tray.rs; sourceTree = "<group>"; };
|
||||
248286BAA086BB1A5F98B2B2 /* libapp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libapp.a; sourceTree = "<group>"; };
|
||||
2F63E2AA460089BB58D40C79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
338E66700FD330B99D434DD7 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; };
|
||||
384966E551417F94A02D2706 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
|
||||
4B2D1B108AE002010BDEC6D2 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
59CFE20DCF760BE67D9CE3D6 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
|
||||
5AC703CEBA41A121596066F3 /* Tauri API.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Tauri API.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
5AC703CEBA41A121596066F3 /* api_iOS.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = api_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
62601E25FA39E62BE119B74D /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
|
||||
6B7E79E23E646BA7968B457C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
71EB788DE4662CFC0D97F567 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
74A8FDFB350B966F5AAD4A24 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; path = assets; sourceTree = SOURCE_ROOT; };
|
||||
785D025E9542F7E098BF22B5 /* lib.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = lib.rs; sourceTree = "<group>"; };
|
||||
785D025E9542F7E098BF22B5 /* lib.rs */ = {isa = PBXFileReference; path = lib.rs; sourceTree = "<group>"; };
|
||||
879941AE3DAA14534BBC6391 /* api_iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = api_iOS.entitlements; sourceTree = "<group>"; };
|
||||
90D3B673AFAB8D8AB561F616 /* main.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
|
||||
B6082E363D51372A7658C351 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
DC377692DC31A070A0188C9D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
||||
EC8C7948C50C3C9B5D96CB61 /* bindings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bindings.h; sourceTree = "<group>"; };
|
||||
F835F52713CE8F029D5D252C /* cmd.rs */ = {isa = PBXFileReference; lastKnownFileType = text; path = cmd.rs; sourceTree = "<group>"; };
|
||||
F835F52713CE8F029D5D252C /* cmd.rs */ = {isa = PBXFileReference; path = cmd.rs; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -104,7 +104,7 @@
|
||||
4AC51E67B71E27F15B02C5CD /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5AC703CEBA41A121596066F3 /* Tauri API.app */,
|
||||
5AC703CEBA41A121596066F3 /* api_iOS.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -171,8 +171,10 @@
|
||||
dependencies = (
|
||||
);
|
||||
name = api_iOS;
|
||||
packageProductDependencies = (
|
||||
);
|
||||
productName = api_iOS;
|
||||
productReference = 5AC703CEBA41A121596066F3 /* Tauri API.app */;
|
||||
productReference = 5AC703CEBA41A121596066F3 /* api_iOS.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
@@ -198,6 +200,8 @@
|
||||
en,
|
||||
);
|
||||
mainGroup = 0677CEAF1F282F38CBA0F140;
|
||||
minimizedProjectReferenceProxies = 1;
|
||||
preferredProjectObjectVersion = 54;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
@@ -236,7 +240,6 @@
|
||||
outputPaths = (
|
||||
"$(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a",
|
||||
"$(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a",
|
||||
"$(SRCROOT)/Externals/arm64-sim/${CONFIGURATION}/libapp.a",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
@@ -301,7 +304,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -363,7 +366,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
@@ -381,52 +384,29 @@
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ARCHS = (
|
||||
arm64,
|
||||
"arm64-sim",
|
||||
);
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = api_iOS/api_iOS.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = Q93MBH6S2F;
|
||||
DEVELOPMENT_TEAM = "Q93MBH6S2F";
|
||||
ENABLE_BITCODE = NO;
|
||||
"EXCLUDED_ARCHS[sdk=iphoneos*]" = "arm64-sim x86_64";
|
||||
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
|
||||
"EXCLUDED_ARCHS[sdk=iphoneos*]" = x86_64;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\".\"",
|
||||
);
|
||||
INFOPLIST_FILE = api_iOS/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@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]" = (
|
||||
"$(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=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=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)";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.tauri.api;
|
||||
PRODUCT_NAME = "Tauri API";
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALID_ARCHS = "arm64 arm64-sim";
|
||||
VALID_ARCHS = arm64;
|
||||
};
|
||||
name = debug;
|
||||
};
|
||||
@@ -436,52 +416,29 @@
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ARCHS = (
|
||||
arm64,
|
||||
"arm64-sim",
|
||||
);
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = api_iOS/api_iOS.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = Q93MBH6S2F;
|
||||
DEVELOPMENT_TEAM = "Q93MBH6S2F";
|
||||
ENABLE_BITCODE = NO;
|
||||
"EXCLUDED_ARCHS[sdk=iphoneos*]" = "arm64-sim x86_64";
|
||||
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
|
||||
"EXCLUDED_ARCHS[sdk=iphoneos*]" = x86_64;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\".\"",
|
||||
);
|
||||
INFOPLIST_FILE = api_iOS/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@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]" = (
|
||||
"$(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=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=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)";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.tauri.api;
|
||||
PRODUCT_NAME = "Tauri API";
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALID_ARCHS = "arm64 arm64-sim";
|
||||
VALID_ARCHS = arm64;
|
||||
};
|
||||
name = release;
|
||||
};
|
||||
|
||||
-8
@@ -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>
|
||||
@@ -40,12 +40,12 @@
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>NSFaceIDUsageDescription</key>
|
||||
<string>Authenticate with biometrics</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Request camera access for WebRTC</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>Request microphone access for WebRTC</string>
|
||||
<key>NSFaceIDUsageDescription</key>
|
||||
<string>Authenticate with biometrics</string>
|
||||
<key>NFCReaderUsageDescription</key>
|
||||
<string>Read and write to NFC tags for testing</string>
|
||||
</dict>
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
<?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>com.apple.developer.nfc.readersession.formats</key>
|
||||
<array>
|
||||
<string>TAG</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict/>
|
||||
</plist>
|
||||
|
||||
@@ -63,14 +63,12 @@ targets:
|
||||
settings:
|
||||
base:
|
||||
ENABLE_BITCODE: false
|
||||
ARCHS: [arm64, arm64-sim]
|
||||
VALID_ARCHS: arm64 arm64-sim
|
||||
ARCHS: [arm64]
|
||||
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=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
|
||||
EXCLUDED_ARCHS[sdk=iphonesimulator*]: arm64
|
||||
EXCLUDED_ARCHS[sdk=iphoneos*]: arm64-sim x86_64
|
||||
EXCLUDED_ARCHS[sdk=iphoneos*]: x86_64
|
||||
groups: [app]
|
||||
dependencies:
|
||||
- framework: libapp.a
|
||||
@@ -88,5 +86,4 @@ targets:
|
||||
basedOnDependencyAnalysis: false
|
||||
outputFiles:
|
||||
- $(SRCROOT)/Externals/x86_64/${CONFIGURATION}/libapp.a
|
||||
- $(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a
|
||||
- $(SRCROOT)/Externals/arm64-sim/${CONFIGURATION}/libapp.a
|
||||
- $(SRCROOT)/Externals/arm64/${CONFIGURATION}/libapp.a
|
||||
@@ -36,8 +36,10 @@ pub fn run() {
|
||||
.plugin(tauri_plugin_notification::init())
|
||||
.plugin(tauri_plugin_os::init())
|
||||
.plugin(tauri_plugin_process::init())
|
||||
.plugin(tauri_plugin_opener::init())
|
||||
.plugin(tauri_plugin_shell::init())
|
||||
.plugin(tauri_plugin_store::Builder::default().build())
|
||||
.plugin(tauri_plugin_upload::init())
|
||||
.setup(move |app| {
|
||||
#[cfg(desktop)]
|
||||
{
|
||||
@@ -67,7 +69,8 @@ pub fn run() {
|
||||
.user_agent(&format!("Tauri API - {}", std::env::consts::OS))
|
||||
.title("Tauri API Validation")
|
||||
.inner_size(1000., 800.)
|
||||
.min_inner_size(600., 400.);
|
||||
.min_inner_size(600., 400.)
|
||||
.visible(false);
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
@@ -100,9 +103,28 @@ pub fn run() {
|
||||
if let Ok(mut request) = server.recv() {
|
||||
let mut body = Vec::new();
|
||||
let _ = request.as_reader().read_to_end(&mut body);
|
||||
let mut headers = request.headers().to_vec();
|
||||
|
||||
if !headers.iter().any(|header| header.field == tiny_http::HeaderField::from_bytes(b"Cookie").unwrap()) {
|
||||
let expires = time::OffsetDateTime::now_utc() + time::Duration::days(1);
|
||||
// RFC 1123 format
|
||||
let format = time::macros::format_description!(
|
||||
"[weekday repr:short], [day] [month repr:short] [year] [hour]:[minute]:[second] GMT"
|
||||
);
|
||||
let expires_str = expires.format(format).unwrap();
|
||||
headers.push(
|
||||
tiny_http::Header::from_bytes(
|
||||
&b"Set-Cookie"[..],
|
||||
format!("session-token=test-value; Secure; Path=/; Expires={expires_str}")
|
||||
.as_bytes(),
|
||||
)
|
||||
.unwrap(),
|
||||
);
|
||||
}
|
||||
|
||||
let response = tiny_http::Response::new(
|
||||
tiny_http::StatusCode(200),
|
||||
request.headers().to_vec(),
|
||||
headers,
|
||||
std::io::Cursor::new(body),
|
||||
request.body_length(),
|
||||
None,
|
||||
|
||||
@@ -45,7 +45,7 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
|
||||
.tooltip("Tauri")
|
||||
.icon(app.default_window_icon().unwrap().clone())
|
||||
.menu(&menu1)
|
||||
.menu_on_left_click(false)
|
||||
.show_menu_on_left_click(false)
|
||||
.on_menu_event(move |app, event| match event.id.as_ref() {
|
||||
"quit" => {
|
||||
app.exit(0);
|
||||
|
||||
+62
-42
@@ -1,6 +1,5 @@
|
||||
<script>
|
||||
import { writable } from 'svelte/store'
|
||||
import { open } from '@tauri-apps/plugin-shell'
|
||||
import { getCurrentWindow } from '@tauri-apps/api/window'
|
||||
import { getCurrentWebview } from '@tauri-apps/api/webview'
|
||||
import * as os from '@tauri-apps/plugin-os'
|
||||
@@ -14,13 +13,16 @@
|
||||
import Notifications from './views/Notifications.svelte'
|
||||
import Shortcuts from './views/Shortcuts.svelte'
|
||||
import Shell from './views/Shell.svelte'
|
||||
import Opener from './views/Opener.svelte'
|
||||
import Store from './views/Store.svelte'
|
||||
import Updater from './views/Updater.svelte'
|
||||
import Upload from './views/Upload.svelte'
|
||||
import Clipboard from './views/Clipboard.svelte'
|
||||
import WebRTC from './views/WebRTC.svelte'
|
||||
import Scanner from './views/Scanner.svelte'
|
||||
import Biometric from './views/Biometric.svelte'
|
||||
import Geolocation from './views/Geolocation.svelte'
|
||||
import Haptics from './views/Haptics.svelte'
|
||||
|
||||
import { onMount, tick } from 'svelte'
|
||||
import { ask } from '@tauri-apps/plugin-dialog'
|
||||
@@ -91,6 +93,11 @@
|
||||
component: Shell,
|
||||
icon: 'i-codicon-terminal-bash'
|
||||
},
|
||||
{
|
||||
label: 'Opener',
|
||||
component: Opener,
|
||||
icon: 'i-codicon-link-external'
|
||||
},
|
||||
{
|
||||
label: 'Store',
|
||||
component: Store,
|
||||
@@ -101,6 +108,11 @@
|
||||
component: Updater,
|
||||
icon: 'i-codicon-cloud-download'
|
||||
},
|
||||
{
|
||||
label: 'Upload',
|
||||
component: Upload,
|
||||
icon: 'i-codicon-cloud-upload'
|
||||
},
|
||||
{
|
||||
label: 'Clipboard',
|
||||
component: Clipboard,
|
||||
@@ -130,6 +142,11 @@
|
||||
label: 'Geolocation',
|
||||
component: Geolocation,
|
||||
icon: 'i-ph-map-pin'
|
||||
},
|
||||
isMobile && {
|
||||
label: 'Haptics',
|
||||
component: Haptics,
|
||||
icon: 'i-ph-vibrate'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -205,7 +222,7 @@
|
||||
if (consoleTextEl) consoleTextEl.scrollTop = consoleTextEl.scrollHeight
|
||||
}
|
||||
|
||||
// this function is renders HTML without sanitizing it so it's insecure
|
||||
// this function renders HTML without sanitizing it so it's insecure
|
||||
// we only use it with our own input data
|
||||
async function insecureRenderHtml(html) {
|
||||
messages.update((r) => [
|
||||
@@ -334,42 +351,46 @@
|
||||
children:h-100% children:w-12 children:inline-flex
|
||||
children:items-center children:justify-center"
|
||||
>
|
||||
<span
|
||||
<button
|
||||
aria-label="Toggle dark mode"
|
||||
title={isDark ? 'Switch to Light mode' : 'Switch to Dark mode'}
|
||||
class="hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
|
||||
class="bg-inherit border-none hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
|
||||
on:click={toggleDark}
|
||||
>
|
||||
{#if isDark}
|
||||
<div class="i-ph-sun" />
|
||||
<div class="i-ph-sun"></div>
|
||||
{:else}
|
||||
<div class="i-ph-moon" />
|
||||
<div class="i-ph-moon"></div>
|
||||
{/if}
|
||||
</span>
|
||||
<span
|
||||
</button>
|
||||
<button
|
||||
aria-label="Minimize window"
|
||||
title="Minimize"
|
||||
class="hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
|
||||
class="bg-inherit border-none hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
|
||||
on:click={minimize}
|
||||
>
|
||||
<div class="i-codicon-chrome-minimize" />
|
||||
</span>
|
||||
<span
|
||||
<div class="i-codicon-chrome-minimize"></div>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Maximize window"
|
||||
title={isWindowMaximized ? 'Restore' : 'Maximize'}
|
||||
class="hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
|
||||
class="bg-inherit border-none hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"
|
||||
on:click={toggleMaximize}
|
||||
>
|
||||
{#if isWindowMaximized}
|
||||
<div class="i-codicon-chrome-restore" />
|
||||
<div class="i-codicon-chrome-restore"></div>
|
||||
{:else}
|
||||
<div class="i-codicon-chrome-maximize" />
|
||||
<div class="i-codicon-chrome-maximize"></div>
|
||||
{/if}
|
||||
</span>
|
||||
<span
|
||||
</button>
|
||||
<button
|
||||
aria-label="Close window"
|
||||
title="Close"
|
||||
class="hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText"
|
||||
class="bg-inherit border-none hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText"
|
||||
on:click={close}
|
||||
>
|
||||
<div class="i-codicon-chrome-close" />
|
||||
</span>
|
||||
<div class="i-codicon-chrome-close"></div>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -377,13 +398,13 @@
|
||||
<!-- Sidebar toggle, only visible on small screens -->
|
||||
<div
|
||||
id="sidebarToggle"
|
||||
class="z-2000 sidebar-toggle display-none lt-sm:flex justify-center absolute items-center w-8 h-8 rd-8
|
||||
class="z-2000 sidebar-toggle hidden lt-sm:flex justify-center absolute items-center w-8 h-8 rd-8
|
||||
bg-accent dark:bg-darkAccent active:bg-accentDark dark:active:bg-darkAccentDark"
|
||||
>
|
||||
{#if isSideBarOpen}
|
||||
<span class="i-codicon-close animate-duration-300ms animate-fade-in" />
|
||||
<span class="i-codicon-close animate-duration-300ms animate-fade-in"></span>
|
||||
{:else}
|
||||
<span class="i-codicon-menu animate-duration-300ms animate-fade-in" />
|
||||
<span class="i-codicon-menu animate-duration-300ms animate-fade-in"></span>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -395,24 +416,21 @@
|
||||
class="lt-sm:h-screen lt-sm:shadow-lg lt-sm:shadow lt-sm:transition-transform lt-sm:absolute lt-sm:z-1999
|
||||
bg-darkPrimaryLighter transition-colors-250 overflow-hidden grid select-none px-2"
|
||||
>
|
||||
<img
|
||||
on:click={() => open('https://tauri.app/')}
|
||||
class="self-center p-7 cursor-pointer"
|
||||
src="tauri_logo.png"
|
||||
alt="Tauri logo"
|
||||
/>
|
||||
<a href="https://tauri.app" target="_blank">
|
||||
<img class="p-7" src="tauri_logo.png" alt="Tauri logo" />
|
||||
</a>
|
||||
{#if !isWindows}
|
||||
<a href="##" class="nv justify-between h-8" on:click={toggleDark}>
|
||||
{#if isDark}
|
||||
Switch to Light mode
|
||||
<div class="i-ph-sun" />
|
||||
<div class="i-ph-sun"></div>
|
||||
{:else}
|
||||
Switch to Dark mode
|
||||
<div class="i-ph-moon" />
|
||||
<div class="i-ph-moon"></div>
|
||||
{/if}
|
||||
</a>
|
||||
<br />
|
||||
<div class="bg-white/5 h-2px" />
|
||||
<div class="bg-white/5 h-2px"></div>
|
||||
<br />
|
||||
{/if}
|
||||
|
||||
@@ -422,7 +440,7 @@
|
||||
href="https://tauri.app/v1/guides/"
|
||||
>
|
||||
Documentation
|
||||
<span class="i-codicon-link-external" />
|
||||
<span class="i-codicon-link-external"></span>
|
||||
</a>
|
||||
<a
|
||||
class="nv justify-between h-8"
|
||||
@@ -430,7 +448,7 @@
|
||||
href="https://github.com/tauri-apps/tauri"
|
||||
>
|
||||
GitHub
|
||||
<span class="i-codicon-link-external" />
|
||||
<span class="i-codicon-link-external"></span>
|
||||
</a>
|
||||
<a
|
||||
class="nv justify-between h-8"
|
||||
@@ -438,10 +456,10 @@
|
||||
href="https://github.com/tauri-apps/tauri/tree/dev/examples/api"
|
||||
>
|
||||
Source
|
||||
<span class="i-codicon-link-external" />
|
||||
<span class="i-codicon-link-external"></span>
|
||||
</a>
|
||||
<br />
|
||||
<div class="bg-white/5 h-2px" />
|
||||
<div class="bg-white/5 h-2px"></div>
|
||||
<br />
|
||||
<div
|
||||
class="flex flex-col overflow-y-auto children-h-10 children-flex-none gap-1"
|
||||
@@ -456,7 +474,7 @@
|
||||
isSideBarOpen = false
|
||||
}}
|
||||
>
|
||||
<div class="{view.icon} mr-2" />
|
||||
<div class="{view.icon} mr-2"></div>
|
||||
<p>{view.label}</p></a
|
||||
>
|
||||
{/if}
|
||||
@@ -485,21 +503,23 @@
|
||||
id="console"
|
||||
class="select-none h-15rem grid grid-rows-[2px_2rem_1fr] gap-1 overflow-hidden"
|
||||
>
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
on:mousedown={startResizingConsole}
|
||||
class="bg-black/20 h-2px cursor-ns-resize"
|
||||
/>
|
||||
></div>
|
||||
<div class="flex justify-between items-center px-2">
|
||||
<p class="font-semibold">Console</p>
|
||||
<div
|
||||
class="cursor-pointer h-85% rd-1 p-1 flex justify-center items-center
|
||||
<button
|
||||
aria-label="Clear Console"
|
||||
class="cursor-pointer h-85% rd-1 p-1 flex justify-center items-center border-none bg-inherit
|
||||
hover:bg-hoverOverlay dark:hover:bg-darkHoverOverlay
|
||||
active:bg-hoverOverlay/25 dark:active:bg-darkHoverOverlay/25
|
||||
"
|
||||
on:click={clear}
|
||||
>
|
||||
<div class="i-codicon-clear-all" />
|
||||
</div>
|
||||
<div class="i-codicon-clear-all"></div>
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
bind:this={consoleTextEl}
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
import 'uno.css'
|
||||
import './app.css'
|
||||
import App from './App.svelte'
|
||||
import { mount } from 'svelte'
|
||||
|
||||
const app = new App({
|
||||
const app = mount(App, {
|
||||
target: document.querySelector('#app')
|
||||
})
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<script>
|
||||
import { getMatches } from "@tauri-apps/plugin-cli";
|
||||
import { getMatches } from '@tauri-apps/plugin-cli'
|
||||
|
||||
export let onMessage;
|
||||
export let onMessage
|
||||
|
||||
function cliMatches() {
|
||||
getMatches().then(onMessage).catch(onMessage);
|
||||
getMatches().then(onMessage).catch(onMessage)
|
||||
}
|
||||
</script>
|
||||
|
||||
<p>
|
||||
<div>
|
||||
This binary can be run from the terminal and takes the following arguments:
|
||||
<code class="code-block flex flex-wrap my-2">
|
||||
<pre>
|
||||
@@ -17,7 +17,7 @@
|
||||
--verbose</pre>
|
||||
</code>
|
||||
Additionally, it has a <code>update --background</code> subcommand.
|
||||
</p>
|
||||
</div>
|
||||
<br />
|
||||
<div class="note">
|
||||
Note that the arguments are only parsed, not implemented.
|
||||
|
||||
@@ -1,183 +1,214 @@
|
||||
<script>
|
||||
import * as fs from "@tauri-apps/plugin-fs";
|
||||
import { convertFileSrc } from "@tauri-apps/api/core";
|
||||
import { arrayBufferToBase64 } from "../lib/utils";
|
||||
import * as fs from '@tauri-apps/plugin-fs'
|
||||
import * as os from '@tauri-apps/plugin-os'
|
||||
import { convertFileSrc } from '@tauri-apps/api/core'
|
||||
import { arrayBufferToBase64 } from '../lib/utils'
|
||||
import { onDestroy, onMount } from 'svelte'
|
||||
|
||||
export let onMessage;
|
||||
export let insecureRenderHtml;
|
||||
const { onMessage, insecureRenderHtml } = $props()
|
||||
|
||||
let path = "";
|
||||
let img;
|
||||
let file;
|
||||
let renameTo;
|
||||
let watchPath = "";
|
||||
let watchDebounceDelay = 0;
|
||||
let watchRecursive = false;
|
||||
let unwatchFn;
|
||||
let unwatchPath = "";
|
||||
let path = $state('')
|
||||
let img
|
||||
/** @type {fs.FileHandle} */
|
||||
let file = $state()
|
||||
let renameTo = $state()
|
||||
let watchPath = $state('')
|
||||
let watchDebounceDelay = $state(0)
|
||||
let watchRecursive = $state(false)
|
||||
/** @type {fs.BaseDirectory | undefined} */
|
||||
let baseDir = $state()
|
||||
let unwatchFn
|
||||
let unwatchPath = ''
|
||||
let isMobile = $state(false)
|
||||
|
||||
function getDir() {
|
||||
const dirSelect = document.getElementById("dir");
|
||||
return dirSelect.value ? parseInt(dir.value) : null;
|
||||
}
|
||||
onMount(() => {
|
||||
let platform = os.platform()
|
||||
isMobile = platform === 'android' || platform === 'ios'
|
||||
})
|
||||
|
||||
const DirOptions = Object.keys(fs.BaseDirectory)
|
||||
.filter((key) => isNaN(parseInt(key)))
|
||||
.map((dir) => [dir, fs.BaseDirectory[dir]]);
|
||||
const dirOptions = Object.keys(fs.BaseDirectory).filter((key) =>
|
||||
isNaN(parseInt(key))
|
||||
)
|
||||
|
||||
function open() {
|
||||
fs.open(path, {
|
||||
baseDir: getDir(),
|
||||
baseDir,
|
||||
read: true,
|
||||
write: true,
|
||||
create: true,
|
||||
create: true
|
||||
})
|
||||
.then((f) => {
|
||||
file = f;
|
||||
onMessage(`Opened ${path}`);
|
||||
file = f
|
||||
onMessage(`Opened ${path}`)
|
||||
})
|
||||
.catch(onMessage);
|
||||
.catch(onMessage)
|
||||
}
|
||||
|
||||
function mkdir() {
|
||||
fs.mkdir(path, { baseDir: getDir() })
|
||||
fs.mkdir(path, { baseDir, recursive: true })
|
||||
.then(() => {
|
||||
onMessage(`Created dir ${path}`);
|
||||
onMessage(`Created dir ${path}`)
|
||||
})
|
||||
.catch(onMessage);
|
||||
.catch(onMessage)
|
||||
}
|
||||
|
||||
function remove() {
|
||||
fs.remove(path, { baseDir: getDir() })
|
||||
fs.remove(path, { baseDir })
|
||||
.then(() => {
|
||||
onMessage(`Removed ${path}`);
|
||||
onMessage(`Removed ${path}`)
|
||||
})
|
||||
.catch(onMessage);
|
||||
.catch(onMessage)
|
||||
}
|
||||
|
||||
function rename() {
|
||||
fs.rename(path, renameTo, {
|
||||
oldPathBaseDir: getDir(),
|
||||
newPathBaseDir: getDir(),
|
||||
oldPathBaseDir,
|
||||
newPathBaseDir
|
||||
})
|
||||
.then(() => {
|
||||
onMessage(`Renamed ${path} to ${renameTo}`);
|
||||
onMessage(`Renamed ${path} to ${renameTo}`)
|
||||
})
|
||||
.catch(onMessage);
|
||||
.catch(onMessage)
|
||||
}
|
||||
|
||||
function truncate() {
|
||||
file
|
||||
.truncate(0)
|
||||
.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() {
|
||||
file
|
||||
.stat()
|
||||
.then((stat) => {
|
||||
onMessage(`File stat ${JSON.stringify(stat)}`);
|
||||
onMessage(`File stat ${JSON.stringify(stat)}`)
|
||||
})
|
||||
.catch(onMessage);
|
||||
.catch(onMessage)
|
||||
}
|
||||
|
||||
function read() {
|
||||
const opts = {
|
||||
baseDir: getDir(),
|
||||
};
|
||||
baseDir
|
||||
}
|
||||
fs.stat(path, opts)
|
||||
.then((stat) => {
|
||||
const isFile = stat.isFile;
|
||||
const isFile = stat.isFile
|
||||
|
||||
const promise = isFile
|
||||
? fs.readFile(path, opts)
|
||||
: fs.readDir(path, opts);
|
||||
: fs.readDir(path, opts)
|
||||
promise
|
||||
.then(function (response) {
|
||||
if (isFile) {
|
||||
if (path.includes(".png") || path.includes(".jpg")) {
|
||||
if (path.includes('.png') || path.includes('.jpg')) {
|
||||
arrayBufferToBase64(
|
||||
new Uint8Array(response),
|
||||
function (base64) {
|
||||
const src = "data:image/png;base64," + base64;
|
||||
insecureRenderHtml('<img src="' + src + '"></img>');
|
||||
const src = 'data:image/png;base64,' + base64
|
||||
insecureRenderHtml('<img src="' + src + '"></img>')
|
||||
}
|
||||
);
|
||||
)
|
||||
} else {
|
||||
const value = String.fromCharCode.apply(null, response);
|
||||
const value = String.fromCharCode.apply(null, response)
|
||||
insecureRenderHtml(
|
||||
'<textarea id="file-response"></textarea><button id="file-save">Save</button>'
|
||||
);
|
||||
)
|
||||
setTimeout(() => {
|
||||
const fileInput = document.getElementById("file-response");
|
||||
fileInput.value = value;
|
||||
const fileInput = document.getElementById('file-response')
|
||||
fileInput.value = value
|
||||
document
|
||||
.getElementById("file-save")
|
||||
.addEventListener("click", function () {
|
||||
.getElementById('file-save')
|
||||
.addEventListener('click', function () {
|
||||
fs.writeTextFile(path, fileInput.value, {
|
||||
dir: getDir(),
|
||||
}).catch(onMessage);
|
||||
});
|
||||
});
|
||||
baseDir
|
||||
}).catch(onMessage)
|
||||
})
|
||||
})
|
||||
}
|
||||
} else {
|
||||
onMessage(response);
|
||||
onMessage(response)
|
||||
}
|
||||
})
|
||||
.catch(onMessage);
|
||||
.catch(onMessage)
|
||||
})
|
||||
.catch(onMessage);
|
||||
.catch(onMessage)
|
||||
}
|
||||
|
||||
function setSrc() {
|
||||
img.src = convertFileSrc(path);
|
||||
img.src = convertFileSrc(path)
|
||||
}
|
||||
|
||||
function watch() {
|
||||
unwatch();
|
||||
unwatch()
|
||||
if (watchPath) {
|
||||
onMessage(`Watching ${watchPath} for changes`);
|
||||
onMessage(`Watching ${watchPath} for changes`)
|
||||
let options = {
|
||||
recursive: watchRecursive,
|
||||
delayMs: parseInt(watchDebounceDelay),
|
||||
};
|
||||
delayMs: watchDebounceDelay
|
||||
}
|
||||
if (options.delayMs === 0) {
|
||||
fs.watchImmediate(watchPath, onMessage, options)
|
||||
.then((fn) => {
|
||||
unwatchFn = fn;
|
||||
unwatchPath = watchPath;
|
||||
unwatchFn = fn
|
||||
unwatchPath = watchPath
|
||||
})
|
||||
.catch(onMessage);
|
||||
.catch(onMessage)
|
||||
} else {
|
||||
fs.watch(watchPath, onMessage, options)
|
||||
.then((fn) => {
|
||||
unwatchFn = fn;
|
||||
unwatchPath = watchPath;
|
||||
unwatchFn = fn
|
||||
unwatchPath = watchPath
|
||||
})
|
||||
.catch(onMessage);
|
||||
.catch(onMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function unwatch() {
|
||||
if (unwatchFn) {
|
||||
onMessage(`Stopped watching ${unwatchPath} for changes`);
|
||||
unwatchFn();
|
||||
onMessage(`Stopped watching ${unwatchPath} for changes`)
|
||||
unwatchFn()
|
||||
}
|
||||
unwatchFn = undefined;
|
||||
unwatchPath = undefined;
|
||||
unwatchFn = undefined
|
||||
unwatchPath = undefined
|
||||
}
|
||||
|
||||
onDestroy(() => {
|
||||
if (file) {
|
||||
file.close()
|
||||
}
|
||||
if (unwatchFn) {
|
||||
unwatchFn()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<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">
|
||||
<select class="input" id="dir">
|
||||
<option value="">None</option>
|
||||
{#each DirOptions as dir}
|
||||
<option value={dir[1]}>{dir[0]}</option>
|
||||
<select class="input" bind:value={baseDir}>
|
||||
<option value={undefined} selected>None</option>
|
||||
{#each dirOptions as dir}
|
||||
<option value={fs.BaseDirectory[dir]}>{dir}</option>
|
||||
{/each}
|
||||
</select>
|
||||
<input
|
||||
@@ -188,20 +219,21 @@
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<button class="btn" on:click={open}>Open</button>
|
||||
<button class="btn" on:click={read}>Read</button>
|
||||
<button class="btn" on:click={mkdir}>Mkdir</button>
|
||||
<button class="btn" on:click={remove}>Remove</button>
|
||||
<button class="btn" onclick={open}>Open</button>
|
||||
<button class="btn" onclick={read}>Read</button>
|
||||
<button class="btn" onclick={mkdir}>Mkdir</button>
|
||||
<button class="btn" onclick={remove}>Remove</button>
|
||||
<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" />
|
||||
</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>
|
||||
{#if file}
|
||||
<div>
|
||||
<button class="btn" on:click={truncate}>Truncate</button>
|
||||
<button class="btn" on:click={stat}>Stat</button>
|
||||
<button class="btn" onclick={write}>Write</button>
|
||||
<button class="btn" onclick={truncate}>Truncate</button>
|
||||
<button class="btn" onclick={stat}>Stat</button>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -230,8 +262,8 @@
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<button class="btn" on:click={watch}>Watch</button>
|
||||
<button class="btn" on:click={unwatch}>Unwatch</button>
|
||||
<button class="btn" onclick={watch}>Watch</button>
|
||||
<button class="btn" onclick={unwatch}>Unwatch</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<script>
|
||||
import {
|
||||
vibrate,
|
||||
impactFeedback,
|
||||
notificationFeedback,
|
||||
selectionFeedback
|
||||
} from '@tauri-apps/plugin-haptics'
|
||||
|
||||
export let onMessage
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<button
|
||||
class="btn"
|
||||
on:click={() => vibrate(300).then(onMessage).catch(onMessage)}
|
||||
>vibrate short</button
|
||||
>
|
||||
<button
|
||||
class="btn"
|
||||
on:click={() => vibrate(1500).then(onMessage).catch(onMessage)}
|
||||
>vibrate long</button
|
||||
>
|
||||
<button
|
||||
class="btn"
|
||||
on:click={() => impactFeedback('medium').then(onMessage).catch(onMessage)}
|
||||
>impact medium</button
|
||||
>
|
||||
<button
|
||||
class="btn"
|
||||
on:click={() =>
|
||||
notificationFeedback('warning').then(onMessage).catch(onMessage)}
|
||||
>notification warning</button
|
||||
>
|
||||
<button
|
||||
class="btn"
|
||||
on:click={() => selectionFeedback().then(onMessage).catch(onMessage)}
|
||||
>selection</button
|
||||
>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<p>
|
||||
Depending on your device settings for haptic feedback some of the buttons may
|
||||
not work.
|
||||
</p>
|
||||
@@ -1,69 +1,69 @@
|
||||
<script>
|
||||
import { fetch as tauriFetch } from "@tauri-apps/plugin-http";
|
||||
import { JsonView } from "@zerodevx/svelte-json-view";
|
||||
import { fetch as tauriFetch } from '@tauri-apps/plugin-http'
|
||||
import { JsonView } from '@zerodevx/svelte-json-view'
|
||||
|
||||
let httpMethod = "GET";
|
||||
let httpBody = "";
|
||||
let httpMethod = 'GET'
|
||||
let httpBody = ''
|
||||
|
||||
export let onMessage;
|
||||
export let onMessage
|
||||
|
||||
async function makeHttpRequest() {
|
||||
let method = httpMethod || "GET";
|
||||
let method = httpMethod || 'GET'
|
||||
|
||||
const options = {
|
||||
method: method || "GET",
|
||||
headers: {},
|
||||
};
|
||||
method: method || 'GET',
|
||||
headers: {}
|
||||
}
|
||||
|
||||
let bodyType;
|
||||
let bodyType
|
||||
|
||||
if (method !== "GET") {
|
||||
options.body = httpBody;
|
||||
if (method !== 'GET') {
|
||||
options.body = httpBody
|
||||
|
||||
if (
|
||||
(httpBody.startsWith("{") && httpBody.endsWith("}")) ||
|
||||
(httpBody.startsWith("[") && httpBody.endsWith("]"))
|
||||
(httpBody.startsWith('{') && httpBody.endsWith('}')) ||
|
||||
(httpBody.startsWith('[') && httpBody.endsWith(']'))
|
||||
) {
|
||||
options.headers["Content-Type"] = "application/json";
|
||||
bodyType = "json";
|
||||
} else if (httpBody !== "") {
|
||||
bodyType = "text";
|
||||
options.headers['Content-Type'] = 'application/json'
|
||||
bodyType = 'json'
|
||||
} else if (httpBody !== '') {
|
||||
bodyType = 'text'
|
||||
}
|
||||
}
|
||||
|
||||
const response = await tauriFetch("http://localhost:3003", options);
|
||||
const response = await tauriFetch('http://localhost:3003', options)
|
||||
const body =
|
||||
bodyType === "json" ? await response.json() : await response.text();
|
||||
bodyType === 'json' ? await response.json() : await response.text()
|
||||
|
||||
onMessage({
|
||||
url: response.url,
|
||||
status: response.status,
|
||||
ok: response.ok,
|
||||
headers: Object.fromEntries(response.headers.entries()),
|
||||
body,
|
||||
});
|
||||
body
|
||||
})
|
||||
}
|
||||
|
||||
/// http form
|
||||
let foo = "baz";
|
||||
let bar = "qux";
|
||||
let result = null;
|
||||
let foo = 'baz'
|
||||
let bar = 'qux'
|
||||
let result = null
|
||||
|
||||
async function doPost() {
|
||||
const form = new FormData();
|
||||
form.append("foo", foo);
|
||||
form.append("bar", bar);
|
||||
const response = await tauriFetch("http://localhost:3003/tauri", {
|
||||
method: "POST",
|
||||
body: form,
|
||||
});
|
||||
const form = new FormData()
|
||||
form.append('foo', foo)
|
||||
form.append('bar', bar)
|
||||
const response = await tauriFetch('http://localhost:3003/tauri', {
|
||||
method: 'POST',
|
||||
body: form
|
||||
})
|
||||
result = {
|
||||
url: response.url,
|
||||
status: response.status,
|
||||
ok: response.ok,
|
||||
headers: Object.fromEntries(response.headers.entries()),
|
||||
body: await response.text(),
|
||||
};
|
||||
body: await response.text()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
placeholder="Request body"
|
||||
rows="5"
|
||||
bind:value={httpBody}
|
||||
/>
|
||||
></textarea>
|
||||
<br />
|
||||
<button class="btn" id="make-request"> Make request </button>
|
||||
</form>
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
<script>
|
||||
import { sendNotification } from '@tauri-apps/plugin-notification'
|
||||
export let onMessage
|
||||
|
||||
let sound = ''
|
||||
|
||||
// send the notification directly
|
||||
// the backend is responsible for checking the permission
|
||||
function _sendNotification() {
|
||||
new Notification('Notification title', {
|
||||
body: 'This is the notification body'
|
||||
sendNotification({
|
||||
title: 'Notification title',
|
||||
body: 'This is the notification body',
|
||||
sound: sound || null
|
||||
})
|
||||
}
|
||||
|
||||
// alternatively, check the permission ourselves
|
||||
function sendNotification() {
|
||||
function triggerNotification() {
|
||||
if (Notification.permission === 'default') {
|
||||
Notification.requestPermission()
|
||||
.then(function (response) {
|
||||
@@ -29,6 +34,11 @@
|
||||
}
|
||||
</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
|
||||
</button>
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<script>
|
||||
import * as opener from '@tauri-apps/plugin-opener'
|
||||
import { platform } from '@tauri-apps/plugin-os'
|
||||
|
||||
export let onMessage
|
||||
|
||||
let url = 'https://tauri.app'
|
||||
let urlProgram =
|
||||
platform() === 'ios' || platform() === 'android' ? 'inAppBrowser' : ''
|
||||
function openUrl() {
|
||||
opener.openUrl(url, urlProgram ? urlProgram : undefined).catch(onMessage)
|
||||
}
|
||||
|
||||
let path = ''
|
||||
let pathProgram = ''
|
||||
function openPath() {
|
||||
opener
|
||||
.openPath(path, pathProgram ? pathProgram : undefined)
|
||||
.catch(onMessage)
|
||||
}
|
||||
|
||||
let revealPath = ''
|
||||
function revealItemInDir() {
|
||||
opener.revealItemInDir(revealPath).catch(onMessage)
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
<form
|
||||
class="flex flex-row gap-2 items-center"
|
||||
on:submit|preventDefault={openUrl}
|
||||
>
|
||||
<button class="btn" type="submit">Open URL</button>
|
||||
<input
|
||||
class="input grow"
|
||||
placeholder="Type the URL to open..."
|
||||
bind:value={url}
|
||||
/>
|
||||
<span> with </span>
|
||||
<input class="input" bind:value={urlProgram} />
|
||||
</form>
|
||||
|
||||
<form
|
||||
class="flex flex-row gap-2 items-center"
|
||||
on:submit|preventDefault={openPath}
|
||||
>
|
||||
<button class="btn" type="submit">Open Path</button>
|
||||
<input
|
||||
class="input grow"
|
||||
placeholder="Type the path to open..."
|
||||
bind:value={path}
|
||||
/>
|
||||
<span> with </span>
|
||||
<input class="input" bind:value={pathProgram} />
|
||||
</form>
|
||||
|
||||
<form
|
||||
class="flex flex-row gap-2 items-center"
|
||||
on:submit|preventDefault={revealItemInDir}
|
||||
>
|
||||
<button class="btn" type="submit">Reveal</button>
|
||||
<input
|
||||
class="input grow"
|
||||
placeholder="Type the path to reveal..."
|
||||
bind:value={revealPath}
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
@@ -1,38 +1,44 @@
|
||||
<script>
|
||||
import { scan, checkPermissions, requestPermissions, Format, cancel } from "@tauri-apps/plugin-barcode-scanner";
|
||||
import {
|
||||
scan,
|
||||
checkPermissions,
|
||||
requestPermissions,
|
||||
Format,
|
||||
cancel
|
||||
} from '@tauri-apps/plugin-barcode-scanner'
|
||||
|
||||
export let onMessage;
|
||||
export let onMessage
|
||||
|
||||
let scanning = false;
|
||||
let windowed = true;
|
||||
let formats = [Format.QRCode];
|
||||
const supportedFormats = [Format.QRCode, Format.EAN13];
|
||||
let scanning = false
|
||||
let windowed = true
|
||||
let formats = [Format.QRCode]
|
||||
const supportedFormats = [Format.QRCode, Format.EAN13]
|
||||
|
||||
async function startScan() {
|
||||
let permission = await checkPermissions();
|
||||
let permission = await checkPermissions()
|
||||
if (permission === 'prompt') {
|
||||
permission = await requestPermissions();
|
||||
permission = await requestPermissions()
|
||||
}
|
||||
if (permission === 'granted') {
|
||||
scanning = true;
|
||||
scanning = true
|
||||
scan({ windowed, formats })
|
||||
.then((res) => {
|
||||
scanning = false;
|
||||
onMessage(res);
|
||||
scanning = false
|
||||
onMessage(res)
|
||||
})
|
||||
.catch((error) => {
|
||||
scanning = false;
|
||||
onMessage(error);
|
||||
});
|
||||
scanning = false
|
||||
onMessage(error)
|
||||
})
|
||||
} else {
|
||||
onMessage('Permission denied')
|
||||
}
|
||||
}
|
||||
|
||||
async function cancelScan() {
|
||||
await cancel();
|
||||
scanning = false;
|
||||
onMessage("cancelled");
|
||||
await cancel()
|
||||
scanning = false
|
||||
onMessage('cancelled')
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -59,11 +65,12 @@
|
||||
<div class="barcode-scanner--area--container">
|
||||
<div class="relative">
|
||||
<p>Aim your camera at a QR code</p>
|
||||
<button class="btn" type="button" on:click={cancelScan}>Cancel</button>
|
||||
<button class="btn" type="button" on:click={cancelScan}>Cancel</button
|
||||
>
|
||||
</div>
|
||||
<div class="square surround-cover">
|
||||
<div class="barcode-scanner--area--outer surround-cover">
|
||||
<div class="barcode-scanner--area--inner" />
|
||||
<div class="barcode-scanner--area--inner"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -111,7 +118,7 @@
|
||||
transition: 0.3s;
|
||||
}
|
||||
.square:after {
|
||||
content: "";
|
||||
content: '';
|
||||
top: 0;
|
||||
display: block;
|
||||
padding-bottom: 100%;
|
||||
@@ -141,7 +148,8 @@
|
||||
width: 100%;
|
||||
margin: 1rem;
|
||||
border: 2px solid #fff;
|
||||
box-shadow: 0px 0px 2px 1px rgb(0 0 0 / 0.5),
|
||||
box-shadow:
|
||||
0px 0px 2px 1px rgb(0 0 0 / 0.5),
|
||||
inset 0px 0px 2px 1px rgb(0 0 0 / 0.5);
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
@@ -1,34 +1,85 @@
|
||||
<script>
|
||||
import { Store } from "@tauri-apps/plugin-store";
|
||||
import { onMount } from "svelte";
|
||||
import { appDataDir, resolve } from '@tauri-apps/api/path'
|
||||
import { LazyStore } from '@tauri-apps/plugin-store'
|
||||
import { onMount } from 'svelte'
|
||||
|
||||
export let onMessage;
|
||||
let { onMessage } = $props()
|
||||
|
||||
let key;
|
||||
let value;
|
||||
let key = $state()
|
||||
let value = $state()
|
||||
|
||||
const store = new Store("cache.json");
|
||||
let cache = {};
|
||||
const storeName = 'cache.json'
|
||||
|
||||
let store = new LazyStore(storeName)
|
||||
let path = $state('')
|
||||
let cache = $state({})
|
||||
|
||||
async function refreshEntries() {
|
||||
try {
|
||||
const values = await store.entries()
|
||||
cache = {}
|
||||
for (const [key, value] of values) {
|
||||
cache[key] = value
|
||||
}
|
||||
} catch (error) {
|
||||
onMessage(error)
|
||||
}
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
await store.load();
|
||||
const values = await store.entries();
|
||||
for (const [key, value] of values) {
|
||||
cache[key] = value;
|
||||
}
|
||||
cache = cache;
|
||||
});
|
||||
path = await resolve(await appDataDir(), storeName)
|
||||
await refreshEntries()
|
||||
})
|
||||
|
||||
function write(key, value) {
|
||||
store
|
||||
.set(key, value)
|
||||
.then(() => store.get(key))
|
||||
.then((v) => {
|
||||
cache[key] = v;
|
||||
cache = cache;
|
||||
})
|
||||
.then(() => store.save())
|
||||
.catch(onMessage);
|
||||
async function write(key, value) {
|
||||
try {
|
||||
if (value) {
|
||||
await store.set(key, value)
|
||||
} else {
|
||||
await store.delete(key)
|
||||
}
|
||||
const v = await store.get(key)
|
||||
if (v === undefined) {
|
||||
delete cache[key]
|
||||
cache = cache
|
||||
} else {
|
||||
cache[key] = v
|
||||
}
|
||||
} catch (error) {
|
||||
onMessage(error)
|
||||
}
|
||||
}
|
||||
|
||||
async function reset() {
|
||||
try {
|
||||
await store.reset()
|
||||
} catch (error) {
|
||||
onMessage(error)
|
||||
}
|
||||
await refreshEntries()
|
||||
}
|
||||
|
||||
async function reload() {
|
||||
try {
|
||||
await store.reload({ overrideDefaults: true })
|
||||
} catch (error) {
|
||||
onMessage(error)
|
||||
}
|
||||
await refreshEntries()
|
||||
}
|
||||
|
||||
async function close() {
|
||||
try {
|
||||
await store.close()
|
||||
onMessage('Store is now closed, any new operations will error out')
|
||||
} catch (error) {
|
||||
onMessage(error)
|
||||
}
|
||||
}
|
||||
|
||||
function reopen() {
|
||||
store = new LazyStore(storeName)
|
||||
onMessage('We made a new `LazyStore` instance, operations will now work')
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -44,10 +95,18 @@
|
||||
<input class="grow input" bind:value />
|
||||
</div>
|
||||
|
||||
<button class="btn" on:click={() => write(key, value)}> Write </button>
|
||||
<div>
|
||||
<button class="btn" onclick={() => write(key, value)}>Write</button>
|
||||
<button class="btn" onclick={() => reset()}>Reset</button>
|
||||
<button class="btn" onclick={() => reload()}>Reload</button>
|
||||
<button class="btn" onclick={() => close()}>Close</button>
|
||||
<button class="btn" onclick={() => reopen()}>Re-open</button>
|
||||
</div>
|
||||
<div>Store at <code>{path}</code> on disk</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2>Store Values</h2>
|
||||
{#each Object.entries(cache) as [k, v]}
|
||||
<div>{k} = {v}</div>
|
||||
{/each}
|
||||
|
||||
@@ -1,56 +1,60 @@
|
||||
<script>
|
||||
import { check } from "@tauri-apps/plugin-updater";
|
||||
import { relaunch } from "@tauri-apps/plugin-process";
|
||||
import { check } from '@tauri-apps/plugin-updater'
|
||||
import { relaunch } from '@tauri-apps/plugin-process'
|
||||
|
||||
export let onMessage;
|
||||
export let onMessage
|
||||
|
||||
let isChecking, isInstalling, newUpdate;
|
||||
let isChecking, isInstalling, newUpdate
|
||||
let totalSize = 0,
|
||||
downloadedSize = 0;
|
||||
downloadedSize = 0
|
||||
|
||||
async function checkUpdate() {
|
||||
isChecking = true;
|
||||
isChecking = true
|
||||
try {
|
||||
const update = await check();
|
||||
onMessage(`Should update: ${update.available}`);
|
||||
onMessage(update);
|
||||
const update = await check()
|
||||
if (update) {
|
||||
onMessage(`Should update: ${update.available}`)
|
||||
onMessage(update)
|
||||
|
||||
newUpdate = update;
|
||||
newUpdate = update
|
||||
} else {
|
||||
onMessage('No update available')
|
||||
}
|
||||
} catch (e) {
|
||||
onMessage(e);
|
||||
onMessage(e)
|
||||
} finally {
|
||||
isChecking = false;
|
||||
isChecking = false
|
||||
}
|
||||
}
|
||||
|
||||
async function install() {
|
||||
isInstalling = true;
|
||||
downloadedSize = 0;
|
||||
isInstalling = true
|
||||
downloadedSize = 0
|
||||
try {
|
||||
await newUpdate.downloadAndInstall((downloadProgress) => {
|
||||
switch (downloadProgress.event) {
|
||||
case "Started":
|
||||
totalSize = downloadProgress.data.contentLength;
|
||||
break;
|
||||
case "Progress":
|
||||
downloadedSize += downloadProgress.data.chunkLength;
|
||||
break;
|
||||
case "Finished":
|
||||
break;
|
||||
case 'Started':
|
||||
totalSize = downloadProgress.data.contentLength
|
||||
break
|
||||
case 'Progress':
|
||||
downloadedSize += downloadProgress.data.chunkLength
|
||||
break
|
||||
case 'Finished':
|
||||
break
|
||||
}
|
||||
});
|
||||
onMessage("Installation complete, restarting...");
|
||||
await new Promise((resolve) => setTimeout(resolve, 2000));
|
||||
await relaunch();
|
||||
})
|
||||
onMessage('Installation complete, restarting...')
|
||||
await new Promise((resolve) => setTimeout(resolve, 2000))
|
||||
await relaunch()
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
onMessage(e);
|
||||
console.error(e)
|
||||
onMessage(e)
|
||||
} finally {
|
||||
isInstalling = false;
|
||||
isInstalling = false
|
||||
}
|
||||
}
|
||||
|
||||
$: progress = totalSize ? Math.round((downloadedSize / totalSize) * 100) : 0;
|
||||
$: progress = totalSize ? Math.round((downloadedSize / totalSize) * 100) : 0
|
||||
</script>
|
||||
|
||||
<div class="flex children:grow children:h10">
|
||||
@@ -61,7 +65,7 @@
|
||||
{:else}
|
||||
<div class="progress">
|
||||
<span>{progress}%</span>
|
||||
<div class="progress-bar" style="width: {progress}%" />
|
||||
<div class="progress-bar" style="width: {progress}%"></div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,376 @@
|
||||
<script>
|
||||
import { download, upload } 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 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']
|
||||
])
|
||||
)
|
||||
|
||||
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>
|
||||
|
||||
<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...' : 'Upload File'}
|
||||
</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>
|
||||
+21
-17
@@ -7,29 +7,33 @@
|
||||
"build": "pnpm run -r --parallel --filter !plugins-workspace --filter !\"./plugins/*/examples/**\" --filter !\"./examples/*\" build",
|
||||
"lint": "eslint .",
|
||||
"format": "prettier --write .",
|
||||
"format:check": "prettier --check ."
|
||||
"format:check": "prettier --check .",
|
||||
"example:api:dev": "pnpm run --filter \"api\" tauri dev"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "9.11.1",
|
||||
"@rollup/plugin-node-resolve": "15.3.0",
|
||||
"@eslint/js": "9.34.0",
|
||||
"@rollup/plugin-node-resolve": "16.0.1",
|
||||
"@rollup/plugin-terser": "0.4.4",
|
||||
"@rollup/plugin-typescript": "11.1.6",
|
||||
"@types/eslint__js": "8.42.3",
|
||||
"covector": "^0.12.3",
|
||||
"eslint": "9.11.1",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"@rollup/plugin-typescript": "12.1.4",
|
||||
"covector": "^0.12.4",
|
||||
"eslint": "9.34.0",
|
||||
"eslint-config-prettier": "10.1.8",
|
||||
"eslint-plugin-security": "3.0.1",
|
||||
"prettier": "3.3.3",
|
||||
"rollup": "4.22.4",
|
||||
"tslib": "2.7.0",
|
||||
"typescript": "5.6.2",
|
||||
"typescript-eslint": "8.7.0"
|
||||
"prettier": "3.6.2",
|
||||
"rollup": "4.48.0",
|
||||
"tslib": "2.8.1",
|
||||
"typescript": "5.9.2",
|
||||
"typescript-eslint": "8.40.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"semver": ">=7.5.2",
|
||||
"optionator": ">=0.9.3"
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"esbuild@<0.25.0": ">=0.25.0"
|
||||
},
|
||||
"onlyBuiltDependencies": [
|
||||
"esbuild"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"pnpm": "^9.0.0"
|
||||
"pnpm": "^10.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# Changelog
|
||||
|
||||
## \[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
|
||||
|
||||
## \[2.4.0]
|
||||
|
||||
- [`764e8f77`](https://github.com/tauri-apps/plugins-workspace/commit/764e8f7719247da515243d9c9cafa6d087d21769) ([#2707](https://github.com/tauri-apps/plugins-workspace/pull/2707)) Added a new builder method app_name() to allow customizing the application name in the autostart entry.
|
||||
|
||||
## \[2.3.0]
|
||||
|
||||
- [`8ecb418a`](https://github.com/tauri-apps/plugins-workspace/commit/8ecb418a1a35d7f234dc5d833746ac2d8e062aec) ([#2569](https://github.com/tauri-apps/plugins-workspace/pull/2569)) Add a `Builder` for more flexible settings
|
||||
|
||||
## \[2.2.0]
|
||||
|
||||
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
@@ -84,11 +104,3 @@
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
te to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-autostart"
|
||||
version = "2.0.0"
|
||||
version = "2.5.0"
|
||||
description = "Automatically launch your application at startup."
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
@@ -27,6 +27,5 @@ tauri-plugin = { workspace = true, features = ["build"] }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
tauri = { workspace = true }
|
||||
log = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
auto-launch = "0.5"
|
||||
|
||||
@@ -12,7 +12,7 @@ Automatically launch your application at startup.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
@@ -33,35 +33,27 @@ tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspac
|
||||
|
||||
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
|
||||
pnpm add @tauri-apps/plugin-autostart
|
||||
# or
|
||||
npm add @tauri-apps/plugin-autostart
|
||||
# or
|
||||
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
|
||||
|
||||
First you need to register the core plugin with Tauri:
|
||||
|
||||
`src-tauri/src/main.rs`
|
||||
`src-tauri/src/lib.rs`
|
||||
|
||||
```rust
|
||||
use tauri_plugin_autostart::MacosLauncher;
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_autostart::init(MacosLauncher::LaunchAgent, Some(vec!["--flag1", "--flag2"]) /* arbitrary number of args to pass to your app */))
|
||||
.plugin(tauri_plugin_autostart::Builder::new()
|
||||
.args(["--flag1", "--flag2"])
|
||||
.app_name("My Custom Name")
|
||||
.build())
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-autostart",
|
||||
"version": "2.0.0",
|
||||
"version": "2.5.0",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
@@ -24,6 +24,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.0.0"
|
||||
"@tauri-apps/api": "^2.8.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ starting the application on boot.
|
||||
It allows all to check, enable and
|
||||
disable the automatic start on boot.
|
||||
|
||||
|
||||
#### This default permission set includes the following:
|
||||
|
||||
- `allow-enable`
|
||||
- `allow-disable`
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
"minimum": 1.0
|
||||
},
|
||||
"description": {
|
||||
"description": "Human-readable description of what the permission does. Tauri convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
|
||||
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
@@ -111,7 +111,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "Human-readable description of what the permission does. Tauri internal convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
|
||||
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
@@ -297,37 +297,44 @@
|
||||
{
|
||||
"description": "Enables the disable command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-disable"
|
||||
"const": "allow-disable",
|
||||
"markdownDescription": "Enables the disable command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the disable command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-disable"
|
||||
"const": "deny-disable",
|
||||
"markdownDescription": "Denies the disable command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the enable command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-enable"
|
||||
"const": "allow-enable",
|
||||
"markdownDescription": "Enables the enable command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the enable command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-enable"
|
||||
"const": "deny-enable",
|
||||
"markdownDescription": "Denies the enable command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the is_enabled command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-is-enabled"
|
||||
"const": "allow-is-enabled",
|
||||
"markdownDescription": "Enables the is_enabled command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the is_enabled command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-is-enabled"
|
||||
"const": "deny-is-enabled",
|
||||
"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",
|
||||
"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`",
|
||||
"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`"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
+146
-54
@@ -2,8 +2,6 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//! [](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/autostart)
|
||||
//!
|
||||
//! Automatically launch your application at startup. Supports Windows, Mac (via AppleScript or Launch Agent), and Linux.
|
||||
|
||||
#![doc(
|
||||
@@ -13,12 +11,10 @@
|
||||
#![cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
|
||||
use auto_launch::{AutoLaunch, AutoLaunchBuilder};
|
||||
#[cfg(target_os = "macos")]
|
||||
use log::info;
|
||||
use serde::{ser::Serializer, Serialize};
|
||||
use tauri::{
|
||||
command,
|
||||
plugin::{Builder, TauriPlugin},
|
||||
plugin::{Builder as PluginBuilder, TauriPlugin},
|
||||
Manager, Runtime, State,
|
||||
};
|
||||
|
||||
@@ -26,8 +22,9 @@ use std::env::current_exe;
|
||||
|
||||
type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Debug, Default, Copy, Clone)]
|
||||
pub enum MacosLauncher {
|
||||
#[default]
|
||||
LaunchAgent,
|
||||
AppleScript,
|
||||
}
|
||||
@@ -75,10 +72,12 @@ impl AutoLaunchManager {
|
||||
}
|
||||
|
||||
pub trait ManagerExt<R: Runtime> {
|
||||
/// TODO: Rename these to `autostart` or `auto_start` in v3
|
||||
fn autolaunch(&self) -> State<'_, AutoLaunchManager>;
|
||||
}
|
||||
|
||||
impl<R: Runtime, T: Manager<R>> ManagerExt<R> for T {
|
||||
/// TODO: Rename these to `autostart` or `auto_start` in v3
|
||||
fn autolaunch(&self) -> State<'_, AutoLaunchManager> {
|
||||
self.state::<AutoLaunchManager>()
|
||||
}
|
||||
@@ -99,60 +98,153 @@ async fn is_enabled(manager: State<'_, AutoLaunchManager>) -> Result<bool> {
|
||||
manager.is_enabled()
|
||||
}
|
||||
|
||||
/// Initializes the plugin.
|
||||
///
|
||||
/// `args` - are passed to your app on startup.
|
||||
pub fn init<R: Runtime>(
|
||||
#[derive(Default)]
|
||||
pub struct Builder {
|
||||
#[cfg(target_os = "macos")]
|
||||
macos_launcher: MacosLauncher,
|
||||
args: Option<Vec<&'static str>>,
|
||||
) -> TauriPlugin<R> {
|
||||
Builder::new("autostart")
|
||||
.invoke_handler(tauri::generate_handler![enable, disable, is_enabled])
|
||||
.setup(move |app, _api| {
|
||||
let mut builder = AutoLaunchBuilder::new();
|
||||
builder.set_app_name(&app.package_info().name);
|
||||
if let Some(args) = args {
|
||||
builder.set_args(&args);
|
||||
}
|
||||
builder.set_use_launch_agent(matches!(macos_launcher, MacosLauncher::LaunchAgent));
|
||||
args: Vec<String>,
|
||||
app_name: Option<String>,
|
||||
}
|
||||
|
||||
let current_exe = current_exe()?;
|
||||
impl Builder {
|
||||
/// Create a new auto start builder with default settings
|
||||
pub fn new() -> Self {
|
||||
Self::default()
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
builder.set_app_path(¤t_exe.display().to_string());
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
// on macOS, current_exe gives path to /Applications/Example.app/MacOS/Example
|
||||
// but this results in seeing a Unix Executable in macOS login items
|
||||
// It must be: /Applications/Example.app
|
||||
// If it didn't find exactly a single occurance of .app, it will default to
|
||||
// exe path to not break it.
|
||||
let exe_path = current_exe.canonicalize()?.display().to_string();
|
||||
let parts: Vec<&str> = exe_path.split(".app/").collect();
|
||||
let app_path =
|
||||
if parts.len() == 2 && matches!(macos_launcher, MacosLauncher::AppleScript) {
|
||||
/// Adds an argument to pass to your app on startup.
|
||||
///
|
||||
/// ## Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// Builder::new()
|
||||
/// .arg("--from-autostart")
|
||||
/// .arg("--hey")
|
||||
/// .build();
|
||||
/// ```
|
||||
pub fn arg<S: Into<String>>(mut self, arg: S) -> Self {
|
||||
self.args.push(arg.into());
|
||||
self
|
||||
}
|
||||
|
||||
/// Adds multiple arguments to pass to your app on startup.
|
||||
///
|
||||
/// ## Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// Builder::new()
|
||||
/// .args(["--from-autostart", "--hey"])
|
||||
/// .build();
|
||||
/// ```
|
||||
pub fn args<I, S>(mut self, args: I) -> Self
|
||||
where
|
||||
I: IntoIterator<Item = S>,
|
||||
S: Into<String>,
|
||||
{
|
||||
for arg in args {
|
||||
self = self.arg(arg);
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets whether to use launch agent or apple script to be used to enable auto start,
|
||||
/// the builder's default is [`MacosLauncher::LaunchAgent`]
|
||||
#[cfg(target_os = "macos")]
|
||||
pub fn macos_launcher(mut self, macos_launcher: MacosLauncher) -> Self {
|
||||
self.macos_launcher = macos_launcher;
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the app name to be used for the auto start entry.
|
||||
///
|
||||
/// ## Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// Builder::new()
|
||||
/// .app_name("My Custom Name"))
|
||||
/// .build();
|
||||
/// ```
|
||||
pub fn app_name<S: Into<String>>(mut self, app_name: S) -> Self {
|
||||
self.app_name = Some(app_name.into());
|
||||
self
|
||||
}
|
||||
|
||||
pub fn build<R: Runtime>(self) -> TauriPlugin<R> {
|
||||
PluginBuilder::new("autostart")
|
||||
.invoke_handler(tauri::generate_handler![enable, disable, is_enabled])
|
||||
.setup(move |app, _api| {
|
||||
let mut builder = AutoLaunchBuilder::new();
|
||||
|
||||
let app_name = self
|
||||
.app_name
|
||||
.as_ref()
|
||||
.unwrap_or_else(|| &app.package_info().name);
|
||||
builder.set_app_name(app_name);
|
||||
|
||||
builder.set_args(&self.args);
|
||||
|
||||
let current_exe = current_exe()?;
|
||||
|
||||
#[cfg(windows)]
|
||||
builder.set_app_path(¤t_exe.display().to_string());
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
builder.set_use_launch_agent(matches!(
|
||||
self.macos_launcher,
|
||||
MacosLauncher::LaunchAgent
|
||||
));
|
||||
// on macOS, current_exe gives path to /Applications/Example.app/MacOS/Example
|
||||
// but this results in seeing a Unix Executable in macOS login items
|
||||
// It must be: /Applications/Example.app
|
||||
// If it didn't find exactly a single occurance of .app, it will default to
|
||||
// exe path to not break it.
|
||||
let exe_path = current_exe.canonicalize()?.display().to_string();
|
||||
let parts: Vec<&str> = exe_path.split(".app/").collect();
|
||||
let app_path = if parts.len() == 2
|
||||
&& matches!(self.macos_launcher, MacosLauncher::AppleScript)
|
||||
{
|
||||
format!("{}.app", parts.first().unwrap())
|
||||
} else {
|
||||
exe_path
|
||||
};
|
||||
info!("auto_start path {}", &app_path);
|
||||
builder.set_app_path(&app_path);
|
||||
}
|
||||
#[cfg(target_os = "linux")]
|
||||
if let Some(appimage) = app
|
||||
.env()
|
||||
.appimage
|
||||
.and_then(|p| p.to_str().map(|s| s.to_string()))
|
||||
{
|
||||
builder.set_app_path(&appimage);
|
||||
} else {
|
||||
builder.set_app_path(¤t_exe.display().to_string());
|
||||
}
|
||||
builder.set_app_path(&app_path);
|
||||
}
|
||||
|
||||
app.manage(AutoLaunchManager(
|
||||
builder.build().map_err(|e| e.to_string())?,
|
||||
));
|
||||
Ok(())
|
||||
})
|
||||
.build()
|
||||
#[cfg(target_os = "linux")]
|
||||
if let Some(appimage) = app
|
||||
.env()
|
||||
.appimage
|
||||
.and_then(|p| p.to_str().map(|s| s.to_string()))
|
||||
{
|
||||
builder.set_app_path(&appimage);
|
||||
} else {
|
||||
builder.set_app_path(¤t_exe.display().to_string());
|
||||
}
|
||||
|
||||
app.manage(AutoLaunchManager(
|
||||
builder.build().map_err(|e| e.to_string())?,
|
||||
));
|
||||
Ok(())
|
||||
})
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
||||
/// Initializes the plugin.
|
||||
///
|
||||
/// `args` - are passed to your app on startup.
|
||||
pub fn init<R: Runtime>(
|
||||
#[allow(unused)] macos_launcher: MacosLauncher,
|
||||
args: Option<Vec<&'static str>>,
|
||||
) -> TauriPlugin<R> {
|
||||
let mut builder = Builder::new();
|
||||
if let Some(args) = args {
|
||||
builder = builder.args(args)
|
||||
}
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
builder = builder.macos_launcher(macos_launcher);
|
||||
}
|
||||
builder.build()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# Changelog
|
||||
|
||||
## \[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]
|
||||
|
||||
- [`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.2.1]
|
||||
|
||||
- [`f634e524`](https://github.com/tauri-apps/plugins-workspace/commit/f634e5248ebe428f8305a59f74c13fc15147fb8e) This is an "empty" release to update the plugins' source files on crates.io and docs.rs. This should fix docs.rs build failures for projects using tauri plugins as dependencies.
|
||||
|
||||
## \[2.2.0]
|
||||
|
||||
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-barcode-scanner"
|
||||
version = "2.0.0"
|
||||
version = "2.4.0"
|
||||
description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS"
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
Allows your mobile application to use the camera to scan QR codes, EAN-13 and other kinds of barcodes.
|
||||
|
||||
@@ -33,28 +33,19 @@ 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:
|
||||
|
||||
> 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
|
||||
pnpm add @tauri-apps/plugin-barcode-scanner
|
||||
# or
|
||||
npm add @tauri-apps/plugin-barcode-scanner
|
||||
# or
|
||||
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
|
||||
|
||||
First you need to register the core plugin with Tauri:
|
||||
|
||||
`src-tauri/src/main.rs`
|
||||
`src-tauri/src/lib.rs`
|
||||
|
||||
```rust
|
||||
fn main() {
|
||||
|
||||
@@ -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__})}
|
||||
|
||||
@@ -12,6 +12,9 @@ export type { PermissionState } from '@tauri-apps/api/core'
|
||||
|
||||
export enum Format {
|
||||
QRCode = 'QR_CODE',
|
||||
/**
|
||||
* Not supported on iOS.
|
||||
*/
|
||||
UPC_A = 'UPC_A',
|
||||
UPC_E = 'UPC_E',
|
||||
EAN8 = 'EAN_8',
|
||||
@@ -19,11 +22,26 @@ export enum Format {
|
||||
Code39 = 'CODE_39',
|
||||
Code93 = 'CODE_93',
|
||||
Code128 = 'CODE_128',
|
||||
/**
|
||||
* Not supported on iOS.
|
||||
*/
|
||||
Codabar = 'CODABAR',
|
||||
ITF = 'ITF',
|
||||
Aztec = 'AZTEC',
|
||||
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 {
|
||||
|
||||
@@ -27,8 +27,11 @@ enum SupportedFormat: String, CaseIterable, Decodable {
|
||||
case DATA_MATRIX
|
||||
case PDF_417
|
||||
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 {
|
||||
case .UPC_E: return AVMetadataObject.ObjectType.upce
|
||||
case .EAN_8: return AVMetadataObject.ObjectType.ean8
|
||||
@@ -41,6 +44,24 @@ enum SupportedFormat: String, CaseIterable, Decodable {
|
||||
case .DATA_MATRIX: return AVMetadataObject.ObjectType.dataMatrix
|
||||
case .PDF_417: return AVMetadataObject.ObjectType.pdf417
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -242,13 +263,20 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate {
|
||||
scanFormats = [AVMetadataObject.ObjectType]()
|
||||
|
||||
(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 {
|
||||
for supportedFormat in SupportedFormat.allCases {
|
||||
scanFormats.append(supportedFormat.value)
|
||||
}
|
||||
if scanFormats.isEmpty {
|
||||
for supportedFormat in SupportedFormat.allCases {
|
||||
if let formatValue = supportedFormat.value {
|
||||
scanFormats.append(formatValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.metaOutput!.metadataObjectTypes = self.scanFormats
|
||||
|
||||
@@ -52,6 +52,15 @@ func discoverCaptureDevices() -> [AVCaptureDevice] {
|
||||
}
|
||||
|
||||
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 {
|
||||
case AVMetadataObject.ObjectType.upce:
|
||||
return "UPC_E"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-barcode-scanner",
|
||||
"version": "2.0.0",
|
||||
"version": "2.4.0",
|
||||
"description": "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
@@ -25,6 +25,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.0.0"
|
||||
"@tauri-apps/api": "^2.8.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ barcode scanning features are by default exposed.
|
||||
|
||||
It allows all barcode related features.
|
||||
|
||||
|
||||
#### This default permission set includes the following:
|
||||
|
||||
- `allow-cancel`
|
||||
- `allow-check-permissions`
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
"minimum": 1.0
|
||||
},
|
||||
"description": {
|
||||
"description": "Human-readable description of what the permission does. Tauri convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
|
||||
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
@@ -111,7 +111,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "Human-readable description of what the permission does. Tauri internal convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
|
||||
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
@@ -297,67 +297,80 @@
|
||||
{
|
||||
"description": "Enables the cancel command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-cancel"
|
||||
"const": "allow-cancel",
|
||||
"markdownDescription": "Enables the cancel command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the cancel command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-cancel"
|
||||
"const": "deny-cancel",
|
||||
"markdownDescription": "Denies the cancel command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the check_permissions command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-check-permissions"
|
||||
"const": "allow-check-permissions",
|
||||
"markdownDescription": "Enables the check_permissions command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the check_permissions command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-check-permissions"
|
||||
"const": "deny-check-permissions",
|
||||
"markdownDescription": "Denies the check_permissions command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the open_app_settings command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-open-app-settings"
|
||||
"const": "allow-open-app-settings",
|
||||
"markdownDescription": "Enables the open_app_settings command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the open_app_settings command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-open-app-settings"
|
||||
"const": "deny-open-app-settings",
|
||||
"markdownDescription": "Denies the open_app_settings command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the request_permissions command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-request-permissions"
|
||||
"const": "allow-request-permissions",
|
||||
"markdownDescription": "Enables the request_permissions command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the request_permissions command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-request-permissions"
|
||||
"const": "deny-request-permissions",
|
||||
"markdownDescription": "Denies the request_permissions command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the scan command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-scan"
|
||||
"const": "allow-scan",
|
||||
"markdownDescription": "Enables the scan command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the scan command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-scan"
|
||||
"const": "deny-scan",
|
||||
"markdownDescription": "Denies the scan command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the vibrate command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-vibrate"
|
||||
"const": "allow-vibrate",
|
||||
"markdownDescription": "Enables the vibrate command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the vibrate command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-vibrate"
|
||||
"const": "deny-vibrate",
|
||||
"markdownDescription": "Denies the vibrate command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "This permission set configures which\nbarcode scanning features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all barcode related features.\n\n",
|
||||
"description": "This permission set configures which\nbarcode scanning features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all barcode related features.\n\n\n#### This default permission set includes:\n\n- `allow-cancel`\n- `allow-check-permissions`\n- `allow-open-app-settings`\n- `allow-request-permissions`\n- `allow-scan`\n- `allow-vibrate`",
|
||||
"type": "string",
|
||||
"const": "default"
|
||||
"const": "default",
|
||||
"markdownDescription": "This permission set configures which\nbarcode scanning features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all barcode related features.\n\n\n#### This default permission set includes:\n\n- `allow-cancel`\n- `allow-check-permissions`\n- `allow-open-app-settings`\n- `allow-request-permissions`\n- `allow-scan`\n- `allow-vibrate`"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
# Changelog
|
||||
|
||||
## \[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
|
||||
|
||||
## \[2.2.2]
|
||||
|
||||
- [`f634e524`](https://github.com/tauri-apps/plugins-workspace/commit/f634e5248ebe428f8305a59f74c13fc15147fb8e) This is an "empty" release to update the plugins' source files on crates.io and docs.rs. This should fix docs.rs build failures for projects using tauri plugins as dependencies.
|
||||
|
||||
## \[2.2.1]
|
||||
|
||||
### bug
|
||||
|
||||
- [`10f9e66e`](https://github.com/tauri-apps/plugins-workspace/commit/10f9e66e32141dd35f4bf884fbf9102691187e92) ([#2633](https://github.com/tauri-apps/plugins-workspace/pull/2633) by [@pjf-dev](https://github.com/tauri-apps/plugins-workspace/../../pjf-dev)) Fix biometric plugin ignoring fallback logic when biometry status is unavailable or not enrolled on iOS.
|
||||
|
||||
## \[2.2.0]
|
||||
|
||||
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-biometric"
|
||||
version = "2.0.0"
|
||||
version = "2.3.0"
|
||||
description = "Prompt the user for biometric authentication on Android and iOS."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -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:
|
||||
|
||||
> 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! -->
|
||||
|
||||
```sh
|
||||
@@ -43,20 +41,13 @@ pnpm add @tauri-apps/plugin-biometric
|
||||
npm add @tauri-apps/plugin-biometric
|
||||
# or
|
||||
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
|
||||
|
||||
First you need to register the core plugin with Tauri:
|
||||
|
||||
`src-tauri/src/main.rs`
|
||||
`src-tauri/src/lib.rs`
|
||||
|
||||
```rust
|
||||
fn main() {
|
||||
|
||||
@@ -98,7 +98,12 @@ class BiometricPlugin: Plugin {
|
||||
}
|
||||
|
||||
@objc func authenticate(_ invoke: Invoke) throws {
|
||||
guard self.status.available else {
|
||||
let args = try invoke.parseArgs(AuthOptions.self)
|
||||
|
||||
let allowDeviceCredential = args.allowDeviceCredential ?? false
|
||||
|
||||
guard self.status.available || allowDeviceCredential else {
|
||||
// Biometry unavailable, fallback disabled
|
||||
invoke.reject(
|
||||
self.status.errorReason ?? "",
|
||||
code: self.status.errorCode ?? ""
|
||||
@@ -106,15 +111,11 @@ class BiometricPlugin: Plugin {
|
||||
return
|
||||
}
|
||||
|
||||
let args = try invoke.parseArgs(AuthOptions.self)
|
||||
|
||||
let context = LAContext()
|
||||
context.localizedFallbackTitle = args.fallbackTitle
|
||||
context.localizedCancelTitle = args.cancelTitle
|
||||
context.touchIDAuthenticationAllowableReuseDuration = 0
|
||||
|
||||
let allowDeviceCredential = args.allowDeviceCredential ?? false
|
||||
|
||||
// force system default fallback title if an empty string is provided (the OS hides the fallback button in this case)
|
||||
if allowDeviceCredential,
|
||||
let fallbackTitle = context.localizedFallbackTitle,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-biometric",
|
||||
"version": "2.0.0",
|
||||
"version": "2.3.0",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
@@ -25,6 +25,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.0.0"
|
||||
"@tauri-apps/api": "^2.8.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ biometric features are by default exposed.
|
||||
|
||||
It allows acccess to all biometric commands.
|
||||
|
||||
|
||||
#### This default permission set includes the following:
|
||||
|
||||
- `allow-authenticate`
|
||||
- `allow-status`
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
"minimum": 1.0
|
||||
},
|
||||
"description": {
|
||||
"description": "Human-readable description of what the permission does. Tauri convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
|
||||
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
@@ -111,7 +111,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "Human-readable description of what the permission does. Tauri internal convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
|
||||
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
@@ -297,27 +297,32 @@
|
||||
{
|
||||
"description": "Enables the authenticate command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-authenticate"
|
||||
"const": "allow-authenticate",
|
||||
"markdownDescription": "Enables the authenticate command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the authenticate command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-authenticate"
|
||||
"const": "deny-authenticate",
|
||||
"markdownDescription": "Denies the authenticate command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the status command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-status"
|
||||
"const": "allow-status",
|
||||
"markdownDescription": "Enables the status command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the status command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-status"
|
||||
"const": "deny-status",
|
||||
"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",
|
||||
"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`",
|
||||
"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`"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# Changelog
|
||||
|
||||
## \[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
|
||||
|
||||
## \[2.3.0]
|
||||
|
||||
- [`f6e11282`](https://github.com/tauri-apps/plugins-workspace/commit/f6e11282a7f4036dd6d1dbb8f100e777e9e42f11) ([#2787](https://github.com/tauri-apps/plugins-workspace/pull/2787) by [@mikew](https://github.com/tauri-apps/plugins-workspace/../../mikew)) Added `Cli.matches_from(args)`. This can be combined with the `args` passed to the callback of `tauri_plugin_single_instance::init` to parse the command line arguments passed to subsequent instances of the application.
|
||||
- [`37c2fb41`](https://github.com/tauri-apps/plugins-workspace/commit/37c2fb41201160e85c8dc3ad40f462cd4e17a304) ([#2772](https://github.com/tauri-apps/plugins-workspace/pull/2772) by [@floriskn](https://github.com/tauri-apps/plugins-workspace/../../floriskn)) Added a new `global` boolean flag to the `CliArg` struct to support global CLI arguments. This flag allows arguments like `--verbose` to be marked as global and automatically propagated to all subcommands, enabling consistent availability throughout the CLI.
|
||||
|
||||
The new field is optional and defaults to false.
|
||||
|
||||
## \[2.2.1]
|
||||
|
||||
- [`f634e524`](https://github.com/tauri-apps/plugins-workspace/commit/f634e5248ebe428f8305a59f74c13fc15147fb8e) This is an "empty" release to update the plugins' source files on crates.io and docs.rs. This should fix docs.rs build failures for projects using tauri plugins as dependencies.
|
||||
|
||||
## \[2.2.0]
|
||||
|
||||
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
@@ -85,10 +108,3 @@
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
te to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
ae67\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-cli"
|
||||
version = "2.0.0"
|
||||
version = "2.4.0"
|
||||
description = "Parse arguments from your Tauri application's command line interface."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
+2
-11
@@ -12,7 +12,7 @@ Parse arguments from your Command Line Interface.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
@@ -34,28 +34,19 @@ 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:
|
||||
|
||||
> 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
|
||||
pnpm add @tauri-apps/plugin-cli
|
||||
# or
|
||||
npm add @tauri-apps/plugin-cli
|
||||
# or
|
||||
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
|
||||
|
||||
First you need to register the core plugin with Tauri:
|
||||
|
||||
`src-tauri/src/main.rs`
|
||||
`src-tauri/src/lib.rs`
|
||||
|
||||
```rust
|
||||
fn main() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-cli",
|
||||
"version": "2.0.0",
|
||||
"version": "2.4.0",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
@@ -24,6 +24,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.0.0"
|
||||
"@tauri-apps/api": "^2.8.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
Allows reading the CLI matches
|
||||
|
||||
#### This default permission set includes the following:
|
||||
|
||||
- `allow-cli-matches`
|
||||
|
||||
## Permission Table
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
"minimum": 1.0
|
||||
},
|
||||
"description": {
|
||||
"description": "Human-readable description of what the permission does. Tauri convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
|
||||
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
@@ -111,7 +111,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "Human-readable description of what the permission does. Tauri internal convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
|
||||
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
@@ -297,17 +297,20 @@
|
||||
{
|
||||
"description": "Enables the cli_matches command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-cli-matches"
|
||||
"const": "allow-cli-matches",
|
||||
"markdownDescription": "Enables the cli_matches command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the cli_matches command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-cli-matches"
|
||||
"const": "deny-cli-matches",
|
||||
"markdownDescription": "Denies the cli_matches command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Allows reading the CLI matches",
|
||||
"description": "Allows reading the CLI matches\n#### This default permission set includes:\n\n- `allow-cli-matches`",
|
||||
"type": "string",
|
||||
"const": "default"
|
||||
"const": "default",
|
||||
"markdownDescription": "Allows reading the CLI matches\n#### This default permission set includes:\n\n- `allow-cli-matches`"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -114,6 +114,12 @@ pub struct Arg {
|
||||
/// It does not define position in the argument list as a whole. When utilized with multiple=true,
|
||||
/// only the last positional argument may be defined as multiple (i.e. the one with the highest index).
|
||||
pub index: Option<usize>,
|
||||
/// Specifies whether the argument should be global.
|
||||
///
|
||||
/// Global arguments are propagated to all subcommands automatically,
|
||||
/// making them available throughout the CLI regardless of where they are defined.
|
||||
#[serde(default)]
|
||||
pub global: bool,
|
||||
}
|
||||
|
||||
/// describes a CLI configuration
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//! [](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/cli)
|
||||
//!
|
||||
//! Parse arguments from your Command Line Interface.
|
||||
//!
|
||||
//! - Supported platforms: Windows, Linux and macOS.
|
||||
@@ -31,7 +29,11 @@ pub struct Cli<R: Runtime>(PluginApi<R, Config>);
|
||||
|
||||
impl<R: Runtime> Cli<R> {
|
||||
pub fn matches(&self) -> Result<parser::Matches> {
|
||||
parser::get_matches(self.0.config(), self.0.app().package_info())
|
||||
parser::get_matches(self.0.config(), self.0.app().package_info(), None)
|
||||
}
|
||||
|
||||
pub fn matches_from(&self, args: Vec<String>) -> Result<parser::Matches> {
|
||||
parser::get_matches(self.0.config(), self.0.app().package_info(), Some(args))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ use std::collections::HashMap;
|
||||
mod macros;
|
||||
|
||||
/// The resolution of a argument match.
|
||||
#[derive(Default, Debug, Serialize)]
|
||||
#[derive(Default, Debug, Serialize, Clone)]
|
||||
#[non_exhaustive]
|
||||
pub struct ArgData {
|
||||
/// - [`Value::Bool`] if it's a flag,
|
||||
@@ -33,7 +33,7 @@ pub struct ArgData {
|
||||
}
|
||||
|
||||
/// The matched subcommand.
|
||||
#[derive(Default, Debug, Serialize)]
|
||||
#[derive(Default, Debug, Serialize, Clone)]
|
||||
#[non_exhaustive]
|
||||
pub struct SubcommandMatches {
|
||||
/// The subcommand name.
|
||||
@@ -43,7 +43,7 @@ pub struct SubcommandMatches {
|
||||
}
|
||||
|
||||
/// The argument matches of a command.
|
||||
#[derive(Default, Debug, Serialize)]
|
||||
#[derive(Default, Debug, Serialize, Clone)]
|
||||
#[non_exhaustive]
|
||||
pub struct Matches {
|
||||
/// Data structure mapping each found arg with its resolution.
|
||||
@@ -79,7 +79,11 @@ impl Matches {
|
||||
/// Ok(())
|
||||
/// });
|
||||
/// ```
|
||||
pub fn get_matches(cli: &Config, package_info: &PackageInfo) -> crate::Result<Matches> {
|
||||
pub fn get_matches(
|
||||
cli: &Config,
|
||||
package_info: &PackageInfo,
|
||||
args: Option<Vec<String>>,
|
||||
) -> crate::Result<Matches> {
|
||||
let about = cli
|
||||
.description()
|
||||
.unwrap_or(&package_info.description.to_string())
|
||||
@@ -92,7 +96,14 @@ pub fn get_matches(cli: &Config, package_info: &PackageInfo) -> crate::Result<Ma
|
||||
Some(&about),
|
||||
cli,
|
||||
);
|
||||
match app.try_get_matches() {
|
||||
|
||||
let matches = if let Some(args) = args {
|
||||
app.try_get_matches_from(args)
|
||||
} else {
|
||||
app.try_get_matches()
|
||||
};
|
||||
|
||||
match matches {
|
||||
Ok(matches) => Ok(get_matches_internal(cli, &matches)),
|
||||
Err(e) => match e.kind() {
|
||||
ErrorKind::DisplayHelp => {
|
||||
@@ -278,5 +289,7 @@ fn get_arg(arg_name: String, arg: &Arg) -> ClapArg {
|
||||
clap_arg = bind_value_arg!(arg, clap_arg, require_equals);
|
||||
clap_arg = bind_value_arg!(arg, clap_arg, index);
|
||||
|
||||
clap_arg = clap_arg.global(arg.global);
|
||||
|
||||
clap_arg
|
||||
}
|
||||
|
||||
@@ -1,5 +1,39 @@
|
||||
# Changelog
|
||||
|
||||
## \[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
|
||||
|
||||
## \[2.2.3]
|
||||
|
||||
- [`f634e524`](https://github.com/tauri-apps/plugins-workspace/commit/f634e5248ebe428f8305a59f74c13fc15147fb8e) This is an "empty" release to update the plugins' source files on crates.io and docs.rs. This should fix docs.rs build failures for projects using tauri plugins as dependencies.
|
||||
|
||||
## \[2.2.2]
|
||||
|
||||
### bug
|
||||
|
||||
- [`d37bbdef`](https://github.com/tauri-apps/plugins-workspace/commit/d37bbdef8dc70e61e59f9fe0bb8b2a48999d0aa1) ([#2507](https://github.com/tauri-apps/plugins-workspace/pull/2507) by [@SquitchYT](https://github.com/tauri-apps/plugins-workspace/../../SquitchYT)) Fix clipboard-manager Wayland support.
|
||||
|
||||
## \[2.2.1]
|
||||
|
||||
- [`ce11079f`](https://github.com/tauri-apps/plugins-workspace/commit/ce11079f19852fbefdecf0e4c7d947af3624fee0) ([#2280](https://github.com/tauri-apps/plugins-workspace/pull/2280) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Explicitly drop `arboard::Clipboard` on exit. Add recommendation to not use read methods on the mainthread.
|
||||
|
||||
## \[2.2.0]
|
||||
|
||||
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`3fa0fc09`](https://github.com/tauri-apps/plugins-workspace/commit/3fa0fc09bbee0d619801e5757af9fb3c09883c97) ([#2099](https://github.com/tauri-apps/plugins-workspace/pull/2099) by [@rasteiner](https://github.com/tauri-apps/plugins-workspace/../../rasteiner)) Fix clipboard manager client side api not copying fallback alternative text when calling `writeHtml`.
|
||||
|
||||
## \[2.0.2]
|
||||
|
||||
- [`d57df4de`](https://github.com/tauri-apps/plugins-workspace/commit/d57df4debe7c75cfbd6d6558fff1beb07dbee54c) ([#1986](https://github.com/tauri-apps/plugins-workspace/pull/1986) by [@RikaKagurasaka](https://github.com/tauri-apps/plugins-workspace/../../RikaKagurasaka)) Fix that `read_image` wrongly set the image rgba data with binary PNG data.
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
@@ -104,38 +138,3 @@
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
te to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
te to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
hub.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
\`]\(https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
te to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
te to alpha.11.
|
||||
|
||||
## \[2.0.0-alpha.0]
|
||||
|
||||
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
!
|
||||
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
ps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
!
|
||||
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
om/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-clipboard-manager"
|
||||
version = "2.0.0"
|
||||
version = "2.3.0"
|
||||
description = "Read and write to the system clipboard."
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
@@ -36,5 +36,4 @@ thiserror = { workspace = true }
|
||||
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]
|
||||
arboard = "3"
|
||||
image = "0.25"
|
||||
arboard = { version = "3", features = ["wayland-data-control"] }
|
||||
|
||||
@@ -12,7 +12,7 @@ Read and write to the system clipboard.
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.78**_
|
||||
_This plugin requires a Rust version of at least **1.77.2**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
@@ -33,28 +33,19 @@ tauri-plugin-clipboard-manager = { git = "https://github.com/tauri-apps/plugins-
|
||||
|
||||
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
|
||||
pnpm add @tauri-apps/plugin-clipboard-manager
|
||||
# or
|
||||
npm add @tauri-apps/plugin-clipboard-manager
|
||||
# or
|
||||
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
|
||||
|
||||
First you need to register the core plugin with Tauri:
|
||||
|
||||
`src-tauri/src/main.rs`
|
||||
`src-tauri/src/lib.rs`
|
||||
|
||||
```rust
|
||||
fn main() {
|
||||
@@ -72,7 +63,6 @@ import {
|
||||
writeText,
|
||||
readText,
|
||||
writeHtml,
|
||||
readHtml,
|
||||
clear
|
||||
} from '@tauri-apps/plugin-clipboard-manager'
|
||||
await writeText('Tauri is awesome!')
|
||||
|
||||
@@ -1 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARD_MANAGER__=function(e){"use strict";var t;async function r(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}"function"==typeof SuppressedError&&SuppressedError;class n{get rid(){return function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,r,n,a){if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");t.set(e,r)}(this,t,e)}async close(){return r("plugin:resources|close",{rid:this.rid})}}t=new WeakMap;class a extends n{constructor(e){super(e)}static async new(e,t,n){return r("plugin:image|new",{rgba:i(e),width:t,height:n}).then((e=>new a(e)))}static async fromBytes(e){return r("plugin:image|from_bytes",{bytes:i(e)}).then((e=>new a(e)))}static async fromPath(e){return r("plugin:image|from_path",{path:e}).then((e=>new a(e)))}async rgba(){return r("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return r("plugin:image|size",{rid:this.rid})}}function i(e){return null==e?null:"string"==typeof e?e:e instanceof a?e.rid:e}return e.clear=async function(){await r("plugin:clipboard-manager|clear")},e.readImage=async function(){return await r("plugin:clipboard-manager|read_image").then((e=>new a(e)))},e.readText=async function(){return await r("plugin:clipboard-manager|read_text")},e.writeHtml=async function(e,t){await r("plugin:clipboard-manager|write_html",{html:e,altHtml:t})},e.writeImage=async function(e){await r("plugin:clipboard-manager|write_image",{image:i(e)})},e.writeText=async function(e,t){await r("plugin:clipboard-manager|write_text",{label:t?.label,text:e})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARD_MANAGER__})}
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARD_MANAGER__=function(e){"use strict";var n;async function t(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}"function"==typeof SuppressedError&&SuppressedError;class r{get rid(){return function(e,n,t,r){if("function"==typeof n?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?r:"a"===t?r.call(e):r?r.value:n.get(e)}(this,n,"f")}constructor(e){n.set(this,void 0),function(e,n,t){if("function"==typeof n||!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");n.set(e,t)}(this,n,e)}async close(){return t("plugin:resources|close",{rid:this.rid})}}n=new WeakMap;class a extends r{constructor(e){super(e)}static async new(e,n,r){return t("plugin:image|new",{rgba:i(e),width:n,height:r}).then((e=>new a(e)))}static async fromBytes(e){return t("plugin:image|from_bytes",{bytes:i(e)}).then((e=>new a(e)))}static async fromPath(e){return t("plugin:image|from_path",{path:e}).then((e=>new a(e)))}async rgba(){return t("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return t("plugin:image|size",{rid:this.rid})}}function i(e){return null==e?null:"string"==typeof e?e:e instanceof a?e.rid:e}return e.clear=async function(){await t("plugin:clipboard-manager|clear")},e.readImage=async function(){return await t("plugin:clipboard-manager|read_image").then((e=>new a(e)))},e.readText=async function(){return await t("plugin:clipboard-manager|read_text")},e.writeHtml=async function(e,n){await t("plugin:clipboard-manager|write_html",{html:e,altText:n})},e.writeImage=async function(e){await t("plugin:clipboard-manager|write_image",{image:i(e)})},e.writeText=async function(e,n){await t("plugin:clipboard-manager|write_text",{label:n?.label,text:e})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARD_MANAGER__})}
|
||||
|
||||
@@ -65,6 +65,7 @@ async function readText(): Promise<string> {
|
||||
* 0, 255, 0, 255,
|
||||
* ];
|
||||
* await writeImage(buffer);
|
||||
* ```
|
||||
*
|
||||
* @returns A promise indicating the success or failure of the operation.
|
||||
*
|
||||
@@ -90,7 +91,7 @@ async function writeImage(
|
||||
* import { readImage } from '@tauri-apps/plugin-clipboard-manager';
|
||||
*
|
||||
* const clipboardImage = await readImage();
|
||||
* const blob = new Blob([clipboardImage.bytes], { type: 'image' })
|
||||
* const blob = new Blob([await clipboardImage.rgba()], { type: 'image' })
|
||||
* const url = URL.createObjectURL(blob)
|
||||
* ```
|
||||
* @since 2.0.0
|
||||
@@ -110,9 +111,11 @@ async function readImage(): Promise<Image> {
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { writeHtml, readHtml } from '@tauri-apps/plugin-clipboard-manager';
|
||||
* import { writeHtml } from '@tauri-apps/plugin-clipboard-manager';
|
||||
* await writeHtml('<h1>Tauri is awesome!</h1>', 'plaintext');
|
||||
* await writeHtml('<h1>Tauri is awesome!</h1>', '<h1>Tauri is awesome</h1>'); // Will write "<h1>Tauri is awesome</h1>" as plain text
|
||||
* // The following will write "<h1>Tauri is awesome</h1>" as plain text
|
||||
* await writeHtml('<h1>Tauri is awesome!</h1>', '<h1>Tauri is awesome</h1>');
|
||||
* // we can read html data only as a string so there's just readText(), no readHtml()
|
||||
* assert(await readText(), '<h1>Tauri is awesome!</h1>');
|
||||
* ```
|
||||
*
|
||||
@@ -120,10 +123,10 @@ async function readImage(): Promise<Image> {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function writeHtml(html: string, altHtml?: string): Promise<void> {
|
||||
async function writeHtml(html: string, altText?: string): Promise<void> {
|
||||
await invoke('plugin:clipboard-manager|write_html', {
|
||||
html,
|
||||
altHtml
|
||||
altText
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tauri-apps/plugin-clipboard-manager",
|
||||
"version": "2.0.0",
|
||||
"version": "2.3.0",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"authors": [
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
@@ -24,6 +24,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.0.0"
|
||||
"@tauri-apps/api": "^2.8.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ application specific if read and/or write access is needed.
|
||||
|
||||
Clipboard interaction needs to be explicitly enabled.
|
||||
|
||||
|
||||
|
||||
## Permission Table
|
||||
|
||||
<table>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
"minimum": 1.0
|
||||
},
|
||||
"description": {
|
||||
"description": "Human-readable description of what the permission does. Tauri convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
|
||||
"description": "Human-readable description of what the permission does. Tauri convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
@@ -111,7 +111,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "Human-readable description of what the permission does. Tauri internal convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
|
||||
"description": "Human-readable description of what the permission does. Tauri internal convention is to use `<h4>` headings in markdown content for Tauri documentation generation purposes.",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
@@ -297,67 +297,80 @@
|
||||
{
|
||||
"description": "Enables the clear command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-clear"
|
||||
"const": "allow-clear",
|
||||
"markdownDescription": "Enables the clear command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the clear command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-clear"
|
||||
"const": "deny-clear",
|
||||
"markdownDescription": "Denies the clear command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the read_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-read-image"
|
||||
"const": "allow-read-image",
|
||||
"markdownDescription": "Enables the read_image command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the read_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-read-image"
|
||||
"const": "deny-read-image",
|
||||
"markdownDescription": "Denies the read_image command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the read_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-read-text"
|
||||
"const": "allow-read-text",
|
||||
"markdownDescription": "Enables the read_text command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the read_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-read-text"
|
||||
"const": "deny-read-text",
|
||||
"markdownDescription": "Denies the read_text command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the write_html command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-write-html"
|
||||
"const": "allow-write-html",
|
||||
"markdownDescription": "Enables the write_html command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the write_html command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-write-html"
|
||||
"const": "deny-write-html",
|
||||
"markdownDescription": "Denies the write_html command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the write_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-write-image"
|
||||
"const": "allow-write-image",
|
||||
"markdownDescription": "Enables the write_image command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the write_image command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-write-image"
|
||||
"const": "deny-write-image",
|
||||
"markdownDescription": "Denies the write_image command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the write_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "allow-write-text"
|
||||
"const": "allow-write-text",
|
||||
"markdownDescription": "Enables the write_text command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the write_text command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "deny-write-text"
|
||||
"const": "deny-write-text",
|
||||
"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",
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use arboard::ImageData;
|
||||
use image::ImageEncoder;
|
||||
use serde::de::DeserializeOwned;
|
||||
use tauri::{image::Image, plugin::PluginApi, AppHandle, Runtime};
|
||||
|
||||
@@ -15,7 +14,7 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
|
||||
) -> crate::Result<Clipboard<R>> {
|
||||
Ok(Clipboard {
|
||||
app: app.clone(),
|
||||
clipboard: arboard::Clipboard::new().map(Mutex::new),
|
||||
clipboard: arboard::Clipboard::new().map(|c| Mutex::new(Some(c))),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -23,13 +22,21 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
|
||||
pub struct Clipboard<R: Runtime> {
|
||||
#[allow(dead_code)]
|
||||
app: AppHandle<R>,
|
||||
clipboard: Result<Mutex<arboard::Clipboard>, arboard::Error>,
|
||||
// According to arboard docs the clipboard must be dropped before exit.
|
||||
// Since tauri doesn't call drop on exit we'll use an Option to take() on RunEvent::Exit.
|
||||
clipboard: Result<Mutex<Option<arboard::Clipboard>>, arboard::Error>,
|
||||
}
|
||||
|
||||
impl<R: Runtime> Clipboard<R> {
|
||||
pub fn write_text<'a, T: Into<Cow<'a, str>>>(&self, text: T) -> crate::Result<()> {
|
||||
match &self.clipboard {
|
||||
Ok(clipboard) => clipboard.lock().unwrap().set_text(text).map_err(Into::into),
|
||||
Ok(clipboard) => clipboard
|
||||
.lock()
|
||||
.unwrap()
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.set_text(text)
|
||||
.map_err(Into::into),
|
||||
Err(e) => Err(crate::Error::Clipboard(e.to_string())),
|
||||
}
|
||||
}
|
||||
@@ -39,6 +46,8 @@ impl<R: Runtime> Clipboard<R> {
|
||||
Ok(clipboard) => clipboard
|
||||
.lock()
|
||||
.unwrap()
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.set_image(ImageData {
|
||||
bytes: Cow::Borrowed(image.rgba()),
|
||||
width: image.width() as usize,
|
||||
@@ -49,10 +58,11 @@ impl<R: Runtime> Clipboard<R> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Warning: This method should not be used on the main thread! Otherwise the underlying libraries may deadlock on Linux, freezing the whole app, when trying to copy data copied from this app, for example if the user copies text from the WebView.
|
||||
pub fn read_text(&self) -> crate::Result<String> {
|
||||
match &self.clipboard {
|
||||
Ok(clipboard) => {
|
||||
let text = clipboard.lock().unwrap().get_text()?;
|
||||
let text = clipboard.lock().unwrap().as_mut().unwrap().get_text()?;
|
||||
Ok(text)
|
||||
}
|
||||
Err(e) => Err(crate::Error::Clipboard(e.to_string())),
|
||||
@@ -68,6 +78,8 @@ impl<R: Runtime> Clipboard<R> {
|
||||
Ok(clipboard) => clipboard
|
||||
.lock()
|
||||
.unwrap()
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.set_html(html, alt_text)
|
||||
.map_err(Into::into),
|
||||
Err(e) => Err(crate::Error::Clipboard(e.to_string())),
|
||||
@@ -76,28 +88,36 @@ impl<R: Runtime> Clipboard<R> {
|
||||
|
||||
pub fn clear(&self) -> crate::Result<()> {
|
||||
match &self.clipboard {
|
||||
Ok(clipboard) => clipboard.lock().unwrap().clear().map_err(Into::into),
|
||||
Ok(clipboard) => clipboard
|
||||
.lock()
|
||||
.unwrap()
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.clear()
|
||||
.map_err(Into::into),
|
||||
Err(e) => Err(crate::Error::Clipboard(e.to_string())),
|
||||
}
|
||||
}
|
||||
|
||||
/// Warning: This method should not be used on the main thread! Otherwise the underlying libraries may deadlock on Linux, freezing the whole app, when trying to copy data copied from this app, for example if the user copies text from the WebView.
|
||||
pub fn read_image(&self) -> crate::Result<Image<'_>> {
|
||||
match &self.clipboard {
|
||||
Ok(clipboard) => {
|
||||
let image = clipboard.lock().unwrap().get_image()?;
|
||||
|
||||
let mut buffer: Vec<u8> = Vec::new();
|
||||
image::codecs::png::PngEncoder::new(&mut buffer).write_image(
|
||||
&image.bytes,
|
||||
let image = clipboard.lock().unwrap().as_mut().unwrap().get_image()?;
|
||||
let image = Image::new_owned(
|
||||
image.bytes.to_vec(),
|
||||
image.width as u32,
|
||||
image.height as u32,
|
||||
image::ExtendedColorType::Rgba8,
|
||||
)?;
|
||||
|
||||
let image = Image::new_owned(buffer, image.width as u32, image.height as u32);
|
||||
);
|
||||
Ok(image)
|
||||
}
|
||||
Err(e) => Err(crate::Error::Clipboard(e.to_string())),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn cleanup(&self) {
|
||||
if let Ok(clipboard) = &self.clipboard {
|
||||
clipboard.lock().unwrap().take();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,6 @@ pub enum Error {
|
||||
Clipboard(String),
|
||||
#[error(transparent)]
|
||||
Tauri(#[from] tauri::Error),
|
||||
#[cfg(desktop)]
|
||||
#[error("invalid image: {0}")]
|
||||
Image(#[from] image::ImageError),
|
||||
}
|
||||
|
||||
impl Serialize for Error {
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//! [](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/clipboard-manager)
|
||||
//!
|
||||
//! Read and write to the system clipboard.
|
||||
|
||||
#![doc(
|
||||
@@ -13,7 +11,7 @@
|
||||
|
||||
use tauri::{
|
||||
plugin::{Builder, TauriPlugin},
|
||||
Manager, Runtime,
|
||||
Manager, RunEvent, Runtime,
|
||||
};
|
||||
|
||||
#[cfg(desktop)]
|
||||
@@ -61,5 +59,11 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
app.manage(clipboard);
|
||||
Ok(())
|
||||
})
|
||||
.on_event(|_app, _event| {
|
||||
#[cfg(desktop)]
|
||||
if let RunEvent::Exit = _event {
|
||||
_app.clipboard().cleanup();
|
||||
}
|
||||
})
|
||||
.build()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,42 @@
|
||||
# Changelog
|
||||
|
||||
## \[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]
|
||||
|
||||
- [`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.0]
|
||||
|
||||
- [`4d10acee`](https://github.com/tauri-apps/plugins-workspace/commit/4d10acee61bad8045705508121424ed5f2d381f6) ([#993](https://github.com/tauri-apps/plugins-workspace/pull/993) by [@m00nwtchr](https://github.com/tauri-apps/plugins-workspace/../../m00nwtchr)) Exposed Android's `path`, `pathPattern` and `pathSuffix` configurations.
|
||||
- [`4d10acee`](https://github.com/tauri-apps/plugins-workspace/commit/4d10acee61bad8045705508121424ed5f2d381f6) ([#993](https://github.com/tauri-apps/plugins-workspace/pull/993) by [@m00nwtchr](https://github.com/tauri-apps/plugins-workspace/../../m00nwtchr)) Added a `scheme` configuration to set a scheme other than http/https. This is only supported on Android and will still default to http,https if not set.
|
||||
|
||||
## \[2.2.1]
|
||||
|
||||
### bug
|
||||
|
||||
- [`38deef43`](https://github.com/tauri-apps/plugins-workspace/commit/38deef43dca9d5a09a38ed2da45b0f86c6afa1c5) ([#2483](https://github.com/tauri-apps/plugins-workspace/pull/2483)) Fix `is_registered` not being able to pickup deep link registered in `HKEY_LOCAL_MACHINE` on Windows
|
||||
- [`38deef43`](https://github.com/tauri-apps/plugins-workspace/commit/38deef43dca9d5a09a38ed2da45b0f86c6afa1c5) ([#2483](https://github.com/tauri-apps/plugins-workspace/pull/2483)) Fix `unregister` not being able to remove deep link registered in `HKEY_LOCAL_MACHINE` on Windows
|
||||
|
||||
## \[2.2.0]
|
||||
|
||||
- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`b2aea045`](https://github.com/tauri-apps/plugins-workspace/commit/b2aea0456799775a7243706fdd7a5abf9a193992) ([#2008](https://github.com/tauri-apps/plugins-workspace/pull/2008) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) `onOpenUrl()` will now not call `getCurrent()` anymore, matching the documented behavior.
|
||||
|
||||
## \[2.0.1]
|
||||
|
||||
- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
|
||||
|
||||
## \[2.0.0]
|
||||
|
||||
- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user