* feat(dialog) - Support fileAccessMode for open dialog (#3030)
On iOS, when trying to access a file that exists outside of the app sandbox, one of 2 things need to happen to be able to perform any operations on said file:
* A copy of the file needs to be made to the internal app sandbox
* The method startAccessingSecurityScopedResource needs to be called.
Previously, a copy of the file was always being made when a file was selected through the picker dialog.
While this did ensure there were no file access exceptions when reading from the file, it does not scale well for large files.
To resolve this, we now support `fileAccessMode`, which allows a file handle to be returned without copying the file to the app sandbox.
This MR only supports this change for iOS; MacOS has a different set of needs for security scoped resources.
See discussion in #3716 for more discussion of the difference between iOS and MacOS.
See MR #3185 to see how these scoped files will be accessible using security scoping.
* fmt, clippy
* use enum
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* fix(updater): format `Update.date` to RFC 3339
* Messed up on argument in #2572
* Format
* Update example
* Avoid extra to_string
* Deprecate `Update.available`
* refactor(store): more reworks
* Enable auto save by default
* Store to resource table by default
* Remove share store
* Clean up
* Add close store
* Add store function
* Add lazy store
* Add init to lazy store
* refresh cache in example
* Add get-or-create-store
* Revert "Add get-or-create-store"
This reverts commit 7ffd769240.
* try get first
* Docs
* Use absolute path for store
* more docs
* Allow js to use pre-stored (de)serialize functions
* Fix js get and close store
* Show case how to use pretty json
* Update readme
* Use store instead of `store_builder` in example
* Build
* Fix example
* More docs for StoreBuilder::build
* Add default (de)serialize fn
* Use pretty json by default
* Use `undefined` for empty value in get
* Change files
* Differentiate json null from no value for events
* Add create or existing
* Build
* Rename inner store's inset method to set
* Update readme
* Apply suggestions from code review
* Use close instead
* Update breaking changes
* Return result in resolve_store_path
* Change to close_resource and take &self
* Clean up
* Apply suggestions from code review
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
* Remove unused pub(crate)
* Update change file
* Expose resolve_store_path
* Remove with_store
* Remove StoreInner from pub and expose is_empty
* Fix wrong jsdoc param
* Update readme
* rename createOrExistingStore to createOrLoad
* make api consistent with the JS implementation, add examples
* fmt
* reintroduce "get existing store" behavior for create_or_load
* rename createOrLoad to newOrExisting
* keep store lock throughout whole new_or_existing_inner
* Remove load
* Missed if load
* Don't make StoreState public
* Remove R: Runtime from Builder
* rename newOrExisting to load, load to reload
* update docs
* rename missing reload fn
* rename builder fn to build()
* fix default permission
* Fix description and create_new logic
* Clippy
* Update docs
* Update docs
* remove create_store command
* remove close_store command since we extend from Resource
* Revert "remove close_store command since we extend from Resource"
This reverts commit 4a29fc8990.
* Reapply "remove close_store command since we extend from Resource"
This reverts commit 70a1830e7d.
---------
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* chore: adjust prettier config, .gitignore and use taplo to format toml files
This brings the plugins-workspace repository to the same code style of the main tauri repo
* format toml
* ignore examples gen dir
* add .vscode/extensions.json
* remove packageManager field
* fmt
* fix audit
* taplo ignore permissions autogenerated files
* remove create dummy dist
* fix prettier workflow
* install fmt in prettier workflow
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
The Android and iOS support introduced on #1011 is not really supported - the Tauri path API correctly resolves the cache directory on mobile, and we can access those directly using Rust code.
This is a breaking change because we no longer uses the same directory to store the files - app_cache_dir returns a different location
* Add support for notify-debouncer-full
* Add fs watch to demo
* Remove notify-debouncer-mini
* Rename RawEvent to WatchEvent
* Add full type definition for EventKind
* Remove `track file ids` option from fs watcher
* Update plugins/fs/guest-js/index.ts
* feat(fs): improved API
* fmt
* fix unix builds
* again
* clippy
* clippy
* fix import in docs examples
* fmt, clippy
* Update linux.rs
* add API for watch
* fix with `watcher` feature flag
* use baseDir for all commands
* do not export close function
* fix build
* organize and address review comments
* fmt
* generated files
* rename FsFile to FileHandle, move APIs and docs
* extend example
* extend `Resource`
* actually extend it
---------
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>