Commit Graph

1552 Commits

Author SHA1 Message Date
Lucas Fernandes Nogueira
791e291a9f
fix(build): ignore changes on autogenerated files (#8736) 2024-02-02 20:55:27 -03:00
Amr Bashir
e8d3793c3c
feat(tauri-build): add config-json feature flag (#8732)
* feat(tauri-build): add `config-json` feature flag

This allows disabling rebuilding when `tauri.conf.json` when using another config format

see https://github.com/tauri-apps/tauri/issues/8721

* document feature flag

* Update .changes/tauri-build-config-json.md [skip ci]

* Update core/tauri/src/lib.rs [skip ci]

* disable default features for tauri-build on tauri, plugins

* fmt

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2024-02-02 14:11:59 -03:00
Jingyu
95da1a2747
fix(core): macos #5122 app.runtime panic in app.set_activation_policy (#8713)
* fix #5122 app.runtime panic in set_activation_policy

* allow setting the policy at runtime

* add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-02-02 09:40:10 -03:00
Lucas Fernandes Nogueira
a35b416e38
refactor(core): merge scope and commands resolving permission sets (#8731) 2024-02-02 09:18:59 -03:00
Lucas Fernandes Nogueira
3e5c28ff4f
feat(tauri-plugin): generate permissions reference markdown file for plugin (#8729)
* feat(acl): generate reference markdown file

* lint

* generate plugin docs instead
2024-02-01 17:14:23 -03:00
Lucas Fernandes Nogueira
7315189e76
chore: preserve order on schemas (#8724) 2024-02-01 09:16:10 -03:00
time-river
6639a579c7
feat(core): add support to setting a webview proxy, closes #4263 (#8441)
* feat(wry): support proxy in wry runtime

wry has been supported http/socks5 proxy in
[#1006](https://github.com/tauri-apps/wry/pull/1006), which has been
merged in [commit
3cc4d79](3cc4d79843).

This patch aims to support its feature.

Signed-off-by: lin fu <river@vvl.me>

* Apply suggestions from code review

* Apply suggestions from code review

* Update core/tauri-runtime-wry/src/lib.rs

* Update core/tauri/src/window/mod.rs

* add macos-proxy flag

* add change file

* delete file

* update change file

* use macos-14 runner to test core

---------

Signed-off-by: lin fu <river@vvl.me>
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-02-01 08:53:32 -03:00
Amr Bashir
a093682d2d
refactor(core): refactor and fix event system following multiwebview support (#8621)
* clippy

* refactor(core): refactor and fix event system following multiwebview support

* update documentation

* update js docs

* lint

* clippy

* update multiwindow example [skip ci]

* enhance event tests

* fix example

* Update .changes/tauri-event-after-multiwebview.md

Co-authored-by: Lucas Nogueira <118899497+lucasfernog-crabnebula@users.noreply.github.com>

* fix tests

* add diagram

* Add `App/AppHandle` even target

* Discard changes to examples/api/src-tauri/tauri-plugin-sample/permissions/schemas/schema.json

* revert accidental changes

* regenerate schemas

* fix doctests

* add helper methods

* update docs

* update api

* update docs [skip ci]

* update docs [skip ci]

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Nogueira <118899497+lucasfernog-crabnebula@users.noreply.github.com>
2024-02-01 08:06:27 -03:00
Naman Garg
d6c7568c27
feat(bundler): Add files option to the AppImage Configuration. (#8720)
* Add `files` option to Appimage

* Add .changes file
2024-02-01 02:53:26 +02:00
Lucas Fernandes Nogueira
af61023273
refactor(core)!: Window::close triggers RunEvent::CloseRequested (#8710)
* refactor(core): Window::close triggers RunEvent::CloseRequested

* Update .changes/runtime-wry-window-close-event.md

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>

* add destroy [skip ci]

* change files

* delete files

* fix tests

* fix tests

* fix test impl of the close flow

* fmt

* build bundle

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2024-01-31 14:54:49 -03:00
Lucas Fernandes Nogueira
aa758a850f
refactor(core): delete the command module (#8716) 2024-01-31 14:02:52 -03:00
Amr Bashir
9eaeb5a8cd
refactor: refactor parent APIs on WindowBuilder (#8622)
* refactor: refactor parent APIs on `WindowBuilder`

closes #8587 #1643

* fix build

* clippy

* support parent in JS and config

* change files

* fix build

* clippy

* fix doctests

* fix linux build

* fix doctests

* update docs

* fix api, update example to use JS API

* fix merge

* lint

* fix tests on windows

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2024-01-31 13:59:14 -03:00
Amr Bashir
a2fc3a6357
feat(api/window): add visible-on-all-workspaces, closes #8652 (#8657)
* feat(api/window): add visible-on-all-worksapces, closes #8652

* fix build and generate schema

* Update .changes/api-set-visible-on-all-workspaces.md

* revert permissions

* fix alias

* revert set_icon change

* add missing permission

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2024-01-31 12:36:39 -03:00
Amr Bashir
e1eb911f5e
fix(menu): ensure init & drop is done on main thread (#8582)
* fix(menu): ensure init & drop is done on main thread

* move macros back

* fix doctests

* fix macos doctests

* generate inner types and add drop implementation on inner

* clippy

* fix leftoever merge conflicts

* fix doctests

* update api example

* add missing change file

* move macro

* fix tray import

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2024-01-31 12:01:05 -03:00
Amr Bashir
58fe2e812a
fix: improvements and ipc fixes for loading window content using custom protocol (#8670)
* fix: improvements and ipc fixes for loading window content using custom protocol

closes #5478

* Discard changes to tooling/cli/Cargo.lock

* clippy

* fix tests

* typo

* fix webviewurl deserialize

* resolve todo, fixes

* fmt

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2024-01-31 09:38:25 -03:00
Lucas Fernandes Nogueira
00e1567584
refactor(core): exit() and restart() triggers ExitRequested and Exit (#8708)
* refactor(core): exit() and restart() triggers ExitRequested and Exit

* update docs

* update doc
2024-01-30 12:10:22 -03:00
Lucas Fernandes Nogueira
9af90ca7f3
feat(ipc): improve error message when plugin command is not allowed (#8681)
* feat(ipc): improve error message when plugin command is not allowed

* reuse literal_struct macro
2024-01-30 16:54:10 +02:00
Fabian-Lars
38b8e67237
feat: Add support for deep links (#8680)
* initial windows impl

* macos

* adapt windows impl to config changes for macos

* debian

* add missing x-scheme-handler prefix

* bundle xdg-mime

* typo

* revert messed up fmt

* rm pnpm lock

* rm todo

* Update core/tauri-utils/src/config.rs

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>

* Update core/tauri-utils/src/config.rs

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>

* &Option<> -> Option<&>

* DL0 -> R7

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2024-01-29 18:59:45 +02:00
Lucas Fernandes Nogueira
57e3d43d96
feat(acl): generate schema for scope (#8690)
* feat(acl): generate schema for scope

* allow plugin to define its global scope schema

* refactor to use schemas folder instead of individual files

* change signature

* delete .schema.json files
2024-01-29 13:36:31 -03:00
Lucas Fernandes Nogueira
f998fa0ec2
refactor(core): allow scope deserialization to run setup code (#8699)
* refactor(core): allow scope deserialization to run setup code

* Update core/tauri/src/command/authority.rs

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2024-01-29 13:31:03 -03:00
Lucas Fernandes Nogueira
11de49788a
feat(cli): migrate allowlist scope (#8698)
* feat(cli): migrate allowlist scope

* fix tests

* lint

* fix totokens impl
2024-01-29 12:50:21 -03:00
Lucas Fernandes Nogueira
2631e97e2b
fix(acl): command scope should not error out if missing (#8675)
* fix(acl): command scope should not error out if missing

* propagate error
2024-01-29 11:39:56 -03:00
Lucas Fernandes Nogueira
ec9818accb
refactor(core)!: App::run_iteration improvements (#8696)
* refactor(core): App::run_iteration improvements

* lint

* fixes

* fix exit

* Apply suggestions from code review

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

* update cargo.toml

* booooool

* fix mock runtime

* fix doctests

* fix doctest againrrrr

---------

Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
2024-01-29 10:52:44 -03:00
Lucas Fernandes Nogueira
d70470f868
feat(build): save ACL metadata (#8678)
* feat(build): save ACL metadata

metadata will be read by the CLI later to show the user what has been enabled and what can be done

* lint

* fix cli
2024-01-25 15:33:36 -03:00
AuTa
5e1ae87c0c
fix(core/window): set window_effects from config (#8677)
Signed-off-by: AuTa <auta520@live.com>
2024-01-25 14:07:39 +01:00
Lucas Fernandes Nogueira
fd4bf94d4c
refactor(acl): allow extending scope on the capability file (#8674) 2024-01-24 23:36:07 -03:00
Amr Bashir
734d78f736
fix: generate $schema field always with forward slash (#8673) 2024-01-24 21:57:41 -03:00
Lucas Fernandes Nogueira
049ca2d54f
fix(examples): deadlock on api example unit test (#8671) 2024-01-24 21:52:28 -03:00
Lucas Fernandes Nogueira
30a64a9cda
refactor: global scope error handling, fix usage with multiple plugins (#8669)
* refactor: global scope error handling, fix usage with multiple plugins

* lint
2024-01-24 20:57:46 -03:00
Lucas Fernandes Nogueira
4ca0932572
chore(plugin): use BTreeMap on plugin permission map (#8668) 2024-01-24 20:53:47 -03:00
Lucas Fernandes Nogueira
c77b40324e
refactor(core): add support to multiple webviews on a Tauri window (#8280)
* feat: update to latest wry

* wry dev branch [skip ci]

* fix linux [skip ci]

* refactor(runtime): split webview and window types

* split dispatch

* implement create_webview

* move webview message

* wip webview mod

* create webview manager, finish webview struct and builder

* fix tests and docs

* rename WindowUrl to WebviewUrl

* update examples

* event refactor

* update JS API

* fix events

* update example

* add WebviewWindow class on JS

* fix macos build

* allow creating window+webview on the same runtime call

* rename tauri://window-created to tauri://webview-created

* Window::add_child

* use inner_size from webview on macOS

* add multiwebview example

* automatically resize webviews on window resize

* fix tests

* set_position, set_size

* position, size getters

* set_focus

* add close fn

* update mock runtime

* lint [skip ci]

* fix inner_size getter [skip ci]

* import hwnd [skip ci]

* update webview bound ratios on set_size/set_position

* add auto_resize option

* fix android

* fix build on windows

* typo

* with_webview isnt desktop only

* add WebviewWindow rust struct (and builder)

* fix build on android

* license header

* fix macos/windows

* fix macos build

* resolve todo

* handle window not found

* hide unstable features

* document unstable feature [skip ci]

* webview plugin permissions

* hide more stuff

* fix doctests

* typos

* add change files

* fix examples

* rename hook
2024-01-24 11:05:18 -03:00
Lucas Fernandes Nogueira
74a2a6036a
chore: add change files for #8428 (#8661) 2024-01-23 13:19:51 -03:00
tweidinger
3c2f79f6f3
Tauri ACL/Allowlist v2 Implementation and Plugin System Refactor (#8428)
* tauri-plugin concept

* wip

* move command module to its own directory

* wip: new command traits and generated code

* wip: whip

* wip: static dispatch

there is a man standing behind me

* wip

* re-add authority

* fix build [skip ci]

* parse plugin permissions

* merge permission files [skip ci]

* parse capabilities [skip ci]

* resolve acl (untested) [skip ci]

* split functionality, add some docs

* remove command2 stuff

* actually check runtime authority

* small fixes [skip ci]

* add function to auto generate basic permission for a command [skip ci]

* retrieve command scope, implement CommandArg [skip ci]

* fix tests [skip ci]

* global scope

* lint

* license headers [skip ci]

* skip canonicalize

* separate scope type in example

* remove inlinedpermission struct [skip ci]

* permission file schema

* capabilities schema

* move items from tauri-plugin to tauri-utils

this allows tauri-plugin to depend on tauri directly again
which will be used by the runtime feature as a superset to
existing plugin traits

* enable schema and glob [skip ci]

* fix glob [skip ci]

* fix capability schema [skip ci]

* enhance schema for permission set possible values [skip ci]

* permission set can reference other sets [skip ci]

* setup tests for resolving ACL

* fixture for permission set [skip ci]

* remote context test and small fix[skip ci]

* ignore empty scope [skip ci]

* code review [skip ci]

* lint [skip ci]

* runtime fixes

* readd schema feature on tauri-config-schema [skip ci]

* remove plugin example from workspace, it breaks workspace features resolution [skip ci]

* scope as array, add test [skip ci]

* accept new shapshot [skip ci]

* core plugin permissions, default is now a set

* license headers

* fix  on windows

* update global api

* glob is no longer optional on tauri-utils

* add missing permissions on api example [skip ci]

* remove ipc scope and dangerous remote access config

* lint

* fix asset scope usage

* create out dir [skip ci]

* reuse cargo_pkg_name [skip ci]

* capability window glob pattern [skip ci]

* add platforms for capability [skip ci]

* per platform schema [skip ci]

* lint [skip ci]

* rename allowlist build mod [skip ci]

* check restricted visibility

* simplify capability target [skip ci]

* hide codegen build behind tauri-build::try_run

* optimize build scripts [skip ci]

* fix tests

* tests for RuntimeAuthority::resolve_access

* remote domain glob pattern

* lint

---------

Co-authored-by: Chip Reed <chip@chip.sh>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Nogueira <lucas@crabnebula.dev>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2024-01-22 21:24:15 -03:00
Amr Bashir
7f033f6dcd
fix(core): fix undecorated window resizing, #8519 (#8537)
* fix(core): fix undecorated window resizing, fixes #8519

* js api

* fix invoke call

* Update tauri-window-start-resize-dragging.md

* clippy
2024-01-18 19:34:55 +02:00
Amr Bashir
9f8037c288
fix(core): clear window surface for transparent windows (#8633)
* fix(core): clear window surface for transparent windows

closes #8632

this may conflict with `tauri-egui` rendering to the surface so we may need to add an option to disable internal rendering

* fix build
2024-01-18 18:35:20 +02:00
github-actions[bot]
e0b38d7434
Apply Version Updates From Current Changes (#8438)
Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
2024-01-16 18:11:50 -03:00
Lucas Nogueira
d621d3437c
feat: add tracing (port from #8289) (#8607)
* feat(tracing): add IPC tracing

* span for deserialization

* trace spans for IPC command handlers

* fix spans usage

* app tracing [skip ci]

* window tracing

* fix run never resolving all spans

* fix draw not entered

* change level

* feat(core): Manager::emit_filter and optimize serialization (#7512)

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>

* event spans

* lint & fix tests

* change eval to run sync

* fix instrument

* update wry

* change separator

* Update core/tauri/src/plugin.rs

Co-authored-by: Jonas Kruckenberg <118265418+CrabNejonas@users.noreply.github.com>

* Update core/tauri/src/window.rs

Co-authored-by: Jonas Kruckenberg <118265418+CrabNejonas@users.noreply.github.com>

* Update core/tauri/src/window.rs

Co-authored-by: Jonas Kruckenberg <118265418+CrabNejonas@users.noreply.github.com>

* Update core/tauri/src/window.rs

Co-authored-by: Jonas Kruckenberg <118265418+CrabNejonas@users.noreply.github.com>

* Update core/tauri/src/window.rs

Co-authored-by: Jonas Kruckenberg <118265418+CrabNejonas@users.noreply.github.com>

* instrument separators

* remove on_event trace

* skip all arguments on App::build tracing

* ipc spans adjustments

* delete change file

* improve how request and response are added as values (serialize)

* do not run evalScript sync on android :( freezes the app

* wry 0.35.2

* add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Co-authored-by: Jonas Kruckenberg <118265418+CrabNejonas@users.noreply.github.com>
2024-01-16 02:37:50 +02:00
pashokitsme
29ced5ceec
feat: add WindowBuilder::on_download, closes #8157 (#8159)
* on_download_started & on_download_completed setters

* macos: default handler fn if not set

* remove default macos handler

* doc comments

* unify hooks, change files

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-12-30 11:46:53 -03:00
Palash Bansal
27bad32d4d
feat: Add files field in macos build config, closes #3290 (#7798)
* Add appContents field in macos tauri config.

* Change MacConfig::appContents to MacConfig::files to make it similar to DebConfig::files.

* Change appContents to files in helloworld/tauri.conf.json

* use common::copy_dir helper

* add change files [skip ci]

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-12-28 12:10:50 -03:00
Amr Bashir
cb640c8e94
fix(runtime-wry): propagate wry file drop event to tao event loop, closes #8206 (#8393)
* fix(runtime-wry): propagate wry file drop event to tao event loop

* fix build

* always block default OS file drop behavior

* Update .changes/runevent-filedrop.md [skip ci]

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2023-12-28 10:20:24 -03:00
Lucas Fernandes Nogueira
af565c2a20
fix(macos): allow canceling data-tauri-drag-region maximization #8312 (#8487) 2023-12-28 10:03:14 -03:00
Amr Bashir
0ea1a47254
ci: use default options for repository-dispatch (#8455) 2023-12-27 13:00:39 -03:00
Olivier Lemasle
091100acbb
feat(bundler): Add RPM packaging, closes #4402 (#5202)
* feat(bundler): Add RPM packaging

* feat(bundler): Update 'rpm' to 0.13.1

* Fix fmt
2023-12-23 18:38:15 +01:00
Amr Bashir
2032228cad
refactor!: remove GlobalWindowEvent type (#8430)
* refactor!: remove `GlobalWindowEvent` type

* takee references instead
2023-12-19 14:20:00 -03:00
Lucas Nogueira
a9b87c057d
Merge branch '1.x' into dev 2023-12-19 13:52:53 -03:00
Lucas Nogueira
6cd6d3fb32
chore(utils): add change file for #7964 2023-12-19 12:48:05 -03:00
Lucas Nogueira
30c5d86f88
fix: bump tauri-runtime-wry for #8213 2023-12-19 11:33:35 -03:00
github-actions[bot]
e44b36fea4
Apply Version Updates From Current Changes (#8274)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2023-12-19 11:03:26 -03:00
Lucas Fernandes Nogueira
effe5871af
fix(core): scope checks on Android (#8420)
* fix(core): scope checks on Android

On Android, when we call canonicalize() on "/data/user/0/appid" (which is the data dir), the result is a "/data/data/appid" path, so we need to adjust our scope for that.

* clarify code

* apply the logic to all targets
2023-12-19 10:19:26 -03:00
Lucas Fernandes Nogueira
b59f2f54e7
feat(core): expose scope::fs::Scope::new (#8432) 2023-12-18 21:29:12 -03:00