From 3c2f79f6f377b59f3395837520e23fdad2714e80 Mon Sep 17 00:00:00 2001 From: tweidinger <28728469+tweidinger@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:24:15 +0900 Subject: [PATCH] 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 Co-authored-by: Lucas Nogueira Co-authored-by: Lucas Nogueira Co-authored-by: Lucas Nogueira --- Cargo.toml | 3 + core/tauri-build/Cargo.toml | 3 + core/tauri-build/src/acl.rs | 174 + core/tauri-build/src/codegen/context.rs | 15 +- core/tauri-build/src/lib.rs | 60 +- .../src/{allowlist.rs => manifest.rs} | 2 +- core/tauri-codegen/src/context.rs | 32 +- core/tauri-config-schema/Cargo.toml | 2 +- core/tauri-config-schema/schema.json | 47 - core/tauri-macros/src/command/wrapper.rs | 35 +- core/tauri-macros/src/lib.rs | 4 +- core/tauri-macros/src/runtime.rs | 55 +- core/tauri-plugin/Cargo.toml | 34 + core/tauri-plugin/src/build/mod.rs | 73 + core/tauri-plugin/src/lib.rs | 25 + core/tauri-plugin/src/runtime.rs | 3 + core/tauri-utils/Cargo.toml | 11 +- core/tauri-utils/src/acl/build.rs | 318 ++ core/tauri-utils/src/acl/capability.rs | 68 + core/tauri-utils/src/acl/identifier.rs | 262 ++ core/tauri-utils/src/acl/mod.rs | 220 + core/tauri-utils/src/acl/plugin.rs | 106 + core/tauri-utils/src/acl/resolved.rs | 397 ++ core/tauri-utils/src/acl/value.rs | 160 + core/tauri-utils/src/config.rs | 162 +- core/tauri-utils/src/config/parse.rs | 6 +- core/tauri-utils/src/lib.rs | 3 + core/tauri-utils/src/platform.rs | 39 +- core/tauri-utils/src/tokens.rs | 147 + core/tauri/Cargo.toml | 2 + core/tauri/build.rs | 192 + core/tauri/permissions/.gitignore | 1 + .../app/autogenerated/commands/app_hide.toml | 16 + .../app/autogenerated/commands/app_show.toml | 16 + .../app/autogenerated/commands/name.toml | 16 + .../autogenerated/commands/tauri_version.toml | 16 + .../app/autogenerated/commands/version.toml | 16 + .../app/autogenerated/default.toml | 8 + .../event/autogenerated/commands/emit.toml | 16 + .../event/autogenerated/commands/listen.toml | 16 + .../autogenerated/commands/unlisten.toml | 16 + .../event/autogenerated/default.toml | 8 + .../menu/autogenerated/commands/append.toml | 16 + .../commands/create_default.toml | 16 + .../menu/autogenerated/commands/get.toml | 16 + .../menu/autogenerated/commands/insert.toml | 16 + .../autogenerated/commands/is_checked.toml | 16 + .../autogenerated/commands/is_enabled.toml | 16 + .../menu/autogenerated/commands/items.toml | 16 + .../menu/autogenerated/commands/new.toml | 16 + .../menu/autogenerated/commands/popup.toml | 16 + .../menu/autogenerated/commands/prepend.toml | 16 + .../menu/autogenerated/commands/remove.toml | 16 + .../autogenerated/commands/remove_at.toml | 16 + .../commands/set_accelerator.toml | 16 + .../commands/set_as_app_menu.toml | 16 + .../commands/set_as_help_menu_for_nsapp.toml | 16 + .../commands/set_as_window_menu.toml | 16 + .../set_as_windows_menu_for_nsapp.toml | 16 + .../autogenerated/commands/set_checked.toml | 16 + .../autogenerated/commands/set_enabled.toml | 16 + .../menu/autogenerated/commands/set_icon.toml | 16 + .../menu/autogenerated/commands/set_text.toml | 16 + .../menu/autogenerated/commands/text.toml | 16 + .../menu/autogenerated/default.toml | 8 + .../path/autogenerated/commands/basename.toml | 16 + .../path/autogenerated/commands/dirname.toml | 16 + .../path/autogenerated/commands/extname.toml | 16 + .../autogenerated/commands/is_absolute.toml | 16 + .../path/autogenerated/commands/join.toml | 16 + .../autogenerated/commands/normalize.toml | 16 + .../path/autogenerated/commands/resolve.toml | 16 + .../commands/resolve_directory.toml | 16 + .../path/autogenerated/default.toml | 8 + .../autogenerated/commands/close.toml | 16 + .../resources/autogenerated/default.toml | 8 + .../tray/autogenerated/commands/new.toml | 16 + .../tray/autogenerated/commands/set_icon.toml | 16 + .../commands/set_icon_as_template.toml | 16 + .../tray/autogenerated/commands/set_menu.toml | 16 + .../commands/set_show_menu_on_left_click.toml | 16 + .../commands/set_temp_dir_path.toml | 16 + .../autogenerated/commands/set_title.toml | 16 + .../autogenerated/commands/set_tooltip.toml | 16 + .../autogenerated/commands/set_visible.toml | 16 + .../tray/autogenerated/default.toml | 8 + .../commands/available_monitors.toml | 16 + .../window/autogenerated/commands/center.toml | 16 + .../window/autogenerated/commands/close.toml | 16 + .../window/autogenerated/commands/create.toml | 16 + .../commands/current_monitor.toml | 16 + .../window/autogenerated/commands/hide.toml | 16 + .../commands/inner_position.toml | 16 + .../autogenerated/commands/inner_size.toml | 16 + .../commands/internal_toggle_devtools.toml | 16 + .../commands/internal_toggle_maximize.toml | 16 + .../autogenerated/commands/is_closable.toml | 16 + .../autogenerated/commands/is_decorated.toml | 16 + .../autogenerated/commands/is_focused.toml | 16 + .../autogenerated/commands/is_fullscreen.toml | 16 + .../commands/is_maximizable.toml | 16 + .../autogenerated/commands/is_maximized.toml | 16 + .../commands/is_minimizable.toml | 16 + .../autogenerated/commands/is_minimized.toml | 16 + .../autogenerated/commands/is_resizable.toml | 16 + .../autogenerated/commands/is_visible.toml | 16 + .../autogenerated/commands/maximize.toml | 16 + .../autogenerated/commands/minimize.toml | 16 + .../commands/outer_position.toml | 16 + .../autogenerated/commands/outer_size.toml | 16 + .../commands/primary_monitor.toml | 16 + .../window/autogenerated/commands/print.toml | 16 + .../commands/request_user_attention.toml | 16 + .../autogenerated/commands/scale_factor.toml | 16 + .../commands/set_always_on_bottom.toml | 16 + .../commands/set_always_on_top.toml | 16 + .../autogenerated/commands/set_closable.toml | 16 + .../commands/set_content_protected.toml | 16 + .../commands/set_cursor_grab.toml | 16 + .../commands/set_cursor_icon.toml | 16 + .../commands/set_cursor_position.toml | 16 + .../commands/set_cursor_visible.toml | 16 + .../commands/set_decorations.toml | 16 + .../autogenerated/commands/set_effects.toml | 16 + .../autogenerated/commands/set_focus.toml | 16 + .../commands/set_fullscreen.toml | 16 + .../autogenerated/commands/set_icon.toml | 16 + .../commands/set_ignore_cursor_events.toml | 16 + .../autogenerated/commands/set_max_size.toml | 16 + .../commands/set_maximizable.toml | 16 + .../autogenerated/commands/set_min_size.toml | 16 + .../commands/set_minimizable.toml | 16 + .../autogenerated/commands/set_position.toml | 16 + .../commands/set_progress_bar.toml | 16 + .../autogenerated/commands/set_resizable.toml | 16 + .../autogenerated/commands/set_shadow.toml | 16 + .../autogenerated/commands/set_size.toml | 16 + .../commands/set_skip_taskbar.toml | 16 + .../autogenerated/commands/set_title.toml | 16 + .../window/autogenerated/commands/show.toml | 16 + .../commands/start_dragging.toml | 16 + .../window/autogenerated/commands/theme.toml | 16 + .../window/autogenerated/commands/title.toml | 16 + .../commands/toggle_maximize.toml | 16 + .../autogenerated/commands/unmaximize.toml | 16 + .../autogenerated/commands/unminimize.toml | 16 + .../window/autogenerated/default.toml | 8 + core/tauri/scripts/bundle.global.js | 2 +- core/tauri/src/app.rs | 36 +- core/tauri/src/command/authority.rs | 428 ++ core/tauri/src/{command.rs => command/mod.rs} | 8 + core/tauri/src/ipc/mod.rs | 4 + core/tauri/src/lib.rs | 16 +- core/tauri/src/manager/mod.rs | 3 + core/tauri/src/menu/plugin.rs | 4 +- core/tauri/src/scope/ipc.rs | 360 -- core/tauri/src/scope/mod.rs | 3 - core/tauri/src/test/mod.rs | 7 + core/tauri/src/window/mod.rs | 72 +- core/tests/acl/Cargo.toml | 16 + .../fixtures/capabilities/basic-ping/cap.toml | 4 + .../basic-ping/required-plugins.json | 1 + .../file-explorer-remote/cap.toml | 6 + .../required-plugins.json | 1 + .../capabilities/file-explorer/cap.toml | 4 + .../file-explorer/required-plugins.json | 1 + .../acl/fixtures/capabilities/scope/cap.toml | 10 + .../capabilities/scope/required-plugins.json | 1 + .../acl/fixtures/plugins/fs/deny-home.toml | 6 + .../acl/fixtures/plugins/fs/move-tmp.toml | 6 + .../acl/fixtures/plugins/fs/read-dir.toml | 4 + .../acl/fixtures/plugins/fs/read-file.toml | 4 + .../fixtures/plugins/fs/read-resources.toml | 8 + core/tests/acl/fixtures/plugins/fs/read.toml | 4 + core/tests/acl/fixtures/plugins/fs/scope.toml | 6 + .../tests/acl/fixtures/plugins/ping/ping.toml | 4 + .../acl_tests__tests__basic-ping.snap | 41 + ...cl_tests__tests__file-explorer-remote.snap | 143 + .../acl_tests__tests__file-explorer.snap | 75 + .../snapshots/acl_tests__tests__scope.snap | 147 + core/tests/acl/src/lib.rs | 70 + examples/api/dist/assets/index.js | 36 +- examples/api/src-tauri/Cargo.lock | 460 ++- examples/api/src-tauri/build.rs | 5 +- .../api/src-tauri/capabilities/.gitignore | 1 + .../api/src-tauri/capabilities/run-app.json | 89 + .../src-tauri/tauri-plugin-sample/Cargo.toml | 1 + .../src-tauri/tauri-plugin-sample/build.rs | 4 + .../permissions/.gitignore | 1 + .../autogenerated/commands/ping.toml | 13 + .../permissions/global-scope.toml | 7 + .../permissions/ping-scoped.toml | 8 + .../src-tauri/tauri-plugin-sample/src/lib.rs | 33 + .../tauri-plugin-sample/src/models.rs | 2 +- examples/api/src/views/Window.svelte | 28 +- .../plugins/tauri-plugin-example/.gitignore | 1 + .../plugins/tauri-plugin-example/Cargo.lock | 3622 +++++++++++++++++ .../plugins/tauri-plugin-example/Cargo.toml | 11 + .../plugins/tauri-plugin-example/build.rs | 9 + .../permissions/.gitignore | 1 + .../permissions/home-config.toml | 9 + .../permissions/home-dir.toml | 10 + .../tauri-plugin-example/permissions/set.toml | 15 + .../plugins/tauri-plugin-example/src/lib.rs | 18 + tooling/api/src/menu/menu.ts | 2 +- tooling/cli/schema.json | 47 - 206 files changed, 9564 insertions(+), 819 deletions(-) create mode 100644 core/tauri-build/src/acl.rs rename core/tauri-build/src/{allowlist.rs => manifest.rs} (98%) create mode 100644 core/tauri-plugin/Cargo.toml create mode 100644 core/tauri-plugin/src/build/mod.rs create mode 100644 core/tauri-plugin/src/lib.rs create mode 100644 core/tauri-plugin/src/runtime.rs create mode 100644 core/tauri-utils/src/acl/build.rs create mode 100644 core/tauri-utils/src/acl/capability.rs create mode 100644 core/tauri-utils/src/acl/identifier.rs create mode 100644 core/tauri-utils/src/acl/mod.rs create mode 100644 core/tauri-utils/src/acl/plugin.rs create mode 100644 core/tauri-utils/src/acl/resolved.rs create mode 100644 core/tauri-utils/src/acl/value.rs create mode 100644 core/tauri-utils/src/tokens.rs create mode 100644 core/tauri/permissions/.gitignore create mode 100644 core/tauri/permissions/app/autogenerated/commands/app_hide.toml create mode 100644 core/tauri/permissions/app/autogenerated/commands/app_show.toml create mode 100644 core/tauri/permissions/app/autogenerated/commands/name.toml create mode 100644 core/tauri/permissions/app/autogenerated/commands/tauri_version.toml create mode 100644 core/tauri/permissions/app/autogenerated/commands/version.toml create mode 100644 core/tauri/permissions/app/autogenerated/default.toml create mode 100644 core/tauri/permissions/event/autogenerated/commands/emit.toml create mode 100644 core/tauri/permissions/event/autogenerated/commands/listen.toml create mode 100644 core/tauri/permissions/event/autogenerated/commands/unlisten.toml create mode 100644 core/tauri/permissions/event/autogenerated/default.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/append.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/create_default.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/get.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/insert.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/is_checked.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/is_enabled.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/items.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/new.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/popup.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/prepend.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/remove.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/remove_at.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/set_accelerator.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/set_as_app_menu.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/set_as_help_menu_for_nsapp.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/set_as_window_menu.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/set_as_windows_menu_for_nsapp.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/set_checked.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/set_enabled.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/set_icon.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/set_text.toml create mode 100644 core/tauri/permissions/menu/autogenerated/commands/text.toml create mode 100644 core/tauri/permissions/menu/autogenerated/default.toml create mode 100644 core/tauri/permissions/path/autogenerated/commands/basename.toml create mode 100644 core/tauri/permissions/path/autogenerated/commands/dirname.toml create mode 100644 core/tauri/permissions/path/autogenerated/commands/extname.toml create mode 100644 core/tauri/permissions/path/autogenerated/commands/is_absolute.toml create mode 100644 core/tauri/permissions/path/autogenerated/commands/join.toml create mode 100644 core/tauri/permissions/path/autogenerated/commands/normalize.toml create mode 100644 core/tauri/permissions/path/autogenerated/commands/resolve.toml create mode 100644 core/tauri/permissions/path/autogenerated/commands/resolve_directory.toml create mode 100644 core/tauri/permissions/path/autogenerated/default.toml create mode 100644 core/tauri/permissions/resources/autogenerated/commands/close.toml create mode 100644 core/tauri/permissions/resources/autogenerated/default.toml create mode 100644 core/tauri/permissions/tray/autogenerated/commands/new.toml create mode 100644 core/tauri/permissions/tray/autogenerated/commands/set_icon.toml create mode 100644 core/tauri/permissions/tray/autogenerated/commands/set_icon_as_template.toml create mode 100644 core/tauri/permissions/tray/autogenerated/commands/set_menu.toml create mode 100644 core/tauri/permissions/tray/autogenerated/commands/set_show_menu_on_left_click.toml create mode 100644 core/tauri/permissions/tray/autogenerated/commands/set_temp_dir_path.toml create mode 100644 core/tauri/permissions/tray/autogenerated/commands/set_title.toml create mode 100644 core/tauri/permissions/tray/autogenerated/commands/set_tooltip.toml create mode 100644 core/tauri/permissions/tray/autogenerated/commands/set_visible.toml create mode 100644 core/tauri/permissions/tray/autogenerated/default.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/available_monitors.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/center.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/close.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/create.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/current_monitor.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/hide.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/inner_position.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/inner_size.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/internal_toggle_devtools.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/internal_toggle_maximize.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/is_closable.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/is_decorated.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/is_focused.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/is_fullscreen.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/is_maximizable.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/is_maximized.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/is_minimizable.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/is_minimized.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/is_resizable.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/is_visible.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/maximize.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/minimize.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/outer_position.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/outer_size.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/primary_monitor.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/print.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/request_user_attention.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/scale_factor.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_always_on_bottom.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_always_on_top.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_closable.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_content_protected.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_cursor_grab.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_cursor_icon.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_cursor_position.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_cursor_visible.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_decorations.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_effects.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_focus.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_fullscreen.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_icon.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_ignore_cursor_events.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_max_size.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_maximizable.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_min_size.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_minimizable.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_position.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_progress_bar.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_resizable.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_shadow.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_size.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_skip_taskbar.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/set_title.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/show.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/start_dragging.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/theme.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/title.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/toggle_maximize.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/unmaximize.toml create mode 100644 core/tauri/permissions/window/autogenerated/commands/unminimize.toml create mode 100644 core/tauri/permissions/window/autogenerated/default.toml create mode 100644 core/tauri/src/command/authority.rs rename core/tauri/src/{command.rs => command/mod.rs} (97%) delete mode 100644 core/tauri/src/scope/ipc.rs create mode 100644 core/tests/acl/Cargo.toml create mode 100644 core/tests/acl/fixtures/capabilities/basic-ping/cap.toml create mode 100644 core/tests/acl/fixtures/capabilities/basic-ping/required-plugins.json create mode 100644 core/tests/acl/fixtures/capabilities/file-explorer-remote/cap.toml create mode 100644 core/tests/acl/fixtures/capabilities/file-explorer-remote/required-plugins.json create mode 100644 core/tests/acl/fixtures/capabilities/file-explorer/cap.toml create mode 100644 core/tests/acl/fixtures/capabilities/file-explorer/required-plugins.json create mode 100644 core/tests/acl/fixtures/capabilities/scope/cap.toml create mode 100644 core/tests/acl/fixtures/capabilities/scope/required-plugins.json create mode 100644 core/tests/acl/fixtures/plugins/fs/deny-home.toml create mode 100644 core/tests/acl/fixtures/plugins/fs/move-tmp.toml create mode 100644 core/tests/acl/fixtures/plugins/fs/read-dir.toml create mode 100644 core/tests/acl/fixtures/plugins/fs/read-file.toml create mode 100644 core/tests/acl/fixtures/plugins/fs/read-resources.toml create mode 100644 core/tests/acl/fixtures/plugins/fs/read.toml create mode 100644 core/tests/acl/fixtures/plugins/fs/scope.toml create mode 100644 core/tests/acl/fixtures/plugins/ping/ping.toml create mode 100644 core/tests/acl/fixtures/snapshots/acl_tests__tests__basic-ping.snap create mode 100644 core/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer-remote.snap create mode 100644 core/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer.snap create mode 100644 core/tests/acl/fixtures/snapshots/acl_tests__tests__scope.snap create mode 100644 core/tests/acl/src/lib.rs create mode 100644 examples/api/src-tauri/capabilities/.gitignore create mode 100644 examples/api/src-tauri/capabilities/run-app.json create mode 100644 examples/api/src-tauri/tauri-plugin-sample/permissions/.gitignore create mode 100644 examples/api/src-tauri/tauri-plugin-sample/permissions/autogenerated/commands/ping.toml create mode 100644 examples/api/src-tauri/tauri-plugin-sample/permissions/global-scope.toml create mode 100644 examples/api/src-tauri/tauri-plugin-sample/permissions/ping-scoped.toml create mode 100644 examples/plugins/tauri-plugin-example/.gitignore create mode 100644 examples/plugins/tauri-plugin-example/Cargo.lock create mode 100644 examples/plugins/tauri-plugin-example/Cargo.toml create mode 100644 examples/plugins/tauri-plugin-example/build.rs create mode 100644 examples/plugins/tauri-plugin-example/permissions/.gitignore create mode 100644 examples/plugins/tauri-plugin-example/permissions/home-config.toml create mode 100644 examples/plugins/tauri-plugin-example/permissions/home-dir.toml create mode 100644 examples/plugins/tauri-plugin-example/permissions/set.toml create mode 100644 examples/plugins/tauri-plugin-example/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 6c6f337be6b4..4dd3286e0d4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,9 +10,11 @@ members = [ "core/tauri-build", "core/tauri-codegen", "core/tauri-config-schema", + "core/tauri-plugin", # integration tests "core/tests/restart", + "core/tests/acl", ] exclude = [ @@ -22,6 +24,7 @@ exclude = [ "examples/web/core", "examples/file-associations/src-tauri", "examples/workspace", + "examples/plugins/tauri-plugin-example", ] [workspace.package] diff --git a/core/tauri-build/Cargo.toml b/core/tauri-build/Cargo.toml index d2e7b0b9fa71..4471b4efa7a1 100644 --- a/core/tauri-build/Cargo.toml +++ b/core/tauri-build/Cargo.toml @@ -39,6 +39,9 @@ walkdir = "2" tauri-winres = "0.1" semver = "1" dirs-next = "2" +glob = "0.3" +toml = "0.8" +schemars = "0.8" [target."cfg(target_os = \"macos\")".dependencies] swift-rs = { version = "1.0.6", features = [ "build" ] } diff --git a/core/tauri-build/src/acl.rs b/core/tauri-build/src/acl.rs new file mode 100644 index 000000000000..86ea9e22a1e2 --- /dev/null +++ b/core/tauri-build/src/acl.rs @@ -0,0 +1,174 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::{ + collections::BTreeMap, + fs::{copy, create_dir_all, File}, + io::{BufWriter, Write}, + path::PathBuf, +}; + +use anyhow::{Context, Result}; +use schemars::{ + schema::{InstanceType, Metadata, RootSchema, Schema, SchemaObject, SubschemaValidation}, + schema_for, +}; +use tauri_utils::{ + acl::{build::CapabilityFile, capability::Capability, plugin::Manifest}, + platform::Target, +}; + +const CAPABILITIES_SCHEMA_FILE_NAME: &str = "schema.json"; +const CAPABILITIES_SCHEMA_FOLDER_NAME: &str = "schemas"; + +fn capabilities_schema(plugin_manifests: &BTreeMap) -> RootSchema { + let mut schema = schema_for!(CapabilityFile); + + fn schema_from(plugin: &str, id: &str, description: Option<&str>) -> Schema { + Schema::Object(SchemaObject { + metadata: Some(Box::new(Metadata { + description: description + .as_ref() + .map(|d| format!("{plugin}:{id} -> {d}")), + ..Default::default() + })), + instance_type: Some(InstanceType::String.into()), + enum_values: Some(vec![serde_json::Value::String(format!("{plugin}:{id}"))]), + ..Default::default() + }) + } + + let mut permission_schemas = Vec::new(); + + for (plugin, manifest) in plugin_manifests { + for (set_id, set) in &manifest.permission_sets { + permission_schemas.push(schema_from(plugin, set_id, Some(&set.description))); + } + + if let Some(default) = &manifest.default_permission { + permission_schemas.push(schema_from( + plugin, + "default", + Some(default.description.as_ref()), + )); + } + + for (permission_id, permission) in &manifest.permissions { + permission_schemas.push(schema_from( + plugin, + permission_id, + permission.description.as_deref(), + )); + } + } + + if let Some(Schema::Object(obj)) = schema.definitions.get_mut("Identifier") { + obj.object = None; + obj.instance_type = None; + obj.metadata.as_mut().map(|metadata| { + metadata + .description + .replace("Permission identifier".to_string()); + metadata + }); + obj.subschemas.replace(Box::new(SubschemaValidation { + one_of: Some(permission_schemas), + ..Default::default() + })); + } + + schema +} + +pub fn generate_schema( + plugin_manifests: &BTreeMap, + target: Target, +) -> Result<()> { + let schema = capabilities_schema(plugin_manifests); + let schema_str = serde_json::to_string_pretty(&schema).unwrap(); + let out_dir = PathBuf::from("capabilities").join(CAPABILITIES_SCHEMA_FOLDER_NAME); + create_dir_all(&out_dir).context("unable to create schema output directory")?; + + let schema_path = out_dir.join(format!("{target}-{CAPABILITIES_SCHEMA_FILE_NAME}")); + let mut schema_file = BufWriter::new(File::create(&schema_path)?); + write!(schema_file, "{schema_str}")?; + + copy( + schema_path, + out_dir.join(format!( + "{}-{CAPABILITIES_SCHEMA_FILE_NAME}", + if target.is_desktop() { + "desktop" + } else { + "mobile" + } + )), + )?; + + Ok(()) +} + +pub fn get_plugin_manifests() -> Result> { + let permission_map = + tauri_utils::acl::build::read_permissions().context("failed to read plugin permissions")?; + + let mut processed = BTreeMap::new(); + for (plugin_name, permission_files) in permission_map { + processed.insert(plugin_name, Manifest::from_files(permission_files)); + } + + Ok(processed) +} + +pub fn validate_capabilities( + plugin_manifests: &BTreeMap, + capabilities: &BTreeMap, +) -> Result<()> { + let target = tauri_utils::platform::Target::from_triple(&std::env::var("TARGET").unwrap()); + + for capability in capabilities.values() { + if !capability.platforms.contains(&target) { + continue; + } + + for permission in &capability.permissions { + if let Some((plugin_name, permission_name)) = permission.get().split_once(':') { + let permission_exists = plugin_manifests + .get(plugin_name) + .map(|manifest| { + if permission_name == "default" { + manifest.default_permission.is_some() + } else { + manifest.permissions.contains_key(permission_name) + || manifest.permission_sets.contains_key(permission_name) + } + }) + .unwrap_or(false); + + if !permission_exists { + let mut available_permissions = Vec::new(); + for (plugin, manifest) in plugin_manifests { + if manifest.default_permission.is_some() { + available_permissions.push(format!("{plugin}:default")); + } + for p in manifest.permissions.keys() { + available_permissions.push(format!("{plugin}:{p}")); + } + for p in manifest.permission_sets.keys() { + available_permissions.push(format!("{plugin}:{p}")); + } + } + + anyhow::bail!( + "Permission {} not found, expected one of {}", + permission.get(), + available_permissions.join(", ") + ); + } + } + } + } + + Ok(()) +} diff --git a/core/tauri-build/src/codegen/context.rs b/core/tauri-build/src/codegen/context.rs index e1991d206e74..5313ec5f86ff 100644 --- a/core/tauri-build/src/codegen/context.rs +++ b/core/tauri-build/src/codegen/context.rs @@ -78,20 +78,7 @@ impl CodegenContext { /// /// Unless you are doing something special with this builder, you don't need to do anything with /// the returned output path. - /// - /// # Panics - /// - /// If any parts of the codegen fail, this will panic with the related error message. This is - /// typically desirable when running inside a build script; see [`Self::try_build`] for no panics. - pub fn build(self) -> PathBuf { - match self.try_build() { - Ok(out) => out, - Err(error) => panic!("Error found during Codegen::build: {error}"), - } - } - - /// Non-panicking [`Self::build`] - pub fn try_build(self) -> Result { + pub(crate) fn try_build(self) -> Result { let (config, config_parent) = tauri_codegen::get_config(&self.config_path)?; // rerun if changed diff --git a/core/tauri-build/src/lib.rs b/core/tauri-build/src/lib.rs index a41793e3abc0..5aab858b5f4c 100644 --- a/core/tauri-build/src/lib.rs +++ b/core/tauri-build/src/lib.rs @@ -18,20 +18,23 @@ use cargo_toml::Manifest; use heck::AsShoutySnakeCase; use tauri_utils::{ + acl::build::parse_capabilities, config::{BundleResources, Config, WebviewInstallMode}, resources::{external_binaries, ResourcePaths}, }; use std::{ env::var_os, + fs::read_to_string, path::{Path, PathBuf}, }; -mod allowlist; +mod acl; #[cfg(feature = "codegen")] mod codegen; /// Tauri configuration functions. pub mod config; +mod manifest; /// Mobile build functions. pub mod mobile; mod static_vcruntime; @@ -40,6 +43,9 @@ mod static_vcruntime; #[cfg_attr(docsrs, doc(cfg(feature = "codegen")))] pub use codegen::context::CodegenContext; +const PLUGIN_MANIFESTS_FILE_NAME: &str = "plugin-manifests.json"; +const CAPABILITIES_FILE_NAME: &str = "capabilities.json"; + fn copy_file(from: impl AsRef, to: impl AsRef) -> Result<()> { let from = from.as_ref(); let to = to.as_ref(); @@ -333,6 +339,9 @@ impl WindowsAttributes { pub struct Attributes { #[allow(dead_code)] windows_attributes: WindowsAttributes, + capabilities_path_pattern: Option<&'static str>, + #[cfg(feature = "codegen")] + codegen: Option, } impl Attributes { @@ -347,6 +356,21 @@ impl Attributes { self.windows_attributes = windows_attributes; self } + + /// Set the glob pattern to be used to find the capabilities. + #[must_use] + pub fn capabilities_path_pattern(mut self, pattern: &'static str) -> Self { + self.capabilities_path_pattern.replace(pattern); + self + } + + #[cfg(feature = "codegen")] + #[cfg_attr(docsrs, doc(cfg(feature = "codegen")))] + #[must_use] + pub fn codegen(mut self, codegen: codegen::context::CodegenContext) -> Self { + self.codegen.replace(codegen); + self + } } /// Run all build time helpers for your Tauri Application. @@ -399,8 +423,11 @@ pub fn try_build(attributes: Attributes) -> Result<()> { cfg_alias("desktop", !mobile); cfg_alias("mobile", mobile); + let target_triple = std::env::var("TARGET").unwrap(); + let target = tauri_utils::platform::Target::from_triple(&target_triple); + let mut config = serde_json::from_value(tauri_utils::config::parse::read_from( - tauri_utils::platform::Target::from_triple(&std::env::var("TARGET").unwrap()), + target, std::env::current_dir().unwrap(), )?)?; if let Ok(env) = std::env::var("TAURI_CONFIG") { @@ -441,13 +468,31 @@ pub fn try_build(attributes: Attributes) -> Result<()> { Manifest::complete_from_path(&mut manifest, Path::new("Cargo.toml"))?; } - allowlist::check(&config, &mut manifest)?; + let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap()); - let target_triple = std::env::var("TARGET").unwrap(); + manifest::check(&config, &mut manifest)?; + let plugin_manifests = acl::get_plugin_manifests()?; + std::fs::write( + out_dir.join(PLUGIN_MANIFESTS_FILE_NAME), + serde_json::to_string(&plugin_manifests)?, + )?; + let capabilities = if let Some(pattern) = attributes.capabilities_path_pattern { + parse_capabilities(pattern)? + } else { + parse_capabilities("./capabilities/**/*")? + }; + acl::generate_schema(&plugin_manifests, target)?; + + acl::validate_capabilities(&plugin_manifests, &capabilities)?; + + let capabilities_path = out_dir.join(CAPABILITIES_FILE_NAME); + let capabilities_json = serde_json::to_string(&capabilities)?; + if capabilities_json != read_to_string(&capabilities_path).unwrap_or_default() { + std::fs::write(capabilities_path, capabilities_json)?; + } println!("cargo:rustc-env=TAURI_ENV_TARGET_TRIPLE={target_triple}"); - let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap()); // TODO: far from ideal, but there's no other way to get the target dir, see let target_dir = out_dir .parent() @@ -611,6 +656,11 @@ pub fn try_build(attributes: Attributes) -> Result<()> { } } + #[cfg(feature = "codegen")] + if let Some(codegen) = attributes.codegen { + codegen.try_build()?; + } + Ok(()) } diff --git a/core/tauri-build/src/allowlist.rs b/core/tauri-build/src/manifest.rs similarity index 98% rename from core/tauri-build/src/allowlist.rs rename to core/tauri-build/src/manifest.rs index 8494a5abde47..f578d9fc80e0 100644 --- a/core/tauri-build/src/allowlist.rs +++ b/core/tauri-build/src/manifest.rs @@ -211,7 +211,7 @@ mod tests { }, ), ] { - assert_eq!(super::features_diff(¤t, &expected), result); + assert_eq!(crate::manifest::features_diff(¤t, &expected), result); } } } diff --git a/core/tauri-codegen/src/context.rs b/core/tauri-codegen/src/context.rs index de448b071800..6e5aa26cc783 100644 --- a/core/tauri-codegen/src/context.rs +++ b/core/tauri-codegen/src/context.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +use std::collections::BTreeMap; use std::path::{Path, PathBuf}; use std::{ffi::OsStr, str::FromStr}; @@ -10,6 +11,9 @@ use proc_macro2::TokenStream; use quote::quote; use sha2::{Digest, Sha256}; +use tauri_utils::acl::capability::Capability; +use tauri_utils::acl::plugin::Manifest; +use tauri_utils::acl::resolved::Resolved; use tauri_utils::assets::AssetKey; use tauri_utils::config::{AppUrl, Config, PatternKind, WindowUrl}; use tauri_utils::html::{ @@ -19,6 +23,9 @@ use tauri_utils::platform::Target; use crate::embedded_assets::{AssetOptions, CspHashes, EmbeddedAssets, EmbeddedAssetsError}; +const PLUGIN_MANIFESTS_FILE_NAME: &str = "plugin-manifests.json"; +const CAPABILITIES_FILE_NAME: &str = "capabilities.json"; + /// Necessary data needed by [`context_codegen`] to generate code for a Tauri application context. pub struct ContextData { pub dev: bool, @@ -233,7 +240,7 @@ pub fn context_codegen(data: ContextData) -> Result Result Result = if acl_file_path.exists() { + let acl_file = + std::fs::read_to_string(acl_file_path).expect("failed to read plugin manifest map"); + serde_json::from_str(&acl_file).expect("failed to parse plugin manifest map") + } else { + Default::default() + }; + + let capabilities_file_path = out_dir.join(CAPABILITIES_FILE_NAME); + let capabilities: BTreeMap = if capabilities_file_path.exists() { + let capabilities_file = + std::fs::read_to_string(capabilities_file_path).expect("failed to read capabilities"); + serde_json::from_str(&capabilities_file).expect("failed to parse capabilities") + } else { + Default::default() + }; + + let resolved_act = Resolved::resolve(acl, capabilities, target).expect("failed to resolve ACL"); + Ok(quote!({ #[allow(unused_mut, clippy::let_and_return)] let mut context = #root::Context::new( @@ -383,6 +410,7 @@ pub fn context_codegen(data: ContextData) -> Result", "type": "object", diff --git a/core/tauri-macros/src/command/wrapper.rs b/core/tauri-macros/src/command/wrapper.rs index c28c74c0fa6d..4df148ffd28c 100644 --- a/core/tauri-macros/src/command/wrapper.rs +++ b/core/tauri-macros/src/command/wrapper.rs @@ -120,6 +120,7 @@ enum ArgumentCase { struct Invoke { message: Ident, resolver: Ident, + acl: Ident, } /// Create a new [`Wrapper`] from the function and the generated code parsed from the function. @@ -135,13 +136,14 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream { // macros used with `pub use my_macro;` need to be exported with `#[macro_export]` let maybe_macro_export = match &function.vis { - Visibility::Public(_) => quote!(#[macro_export]), - _ => Default::default(), + Visibility::Public(_) | Visibility::Restricted(_) => quote!(#[macro_export]), + _ => TokenStream2::default(), }; let invoke = Invoke { message: format_ident!("__tauri_message__"), resolver: format_ident!("__tauri_resolver__"), + acl: format_ident!("__tauri_acl__"), }; // Tauri currently doesn't support async commands that take a reference as input and don't return @@ -210,7 +212,11 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream { } }; - let Invoke { message, resolver } = invoke; + let Invoke { + message, + resolver, + acl, + } = invoke; let root = attrs.root; @@ -255,7 +261,7 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream { use #root::command::private::*; // prevent warnings when the body is a `compile_error!` or if the command has no arguments #[allow(unused_variables)] - let #root::ipc::Invoke { message: #message, resolver: #resolver } = $invoke; + let #root::ipc::Invoke { message: #message, resolver: #resolver, acl: #acl } = $invoke; #maybe_span @@ -280,8 +286,12 @@ fn body_async( invoke: &Invoke, attributes: &WrapperAttributes, ) -> syn::Result { - let Invoke { message, resolver } = invoke; - parse_args(function, message, attributes).map(|args| { + let Invoke { + message, + resolver, + acl, + } = invoke; + parse_args(function, message, acl, attributes).map(|args| { #[cfg(feature = "tracing")] quote! { use tracing::Instrument; @@ -318,8 +328,12 @@ fn body_blocking( invoke: &Invoke, attributes: &WrapperAttributes, ) -> syn::Result { - let Invoke { message, resolver } = invoke; - let args = parse_args(function, message, attributes)?; + let Invoke { + message, + resolver, + acl, + } = invoke; + let args = parse_args(function, message, acl, attributes)?; // the body of a `match` to early return any argument that wasn't successful in parsing. let match_body = quote!({ @@ -346,13 +360,14 @@ fn body_blocking( fn parse_args( function: &ItemFn, message: &Ident, + acl: &Ident, attributes: &WrapperAttributes, ) -> syn::Result> { function .sig .inputs .iter() - .map(|arg| parse_arg(&function.sig.ident, arg, message, attributes)) + .map(|arg| parse_arg(&function.sig.ident, arg, message, acl, attributes)) .collect() } @@ -361,6 +376,7 @@ fn parse_arg( command: &Ident, arg: &FnArg, message: &Ident, + acl: &Ident, attributes: &WrapperAttributes, ) -> syn::Result { // we have no use for self arguments @@ -412,6 +428,7 @@ fn parse_arg( name: stringify!(#command), key: #key, message: &#message, + acl: &#acl, } ))) } diff --git a/core/tauri-macros/src/lib.rs b/core/tauri-macros/src/lib.rs index 990dc6aff0fa..c45f3724d1c9 100644 --- a/core/tauri-macros/src/lib.rs +++ b/core/tauri-macros/src/lib.rs @@ -13,7 +13,7 @@ use crate::context::ContextItems; use proc_macro::TokenStream; -use syn::{parse_macro_input, DeriveInput}; +use syn::parse_macro_input; mod command; mod menu; @@ -87,7 +87,7 @@ pub fn generate_context(items: TokenStream) -> TokenStream { #[proc_macro_attribute] pub fn default_runtime(attributes: TokenStream, input: TokenStream) -> TokenStream { let attributes = parse_macro_input!(attributes as runtime::Attributes); - let input = parse_macro_input!(input as DeriveInput); + let input = parse_macro_input!(input as runtime::Input); runtime::default_runtime(attributes, input).into() } diff --git a/core/tauri-macros/src/runtime.rs b/core/tauri-macros/src/runtime.rs index 800e6beb399a..94bcf89ef7d5 100644 --- a/core/tauri-macros/src/runtime.rs +++ b/core/tauri-macros/src/runtime.rs @@ -3,9 +3,54 @@ // SPDX-License-Identifier: MIT use proc_macro2::TokenStream; -use quote::quote; +use quote::{quote, ToTokens}; use syn::parse::{Parse, ParseStream}; -use syn::{parse_quote, DeriveInput, GenericParam, Ident, Token, Type, TypeParam}; +use syn::{ + parse_quote, DeriveInput, Error, GenericParam, Ident, ItemTrait, ItemType, Token, Type, TypeParam, +}; + +#[derive(Clone)] +pub(crate) enum Input { + Derive(DeriveInput), + Trait(ItemTrait), + Type(ItemType), +} + +impl Parse for Input { + fn parse(input: ParseStream) -> syn::Result { + input + .parse::() + .map(Self::Derive) + .or_else(|_| input.parse().map(Self::Trait)) + .or_else(|_| input.parse().map(Self::Type)) + .map_err(|_| { + Error::new( + input.span(), + "default_runtime only supports `struct`, `enum`, `type`, or `trait` definitions", + ) + }) + } +} + +impl Input { + fn last_param_mut(&mut self) -> Option<&mut GenericParam> { + match self { + Input::Derive(d) => d.generics.params.last_mut(), + Input::Trait(t) => t.generics.params.last_mut(), + Input::Type(t) => t.generics.params.last_mut(), + } + } +} + +impl ToTokens for Input { + fn to_tokens(&self, tokens: &mut TokenStream) { + match self { + Input::Derive(d) => d.to_tokens(tokens), + Input::Trait(t) => t.to_tokens(tokens), + Input::Type(t) => t.to_tokens(tokens), + } + } +} /// The default runtime type to enable when the provided feature is enabled. pub(crate) struct Attributes { @@ -24,13 +69,11 @@ impl Parse for Attributes { } } -pub(crate) fn default_runtime(attributes: Attributes, input: DeriveInput) -> TokenStream { +pub(crate) fn default_runtime(attributes: Attributes, input: Input) -> TokenStream { // create a new copy to manipulate for the wry feature flag let mut wry = input.clone(); let wry_runtime = wry - .generics - .params - .last_mut() + .last_param_mut() .expect("default_runtime requires the item to have at least 1 generic parameter"); // set the default value of the last generic parameter to the provided runtime type diff --git a/core/tauri-plugin/Cargo.toml b/core/tauri-plugin/Cargo.toml new file mode 100644 index 000000000000..fe9c57d60286 --- /dev/null +++ b/core/tauri-plugin/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "tauri-plugin" +version = "0.1.0" +authors = { workspace = true } +homepage = { workspace = true } +repository = { workspace = true } +categories = { workspace = true } +license = { workspace = true } +edition = { workspace = true } +rust-version = { workspace = true } + +[features] +build = [ + "dep:serde", + "dep:cargo_metadata", + "dep:serde_json", + "dep:glob", + "dep:toml", +] +runtime = [] + +[dependencies] +serde = { version = "1", optional = true } +cargo_metadata = { version = "0.18", optional = true } +tauri-utils = { version = "2.0.0-alpha.12", default-features = false, path = "../tauri-utils" } +tauri = { version = "2.0.0-alpha.20", default-features = false, path = "../tauri" } +serde_json = { version = "1", optional = true } +glob = { version = "0.3", optional = true } +toml = { version = "0.8", optional = true } + +[package.metadata.docs.rs] +features = ["build", "runtime"] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/core/tauri-plugin/src/build/mod.rs b/core/tauri-plugin/src/build/mod.rs new file mode 100644 index 000000000000..7d593671ff43 --- /dev/null +++ b/core/tauri-plugin/src/build/mod.rs @@ -0,0 +1,73 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::path::Path; + +use cargo_metadata::{Metadata, MetadataCommand}; +use tauri_utils::acl::{self, Error}; + +pub struct Builder<'a> { + commands: &'a [&'static str], +} + +impl<'a> Builder<'a> { + pub fn new(commands: &'a [&'static str]) -> Self { + Self { commands } + } + + /// [`Self::try_build`] but will exit automatically if an error is found. + pub fn build(self) { + if let Err(error) = self.try_build() { + println!("{}: {}", env!("CARGO_PKG_NAME"), error); + std::process::exit(1); + } + } + + /// Ensure this crate is properly configured to be a Tauri plugin. + /// + /// # Errors + /// + /// Errors will occur if environmental variables expected to be set inside of [build scripts] + /// are not found, or if the crate violates Tauri plugin conventions. + pub fn try_build(self) -> Result<(), Error> { + // convention: plugin names should not use underscores + let name = build_var("CARGO_PKG_NAME")?; + if name.contains('_') { + return Err(Error::CrateName); + } + + // requirement: links MUST be set and MUST match the name + let _links = build_var("CARGO_MANIFEST_LINKS")?; + + let autogenerated = Path::new("permissions/autogenerated/"); + let commands_dir = &autogenerated.join("commands"); + + if !self.commands.is_empty() { + acl::build::autogenerate_command_permissions(commands_dir, self.commands, ""); + } + + let permissions = acl::build::define_permissions("./permissions/**/*.*", &name)?; + acl::build::generate_schema(&permissions, "./permissions")?; + + let metadata = find_metadata()?; + println!("{metadata:#?}"); + + Ok(()) + } +} + +/// Grab an env var that is expected to be set inside of build scripts. +fn build_var(key: &'static str) -> Result { + std::env::var(key).map_err(|_| Error::BuildVar(key)) +} + +fn find_metadata() -> Result { + build_var("CARGO_MANIFEST_DIR").and_then(|dir| { + MetadataCommand::new() + .current_dir(dir) + .no_deps() + .exec() + .map_err(Error::Metadata) + }) +} diff --git a/core/tauri-plugin/src/lib.rs b/core/tauri-plugin/src/lib.rs new file mode 100644 index 000000000000..c32c3e683fd8 --- /dev/null +++ b/core/tauri-plugin/src/lib.rs @@ -0,0 +1,25 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//! [![](https://github.com/tauri-apps/tauri/raw/dev/.github/splash.png)](https://tauri.app) +//! +//! Interface for building Tauri plugins. + +#![doc( + html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png", + html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" +)] +#![cfg_attr(docsrs, feature(doc_cfg))] + +#[cfg(feature = "build")] +mod build; +#[cfg(feature = "runtime")] +mod runtime; + +#[cfg(feature = "build")] +#[cfg_attr(docsrs, doc(feature = "build"))] +pub use build::*; +#[cfg(feature = "runtime")] +#[cfg_attr(docsrs, doc(feature = "runtime"))] +pub use runtime::*; diff --git a/core/tauri-plugin/src/runtime.rs b/core/tauri-plugin/src/runtime.rs new file mode 100644 index 000000000000..a056038571a5 --- /dev/null +++ b/core/tauri-plugin/src/runtime.rs @@ -0,0 +1,3 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT diff --git a/core/tauri-utils/Cargo.toml b/core/tauri-utils/Cargo.toml index 36ade20f0211..108423ce5eb8 100644 --- a/core/tauri-utils/Cargo.toml +++ b/core/tauri-utils/Cargo.toml @@ -30,25 +30,26 @@ getrandom = { version = "0.2", optional = true, features = [ "std" ] } serialize-to-javascript = { version = "=0.1.1", optional = true } ctor = "0.2" json5 = { version = "0.4", optional = true } -toml = { version = "0.8", optional = true } +toml = { version = "0.8", features = ["parse"] } json-patch = "1.2" -glob = { version = "0.3", optional = true } +glob = "0.3" walkdir = { version = "2", optional = true } memchr = "2" semver = "1" infer = "0.15" dunce = "1" log = "0.4.20" +cargo_metadata = { version = "0.18", optional = true } [target."cfg(target_os = \"linux\")".dependencies] heck = "0.4" [features] -build = [ "proc-macro2", "quote" ] +build = [ "proc-macro2", "quote", "cargo_metadata", "schema" ] compression = [ "brotli" ] schema = [ "schemars" ] isolation = [ "aes-gcm", "getrandom", "serialize-to-javascript" ] process-relaunch-dangerous-allow-symlink-macos = [ ] config-json5 = [ "json5" ] -config-toml = [ "toml" ] -resources = [ "glob", "walkdir" ] +config-toml = [] +resources = [ "walkdir" ] diff --git a/core/tauri-utils/src/acl/build.rs b/core/tauri-utils/src/acl/build.rs new file mode 100644 index 000000000000..9f001c29b34a --- /dev/null +++ b/core/tauri-utils/src/acl/build.rs @@ -0,0 +1,318 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//! ACL items that are only useful inside of build script/codegen context. + +use std::{ + collections::{BTreeMap, HashMap}, + env::{current_dir, vars_os}, + fs::{create_dir_all, read_to_string, File}, + io::{BufWriter, Write}, + path::{Path, PathBuf}, +}; + +use crate::acl::Error; +use schemars::{ + schema::{InstanceType, Metadata, RootSchema, Schema, SchemaObject, SubschemaValidation}, + schema_for, +}; +use serde::Deserialize; + +use super::{capability::Capability, plugin::PermissionFile}; + +/// Cargo cfg key for permissions file paths +pub const PERMISSION_FILES_PATH_KEY: &str = "PERMISSION_FILES_PATH"; + +/// Allowed permission file extensions +pub const PERMISSION_FILE_EXTENSIONS: &[&str] = &["json", "toml"]; + +/// Known filename of a permission schema +pub const PERMISSION_SCHEMA_FILE_NAME: &str = ".schema.json"; + +/// Allowed capability file extensions +const CAPABILITY_FILE_EXTENSIONS: &[&str] = &["json", "toml"]; + +/// Known folder name of the capability schemas +const CAPABILITIES_SCHEMA_FOLDER_NAME: &str = "schemas"; + +const CORE_PLUGIN_PERMISSIONS_TOKEN: &str = "__CORE_PLUGIN__"; + +/// Capability formats accepted in a capability file. +#[derive(Deserialize, schemars::JsonSchema)] +#[serde(untagged)] +pub enum CapabilityFile { + /// A single capability. + Capability(Capability), + /// A list of capabilities. + List { + /// The list of capabilities. + capabilities: Vec, + }, +} + +/// Write the permissions to a temporary directory and pass it to the immediate consuming crate. +pub fn define_permissions(pattern: &str, pkg_name: &str) -> Result, Error> { + let permission_files = glob::glob(pattern)? + .flatten() + .flat_map(|p| p.canonicalize()) + // filter extension + .filter(|p| { + p.extension() + .and_then(|e| e.to_str()) + .map(|e| PERMISSION_FILE_EXTENSIONS.contains(&e)) + .unwrap_or_default() + }) + // filter schema file + .filter(|p| { + p.file_name() + .map(|name| name != PERMISSION_SCHEMA_FILE_NAME) + .unwrap_or(true) + }) + .collect::>(); + + for path in &permission_files { + println!("cargo:rerun-if-changed={}", path.display()); + } + + let permission_files_path = std::env::temp_dir().join(format!("{}-permission-files", pkg_name)); + std::fs::write( + &permission_files_path, + serde_json::to_string(&permission_files)?, + ) + .map_err(Error::WriteFile)?; + + if let Some(plugin_name) = pkg_name.strip_prefix("tauri:") { + println!( + "cargo:{plugin_name}{CORE_PLUGIN_PERMISSIONS_TOKEN}_{PERMISSION_FILES_PATH_KEY}={}", + permission_files_path.display() + ); + } else { + println!( + "cargo:{PERMISSION_FILES_PATH_KEY}={}", + permission_files_path.display() + ); + } + + parse_permissions(permission_files) +} + +/// Parses all capability files with the given glob pattern. +pub fn parse_capabilities( + capabilities_path_pattern: &str, +) -> Result, Error> { + let mut capabilities_map = BTreeMap::new(); + + for path in glob::glob(capabilities_path_pattern)? + .flatten() // filter extension + .filter(|p| { + p.extension() + .and_then(|e| e.to_str()) + .map(|e| CAPABILITY_FILE_EXTENSIONS.contains(&e)) + .unwrap_or_default() + }) + // filter schema files + .filter(|p| p.parent().unwrap().file_name().unwrap() != CAPABILITIES_SCHEMA_FOLDER_NAME) + { + println!("cargo:rerun-if-changed={}", path.display()); + + let capability_file = std::fs::read_to_string(&path).map_err(Error::ReadFile)?; + let ext = path.extension().unwrap().to_string_lossy().to_string(); + let capability: CapabilityFile = match ext.as_str() { + "toml" => toml::from_str(&capability_file)?, + "json" => serde_json::from_str(&capability_file)?, + _ => return Err(Error::UnknownCapabilityFormat(ext)), + }; + + match capability { + CapabilityFile::Capability(capability) => { + capabilities_map.insert(capability.identifier.clone(), capability); + } + CapabilityFile::List { capabilities } => { + for capability in capabilities { + capabilities_map.insert(capability.identifier.clone(), capability); + } + } + } + } + + Ok(capabilities_map) +} + +fn permissions_schema(permissions: &[PermissionFile]) -> RootSchema { + let mut schema = schema_for!(PermissionFile); + + fn schema_from(id: &str, description: Option<&str>) -> Schema { + Schema::Object(SchemaObject { + metadata: Some(Box::new(Metadata { + description: description.map(|d| format!("{id} -> {d}")), + ..Default::default() + })), + instance_type: Some(InstanceType::String.into()), + enum_values: Some(vec![serde_json::Value::String(id.into())]), + ..Default::default() + }) + } + + let mut permission_schemas = Vec::new(); + for file in permissions { + if let Some(permission) = &file.default { + permission_schemas.push(schema_from("default", permission.description.as_deref())); + } + + permission_schemas.extend( + file + .set + .iter() + .map(|set| schema_from(&set.identifier, Some(set.description.as_str()))) + .collect::>(), + ); + + permission_schemas.extend( + file + .permission + .iter() + .map(|permission| schema_from(&permission.identifier, permission.description.as_deref())) + .collect::>(), + ); + } + + if let Some(Schema::Object(obj)) = schema.definitions.get_mut("PermissionSet") { + if let Some(Schema::Object(permissions_prop_schema)) = + obj.object().properties.get_mut("permissions") + { + permissions_prop_schema.array().items.replace( + Schema::Object(SchemaObject { + reference: Some("#/definitions/PermissionKind".into()), + ..Default::default() + }) + .into(), + ); + + schema.definitions.insert( + "PermissionKind".into(), + Schema::Object(SchemaObject { + instance_type: Some(InstanceType::String.into()), + subschemas: Some(Box::new(SubschemaValidation { + one_of: Some(permission_schemas), + ..Default::default() + })), + ..Default::default() + }), + ); + } + } + + schema +} + +/// Generate and write a schema based on the format of a [`PermissionFile`]. +pub fn generate_schema>( + permissions: &[PermissionFile], + out_dir: P, +) -> Result<(), Error> { + let schema = permissions_schema(permissions); + let schema_str = serde_json::to_string_pretty(&schema).unwrap(); + + let out_dir = out_dir.as_ref(); + create_dir_all(out_dir).expect("unable to create schema output directory"); + + let mut schema_file = BufWriter::new( + File::create(out_dir.join(PERMISSION_SCHEMA_FILE_NAME)).map_err(Error::CreateFile)?, + ); + write!(schema_file, "{schema_str}").map_err(Error::WriteFile)?; + Ok(()) +} + +/// Read all permissions listed from the defined cargo cfg key value. +pub fn read_permissions() -> Result>, Error> { + let mut permissions_map = HashMap::new(); + + for (key, value) in vars_os() { + let key = key.to_string_lossy(); + + if let Some(plugin_crate_name_var) = key + .strip_prefix("DEP_") + .and_then(|v| v.strip_suffix(&format!("_{PERMISSION_FILES_PATH_KEY}"))) + .map(|v| { + v.strip_suffix(CORE_PLUGIN_PERMISSIONS_TOKEN) + .and_then(|v| v.strip_prefix("TAURI_")) + .unwrap_or(v) + }) + { + let permissions_path = PathBuf::from(value); + let permissions_str = std::fs::read_to_string(&permissions_path).map_err(Error::ReadFile)?; + let permissions: Vec = serde_json::from_str(&permissions_str)?; + let permissions = parse_permissions(permissions)?; + + let plugin_crate_name = plugin_crate_name_var.to_lowercase().replace('_', "-"); + permissions_map.insert( + plugin_crate_name + .strip_prefix("tauri-plugin-") + .map(|n| n.to_string()) + .unwrap_or(plugin_crate_name), + permissions, + ); + } + } + + Ok(permissions_map) +} + +fn parse_permissions(paths: Vec) -> Result, Error> { + let mut permissions = Vec::new(); + for path in paths { + let permission_file = std::fs::read_to_string(&path).map_err(Error::ReadFile)?; + let ext = path.extension().unwrap().to_string_lossy().to_string(); + let permission: PermissionFile = match ext.as_str() { + "toml" => toml::from_str(&permission_file)?, + "json" => serde_json::from_str(&permission_file)?, + _ => return Err(Error::UnknownPermissionFormat(ext)), + }; + permissions.push(permission); + } + Ok(permissions) +} + +/// Autogenerate permission files for a list of commands. +pub fn autogenerate_command_permissions(path: &Path, commands: &[&str], license_header: &str) { + if !path.exists() { + create_dir_all(path).expect("unable to create autogenerated commands dir"); + } + + let cwd = current_dir().unwrap(); + let components_len = path.strip_prefix(&cwd).unwrap_or(path).components().count(); + let schema_path = (1..components_len) + .map(|_| "..") + .collect::() + .join(PERMISSION_SCHEMA_FILE_NAME); + + for command in commands { + let slugified_command = command.replace('_', "-"); + let toml = format!( + r###"{license_header}# Automatically generated - DO NOT EDIT! + +"$schema" = "{schema_path}" + +[[permission]] +identifier = "allow-{slugified_command}" +description = "Enables the {command} command without any pre-configured scope." +commands.allow = ["{command}"] + +[[permission]] +identifier = "deny-{slugified_command}" +description = "Denies the {command} command without any pre-configured scope." +commands.deny = ["{command}"] +"###, + command = command, + slugified_command = slugified_command, + schema_path = schema_path.display().to_string().replace('\\', "\\\\") + ); + + let out_path = path.join(format!("{command}.toml")); + if toml != read_to_string(&out_path).unwrap_or_default() { + std::fs::write(out_path, toml) + .unwrap_or_else(|_| panic!("unable to autogenerate ${command}.toml")); + } + } +} diff --git a/core/tauri-utils/src/acl/capability.rs b/core/tauri-utils/src/acl/capability.rs new file mode 100644 index 000000000000..5d163175ed7f --- /dev/null +++ b/core/tauri-utils/src/acl/capability.rs @@ -0,0 +1,68 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//! End-user abstraction for selecting permissions a window has access to. + +use crate::{acl::Identifier, platform::Target}; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Serialize, Deserialize)] + +/// A set of direct capabilities grouped together under a new name. +pub struct CapabilitySet { + inner: Vec, +} + +/// a grouping and boundary mechanism developers can use to separate windows or plugins functionality from each other at runtime. +/// +/// If a window is not matching any capability then it has no access to the IPC layer at all. +/// +/// This can be done to create trust groups and reduce impact of vulnerabilities in certain plugins or windows. +/// Windows can be added to a capability by exact name or glob patterns like *, admin-* or main-window. +#[derive(Debug, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +pub struct Capability { + /// Identifier of the capability. + pub identifier: String, + /// Description of the capability. + #[serde(default)] + pub description: String, + /// Execution context of the capability. + /// + /// At runtime, Tauri filters the IPC command together with the context to determine wheter it is allowed or not and its scope. + #[serde(default)] + pub context: CapabilityContext, + /// List of windows that uses this capability. Can be a glob pattern. + pub windows: Vec, + /// List of permissions attached to this capability. Must include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. + pub permissions: Vec, + /// Target platforms this capability applies. By default all platforms applies. + #[serde(default = "default_platforms")] + pub platforms: Vec, +} + +fn default_platforms() -> Vec { + vec![ + Target::Linux, + Target::MacOS, + Target::Windows, + Target::Android, + Target::Ios, + ] +} + +/// Context of the capability. +#[derive(Debug, Default, Clone, Serialize, Deserialize, Eq, PartialEq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub enum CapabilityContext { + /// Capability refers to local URL usage. + #[default] + Local, + /// Capability refers to remote usage. + Remote { + /// Remote domains this capability refers to. Can use glob patterns. + domains: Vec, + }, +} diff --git a/core/tauri-utils/src/acl/identifier.rs b/core/tauri-utils/src/acl/identifier.rs new file mode 100644 index 000000000000..75c1d937ac20 --- /dev/null +++ b/core/tauri-utils/src/acl/identifier.rs @@ -0,0 +1,262 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//! Identifier for plugins. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use std::num::NonZeroU8; +use thiserror::Error; + +const IDENTIFIER_SEPARATOR: u8 = b':'; +const PLUGIN_PREFIX: &str = "tauri-plugin-"; + +// https://doc.rust-lang.org/cargo/reference/manifest.html#the-name-field +const MAX_LEN_PREFIX: usize = 64 - PLUGIN_PREFIX.len(); +const MAX_LEN_BASE: usize = 64; +const MAX_LEN_IDENTIFIER: usize = MAX_LEN_PREFIX + 1 + MAX_LEN_BASE; + +/// Plugin identifier. +#[derive(Debug, Clone)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +pub struct Identifier { + inner: String, + separator: Option, +} + +impl AsRef for Identifier { + #[inline(always)] + fn as_ref(&self) -> &str { + &self.inner + } +} + +impl Identifier { + /// Get the identifier str. + #[inline(always)] + pub fn get(&self) -> &str { + self.as_ref() + } + + /// Get the identifier without prefix. + pub fn get_base(&self) -> &str { + match self.separator_index() { + None => self.get(), + Some(i) => &self.inner[i + 1..], + } + } + + /// Get the prefix of the identifier. + pub fn get_prefix(&self) -> Option<&str> { + self.separator_index().map(|i| &self.inner[0..i]) + } + + /// Set the identifier prefix. + pub fn set_prefix(&mut self) -> Result<(), ParseIdentifierError> { + todo!() + } + + /// Get the identifier string and its separator. + pub fn into_inner(self) -> (String, Option) { + (self.inner, self.separator) + } + + fn separator_index(&self) -> Option { + self.separator.map(|i| i.get() as usize) + } +} + +#[derive(Debug)] +enum ValidByte { + Separator, + Byte(u8), +} + +impl ValidByte { + fn lower_alpha(byte: u8) -> Option { + byte.is_ascii_lowercase().then_some(Self::Byte(byte)) + } + + fn lower_alpha_hyphen(byte: u8) -> Option { + matches!(byte, b'a'..=b'z' | b'-').then_some(Self::Byte(byte)) + } + + fn next(&self, next: u8) -> Option { + match (self, next) { + (ValidByte::Byte(b'-'), IDENTIFIER_SEPARATOR) => None, + (ValidByte::Separator, b'-') => None, + + (_, IDENTIFIER_SEPARATOR) => Some(ValidByte::Separator), + (ValidByte::Separator, next) => ValidByte::lower_alpha(next), + (ValidByte::Byte(b'-'), next) => ValidByte::lower_alpha(next), + (ValidByte::Byte(_), next) => ValidByte::lower_alpha_hyphen(next), + } + } +} + +/// Errors that can happen when parsing an identifier. +#[derive(Debug, Error)] +pub enum ParseIdentifierError { + /// Identifier start with the plugin prefix. + #[error("identifiers cannot start with {}", PLUGIN_PREFIX)] + StartsWithTauriPlugin, + + /// Identifier empty. + #[error("identifiers cannot be empty")] + Empty, + + /// Identifier is too long. + #[error("identifiers cannot be longer than {}, found {0}", MAX_LEN_IDENTIFIER)] + Humungous(usize), + + /// Identifier is not in a valid format. + #[error("identifiers can only include lowercase ASCII, hyphens which are not leading or trailing, and a single colon if using a prefix")] + InvalidFormat, + + /// Identifier has multiple separators. + #[error( + "identifiers can only include a single separator '{}'", + IDENTIFIER_SEPARATOR + )] + MultipleSeparators, + + /// Identifier has a trailing hyphen. + #[error("identifiers cannot have a trailing hyphen")] + TrailingHyphen, + + /// Identifier has a prefix without a base. + #[error("identifiers cannot have a prefix without a base")] + PrefixWithoutBase, +} + +impl TryFrom for Identifier { + type Error = ParseIdentifierError; + + fn try_from(value: String) -> Result { + if value.starts_with(PLUGIN_PREFIX) { + return Err(Self::Error::StartsWithTauriPlugin); + } + + if value.is_empty() { + return Err(Self::Error::Empty); + } + + let mut bytes = value.bytes(); + if bytes.len() > MAX_LEN_IDENTIFIER { + return Err(Self::Error::Humungous(bytes.len())); + } + + // grab the first byte only before parsing the rest + let mut prev = bytes + .next() + .and_then(ValidByte::lower_alpha) + .ok_or(Self::Error::InvalidFormat)?; + + let mut idx = 0; + let mut seperator = None; + for byte in bytes { + idx += 1; // we already consumed first item + match prev.next(byte) { + None => return Err(Self::Error::InvalidFormat), + Some(next @ ValidByte::Byte(_)) => prev = next, + Some(ValidByte::Separator) => { + if seperator.is_none() { + // safe to unwrap because idx starts at 1 and cannot go over MAX_IDENTIFIER_LEN + seperator = Some(idx.try_into().unwrap()); + prev = ValidByte::Separator + } else { + return Err(Self::Error::MultipleSeparators); + } + } + } + } + + match prev { + // empty base + ValidByte::Separator => return Err(Self::Error::PrefixWithoutBase), + + // trailing hyphen + ValidByte::Byte(b'-') => return Err(Self::Error::TrailingHyphen), + + _ => (), + } + + Ok(Self { + inner: value, + separator: seperator, + }) + } +} + +impl<'de> Deserialize<'de> for Identifier { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + Self::try_from(String::deserialize(deserializer)?).map_err(serde::de::Error::custom) + } +} + +impl Serialize for Identifier { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.get()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn ident(s: impl Into) -> Result { + Identifier::try_from(s.into()) + } + + #[test] + fn max_len_fits_in_u8() { + assert!(MAX_LEN_IDENTIFIER < u8::MAX as usize) + } + + #[test] + fn format() { + assert!(ident("prefix:base").is_ok()); + + // bad + assert!(ident("tauri-plugin-prefix:base").is_err()); + + assert!(ident("-prefix-:-base-").is_err()); + assert!(ident("-prefix:base").is_err()); + assert!(ident("prefix-:base").is_err()); + assert!(ident("prefix:-base").is_err()); + assert!(ident("prefix:base-").is_err()); + + assert!(ident("pre--fix:base--sep").is_err()); + assert!(ident("prefix:base--sep").is_err()); + assert!(ident("pre--fix:base").is_err()); + + assert!(ident("prefix::base").is_err()); + assert!(ident(":base").is_err()); + assert!(ident("prefix:").is_err()); + assert!(ident(":prefix:base:").is_err()); + assert!(ident("base:").is_err()); + + assert!(ident("").is_err()); + assert!(ident("💩").is_err()); + + assert!(ident("a".repeat(MAX_LEN_IDENTIFIER + 1)).is_err()); + } + + #[test] + fn base() { + assert_eq!(ident("prefix:base").unwrap().get_base(), "base"); + assert_eq!(ident("base").unwrap().get_base(), "base"); + } + + #[test] + fn prefix() { + assert_eq!(ident("prefix:base").unwrap().get_prefix(), Some("prefix")); + assert_eq!(ident("base").unwrap().get_prefix(), None); + } +} diff --git a/core/tauri-utils/src/acl/mod.rs b/core/tauri-utils/src/acl/mod.rs new file mode 100644 index 000000000000..350eb93e704e --- /dev/null +++ b/core/tauri-utils/src/acl/mod.rs @@ -0,0 +1,220 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//! Access Control List types. + +use glob::Pattern; +use serde::{Deserialize, Serialize}; +use std::num::NonZeroU64; +use thiserror::Error; + +pub use self::{identifier::*, value::*}; + +#[cfg(feature = "build")] +pub mod build; +pub mod capability; +pub mod identifier; +pub mod plugin; +pub mod resolved; +pub mod value; + +/// Possible errors while processing ACL files. +#[derive(Debug, Error)] +pub enum Error { + /// Could not find an environmental variable that is set inside of build scripts. + /// + /// Whatever generated this should be called inside of a build script. + #[error("expected build script env var {0}, but it was not found - ensure this is called in a build script")] + BuildVar(&'static str), + + /// Plugin name doesn't follow Tauri standards + #[error("plugin names cannot contain underscores")] + CrateName, + + /// The links field in the manifest **MUST** be set and match the name of the crate. + #[error("package.links field in the Cargo manifest is not set, it should be set to the same as package.name")] + LinksMissing, + + /// The links field in the manifest **MUST** match the name of the crate. + #[error( + "package.links field in the Cargo manifest MUST be set to the same value as package.name" + )] + LinksName, + + /// IO error while reading a file + #[error("failed to read file: {0}")] + ReadFile(std::io::Error), + + /// IO error while writing a file + #[error("failed to write file: {0}")] + WriteFile(std::io::Error), + + /// IO error while creating a file + #[error("failed to create file: {0}")] + CreateFile(std::io::Error), + + /// [`cargo_metadata`] was not able to complete successfully + #[cfg(feature = "build")] + #[error("failed to execute: {0}")] + Metadata(#[from] ::cargo_metadata::Error), + + /// Invalid glob + #[error("failed to run glob: {0}")] + Glob(#[from] glob::PatternError), + + /// Invalid TOML encountered + #[error("failed to parse TOML: {0}")] + Toml(#[from] toml::de::Error), + + /// Invalid JSON encountered + #[error("failed to parse JSON: {0}")] + Json(#[from] serde_json::Error), + + /// Invalid permissions file format + #[error("unknown permission format {0}")] + UnknownPermissionFormat(String), + + /// Invalid capabilities file format + #[error("unknown capability format {0}")] + UnknownCapabilityFormat(String), + + /// Permission referenced in set not found. + #[error("permission {permission} not found from set {set}")] + SetPermissionNotFound { + /// Permission identifier. + permission: String, + /// Set identifier. + set: String, + }, + + /// Plugin has no default permission. + #[error("plugin {plugin} has no default permission")] + MissingDefaultPermission { + /// Plugin name. + plugin: String, + }, + + /// Unknown plugin. + #[error("unknown plugin {plugin}, expected one of {available}")] + UnknownPlugin { + /// Plugin name. + plugin: String, + /// Available plugins. + available: String, + }, + + /// Unknown permission. + #[error("unknown permission {permission} for plugin {plugin}")] + UnknownPermission { + /// Plugin name. + plugin: String, + + /// Permission identifier. + permission: String, + }, +} + +/// Allowed and denied commands inside a permission. +/// +/// If two commands clash inside of `allow` and `deny`, it should be denied by default. +#[derive(Debug, Default, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +pub struct Commands { + /// Allowed command. + #[serde(default)] + pub allow: Vec, + + /// Denied command, which takes priority. + #[serde(default)] + pub deny: Vec, +} + +/// A restriction of the command/endpoint functionality. +/// +/// It can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command. +/// +/// The scope is passed to the command and handled/enforced by the command itself. +#[derive(Debug, Default, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +pub struct Scopes { + /// Data that defines what is allowed by the scope. + pub allow: Option>, + /// Data that defines what is denied by the scope. + pub deny: Option>, +} + +/// Descriptions of explicit privileges of commands. +/// +/// It can enable commands to be accessible in the frontend of the application. +/// +/// If the scope is defined it can be used to fine grain control the access of individual or multiple commands. +#[derive(Debug, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +pub struct Permission { + /// The version of the permission. + pub version: Option, + + /// A unique identifier for the permission. + pub identifier: String, + + /// Human-readable description of what the permission does. + pub description: Option, + + /// Allowed or denied commands when using this permission. + #[serde(default)] + pub commands: Commands, + + /// Allowed or denied scoped when using this permission. + #[serde(default)] + pub scope: Scopes, +} + +/// A set of direct permissions grouped together under a new name. +#[derive(Debug, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +pub struct PermissionSet { + /// A unique identifier for the permission. + pub identifier: String, + + /// Human-readable description of what the permission does. + pub description: String, + + /// All permissions this set contains. + pub permissions: Vec, +} + +/// Execution context of an IPC call. +#[derive(Debug, Clone, Eq, PartialEq, PartialOrd, Ord, Hash)] +pub enum ExecutionContext { + /// A local URL is used (the Tauri app URL). + Local, + /// Remote URL is tring to use the IPC. + Remote { + /// The domain trying to access the IPC (glob pattern). + domain: Pattern, + }, +} + +#[cfg(feature = "build")] +mod build_ { + use super::*; + use proc_macro2::TokenStream; + use quote::{quote, ToTokens, TokenStreamExt}; + + impl ToTokens for ExecutionContext { + fn to_tokens(&self, tokens: &mut TokenStream) { + let prefix = quote! { ::tauri::utils::acl::ExecutionContext }; + + tokens.append_all(match self { + Self::Local => { + quote! { #prefix::Local } + } + Self::Remote { domain } => { + let domain = domain.as_str(); + quote! { #prefix::Remote { domain: #domain.parse().unwrap() } } + } + }); + } + } +} diff --git a/core/tauri-utils/src/acl/plugin.rs b/core/tauri-utils/src/acl/plugin.rs new file mode 100644 index 000000000000..d825a631cad0 --- /dev/null +++ b/core/tauri-utils/src/acl/plugin.rs @@ -0,0 +1,106 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//! Plugin ACL types. + +use std::{collections::HashMap, num::NonZeroU64}; + +use super::{Permission, PermissionSet}; +use serde::{Deserialize, Serialize}; + +/// The default permission set of the plugin. +/// +/// Works similarly to a permission with the "default" identifier. +#[derive(Debug, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +pub struct DefaultPermission { + /// The version of the permission. + pub version: Option, + + /// Human-readable description of what the permission does. + pub description: Option, + + /// All permissions this set contains. + pub permissions: Vec, +} + +/// Permission file that can define a default permission, a set of permissions or a list of inlined permissions. +#[derive(Debug, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +pub struct PermissionFile { + /// The default permission set for the plugin + pub default: Option, + + /// A list of permissions sets defined + #[serde(default)] + pub set: Vec, + + /// Test something!! + pub test: Option, + + /// A list of inlined permissions + #[serde(default)] + pub permission: Vec, +} + +/// Plugin manifest. +#[derive(Debug, Serialize, Deserialize)] +pub struct Manifest { + /// Default permission. + pub default_permission: Option, + /// Plugin permissions. + pub permissions: HashMap, + /// Plugin permission sets. + pub permission_sets: HashMap, +} + +impl Manifest { + /// Creates a new manifest from a list of permission files. + pub fn from_files(permission_files: Vec) -> Self { + let mut manifest = Self { + default_permission: None, + permissions: HashMap::new(), + permission_sets: HashMap::new(), + }; + + for permission_file in permission_files { + if let Some(default) = permission_file.default { + manifest.default_permission.replace(PermissionSet { + identifier: "default".into(), + description: default + .description + .unwrap_or_else(|| "Default plugin permissions.".to_string()), + permissions: default.permissions, + }); + } + + manifest.permissions.extend( + permission_file + .permission + .into_iter() + .map(|p| (p.identifier.clone(), p)) + .collect::>(), + ); + + manifest.permission_sets.extend( + permission_file + .set + .into_iter() + .map(|set| { + ( + set.identifier.clone(), + PermissionSet { + identifier: set.identifier, + description: set.description, + permissions: set.permissions, + }, + ) + }) + .collect::>(), + ); + } + + manifest + } +} diff --git a/core/tauri-utils/src/acl/resolved.rs b/core/tauri-utils/src/acl/resolved.rs new file mode 100644 index 000000000000..40224b7a632a --- /dev/null +++ b/core/tauri-utils/src/acl/resolved.rs @@ -0,0 +1,397 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//! Resolved ACL for runtime usage. + +use std::{ + collections::{hash_map::DefaultHasher, BTreeMap, HashSet}, + hash::{Hash, Hasher}, +}; + +use glob::Pattern; + +use crate::platform::Target; + +use super::{ + capability::{Capability, CapabilityContext}, + plugin::Manifest, + Error, ExecutionContext, Permission, PermissionSet, Value, +}; + +/// A key for a scope, used to link a [`ResolvedCommand#structfield.scope`] to the store [`Resolved#structfield.scopes`]. +pub type ScopeKey = usize; + +/// A resolved command permission. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct ResolvedCommand { + /// The list of window label patterns that is allowed to run this command. + pub windows: Vec, + /// The reference of the scope that is associated with this command. See [`Resolved#structfield.scopes`]. + pub scope: Option, +} + +/// A resolved scope. Merges all scopes defined for a single command. +#[derive(Debug, Default)] +pub struct ResolvedScope { + /// Allows something on the command. + pub allow: Vec, + /// Denies something on the command. + pub deny: Vec, +} + +/// A command key for the map of allowed and denied commands. +/// Takes into consideration the command name and the execution context. +#[derive(Debug, Clone, Eq, PartialEq, PartialOrd, Ord, Hash)] +pub struct CommandKey { + /// The full command name. + pub name: String, + /// The context of the command. + pub context: ExecutionContext, +} + +/// Resolved access control list. +#[derive(Debug)] +pub struct Resolved { + /// The commands that are allowed. Map each command with its context to a [`ResolvedCommand`]. + pub allowed_commands: BTreeMap, + /// The commands that are denied. Map each command with its context to a [`ResolvedCommand`]. + pub denied_commands: BTreeMap, + /// The store of scopes referenced by a [`ResolvedCommand`]. + pub command_scope: BTreeMap, + /// The global scope. + pub global_scope: ResolvedScope, +} + +impl Resolved { + /// Resolves the ACL for the given plugin permissions and app capabilities. + pub fn resolve( + acl: BTreeMap, + capabilities: BTreeMap, + target: Target, + ) -> Result { + let mut allowed_commands = BTreeMap::new(); + let mut denied_commands = BTreeMap::new(); + + let mut current_scope_id = 0; + let mut command_scopes = BTreeMap::new(); + let mut global_scope = Vec::new(); + + // resolve commands + for capability in capabilities.values() { + if !capability.platforms.contains(&target) { + continue; + } + + for permission_id in &capability.permissions { + let permission_name = permission_id.get_base(); + + if let Some(plugin_name) = permission_id.get_prefix() { + let permissions = get_permissions(plugin_name, permission_name, &acl)?; + + for permission in permissions { + if permission.commands.allow.is_empty() && permission.commands.deny.is_empty() { + // global scope + global_scope.push(permission.scope.clone()); + } else { + let has_scope = permission.scope.allow.is_some() || permission.scope.deny.is_some(); + if has_scope { + current_scope_id += 1; + command_scopes.insert(current_scope_id, permission.scope.clone()); + } + + let scope_id = if has_scope { + Some(current_scope_id) + } else { + None + }; + + for allowed_command in &permission.commands.allow { + resolve_command( + &mut allowed_commands, + format!("plugin:{plugin_name}|{allowed_command}"), + capability, + scope_id, + ); + } + + for denied_command in &permission.commands.deny { + resolve_command( + &mut denied_commands, + format!("plugin:{plugin_name}|{denied_command}"), + capability, + scope_id, + ); + } + } + } + } + } + } + + // resolve scopes + let mut resolved_scopes = BTreeMap::new(); + + for allowed in allowed_commands.values_mut() { + if !allowed.scope.is_empty() { + allowed.scope.sort(); + + let mut hasher = DefaultHasher::new(); + allowed.scope.hash(&mut hasher); + let hash = hasher.finish() as usize; + + allowed.resolved_scope_key.replace(hash); + + let resolved_scope = ResolvedScope { + allow: allowed + .scope + .iter() + .flat_map(|s| command_scopes.get(s).unwrap().allow.clone()) + .flatten() + .collect(), + deny: allowed + .scope + .iter() + .flat_map(|s| command_scopes.get(s).unwrap().deny.clone()) + .flatten() + .collect(), + }; + + resolved_scopes.insert(hash, resolved_scope); + } + } + + let global_scope = ResolvedScope { + allow: global_scope + .iter_mut() + .flat_map(|s| s.allow.take()) + .flatten() + .collect(), + deny: global_scope + .iter_mut() + .flat_map(|s| s.deny.take()) + .flatten() + .collect(), + }; + + let resolved = Self { + allowed_commands: allowed_commands + .into_iter() + .map(|(key, cmd)| { + Ok(( + key, + ResolvedCommand { + windows: parse_window_patterns(cmd.windows)?, + scope: cmd.resolved_scope_key, + }, + )) + }) + .collect::>()?, + denied_commands: denied_commands + .into_iter() + .map(|(key, cmd)| { + Ok(( + key, + ResolvedCommand { + windows: parse_window_patterns(cmd.windows)?, + scope: cmd.resolved_scope_key, + }, + )) + }) + .collect::>()?, + command_scope: resolved_scopes, + global_scope, + }; + + Ok(resolved) + } +} + +fn parse_window_patterns(windows: HashSet) -> Result, Error> { + let mut patterns = Vec::new(); + for window in windows { + patterns.push(glob::Pattern::new(&window)?); + } + Ok(patterns) +} + +#[derive(Debug, Default)] +struct ResolvedCommandTemp { + pub windows: HashSet, + pub scope: Vec, + pub resolved_scope_key: Option, +} + +fn resolve_command( + commands: &mut BTreeMap, + command: String, + capability: &Capability, + scope_id: Option, +) { + let contexts = match &capability.context { + CapabilityContext::Local => { + vec![ExecutionContext::Local] + } + CapabilityContext::Remote { domains } => domains + .iter() + .map(|domain| ExecutionContext::Remote { + domain: Pattern::new(domain) + .unwrap_or_else(|e| panic!("invalid glob pattern for remote domain {domain}: {e}")), + }) + .collect(), + }; + + for context in contexts { + let resolved = commands + .entry(CommandKey { + name: command.clone(), + context, + }) + .or_default(); + + resolved.windows.extend(capability.windows.clone()); + if let Some(id) = scope_id { + resolved.scope.push(id); + } + } +} + +// get the permissions from a permission set +fn get_permission_set_permissions<'a>( + manifest: &'a Manifest, + set: &'a PermissionSet, +) -> Result, Error> { + let mut permissions = Vec::new(); + + for p in &set.permissions { + if let Some(permission) = manifest.permissions.get(p) { + permissions.push(permission); + } else if let Some(permission_set) = manifest.permission_sets.get(p) { + permissions.extend(get_permission_set_permissions(manifest, permission_set)?); + } else { + return Err(Error::SetPermissionNotFound { + permission: p.to_string(), + set: set.identifier.clone(), + }); + } + } + + Ok(permissions) +} + +fn get_permissions<'a>( + plugin_name: &'a str, + permission_name: &'a str, + acl: &'a BTreeMap, +) -> Result, Error> { + let manifest = acl.get(plugin_name).ok_or_else(|| Error::UnknownPlugin { + plugin: plugin_name.to_string(), + available: acl.keys().cloned().collect::>().join(", "), + })?; + + if permission_name == "default" { + manifest + .default_permission + .as_ref() + .ok_or_else(|| Error::UnknownPermission { + plugin: plugin_name.to_string(), + permission: permission_name.to_string(), + }) + .and_then(|default| get_permission_set_permissions(manifest, default)) + } else if let Some(set) = manifest.permission_sets.get(permission_name) { + get_permission_set_permissions(manifest, set) + } else if let Some(permission) = manifest.permissions.get(permission_name) { + Ok(vec![permission]) + } else { + Err(Error::UnknownPermission { + plugin: plugin_name.to_string(), + permission: permission_name.to_string(), + }) + } +} + +#[cfg(feature = "build")] +mod build { + use proc_macro2::TokenStream; + use quote::{quote, ToTokens, TokenStreamExt}; + use std::convert::identity; + + use super::*; + use crate::tokens::*; + + /// Write a `TokenStream` of the `$struct`'s fields to the `$tokens`. + /// + /// All fields must represent a binding of the same name that implements `ToTokens`. + macro_rules! literal_struct { + ($tokens:ident, $struct:ident, $($field:ident),+) => { + $tokens.append_all(quote! { + ::tauri::utils::acl::resolved::$struct { + $($field: #$field),+ + } + }) + }; + } + + impl ToTokens for CommandKey { + fn to_tokens(&self, tokens: &mut TokenStream) { + let name = str_lit(&self.name); + let context = &self.context; + literal_struct!(tokens, CommandKey, name, context) + } + } + + impl ToTokens for ResolvedCommand { + fn to_tokens(&self, tokens: &mut TokenStream) { + let windows = vec_lit(&self.windows, |window| { + let w = window.as_str(); + quote!(#w.parse().unwrap()) + }); + let scope = opt_lit(self.scope.as_ref()); + literal_struct!(tokens, ResolvedCommand, windows, scope) + } + } + + impl ToTokens for ResolvedScope { + fn to_tokens(&self, tokens: &mut TokenStream) { + let allow = vec_lit(&self.allow, identity); + let deny = vec_lit(&self.deny, identity); + literal_struct!(tokens, ResolvedScope, allow, deny) + } + } + + impl ToTokens for Resolved { + fn to_tokens(&self, tokens: &mut TokenStream) { + let allowed_commands = map_lit( + quote! { ::std::collections::BTreeMap }, + &self.allowed_commands, + identity, + identity, + ); + + let denied_commands = map_lit( + quote! { ::std::collections::BTreeMap }, + &self.denied_commands, + identity, + identity, + ); + + let command_scope = map_lit( + quote! { ::std::collections::BTreeMap }, + &self.command_scope, + identity, + identity, + ); + + let global_scope = &self.global_scope; + + literal_struct!( + tokens, + Resolved, + allowed_commands, + denied_commands, + command_scope, + global_scope + ) + } + } +} diff --git a/core/tauri-utils/src/acl/value.rs b/core/tauri-utils/src/acl/value.rs new file mode 100644 index 000000000000..88908ecd3a4c --- /dev/null +++ b/core/tauri-utils/src/acl/value.rs @@ -0,0 +1,160 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//! A [`Value`] that is used instead of [`toml::Value`] or [`serde_json::Value`] +//! to support both formats. + +use std::collections::BTreeMap; +use std::fmt::Debug; + +use serde::de::DeserializeOwned; +use serde::{Deserialize, Serialize}; + +/// A valid ACL number. +#[derive(Debug, Serialize, Deserialize, Copy, Clone, PartialOrd, PartialEq)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(untagged)] +pub enum Number { + /// Represents an [`i64`]. + Int(i64), + + /// Represents a [`f64`]. + Float(f64), +} + +impl From for Number { + #[inline(always)] + fn from(value: i64) -> Self { + Self::Int(value) + } +} + +impl From for Number { + #[inline(always)] + fn from(value: f64) -> Self { + Self::Float(value) + } +} + +/// All supported ACL values. +#[derive(Debug, Serialize, Deserialize, Clone, PartialOrd, PartialEq)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(untagged)] +pub enum Value { + /// Represents a [`bool`]. + Bool(bool), + + /// Represents a valid ACL [`Number`]. + Number(Number), + + /// Represents a [`String`]. + String(String), + + /// Represents a list of other [`Value`]s. + List(Vec), + + /// Represents a map of [`String`] keys to [`Value`]s. + Map(BTreeMap), +} + +impl Value { + /// TODO: implement [`serde::Deserializer`] directly to avoid serializing then deserializing + pub fn deserialize(&self) -> Option { + dbg!(serde_json::to_string(self)) + .ok() + .and_then(|s| dbg!(serde_json::from_str(&s).ok())) + } +} + +impl From for Value { + #[inline(always)] + fn from(value: bool) -> Self { + Self::Bool(value) + } +} + +impl> From for Value { + #[inline(always)] + fn from(value: T) -> Self { + Self::Number(value.into()) + } +} + +impl From for Value { + #[inline(always)] + fn from(value: String) -> Self { + Value::String(value) + } +} + +impl From for Value { + #[inline(always)] + fn from(value: toml::Value) -> Self { + use toml::Value as Toml; + + match value { + Toml::String(s) => s.into(), + Toml::Integer(i) => i.into(), + Toml::Float(f) => f.into(), + Toml::Boolean(b) => b.into(), + Toml::Datetime(d) => d.to_string().into(), + Toml::Array(a) => Value::List(a.into_iter().map(Value::from).collect()), + Toml::Table(t) => Value::Map(t.into_iter().map(|(k, v)| (k, v.into())).collect()), + } + } +} + +#[cfg(feature = "build")] +mod build { + use std::convert::identity; + + use crate::tokens::*; + + use super::*; + use proc_macro2::TokenStream; + use quote::{quote, ToTokens, TokenStreamExt}; + + impl ToTokens for Number { + fn to_tokens(&self, tokens: &mut TokenStream) { + let prefix = quote! { ::tauri::utils::acl::Number }; + + tokens.append_all(match self { + Self::Int(i) => { + quote! { #prefix::Int(#i) } + } + Self::Float(f) => { + quote! { #prefix::Float (#f) } + } + }); + } + } + + impl ToTokens for Value { + fn to_tokens(&self, tokens: &mut TokenStream) { + let prefix = quote! { ::tauri::utils::acl::Value }; + + tokens.append_all(match self { + Value::Bool(bool) => quote! { #prefix::Bool(#bool) }, + Value::Number(number) => quote! { #prefix::Number(#number) }, + Value::String(str) => { + let s = str_lit(str); + quote! { #prefix::String(#s) } + } + Value::List(vec) => { + let items = vec_lit(vec, identity); + quote! { #prefix::List(#items) } + } + Value::Map(map) => { + let map = map_lit( + quote! { ::std::collections::BTreeMap }, + map, + str_lit, + identity, + ); + quote! { #prefix::Map(#map) } + } + }); + } + } +} diff --git a/core/tauri-utils/src/config.rs b/core/tauri-utils/src/config.rs index 253cfa3d7bc5..6210d75852c5 100644 --- a/core/tauri-utils/src/config.rs +++ b/core/tauri-utils/src/config.rs @@ -1543,20 +1543,6 @@ pub struct SecurityConfig { /// Your application might be vulnerable to XSS attacks without this Tauri protection. #[serde(default, alias = "dangerous-disable-asset-csp-modification")] pub dangerous_disable_asset_csp_modification: DisabledCspModificationKind, - /// Allow external domains to send command to Tauri. - /// - /// By default, external domains do not have access to `window.__TAURI__`, which means they cannot - /// communicate with the commands defined in Rust. This prevents attacks where an externally - /// loaded malicious or compromised sites could start executing commands on the user's device. - /// - /// This configuration allows a set of external domains to have access to the Tauri commands. - /// When you configure a domain to be allowed to access the IPC, all subpaths are allowed. Subdomains are not allowed. - /// - /// **WARNING:** Only use this option if you either have internal checks against malicious - /// external sites or you can trust the allowed external sites. You application might be - /// vulnerable to dangerous Tauri command related attacks otherwise. - #[serde(default, alias = "dangerous-remote-domain-ipc-access")] - pub dangerous_remote_domain_ipc_access: Vec, /// Custom protocol config. #[serde(default, alias = "asset-protocol")] pub asset_protocol: AssetProtocolConfig, @@ -2140,149 +2126,11 @@ fn default_build() -> BuildConfig { /// application using tauri while only parsing it once (in the build script). #[cfg(feature = "build")] mod build { - use std::{convert::identity, path::Path}; - + use super::*; + use crate::tokens::*; use proc_macro2::TokenStream; use quote::{quote, ToTokens, TokenStreamExt}; - - use super::*; - - use serde_json::Value as JsonValue; - - /// Create a `String` constructor `TokenStream`. - /// - /// e.g. `"Hello World" -> String::from("Hello World"). - /// This takes a `&String` to reduce casting all the `&String` -> `&str` manually. - fn str_lit(s: impl AsRef) -> TokenStream { - let s = s.as_ref(); - quote! { #s.into() } - } - - /// Create an `Option` constructor `TokenStream`. - fn opt_lit(item: Option<&impl ToTokens>) -> TokenStream { - match item { - None => quote! { ::core::option::Option::None }, - Some(item) => quote! { ::core::option::Option::Some(#item) }, - } - } - - /// Helper function to combine an `opt_lit` with `str_lit`. - fn opt_str_lit(item: Option>) -> TokenStream { - opt_lit(item.map(str_lit).as_ref()) - } - - /// Helper function to combine an `opt_lit` with a list of `str_lit` - fn opt_vec_str_lit(item: Option>>) -> TokenStream { - opt_lit(item.map(|list| vec_lit(list, str_lit)).as_ref()) - } - - /// Create a `Vec` constructor, mapping items with a function that spits out `TokenStream`s. - fn vec_lit( - list: impl IntoIterator, - map: impl Fn(Raw) -> Tokens, - ) -> TokenStream - where - Tokens: ToTokens, - { - let items = list.into_iter().map(map); - quote! { vec![#(#items),*] } - } - - /// Create a `PathBuf` constructor `TokenStream`. - /// - /// e.g. `"Hello World" -> String::from("Hello World"). - fn path_buf_lit(s: impl AsRef) -> TokenStream { - let s = s.as_ref().to_string_lossy().into_owned(); - quote! { ::std::path::PathBuf::from(#s) } - } - - /// Creates a `Url` constructor `TokenStream`. - fn url_lit(url: &Url) -> TokenStream { - let url = url.as_str(); - quote! { #url.parse().unwrap() } - } - - /// Create a map constructor, mapping keys and values with other `TokenStream`s. - /// - /// This function is pretty generic because the types of keys AND values get transformed. - fn map_lit( - map_type: TokenStream, - map: Map, - map_key: FuncKey, - map_value: FuncValue, - ) -> TokenStream - where - ::IntoIter: ExactSizeIterator, - Map: IntoIterator, - TokenStreamKey: ToTokens, - TokenStreamValue: ToTokens, - FuncKey: Fn(Key) -> TokenStreamKey, - FuncValue: Fn(Value) -> TokenStreamValue, - { - let ident = quote::format_ident!("map"); - let map = map.into_iter(); - - if map.len() > 0 { - let items = map.map(|(key, value)| { - let key = map_key(key); - let value = map_value(value); - quote! { #ident.insert(#key, #value); } - }); - - quote! {{ - let mut #ident = #map_type::new(); - #(#items)* - #ident - }} - } else { - quote! { #map_type::new() } - } - } - - /// Create a `serde_json::Value` variant `TokenStream` for a number - fn json_value_number_lit(num: &serde_json::Number) -> TokenStream { - // See https://docs.rs/serde_json/1/serde_json/struct.Number.html for guarantees - let prefix = quote! { ::serde_json::Value }; - if num.is_u64() { - // guaranteed u64 - let num = num.as_u64().unwrap(); - quote! { #prefix::Number(#num.into()) } - } else if num.is_i64() { - // guaranteed i64 - let num = num.as_i64().unwrap(); - quote! { #prefix::Number(#num.into()) } - } else if num.is_f64() { - // guaranteed f64 - let num = num.as_f64().unwrap(); - quote! { #prefix::Number(::serde_json::Number::from_f64(#num).unwrap(/* safe to unwrap, guaranteed f64 */)) } - } else { - // invalid number - quote! { #prefix::Null } - } - } - - /// Create a `serde_json::Value` constructor `TokenStream` - fn json_value_lit(jv: &JsonValue) -> TokenStream { - let prefix = quote! { ::serde_json::Value }; - - match jv { - JsonValue::Null => quote! { #prefix::Null }, - JsonValue::Bool(bool) => quote! { #prefix::Bool(#bool) }, - JsonValue::Number(number) => json_value_number_lit(number), - JsonValue::String(str) => { - let s = str_lit(str); - quote! { #prefix::String(#s) } - } - JsonValue::Array(vec) => { - let items = vec.iter().map(json_value_lit); - quote! { #prefix::Array(vec![#(#items),*]) } - } - JsonValue::Object(map) => { - let map = map_lit(quote! { ::serde_json::Map }, map, str_lit, json_value_lit); - quote! { #prefix::Object(#map) } - } - } - } + use std::convert::identity; /// Write a `TokenStream` of the `$struct`'s fields to the `$tokens`. /// @@ -2749,8 +2597,6 @@ mod build { let dev_csp = opt_lit(self.dev_csp.as_ref()); let freeze_prototype = self.freeze_prototype; let dangerous_disable_asset_csp_modification = &self.dangerous_disable_asset_csp_modification; - let dangerous_remote_domain_ipc_access = - vec_lit(&self.dangerous_remote_domain_ipc_access, identity); let asset_protocol = &self.asset_protocol; literal_struct!( @@ -2760,7 +2606,6 @@ mod build { dev_csp, freeze_prototype, dangerous_disable_asset_csp_modification, - dangerous_remote_domain_ipc_access, asset_protocol ); } @@ -2921,7 +2766,6 @@ mod test { dev_csp: None, freeze_prototype: false, dangerous_disable_asset_csp_modification: DisabledCspModificationKind::Flag(false), - dangerous_remote_domain_ipc_access: Vec::new(), asset_protocol: AssetProtocolConfig::default(), }, tray_icon: None, diff --git a/core/tauri-utils/src/config/parse.rs b/core/tauri-utils/src/config/parse.rs index b098cb545707..d82c6a27edde 100644 --- a/core/tauri-utils/src/config/parse.rs +++ b/core/tauri-utils/src/config/parse.rs @@ -51,21 +51,21 @@ impl ConfigFormat { fn into_platform_file_name(self, target: Target) -> &'static str { match self { Self::Json => match target { - Target::Darwin => "tauri.macos.conf.json", + Target::MacOS => "tauri.macos.conf.json", Target::Windows => "tauri.windows.conf.json", Target::Linux => "tauri.linux.conf.json", Target::Android => "tauri.android.conf.json", Target::Ios => "tauri.ios.conf.json", }, Self::Json5 => match target { - Target::Darwin => "tauri.macos.conf.json5", + Target::MacOS => "tauri.macos.conf.json5", Target::Windows => "tauri.windows.conf.json5", Target::Linux => "tauri.linux.conf.json5", Target::Android => "tauri.android.conf.json5", Target::Ios => "tauri.ios.conf.json5", }, Self::Toml => match target { - Target::Darwin => "Tauri.macos.toml", + Target::MacOS => "Tauri.macos.toml", Target::Windows => "Tauri.windows.toml", Target::Linux => "Tauri.linux.toml", Target::Android => "Tauri.android.toml", diff --git a/core/tauri-utils/src/lib.rs b/core/tauri-utils/src/lib.rs index d09c0f15978e..18e742505dfb 100644 --- a/core/tauri-utils/src/lib.rs +++ b/core/tauri-utils/src/lib.rs @@ -24,6 +24,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; use log::warn; +pub mod acl; pub mod assets; pub mod config; pub mod html; @@ -33,6 +34,8 @@ pub mod platform; /// Prepare application resources and sidecars. #[cfg(feature = "resources")] pub mod resources; +#[cfg(feature = "build")] +pub mod tokens; /// Application pattern. pub mod pattern; diff --git a/core/tauri-utils/src/platform.rs b/core/tauri-utils/src/platform.rs index 6659438b6097..1ff29964b050 100644 --- a/core/tauri-utils/src/platform.rs +++ b/core/tauri-utils/src/platform.rs @@ -4,17 +4,25 @@ //! Platform helper functions. -use std::path::{PathBuf, MAIN_SEPARATOR}; +use std::{ + fmt::Display, + path::{PathBuf, MAIN_SEPARATOR}, +}; + +use serde::{Deserialize, Serialize}; use crate::{Env, PackageInfo}; mod starting_binary; /// Platform target. -#[derive(PartialEq, Eq, Copy, Clone)] +#[derive(PartialEq, Eq, Copy, Debug, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] pub enum Target { /// MacOS. - Darwin, + #[serde(rename = "macOS")] + MacOS, /// Windows. Windows, /// Linux. @@ -22,14 +30,31 @@ pub enum Target { /// Android. Android, /// iOS. + #[serde(rename = "iOS")] Ios, } +impl Display for Target { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!( + f, + "{}", + match self { + Self::MacOS => "macOS", + Self::Windows => "windows", + Self::Linux => "linux", + Self::Android => "android", + Self::Ios => "iOS", + } + ) + } +} + impl Target { /// Parses the target from the given target triple. pub fn from_triple(target: &str) -> Self { if target.contains("darwin") { - Self::Darwin + Self::MacOS } else if target.contains("windows") { Self::Windows } else if target.contains("android") { @@ -44,9 +69,13 @@ impl Target { /// Gets the current build target. pub fn current() -> Self { if cfg!(target_os = "macos") { - Self::Darwin + Self::MacOS } else if cfg!(target_os = "windows") { Self::Windows + } else if cfg!(target_os = "ios") { + Self::Ios + } else if cfg!(target_os = "android") { + Self::Android } else { Self::Linux } diff --git a/core/tauri-utils/src/tokens.rs b/core/tauri-utils/src/tokens.rs new file mode 100644 index 000000000000..81e9740d8c54 --- /dev/null +++ b/core/tauri-utils/src/tokens.rs @@ -0,0 +1,147 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//! Utilities to implement [`ToTokens`] for a type. + +use std::path::Path; + +use proc_macro2::TokenStream; +use quote::{quote, ToTokens}; +use serde_json::Value as JsonValue; +use url::Url; + +/// Create a `String` constructor `TokenStream`. +/// +/// e.g. `"Hello World" -> String::from("Hello World"). +/// This takes a `&String` to reduce casting all the `&String` -> `&str` manually. +pub fn str_lit(s: impl AsRef) -> TokenStream { + let s = s.as_ref(); + quote! { #s.into() } +} + +/// Create an `Option` constructor `TokenStream`. +pub fn opt_lit(item: Option<&impl ToTokens>) -> TokenStream { + match item { + None => quote! { ::core::option::Option::None }, + Some(item) => quote! { ::core::option::Option::Some(#item) }, + } +} + +/// Helper function to combine an `opt_lit` with `str_lit`. +pub fn opt_str_lit(item: Option>) -> TokenStream { + opt_lit(item.map(str_lit).as_ref()) +} + +/// Helper function to combine an `opt_lit` with a list of `str_lit` +pub fn opt_vec_str_lit(item: Option>>) -> TokenStream { + opt_lit(item.map(|list| vec_lit(list, str_lit)).as_ref()) +} + +/// Create a `Vec` constructor, mapping items with a function that spits out `TokenStream`s. +pub fn vec_lit( + list: impl IntoIterator, + map: impl Fn(Raw) -> Tokens, +) -> TokenStream +where + Tokens: ToTokens, +{ + let items = list.into_iter().map(map); + quote! { vec![#(#items),*] } +} + +/// Create a `PathBuf` constructor `TokenStream`. +/// +/// e.g. `"Hello World" -> String::from("Hello World"). +pub fn path_buf_lit(s: impl AsRef) -> TokenStream { + let s = s.as_ref().to_string_lossy().into_owned(); + quote! { ::std::path::PathBuf::from(#s) } +} + +/// Creates a `Url` constructor `TokenStream`. +pub fn url_lit(url: &Url) -> TokenStream { + let url = url.as_str(); + quote! { #url.parse().unwrap() } +} + +/// Create a map constructor, mapping keys and values with other `TokenStream`s. +/// +/// This function is pretty generic because the types of keys AND values get transformed. +pub fn map_lit( + map_type: TokenStream, + map: Map, + map_key: FuncKey, + map_value: FuncValue, +) -> TokenStream +where + ::IntoIter: ExactSizeIterator, + Map: IntoIterator, + TokenStreamKey: ToTokens, + TokenStreamValue: ToTokens, + FuncKey: Fn(Key) -> TokenStreamKey, + FuncValue: Fn(Value) -> TokenStreamValue, +{ + let ident = quote::format_ident!("map"); + let map = map.into_iter(); + + if map.len() > 0 { + let items = map.map(|(key, value)| { + let key = map_key(key); + let value = map_value(value); + quote! { #ident.insert(#key, #value); } + }); + + quote! {{ + let mut #ident = #map_type::new(); + #(#items)* + #ident + }} + } else { + quote! { #map_type::new() } + } +} + +/// Create a `serde_json::Value` variant `TokenStream` for a number +pub fn json_value_number_lit(num: &serde_json::Number) -> TokenStream { + // See https://docs.rs/serde_json/1/serde_json/struct.Number.html for guarantees + let prefix = quote! { ::serde_json::Value }; + if num.is_u64() { + // guaranteed u64 + let num = num.as_u64().unwrap(); + quote! { #prefix::Number(#num.into()) } + } else if num.is_i64() { + // guaranteed i64 + let num = num.as_i64().unwrap(); + quote! { #prefix::Number(#num.into()) } + } else if num.is_f64() { + // guaranteed f64 + let num = num.as_f64().unwrap(); + quote! { #prefix::Number(::serde_json::Number::from_f64(#num).unwrap(/* safe to unwrap, guaranteed f64 */)) } + } else { + // invalid number + quote! { #prefix::Null } + } +} + +/// Create a `serde_json::Value` constructor `TokenStream` +pub fn json_value_lit(jv: &JsonValue) -> TokenStream { + let prefix = quote! { ::serde_json::Value }; + + match jv { + JsonValue::Null => quote! { #prefix::Null }, + JsonValue::Bool(bool) => quote! { #prefix::Bool(#bool) }, + JsonValue::Number(number) => json_value_number_lit(number), + JsonValue::String(str) => { + let s = str_lit(str); + quote! { #prefix::String(#s) } + } + JsonValue::Array(vec) => { + let items = vec.iter().map(json_value_lit); + quote! { #prefix::Array(vec![#(#items),*]) } + } + JsonValue::Object(map) => { + let map = map_lit(quote! { ::serde_json::Map }, map, str_lit, json_value_lit); + quote! { #prefix::Object(#map) } + } + } +} diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index efc49e51fcf5..27f054e8663f 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -71,6 +71,7 @@ png = { version = "0.17", optional = true } ico = { version = "0.3.0", optional = true } http-range = { version = "0.1.5", optional = true } tracing = { version = "0.1", optional = true } +static_assertions = "1" [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\", target_os = \"windows\", target_os = \"macos\"))".dependencies] muda = { version = "0.11", default-features = false, features = [ "serde" ] } @@ -110,6 +111,7 @@ swift-rs = "1.0.6" [build-dependencies] heck = "0.4" tauri-build = { path = "../tauri-build/", version = "2.0.0-alpha.14" } +tauri-utils = { path = "../tauri-utils/", version = "2.0.0-alpha.13", features = [ "build" ] } [dev-dependencies] proptest = "1.4.0" diff --git a/core/tauri/build.rs b/core/tauri/build.rs index 01a589c86409..e944be71b76f 100644 --- a/core/tauri/build.rs +++ b/core/tauri/build.rs @@ -15,6 +15,146 @@ use std::{ }; static CHECKED_FEATURES: OnceLock>> = OnceLock::new(); +const PLUGINS: &[(&str, &[(&str, bool)])] = &[ + // (plugin_name, &[(command, enabled-by_default)]) + ( + "path", + &[ + ("resolve_directory", true), + ("resolve", true), + ("normalize", true), + ("join", true), + ("dirname", true), + ("extname", true), + ("basename", true), + ("is_absolute", true), + ], + ), + ( + "event", + &[("listen", true), ("unlisten", true), ("emit", true)], + ), + ( + "window", + &[ + ("create", false), + // getters + ("scale_factor", true), + ("inner_position", true), + ("outer_position", true), + ("inner_size", true), + ("outer_size", true), + ("is_fullscreen", true), + ("is_minimized", true), + ("is_maximized", true), + ("is_focused", true), + ("is_decorated", true), + ("is_resizable", true), + ("is_maximizable", true), + ("is_minimizable", true), + ("is_closable", true), + ("is_visible", true), + ("title", true), + ("current_monitor", true), + ("primary_monitor", true), + ("available_monitors", true), + ("theme", true), + // setters + ("center", false), + ("request_user_attention", false), + ("set_resizable", false), + ("set_maximizable", false), + ("set_minimizable", false), + ("set_closable", false), + ("set_title", false), + ("maximize", false), + ("unmaximize", false), + ("minimize", false), + ("unminimize", false), + ("show", false), + ("hide", false), + ("close", false), + ("set_decorations", false), + ("set_shadow", false), + ("set_effects", false), + ("set_always_on_top", false), + ("set_always_on_bottom", false), + ("set_content_protected", false), + ("set_size", false), + ("set_min_size", false), + ("set_max_size", false), + ("set_position", false), + ("set_fullscreen", false), + ("set_focus", false), + ("set_skip_taskbar", false), + ("set_cursor_grab", false), + ("set_cursor_visible", false), + ("set_cursor_icon", false), + ("set_cursor_position", false), + ("set_ignore_cursor_events", false), + ("start_dragging", false), + ("set_progress_bar", false), + ("print", false), + ("set_icon", false), + ("toggle_maximize", false), + // internal + ("internal_toggle_maximize", true), + ("internal_toggle_devtools", true), + ], + ), + ( + "app", + &[ + ("version", true), + ("name", true), + ("tauri_version", true), + ("app_show", false), + ("app_hide", false), + ], + ), + ("resources", &[("close", true)]), + ( + "menu", + &[ + ("new", false), + ("append", false), + ("prepend", false), + ("insert", false), + ("remove", false), + ("remove_at", false), + ("items", false), + ("get", false), + ("popup", false), + ("create_default", false), + ("set_as_app_menu", false), + ("set_as_window_menu", false), + ("text", false), + ("set_text", false), + ("is_enabled", false), + ("set_enabled", false), + ("set_accelerator", false), + ("set_as_windows_menu_for_nsapp", false), + ("set_as_help_menu_for_nsapp", false), + ("is_checked", false), + ("set_checked", false), + ("set_icon", false), + ], + ), + ( + "tray", + &[ + ("new", false), + ("set_icon", false), + ("set_menu", false), + ("set_tooltip", false), + ("set_title", false), + ("set_visible", false), + ("set_temp_dir_path", false), + ("set_icon_as_template", false), + ("set_show_menu_on_left_click", false), + ], + ), +]; // checks if the given Cargo feature is enabled. fn has_feature(feature: &str) -> bool { @@ -134,6 +274,58 @@ fn main() { println!("cargo:ios_library_path={}", lib_path.display()); } } + + define_permissions(); +} + +fn define_permissions() { + let license_header = r#"# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +"#; + + for (plugin, commands) in PLUGINS { + let autogenerated = PathBuf::from(format!("permissions/{plugin}/autogenerated/")); + let commands_dir = autogenerated.join("commands"); + + tauri_utils::acl::build::autogenerate_command_permissions( + &commands_dir, + &commands.iter().map(|(cmd, _)| *cmd).collect::>(), + license_header, + ); + let default_permissions = commands + .iter() + .filter(|(_cmd, default)| *default) + .map(|(cmd, _)| { + let slugified_command = cmd.replace('_', "-"); + format!("\"allow-{}\"", slugified_command) + }) + .collect::>() + .join(", "); + + let default_toml = format!( + r###"{license_header}# Automatically generated - DO NOT EDIT! + +[default] +description = "Default permissions for the plugin." +permissions = [{default_permissions}] +"###, + ); + + let out_path = autogenerated.join("default.toml"); + if default_toml != read_to_string(&out_path).unwrap_or_default() { + std::fs::write(out_path, default_toml) + .unwrap_or_else(|_| panic!("unable to autogenerate default permissions")); + } + + let permissions = tauri_utils::acl::build::define_permissions( + &format!("./permissions/{plugin}/**/*.toml"), + &format!("tauri:{plugin}"), + ) + .unwrap_or_else(|e| panic!("failed to define permissions for {plugin}: {e}")); + tauri_utils::acl::build::generate_schema(&permissions, format!("./permissions/{plugin}")) + .unwrap_or_else(|e| panic!("failed to generate schema for {plugin}: {e}")); + } } fn add_manifest() { diff --git a/core/tauri/permissions/.gitignore b/core/tauri/permissions/.gitignore new file mode 100644 index 000000000000..9fe3b17f12ec --- /dev/null +++ b/core/tauri/permissions/.gitignore @@ -0,0 +1 @@ +.schema.json diff --git a/core/tauri/permissions/app/autogenerated/commands/app_hide.toml b/core/tauri/permissions/app/autogenerated/commands/app_hide.toml new file mode 100644 index 000000000000..00c3297eda95 --- /dev/null +++ b/core/tauri/permissions/app/autogenerated/commands/app_hide.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-app-hide" +description = "Enables the app_hide command without any pre-configured scope." +commands.allow = ["app_hide"] + +[[permission]] +identifier = "deny-app-hide" +description = "Denies the app_hide command without any pre-configured scope." +commands.deny = ["app_hide"] diff --git a/core/tauri/permissions/app/autogenerated/commands/app_show.toml b/core/tauri/permissions/app/autogenerated/commands/app_show.toml new file mode 100644 index 000000000000..b93047123134 --- /dev/null +++ b/core/tauri/permissions/app/autogenerated/commands/app_show.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-app-show" +description = "Enables the app_show command without any pre-configured scope." +commands.allow = ["app_show"] + +[[permission]] +identifier = "deny-app-show" +description = "Denies the app_show command without any pre-configured scope." +commands.deny = ["app_show"] diff --git a/core/tauri/permissions/app/autogenerated/commands/name.toml b/core/tauri/permissions/app/autogenerated/commands/name.toml new file mode 100644 index 000000000000..859a0209a9da --- /dev/null +++ b/core/tauri/permissions/app/autogenerated/commands/name.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-name" +description = "Enables the name command without any pre-configured scope." +commands.allow = ["name"] + +[[permission]] +identifier = "deny-name" +description = "Denies the name command without any pre-configured scope." +commands.deny = ["name"] diff --git a/core/tauri/permissions/app/autogenerated/commands/tauri_version.toml b/core/tauri/permissions/app/autogenerated/commands/tauri_version.toml new file mode 100644 index 000000000000..3e71c771b9f2 --- /dev/null +++ b/core/tauri/permissions/app/autogenerated/commands/tauri_version.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-tauri-version" +description = "Enables the tauri_version command without any pre-configured scope." +commands.allow = ["tauri_version"] + +[[permission]] +identifier = "deny-tauri-version" +description = "Denies the tauri_version command without any pre-configured scope." +commands.deny = ["tauri_version"] diff --git a/core/tauri/permissions/app/autogenerated/commands/version.toml b/core/tauri/permissions/app/autogenerated/commands/version.toml new file mode 100644 index 000000000000..4a50bddeda20 --- /dev/null +++ b/core/tauri/permissions/app/autogenerated/commands/version.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-version" +description = "Enables the version command without any pre-configured scope." +commands.allow = ["version"] + +[[permission]] +identifier = "deny-version" +description = "Denies the version command without any pre-configured scope." +commands.deny = ["version"] diff --git a/core/tauri/permissions/app/autogenerated/default.toml b/core/tauri/permissions/app/autogenerated/default.toml new file mode 100644 index 000000000000..a614e4d18e6c --- /dev/null +++ b/core/tauri/permissions/app/autogenerated/default.toml @@ -0,0 +1,8 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +[default] +description = "Default permissions for the plugin." +permissions = ["allow-version", "allow-name", "allow-tauri-version"] diff --git a/core/tauri/permissions/event/autogenerated/commands/emit.toml b/core/tauri/permissions/event/autogenerated/commands/emit.toml new file mode 100644 index 000000000000..4b0d4048b179 --- /dev/null +++ b/core/tauri/permissions/event/autogenerated/commands/emit.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-emit" +description = "Enables the emit command without any pre-configured scope." +commands.allow = ["emit"] + +[[permission]] +identifier = "deny-emit" +description = "Denies the emit command without any pre-configured scope." +commands.deny = ["emit"] diff --git a/core/tauri/permissions/event/autogenerated/commands/listen.toml b/core/tauri/permissions/event/autogenerated/commands/listen.toml new file mode 100644 index 000000000000..8732753ef5d7 --- /dev/null +++ b/core/tauri/permissions/event/autogenerated/commands/listen.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-listen" +description = "Enables the listen command without any pre-configured scope." +commands.allow = ["listen"] + +[[permission]] +identifier = "deny-listen" +description = "Denies the listen command without any pre-configured scope." +commands.deny = ["listen"] diff --git a/core/tauri/permissions/event/autogenerated/commands/unlisten.toml b/core/tauri/permissions/event/autogenerated/commands/unlisten.toml new file mode 100644 index 000000000000..86b0595d55cf --- /dev/null +++ b/core/tauri/permissions/event/autogenerated/commands/unlisten.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-unlisten" +description = "Enables the unlisten command without any pre-configured scope." +commands.allow = ["unlisten"] + +[[permission]] +identifier = "deny-unlisten" +description = "Denies the unlisten command without any pre-configured scope." +commands.deny = ["unlisten"] diff --git a/core/tauri/permissions/event/autogenerated/default.toml b/core/tauri/permissions/event/autogenerated/default.toml new file mode 100644 index 000000000000..5c608785857d --- /dev/null +++ b/core/tauri/permissions/event/autogenerated/default.toml @@ -0,0 +1,8 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +[default] +description = "Default permissions for the plugin." +permissions = ["allow-listen", "allow-unlisten", "allow-emit"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/append.toml b/core/tauri/permissions/menu/autogenerated/commands/append.toml new file mode 100644 index 000000000000..f370284b42a3 --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/append.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-append" +description = "Enables the append command without any pre-configured scope." +commands.allow = ["append"] + +[[permission]] +identifier = "deny-append" +description = "Denies the append command without any pre-configured scope." +commands.deny = ["append"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/create_default.toml b/core/tauri/permissions/menu/autogenerated/commands/create_default.toml new file mode 100644 index 000000000000..ce51b421a6da --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/create_default.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-create-default" +description = "Enables the create_default command without any pre-configured scope." +commands.allow = ["create_default"] + +[[permission]] +identifier = "deny-create-default" +description = "Denies the create_default command without any pre-configured scope." +commands.deny = ["create_default"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/get.toml b/core/tauri/permissions/menu/autogenerated/commands/get.toml new file mode 100644 index 000000000000..79a5620fd544 --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/get.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-get" +description = "Enables the get command without any pre-configured scope." +commands.allow = ["get"] + +[[permission]] +identifier = "deny-get" +description = "Denies the get command without any pre-configured scope." +commands.deny = ["get"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/insert.toml b/core/tauri/permissions/menu/autogenerated/commands/insert.toml new file mode 100644 index 000000000000..5de90c3c84a9 --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/insert.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-insert" +description = "Enables the insert command without any pre-configured scope." +commands.allow = ["insert"] + +[[permission]] +identifier = "deny-insert" +description = "Denies the insert command without any pre-configured scope." +commands.deny = ["insert"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/is_checked.toml b/core/tauri/permissions/menu/autogenerated/commands/is_checked.toml new file mode 100644 index 000000000000..efb4299a1bed --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/is_checked.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-is-checked" +description = "Enables the is_checked command without any pre-configured scope." +commands.allow = ["is_checked"] + +[[permission]] +identifier = "deny-is-checked" +description = "Denies the is_checked command without any pre-configured scope." +commands.deny = ["is_checked"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/is_enabled.toml b/core/tauri/permissions/menu/autogenerated/commands/is_enabled.toml new file mode 100644 index 000000000000..39b567085f11 --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/is_enabled.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-is-enabled" +description = "Enables the is_enabled command without any pre-configured scope." +commands.allow = ["is_enabled"] + +[[permission]] +identifier = "deny-is-enabled" +description = "Denies the is_enabled command without any pre-configured scope." +commands.deny = ["is_enabled"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/items.toml b/core/tauri/permissions/menu/autogenerated/commands/items.toml new file mode 100644 index 000000000000..cbb5055007cf --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/items.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-items" +description = "Enables the items command without any pre-configured scope." +commands.allow = ["items"] + +[[permission]] +identifier = "deny-items" +description = "Denies the items command without any pre-configured scope." +commands.deny = ["items"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/new.toml b/core/tauri/permissions/menu/autogenerated/commands/new.toml new file mode 100644 index 000000000000..c87453714563 --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/new.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-new" +description = "Enables the new command without any pre-configured scope." +commands.allow = ["new"] + +[[permission]] +identifier = "deny-new" +description = "Denies the new command without any pre-configured scope." +commands.deny = ["new"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/popup.toml b/core/tauri/permissions/menu/autogenerated/commands/popup.toml new file mode 100644 index 000000000000..18970ba64117 --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/popup.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-popup" +description = "Enables the popup command without any pre-configured scope." +commands.allow = ["popup"] + +[[permission]] +identifier = "deny-popup" +description = "Denies the popup command without any pre-configured scope." +commands.deny = ["popup"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/prepend.toml b/core/tauri/permissions/menu/autogenerated/commands/prepend.toml new file mode 100644 index 000000000000..5c90aba3d080 --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/prepend.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-prepend" +description = "Enables the prepend command without any pre-configured scope." +commands.allow = ["prepend"] + +[[permission]] +identifier = "deny-prepend" +description = "Denies the prepend command without any pre-configured scope." +commands.deny = ["prepend"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/remove.toml b/core/tauri/permissions/menu/autogenerated/commands/remove.toml new file mode 100644 index 000000000000..c7e09c5904fe --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/remove.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-remove" +description = "Enables the remove command without any pre-configured scope." +commands.allow = ["remove"] + +[[permission]] +identifier = "deny-remove" +description = "Denies the remove command without any pre-configured scope." +commands.deny = ["remove"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/remove_at.toml b/core/tauri/permissions/menu/autogenerated/commands/remove_at.toml new file mode 100644 index 000000000000..3a58bc731d2c --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/remove_at.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-remove-at" +description = "Enables the remove_at command without any pre-configured scope." +commands.allow = ["remove_at"] + +[[permission]] +identifier = "deny-remove-at" +description = "Denies the remove_at command without any pre-configured scope." +commands.deny = ["remove_at"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/set_accelerator.toml b/core/tauri/permissions/menu/autogenerated/commands/set_accelerator.toml new file mode 100644 index 000000000000..9392a0dbdc1f --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/set_accelerator.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-accelerator" +description = "Enables the set_accelerator command without any pre-configured scope." +commands.allow = ["set_accelerator"] + +[[permission]] +identifier = "deny-set-accelerator" +description = "Denies the set_accelerator command without any pre-configured scope." +commands.deny = ["set_accelerator"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/set_as_app_menu.toml b/core/tauri/permissions/menu/autogenerated/commands/set_as_app_menu.toml new file mode 100644 index 000000000000..fa838d50086b --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/set_as_app_menu.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-as-app-menu" +description = "Enables the set_as_app_menu command without any pre-configured scope." +commands.allow = ["set_as_app_menu"] + +[[permission]] +identifier = "deny-set-as-app-menu" +description = "Denies the set_as_app_menu command without any pre-configured scope." +commands.deny = ["set_as_app_menu"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/set_as_help_menu_for_nsapp.toml b/core/tauri/permissions/menu/autogenerated/commands/set_as_help_menu_for_nsapp.toml new file mode 100644 index 000000000000..c90644a8ef93 --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/set_as_help_menu_for_nsapp.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-as-help-menu-for-nsapp" +description = "Enables the set_as_help_menu_for_nsapp command without any pre-configured scope." +commands.allow = ["set_as_help_menu_for_nsapp"] + +[[permission]] +identifier = "deny-set-as-help-menu-for-nsapp" +description = "Denies the set_as_help_menu_for_nsapp command without any pre-configured scope." +commands.deny = ["set_as_help_menu_for_nsapp"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/set_as_window_menu.toml b/core/tauri/permissions/menu/autogenerated/commands/set_as_window_menu.toml new file mode 100644 index 000000000000..1e0c7fd240f0 --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/set_as_window_menu.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-as-window-menu" +description = "Enables the set_as_window_menu command without any pre-configured scope." +commands.allow = ["set_as_window_menu"] + +[[permission]] +identifier = "deny-set-as-window-menu" +description = "Denies the set_as_window_menu command without any pre-configured scope." +commands.deny = ["set_as_window_menu"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/set_as_windows_menu_for_nsapp.toml b/core/tauri/permissions/menu/autogenerated/commands/set_as_windows_menu_for_nsapp.toml new file mode 100644 index 000000000000..3583ccd2786c --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/set_as_windows_menu_for_nsapp.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-as-windows-menu-for-nsapp" +description = "Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope." +commands.allow = ["set_as_windows_menu_for_nsapp"] + +[[permission]] +identifier = "deny-set-as-windows-menu-for-nsapp" +description = "Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope." +commands.deny = ["set_as_windows_menu_for_nsapp"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/set_checked.toml b/core/tauri/permissions/menu/autogenerated/commands/set_checked.toml new file mode 100644 index 000000000000..784b85da9b52 --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/set_checked.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-checked" +description = "Enables the set_checked command without any pre-configured scope." +commands.allow = ["set_checked"] + +[[permission]] +identifier = "deny-set-checked" +description = "Denies the set_checked command without any pre-configured scope." +commands.deny = ["set_checked"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/set_enabled.toml b/core/tauri/permissions/menu/autogenerated/commands/set_enabled.toml new file mode 100644 index 000000000000..76a3df65209c --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/set_enabled.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-enabled" +description = "Enables the set_enabled command without any pre-configured scope." +commands.allow = ["set_enabled"] + +[[permission]] +identifier = "deny-set-enabled" +description = "Denies the set_enabled command without any pre-configured scope." +commands.deny = ["set_enabled"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/set_icon.toml b/core/tauri/permissions/menu/autogenerated/commands/set_icon.toml new file mode 100644 index 000000000000..556648a688bc --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/set_icon.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-icon" +description = "Enables the set_icon command without any pre-configured scope." +commands.allow = ["set_icon"] + +[[permission]] +identifier = "deny-set-icon" +description = "Denies the set_icon command without any pre-configured scope." +commands.deny = ["set_icon"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/set_text.toml b/core/tauri/permissions/menu/autogenerated/commands/set_text.toml new file mode 100644 index 000000000000..5a050e3c38fc --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/set_text.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-text" +description = "Enables the set_text command without any pre-configured scope." +commands.allow = ["set_text"] + +[[permission]] +identifier = "deny-set-text" +description = "Denies the set_text command without any pre-configured scope." +commands.deny = ["set_text"] diff --git a/core/tauri/permissions/menu/autogenerated/commands/text.toml b/core/tauri/permissions/menu/autogenerated/commands/text.toml new file mode 100644 index 000000000000..a6c5b93261e6 --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/commands/text.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-text" +description = "Enables the text command without any pre-configured scope." +commands.allow = ["text"] + +[[permission]] +identifier = "deny-text" +description = "Denies the text command without any pre-configured scope." +commands.deny = ["text"] diff --git a/core/tauri/permissions/menu/autogenerated/default.toml b/core/tauri/permissions/menu/autogenerated/default.toml new file mode 100644 index 000000000000..6817a6290cbb --- /dev/null +++ b/core/tauri/permissions/menu/autogenerated/default.toml @@ -0,0 +1,8 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +[default] +description = "Default permissions for the plugin." +permissions = [] diff --git a/core/tauri/permissions/path/autogenerated/commands/basename.toml b/core/tauri/permissions/path/autogenerated/commands/basename.toml new file mode 100644 index 000000000000..5be962c63c97 --- /dev/null +++ b/core/tauri/permissions/path/autogenerated/commands/basename.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-basename" +description = "Enables the basename command without any pre-configured scope." +commands.allow = ["basename"] + +[[permission]] +identifier = "deny-basename" +description = "Denies the basename command without any pre-configured scope." +commands.deny = ["basename"] diff --git a/core/tauri/permissions/path/autogenerated/commands/dirname.toml b/core/tauri/permissions/path/autogenerated/commands/dirname.toml new file mode 100644 index 000000000000..94d2a1b9722f --- /dev/null +++ b/core/tauri/permissions/path/autogenerated/commands/dirname.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-dirname" +description = "Enables the dirname command without any pre-configured scope." +commands.allow = ["dirname"] + +[[permission]] +identifier = "deny-dirname" +description = "Denies the dirname command without any pre-configured scope." +commands.deny = ["dirname"] diff --git a/core/tauri/permissions/path/autogenerated/commands/extname.toml b/core/tauri/permissions/path/autogenerated/commands/extname.toml new file mode 100644 index 000000000000..ba628fcad70a --- /dev/null +++ b/core/tauri/permissions/path/autogenerated/commands/extname.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-extname" +description = "Enables the extname command without any pre-configured scope." +commands.allow = ["extname"] + +[[permission]] +identifier = "deny-extname" +description = "Denies the extname command without any pre-configured scope." +commands.deny = ["extname"] diff --git a/core/tauri/permissions/path/autogenerated/commands/is_absolute.toml b/core/tauri/permissions/path/autogenerated/commands/is_absolute.toml new file mode 100644 index 000000000000..463de2f3a07a --- /dev/null +++ b/core/tauri/permissions/path/autogenerated/commands/is_absolute.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-is-absolute" +description = "Enables the is_absolute command without any pre-configured scope." +commands.allow = ["is_absolute"] + +[[permission]] +identifier = "deny-is-absolute" +description = "Denies the is_absolute command without any pre-configured scope." +commands.deny = ["is_absolute"] diff --git a/core/tauri/permissions/path/autogenerated/commands/join.toml b/core/tauri/permissions/path/autogenerated/commands/join.toml new file mode 100644 index 000000000000..bc2aa3ce04ec --- /dev/null +++ b/core/tauri/permissions/path/autogenerated/commands/join.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-join" +description = "Enables the join command without any pre-configured scope." +commands.allow = ["join"] + +[[permission]] +identifier = "deny-join" +description = "Denies the join command without any pre-configured scope." +commands.deny = ["join"] diff --git a/core/tauri/permissions/path/autogenerated/commands/normalize.toml b/core/tauri/permissions/path/autogenerated/commands/normalize.toml new file mode 100644 index 000000000000..7c18e091390d --- /dev/null +++ b/core/tauri/permissions/path/autogenerated/commands/normalize.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-normalize" +description = "Enables the normalize command without any pre-configured scope." +commands.allow = ["normalize"] + +[[permission]] +identifier = "deny-normalize" +description = "Denies the normalize command without any pre-configured scope." +commands.deny = ["normalize"] diff --git a/core/tauri/permissions/path/autogenerated/commands/resolve.toml b/core/tauri/permissions/path/autogenerated/commands/resolve.toml new file mode 100644 index 000000000000..f4223bf6ad89 --- /dev/null +++ b/core/tauri/permissions/path/autogenerated/commands/resolve.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-resolve" +description = "Enables the resolve command without any pre-configured scope." +commands.allow = ["resolve"] + +[[permission]] +identifier = "deny-resolve" +description = "Denies the resolve command without any pre-configured scope." +commands.deny = ["resolve"] diff --git a/core/tauri/permissions/path/autogenerated/commands/resolve_directory.toml b/core/tauri/permissions/path/autogenerated/commands/resolve_directory.toml new file mode 100644 index 000000000000..6a207cfca6c7 --- /dev/null +++ b/core/tauri/permissions/path/autogenerated/commands/resolve_directory.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-resolve-directory" +description = "Enables the resolve_directory command without any pre-configured scope." +commands.allow = ["resolve_directory"] + +[[permission]] +identifier = "deny-resolve-directory" +description = "Denies the resolve_directory command without any pre-configured scope." +commands.deny = ["resolve_directory"] diff --git a/core/tauri/permissions/path/autogenerated/default.toml b/core/tauri/permissions/path/autogenerated/default.toml new file mode 100644 index 000000000000..637a878d68f3 --- /dev/null +++ b/core/tauri/permissions/path/autogenerated/default.toml @@ -0,0 +1,8 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +[default] +description = "Default permissions for the plugin." +permissions = ["allow-resolve-directory", "allow-resolve", "allow-normalize", "allow-join", "allow-dirname", "allow-extname", "allow-basename", "allow-is-absolute"] diff --git a/core/tauri/permissions/resources/autogenerated/commands/close.toml b/core/tauri/permissions/resources/autogenerated/commands/close.toml new file mode 100644 index 000000000000..ddbc008d0dea --- /dev/null +++ b/core/tauri/permissions/resources/autogenerated/commands/close.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-close" +description = "Enables the close command without any pre-configured scope." +commands.allow = ["close"] + +[[permission]] +identifier = "deny-close" +description = "Denies the close command without any pre-configured scope." +commands.deny = ["close"] diff --git a/core/tauri/permissions/resources/autogenerated/default.toml b/core/tauri/permissions/resources/autogenerated/default.toml new file mode 100644 index 000000000000..46686da50f24 --- /dev/null +++ b/core/tauri/permissions/resources/autogenerated/default.toml @@ -0,0 +1,8 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +[default] +description = "Default permissions for the plugin." +permissions = ["allow-close"] diff --git a/core/tauri/permissions/tray/autogenerated/commands/new.toml b/core/tauri/permissions/tray/autogenerated/commands/new.toml new file mode 100644 index 000000000000..c87453714563 --- /dev/null +++ b/core/tauri/permissions/tray/autogenerated/commands/new.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-new" +description = "Enables the new command without any pre-configured scope." +commands.allow = ["new"] + +[[permission]] +identifier = "deny-new" +description = "Denies the new command without any pre-configured scope." +commands.deny = ["new"] diff --git a/core/tauri/permissions/tray/autogenerated/commands/set_icon.toml b/core/tauri/permissions/tray/autogenerated/commands/set_icon.toml new file mode 100644 index 000000000000..556648a688bc --- /dev/null +++ b/core/tauri/permissions/tray/autogenerated/commands/set_icon.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-icon" +description = "Enables the set_icon command without any pre-configured scope." +commands.allow = ["set_icon"] + +[[permission]] +identifier = "deny-set-icon" +description = "Denies the set_icon command without any pre-configured scope." +commands.deny = ["set_icon"] diff --git a/core/tauri/permissions/tray/autogenerated/commands/set_icon_as_template.toml b/core/tauri/permissions/tray/autogenerated/commands/set_icon_as_template.toml new file mode 100644 index 000000000000..1798118c44f5 --- /dev/null +++ b/core/tauri/permissions/tray/autogenerated/commands/set_icon_as_template.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-icon-as-template" +description = "Enables the set_icon_as_template command without any pre-configured scope." +commands.allow = ["set_icon_as_template"] + +[[permission]] +identifier = "deny-set-icon-as-template" +description = "Denies the set_icon_as_template command without any pre-configured scope." +commands.deny = ["set_icon_as_template"] diff --git a/core/tauri/permissions/tray/autogenerated/commands/set_menu.toml b/core/tauri/permissions/tray/autogenerated/commands/set_menu.toml new file mode 100644 index 000000000000..b23bba10e5f3 --- /dev/null +++ b/core/tauri/permissions/tray/autogenerated/commands/set_menu.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-menu" +description = "Enables the set_menu command without any pre-configured scope." +commands.allow = ["set_menu"] + +[[permission]] +identifier = "deny-set-menu" +description = "Denies the set_menu command without any pre-configured scope." +commands.deny = ["set_menu"] diff --git a/core/tauri/permissions/tray/autogenerated/commands/set_show_menu_on_left_click.toml b/core/tauri/permissions/tray/autogenerated/commands/set_show_menu_on_left_click.toml new file mode 100644 index 000000000000..a6209b628468 --- /dev/null +++ b/core/tauri/permissions/tray/autogenerated/commands/set_show_menu_on_left_click.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-show-menu-on-left-click" +description = "Enables the set_show_menu_on_left_click command without any pre-configured scope." +commands.allow = ["set_show_menu_on_left_click"] + +[[permission]] +identifier = "deny-set-show-menu-on-left-click" +description = "Denies the set_show_menu_on_left_click command without any pre-configured scope." +commands.deny = ["set_show_menu_on_left_click"] diff --git a/core/tauri/permissions/tray/autogenerated/commands/set_temp_dir_path.toml b/core/tauri/permissions/tray/autogenerated/commands/set_temp_dir_path.toml new file mode 100644 index 000000000000..e07000aa6ae6 --- /dev/null +++ b/core/tauri/permissions/tray/autogenerated/commands/set_temp_dir_path.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-temp-dir-path" +description = "Enables the set_temp_dir_path command without any pre-configured scope." +commands.allow = ["set_temp_dir_path"] + +[[permission]] +identifier = "deny-set-temp-dir-path" +description = "Denies the set_temp_dir_path command without any pre-configured scope." +commands.deny = ["set_temp_dir_path"] diff --git a/core/tauri/permissions/tray/autogenerated/commands/set_title.toml b/core/tauri/permissions/tray/autogenerated/commands/set_title.toml new file mode 100644 index 000000000000..b522982eb117 --- /dev/null +++ b/core/tauri/permissions/tray/autogenerated/commands/set_title.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-title" +description = "Enables the set_title command without any pre-configured scope." +commands.allow = ["set_title"] + +[[permission]] +identifier = "deny-set-title" +description = "Denies the set_title command without any pre-configured scope." +commands.deny = ["set_title"] diff --git a/core/tauri/permissions/tray/autogenerated/commands/set_tooltip.toml b/core/tauri/permissions/tray/autogenerated/commands/set_tooltip.toml new file mode 100644 index 000000000000..64434654cc96 --- /dev/null +++ b/core/tauri/permissions/tray/autogenerated/commands/set_tooltip.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-tooltip" +description = "Enables the set_tooltip command without any pre-configured scope." +commands.allow = ["set_tooltip"] + +[[permission]] +identifier = "deny-set-tooltip" +description = "Denies the set_tooltip command without any pre-configured scope." +commands.deny = ["set_tooltip"] diff --git a/core/tauri/permissions/tray/autogenerated/commands/set_visible.toml b/core/tauri/permissions/tray/autogenerated/commands/set_visible.toml new file mode 100644 index 000000000000..ff92c3869a39 --- /dev/null +++ b/core/tauri/permissions/tray/autogenerated/commands/set_visible.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-visible" +description = "Enables the set_visible command without any pre-configured scope." +commands.allow = ["set_visible"] + +[[permission]] +identifier = "deny-set-visible" +description = "Denies the set_visible command without any pre-configured scope." +commands.deny = ["set_visible"] diff --git a/core/tauri/permissions/tray/autogenerated/default.toml b/core/tauri/permissions/tray/autogenerated/default.toml new file mode 100644 index 000000000000..6817a6290cbb --- /dev/null +++ b/core/tauri/permissions/tray/autogenerated/default.toml @@ -0,0 +1,8 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +[default] +description = "Default permissions for the plugin." +permissions = [] diff --git a/core/tauri/permissions/window/autogenerated/commands/available_monitors.toml b/core/tauri/permissions/window/autogenerated/commands/available_monitors.toml new file mode 100644 index 000000000000..78460c8f817d --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/available_monitors.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-available-monitors" +description = "Enables the available_monitors command without any pre-configured scope." +commands.allow = ["available_monitors"] + +[[permission]] +identifier = "deny-available-monitors" +description = "Denies the available_monitors command without any pre-configured scope." +commands.deny = ["available_monitors"] diff --git a/core/tauri/permissions/window/autogenerated/commands/center.toml b/core/tauri/permissions/window/autogenerated/commands/center.toml new file mode 100644 index 000000000000..c66d4ad08b55 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/center.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-center" +description = "Enables the center command without any pre-configured scope." +commands.allow = ["center"] + +[[permission]] +identifier = "deny-center" +description = "Denies the center command without any pre-configured scope." +commands.deny = ["center"] diff --git a/core/tauri/permissions/window/autogenerated/commands/close.toml b/core/tauri/permissions/window/autogenerated/commands/close.toml new file mode 100644 index 000000000000..ddbc008d0dea --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/close.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-close" +description = "Enables the close command without any pre-configured scope." +commands.allow = ["close"] + +[[permission]] +identifier = "deny-close" +description = "Denies the close command without any pre-configured scope." +commands.deny = ["close"] diff --git a/core/tauri/permissions/window/autogenerated/commands/create.toml b/core/tauri/permissions/window/autogenerated/commands/create.toml new file mode 100644 index 000000000000..db39506f5c4a --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/create.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-create" +description = "Enables the create command without any pre-configured scope." +commands.allow = ["create"] + +[[permission]] +identifier = "deny-create" +description = "Denies the create command without any pre-configured scope." +commands.deny = ["create"] diff --git a/core/tauri/permissions/window/autogenerated/commands/current_monitor.toml b/core/tauri/permissions/window/autogenerated/commands/current_monitor.toml new file mode 100644 index 000000000000..543e81cf0466 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/current_monitor.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-current-monitor" +description = "Enables the current_monitor command without any pre-configured scope." +commands.allow = ["current_monitor"] + +[[permission]] +identifier = "deny-current-monitor" +description = "Denies the current_monitor command without any pre-configured scope." +commands.deny = ["current_monitor"] diff --git a/core/tauri/permissions/window/autogenerated/commands/hide.toml b/core/tauri/permissions/window/autogenerated/commands/hide.toml new file mode 100644 index 000000000000..7baddd5dec1d --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/hide.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-hide" +description = "Enables the hide command without any pre-configured scope." +commands.allow = ["hide"] + +[[permission]] +identifier = "deny-hide" +description = "Denies the hide command without any pre-configured scope." +commands.deny = ["hide"] diff --git a/core/tauri/permissions/window/autogenerated/commands/inner_position.toml b/core/tauri/permissions/window/autogenerated/commands/inner_position.toml new file mode 100644 index 000000000000..418b9b675a36 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/inner_position.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-inner-position" +description = "Enables the inner_position command without any pre-configured scope." +commands.allow = ["inner_position"] + +[[permission]] +identifier = "deny-inner-position" +description = "Denies the inner_position command without any pre-configured scope." +commands.deny = ["inner_position"] diff --git a/core/tauri/permissions/window/autogenerated/commands/inner_size.toml b/core/tauri/permissions/window/autogenerated/commands/inner_size.toml new file mode 100644 index 000000000000..313b4df62543 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/inner_size.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-inner-size" +description = "Enables the inner_size command without any pre-configured scope." +commands.allow = ["inner_size"] + +[[permission]] +identifier = "deny-inner-size" +description = "Denies the inner_size command without any pre-configured scope." +commands.deny = ["inner_size"] diff --git a/core/tauri/permissions/window/autogenerated/commands/internal_toggle_devtools.toml b/core/tauri/permissions/window/autogenerated/commands/internal_toggle_devtools.toml new file mode 100644 index 000000000000..85e19e75009f --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/internal_toggle_devtools.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-internal-toggle-devtools" +description = "Enables the internal_toggle_devtools command without any pre-configured scope." +commands.allow = ["internal_toggle_devtools"] + +[[permission]] +identifier = "deny-internal-toggle-devtools" +description = "Denies the internal_toggle_devtools command without any pre-configured scope." +commands.deny = ["internal_toggle_devtools"] diff --git a/core/tauri/permissions/window/autogenerated/commands/internal_toggle_maximize.toml b/core/tauri/permissions/window/autogenerated/commands/internal_toggle_maximize.toml new file mode 100644 index 000000000000..4f663c0bed82 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/internal_toggle_maximize.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-internal-toggle-maximize" +description = "Enables the internal_toggle_maximize command without any pre-configured scope." +commands.allow = ["internal_toggle_maximize"] + +[[permission]] +identifier = "deny-internal-toggle-maximize" +description = "Denies the internal_toggle_maximize command without any pre-configured scope." +commands.deny = ["internal_toggle_maximize"] diff --git a/core/tauri/permissions/window/autogenerated/commands/is_closable.toml b/core/tauri/permissions/window/autogenerated/commands/is_closable.toml new file mode 100644 index 000000000000..fe9d94256084 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/is_closable.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-is-closable" +description = "Enables the is_closable command without any pre-configured scope." +commands.allow = ["is_closable"] + +[[permission]] +identifier = "deny-is-closable" +description = "Denies the is_closable command without any pre-configured scope." +commands.deny = ["is_closable"] diff --git a/core/tauri/permissions/window/autogenerated/commands/is_decorated.toml b/core/tauri/permissions/window/autogenerated/commands/is_decorated.toml new file mode 100644 index 000000000000..a8f2055b0698 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/is_decorated.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-is-decorated" +description = "Enables the is_decorated command without any pre-configured scope." +commands.allow = ["is_decorated"] + +[[permission]] +identifier = "deny-is-decorated" +description = "Denies the is_decorated command without any pre-configured scope." +commands.deny = ["is_decorated"] diff --git a/core/tauri/permissions/window/autogenerated/commands/is_focused.toml b/core/tauri/permissions/window/autogenerated/commands/is_focused.toml new file mode 100644 index 000000000000..e58975d235a9 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/is_focused.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-is-focused" +description = "Enables the is_focused command without any pre-configured scope." +commands.allow = ["is_focused"] + +[[permission]] +identifier = "deny-is-focused" +description = "Denies the is_focused command without any pre-configured scope." +commands.deny = ["is_focused"] diff --git a/core/tauri/permissions/window/autogenerated/commands/is_fullscreen.toml b/core/tauri/permissions/window/autogenerated/commands/is_fullscreen.toml new file mode 100644 index 000000000000..28db27d3818f --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/is_fullscreen.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-is-fullscreen" +description = "Enables the is_fullscreen command without any pre-configured scope." +commands.allow = ["is_fullscreen"] + +[[permission]] +identifier = "deny-is-fullscreen" +description = "Denies the is_fullscreen command without any pre-configured scope." +commands.deny = ["is_fullscreen"] diff --git a/core/tauri/permissions/window/autogenerated/commands/is_maximizable.toml b/core/tauri/permissions/window/autogenerated/commands/is_maximizable.toml new file mode 100644 index 000000000000..4ac0bc946be9 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/is_maximizable.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-is-maximizable" +description = "Enables the is_maximizable command without any pre-configured scope." +commands.allow = ["is_maximizable"] + +[[permission]] +identifier = "deny-is-maximizable" +description = "Denies the is_maximizable command without any pre-configured scope." +commands.deny = ["is_maximizable"] diff --git a/core/tauri/permissions/window/autogenerated/commands/is_maximized.toml b/core/tauri/permissions/window/autogenerated/commands/is_maximized.toml new file mode 100644 index 000000000000..c35dbd38470b --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/is_maximized.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-is-maximized" +description = "Enables the is_maximized command without any pre-configured scope." +commands.allow = ["is_maximized"] + +[[permission]] +identifier = "deny-is-maximized" +description = "Denies the is_maximized command without any pre-configured scope." +commands.deny = ["is_maximized"] diff --git a/core/tauri/permissions/window/autogenerated/commands/is_minimizable.toml b/core/tauri/permissions/window/autogenerated/commands/is_minimizable.toml new file mode 100644 index 000000000000..073da07c8dc0 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/is_minimizable.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-is-minimizable" +description = "Enables the is_minimizable command without any pre-configured scope." +commands.allow = ["is_minimizable"] + +[[permission]] +identifier = "deny-is-minimizable" +description = "Denies the is_minimizable command without any pre-configured scope." +commands.deny = ["is_minimizable"] diff --git a/core/tauri/permissions/window/autogenerated/commands/is_minimized.toml b/core/tauri/permissions/window/autogenerated/commands/is_minimized.toml new file mode 100644 index 000000000000..22b5685c877d --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/is_minimized.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-is-minimized" +description = "Enables the is_minimized command without any pre-configured scope." +commands.allow = ["is_minimized"] + +[[permission]] +identifier = "deny-is-minimized" +description = "Denies the is_minimized command without any pre-configured scope." +commands.deny = ["is_minimized"] diff --git a/core/tauri/permissions/window/autogenerated/commands/is_resizable.toml b/core/tauri/permissions/window/autogenerated/commands/is_resizable.toml new file mode 100644 index 000000000000..86e06c23f2b2 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/is_resizable.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-is-resizable" +description = "Enables the is_resizable command without any pre-configured scope." +commands.allow = ["is_resizable"] + +[[permission]] +identifier = "deny-is-resizable" +description = "Denies the is_resizable command without any pre-configured scope." +commands.deny = ["is_resizable"] diff --git a/core/tauri/permissions/window/autogenerated/commands/is_visible.toml b/core/tauri/permissions/window/autogenerated/commands/is_visible.toml new file mode 100644 index 000000000000..214cd1d01740 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/is_visible.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-is-visible" +description = "Enables the is_visible command without any pre-configured scope." +commands.allow = ["is_visible"] + +[[permission]] +identifier = "deny-is-visible" +description = "Denies the is_visible command without any pre-configured scope." +commands.deny = ["is_visible"] diff --git a/core/tauri/permissions/window/autogenerated/commands/maximize.toml b/core/tauri/permissions/window/autogenerated/commands/maximize.toml new file mode 100644 index 000000000000..69bf6e376e5a --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/maximize.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-maximize" +description = "Enables the maximize command without any pre-configured scope." +commands.allow = ["maximize"] + +[[permission]] +identifier = "deny-maximize" +description = "Denies the maximize command without any pre-configured scope." +commands.deny = ["maximize"] diff --git a/core/tauri/permissions/window/autogenerated/commands/minimize.toml b/core/tauri/permissions/window/autogenerated/commands/minimize.toml new file mode 100644 index 000000000000..f58399ab728e --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/minimize.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-minimize" +description = "Enables the minimize command without any pre-configured scope." +commands.allow = ["minimize"] + +[[permission]] +identifier = "deny-minimize" +description = "Denies the minimize command without any pre-configured scope." +commands.deny = ["minimize"] diff --git a/core/tauri/permissions/window/autogenerated/commands/outer_position.toml b/core/tauri/permissions/window/autogenerated/commands/outer_position.toml new file mode 100644 index 000000000000..1bd4cb597aab --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/outer_position.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-outer-position" +description = "Enables the outer_position command without any pre-configured scope." +commands.allow = ["outer_position"] + +[[permission]] +identifier = "deny-outer-position" +description = "Denies the outer_position command without any pre-configured scope." +commands.deny = ["outer_position"] diff --git a/core/tauri/permissions/window/autogenerated/commands/outer_size.toml b/core/tauri/permissions/window/autogenerated/commands/outer_size.toml new file mode 100644 index 000000000000..962e66fc3058 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/outer_size.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-outer-size" +description = "Enables the outer_size command without any pre-configured scope." +commands.allow = ["outer_size"] + +[[permission]] +identifier = "deny-outer-size" +description = "Denies the outer_size command without any pre-configured scope." +commands.deny = ["outer_size"] diff --git a/core/tauri/permissions/window/autogenerated/commands/primary_monitor.toml b/core/tauri/permissions/window/autogenerated/commands/primary_monitor.toml new file mode 100644 index 000000000000..7493e5414fbd --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/primary_monitor.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-primary-monitor" +description = "Enables the primary_monitor command without any pre-configured scope." +commands.allow = ["primary_monitor"] + +[[permission]] +identifier = "deny-primary-monitor" +description = "Denies the primary_monitor command without any pre-configured scope." +commands.deny = ["primary_monitor"] diff --git a/core/tauri/permissions/window/autogenerated/commands/print.toml b/core/tauri/permissions/window/autogenerated/commands/print.toml new file mode 100644 index 000000000000..820f5c33b840 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/print.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-print" +description = "Enables the print command without any pre-configured scope." +commands.allow = ["print"] + +[[permission]] +identifier = "deny-print" +description = "Denies the print command without any pre-configured scope." +commands.deny = ["print"] diff --git a/core/tauri/permissions/window/autogenerated/commands/request_user_attention.toml b/core/tauri/permissions/window/autogenerated/commands/request_user_attention.toml new file mode 100644 index 000000000000..815c69bc928c --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/request_user_attention.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-request-user-attention" +description = "Enables the request_user_attention command without any pre-configured scope." +commands.allow = ["request_user_attention"] + +[[permission]] +identifier = "deny-request-user-attention" +description = "Denies the request_user_attention command without any pre-configured scope." +commands.deny = ["request_user_attention"] diff --git a/core/tauri/permissions/window/autogenerated/commands/scale_factor.toml b/core/tauri/permissions/window/autogenerated/commands/scale_factor.toml new file mode 100644 index 000000000000..ba07656f598c --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/scale_factor.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-scale-factor" +description = "Enables the scale_factor command without any pre-configured scope." +commands.allow = ["scale_factor"] + +[[permission]] +identifier = "deny-scale-factor" +description = "Denies the scale_factor command without any pre-configured scope." +commands.deny = ["scale_factor"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_always_on_bottom.toml b/core/tauri/permissions/window/autogenerated/commands/set_always_on_bottom.toml new file mode 100644 index 000000000000..2b4b9c4e10c1 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_always_on_bottom.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-always-on-bottom" +description = "Enables the set_always_on_bottom command without any pre-configured scope." +commands.allow = ["set_always_on_bottom"] + +[[permission]] +identifier = "deny-set-always-on-bottom" +description = "Denies the set_always_on_bottom command without any pre-configured scope." +commands.deny = ["set_always_on_bottom"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_always_on_top.toml b/core/tauri/permissions/window/autogenerated/commands/set_always_on_top.toml new file mode 100644 index 000000000000..709f2df837c1 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_always_on_top.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-always-on-top" +description = "Enables the set_always_on_top command without any pre-configured scope." +commands.allow = ["set_always_on_top"] + +[[permission]] +identifier = "deny-set-always-on-top" +description = "Denies the set_always_on_top command without any pre-configured scope." +commands.deny = ["set_always_on_top"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_closable.toml b/core/tauri/permissions/window/autogenerated/commands/set_closable.toml new file mode 100644 index 000000000000..79fd5eebc1ab --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_closable.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-closable" +description = "Enables the set_closable command without any pre-configured scope." +commands.allow = ["set_closable"] + +[[permission]] +identifier = "deny-set-closable" +description = "Denies the set_closable command without any pre-configured scope." +commands.deny = ["set_closable"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_content_protected.toml b/core/tauri/permissions/window/autogenerated/commands/set_content_protected.toml new file mode 100644 index 000000000000..0641ee285acf --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_content_protected.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-content-protected" +description = "Enables the set_content_protected command without any pre-configured scope." +commands.allow = ["set_content_protected"] + +[[permission]] +identifier = "deny-set-content-protected" +description = "Denies the set_content_protected command without any pre-configured scope." +commands.deny = ["set_content_protected"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_cursor_grab.toml b/core/tauri/permissions/window/autogenerated/commands/set_cursor_grab.toml new file mode 100644 index 000000000000..455d0dd3b32b --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_cursor_grab.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-cursor-grab" +description = "Enables the set_cursor_grab command without any pre-configured scope." +commands.allow = ["set_cursor_grab"] + +[[permission]] +identifier = "deny-set-cursor-grab" +description = "Denies the set_cursor_grab command without any pre-configured scope." +commands.deny = ["set_cursor_grab"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_cursor_icon.toml b/core/tauri/permissions/window/autogenerated/commands/set_cursor_icon.toml new file mode 100644 index 000000000000..e6ed6b099569 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_cursor_icon.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-cursor-icon" +description = "Enables the set_cursor_icon command without any pre-configured scope." +commands.allow = ["set_cursor_icon"] + +[[permission]] +identifier = "deny-set-cursor-icon" +description = "Denies the set_cursor_icon command without any pre-configured scope." +commands.deny = ["set_cursor_icon"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_cursor_position.toml b/core/tauri/permissions/window/autogenerated/commands/set_cursor_position.toml new file mode 100644 index 000000000000..98ec27bb380c --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_cursor_position.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-cursor-position" +description = "Enables the set_cursor_position command without any pre-configured scope." +commands.allow = ["set_cursor_position"] + +[[permission]] +identifier = "deny-set-cursor-position" +description = "Denies the set_cursor_position command without any pre-configured scope." +commands.deny = ["set_cursor_position"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_cursor_visible.toml b/core/tauri/permissions/window/autogenerated/commands/set_cursor_visible.toml new file mode 100644 index 000000000000..b2668a965598 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_cursor_visible.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-cursor-visible" +description = "Enables the set_cursor_visible command without any pre-configured scope." +commands.allow = ["set_cursor_visible"] + +[[permission]] +identifier = "deny-set-cursor-visible" +description = "Denies the set_cursor_visible command without any pre-configured scope." +commands.deny = ["set_cursor_visible"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_decorations.toml b/core/tauri/permissions/window/autogenerated/commands/set_decorations.toml new file mode 100644 index 000000000000..4db5281d7408 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_decorations.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-decorations" +description = "Enables the set_decorations command without any pre-configured scope." +commands.allow = ["set_decorations"] + +[[permission]] +identifier = "deny-set-decorations" +description = "Denies the set_decorations command without any pre-configured scope." +commands.deny = ["set_decorations"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_effects.toml b/core/tauri/permissions/window/autogenerated/commands/set_effects.toml new file mode 100644 index 000000000000..16d707979713 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_effects.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-effects" +description = "Enables the set_effects command without any pre-configured scope." +commands.allow = ["set_effects"] + +[[permission]] +identifier = "deny-set-effects" +description = "Denies the set_effects command without any pre-configured scope." +commands.deny = ["set_effects"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_focus.toml b/core/tauri/permissions/window/autogenerated/commands/set_focus.toml new file mode 100644 index 000000000000..79e6d81a3cc0 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_focus.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-focus" +description = "Enables the set_focus command without any pre-configured scope." +commands.allow = ["set_focus"] + +[[permission]] +identifier = "deny-set-focus" +description = "Denies the set_focus command without any pre-configured scope." +commands.deny = ["set_focus"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_fullscreen.toml b/core/tauri/permissions/window/autogenerated/commands/set_fullscreen.toml new file mode 100644 index 000000000000..9ff220fe60a5 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_fullscreen.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-fullscreen" +description = "Enables the set_fullscreen command without any pre-configured scope." +commands.allow = ["set_fullscreen"] + +[[permission]] +identifier = "deny-set-fullscreen" +description = "Denies the set_fullscreen command without any pre-configured scope." +commands.deny = ["set_fullscreen"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_icon.toml b/core/tauri/permissions/window/autogenerated/commands/set_icon.toml new file mode 100644 index 000000000000..556648a688bc --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_icon.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-icon" +description = "Enables the set_icon command without any pre-configured scope." +commands.allow = ["set_icon"] + +[[permission]] +identifier = "deny-set-icon" +description = "Denies the set_icon command without any pre-configured scope." +commands.deny = ["set_icon"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_ignore_cursor_events.toml b/core/tauri/permissions/window/autogenerated/commands/set_ignore_cursor_events.toml new file mode 100644 index 000000000000..c437a4be7284 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_ignore_cursor_events.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-ignore-cursor-events" +description = "Enables the set_ignore_cursor_events command without any pre-configured scope." +commands.allow = ["set_ignore_cursor_events"] + +[[permission]] +identifier = "deny-set-ignore-cursor-events" +description = "Denies the set_ignore_cursor_events command without any pre-configured scope." +commands.deny = ["set_ignore_cursor_events"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_max_size.toml b/core/tauri/permissions/window/autogenerated/commands/set_max_size.toml new file mode 100644 index 000000000000..c08893fa4560 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_max_size.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-max-size" +description = "Enables the set_max_size command without any pre-configured scope." +commands.allow = ["set_max_size"] + +[[permission]] +identifier = "deny-set-max-size" +description = "Denies the set_max_size command without any pre-configured scope." +commands.deny = ["set_max_size"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_maximizable.toml b/core/tauri/permissions/window/autogenerated/commands/set_maximizable.toml new file mode 100644 index 000000000000..b4d3c19222f8 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_maximizable.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-maximizable" +description = "Enables the set_maximizable command without any pre-configured scope." +commands.allow = ["set_maximizable"] + +[[permission]] +identifier = "deny-set-maximizable" +description = "Denies the set_maximizable command without any pre-configured scope." +commands.deny = ["set_maximizable"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_min_size.toml b/core/tauri/permissions/window/autogenerated/commands/set_min_size.toml new file mode 100644 index 000000000000..b168be30c7c7 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_min_size.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-min-size" +description = "Enables the set_min_size command without any pre-configured scope." +commands.allow = ["set_min_size"] + +[[permission]] +identifier = "deny-set-min-size" +description = "Denies the set_min_size command without any pre-configured scope." +commands.deny = ["set_min_size"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_minimizable.toml b/core/tauri/permissions/window/autogenerated/commands/set_minimizable.toml new file mode 100644 index 000000000000..727948c3935b --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_minimizable.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-minimizable" +description = "Enables the set_minimizable command without any pre-configured scope." +commands.allow = ["set_minimizable"] + +[[permission]] +identifier = "deny-set-minimizable" +description = "Denies the set_minimizable command without any pre-configured scope." +commands.deny = ["set_minimizable"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_position.toml b/core/tauri/permissions/window/autogenerated/commands/set_position.toml new file mode 100644 index 000000000000..3ed75531b56b --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_position.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-position" +description = "Enables the set_position command without any pre-configured scope." +commands.allow = ["set_position"] + +[[permission]] +identifier = "deny-set-position" +description = "Denies the set_position command without any pre-configured scope." +commands.deny = ["set_position"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_progress_bar.toml b/core/tauri/permissions/window/autogenerated/commands/set_progress_bar.toml new file mode 100644 index 000000000000..dcf769e174a7 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_progress_bar.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-progress-bar" +description = "Enables the set_progress_bar command without any pre-configured scope." +commands.allow = ["set_progress_bar"] + +[[permission]] +identifier = "deny-set-progress-bar" +description = "Denies the set_progress_bar command without any pre-configured scope." +commands.deny = ["set_progress_bar"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_resizable.toml b/core/tauri/permissions/window/autogenerated/commands/set_resizable.toml new file mode 100644 index 000000000000..f6fa71794d5c --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_resizable.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-resizable" +description = "Enables the set_resizable command without any pre-configured scope." +commands.allow = ["set_resizable"] + +[[permission]] +identifier = "deny-set-resizable" +description = "Denies the set_resizable command without any pre-configured scope." +commands.deny = ["set_resizable"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_shadow.toml b/core/tauri/permissions/window/autogenerated/commands/set_shadow.toml new file mode 100644 index 000000000000..89bae03037dd --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_shadow.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-shadow" +description = "Enables the set_shadow command without any pre-configured scope." +commands.allow = ["set_shadow"] + +[[permission]] +identifier = "deny-set-shadow" +description = "Denies the set_shadow command without any pre-configured scope." +commands.deny = ["set_shadow"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_size.toml b/core/tauri/permissions/window/autogenerated/commands/set_size.toml new file mode 100644 index 000000000000..0b2dd25c2f28 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_size.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-size" +description = "Enables the set_size command without any pre-configured scope." +commands.allow = ["set_size"] + +[[permission]] +identifier = "deny-set-size" +description = "Denies the set_size command without any pre-configured scope." +commands.deny = ["set_size"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_skip_taskbar.toml b/core/tauri/permissions/window/autogenerated/commands/set_skip_taskbar.toml new file mode 100644 index 000000000000..ad5957c08571 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_skip_taskbar.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-skip-taskbar" +description = "Enables the set_skip_taskbar command without any pre-configured scope." +commands.allow = ["set_skip_taskbar"] + +[[permission]] +identifier = "deny-set-skip-taskbar" +description = "Denies the set_skip_taskbar command without any pre-configured scope." +commands.deny = ["set_skip_taskbar"] diff --git a/core/tauri/permissions/window/autogenerated/commands/set_title.toml b/core/tauri/permissions/window/autogenerated/commands/set_title.toml new file mode 100644 index 000000000000..b522982eb117 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/set_title.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-set-title" +description = "Enables the set_title command without any pre-configured scope." +commands.allow = ["set_title"] + +[[permission]] +identifier = "deny-set-title" +description = "Denies the set_title command without any pre-configured scope." +commands.deny = ["set_title"] diff --git a/core/tauri/permissions/window/autogenerated/commands/show.toml b/core/tauri/permissions/window/autogenerated/commands/show.toml new file mode 100644 index 000000000000..ed84f065c642 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/show.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-show" +description = "Enables the show command without any pre-configured scope." +commands.allow = ["show"] + +[[permission]] +identifier = "deny-show" +description = "Denies the show command without any pre-configured scope." +commands.deny = ["show"] diff --git a/core/tauri/permissions/window/autogenerated/commands/start_dragging.toml b/core/tauri/permissions/window/autogenerated/commands/start_dragging.toml new file mode 100644 index 000000000000..5864ae81e930 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/start_dragging.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-start-dragging" +description = "Enables the start_dragging command without any pre-configured scope." +commands.allow = ["start_dragging"] + +[[permission]] +identifier = "deny-start-dragging" +description = "Denies the start_dragging command without any pre-configured scope." +commands.deny = ["start_dragging"] diff --git a/core/tauri/permissions/window/autogenerated/commands/theme.toml b/core/tauri/permissions/window/autogenerated/commands/theme.toml new file mode 100644 index 000000000000..09fdd772839b --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/theme.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-theme" +description = "Enables the theme command without any pre-configured scope." +commands.allow = ["theme"] + +[[permission]] +identifier = "deny-theme" +description = "Denies the theme command without any pre-configured scope." +commands.deny = ["theme"] diff --git a/core/tauri/permissions/window/autogenerated/commands/title.toml b/core/tauri/permissions/window/autogenerated/commands/title.toml new file mode 100644 index 000000000000..327dd30be247 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/title.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-title" +description = "Enables the title command without any pre-configured scope." +commands.allow = ["title"] + +[[permission]] +identifier = "deny-title" +description = "Denies the title command without any pre-configured scope." +commands.deny = ["title"] diff --git a/core/tauri/permissions/window/autogenerated/commands/toggle_maximize.toml b/core/tauri/permissions/window/autogenerated/commands/toggle_maximize.toml new file mode 100644 index 000000000000..01a601aa026c --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/toggle_maximize.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-toggle-maximize" +description = "Enables the toggle_maximize command without any pre-configured scope." +commands.allow = ["toggle_maximize"] + +[[permission]] +identifier = "deny-toggle-maximize" +description = "Denies the toggle_maximize command without any pre-configured scope." +commands.deny = ["toggle_maximize"] diff --git a/core/tauri/permissions/window/autogenerated/commands/unmaximize.toml b/core/tauri/permissions/window/autogenerated/commands/unmaximize.toml new file mode 100644 index 000000000000..47701d92f6e4 --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/unmaximize.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-unmaximize" +description = "Enables the unmaximize command without any pre-configured scope." +commands.allow = ["unmaximize"] + +[[permission]] +identifier = "deny-unmaximize" +description = "Denies the unmaximize command without any pre-configured scope." +commands.deny = ["unmaximize"] diff --git a/core/tauri/permissions/window/autogenerated/commands/unminimize.toml b/core/tauri/permissions/window/autogenerated/commands/unminimize.toml new file mode 100644 index 000000000000..abefddecd37e --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/commands/unminimize.toml @@ -0,0 +1,16 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../../.schema.json" + +[[permission]] +identifier = "allow-unminimize" +description = "Enables the unminimize command without any pre-configured scope." +commands.allow = ["unminimize"] + +[[permission]] +identifier = "deny-unminimize" +description = "Denies the unminimize command without any pre-configured scope." +commands.deny = ["unminimize"] diff --git a/core/tauri/permissions/window/autogenerated/default.toml b/core/tauri/permissions/window/autogenerated/default.toml new file mode 100644 index 000000000000..01559b388a0a --- /dev/null +++ b/core/tauri/permissions/window/autogenerated/default.toml @@ -0,0 +1,8 @@ +# Copyright 2019-2023 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +# Automatically generated - DO NOT EDIT! + +[default] +description = "Default permissions for the plugin." +permissions = ["allow-scale-factor", "allow-inner-position", "allow-outer-position", "allow-inner-size", "allow-outer-size", "allow-is-fullscreen", "allow-is-minimized", "allow-is-maximized", "allow-is-focused", "allow-is-decorated", "allow-is-resizable", "allow-is-maximizable", "allow-is-minimizable", "allow-is-closable", "allow-is-visible", "allow-title", "allow-current-monitor", "allow-primary-monitor", "allow-available-monitors", "allow-theme", "allow-internal-toggle-maximize", "allow-internal-toggle-devtools"] diff --git a/core/tauri/scripts/bundle.global.js b/core/tauri/scripts/bundle.global.js index 307c39742799..4a4dc4e26fbc 100644 --- a/core/tauri/scripts/bundle.global.js +++ b/core/tauri/scripts/bundle.global.js @@ -1 +1 @@ -var __TAURI_IIFE__=function(e){"use strict";function n(e,n,t,i){if("a"===t&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?e!==n||!i:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?i:"a"===t?i.call(e):i?i.value:n.get(e)}function t(e,n,t,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?e!==n||!r:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,t):r?r.value=t:n.set(e,t),t}var i,r;function a(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}"function"==typeof SuppressedError&&SuppressedError;class s{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),this.id=a((e=>{n(this,i,"f").call(this,e)}))}set onmessage(e){t(this,i,e,"f")}get onmessage(){return n(this,i,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}i=new WeakMap;class l{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return o(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function o(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}class u{get rid(){return n(this,r,"f")}constructor(e){r.set(this,void 0),t(this,r,e,"f")}async close(){return o("plugin:resources|close",{rid:this.rid})}}r=new WeakMap;var c=Object.freeze({__proto__:null,Channel:s,PluginListener:l,Resource:u,addPluginListener:async function(e,n,t){const i=new s;return i.onmessage=t,o(`plugin:${e}|register_listener`,{event:n,handler:i}).then((()=>new l(e,n,i.id)))},convertFileSrc:function(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)},invoke:o,transformCallback:a});var d,p=Object.freeze({__proto__:null,getName:async function(){return o("plugin:app|name")},getTauriVersion:async function(){return o("plugin:app|tauri_version")},getVersion:async function(){return o("plugin:app|version")},hide:async function(){return o("plugin:app|app_hide")},show:async function(){return o("plugin:app|app_show")}});async function h(e,n){await o("plugin:event|unlisten",{event:e,eventId:n})}async function y(e,n,t){return o("plugin:event|listen",{event:e,windowLabel:t?.target,handler:a(n)}).then((n=>async()=>h(e,n)))}async function g(e,n,t){return y(e,(t=>{n(t),h(e,t.id).catch((()=>{}))}),t)}async function w(e,n,t){await o("plugin:event|emit",{event:e,windowLabel:t?.target,payload:n})}!function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled"}(d||(d={}));var _=Object.freeze({__proto__:null,get TauriEvent(){return d},emit:w,listen:y,once:g});class m{constructor(e,n){this.type="Logical",this.width=e,this.height=n}}class b{constructor(e,n){this.type="Physical",this.width=e,this.height=n}toLogical(e){return new m(this.width/e,this.height/e)}}class f{constructor(e,n){this.type="Logical",this.x=e,this.y=n}}class v{constructor(e,n){this.type="Physical",this.x=e,this.y=n}toLogical(e){return new f(this.x/e,this.y/e)}}var k,D,A=Object.freeze({__proto__:null,LogicalPosition:f,LogicalSize:m,PhysicalPosition:v,PhysicalSize:b});!function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"}(k||(k={}));class E{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}function I(){return new P(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function L(){return window.__TAURI_INTERNALS__.metadata.windows.map((e=>new P(e.label,{skip:!0})))}!function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"}(D||(D={}));const S=["tauri://created","tauri://error"];class P{constructor(e,n={}){this.label=e,this.listeners=Object.create(null),n?.skip||o("plugin:window|create",{options:{...n,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static getByLabel(e){return L().some((n=>n.label===e))?new P(e,{skip:!0}):null}static getCurrent(){return I()}static getAll(){return L()}static async getFocusedWindow(){for(const e of L())if(await e.isFocused())return e;return null}async listen(e,n){return this._handleTauriEvent(e,n)?Promise.resolve((()=>{const t=this.listeners[e];t.splice(t.indexOf(n),1)})):y(e,n,{target:this.label})}async once(e,n){return this._handleTauriEvent(e,n)?Promise.resolve((()=>{const t=this.listeners[e];t.splice(t.indexOf(n),1)})):g(e,n,{target:this.label})}async emit(e,n){if(S.includes(e)){for(const t of this.listeners[e]||[])t({event:e,id:-1,windowLabel:this.label,payload:n});return Promise.resolve()}return w(e,n,{target:this.label})}_handleTauriEvent(e,n){return!!S.includes(e)&&(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0)}async scaleFactor(){return o("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return o("plugin:window|inner_position",{label:this.label}).then((({x:e,y:n})=>new v(e,n)))}async outerPosition(){return o("plugin:window|outer_position",{label:this.label}).then((({x:e,y:n})=>new v(e,n)))}async innerSize(){return o("plugin:window|inner_size",{label:this.label}).then((({width:e,height:n})=>new b(e,n)))}async outerSize(){return o("plugin:window|outer_size",{label:this.label}).then((({width:e,height:n})=>new b(e,n)))}async isFullscreen(){return o("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return o("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return o("plugin:window|is_maximized",{label:this.label})}async isFocused(){return o("plugin:window|is_focused",{label:this.label})}async isDecorated(){return o("plugin:window|is_decorated",{label:this.label})}async isResizable(){return o("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return o("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return o("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return o("plugin:window|is_closable",{label:this.label})}async isVisible(){return o("plugin:window|is_visible",{label:this.label})}async title(){return o("plugin:window|title",{label:this.label})}async theme(){return o("plugin:window|theme",{label:this.label})}async center(){return o("plugin:window|center",{label:this.label})}async requestUserAttention(e){let n=null;return e&&(n=e===k.Critical?{type:"Critical"}:{type:"Informational"}),o("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(e){return o("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return o("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return o("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return o("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return o("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return o("plugin:window|maximize",{label:this.label})}async unmaximize(){return o("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return o("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return o("plugin:window|minimize",{label:this.label})}async unminimize(){return o("plugin:window|unminimize",{label:this.label})}async show(){return o("plugin:window|show",{label:this.label})}async hide(){return o("plugin:window|hide",{label:this.label})}async close(){return o("plugin:window|close",{label:this.label})}async setDecorations(e){return o("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return o("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return o("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return o("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return o("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return o("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return o("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return o("plugin:window|set_size",{label:this.label,value:{type:e.type,data:{width:e.width,height:e.height}}})}async setMinSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return o("plugin:window|set_min_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setMaxSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return o("plugin:window|set_max_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return o("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return o("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return o("plugin:window|set_focus",{label:this.label})}async setIcon(e){return o("plugin:window|set_icon",{label:this.label,value:"string"==typeof e?e:Array.from(e)})}async setSkipTaskbar(e){return o("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return o("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return o("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return o("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return o("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return o("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return o("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(e){return o("plugin:window|start_resize_dragging",{label:this.label,value:e})}async setProgressBar(e){return o("plugin:window|set_progress_bar",{label:this.label,value:e})}async onResized(e){return this.listen(d.WINDOW_RESIZED,(n=>{n.payload=R(n.payload),e(n)}))}async onMoved(e){return this.listen(d.WINDOW_MOVED,(n=>{n.payload=z(n.payload),e(n)}))}async onCloseRequested(e){return this.listen(d.WINDOW_CLOSE_REQUESTED,(n=>{const t=new E(n);Promise.resolve(e(t)).then((()=>{if(!t.isPreventDefault())return this.close()}))}))}async onFocusChanged(e){const n=await this.listen(d.WINDOW_FOCUS,(n=>{e({...n,payload:!0})})),t=await this.listen(d.WINDOW_BLUR,(n=>{e({...n,payload:!1})}));return()=>{n(),t()}}async onScaleChanged(e){return this.listen(d.WINDOW_SCALE_FACTOR_CHANGED,e)}async onFileDropEvent(e){const n=await this.listen(d.WINDOW_FILE_DROP,(n=>{e({...n,payload:{type:"drop",paths:n.payload.paths,position:z(n.payload.position)}})})),t=await this.listen(d.WINDOW_FILE_DROP_HOVER,(n=>{e({...n,payload:{type:"hover",paths:n.payload.paths,position:z(n.payload.position)}})})),i=await this.listen(d.WINDOW_FILE_DROP_CANCELLED,(n=>{e({...n,payload:{type:"cancel"}})}));return()=>{n(),t(),i()}}async onThemeChanged(e){return this.listen(d.WINDOW_THEME_CHANGED,e)}}var C,T;function x(e){return null===e?null:{name:e.name,scaleFactor:e.scaleFactor,position:z(e.position),size:R(e.size)}}function z(e){return new v(e.x,e.y)}function R(e){return new b(e.width,e.height)}!function(e){e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight"}(C||(C={})),function(e){e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive"}(T||(T={}));var F,W=Object.freeze({__proto__:null,CloseRequestedEvent:E,get Effect(){return C},get EffectState(){return T},LogicalPosition:f,LogicalSize:m,PhysicalPosition:v,PhysicalSize:b,get ProgressBarStatus(){return D},get UserAttentionType(){return k},Window:P,availableMonitors:async function(){return o("plugin:window|available_monitors").then((e=>e.map(x)))},currentMonitor:async function(){return o("plugin:window|current_monitor").then(x)},getAll:L,getCurrent:I,primaryMonitor:async function(){return o("plugin:window|primary_monitor").then(x)}});!function(e){e[e.Audio=1]="Audio",e[e.Cache=2]="Cache",e[e.Config=3]="Config",e[e.Data=4]="Data",e[e.LocalData=5]="LocalData",e[e.Document=6]="Document",e[e.Download=7]="Download",e[e.Picture=8]="Picture",e[e.Public=9]="Public",e[e.Video=10]="Video",e[e.Resource=11]="Resource",e[e.Temp=12]="Temp",e[e.AppConfig=13]="AppConfig",e[e.AppData=14]="AppData",e[e.AppLocalData=15]="AppLocalData",e[e.AppCache=16]="AppCache",e[e.AppLog=17]="AppLog",e[e.Desktop=18]="Desktop",e[e.Executable=19]="Executable",e[e.Font=20]="Font",e[e.Home=21]="Home",e[e.Runtime=22]="Runtime",e[e.Template=23]="Template"}(F||(F={}));var N=Object.freeze({__proto__:null,get BaseDirectory(){return F},appCacheDir:async function(){return o("plugin:path|resolve_directory",{directory:F.AppCache})},appConfigDir:async function(){return o("plugin:path|resolve_directory",{directory:F.AppConfig})},appDataDir:async function(){return o("plugin:path|resolve_directory",{directory:F.AppData})},appLocalDataDir:async function(){return o("plugin:path|resolve_directory",{directory:F.AppLocalData})},appLogDir:async function(){return o("plugin:path|resolve_directory",{directory:F.AppLog})},audioDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Audio})},basename:async function(e,n){return o("plugin:path|basename",{path:e,ext:n})},cacheDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Cache})},configDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Config})},dataDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Data})},delimiter:function(){return window.__TAURI_INTERNALS__.plugins.path.delimiter},desktopDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Desktop})},dirname:async function(e){return o("plugin:path|dirname",{path:e})},documentDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Document})},downloadDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Download})},executableDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Executable})},extname:async function(e){return o("plugin:path|extname",{path:e})},fontDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Font})},homeDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Home})},isAbsolute:async function(e){return o("plugin:path|isAbsolute",{path:e})},join:async function(...e){return o("plugin:path|join",{paths:e})},localDataDir:async function(){return o("plugin:path|resolve_directory",{directory:F.LocalData})},normalize:async function(e){return o("plugin:path|normalize",{path:e})},pictureDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Picture})},publicDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Public})},resolve:async function(...e){return o("plugin:path|resolve",{paths:e})},resolveResource:async function(e){return o("plugin:path|resolve_directory",{directory:F.Resource,path:e})},resourceDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Resource})},runtimeDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Runtime})},sep:function(){return window.__TAURI_INTERNALS__.plugins.path.sep},tempDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Temp})},templateDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Template})},videoDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Video})}});class O extends u{constructor(e,n){super(e),this.id=n}static async new(e){e?.menu&&(e.menu=[e.menu.rid,e.menu.kind]),e?.icon&&(e.icon="string"==typeof e.icon?e.icon:Array.from(e.icon));const n=new s;return e?.action&&(n.onmessage=e.action,delete e.action),o("plugin:tray|new",{options:e??{},handler:n}).then((([e,n])=>new O(e,n)))}async setIcon(e){let n=null;return e&&(n="string"==typeof e?e:Array.from(e)),o("plugin:tray|set_icon",{rid:this.rid,icon:n})}async setMenu(e){return e&&(e=[e.rid,e.kind]),o("plugin:tray|set_menu",{rid:this.rid,menu:e})}async setTooltip(e){return o("plugin:tray|set_tooltip",{rid:this.rid,tooltip:e})}async setTitle(e){return o("plugin:tray|set_title",{rid:this.rid,title:e})}async setVisible(e){return o("plugin:tray|set_visible",{rid:this.rid,visible:e})}async setTempDirPath(e){return o("plugin:tray|set_temp_dir_path",{rid:this.rid,path:e})}async setIconAsTemplate(e){return o("plugin:tray|set_icon_as_template",{rid:this.rid,asTemplate:e})}async setMenuOnLeftClick(e){return o("plugin:tray|set_show_menu_on_left_click",{rid:this.rid,onLeft:e})}}var M,U,B,V=Object.freeze({__proto__:null,TrayIcon:O});function H(e){if("items"in e)e.items=e.items?.map((e=>"rid"in e?e:H(e)));else if("action"in e&&e.action){const n=new s;return n.onmessage=e.action,delete e.action,{...e,handler:n}}return e}async function G(e,n){const t=new s;let i=null;return n&&"object"==typeof n&&("action"in n&&n.action&&(t.onmessage=n.action,delete n.action),"items"in n&&n.items&&(i=n.items.map((e=>"rid"in e?[e.rid,e.kind]:H(e))))),o("plugin:menu|new",{kind:e,options:n?{...n,items:i}:void 0,handler:t})}class j extends u{get id(){return n(this,M,"f")}get kind(){return n(this,U,"f")}constructor(e,n,i){super(e),M.set(this,void 0),U.set(this,void 0),t(this,M,n,"f"),t(this,U,i,"f")}}M=new WeakMap,U=new WeakMap;class q extends j{constructor(e,n){super(e,n,"MenuItem")}static async new(e){return G("MenuItem",e).then((([e,n])=>new q(e,n)))}async text(){return o("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return o("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return o("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return o("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return o("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}}class Q extends j{constructor(e,n){super(e,n,"Check")}static async new(e){return G("Check",e).then((([e,n])=>new Q(e,n)))}async text(){return o("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return o("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return o("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return o("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return o("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async isChecked(){return o("plugin:menu|is_checked",{rid:this.rid})}async setChecked(e){return o("plugin:menu|set_checked",{rid:this.rid,checked:e})}}!function(e){e.Add="Add",e.Advanced="Advanced",e.Bluetooth="Bluetooth",e.Bookmarks="Bookmarks",e.Caution="Caution",e.ColorPanel="ColorPanel",e.ColumnView="ColumnView",e.Computer="Computer",e.EnterFullScreen="EnterFullScreen",e.Everyone="Everyone",e.ExitFullScreen="ExitFullScreen",e.FlowView="FlowView",e.Folder="Folder",e.FolderBurnable="FolderBurnable",e.FolderSmart="FolderSmart",e.FollowLinkFreestanding="FollowLinkFreestanding",e.FontPanel="FontPanel",e.GoLeft="GoLeft",e.GoRight="GoRight",e.Home="Home",e.IChatTheater="IChatTheater",e.IconView="IconView",e.Info="Info",e.InvalidDataFreestanding="InvalidDataFreestanding",e.LeftFacingTriangle="LeftFacingTriangle",e.ListView="ListView",e.LockLocked="LockLocked",e.LockUnlocked="LockUnlocked",e.MenuMixedState="MenuMixedState",e.MenuOnState="MenuOnState",e.MobileMe="MobileMe",e.MultipleDocuments="MultipleDocuments",e.Network="Network",e.Path="Path",e.PreferencesGeneral="PreferencesGeneral",e.QuickLook="QuickLook",e.RefreshFreestanding="RefreshFreestanding",e.Refresh="Refresh",e.Remove="Remove",e.RevealFreestanding="RevealFreestanding",e.RightFacingTriangle="RightFacingTriangle",e.Share="Share",e.Slideshow="Slideshow",e.SmartBadge="SmartBadge",e.StatusAvailable="StatusAvailable",e.StatusNone="StatusNone",e.StatusPartiallyAvailable="StatusPartiallyAvailable",e.StatusUnavailable="StatusUnavailable",e.StopProgressFreestanding="StopProgressFreestanding",e.StopProgress="StopProgress",e.TrashEmpty="TrashEmpty",e.TrashFull="TrashFull",e.User="User",e.UserAccounts="UserAccounts",e.UserGroup="UserGroup",e.UserGuest="UserGuest"}(B||(B={}));class $ extends j{constructor(e,n){super(e,n,"Icon")}static async new(e){return G("Icon",e).then((([e,n])=>new $(e,n)))}async text(){return o("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return o("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return o("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return o("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return o("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async setIcon(e){return o("plugin:menu|set_icon",{rid:this.rid,icon:e})}}class Z extends j{constructor(e,n){super(e,n,"Predefined")}static async new(e){return G("Predefined",e).then((([e,n])=>new Z(e,n)))}async text(){return o("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return o("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}}function J([e,n,t]){switch(t){case"Submenu":return new K(e,n);case"Predefined":return new Z(e,n);case"Check":return new Q(e,n);case"Icon":return new $(e,n);default:return new q(e,n)}}class K extends j{constructor(e,n){super(e,n,"Submenu")}static async new(e){return G("Submenu",e).then((([e,n])=>new K(e,n)))}async text(){return o("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return o("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return o("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return o("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async append(e){return o("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map((e=>"rid"in e?[e.rid,e.kind]:e))})}async prepend(e){return o("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map((e=>"rid"in e?[e.rid,e.kind]:e))})}async insert(e,n){return o("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map((e=>"rid"in e?[e.rid,e.kind]:e)),position:n})}async remove(e){return o("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return o("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(J)}async items(){return o("plugin:menu|items",{rid:this.rid,kind:this.kind}).then((e=>e.map(J)))}async get(e){return o("plugin:menu|get",{rid:this.rid,kind:this.kind,id:e}).then((e=>e?J(e):null))}async popup(e,n){let t=null;return e&&(t={type:e instanceof v?"Physical":"Logical",data:e}),o("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:n?.label??null,at:t})}async setAsWindowsMenuForNSApp(){return o("plugin:menu|set_as_windows_menu_for_nsapp",{rid:this.rid})}async setAsHelpMenuForNSApp(){return o("plugin:menu|set_as_help_menu_for_nsapp",{rid:this.rid})}}function Y([e,n,t]){switch(t){case"Submenu":return new K(e,n);case"Predefined":return new Z(e,n);case"Check":return new Q(e,n);case"Icon":return new $(e,n);default:return new q(e,n)}}class X extends j{constructor(e,n){super(e,n,"Menu")}static async new(e){return G("Menu",e).then((([e,n])=>new X(e,n)))}static async default(){return o("plugin:menu|default").then((([e,n])=>new X(e,n)))}async append(e){return o("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map((e=>"rid"in e?[e.rid,e.kind]:e))})}async prepend(e){return o("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map((e=>"rid"in e?[e.rid,e.kind]:e))})}async insert(e,n){return o("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map((e=>"rid"in e?[e.rid,e.kind]:e)),position:n})}async remove(e){return o("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return o("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(Y)}async items(){return o("plugin:menu|items",{rid:this.rid,kind:this.kind}).then((e=>e.map(Y)))}async get(e){return o("plugin:menu|get",{rid:this.rid,kind:this.kind,id:e}).then((e=>e?Y(e):null))}async popup(e,n){let t=null;return e&&(t={type:e instanceof v?"Physical":"Logical",data:e}),o("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:n?.label??null,at:t})}async setAsAppMenu(){return o("plugin:menu|set_as_app_menu",{rid:this.rid}).then((e=>e?new X(e[0],e[1]):null))}async setAsWindowMenu(e){return o("plugin:menu|set_as_window_menu",{rid:this.rid,window:e?.label??null}).then((e=>e?new X(e[0],e[1]):null))}}var ee=Object.freeze({__proto__:null,CheckMenuItem:Q,IconMenuItem:$,Menu:X,MenuItem:q,get NativeIcon(){return B},PredefinedMenuItem:Z,Submenu:K});return e.app=p,e.core=c,e.dpi=A,e.event=_,e.menu=ee,e.path=N,e.tray=V,e.window=W,e}({});window.__TAURI__=__TAURI_IIFE__; +var __TAURI_IIFE__=function(e){"use strict";function n(e,n,t,i){if("a"===t&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?e!==n||!i:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?i:"a"===t?i.call(e):i?i.value:n.get(e)}function t(e,n,t,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?e!==n||!r:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,t):r?r.value=t:n.set(e,t),t}var i,r;function a(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}"function"==typeof SuppressedError&&SuppressedError;class s{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),this.id=a((e=>{n(this,i,"f").call(this,e)}))}set onmessage(e){t(this,i,e,"f")}get onmessage(){return n(this,i,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}i=new WeakMap;class l{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return o(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function o(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}class u{get rid(){return n(this,r,"f")}constructor(e){r.set(this,void 0),t(this,r,e,"f")}async close(){return o("plugin:resources|close",{rid:this.rid})}}r=new WeakMap;var c=Object.freeze({__proto__:null,Channel:s,PluginListener:l,Resource:u,addPluginListener:async function(e,n,t){const i=new s;return i.onmessage=t,o(`plugin:${e}|register_listener`,{event:n,handler:i}).then((()=>new l(e,n,i.id)))},convertFileSrc:function(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)},invoke:o,transformCallback:a});var d,p=Object.freeze({__proto__:null,getName:async function(){return o("plugin:app|name")},getTauriVersion:async function(){return o("plugin:app|tauri_version")},getVersion:async function(){return o("plugin:app|version")},hide:async function(){return o("plugin:app|app_hide")},show:async function(){return o("plugin:app|app_show")}});async function h(e,n){await o("plugin:event|unlisten",{event:e,eventId:n})}async function y(e,n,t){return o("plugin:event|listen",{event:e,windowLabel:t?.target,handler:a(n)}).then((n=>async()=>h(e,n)))}async function g(e,n,t){return y(e,(t=>{n(t),h(e,t.id).catch((()=>{}))}),t)}async function w(e,n,t){await o("plugin:event|emit",{event:e,windowLabel:t?.target,payload:n})}!function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled"}(d||(d={}));var _=Object.freeze({__proto__:null,get TauriEvent(){return d},emit:w,listen:y,once:g});class m{constructor(e,n){this.type="Logical",this.width=e,this.height=n}}class b{constructor(e,n){this.type="Physical",this.width=e,this.height=n}toLogical(e){return new m(this.width/e,this.height/e)}}class f{constructor(e,n){this.type="Logical",this.x=e,this.y=n}}class v{constructor(e,n){this.type="Physical",this.x=e,this.y=n}toLogical(e){return new f(this.x/e,this.y/e)}}var k,D,A=Object.freeze({__proto__:null,LogicalPosition:f,LogicalSize:m,PhysicalPosition:v,PhysicalSize:b});!function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"}(k||(k={}));class E{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}function I(){return new P(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function L(){return window.__TAURI_INTERNALS__.metadata.windows.map((e=>new P(e.label,{skip:!0})))}!function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"}(D||(D={}));const S=["tauri://created","tauri://error"];class P{constructor(e,n={}){this.label=e,this.listeners=Object.create(null),n?.skip||o("plugin:window|create",{options:{...n,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static getByLabel(e){return L().some((n=>n.label===e))?new P(e,{skip:!0}):null}static getCurrent(){return I()}static getAll(){return L()}static async getFocusedWindow(){for(const e of L())if(await e.isFocused())return e;return null}async listen(e,n){return this._handleTauriEvent(e,n)?Promise.resolve((()=>{const t=this.listeners[e];t.splice(t.indexOf(n),1)})):y(e,n,{target:this.label})}async once(e,n){return this._handleTauriEvent(e,n)?Promise.resolve((()=>{const t=this.listeners[e];t.splice(t.indexOf(n),1)})):g(e,n,{target:this.label})}async emit(e,n){if(S.includes(e)){for(const t of this.listeners[e]||[])t({event:e,id:-1,windowLabel:this.label,payload:n});return Promise.resolve()}return w(e,n,{target:this.label})}_handleTauriEvent(e,n){return!!S.includes(e)&&(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0)}async scaleFactor(){return o("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return o("plugin:window|inner_position",{label:this.label}).then((({x:e,y:n})=>new v(e,n)))}async outerPosition(){return o("plugin:window|outer_position",{label:this.label}).then((({x:e,y:n})=>new v(e,n)))}async innerSize(){return o("plugin:window|inner_size",{label:this.label}).then((({width:e,height:n})=>new b(e,n)))}async outerSize(){return o("plugin:window|outer_size",{label:this.label}).then((({width:e,height:n})=>new b(e,n)))}async isFullscreen(){return o("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return o("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return o("plugin:window|is_maximized",{label:this.label})}async isFocused(){return o("plugin:window|is_focused",{label:this.label})}async isDecorated(){return o("plugin:window|is_decorated",{label:this.label})}async isResizable(){return o("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return o("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return o("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return o("plugin:window|is_closable",{label:this.label})}async isVisible(){return o("plugin:window|is_visible",{label:this.label})}async title(){return o("plugin:window|title",{label:this.label})}async theme(){return o("plugin:window|theme",{label:this.label})}async center(){return o("plugin:window|center",{label:this.label})}async requestUserAttention(e){let n=null;return e&&(n=e===k.Critical?{type:"Critical"}:{type:"Informational"}),o("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(e){return o("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return o("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return o("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return o("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return o("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return o("plugin:window|maximize",{label:this.label})}async unmaximize(){return o("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return o("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return o("plugin:window|minimize",{label:this.label})}async unminimize(){return o("plugin:window|unminimize",{label:this.label})}async show(){return o("plugin:window|show",{label:this.label})}async hide(){return o("plugin:window|hide",{label:this.label})}async close(){return o("plugin:window|close",{label:this.label})}async setDecorations(e){return o("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return o("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return o("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return o("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return o("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return o("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return o("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return o("plugin:window|set_size",{label:this.label,value:{type:e.type,data:{width:e.width,height:e.height}}})}async setMinSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return o("plugin:window|set_min_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setMaxSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return o("plugin:window|set_max_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return o("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return o("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return o("plugin:window|set_focus",{label:this.label})}async setIcon(e){return o("plugin:window|set_icon",{label:this.label,value:"string"==typeof e?e:Array.from(e)})}async setSkipTaskbar(e){return o("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return o("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return o("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return o("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return o("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return o("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return o("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(e){return o("plugin:window|start_resize_dragging",{label:this.label,value:e})}async setProgressBar(e){return o("plugin:window|set_progress_bar",{label:this.label,value:e})}async onResized(e){return this.listen(d.WINDOW_RESIZED,(n=>{n.payload=R(n.payload),e(n)}))}async onMoved(e){return this.listen(d.WINDOW_MOVED,(n=>{n.payload=z(n.payload),e(n)}))}async onCloseRequested(e){return this.listen(d.WINDOW_CLOSE_REQUESTED,(n=>{const t=new E(n);Promise.resolve(e(t)).then((()=>{if(!t.isPreventDefault())return this.close()}))}))}async onFocusChanged(e){const n=await this.listen(d.WINDOW_FOCUS,(n=>{e({...n,payload:!0})})),t=await this.listen(d.WINDOW_BLUR,(n=>{e({...n,payload:!1})}));return()=>{n(),t()}}async onScaleChanged(e){return this.listen(d.WINDOW_SCALE_FACTOR_CHANGED,e)}async onFileDropEvent(e){const n=await this.listen(d.WINDOW_FILE_DROP,(n=>{e({...n,payload:{type:"drop",paths:n.payload.paths,position:z(n.payload.position)}})})),t=await this.listen(d.WINDOW_FILE_DROP_HOVER,(n=>{e({...n,payload:{type:"hover",paths:n.payload.paths,position:z(n.payload.position)}})})),i=await this.listen(d.WINDOW_FILE_DROP_CANCELLED,(n=>{e({...n,payload:{type:"cancel"}})}));return()=>{n(),t(),i()}}async onThemeChanged(e){return this.listen(d.WINDOW_THEME_CHANGED,e)}}var C,T;function x(e){return null===e?null:{name:e.name,scaleFactor:e.scaleFactor,position:z(e.position),size:R(e.size)}}function z(e){return new v(e.x,e.y)}function R(e){return new b(e.width,e.height)}!function(e){e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight"}(C||(C={})),function(e){e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive"}(T||(T={}));var F,W=Object.freeze({__proto__:null,CloseRequestedEvent:E,get Effect(){return C},get EffectState(){return T},LogicalPosition:f,LogicalSize:m,PhysicalPosition:v,PhysicalSize:b,get ProgressBarStatus(){return D},get UserAttentionType(){return k},Window:P,availableMonitors:async function(){return o("plugin:window|available_monitors").then((e=>e.map(x)))},currentMonitor:async function(){return o("plugin:window|current_monitor").then(x)},getAll:L,getCurrent:I,primaryMonitor:async function(){return o("plugin:window|primary_monitor").then(x)}});!function(e){e[e.Audio=1]="Audio",e[e.Cache=2]="Cache",e[e.Config=3]="Config",e[e.Data=4]="Data",e[e.LocalData=5]="LocalData",e[e.Document=6]="Document",e[e.Download=7]="Download",e[e.Picture=8]="Picture",e[e.Public=9]="Public",e[e.Video=10]="Video",e[e.Resource=11]="Resource",e[e.Temp=12]="Temp",e[e.AppConfig=13]="AppConfig",e[e.AppData=14]="AppData",e[e.AppLocalData=15]="AppLocalData",e[e.AppCache=16]="AppCache",e[e.AppLog=17]="AppLog",e[e.Desktop=18]="Desktop",e[e.Executable=19]="Executable",e[e.Font=20]="Font",e[e.Home=21]="Home",e[e.Runtime=22]="Runtime",e[e.Template=23]="Template"}(F||(F={}));var N=Object.freeze({__proto__:null,get BaseDirectory(){return F},appCacheDir:async function(){return o("plugin:path|resolve_directory",{directory:F.AppCache})},appConfigDir:async function(){return o("plugin:path|resolve_directory",{directory:F.AppConfig})},appDataDir:async function(){return o("plugin:path|resolve_directory",{directory:F.AppData})},appLocalDataDir:async function(){return o("plugin:path|resolve_directory",{directory:F.AppLocalData})},appLogDir:async function(){return o("plugin:path|resolve_directory",{directory:F.AppLog})},audioDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Audio})},basename:async function(e,n){return o("plugin:path|basename",{path:e,ext:n})},cacheDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Cache})},configDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Config})},dataDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Data})},delimiter:function(){return window.__TAURI_INTERNALS__.plugins.path.delimiter},desktopDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Desktop})},dirname:async function(e){return o("plugin:path|dirname",{path:e})},documentDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Document})},downloadDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Download})},executableDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Executable})},extname:async function(e){return o("plugin:path|extname",{path:e})},fontDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Font})},homeDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Home})},isAbsolute:async function(e){return o("plugin:path|isAbsolute",{path:e})},join:async function(...e){return o("plugin:path|join",{paths:e})},localDataDir:async function(){return o("plugin:path|resolve_directory",{directory:F.LocalData})},normalize:async function(e){return o("plugin:path|normalize",{path:e})},pictureDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Picture})},publicDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Public})},resolve:async function(...e){return o("plugin:path|resolve",{paths:e})},resolveResource:async function(e){return o("plugin:path|resolve_directory",{directory:F.Resource,path:e})},resourceDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Resource})},runtimeDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Runtime})},sep:function(){return window.__TAURI_INTERNALS__.plugins.path.sep},tempDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Temp})},templateDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Template})},videoDir:async function(){return o("plugin:path|resolve_directory",{directory:F.Video})}});class O extends u{constructor(e,n){super(e),this.id=n}static async new(e){e?.menu&&(e.menu=[e.menu.rid,e.menu.kind]),e?.icon&&(e.icon="string"==typeof e.icon?e.icon:Array.from(e.icon));const n=new s;return e?.action&&(n.onmessage=e.action,delete e.action),o("plugin:tray|new",{options:e??{},handler:n}).then((([e,n])=>new O(e,n)))}async setIcon(e){let n=null;return e&&(n="string"==typeof e?e:Array.from(e)),o("plugin:tray|set_icon",{rid:this.rid,icon:n})}async setMenu(e){return e&&(e=[e.rid,e.kind]),o("plugin:tray|set_menu",{rid:this.rid,menu:e})}async setTooltip(e){return o("plugin:tray|set_tooltip",{rid:this.rid,tooltip:e})}async setTitle(e){return o("plugin:tray|set_title",{rid:this.rid,title:e})}async setVisible(e){return o("plugin:tray|set_visible",{rid:this.rid,visible:e})}async setTempDirPath(e){return o("plugin:tray|set_temp_dir_path",{rid:this.rid,path:e})}async setIconAsTemplate(e){return o("plugin:tray|set_icon_as_template",{rid:this.rid,asTemplate:e})}async setMenuOnLeftClick(e){return o("plugin:tray|set_show_menu_on_left_click",{rid:this.rid,onLeft:e})}}var M,U,B,V=Object.freeze({__proto__:null,TrayIcon:O});function H(e){if("items"in e)e.items=e.items?.map((e=>"rid"in e?e:H(e)));else if("action"in e&&e.action){const n=new s;return n.onmessage=e.action,delete e.action,{...e,handler:n}}return e}async function G(e,n){const t=new s;let i=null;return n&&"object"==typeof n&&("action"in n&&n.action&&(t.onmessage=n.action,delete n.action),"items"in n&&n.items&&(i=n.items.map((e=>"rid"in e?[e.rid,e.kind]:H(e))))),o("plugin:menu|new",{kind:e,options:n?{...n,items:i}:void 0,handler:t})}class j extends u{get id(){return n(this,M,"f")}get kind(){return n(this,U,"f")}constructor(e,n,i){super(e),M.set(this,void 0),U.set(this,void 0),t(this,M,n,"f"),t(this,U,i,"f")}}M=new WeakMap,U=new WeakMap;class q extends j{constructor(e,n){super(e,n,"MenuItem")}static async new(e){return G("MenuItem",e).then((([e,n])=>new q(e,n)))}async text(){return o("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return o("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return o("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return o("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return o("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}}class Q extends j{constructor(e,n){super(e,n,"Check")}static async new(e){return G("Check",e).then((([e,n])=>new Q(e,n)))}async text(){return o("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return o("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return o("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return o("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return o("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async isChecked(){return o("plugin:menu|is_checked",{rid:this.rid})}async setChecked(e){return o("plugin:menu|set_checked",{rid:this.rid,checked:e})}}!function(e){e.Add="Add",e.Advanced="Advanced",e.Bluetooth="Bluetooth",e.Bookmarks="Bookmarks",e.Caution="Caution",e.ColorPanel="ColorPanel",e.ColumnView="ColumnView",e.Computer="Computer",e.EnterFullScreen="EnterFullScreen",e.Everyone="Everyone",e.ExitFullScreen="ExitFullScreen",e.FlowView="FlowView",e.Folder="Folder",e.FolderBurnable="FolderBurnable",e.FolderSmart="FolderSmart",e.FollowLinkFreestanding="FollowLinkFreestanding",e.FontPanel="FontPanel",e.GoLeft="GoLeft",e.GoRight="GoRight",e.Home="Home",e.IChatTheater="IChatTheater",e.IconView="IconView",e.Info="Info",e.InvalidDataFreestanding="InvalidDataFreestanding",e.LeftFacingTriangle="LeftFacingTriangle",e.ListView="ListView",e.LockLocked="LockLocked",e.LockUnlocked="LockUnlocked",e.MenuMixedState="MenuMixedState",e.MenuOnState="MenuOnState",e.MobileMe="MobileMe",e.MultipleDocuments="MultipleDocuments",e.Network="Network",e.Path="Path",e.PreferencesGeneral="PreferencesGeneral",e.QuickLook="QuickLook",e.RefreshFreestanding="RefreshFreestanding",e.Refresh="Refresh",e.Remove="Remove",e.RevealFreestanding="RevealFreestanding",e.RightFacingTriangle="RightFacingTriangle",e.Share="Share",e.Slideshow="Slideshow",e.SmartBadge="SmartBadge",e.StatusAvailable="StatusAvailable",e.StatusNone="StatusNone",e.StatusPartiallyAvailable="StatusPartiallyAvailable",e.StatusUnavailable="StatusUnavailable",e.StopProgressFreestanding="StopProgressFreestanding",e.StopProgress="StopProgress",e.TrashEmpty="TrashEmpty",e.TrashFull="TrashFull",e.User="User",e.UserAccounts="UserAccounts",e.UserGroup="UserGroup",e.UserGuest="UserGuest"}(B||(B={}));class $ extends j{constructor(e,n){super(e,n,"Icon")}static async new(e){return G("Icon",e).then((([e,n])=>new $(e,n)))}async text(){return o("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return o("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return o("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return o("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return o("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async setIcon(e){return o("plugin:menu|set_icon",{rid:this.rid,icon:e})}}class Z extends j{constructor(e,n){super(e,n,"Predefined")}static async new(e){return G("Predefined",e).then((([e,n])=>new Z(e,n)))}async text(){return o("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return o("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}}function J([e,n,t]){switch(t){case"Submenu":return new K(e,n);case"Predefined":return new Z(e,n);case"Check":return new Q(e,n);case"Icon":return new $(e,n);default:return new q(e,n)}}class K extends j{constructor(e,n){super(e,n,"Submenu")}static async new(e){return G("Submenu",e).then((([e,n])=>new K(e,n)))}async text(){return o("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return o("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return o("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return o("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async append(e){return o("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map((e=>"rid"in e?[e.rid,e.kind]:e))})}async prepend(e){return o("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map((e=>"rid"in e?[e.rid,e.kind]:e))})}async insert(e,n){return o("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map((e=>"rid"in e?[e.rid,e.kind]:e)),position:n})}async remove(e){return o("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return o("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(J)}async items(){return o("plugin:menu|items",{rid:this.rid,kind:this.kind}).then((e=>e.map(J)))}async get(e){return o("plugin:menu|get",{rid:this.rid,kind:this.kind,id:e}).then((e=>e?J(e):null))}async popup(e,n){let t=null;return e&&(t={type:e instanceof v?"Physical":"Logical",data:e}),o("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:n?.label??null,at:t})}async setAsWindowsMenuForNSApp(){return o("plugin:menu|set_as_windows_menu_for_nsapp",{rid:this.rid})}async setAsHelpMenuForNSApp(){return o("plugin:menu|set_as_help_menu_for_nsapp",{rid:this.rid})}}function Y([e,n,t]){switch(t){case"Submenu":return new K(e,n);case"Predefined":return new Z(e,n);case"Check":return new Q(e,n);case"Icon":return new $(e,n);default:return new q(e,n)}}class X extends j{constructor(e,n){super(e,n,"Menu")}static async new(e){return G("Menu",e).then((([e,n])=>new X(e,n)))}static async default(){return o("plugin:menu|create_default").then((([e,n])=>new X(e,n)))}async append(e){return o("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map((e=>"rid"in e?[e.rid,e.kind]:e))})}async prepend(e){return o("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map((e=>"rid"in e?[e.rid,e.kind]:e))})}async insert(e,n){return o("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map((e=>"rid"in e?[e.rid,e.kind]:e)),position:n})}async remove(e){return o("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return o("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(Y)}async items(){return o("plugin:menu|items",{rid:this.rid,kind:this.kind}).then((e=>e.map(Y)))}async get(e){return o("plugin:menu|get",{rid:this.rid,kind:this.kind,id:e}).then((e=>e?Y(e):null))}async popup(e,n){let t=null;return e&&(t={type:e instanceof v?"Physical":"Logical",data:e}),o("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:n?.label??null,at:t})}async setAsAppMenu(){return o("plugin:menu|set_as_app_menu",{rid:this.rid}).then((e=>e?new X(e[0],e[1]):null))}async setAsWindowMenu(e){return o("plugin:menu|set_as_window_menu",{rid:this.rid,window:e?.label??null}).then((e=>e?new X(e[0],e[1]):null))}}var ee=Object.freeze({__proto__:null,CheckMenuItem:Q,IconMenuItem:$,Menu:X,MenuItem:q,get NativeIcon(){return B},PredefinedMenuItem:Z,Submenu:K});return e.app=p,e.core=c,e.dpi=A,e.event=_,e.menu=ee,e.path=N,e.tray=V,e.window=W,e}({});window.__TAURI__=__TAURI_IIFE__; diff --git a/core/tauri/src/app.rs b/core/tauri/src/app.rs index c9de41b64d43..118ed57dadbb 100644 --- a/core/tauri/src/app.rs +++ b/core/tauri/src/app.rs @@ -15,7 +15,6 @@ use crate::{ window::{PendingWindow, WindowEvent as RuntimeWindowEvent}, ExitRequestedEventAction, RunEvent as RuntimeRunEvent, }, - scope, sealed::{ManagerBase, RuntimeOrDispatch}, utils::config::Config, utils::{assets::Assets, Env}, @@ -48,7 +47,7 @@ use std::{ borrow::Cow, collections::HashMap, fmt, - sync::{mpsc::Sender, Arc, Weak}, + sync::{mpsc::Sender, Arc}, }; use crate::runtime::RuntimeHandle; @@ -256,7 +255,7 @@ impl AppHandle { >( &self, f: F, - ) -> crate::Result> { + ) -> crate::Result> { self.runtime_handle.create_tao_window(f).map_err(Into::into) } @@ -988,6 +987,23 @@ struct InvokeInitializationScript<'a> { use_custom_protocol: bool, } +/// Make `Wry` the default `Runtime` for `Builder` +#[cfg(feature = "wry")] +#[cfg_attr(docsrs, doc(cfg(feature = "wry")))] +impl Default for Builder { + fn default() -> Self { + Self::new() + } +} + +#[cfg(not(feature = "wry"))] +#[cfg_attr(docsrs, doc(cfg(not(feature = "wry"))))] +impl Default for Builder { + fn default() -> Self { + Self::new() + } +} + impl Builder { /// Creates a new App builder. pub fn new() -> Self { @@ -1018,7 +1034,9 @@ impl Builder { device_event_filter: Default::default(), } } +} +impl Builder { /// Builds a new Tauri application running on any thread, bypassing the main thread requirement. /// /// ## Platform-specific @@ -1554,9 +1572,8 @@ impl Builder { app.manage(env); app.manage(Scopes { - ipc: scope::ipc::Scope::new(app.config()), #[cfg(feature = "protocol-asset")] - asset_protocol: scope::fs::Scope::new( + asset_protocol: crate::scope::fs::Scope::new( &app, &app.config().tauri.security.asset_protocol.scope, )?, @@ -1833,15 +1850,6 @@ fn on_event_loop_event, RunEvent) + 'static>( } } -/// Make `Wry` the default `Runtime` for `Builder` -#[cfg(feature = "wry")] -#[cfg_attr(docsrs, doc(cfg(feature = "wry")))] -impl Default for Builder { - fn default() -> Self { - Self::new() - } -} - #[cfg(test)] mod tests { #[test] diff --git a/core/tauri/src/command/authority.rs b/core/tauri/src/command/authority.rs new file mode 100644 index 000000000000..b7e28c719342 --- /dev/null +++ b/core/tauri/src/command/authority.rs @@ -0,0 +1,428 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::collections::BTreeMap; +use std::fmt::Debug; + +use serde::de::DeserializeOwned; +use state::TypeMap; + +use tauri_utils::acl::{ + resolved::{CommandKey, Resolved, ResolvedCommand, ResolvedScope, ScopeKey}, + ExecutionContext, +}; + +use crate::{ipc::InvokeError, Runtime}; + +use super::{CommandArg, CommandItem}; + +/// The runtime authority used to authorize IPC execution based on the Access Control List. +pub struct RuntimeAuthority { + allowed_commands: BTreeMap, + denied_commands: BTreeMap, + scope_manager: ScopeManager, +} + +/// The origin trying to access the IPC. +pub enum Origin { + /// Local app origin. + Local, + /// Remote origin. + Remote { + /// Remote origin domain. + domain: String, + }, +} + +impl Origin { + fn matches(&self, context: &ExecutionContext) -> bool { + match (self, context) { + (Self::Local, ExecutionContext::Local) => true, + ( + Self::Remote { domain }, + ExecutionContext::Remote { + domain: domain_pattern, + }, + ) => domain_pattern.matches(domain), + _ => false, + } + } +} + +impl RuntimeAuthority { + pub(crate) fn new(acl: Resolved) -> Self { + let command_cache = acl + .command_scope + .keys() + .map(|key| (*key, ::new())) + .collect(); + Self { + allowed_commands: acl.allowed_commands, + denied_commands: acl.denied_commands, + scope_manager: ScopeManager { + command_scope: acl.command_scope, + global_scope: acl.global_scope, + command_cache, + global_scope_cache: Default::default(), + }, + } + } + + /// Checks if the given IPC execution is allowed and returns the [`ResolvedCommand`] if it is. + pub fn resolve_access( + &self, + command: &str, + window: &str, + origin: Origin, + ) -> Option<&ResolvedCommand> { + if self + .denied_commands + .keys() + .any(|cmd| cmd.name == command && origin.matches(&cmd.context)) + { + None + } else { + self + .allowed_commands + .iter() + .find(|(cmd, _)| cmd.name == command && origin.matches(&cmd.context)) + .map(|(_cmd, allowed)| allowed) + .filter(|allowed| allowed.windows.iter().any(|w| w.matches(window))) + } + } +} + +#[derive(Debug)] +struct ScopeValue { + allow: Vec, + deny: Vec, +} + +/// Access scope for a command that can be retrieved directly in the command function. +#[derive(Debug)] +pub struct CommandScope<'a, T: Debug + DeserializeOwned + Send + Sync + 'static>(&'a ScopeValue); + +impl<'a, T: Debug + DeserializeOwned + Send + Sync + 'static> CommandScope<'a, T> { + /// What this access scope allows. + pub fn allows(&self) -> &Vec { + &self.0.allow + } + + /// What this access scope denies. + pub fn denies(&self) -> &Vec { + &self.0.deny + } +} + +impl<'a, R: Runtime, T: Debug + DeserializeOwned + Send + Sync + 'static> CommandArg<'a, R> + for CommandScope<'a, T> +{ + /// Grabs the [`ResolvedScope`] from the [`CommandItem`] and returns the associated [`CommandScope`]. + fn from_command(command: CommandItem<'a, R>) -> Result { + command + .acl + .as_ref() + .and_then(|resolved| resolved.scope) + .and_then(|scope_id| { + command + .message + .window + .manager + .runtime_authority + .scope_manager + .get_command_scope_typed(&scope_id) + .map(CommandScope) + }) + .ok_or_else(|| InvokeError::from_anyhow(anyhow::anyhow!("scope not found"))) + } +} + +/// Global access scope that can be retrieved directly in the command function. +#[derive(Debug)] +pub struct GlobalScope<'a, T: Debug + DeserializeOwned + Send + Sync + 'static>(&'a ScopeValue); + +impl<'a, T: Debug + DeserializeOwned + Send + Sync + 'static> GlobalScope<'a, T> { + /// What this access scope allows. + pub fn allows(&self) -> &Vec { + &self.0.allow + } + + /// What this access scope denies. + pub fn denies(&self) -> &Vec { + &self.0.deny + } +} + +impl<'a, R: Runtime, T: Debug + DeserializeOwned + Send + Sync + 'static> CommandArg<'a, R> + for GlobalScope<'a, T> +{ + /// Grabs the [`ResolvedScope`] from the [`CommandItem`] and returns the associated [`GlobalScope`]. + fn from_command(command: CommandItem<'a, R>) -> Result { + let scope = command + .message + .window + .manager + .runtime_authority + .scope_manager + .get_global_scope_typed(); + Ok(GlobalScope(scope)) + } +} + +#[derive(Debug)] +pub struct ScopeManager { + command_scope: BTreeMap, + global_scope: ResolvedScope, + command_cache: BTreeMap, + global_scope_cache: TypeMap![Send + Sync], +} + +impl ScopeManager { + fn get_global_scope_typed( + &self, + ) -> &ScopeValue { + match self.global_scope_cache.try_get() { + Some(cached) => cached, + None => { + let mut allow: Vec = Vec::new(); + let mut deny: Vec = Vec::new(); + + for allowed in &self.global_scope.allow { + allow.push(allowed.deserialize().unwrap()); + } + for denied in &self.global_scope.deny { + deny.push(denied.deserialize().unwrap()); + } + + let scope = ScopeValue { allow, deny }; + let _ = self.global_scope_cache.set(scope); + self.global_scope_cache.get() + } + } + } + + fn get_command_scope_typed( + &self, + key: &ScopeKey, + ) -> Option<&ScopeValue> { + let cache = self.command_cache.get(key).unwrap(); + match cache.try_get() { + cached @ Some(_) => cached, + None => match self.command_scope.get(key).map(|r| { + let mut allow: Vec = Vec::new(); + let mut deny: Vec = Vec::new(); + + for allowed in &r.allow { + allow.push(allowed.deserialize().unwrap()); + } + for denied in &r.deny { + deny.push(denied.deserialize().unwrap()); + } + + ScopeValue { allow, deny } + }) { + None => None, + Some(value) => { + let _ = cache.set(value); + cache.try_get() + } + }, + } + } +} + +#[cfg(test)] +mod tests { + use glob::Pattern; + use tauri_utils::acl::{ + resolved::{CommandKey, Resolved, ResolvedCommand}, + ExecutionContext, + }; + + use crate::command::Origin; + + use super::RuntimeAuthority; + + #[test] + fn window_glob_pattern_matches() { + let command = CommandKey { + name: "my-command".into(), + context: ExecutionContext::Local, + }; + let window = "main-*"; + + let resolved_cmd = ResolvedCommand { + windows: vec![Pattern::new(window).unwrap()], + scope: None, + }; + let allowed_commands = [(command.clone(), resolved_cmd.clone())] + .into_iter() + .collect(); + + let authority = RuntimeAuthority::new(Resolved { + allowed_commands, + denied_commands: Default::default(), + command_scope: Default::default(), + global_scope: Default::default(), + }); + + assert_eq!( + authority.resolve_access( + &command.name, + &window.replace('*', "something"), + Origin::Local + ), + Some(&resolved_cmd) + ); + } + + #[test] + fn remote_domain_matches() { + let domain = "tauri.app"; + let command = CommandKey { + name: "my-command".into(), + context: ExecutionContext::Remote { + domain: Pattern::new(domain).unwrap(), + }, + }; + let window = "main"; + + let resolved_cmd = ResolvedCommand { + windows: vec![Pattern::new(window).unwrap()], + scope: None, + }; + let allowed_commands = [(command.clone(), resolved_cmd.clone())] + .into_iter() + .collect(); + + let authority = RuntimeAuthority::new(Resolved { + allowed_commands, + denied_commands: Default::default(), + command_scope: Default::default(), + global_scope: Default::default(), + }); + + assert_eq!( + authority.resolve_access( + &command.name, + window, + Origin::Remote { + domain: domain.into() + } + ), + Some(&resolved_cmd) + ); + } + + #[test] + fn remote_domain_glob_pattern_matches() { + let domain = "tauri.*"; + let command = CommandKey { + name: "my-command".into(), + context: ExecutionContext::Remote { + domain: Pattern::new(domain).unwrap(), + }, + }; + let window = "main"; + + let resolved_cmd = ResolvedCommand { + windows: vec![Pattern::new(window).unwrap()], + scope: None, + }; + let allowed_commands = [(command.clone(), resolved_cmd.clone())] + .into_iter() + .collect(); + + let authority = RuntimeAuthority::new(Resolved { + allowed_commands, + denied_commands: Default::default(), + command_scope: Default::default(), + global_scope: Default::default(), + }); + + assert_eq!( + authority.resolve_access( + &command.name, + window, + Origin::Remote { + domain: domain.replace('*', "studio") + } + ), + Some(&resolved_cmd) + ); + } + + #[test] + fn remote_context_denied() { + let command = CommandKey { + name: "my-command".into(), + context: ExecutionContext::Local, + }; + let window = "main"; + + let resolved_cmd = ResolvedCommand { + windows: vec![Pattern::new(window).unwrap()], + scope: None, + }; + let allowed_commands = [(command.clone(), resolved_cmd.clone())] + .into_iter() + .collect(); + + let authority = RuntimeAuthority::new(Resolved { + allowed_commands, + denied_commands: Default::default(), + command_scope: Default::default(), + global_scope: Default::default(), + }); + + assert!(authority + .resolve_access( + &command.name, + window, + Origin::Remote { + domain: "tauri.app".into() + } + ) + .is_none()); + } + + #[test] + fn denied_command_takes_precendence() { + let command = CommandKey { + name: "my-command".into(), + context: ExecutionContext::Local, + }; + let window = "main"; + let windows = vec![Pattern::new(window).unwrap()]; + let allowed_commands = [( + command.clone(), + ResolvedCommand { + windows: windows.clone(), + scope: None, + }, + )] + .into_iter() + .collect(); + let denied_commands = [( + command.clone(), + ResolvedCommand { + windows: windows.clone(), + scope: None, + }, + )] + .into_iter() + .collect(); + + let authority = RuntimeAuthority::new(Resolved { + allowed_commands, + denied_commands, + command_scope: Default::default(), + global_scope: Default::default(), + }); + + assert!(authority + .resolve_access(&command.name, window, Origin::Local) + .is_none()); + } +} diff --git a/core/tauri/src/command.rs b/core/tauri/src/command/mod.rs similarity index 97% rename from core/tauri/src/command.rs rename to core/tauri/src/command/mod.rs index 766e0186bc7d..7a0296356ecd 100644 --- a/core/tauri/src/command.rs +++ b/core/tauri/src/command/mod.rs @@ -16,6 +16,11 @@ use serde::{ Deserialize, Deserializer, }; +mod authority; + +pub use authority::{CommandScope, GlobalScope, Origin, RuntimeAuthority}; +use tauri_utils::acl::resolved::ResolvedCommand; + /// Represents a custom command. pub struct CommandItem<'a, R: Runtime> { /// The name of the command, e.g. `handler` on `#[command] fn handler(value: u64)` @@ -26,6 +31,9 @@ pub struct CommandItem<'a, R: Runtime> { /// The [`InvokeMessage`] that was passed to this command. pub message: &'a InvokeMessage, + + /// The resolved ACL for this command. + pub acl: &'a Option, } /// Trait implemented by command arguments to derive a value from a [`CommandItem`]. diff --git a/core/tauri/src/ipc/mod.rs b/core/tauri/src/ipc/mod.rs index 9d7412d7460e..4df92ba9afd7 100644 --- a/core/tauri/src/ipc/mod.rs +++ b/core/tauri/src/ipc/mod.rs @@ -14,6 +14,7 @@ use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_json::Value as JsonValue; pub use serialize_to_javascript::Options as SerializeOptions; use tauri_macros::default_runtime; +use tauri_utils::acl::resolved::ResolvedCommand; use crate::{ command::{CommandArg, CommandItem}, @@ -159,6 +160,9 @@ pub struct Invoke { /// The resolver of the message. pub resolver: InvokeResolver, + + /// Resolved ACL for this IPC invoke. + pub acl: Option, } /// Error response from an [`InvokeMessage`]. diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index ffe7a66f46bd..ba92d226db2a 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -110,6 +110,10 @@ pub use http; #[cfg(feature = "wry")] #[cfg_attr(docsrs, doc(cfg(feature = "wry")))] pub type Wry = tauri_runtime_wry::Wry; +/// A Tauri [`RuntimeHandle`] wrapper around wry. +#[cfg(feature = "wry")] +#[cfg_attr(docsrs, doc(cfg(feature = "wry")))] +pub type WryHandle = tauri_runtime_wry::WryHandle; #[cfg(all(feature = "wry", target_os = "android"))] #[cfg_attr(docsrs, doc(cfg(all(feature = "wry", target_os = "android"))))] @@ -184,6 +188,7 @@ use std::{ fmt::{self, Debug}, sync::MutexGuard, }; +use utils::acl::resolved::Resolved; #[cfg(feature = "wry")] #[cfg_attr(docsrs, doc(cfg(feature = "wry")))] @@ -272,8 +277,11 @@ pub enum EventLoopMessage { /// The webview runtime interface. A wrapper around [`runtime::Runtime`] with the proper user event type associated. pub trait Runtime: runtime::Runtime {} +/// The webview runtime handle. A wrapper arond [`runtime::RuntimeHandle`] with the proper user event type associated. +pub trait RuntimeHandle: runtime::RuntimeHandle {} impl> Runtime for W {} +impl> RuntimeHandle for R {} /// Reads the config file at compile time and generates a [`Context`] based on its content. /// @@ -412,6 +420,7 @@ pub struct Context { pub(crate) package_info: PackageInfo, pub(crate) _info_plist: (), pub(crate) pattern: Pattern, + pub(crate) resolved_acl: Resolved, } impl fmt::Debug for Context { @@ -512,6 +521,7 @@ impl Context { package_info: PackageInfo, info_plist: (), pattern: Pattern, + resolved_acl: Resolved, ) -> Self { Self { config, @@ -523,6 +533,7 @@ impl Context { package_info, _info_plist: info_plist, pattern, + resolved_acl, } } @@ -846,11 +857,6 @@ pub trait Manager: sealed::ManagerBase { self.state::().inner().clone() } - /// Gets the scope for the IPC. - fn ipc_scope(&self) -> scope::ipc::Scope { - self.state::().inner().ipc.clone() - } - /// Gets the scope for the asset protocol. #[cfg(feature = "protocol-asset")] fn asset_protocol_scope(&self) -> scope::fs::Scope { diff --git a/core/tauri/src/manager/mod.rs b/core/tauri/src/manager/mod.rs index 980fb07056c3..44908ceec7b2 100644 --- a/core/tauri/src/manager/mod.rs +++ b/core/tauri/src/manager/mod.rs @@ -22,6 +22,7 @@ use tauri_utils::{ use crate::{ app::{AppHandle, GlobalWindowEventListener, OnPageLoad}, + command::RuntimeAuthority, event::{assert_event_name_is_valid, Event, EventId, Listeners}, ipc::{Invoke, InvokeHandler, InvokeResponder}, plugin::PluginStore, @@ -178,6 +179,7 @@ pub struct Asset { #[default_runtime(crate::Wry, wry)] pub struct AppManager { + pub runtime_authority: RuntimeAuthority, pub window: window::WindowManager, #[cfg(all(desktop, feature = "tray-icon"))] pub tray: tray::TrayManager, @@ -245,6 +247,7 @@ impl AppManager { } Self { + runtime_authority: RuntimeAuthority::new(context.resolved_acl), window: window::WindowManager { windows: Mutex::default(), invoke_handler, diff --git a/core/tauri/src/menu/plugin.rs b/core/tauri/src/menu/plugin.rs index ad10c4d9e6e6..10e2976ba150 100644 --- a/core/tauri/src/menu/plugin.rs +++ b/core/tauri/src/menu/plugin.rs @@ -661,7 +661,7 @@ async fn popup( } #[command(root = "crate")] -fn default(app: AppHandle) -> crate::Result<(ResourceId, MenuId)> { +fn create_default(app: AppHandle) -> crate::Result<(ResourceId, MenuId)> { let mut resources_table = app.resources_table(); let menu = Menu::default(&app)?; let id = menu.id().clone(); @@ -858,7 +858,7 @@ pub(crate) fn init() -> TauriPlugin { items, get, popup, - default, + create_default, set_as_app_menu, set_as_window_menu, text, diff --git a/core/tauri/src/scope/ipc.rs b/core/tauri/src/scope/ipc.rs deleted file mode 100644 index 363c257cdb8c..000000000000 --- a/core/tauri/src/scope/ipc.rs +++ /dev/null @@ -1,360 +0,0 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -use std::sync::{Arc, Mutex}; - -use crate::{Config, Runtime, Window}; -use url::Url; - -/// IPC access configuration for a remote domain. -#[derive(Debug, Clone)] -pub struct RemoteDomainAccessScope { - scheme: Option, - domain: String, - windows: Vec, - plugins: Vec, -} - -impl RemoteDomainAccessScope { - /// Creates a new access scope. - pub fn new(domain: impl Into) -> Self { - Self { - scheme: None, - domain: domain.into(), - windows: Vec::new(), - plugins: Vec::new(), - } - } - - /// Sets the scheme of the URL to allow in this scope. By default, all schemes with the given domain are allowed. - pub fn allow_on_scheme(mut self, scheme: impl Into) -> Self { - self.scheme.replace(scheme.into()); - self - } - - /// Adds the given window label to the list of windows that uses this scope. - pub fn add_window(mut self, window: impl Into) -> Self { - self.windows.push(window.into()); - self - } - - /// Adds the given plugin to the allowed plugin list. - pub fn add_plugin(mut self, plugin: impl Into) -> Self { - self.plugins.push(plugin.into()); - self - } - - /// Adds the given list of plugins to the allowed plugin list. - pub fn add_plugins(mut self, plugins: I) -> Self - where - I: IntoIterator, - S: Into, - { - self.plugins.extend(plugins.into_iter().map(Into::into)); - self - } - - /// The domain of the URLs that can access this scope. - pub fn domain(&self) -> &str { - &self.domain - } - - /// The list of window labels that can access this scope. - pub fn windows(&self) -> &Vec { - &self.windows - } - - /// The list of plugins enabled by this scope. - pub fn plugins(&self) -> &Vec { - &self.plugins - } -} - -pub(crate) struct RemoteAccessError { - pub matches_window: bool, - pub matches_domain: bool, -} - -/// IPC scope. -#[derive(Clone)] -pub struct Scope { - remote_access: Arc>>, -} - -impl Scope { - pub(crate) fn new(config: &Config) -> Self { - #[allow(unused_mut)] - let mut remote_access: Vec = config - .tauri - .security - .dangerous_remote_domain_ipc_access - .clone() - .into_iter() - .map(|s| RemoteDomainAccessScope { - scheme: s.scheme, - domain: s.domain, - windows: s.windows, - plugins: s.plugins, - }) - .collect(); - - Self { - remote_access: Arc::new(Mutex::new(remote_access)), - } - } - - /// Adds the given configuration for remote access. - /// - /// # Examples - /// - /// ``` - /// use tauri::{Manager, scope::ipc::RemoteDomainAccessScope}; - /// tauri::Builder::default() - /// .setup(|app| { - /// app.ipc_scope().configure_remote_access( - /// RemoteDomainAccessScope::new("tauri.app") - /// .add_window("main") - /// .add_plugins(["path", "event"]) - /// ); - /// Ok(()) - /// }); - /// ``` - pub fn configure_remote_access(&self, access: RemoteDomainAccessScope) { - self.remote_access.lock().unwrap().push(access); - } - - pub(crate) fn remote_access_for( - &self, - window: &Window, - url: &Url, - ) -> Result { - let mut scope = None; - let mut found_scope_for_window = false; - let mut found_scope_for_domain = false; - let label = window.label().to_string(); - - for s in &*self.remote_access.lock().unwrap() { - #[allow(unused_mut)] - let mut matches_window = s.windows.contains(&label); - - let matches_scheme = s - .scheme - .as_ref() - .map(|scheme| scheme == url.scheme()) - .unwrap_or(true); - - let matches_domain = - matches_scheme && url.domain().map(|d| d == s.domain).unwrap_or_default(); - found_scope_for_window = found_scope_for_window || matches_window; - found_scope_for_domain = found_scope_for_domain || matches_domain; - if matches_window && matches_domain && scope.is_none() { - scope.replace(s.clone()); - } - } - - if let Some(s) = scope { - Ok(s) - } else { - Err(RemoteAccessError { - matches_window: found_scope_for_window, - matches_domain: found_scope_for_domain, - }) - } - } -} - -#[cfg(test)] -mod tests { - use super::RemoteDomainAccessScope; - use crate::{ - ipc::CallbackFn, - test::{assert_ipc_response, mock_app, MockRuntime}, - window::InvokeRequest, - App, Manager, Window, WindowBuilder, - }; - - const PLUGIN_NAME: &str = "test"; - - fn test_context(scopes: Vec) -> (App, Window) { - let app = mock_app(); - let window = WindowBuilder::new(&app, "main", Default::default()) - .build() - .unwrap(); - - for scope in scopes { - app.ipc_scope().configure_remote_access(scope); - } - - (app, window) - } - - fn path_is_absolute_request() -> InvokeRequest { - let callback = CallbackFn(0); - let error = CallbackFn(1); - - let mut payload = serde_json::Map::new(); - payload.insert( - "path".into(), - serde_json::Value::String(std::env::current_dir().unwrap().display().to_string()), - ); - - InvokeRequest { - cmd: "plugin:path|is_absolute".into(), - callback, - error, - body: serde_json::Value::Object(payload).into(), - headers: Default::default(), - } - } - - fn plugin_test_request() -> InvokeRequest { - let callback = CallbackFn(0); - let error = CallbackFn(1); - - InvokeRequest { - cmd: format!("plugin:{PLUGIN_NAME}|doSomething"), - callback, - error, - body: Default::default(), - headers: Default::default(), - } - } - - #[test] - fn scope_not_defined() { - let (_app, mut window) = test_context(vec![RemoteDomainAccessScope::new("app.tauri.app") - .add_window("other") - .add_plugin("path")]); - - window.navigate("https://tauri.app".parse().unwrap()); - assert_ipc_response( - &window, - path_is_absolute_request(), - Err(crate::window::ipc_scope_not_found_error_message( - "main", - "https://tauri.app/", - )), - ); - } - - #[test] - fn scope_not_defined_for_window() { - let (_app, mut window) = test_context(vec![RemoteDomainAccessScope::new("tauri.app") - .add_window("second") - .add_plugin("path")]); - - window.navigate("https://tauri.app".parse().unwrap()); - assert_ipc_response( - &window, - path_is_absolute_request(), - Err(crate::window::ipc_scope_window_error_message("main")), - ); - } - - #[test] - fn scope_not_defined_for_url() { - let (_app, mut window) = test_context(vec![RemoteDomainAccessScope::new("github.com") - .add_window("main") - .add_plugin("path")]); - - window.navigate("https://tauri.app".parse().unwrap()); - assert_ipc_response( - &window, - path_is_absolute_request(), - Err(crate::window::ipc_scope_domain_error_message( - "https://tauri.app/", - )), - ); - } - - #[test] - fn subdomain_is_not_allowed() { - let (_app, mut window) = test_context(vec![ - RemoteDomainAccessScope::new("tauri.app") - .add_window("main") - .add_plugin("path"), - RemoteDomainAccessScope::new("sub.tauri.app") - .add_window("main") - .add_plugin("path"), - ]); - - window.navigate("https://tauri.app".parse().unwrap()); - assert_ipc_response(&window, path_is_absolute_request(), Ok(true)); - - window.navigate("https://blog.tauri.app".parse().unwrap()); - assert_ipc_response( - &window, - path_is_absolute_request(), - Err(crate::window::ipc_scope_domain_error_message( - "https://blog.tauri.app/", - )), - ); - - window.navigate("https://sub.tauri.app".parse().unwrap()); - assert_ipc_response(&window, path_is_absolute_request(), Ok(true)); - - window.window.label = "test".into(); - window.navigate("https://dev.tauri.app".parse().unwrap()); - assert_ipc_response( - &window, - path_is_absolute_request(), - Err(crate::window::ipc_scope_not_found_error_message( - "test", - "https://dev.tauri.app/", - )), - ); - } - - #[test] - fn subpath_is_allowed() { - let (_app, mut window) = test_context(vec![RemoteDomainAccessScope::new("tauri.app") - .add_window("main") - .add_plugin("path")]); - - window.navigate("https://tauri.app/inner/path".parse().unwrap()); - assert_ipc_response(&window, path_is_absolute_request(), Ok(true)); - } - - #[test] - fn tauri_api_not_allowed() { - let (_app, mut window) = test_context(vec![ - RemoteDomainAccessScope::new("tauri.app").add_window("main") - ]); - - window.navigate("https://tauri.app".parse().unwrap()); - assert_ipc_response( - &window, - path_is_absolute_request(), - Err(crate::window::IPC_SCOPE_DOES_NOT_ALLOW), - ); - } - - #[test] - fn plugin_allowed() { - let (_app, mut window) = test_context(vec![RemoteDomainAccessScope::new("tauri.app") - .add_window("main") - .add_plugin(PLUGIN_NAME)]); - - window.navigate("https://tauri.app".parse().unwrap()); - assert_ipc_response( - &window, - plugin_test_request(), - Err(format!("plugin {PLUGIN_NAME} not found")), - ); - } - - #[test] - fn plugin_not_allowed() { - let (_app, mut window) = test_context(vec![ - RemoteDomainAccessScope::new("tauri.app").add_window("main") - ]); - - window.navigate("https://tauri.app".parse().unwrap()); - assert_ipc_response( - &window, - plugin_test_request(), - Err(crate::window::IPC_SCOPE_DOES_NOT_ALLOW), - ); - } -} diff --git a/core/tauri/src/scope/mod.rs b/core/tauri/src/scope/mod.rs index fbb886fb4b5e..d2c7b7c8e5cf 100644 --- a/core/tauri/src/scope/mod.rs +++ b/core/tauri/src/scope/mod.rs @@ -4,8 +4,6 @@ /// FS scope. pub mod fs; -/// IPC scope. -pub mod ipc; use std::path::Path; @@ -14,7 +12,6 @@ pub type ScopeEventId = u32; /// Managed state for all the core scopes in a tauri application. pub struct Scopes { - pub(crate) ipc: ipc::Scope, #[cfg(feature = "protocol-asset")] pub(crate) asset_protocol: fs::Scope, } diff --git a/core/tauri/src/test/mod.rs b/core/tauri/src/test/mod.rs index 933b53c37849..9ed6b3466d8e 100644 --- a/core/tauri/src/test/mod.rs +++ b/core/tauri/src/test/mod.rs @@ -62,6 +62,7 @@ use crate::{ App, Builder, Context, Pattern, Window, }; use tauri_utils::{ + acl::resolved::Resolved, assets::{AssetKey, Assets, CspHash}, config::{Config, PatternKind, TauriConfig}, }; @@ -125,6 +126,12 @@ pub fn mock_context(assets: A) -> crate::Context { }, _info_plist: (), pattern: Pattern::Brownfield(std::marker::PhantomData), + resolved_acl: Resolved { + allowed_commands: Default::default(), + denied_commands: Default::default(), + command_scope: Default::default(), + global_scope: Default::default(), + }, } } diff --git a/core/tauri/src/window/mod.rs b/core/tauri/src/window/mod.rs index b7615c9f65e9..d566e0e3fcce 100644 --- a/core/tauri/src/window/mod.rs +++ b/core/tauri/src/window/mod.rs @@ -16,7 +16,7 @@ use url::Url; use crate::TitleBarStyle; use crate::{ app::{AppHandle, UriSchemeResponder}, - command::{CommandArg, CommandItem}, + command::{CommandArg, CommandItem, Origin}, event::{EmitArgs, Event, EventId}, ipc::{ CallbackFn, Invoke, InvokeBody, InvokeError, InvokeMessage, InvokeResolver, @@ -2314,24 +2314,6 @@ impl Window { let current_url = self.url(); let is_local = self.is_local_url(¤t_url); - let mut scope_not_found_error_message = - ipc_scope_not_found_error_message(&self.window.label, current_url.as_str()); - let scope = if is_local { - None - } else { - match self.ipc_scope().remote_access_for(&self, ¤t_url) { - Ok(scope) => Some(scope), - Err(e) => { - if e.matches_window { - scope_not_found_error_message = ipc_scope_domain_error_message(current_url.as_str()); - } else if e.matches_domain { - scope_not_found_error_message = ipc_scope_window_error_message(&self.window.label); - } - None - } - } - }; - let custom_responder = self.manager.window.invoke_responder.clone(); let resolver = InvokeResolver::new( @@ -2362,14 +2344,36 @@ impl Window { request.headers, ); + let resolved_acl = manager + .runtime_authority + .resolve_access( + &request.cmd, + &message.window.window.label, + if is_local { + Origin::Local + } else { + Origin::Remote { + domain: current_url + .domain() + .map(|d| d.to_string()) + .unwrap_or_default(), + } + }, + ) + .cloned(); + let mut invoke = Invoke { message, resolver: resolver.clone(), + acl: resolved_acl, }; - if !is_local && scope.is_none() { - invoke.resolver.reject(scope_not_found_error_message); - } else if request.cmd.starts_with("plugin:") { + if request.cmd.starts_with("plugin:") { + if request.cmd != crate::ipc::channel::FETCH_CHANNEL_DATA_COMMAND && invoke.acl.is_none() { + invoke.resolver.reject("NOT ALLOWED"); + return; + } + let command = invoke.message.command.replace("plugin:", ""); let mut tokens = command.split('|'); // safe to unwrap: split always has a least one item @@ -2379,16 +2383,6 @@ impl Window { .map(|c| c.to_string()) .unwrap_or_else(String::new); - if !(is_local - || plugin == crate::ipc::channel::CHANNEL_PLUGIN_NAME - || scope - .map(|s| s.plugins().contains(&plugin.into())) - .unwrap_or(true)) - { - invoke.resolver.reject(IPC_SCOPE_DOES_NOT_ALLOW); - return; - } - let command = invoke.message.command.clone(); #[cfg(mobile)] @@ -2759,20 +2753,6 @@ impl From for EffectsBuilder { } } -pub(crate) const IPC_SCOPE_DOES_NOT_ALLOW: &str = "Not allowed by the scope"; - -pub(crate) fn ipc_scope_not_found_error_message(label: &str, url: &str) -> String { - format!("Scope not defined for window `{label}` and URL `{url}`. See https://tauri.app/v1/api/config/#securityconfig.dangerousremotedomainipcaccess and https://docs.rs/tauri/1/tauri/scope/struct.IpcScope.html#method.configure_remote_access") -} - -pub(crate) fn ipc_scope_window_error_message(label: &str) -> String { - format!("Scope not defined for window `{}`. See https://tauri.app/v1/api/config/#securityconfig.dangerousremotedomainipcaccess and https://docs.rs/tauri/1/tauri/scope/struct.IpcScope.html#method.configure_remote_access", label) -} - -pub(crate) fn ipc_scope_domain_error_message(url: &str) -> String { - format!("Scope not defined for URL `{url}`. See https://tauri.app/v1/api/config/#securityconfig.dangerousremotedomainipcaccess and https://docs.rs/tauri/1/tauri/scope/struct.IpcScope.html#method.configure_remote_access") -} - #[cfg(test)] mod tests { #[test] diff --git a/core/tests/acl/Cargo.toml b/core/tests/acl/Cargo.toml new file mode 100644 index 000000000000..0fe970b9990d --- /dev/null +++ b/core/tests/acl/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "acl-tests" +version = "0.1.0" +authors.workspace = true +homepage.workspace = true +repository.workspace = true +categories.workspace = true +license.workspace = true +edition.workspace = true +rust-version.workspace = true +publish = false + +[dev-dependencies] +tauri-utils = { path = "../../tauri-utils/", features = ["build"] } +serde_json = "1" +insta = "1" diff --git a/core/tests/acl/fixtures/capabilities/basic-ping/cap.toml b/core/tests/acl/fixtures/capabilities/basic-ping/cap.toml new file mode 100644 index 000000000000..95755ed0f73d --- /dev/null +++ b/core/tests/acl/fixtures/capabilities/basic-ping/cap.toml @@ -0,0 +1,4 @@ +identifier = "run-app" +description = "app capability" +windows = ["main"] +permissions = ["ping:allow-ping"] diff --git a/core/tests/acl/fixtures/capabilities/basic-ping/required-plugins.json b/core/tests/acl/fixtures/capabilities/basic-ping/required-plugins.json new file mode 100644 index 000000000000..4239d5ee3abd --- /dev/null +++ b/core/tests/acl/fixtures/capabilities/basic-ping/required-plugins.json @@ -0,0 +1 @@ +["ping"] diff --git a/core/tests/acl/fixtures/capabilities/file-explorer-remote/cap.toml b/core/tests/acl/fixtures/capabilities/file-explorer-remote/cap.toml new file mode 100644 index 000000000000..ebc8353d3d1f --- /dev/null +++ b/core/tests/acl/fixtures/capabilities/file-explorer-remote/cap.toml @@ -0,0 +1,6 @@ +identifier = "run-app" +description = "app capability" +windows = ["main"] +permissions = ["fs:read", "fs:allow-app"] +[context.remote] +domains = ["tauri.app"] diff --git a/core/tests/acl/fixtures/capabilities/file-explorer-remote/required-plugins.json b/core/tests/acl/fixtures/capabilities/file-explorer-remote/required-plugins.json new file mode 100644 index 000000000000..9ab323181acf --- /dev/null +++ b/core/tests/acl/fixtures/capabilities/file-explorer-remote/required-plugins.json @@ -0,0 +1 @@ +["fs"] diff --git a/core/tests/acl/fixtures/capabilities/file-explorer/cap.toml b/core/tests/acl/fixtures/capabilities/file-explorer/cap.toml new file mode 100644 index 000000000000..e76764f72706 --- /dev/null +++ b/core/tests/acl/fixtures/capabilities/file-explorer/cap.toml @@ -0,0 +1,4 @@ +identifier = "run-app" +description = "app capability" +windows = ["main"] +permissions = ["fs:read", "fs:allow-app"] diff --git a/core/tests/acl/fixtures/capabilities/file-explorer/required-plugins.json b/core/tests/acl/fixtures/capabilities/file-explorer/required-plugins.json new file mode 100644 index 000000000000..9ab323181acf --- /dev/null +++ b/core/tests/acl/fixtures/capabilities/file-explorer/required-plugins.json @@ -0,0 +1 @@ +["fs"] diff --git a/core/tests/acl/fixtures/capabilities/scope/cap.toml b/core/tests/acl/fixtures/capabilities/scope/cap.toml new file mode 100644 index 000000000000..934483076eb2 --- /dev/null +++ b/core/tests/acl/fixtures/capabilities/scope/cap.toml @@ -0,0 +1,10 @@ +identifier = "run-app" +description = "app capability" +windows = ["main"] +permissions = [ + "fs:read", + "fs:allow-app", + "fs:deny-home", + "fs:allow-read-resources", + "fs:allow-move-temp", +] diff --git a/core/tests/acl/fixtures/capabilities/scope/required-plugins.json b/core/tests/acl/fixtures/capabilities/scope/required-plugins.json new file mode 100644 index 000000000000..9ab323181acf --- /dev/null +++ b/core/tests/acl/fixtures/capabilities/scope/required-plugins.json @@ -0,0 +1 @@ +["fs"] diff --git a/core/tests/acl/fixtures/plugins/fs/deny-home.toml b/core/tests/acl/fixtures/plugins/fs/deny-home.toml new file mode 100644 index 000000000000..34b0c9563676 --- /dev/null +++ b/core/tests/acl/fixtures/plugins/fs/deny-home.toml @@ -0,0 +1,6 @@ + +[[permission]] +identifier = "deny-home" +description = "Denies accessing the $HOME path." +[[permission.scope.deny]] +path = "$HOME" diff --git a/core/tests/acl/fixtures/plugins/fs/move-tmp.toml b/core/tests/acl/fixtures/plugins/fs/move-tmp.toml new file mode 100644 index 000000000000..db5854c3a0a6 --- /dev/null +++ b/core/tests/acl/fixtures/plugins/fs/move-tmp.toml @@ -0,0 +1,6 @@ +[[permission]] +identifier = "allow-move-temp" +description = "Enables the move command with the $TEMP base directory." +commands.allow = ["move"] +[[permission.scope.allow]] +path = "$TEMP/*" diff --git a/core/tests/acl/fixtures/plugins/fs/read-dir.toml b/core/tests/acl/fixtures/plugins/fs/read-dir.toml new file mode 100644 index 000000000000..05c3452b2368 --- /dev/null +++ b/core/tests/acl/fixtures/plugins/fs/read-dir.toml @@ -0,0 +1,4 @@ +[[permission]] +identifier = "allow-read-dir" +description = "Enables the read_dir command without any pre-configured scope." +commands.allow = ["read_dir"] diff --git a/core/tests/acl/fixtures/plugins/fs/read-file.toml b/core/tests/acl/fixtures/plugins/fs/read-file.toml new file mode 100644 index 000000000000..c2b37b40938e --- /dev/null +++ b/core/tests/acl/fixtures/plugins/fs/read-file.toml @@ -0,0 +1,4 @@ +[[permission]] +identifier = "allow-read-file" +description = "Enables the read_file command without any pre-configured scope." +commands.allow = ["read_file"] diff --git a/core/tests/acl/fixtures/plugins/fs/read-resources.toml b/core/tests/acl/fixtures/plugins/fs/read-resources.toml new file mode 100644 index 000000000000..9a8572d7c805 --- /dev/null +++ b/core/tests/acl/fixtures/plugins/fs/read-resources.toml @@ -0,0 +1,8 @@ +[[permission]] +identifier = "allow-read-resources" +description = "Enables the read_file and read_dir command using the $RESOURCE base directory." +commands.allow = ["read_file", "read_dir"] +[[permission.scope.allow]] +path = "$RESOURCE/**" +[[permission.scope.allow]] +path = "$RESOURCE" diff --git a/core/tests/acl/fixtures/plugins/fs/read.toml b/core/tests/acl/fixtures/plugins/fs/read.toml new file mode 100644 index 000000000000..ab9c72c61c45 --- /dev/null +++ b/core/tests/acl/fixtures/plugins/fs/read.toml @@ -0,0 +1,4 @@ +[[set]] +identifier = "read" +description = "allows all read APIs" +permissions = ["allow-read-dir", "allow-read-file"] diff --git a/core/tests/acl/fixtures/plugins/fs/scope.toml b/core/tests/acl/fixtures/plugins/fs/scope.toml new file mode 100644 index 000000000000..9c00d0e6cc68 --- /dev/null +++ b/core/tests/acl/fixtures/plugins/fs/scope.toml @@ -0,0 +1,6 @@ + +[[permission]] +identifier = "allow-app" +description = "Allows accessing the $APP path." +[[permission.scope.allow]] +path = "$APP" diff --git a/core/tests/acl/fixtures/plugins/ping/ping.toml b/core/tests/acl/fixtures/plugins/ping/ping.toml new file mode 100644 index 000000000000..dfd151dddf11 --- /dev/null +++ b/core/tests/acl/fixtures/plugins/ping/ping.toml @@ -0,0 +1,4 @@ +[[permission]] +identifier = "allow-ping" +description = "Enables the ping command without any pre-configured scope." +commands.allow = ["ping"] diff --git a/core/tests/acl/fixtures/snapshots/acl_tests__tests__basic-ping.snap b/core/tests/acl/fixtures/snapshots/acl_tests__tests__basic-ping.snap new file mode 100644 index 000000000000..68967415e8f7 --- /dev/null +++ b/core/tests/acl/fixtures/snapshots/acl_tests__tests__basic-ping.snap @@ -0,0 +1,41 @@ +--- +source: core/tests/acl/src/lib.rs +assertion_line: 59 +expression: resolved +--- +Resolved { + allowed_commands: { + CommandKey { + name: "plugin:ping|ping", + context: Local, + }: ResolvedCommand { + windows: [ + Pattern { + original: "main", + tokens: [ + Char( + 'm', + ), + Char( + 'a', + ), + Char( + 'i', + ), + Char( + 'n', + ), + ], + is_recursive: false, + }, + ], + scope: None, + }, + }, + denied_commands: {}, + command_scope: {}, + global_scope: ResolvedScope { + allow: [], + deny: [], + }, +} diff --git a/core/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer-remote.snap b/core/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer-remote.snap new file mode 100644 index 000000000000..d3a474292c89 --- /dev/null +++ b/core/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer-remote.snap @@ -0,0 +1,143 @@ +--- +source: core/tests/acl/src/lib.rs +assertion_line: 59 +expression: resolved +--- +Resolved { + allowed_commands: { + CommandKey { + name: "plugin:fs|read_dir", + context: Remote { + domain: Pattern { + original: "tauri.app", + tokens: [ + Char( + 't', + ), + Char( + 'a', + ), + Char( + 'u', + ), + Char( + 'r', + ), + Char( + 'i', + ), + Char( + '.', + ), + Char( + 'a', + ), + Char( + 'p', + ), + Char( + 'p', + ), + ], + is_recursive: false, + }, + }, + }: ResolvedCommand { + windows: [ + Pattern { + original: "main", + tokens: [ + Char( + 'm', + ), + Char( + 'a', + ), + Char( + 'i', + ), + Char( + 'n', + ), + ], + is_recursive: false, + }, + ], + scope: None, + }, + CommandKey { + name: "plugin:fs|read_file", + context: Remote { + domain: Pattern { + original: "tauri.app", + tokens: [ + Char( + 't', + ), + Char( + 'a', + ), + Char( + 'u', + ), + Char( + 'r', + ), + Char( + 'i', + ), + Char( + '.', + ), + Char( + 'a', + ), + Char( + 'p', + ), + Char( + 'p', + ), + ], + is_recursive: false, + }, + }, + }: ResolvedCommand { + windows: [ + Pattern { + original: "main", + tokens: [ + Char( + 'm', + ), + Char( + 'a', + ), + Char( + 'i', + ), + Char( + 'n', + ), + ], + is_recursive: false, + }, + ], + scope: None, + }, + }, + denied_commands: {}, + command_scope: {}, + global_scope: ResolvedScope { + allow: [ + Map( + { + "path": String( + "$APP", + ), + }, + ), + ], + deny: [], + }, +} diff --git a/core/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer.snap b/core/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer.snap new file mode 100644 index 000000000000..4fe88d56ac7f --- /dev/null +++ b/core/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer.snap @@ -0,0 +1,75 @@ +--- +source: core/tests/acl/src/lib.rs +assertion_line: 59 +expression: resolved +--- +Resolved { + allowed_commands: { + CommandKey { + name: "plugin:fs|read_dir", + context: Local, + }: ResolvedCommand { + windows: [ + Pattern { + original: "main", + tokens: [ + Char( + 'm', + ), + Char( + 'a', + ), + Char( + 'i', + ), + Char( + 'n', + ), + ], + is_recursive: false, + }, + ], + scope: None, + }, + CommandKey { + name: "plugin:fs|read_file", + context: Local, + }: ResolvedCommand { + windows: [ + Pattern { + original: "main", + tokens: [ + Char( + 'm', + ), + Char( + 'a', + ), + Char( + 'i', + ), + Char( + 'n', + ), + ], + is_recursive: false, + }, + ], + scope: None, + }, + }, + denied_commands: {}, + command_scope: {}, + global_scope: ResolvedScope { + allow: [ + Map( + { + "path": String( + "$APP", + ), + }, + ), + ], + deny: [], + }, +} diff --git a/core/tests/acl/fixtures/snapshots/acl_tests__tests__scope.snap b/core/tests/acl/fixtures/snapshots/acl_tests__tests__scope.snap new file mode 100644 index 000000000000..65ddec90897e --- /dev/null +++ b/core/tests/acl/fixtures/snapshots/acl_tests__tests__scope.snap @@ -0,0 +1,147 @@ +--- +source: core/tests/acl/src/lib.rs +assertion_line: 59 +expression: resolved +--- +Resolved { + allowed_commands: { + CommandKey { + name: "plugin:fs|move", + context: Local, + }: ResolvedCommand { + windows: [ + Pattern { + original: "main", + tokens: [ + Char( + 'm', + ), + Char( + 'a', + ), + Char( + 'i', + ), + Char( + 'n', + ), + ], + is_recursive: false, + }, + ], + scope: Some( + 18088007599891946824, + ), + }, + CommandKey { + name: "plugin:fs|read_dir", + context: Local, + }: ResolvedCommand { + windows: [ + Pattern { + original: "main", + tokens: [ + Char( + 'm', + ), + Char( + 'a', + ), + Char( + 'i', + ), + Char( + 'n', + ), + ], + is_recursive: false, + }, + ], + scope: Some( + 7912899488978770657, + ), + }, + CommandKey { + name: "plugin:fs|read_file", + context: Local, + }: ResolvedCommand { + windows: [ + Pattern { + original: "main", + tokens: [ + Char( + 'm', + ), + Char( + 'a', + ), + Char( + 'i', + ), + Char( + 'n', + ), + ], + is_recursive: false, + }, + ], + scope: Some( + 7912899488978770657, + ), + }, + }, + denied_commands: {}, + command_scope: { + 7912899488978770657: ResolvedScope { + allow: [ + Map( + { + "path": String( + "$RESOURCE/**", + ), + }, + ), + Map( + { + "path": String( + "$RESOURCE", + ), + }, + ), + ], + deny: [], + }, + 18088007599891946824: ResolvedScope { + allow: [ + Map( + { + "path": String( + "$TEMP/*", + ), + }, + ), + ], + deny: [], + }, + }, + global_scope: ResolvedScope { + allow: [ + Map( + { + "path": String( + "$APP", + ), + }, + ), + ], + deny: [ + Map( + { + "path": String( + "$HOME", + ), + }, + ), + ], + }, +} diff --git a/core/tests/acl/src/lib.rs b/core/tests/acl/src/lib.rs new file mode 100644 index 000000000000..25d899b4a33a --- /dev/null +++ b/core/tests/acl/src/lib.rs @@ -0,0 +1,70 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +#[cfg(test)] +mod tests { + use std::{ + collections::BTreeMap, + fs::{read_dir, read_to_string}, + path::Path, + }; + + use tauri_utils::{ + acl::{build::parse_capabilities, plugin::Manifest, resolved::Resolved}, + platform::Target, + }; + + fn load_plugins(plugins: &[String]) -> BTreeMap { + let mut manifests = BTreeMap::new(); + + let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR")); + for plugin in plugins { + let plugin_path = manifest_dir.join("fixtures").join("plugins").join(plugin); + + let permission_files = tauri_utils::acl::build::define_permissions( + &format!("{}/*.toml", plugin_path.display()), + plugin, + ) + .expect("failed to define permissions"); + let manifest = Manifest::from_files(permission_files); + manifests.insert(plugin.to_string(), manifest); + } + + manifests + } + + #[test] + fn resolve_acl() { + let mut settings = insta::Settings::clone_current(); + settings.set_snapshot_path("../fixtures/snapshots"); + let _guard = settings.bind_to_scope(); + + let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR")); + let fixtures_path = manifest_dir.join("fixtures").join("capabilities"); + for fixture_path in read_dir(&fixtures_path).expect("failed to read fixtures") { + let fixture_entry = fixture_path.expect("failed to read fixture entry"); + let fixture_plugins_str = read_to_string(fixture_entry.path().join("required-plugins.json")) + .expect("failed to read fixture required-plugins.json file"); + let fixture_plugins: Vec = serde_json::from_str(&fixture_plugins_str) + .expect("required-plugins.json is not a valid JSON"); + + let manifests = load_plugins(&fixture_plugins); + let capabilities = parse_capabilities(&format!("{}/*.toml", fixture_entry.path().display())) + .expect("failed to parse capabilities"); + + let resolved = Resolved::resolve(manifests, capabilities, Target::current()) + .expect("failed to resolve ACL"); + + insta::assert_debug_snapshot!( + fixture_entry + .path() + .file_name() + .unwrap() + .to_string_lossy() + .to_string(), + resolved + ); + } + } +} diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index 28b029f56903..591cd0f613e6 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,9 +1,9 @@ -var yr=Object.defineProperty;var vr=(t,e,n)=>e in t?yr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var _t=(t,e,n)=>(vr(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function n(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=n(s);fetch(s.href,u)}})();function ie(){}function sr(t){return t()}function Ms(){return Object.create(null)}function Ce(t){t.forEach(sr)}function rr(t){return typeof t=="function"}function je(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Vi;function Cr(t,e){return t===e?!0:(Vi||(Vi=document.createElement("a")),Vi.href=e,t===Vi.href)}function Sr(t){return Object.keys(t).length===0}function Lr(t,...e){if(t==null){for(const l of e)l(void 0);return ie}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Ar(t,e,n){t.$$.on_destroy.push(Lr(e,n))}function i(t,e){t.appendChild(e)}function C(t,e,n){t.insertBefore(e,n||null)}function v(t){t.parentNode&&t.parentNode.removeChild(t)}function Je(t,e){for(let n=0;nt.removeEventListener(e,n,l)}function Ps(t){return function(e){return e.preventDefault(),t.call(this,e)}}function a(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Q(t){return t===""?null:+t}function Pr(t){return Array.from(t.childNodes)}function re(t,e){e=""+e,t.data!==e&&(t.data=e)}function I(t,e){t.value=e??""}function xt(t,e,n,l){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,l?"important":"")}function Qe(t,e,n){for(let l=0;l{const s=t.$$.callbacks[e];if(s){const u=Er(e,n,{cancelable:l});return s.slice().forEach(d=>{d.call(t,u)}),!u.defaultPrevented}return!0}}const tn=[],sn=[];let nn=[];const El=[],or=Promise.resolve();let Tl=!1;function cr(){Tl||(Tl=!0,or.then(hr))}function Ts(){return cr(),or}function wt(t){nn.push(t)}function dr(t){El.push(t)}const Sl=new Set;let $t=0;function hr(){if($t!==0)return;const t=On;do{try{for(;$tt.indexOf(l)===-1?e.push(l):n.push(l)),n.forEach(l=>l()),nn=e}const qi=new Set;let zt;function Wr(){zt={r:0,c:[],p:zt}}function Ir(){zt.r||Ce(zt.c),zt=zt.p}function rn(t,e){t&&t.i&&(qi.delete(t),t.i(e))}function Wn(t,e,n,l){if(t&&t.o){if(qi.has(t))return;qi.add(t),zt.c.push(()=>{qi.delete(t),l&&(n&&t.d(1),l())}),t.o(e)}else l&&l()}function fe(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function fr(t,e,n){const l=t.$$.props[e];l!==void 0&&(t.$$.bound[l]=n,n(t.$$.ctx[l]))}function In(t){t&&t.c()}function an(t,e,n){const{fragment:l,after_update:s}=t.$$;l&&l.m(e,n),wt(()=>{const u=t.$$.on_mount.map(sr).filter(rr);t.$$.on_destroy?t.$$.on_destroy.push(...u):Ce(u),t.$$.on_mount=[]}),s.forEach(wt)}function un(t,e){const n=t.$$;n.fragment!==null&&(Or(n.after_update),Ce(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Rr(t,e){t.$$.dirty[0]===-1&&(tn.push(t),cr(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const y=k.length?k[0]:A;return h.ctx&&s(h.ctx[_],h.ctx[_]=y)&&(!h.skip_bound&&h.bound[_]&&h.bound[_](y),w&&Rr(t,_)),A}):[],h.update(),w=!0,Ce(h.before_update),h.fragment=l?l(h.ctx):!1,e.target){if(e.hydrate){const _=Pr(e.target);h.fragment&&h.fragment.l(_),_.forEach(v)}else h.fragment&&h.fragment.c();e.intro&&rn(t.$$.fragment),an(t,e.target,e.anchor),hr()}zn(c)}class xe{constructor(){_t(this,"$$");_t(this,"$$set")}$destroy(){un(this,1),this.$destroy=ie}$on(e,n){if(!rr(n))return ie;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(n),()=>{const s=l.indexOf(n);s!==-1&&l.splice(s,1)}}$set(e){this.$$set&&!Sr(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Dr="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Dr);const en=[];function Fr(t,e=ie){let n;const l=new Set;function s(o){if(je(t,o)&&(t=o,n)){const c=!en.length;for(const h of l)h[1](),en.push(h,t);if(c){for(let h=0;h{l.delete(h),l.size===0&&n&&(n(),n=null)}}return{set:s,update:u,subscribe:d}}function Rn(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)}function Xi(t,e,n,l,s){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?s.call(t,n):s?s.value=n:e.set(t,n),n}var Tn,Ni;function pr(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}class Il{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,Tn.set(this,()=>{}),this.id=pr(e=>{Rn(this,Tn,"f").call(this,e)})}set onmessage(e){Xi(this,Tn,e,"f")}get onmessage(){return Rn(this,Tn,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}Tn=new WeakMap;async function m(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}class mr{get rid(){return Rn(this,Ni,"f")}constructor(e){Ni.set(this,void 0),Xi(this,Ni,e,"f")}async close(){return m("plugin:resources|close",{rid:this.rid})}}Ni=new WeakMap;async function Hr(){return m("plugin:app|version")}async function Ur(){return m("plugin:app|name")}async function Br(){return m("plugin:app|tauri_version")}async function Vr(){return m("plugin:app|app_show")}async function qr(){return m("plugin:app|app_hide")}function Nr(t){let e,n,l,s,u,d,o,c,h,w,_,A,k,y,L,M,B,D,O,P,E,z,R,J;return{c(){e=r("div"),n=r("p"),n.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our +var yr=Object.defineProperty;var vr=(t,e,n)=>e in t?yr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var bt=(t,e,n)=>(vr(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function n(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=n(s);fetch(s.href,u)}})();function ie(){}function sr(t){return t()}function Ms(){return Object.create(null)}function Ce(t){t.forEach(sr)}function rr(t){return typeof t=="function"}function je(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Vi;function Cr(t,e){return t===e?!0:(Vi||(Vi=document.createElement("a")),Vi.href=e,t===Vi.href)}function Sr(t){return Object.keys(t).length===0}function Lr(t,...e){if(t==null){for(const l of e)l(void 0);return ie}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Ar(t,e,n){t.$$.on_destroy.push(Lr(e,n))}function i(t,e){t.appendChild(e)}function C(t,e,n){t.insertBefore(e,n||null)}function v(t){t.parentNode&&t.parentNode.removeChild(t)}function Je(t,e){for(let n=0;nt.removeEventListener(e,n,l)}function Ps(t){return function(e){return e.preventDefault(),t.call(this,e)}}function a(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Q(t){return t===""?null:+t}function Pr(t){return Array.from(t.childNodes)}function re(t,e){e=""+e,t.data!==e&&(t.data=e)}function I(t,e){t.value=e??""}function $t(t,e,n,l){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,l?"important":"")}function Qe(t,e,n){for(let l=0;l{const s=t.$$.callbacks[e];if(s){const u=Er(e,n,{cancelable:l});return s.slice().forEach(d=>{d.call(t,u)}),!u.defaultPrevented}return!0}}const nn=[],rn=[];let ln=[];const El=[],or=Promise.resolve();let Tl=!1;function cr(){Tl||(Tl=!0,or.then(hr))}function Ts(){return cr(),or}function kt(t){ln.push(t)}function dr(t){El.push(t)}const Sl=new Set;let en=0;function hr(){if(en!==0)return;const t=On;do{try{for(;ent.indexOf(l)===-1?e.push(l):n.push(l)),n.forEach(l=>l()),ln=e}const qi=new Set;let Ot;function Wr(){Ot={r:0,c:[],p:Ot}}function Ir(){Ot.r||Ce(Ot.c),Ot=Ot.p}function an(t,e){t&&t.i&&(qi.delete(t),t.i(e))}function Wn(t,e,n,l){if(t&&t.o){if(qi.has(t))return;qi.add(t),Ot.c.push(()=>{qi.delete(t),l&&(n&&t.d(1),l())}),t.o(e)}else l&&l()}function fe(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function fr(t,e,n){const l=t.$$.props[e];l!==void 0&&(t.$$.bound[l]=n,n(t.$$.ctx[l]))}function In(t){t&&t.c()}function un(t,e,n){const{fragment:l,after_update:s}=t.$$;l&&l.m(e,n),kt(()=>{const u=t.$$.on_mount.map(sr).filter(rr);t.$$.on_destroy?t.$$.on_destroy.push(...u):Ce(u),t.$$.on_mount=[]}),s.forEach(kt)}function on(t,e){const n=t.$$;n.fragment!==null&&(Or(n.after_update),Ce(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Rr(t,e){t.$$.dirty[0]===-1&&(nn.push(t),cr(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const y=k.length?k[0]:A;return h.ctx&&s(h.ctx[_],h.ctx[_]=y)&&(!h.skip_bound&&h.bound[_]&&h.bound[_](y),w&&Rr(t,_)),A}):[],h.update(),w=!0,Ce(h.before_update),h.fragment=l?l(h.ctx):!1,e.target){if(e.hydrate){const _=Pr(e.target);h.fragment&&h.fragment.l(_),_.forEach(v)}else h.fragment&&h.fragment.c();e.intro&&an(t.$$.fragment),un(t,e.target,e.anchor),hr()}zn(c)}class xe{constructor(){bt(this,"$$");bt(this,"$$set")}$destroy(){on(this,1),this.$destroy=ie}$on(e,n){if(!rr(n))return ie;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(n),()=>{const s=l.indexOf(n);s!==-1&&l.splice(s,1)}}$set(e){this.$$set&&!Sr(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Dr="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Dr);const tn=[];function Fr(t,e=ie){let n;const l=new Set;function s(o){if(je(t,o)&&(t=o,n)){const c=!tn.length;for(const h of l)h[1](),tn.push(h,t);if(c){for(let h=0;h{l.delete(h),l.size===0&&n&&(n(),n=null)}}return{set:s,update:u,subscribe:d}}function Rn(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)}function Xi(t,e,n,l,s){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?s.call(t,n):s?s.value=n:e.set(t,n),n}var Tn,Ni;function pr(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}class Il{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,Tn.set(this,()=>{}),this.id=pr(e=>{Rn(this,Tn,"f").call(this,e)})}set onmessage(e){Xi(this,Tn,e,"f")}get onmessage(){return Rn(this,Tn,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}Tn=new WeakMap;async function m(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}class mr{get rid(){return Rn(this,Ni,"f")}constructor(e){Ni.set(this,void 0),Xi(this,Ni,e,"f")}async close(){return m("plugin:resources|close",{rid:this.rid})}}Ni=new WeakMap;async function Hr(){return m("plugin:app|version")}async function Ur(){return m("plugin:app|name")}async function Br(){return m("plugin:app|tauri_version")}async function Vr(){return m("plugin:app|app_show")}async function qr(){return m("plugin:app|app_hide")}function Nr(t){let e,n,l,s,u,d,o,c,h,w,_,A,k,y,L,M,B,D,O,P,E,z,R,J;return{c(){e=r("div"),n=r("p"),n.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our development process. In the future, this app will be used on Tauri's integration tests.`,l=p(),s=r("br"),u=p(),d=r("br"),o=p(),c=r("pre"),h=b(" App name: "),w=r("code"),_=b(t[2]),A=b(` App version: `),k=r("code"),y=b(t[0]),L=b(` Tauri version: `),M=r("code"),B=b(t[1]),D=b(` - `),O=p(),P=r("br"),E=p(),z=r("button"),z.textContent="Context menu",a(z,"class","btn")},m(V,Z){C(V,e,Z),i(e,n),i(e,l),i(e,s),i(e,u),i(e,d),i(e,o),i(e,c),i(c,h),i(c,w),i(w,_),i(c,A),i(c,k),i(k,y),i(c,L),i(c,M),i(M,B),i(c,D),i(e,O),i(e,P),i(e,E),i(e,z),R||(J=S(z,"click",t[3]),R=!0)},p(V,[Z]){Z&4&&re(_,V[2]),Z&1&&re(y,V[0]),Z&2&&re(B,V[1])},i:ie,o:ie,d(V){V&&v(e),R=!1,J()}}}function jr(t,e,n){let l="1.0.0",s="1.0.0",u="Unknown";Ur().then(o=>{n(2,u=o)}),Hr().then(o=>{n(0,l=o)}),Br().then(o=>{n(1,s=o)});function d(){m("popup_context_menu")}return[l,s,u,d]}class Gr extends xe{constructor(e){super(),Ze(this,e,jr,Nr,je,{})}}var Oe;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_CREATED="tauri://window-created",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_FILE_DROP="tauri://file-drop",t.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",t.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled"})(Oe||(Oe={}));async function gr(t,e){await m("plugin:event|unlisten",{event:t,eventId:e})}async function Rl(t,e,n){return m("plugin:event|listen",{event:t,windowLabel:n==null?void 0:n.target,handler:pr(e)}).then(l=>async()=>gr(t,l))}async function Kr(t,e,n){return Rl(t,l=>{e(l),gr(t,l.id).catch(()=>{})},n)}async function _r(t,e,n){await m("plugin:event|emit",{event:t,windowLabel:n==null?void 0:n.target,payload:e})}function Xr(t){let e,n,l,s,u,d,o,c;return{c(){e=r("div"),n=r("button"),n.textContent="Call Log API",l=p(),s=r("button"),s.textContent="Call Request (async) API",u=p(),d=r("button"),d.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(s,"class","btn"),a(s,"id","request"),a(d,"class","btn"),a(d,"id","event")},m(h,w){C(h,e,w),i(e,n),i(e,l),i(e,s),i(e,u),i(e,d),o||(c=[S(n,"click",t[0]),S(s,"click",t[1]),S(d,"click",t[2])],o=!0)},p:ie,i:ie,o:ie,d(h){h&&v(e),o=!1,Ce(c)}}}function Yr(t,e,n){let{onMessage:l}=e,s;Ki(async()=>{s=await Rl("rust-event",l)}),ar(()=>{s&&s()});function u(){m("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function d(){m("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(l).catch(l)}function o(){_r("js-event","this is the payload string")}return t.$$set=c=>{"onMessage"in c&&n(3,l=c.onMessage)},[u,d,o,l]}class Qr extends xe{constructor(e){super(),Ze(this,e,Yr,Xr,je,{onMessage:3})}}class zl{constructor(e,n){this.type="Logical",this.width=e,this.height=n}}class ln{constructor(e,n){this.type="Physical",this.width=e,this.height=n}toLogical(e){return new zl(this.width/e,this.height/e)}}class Jr{constructor(e,n){this.type="Logical",this.x=e,this.y=n}}class it{constructor(e,n){this.type="Physical",this.x=e,this.y=n}toLogical(e){return new Jr(this.x/e,this.y/e)}}var Yi;(function(t){t[t.Critical=1]="Critical",t[t.Informational=2]="Informational"})(Yi||(Yi={}));class Zr{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}var Qi;(function(t){t.None="none",t.Normal="normal",t.Indeterminate="indeterminate",t.Paused="paused",t.Error="error"})(Qi||(Qi={}));function br(){return new Dn(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function Ll(){return window.__TAURI_INTERNALS__.metadata.windows.map(t=>new Dn(t.label,{skip:!0}))}const zs=["tauri://created","tauri://error"];class Dn{constructor(e,n={}){this.label=e,this.listeners=Object.create(null),n!=null&&n.skip||m("plugin:window|create",{options:{...n,label:e}}).then(async()=>this.emit("tauri://created")).catch(async l=>this.emit("tauri://error",l))}static getByLabel(e){return Ll().some(n=>n.label===e)?new Dn(e,{skip:!0}):null}static getCurrent(){return br()}static getAll(){return Ll()}static async getFocusedWindow(){for(const e of Ll())if(await e.isFocused())return e;return null}async listen(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{const l=this.listeners[e];l.splice(l.indexOf(n),1)}):Rl(e,n,{target:this.label})}async once(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{const l=this.listeners[e];l.splice(l.indexOf(n),1)}):Kr(e,n,{target:this.label})}async emit(e,n){if(zs.includes(e)){for(const l of this.listeners[e]||[])l({event:e,id:-1,windowLabel:this.label,payload:n});return Promise.resolve()}return _r(e,n,{target:this.label})}_handleTauriEvent(e,n){return zs.includes(e)?(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0):!1}async scaleFactor(){return m("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return m("plugin:window|inner_position",{label:this.label}).then(({x:e,y:n})=>new it(e,n))}async outerPosition(){return m("plugin:window|outer_position",{label:this.label}).then(({x:e,y:n})=>new it(e,n))}async innerSize(){return m("plugin:window|inner_size",{label:this.label}).then(({width:e,height:n})=>new ln(e,n))}async outerSize(){return m("plugin:window|outer_size",{label:this.label}).then(({width:e,height:n})=>new ln(e,n))}async isFullscreen(){return m("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return m("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return m("plugin:window|is_maximized",{label:this.label})}async isFocused(){return m("plugin:window|is_focused",{label:this.label})}async isDecorated(){return m("plugin:window|is_decorated",{label:this.label})}async isResizable(){return m("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return m("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return m("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return m("plugin:window|is_closable",{label:this.label})}async isVisible(){return m("plugin:window|is_visible",{label:this.label})}async title(){return m("plugin:window|title",{label:this.label})}async theme(){return m("plugin:window|theme",{label:this.label})}async center(){return m("plugin:window|center",{label:this.label})}async requestUserAttention(e){let n=null;return e&&(e===Yi.Critical?n={type:"Critical"}:n={type:"Informational"}),m("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(e){return m("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return m("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return m("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return m("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return m("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return m("plugin:window|maximize",{label:this.label})}async unmaximize(){return m("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return m("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return m("plugin:window|minimize",{label:this.label})}async unminimize(){return m("plugin:window|unminimize",{label:this.label})}async show(){return m("plugin:window|show",{label:this.label})}async hide(){return m("plugin:window|hide",{label:this.label})}async close(){return m("plugin:window|close",{label:this.label})}async setDecorations(e){return m("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return m("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return m("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return m("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return m("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return m("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return m("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_size",{label:this.label,value:{type:e.type,data:{width:e.width,height:e.height}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_min_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_max_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return m("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return m("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return m("plugin:window|set_focus",{label:this.label})}async setIcon(e){return m("plugin:window|set_icon",{label:this.label,value:typeof e=="string"?e:Array.from(e)})}async setSkipTaskbar(e){return m("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return m("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return m("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return m("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return m("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return m("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return m("plugin:window|start_dragging",{label:this.label})}async setProgressBar(e){return m("plugin:window|set_progress_bar",{label:this.label,value:e})}async onResized(e){return this.listen(Oe.WINDOW_RESIZED,n=>{n.payload=xr(n.payload),e(n)})}async onMoved(e){return this.listen(Oe.WINDOW_MOVED,n=>{n.payload=Al(n.payload),e(n)})}async onCloseRequested(e){return this.listen(Oe.WINDOW_CLOSE_REQUESTED,n=>{const l=new Zr(n);Promise.resolve(e(l)).then(()=>{if(!l.isPreventDefault())return this.close()})})}async onFocusChanged(e){const n=await this.listen(Oe.WINDOW_FOCUS,s=>{e({...s,payload:!0})}),l=await this.listen(Oe.WINDOW_BLUR,s=>{e({...s,payload:!1})});return()=>{n(),l()}}async onScaleChanged(e){return this.listen(Oe.WINDOW_SCALE_FACTOR_CHANGED,e)}async onFileDropEvent(e){const n=await this.listen(Oe.WINDOW_FILE_DROP,u=>{e({...u,payload:{type:"drop",paths:u.payload.paths,position:Al(u.payload.position)}})}),l=await this.listen(Oe.WINDOW_FILE_DROP_HOVER,u=>{e({...u,payload:{type:"hover",paths:u.payload.paths,position:Al(u.payload.position)}})}),s=await this.listen(Oe.WINDOW_FILE_DROP_CANCELLED,u=>{e({...u,payload:{type:"cancel"}})});return()=>{n(),l(),s()}}async onThemeChanged(e){return this.listen(Oe.WINDOW_THEME_CHANGED,e)}}var Ji;(function(t){t.AppearanceBased="appearanceBased",t.Light="light",t.Dark="dark",t.MediumLight="mediumLight",t.UltraDark="ultraDark",t.Titlebar="titlebar",t.Selection="selection",t.Menu="menu",t.Popover="popover",t.Sidebar="sidebar",t.HeaderView="headerView",t.Sheet="sheet",t.WindowBackground="windowBackground",t.HudWindow="hudWindow",t.FullScreenUI="fullScreenUI",t.Tooltip="tooltip",t.ContentBackground="contentBackground",t.UnderWindowBackground="underWindowBackground",t.UnderPageBackground="underPageBackground",t.Mica="mica",t.Blur="blur",t.Acrylic="acrylic",t.Tabbed="tabbed",t.TabbedDark="tabbedDark",t.TabbedLight="tabbedLight"})(Ji||(Ji={}));var Zi;(function(t){t.FollowsWindowActiveState="followsWindowActiveState",t.Active="active",t.Inactive="inactive"})(Zi||(Zi={}));function Al(t){return new it(t.x,t.y)}function xr(t){return new ln(t.width,t.height)}function Os(t,e,n){const l=t.slice();return l[105]=e[n],l}function Ws(t,e,n){const l=t.slice();return l[108]=e[n],l}function Is(t,e,n){const l=t.slice();return l[111]=e[n],l}function Rs(t,e,n){const l=t.slice();return l[114]=e[n],l}function Ds(t,e,n){const l=t.slice();return l[117]=e[n],l}function Fs(t){let e,n,l,s,u,d,o=fe(Object.keys(t[1])),c=[];for(let h=0;ht[59].call(l))},m(h,w){C(h,e,w),C(h,n,w),C(h,l,w),i(l,s);for(let _=0;_{n(2,u=o)}),Hr().then(o=>{n(0,l=o)}),Br().then(o=>{n(1,s=o)});function d(){m("popup_context_menu")}return[l,s,u,d]}class Gr extends xe{constructor(e){super(),Ze(this,e,jr,Nr,je,{})}}var Oe;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_CREATED="tauri://window-created",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_FILE_DROP="tauri://file-drop",t.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",t.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled"})(Oe||(Oe={}));async function gr(t,e){await m("plugin:event|unlisten",{event:t,eventId:e})}async function Rl(t,e,n){return m("plugin:event|listen",{event:t,windowLabel:n==null?void 0:n.target,handler:pr(e)}).then(l=>async()=>gr(t,l))}async function Kr(t,e,n){return Rl(t,l=>{e(l),gr(t,l.id).catch(()=>{})},n)}async function _r(t,e,n){await m("plugin:event|emit",{event:t,windowLabel:n==null?void 0:n.target,payload:e})}function Xr(t){let e,n,l,s,u,d,o,c;return{c(){e=r("div"),n=r("button"),n.textContent="Call Log API",l=p(),s=r("button"),s.textContent="Call Request (async) API",u=p(),d=r("button"),d.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(s,"class","btn"),a(s,"id","request"),a(d,"class","btn"),a(d,"id","event")},m(h,w){C(h,e,w),i(e,n),i(e,l),i(e,s),i(e,u),i(e,d),o||(c=[S(n,"click",t[0]),S(s,"click",t[1]),S(d,"click",t[2])],o=!0)},p:ie,i:ie,o:ie,d(h){h&&v(e),o=!1,Ce(c)}}}function Yr(t,e,n){let{onMessage:l}=e,s;Ki(async()=>{s=await Rl("rust-event",l)}),ar(()=>{s&&s()});function u(){m("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function d(){m("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(l).catch(l)}function o(){_r("js-event","this is the payload string")}return t.$$set=c=>{"onMessage"in c&&n(3,l=c.onMessage)},[u,d,o,l]}class Qr extends xe{constructor(e){super(),Ze(this,e,Yr,Xr,je,{onMessage:3})}}class zl{constructor(e,n){this.type="Logical",this.width=e,this.height=n}}class sn{constructor(e,n){this.type="Physical",this.width=e,this.height=n}toLogical(e){return new zl(this.width/e,this.height/e)}}class Jr{constructor(e,n){this.type="Logical",this.x=e,this.y=n}}class it{constructor(e,n){this.type="Physical",this.x=e,this.y=n}toLogical(e){return new Jr(this.x/e,this.y/e)}}var Yi;(function(t){t[t.Critical=1]="Critical",t[t.Informational=2]="Informational"})(Yi||(Yi={}));class Zr{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}var Qi;(function(t){t.None="none",t.Normal="normal",t.Indeterminate="indeterminate",t.Paused="paused",t.Error="error"})(Qi||(Qi={}));function br(){return new Dn(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function Ll(){return window.__TAURI_INTERNALS__.metadata.windows.map(t=>new Dn(t.label,{skip:!0}))}const zs=["tauri://created","tauri://error"];class Dn{constructor(e,n={}){this.label=e,this.listeners=Object.create(null),n!=null&&n.skip||m("plugin:window|create",{options:{...n,label:e}}).then(async()=>this.emit("tauri://created")).catch(async l=>this.emit("tauri://error",l))}static getByLabel(e){return Ll().some(n=>n.label===e)?new Dn(e,{skip:!0}):null}static getCurrent(){return br()}static getAll(){return Ll()}static async getFocusedWindow(){for(const e of Ll())if(await e.isFocused())return e;return null}async listen(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{const l=this.listeners[e];l.splice(l.indexOf(n),1)}):Rl(e,n,{target:this.label})}async once(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{const l=this.listeners[e];l.splice(l.indexOf(n),1)}):Kr(e,n,{target:this.label})}async emit(e,n){if(zs.includes(e)){for(const l of this.listeners[e]||[])l({event:e,id:-1,windowLabel:this.label,payload:n});return Promise.resolve()}return _r(e,n,{target:this.label})}_handleTauriEvent(e,n){return zs.includes(e)?(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0):!1}async scaleFactor(){return m("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return m("plugin:window|inner_position",{label:this.label}).then(({x:e,y:n})=>new it(e,n))}async outerPosition(){return m("plugin:window|outer_position",{label:this.label}).then(({x:e,y:n})=>new it(e,n))}async innerSize(){return m("plugin:window|inner_size",{label:this.label}).then(({width:e,height:n})=>new sn(e,n))}async outerSize(){return m("plugin:window|outer_size",{label:this.label}).then(({width:e,height:n})=>new sn(e,n))}async isFullscreen(){return m("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return m("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return m("plugin:window|is_maximized",{label:this.label})}async isFocused(){return m("plugin:window|is_focused",{label:this.label})}async isDecorated(){return m("plugin:window|is_decorated",{label:this.label})}async isResizable(){return m("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return m("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return m("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return m("plugin:window|is_closable",{label:this.label})}async isVisible(){return m("plugin:window|is_visible",{label:this.label})}async title(){return m("plugin:window|title",{label:this.label})}async theme(){return m("plugin:window|theme",{label:this.label})}async center(){return m("plugin:window|center",{label:this.label})}async requestUserAttention(e){let n=null;return e&&(e===Yi.Critical?n={type:"Critical"}:n={type:"Informational"}),m("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(e){return m("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return m("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return m("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return m("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return m("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return m("plugin:window|maximize",{label:this.label})}async unmaximize(){return m("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return m("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return m("plugin:window|minimize",{label:this.label})}async unminimize(){return m("plugin:window|unminimize",{label:this.label})}async show(){return m("plugin:window|show",{label:this.label})}async hide(){return m("plugin:window|hide",{label:this.label})}async close(){return m("plugin:window|close",{label:this.label})}async setDecorations(e){return m("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return m("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return m("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return m("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return m("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return m("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return m("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_size",{label:this.label,value:{type:e.type,data:{width:e.width,height:e.height}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_min_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_max_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return m("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return m("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return m("plugin:window|set_focus",{label:this.label})}async setIcon(e){return m("plugin:window|set_icon",{label:this.label,value:typeof e=="string"?e:Array.from(e)})}async setSkipTaskbar(e){return m("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return m("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return m("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return m("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return m("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return m("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return m("plugin:window|start_dragging",{label:this.label})}async setProgressBar(e){return m("plugin:window|set_progress_bar",{label:this.label,value:e})}async onResized(e){return this.listen(Oe.WINDOW_RESIZED,n=>{n.payload=xr(n.payload),e(n)})}async onMoved(e){return this.listen(Oe.WINDOW_MOVED,n=>{n.payload=Al(n.payload),e(n)})}async onCloseRequested(e){return this.listen(Oe.WINDOW_CLOSE_REQUESTED,n=>{const l=new Zr(n);Promise.resolve(e(l)).then(()=>{if(!l.isPreventDefault())return this.close()})})}async onFocusChanged(e){const n=await this.listen(Oe.WINDOW_FOCUS,s=>{e({...s,payload:!0})}),l=await this.listen(Oe.WINDOW_BLUR,s=>{e({...s,payload:!1})});return()=>{n(),l()}}async onScaleChanged(e){return this.listen(Oe.WINDOW_SCALE_FACTOR_CHANGED,e)}async onFileDropEvent(e){const n=await this.listen(Oe.WINDOW_FILE_DROP,u=>{e({...u,payload:{type:"drop",paths:u.payload.paths,position:Al(u.payload.position)}})}),l=await this.listen(Oe.WINDOW_FILE_DROP_HOVER,u=>{e({...u,payload:{type:"hover",paths:u.payload.paths,position:Al(u.payload.position)}})}),s=await this.listen(Oe.WINDOW_FILE_DROP_CANCELLED,u=>{e({...u,payload:{type:"cancel"}})});return()=>{n(),l(),s()}}async onThemeChanged(e){return this.listen(Oe.WINDOW_THEME_CHANGED,e)}}var Ji;(function(t){t.AppearanceBased="appearanceBased",t.Light="light",t.Dark="dark",t.MediumLight="mediumLight",t.UltraDark="ultraDark",t.Titlebar="titlebar",t.Selection="selection",t.Menu="menu",t.Popover="popover",t.Sidebar="sidebar",t.HeaderView="headerView",t.Sheet="sheet",t.WindowBackground="windowBackground",t.HudWindow="hudWindow",t.FullScreenUI="fullScreenUI",t.Tooltip="tooltip",t.ContentBackground="contentBackground",t.UnderWindowBackground="underWindowBackground",t.UnderPageBackground="underPageBackground",t.Mica="mica",t.Blur="blur",t.Acrylic="acrylic",t.Tabbed="tabbed",t.TabbedDark="tabbedDark",t.TabbedLight="tabbedLight"})(Ji||(Ji={}));var Zi;(function(t){t.FollowsWindowActiveState="followsWindowActiveState",t.Active="active",t.Inactive="inactive"})(Zi||(Zi={}));function Al(t){return new it(t.x,t.y)}function xr(t){return new sn(t.width,t.height)}function Os(t,e,n){const l=t.slice();return l[105]=e[n],l}function Ws(t,e,n){const l=t.slice();return l[108]=e[n],l}function Is(t,e,n){const l=t.slice();return l[111]=e[n],l}function Rs(t,e,n){const l=t.slice();return l[114]=e[n],l}function Ds(t,e,n){const l=t.slice();return l[117]=e[n],l}function Fs(t){let e,n,l,s,u,d,o=fe(Object.keys(t[1])),c=[];for(let h=0;ht[59].call(l))},m(h,w){C(h,e,w),C(h,n,w),C(h,l,w),i(l,s);for(let _=0;_e in t?yr(t,e,{enumerable:!0,config `),ge=r("input"),_e=p(),Se=r("label"),Pe=b(`Content protected `),he=r("input"),Le=p(),oe=r("label"),Re=b(`Fullscreen `),De=r("input"),Ee=p(),ce=r("br"),F=p(),ee=r("div"),U=r("div"),Te=r("div"),Vn=b(`X - `),Fe=r("input"),qn=p(),Ot=r("div"),Nn=b(`Y - `),He=r("input"),jn=p(),lt=r("div"),Wt=r("div"),Gn=b(`Width - `),Ue=r("input"),Kn=p(),It=r("div"),Xn=b(`Height - `),Be=r("input"),Yn=p(),st=r("div"),Rt=r("div"),Qn=b(`Min width - `),Ge=r("input"),Jn=p(),Dt=r("div"),Zn=b(`Min height - `),Ke=r("input"),xn=p(),rt=r("div"),Ft=r("div"),$n=b(`Max width - `),Ve=r("input"),ei=p(),Ht=r("div"),ti=b(`Max height - `),qe=r("input"),hn=p(),fn=r("br"),pn=p(),ze=r("div"),at=r("div"),Xe=r("div"),N=r("div"),N.textContent="Inner Size",mn=p(),kt=r("span"),gn=b("Width: "),Ut=b(yt),_n=p(),vt=r("span"),bn=b("Height: "),Bt=b(Ct),wn=p(),Ne=r("div"),St=r("div"),St.textContent="Outer Size",kn=p(),Lt=r("span"),yn=b("Width: "),Vt=b(At),vn=p(),Mt=r("span"),Cn=b("Height: "),qt=b(Pt),ni=p(),Nt=r("div"),ut=r("div"),ii=r("div"),ii.textContent="Inner Logical Size",Fl=p(),li=r("span"),Hl=b("Width: "),xi=b(si),Ul=p(),ri=r("span"),Bl=b("Height: "),$i=b(ai),Vl=p(),ot=r("div"),ui=r("div"),ui.textContent="Outer Logical Size",ql=p(),oi=r("span"),Nl=b("Width: "),el=b(ci),jl=p(),di=r("span"),Gl=b("Height: "),tl=b(hi),Kl=p(),jt=r("div"),ct=r("div"),fi=r("div"),fi.textContent="Inner Position",Xl=p(),pi=r("span"),Yl=b("x: "),nl=b(mi),Ql=p(),gi=r("span"),Jl=b("y: "),il=b(_i),Zl=p(),dt=r("div"),bi=r("div"),bi.textContent="Outer Position",xl=p(),wi=r("span"),$l=b("x: "),ll=b(ki),es=p(),yi=r("span"),ts=b("y: "),sl=b(vi),ns=p(),Gt=r("div"),ht=r("div"),Ci=r("div"),Ci.textContent="Inner Logical Position",is=p(),Si=r("span"),ls=b("x: "),rl=b(Li),ss=p(),Ai=r("span"),rs=b("y: "),al=b(Mi),as=p(),ft=r("div"),Pi=r("div"),Pi.textContent="Outer Logical Position",us=p(),Ei=r("span"),os=b("x: "),ul=b(Ti),cs=p(),zi=r("span"),ds=b("y: "),ol=b(Oi),cl=p(),dl=r("br"),hl=p(),Sn=r("h4"),Sn.textContent="Cursor",fl=p(),$e=r("div"),Wi=r("label"),Kt=r("input"),hs=b(` - Grab`),fs=p(),Ii=r("label"),Xt=r("input"),ps=b(` - Visible`),ms=p(),Ri=r("label"),Yt=r("input"),gs=b(` + `),Fe=r("input"),qn=p(),Wt=r("div"),Nn=b(`Y + `),He=r("input"),jn=p(),lt=r("div"),It=r("div"),Gn=b(`Width + `),Ue=r("input"),Kn=p(),Rt=r("div"),Xn=b(`Height + `),Be=r("input"),Yn=p(),st=r("div"),Dt=r("div"),Qn=b(`Min width + `),Ge=r("input"),Jn=p(),Ft=r("div"),Zn=b(`Min height + `),Ke=r("input"),xn=p(),rt=r("div"),Ht=r("div"),$n=b(`Max width + `),Ve=r("input"),ei=p(),Ut=r("div"),ti=b(`Max height + `),qe=r("input"),fn=p(),pn=r("br"),mn=p(),ze=r("div"),at=r("div"),Xe=r("div"),N=r("div"),N.textContent="Inner Size",ut=p(),yt=r("span"),gn=b("Width: "),Bt=b(vt),_n=p(),Ct=r("span"),bn=b("Height: "),Vt=b(St),wn=p(),Ne=r("div"),Lt=r("div"),Lt.textContent="Outer Size",kn=p(),At=r("span"),yn=b("Width: "),qt=b(Mt),vn=p(),Pt=r("span"),Cn=b("Height: "),Nt=b(Et),ni=p(),jt=r("div"),ot=r("div"),ii=r("div"),ii.textContent="Inner Logical Size",Fl=p(),li=r("span"),Hl=b("Width: "),xi=b(si),Ul=p(),ri=r("span"),Bl=b("Height: "),$i=b(ai),Vl=p(),ct=r("div"),ui=r("div"),ui.textContent="Outer Logical Size",ql=p(),oi=r("span"),Nl=b("Width: "),el=b(ci),jl=p(),di=r("span"),Gl=b("Height: "),tl=b(hi),Kl=p(),Gt=r("div"),dt=r("div"),fi=r("div"),fi.textContent="Inner Position",Xl=p(),pi=r("span"),Yl=b("x: "),nl=b(mi),Ql=p(),gi=r("span"),Jl=b("y: "),il=b(_i),Zl=p(),ht=r("div"),bi=r("div"),bi.textContent="Outer Position",xl=p(),wi=r("span"),$l=b("x: "),ll=b(ki),es=p(),yi=r("span"),ts=b("y: "),sl=b(vi),ns=p(),Kt=r("div"),ft=r("div"),Ci=r("div"),Ci.textContent="Inner Logical Position",is=p(),Si=r("span"),ls=b("x: "),rl=b(Li),ss=p(),Ai=r("span"),rs=b("y: "),al=b(Mi),as=p(),pt=r("div"),Pi=r("div"),Pi.textContent="Outer Logical Position",us=p(),Ei=r("span"),os=b("x: "),ul=b(Ti),cs=p(),zi=r("span"),ds=b("y: "),ol=b(Oi),cl=p(),dl=r("br"),hl=p(),Sn=r("h4"),Sn.textContent="Cursor",fl=p(),$e=r("div"),Wi=r("label"),Xt=r("input"),hs=b(` + Grab`),fs=p(),Ii=r("label"),Yt=r("input"),ps=b(` + Visible`),ms=p(),Ri=r("label"),Qt=r("input"),gs=b(` Ignore events`),pl=p(),et=r("div"),Di=r("label"),_s=b(`Icon `),tt=r("select");for(let f=0;ft[83].call(tt)),a(pt,"class","input"),a(pt,"type","number"),a(mt,"class","input"),a(mt,"type","number"),a(et,"class","flex gap-2"),a(gt,"class","input grow"),a(gt,"id","title"),a(An,"class","btn"),a(An,"type","submit"),a(Et,"class","flex gap-1"),a(Ln,"class","flex flex-col gap-1"),a(nt,"class","input"),t[26]===void 0&&wt(()=>t[87].call(nt)),a(Ye,"class","input"),a(Ye,"type","number"),a(Ye,"min","0"),a(Ye,"max","100"),a(Qt,"class","flex gap-2"),a(Mn,"class","flex flex-col gap-1")},m(f,g){C(f,e,g),C(f,n,g),C(f,l,g),i(l,s),i(l,u),i(l,d),i(d,o),I(o,t[43]),i(d,c),i(d,h),C(f,w,g),C(f,_,g),C(f,A,g),C(f,k,g),i(k,y),i(k,L),i(k,M),i(k,B),i(k,D),i(k,O),i(k,P),C(f,E,g),C(f,z,g),i(z,R),i(R,J),i(R,V),V.checked=t[6],i(z,Z),i(z,le),i(le,te),i(le,q),q.checked=t[2],i(z,G),i(z,T),i(T,K),i(T,X),X.checked=t[3],i(z,be),i(z,ke),i(ke,de),i(ke,ae),ae.checked=t[4],i(z,$),i(z,pe),i(pe,Y),i(pe,se),se.checked=t[5],i(z,ne),i(z,W),i(W,x),i(W,H),H.checked=t[7],i(z,ue),i(z,Ae),i(Ae,we),i(Ae,me),me.checked=t[8],i(z,We),i(z,Me),i(Me,Ie),i(Me,ge),ge.checked=t[9],i(z,_e),i(z,Se),i(Se,Pe),i(Se,he),he.checked=t[10],i(z,Le),i(z,oe),i(oe,Re),i(oe,De),De.checked=t[11],C(f,Ee,g),C(f,ce,g),C(f,F,g),C(f,ee,g),i(ee,U),i(U,Te),i(Te,Vn),i(Te,Fe),I(Fe,t[18]),i(U,qn),i(U,Ot),i(Ot,Nn),i(Ot,He),I(He,t[19]),i(ee,jn),i(ee,lt),i(lt,Wt),i(Wt,Gn),i(Wt,Ue),I(Ue,t[12]),i(lt,Kn),i(lt,It),i(It,Xn),i(It,Be),I(Be,t[13]),i(ee,Yn),i(ee,st),i(st,Rt),i(Rt,Qn),i(Rt,Ge),I(Ge,t[14]),i(st,Jn),i(st,Dt),i(Dt,Zn),i(Dt,Ke),I(Ke,t[15]),i(ee,xn),i(ee,rt),i(rt,Ft),i(Ft,$n),i(Ft,Ve),I(Ve,t[16]),i(rt,ei),i(rt,Ht),i(Ht,ti),i(Ht,qe),I(qe,t[17]),C(f,hn,g),C(f,fn,g),C(f,pn,g),C(f,ze,g),i(ze,at),i(at,Xe),i(Xe,N),i(Xe,mn),i(Xe,kt),i(kt,gn),i(kt,Ut),i(Xe,_n),i(Xe,vt),i(vt,bn),i(vt,Bt),i(at,wn),i(at,Ne),i(Ne,St),i(Ne,kn),i(Ne,Lt),i(Lt,yn),i(Lt,Vt),i(Ne,vn),i(Ne,Mt),i(Mt,Cn),i(Mt,qt),i(ze,ni),i(ze,Nt),i(Nt,ut),i(ut,ii),i(ut,Fl),i(ut,li),i(li,Hl),i(li,xi),i(ut,Ul),i(ut,ri),i(ri,Bl),i(ri,$i),i(Nt,Vl),i(Nt,ot),i(ot,ui),i(ot,ql),i(ot,oi),i(oi,Nl),i(oi,el),i(ot,jl),i(ot,di),i(di,Gl),i(di,tl),i(ze,Kl),i(ze,jt),i(jt,ct),i(ct,fi),i(ct,Xl),i(ct,pi),i(pi,Yl),i(pi,nl),i(ct,Ql),i(ct,gi),i(gi,Jl),i(gi,il),i(jt,Zl),i(jt,dt),i(dt,bi),i(dt,xl),i(dt,wi),i(wi,$l),i(wi,ll),i(dt,es),i(dt,yi),i(yi,ts),i(yi,sl),i(ze,ns),i(ze,Gt),i(Gt,ht),i(ht,Ci),i(ht,is),i(ht,Si),i(Si,ls),i(Si,rl),i(ht,ss),i(ht,Ai),i(Ai,rs),i(Ai,al),i(Gt,as),i(Gt,ft),i(ft,Pi),i(ft,us),i(ft,Ei),i(Ei,os),i(Ei,ul),i(ft,cs),i(ft,zi),i(zi,ds),i(zi,ol),C(f,cl,g),C(f,dl,g),C(f,hl,g),C(f,Sn,g),C(f,fl,g),C(f,$e,g),i($e,Wi),i(Wi,Kt),Kt.checked=t[20],i(Wi,hs),i($e,fs),i($e,Ii),i(Ii,Xt),Xt.checked=t[21],i(Ii,ps),i($e,ms),i($e,Ri),i(Ri,Yt),Yt.checked=t[25],i(Ri,gs),C(f,pl,g),C(f,et,g),i(et,Di),i(Di,_s),i(Di,tt);for(let j=0;jt[83].call(tt)),a(mt,"class","input"),a(mt,"type","number"),a(gt,"class","input"),a(gt,"type","number"),a(et,"class","flex gap-2"),a(_t,"class","input grow"),a(_t,"id","title"),a(An,"class","btn"),a(An,"type","submit"),a(Tt,"class","flex gap-1"),a(Ln,"class","flex flex-col gap-1"),a(nt,"class","input"),t[26]===void 0&&kt(()=>t[87].call(nt)),a(Ye,"class","input"),a(Ye,"type","number"),a(Ye,"min","0"),a(Ye,"max","100"),a(Jt,"class","flex gap-2"),a(Mn,"class","flex flex-col gap-1")},m(f,g){C(f,e,g),C(f,n,g),C(f,l,g),i(l,s),i(l,u),i(l,d),i(d,o),I(o,t[43]),i(d,c),i(d,h),C(f,w,g),C(f,_,g),C(f,A,g),C(f,k,g),i(k,y),i(k,L),i(k,M),i(k,B),i(k,D),i(k,O),i(k,P),C(f,E,g),C(f,z,g),i(z,R),i(R,J),i(R,V),V.checked=t[6],i(z,Z),i(z,le),i(le,te),i(le,q),q.checked=t[2],i(z,G),i(z,T),i(T,K),i(T,X),X.checked=t[3],i(z,be),i(z,ke),i(ke,de),i(ke,ae),ae.checked=t[4],i(z,$),i(z,pe),i(pe,Y),i(pe,se),se.checked=t[5],i(z,ne),i(z,W),i(W,x),i(W,H),H.checked=t[7],i(z,ue),i(z,Ae),i(Ae,we),i(Ae,me),me.checked=t[8],i(z,We),i(z,Me),i(Me,Ie),i(Me,ge),ge.checked=t[9],i(z,_e),i(z,Se),i(Se,Pe),i(Se,he),he.checked=t[10],i(z,Le),i(z,oe),i(oe,Re),i(oe,De),De.checked=t[11],C(f,Ee,g),C(f,ce,g),C(f,F,g),C(f,ee,g),i(ee,U),i(U,Te),i(Te,Vn),i(Te,Fe),I(Fe,t[18]),i(U,qn),i(U,Wt),i(Wt,Nn),i(Wt,He),I(He,t[19]),i(ee,jn),i(ee,lt),i(lt,It),i(It,Gn),i(It,Ue),I(Ue,t[12]),i(lt,Kn),i(lt,Rt),i(Rt,Xn),i(Rt,Be),I(Be,t[13]),i(ee,Yn),i(ee,st),i(st,Dt),i(Dt,Qn),i(Dt,Ge),I(Ge,t[14]),i(st,Jn),i(st,Ft),i(Ft,Zn),i(Ft,Ke),I(Ke,t[15]),i(ee,xn),i(ee,rt),i(rt,Ht),i(Ht,$n),i(Ht,Ve),I(Ve,t[16]),i(rt,ei),i(rt,Ut),i(Ut,ti),i(Ut,qe),I(qe,t[17]),C(f,fn,g),C(f,pn,g),C(f,mn,g),C(f,ze,g),i(ze,at),i(at,Xe),i(Xe,N),i(Xe,ut),i(Xe,yt),i(yt,gn),i(yt,Bt),i(Xe,_n),i(Xe,Ct),i(Ct,bn),i(Ct,Vt),i(at,wn),i(at,Ne),i(Ne,Lt),i(Ne,kn),i(Ne,At),i(At,yn),i(At,qt),i(Ne,vn),i(Ne,Pt),i(Pt,Cn),i(Pt,Nt),i(ze,ni),i(ze,jt),i(jt,ot),i(ot,ii),i(ot,Fl),i(ot,li),i(li,Hl),i(li,xi),i(ot,Ul),i(ot,ri),i(ri,Bl),i(ri,$i),i(jt,Vl),i(jt,ct),i(ct,ui),i(ct,ql),i(ct,oi),i(oi,Nl),i(oi,el),i(ct,jl),i(ct,di),i(di,Gl),i(di,tl),i(ze,Kl),i(ze,Gt),i(Gt,dt),i(dt,fi),i(dt,Xl),i(dt,pi),i(pi,Yl),i(pi,nl),i(dt,Ql),i(dt,gi),i(gi,Jl),i(gi,il),i(Gt,Zl),i(Gt,ht),i(ht,bi),i(ht,xl),i(ht,wi),i(wi,$l),i(wi,ll),i(ht,es),i(ht,yi),i(yi,ts),i(yi,sl),i(ze,ns),i(ze,Kt),i(Kt,ft),i(ft,Ci),i(ft,is),i(ft,Si),i(Si,ls),i(Si,rl),i(ft,ss),i(ft,Ai),i(Ai,rs),i(Ai,al),i(Kt,as),i(Kt,pt),i(pt,Pi),i(pt,us),i(pt,Ei),i(Ei,os),i(Ei,ul),i(pt,cs),i(pt,zi),i(zi,ds),i(zi,ol),C(f,cl,g),C(f,dl,g),C(f,hl,g),C(f,Sn,g),C(f,fl,g),C(f,$e,g),i($e,Wi),i(Wi,Xt),Xt.checked=t[20],i(Wi,hs),i($e,fs),i($e,Ii),i(Ii,Yt),Yt.checked=t[21],i(Ii,ps),i($e,ms),i($e,Ri),i(Ri,Qt),Qt.checked=t[25],i(Ri,gs),C(f,pl,g),C(f,et,g),i(et,Di),i(Di,_s),i(Di,tt);for(let j=0;jt[89].call(u)),a(h,"class","input"),t[37]===void 0&&wt(()=>t[90].call(h)),a(k,"class","input"),a(k,"type","number"),a(n,"class","flex"),xt(O,"max-width","120px"),a(O,"class","input"),a(O,"type","number"),a(O,"placeholder","R"),xt(E,"max-width","120px"),a(E,"class","input"),a(E,"type","number"),a(E,"placeholder","G"),xt(R,"max-width","120px"),a(R,"class","input"),a(R,"type","number"),a(R,"placeholder","B"),xt(V,"max-width","120px"),a(V,"class","input"),a(V,"type","number"),a(V,"placeholder","A"),a(D,"class","flex"),a(L,"class","flex"),a(te,"class","btn"),xt(te,"width","80px"),a(le,"class","flex"),a(de,"class","btn"),xt(de,"width","80px"),a(G,"class","flex"),a(e,"class","flex flex-col gap-1")},m(W,x){C(W,e,x),i(e,n),i(n,l),i(l,s),i(l,u);for(let H=0;H=1,w,_,A,k=h&&Fs(t),y=t[1][t[0]]&&Us(t);return{c(){e=r("div"),n=r("div"),l=r("input"),s=p(),u=r("button"),u.textContent="New window",d=p(),o=r("br"),c=p(),k&&k.c(),w=p(),y&&y.c(),a(l,"class","input grow"),a(l,"type","text"),a(l,"placeholder","New Window label.."),a(u,"class","btn"),a(n,"class","flex gap-1"),a(e,"class","flex flex-col children:grow gap-2")},m(L,M){C(L,e,M),i(e,n),i(n,l),I(l,t[28]),i(n,s),i(n,u),i(e,d),i(e,o),i(e,c),k&&k.m(e,null),i(e,w),y&&y.m(e,null),_||(A=[S(l,"input",t[58]),S(u,"click",t[53])],_=!0)},p(L,M){M[0]&268435456&&l.value!==L[28]&&I(l,L[28]),M[0]&2&&(h=Object.keys(L[1]).length>=1),h?k?k.p(L,M):(k=Fs(L),k.c(),k.m(e,w)):k&&(k.d(1),k=null),L[1][L[0]]?y?y.p(L,M):(y=Us(L),y.c(),y.m(e,null)):y&&(y.d(1),y=null)},i:ie,o:ie,d(L){L&&v(e),k&&k.d(),y&&y.d(),_=!1,Ce(A)}}}function ta(t,e,n){const l=br();let s=l.label;const u={[l.label]:l},d=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"],o=["mica","blur","acrylic","tabbed","tabbedDark","tabbedLight"],c=navigator.appVersion.includes("Windows"),h=navigator.appVersion.includes("Macintosh");let w=c?o:Object.keys(Ji).map(N=>Ji[N]).filter(N=>!o.includes(N));const _=Object.keys(Zi).map(N=>Zi[N]),A=Object.keys(Qi).map(N=>Qi[N]);let{onMessage:k}=e;const y=document.querySelector("main");let L,M=!0,B=!0,D=!0,O=!0,P=!1,E=!0,z=!1,R=!1,J=!0,V=!1,Z=null,le=null,te=null,q=null,G=null,T=null,K=null,X=null,be=1,ke=new it(K,X),de=new it(K,X),ae=new ln(Z,le),$=new ln(Z,le),pe,Y,se=!1,ne=!0,W=null,x=null,H="default",ue=!1,Ae="Awesome Tauri Example!",we=[],me,We,Me,Ie,ge,_e,Se,Pe="none",he=0,Le;function oe(){u[s].setTitle(Ae)}function Re(){u[s].hide(),setTimeout(u[s].show,2e3)}function De(){u[s].minimize(),setTimeout(u[s].unminimize,2e3)}function Ee(){if(!L)return;const N=new Dn(L);n(1,u[L]=N,u),N.once("tauri://error",function(){k("Error creating new webview")})}function ce(){u[s].innerSize().then(N=>{n(32,ae=N),n(12,Z=ae.width),n(13,le=ae.height)}),u[s].outerSize().then(N=>{n(33,$=N)})}function F(){u[s].innerPosition().then(N=>{n(30,ke=N)}),u[s].outerPosition().then(N=>{n(31,de=N),n(18,K=de.x),n(19,X=de.y)})}async function ee(N){N&&(pe&&pe(),Y&&Y(),Y=await N.listen("tauri://move",F),pe=await N.listen("tauri://resize",ce))}async function U(){await u[s].minimize(),await u[s].requestUserAttention(Yi.Critical),await new Promise(N=>setTimeout(N,3e3)),await u[s].requestUserAttention(null)}async function Te(){we.includes(me)||n(35,we=[...we,me]);const N={effects:we,state:We,radius:Me};Number.isInteger(Ie)&&Number.isInteger(ge)&&Number.isInteger(_e)&&Number.isInteger(Se)&&(N.color=[Ie,ge,_e,Se]),y.classList.remove("bg-primary"),y.classList.remove("dark:bg-darkPrimary"),await u[s].clearEffects(),await u[s].setEffects(N)}async function Vn(){n(35,we=[]),await u[s].clearEffects(),y.classList.add("bg-primary"),y.classList.add("dark:bg-darkPrimary")}function Fe(){L=this.value,n(28,L)}function qn(){s=En(this),n(0,s),n(1,u)}function Ot(){Le=this.value,n(43,Le)}const Nn=()=>u[s].center();function He(){P=this.checked,n(6,P)}function jn(){M=this.checked,n(2,M)}function lt(){B=this.checked,n(3,B)}function Wt(){D=this.checked,n(4,D)}function Gn(){O=this.checked,n(5,O)}function Ue(){E=this.checked,n(7,E)}function Kn(){z=this.checked,n(8,z)}function It(){R=this.checked,n(9,R)}function Xn(){J=this.checked,n(10,J)}function Be(){V=this.checked,n(11,V)}function Yn(){K=Q(this.value),n(18,K)}function st(){X=Q(this.value),n(19,X)}function Rt(){Z=Q(this.value),n(12,Z)}function Qn(){le=Q(this.value),n(13,le)}function Ge(){te=Q(this.value),n(14,te)}function Jn(){q=Q(this.value),n(15,q)}function Dt(){G=Q(this.value),n(16,G)}function Zn(){T=Q(this.value),n(17,T)}function Ke(){se=this.checked,n(20,se)}function xn(){ne=this.checked,n(21,ne)}function rt(){ue=this.checked,n(25,ue)}function Ft(){H=En(this),n(24,H),n(44,d)}function $n(){W=Q(this.value),n(22,W)}function Ve(){x=Q(this.value),n(23,x)}function ei(){Ae=this.value,n(34,Ae)}function Ht(){Pe=En(this),n(26,Pe),n(49,A)}function ti(){he=Q(this.value),n(27,he)}function qe(){me=En(this),n(36,me),n(47,w)}function hn(){We=En(this),n(37,We),n(48,_)}function fn(){Me=Q(this.value),n(38,Me)}function pn(){Ie=Q(this.value),n(39,Ie)}function ze(){ge=Q(this.value),n(40,ge)}function at(){_e=Q(this.value),n(41,_e)}function Xe(){Se=Q(this.value),n(42,Se)}return t.$$set=N=>{"onMessage"in N&&n(57,k=N.onMessage)},t.$$.update=()=>{var N,mn,kt,gn,yt,Ut,_n,vt,bn,Ct,Bt,wn,Ne,St,kn,Lt,yn,At,Vt,vn,Mt,Cn,Pt,qt;t.$$.dirty[0]&3&&(u[s],F(),ce()),t.$$.dirty[0]&7&&((N=u[s])==null||N.setResizable(M)),t.$$.dirty[0]&11&&((mn=u[s])==null||mn.setMaximizable(B)),t.$$.dirty[0]&19&&((kt=u[s])==null||kt.setMinimizable(D)),t.$$.dirty[0]&35&&((gn=u[s])==null||gn.setClosable(O)),t.$$.dirty[0]&67&&(P?(yt=u[s])==null||yt.maximize():(Ut=u[s])==null||Ut.unmaximize()),t.$$.dirty[0]&131&&((_n=u[s])==null||_n.setDecorations(E)),t.$$.dirty[0]&259&&((vt=u[s])==null||vt.setAlwaysOnTop(z)),t.$$.dirty[0]&515&&((bn=u[s])==null||bn.setAlwaysOnBottom(R)),t.$$.dirty[0]&1027&&((Ct=u[s])==null||Ct.setContentProtected(J)),t.$$.dirty[0]&2051&&((Bt=u[s])==null||Bt.setFullscreen(V)),t.$$.dirty[0]&12291&&Z&&le&&((wn=u[s])==null||wn.setSize(new ln(Z,le))),t.$$.dirty[0]&49155&&(te&&q?(Ne=u[s])==null||Ne.setMinSize(new zl(te,q)):(St=u[s])==null||St.setMinSize(null)),t.$$.dirty[0]&196611&&(G>800&&T>400?(kn=u[s])==null||kn.setMaxSize(new zl(G,T)):(Lt=u[s])==null||Lt.setMaxSize(null)),t.$$.dirty[0]&786435&&K!==null&&X!==null&&((yn=u[s])==null||yn.setPosition(new it(K,X))),t.$$.dirty[0]&3&&((At=u[s])==null||At.scaleFactor().then(ni=>n(29,be=ni))),t.$$.dirty[0]&3&&ee(u[s]),t.$$.dirty[0]&1048579&&((Vt=u[s])==null||Vt.setCursorGrab(se)),t.$$.dirty[0]&2097155&&((vn=u[s])==null||vn.setCursorVisible(ne)),t.$$.dirty[0]&16777219&&((Mt=u[s])==null||Mt.setCursorIcon(H)),t.$$.dirty[0]&12582915&&W!==null&&x!==null&&((Cn=u[s])==null||Cn.setCursorPosition(new it(W,x))),t.$$.dirty[0]&33554435&&((Pt=u[s])==null||Pt.setIgnoreCursorEvents(ue)),t.$$.dirty[0]&201326595&&((qt=u[s])==null||qt.setProgressBar({status:Pe,progress:he}))},[s,u,M,B,D,O,P,E,z,R,J,V,Z,le,te,q,G,T,K,X,se,ne,W,x,H,ue,Pe,he,L,be,ke,de,ae,$,Ae,we,me,We,Me,Ie,ge,_e,Se,Le,d,c,h,w,_,A,oe,Re,De,Ee,U,Te,Vn,k,Fe,qn,Ot,Nn,He,jn,lt,Wt,Gn,Ue,Kn,It,Xn,Be,Yn,st,Rt,Qn,Ge,Jn,Dt,Zn,Ke,xn,rt,Ft,$n,Ve,ei,Ht,ti,qe,hn,fn,pn,ze,at,Xe]}class na extends xe{constructor(e){super(),Ze(this,e,ta,ea,je,{onMessage:57},null,[-1,-1,-1,-1])}}function ia(t){let e;return{c(){e=r("div"),e.innerHTML='
Not available for Linux
',a(e,"class","flex flex-col gap-2")},m(n,l){C(n,e,l)},p:ie,i:ie,o:ie,d(n){n&&v(e)}}}function la(t,e,n){let{onMessage:l}=e;const s=window.constraints={audio:!0,video:!0};function u(o){const c=document.querySelector("video"),h=o.getVideoTracks();l("Got stream with constraints:",s),l(`Using video device: ${h[0].label}`),window.stream=o,c.srcObject=o}function d(o){if(o.name==="ConstraintNotSatisfiedError"){const c=s.video;l(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else o.name==="PermissionDeniedError"&&l("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");l(`getUserMedia error: ${o.name}`,o)}return Ki(async()=>{try{const o=await navigator.mediaDevices.getUserMedia(s);u(o)}catch(o){d(o)}}),ar(()=>{var o;(o=window.stream)==null||o.getTracks().forEach(function(c){c.stop()})}),t.$$set=o=>{"onMessage"in o&&n(0,l=o.onMessage)},[l]}class sa extends xe{constructor(e){super(),Ze(this,e,la,ia,je,{onMessage:0})}}function ra(t){let e,n,l,s,u,d;return{c(){e=r("div"),n=r("button"),n.textContent="Show",l=p(),s=r("button"),s.textContent="Hide",a(n,"class","btn"),a(n,"id","show"),a(n,"title","Hides and shows the app after 2 seconds"),a(s,"class","btn"),a(s,"id","hide")},m(o,c){C(o,e,c),i(e,n),i(e,l),i(e,s),u||(d=[S(n,"click",t[0]),S(s,"click",t[1])],u=!0)},p:ie,i:ie,o:ie,d(o){o&&v(e),u=!1,Ce(d)}}}function aa(t,e,n){let{onMessage:l}=e;function s(){u().then(()=>{setTimeout(()=>{Vr().then(()=>l("Shown app")).catch(l)},2e3)}).catch(l)}function u(){return qr().then(()=>l("Hide app")).catch(l)}return t.$$set=d=>{"onMessage"in d&&n(2,l=d.onMessage)},[s,u,l]}class ua extends xe{constructor(e){super(),Ze(this,e,aa,ra,je,{onMessage:2})}}var ji,Gi;function wr(t){var e;if("items"in t)t.items=(e=t.items)==null?void 0:e.map(n=>"rid"in n?n:wr(n));else if("action"in t&&t.action){const n=new Il;return n.onmessage=t.action,delete t.action,{...t,handler:n}}return t}async function on(t,e){const n=new Il;let l=null;return e&&typeof e=="object"&&("action"in e&&e.action&&(n.onmessage=e.action,delete e.action),"items"in e&&e.items&&(l=e.items.map(s=>"rid"in s?[s.rid,s.kind]:wr(s)))),m("plugin:menu|new",{kind:t,options:e?{...e,items:l}:void 0,handler:n})}class cn extends mr{get id(){return Rn(this,ji,"f")}get kind(){return Rn(this,Gi,"f")}constructor(e,n,l){super(e),ji.set(this,void 0),Gi.set(this,void 0),Xi(this,ji,n,"f"),Xi(this,Gi,l,"f")}}ji=new WeakMap,Gi=new WeakMap;class Fn extends cn{constructor(e,n){super(e,n,"MenuItem")}static async new(e){return on("MenuItem",e).then(([n,l])=>new Fn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}}class dn extends cn{constructor(e,n){super(e,n,"Check")}static async new(e){return on("Check",e).then(([n,l])=>new dn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async isChecked(){return m("plugin:menu|is_checked",{rid:this.rid})}async setChecked(e){return m("plugin:menu|set_checked",{rid:this.rid,checked:e})}}var js;(function(t){t.Add="Add",t.Advanced="Advanced",t.Bluetooth="Bluetooth",t.Bookmarks="Bookmarks",t.Caution="Caution",t.ColorPanel="ColorPanel",t.ColumnView="ColumnView",t.Computer="Computer",t.EnterFullScreen="EnterFullScreen",t.Everyone="Everyone",t.ExitFullScreen="ExitFullScreen",t.FlowView="FlowView",t.Folder="Folder",t.FolderBurnable="FolderBurnable",t.FolderSmart="FolderSmart",t.FollowLinkFreestanding="FollowLinkFreestanding",t.FontPanel="FontPanel",t.GoLeft="GoLeft",t.GoRight="GoRight",t.Home="Home",t.IChatTheater="IChatTheater",t.IconView="IconView",t.Info="Info",t.InvalidDataFreestanding="InvalidDataFreestanding",t.LeftFacingTriangle="LeftFacingTriangle",t.ListView="ListView",t.LockLocked="LockLocked",t.LockUnlocked="LockUnlocked",t.MenuMixedState="MenuMixedState",t.MenuOnState="MenuOnState",t.MobileMe="MobileMe",t.MultipleDocuments="MultipleDocuments",t.Network="Network",t.Path="Path",t.PreferencesGeneral="PreferencesGeneral",t.QuickLook="QuickLook",t.RefreshFreestanding="RefreshFreestanding",t.Refresh="Refresh",t.Remove="Remove",t.RevealFreestanding="RevealFreestanding",t.RightFacingTriangle="RightFacingTriangle",t.Share="Share",t.Slideshow="Slideshow",t.SmartBadge="SmartBadge",t.StatusAvailable="StatusAvailable",t.StatusNone="StatusNone",t.StatusPartiallyAvailable="StatusPartiallyAvailable",t.StatusUnavailable="StatusUnavailable",t.StopProgressFreestanding="StopProgressFreestanding",t.StopProgress="StopProgress",t.TrashEmpty="TrashEmpty",t.TrashFull="TrashFull",t.User="User",t.UserAccounts="UserAccounts",t.UserGroup="UserGroup",t.UserGuest="UserGuest"})(js||(js={}));class Hn extends cn{constructor(e,n){super(e,n,"Icon")}static async new(e){return on("Icon",e).then(([n,l])=>new Hn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async setIcon(e){return m("plugin:menu|set_icon",{rid:this.rid,icon:e})}}class Un extends cn{constructor(e,n){super(e,n,"Predefined")}static async new(e){return on("Predefined",e).then(([n,l])=>new Un(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}}function Ml([t,e,n]){switch(n){case"Submenu":return new Bn(t,e);case"Predefined":return new Un(t,e);case"Check":return new dn(t,e);case"Icon":return new Hn(t,e);case"MenuItem":default:return new Fn(t,e)}}class Bn extends cn{constructor(e,n){super(e,n,"Submenu")}static async new(e){return on("Submenu",e).then(([n,l])=>new Bn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async append(e){return m("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async prepend(e){return m("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async insert(e,n){return m("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(l=>"rid"in l?[l.rid,l.kind]:l),position:n})}async remove(e){return m("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return m("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(Ml)}async items(){return m("plugin:menu|items",{rid:this.rid,kind:this.kind}).then(e=>e.map(Ml))}async get(e){return m("plugin:menu|get",{rid:this.rid,kind:this.kind,id:e}).then(n=>n?Ml(n):null)}async popup(e,n){let l=null;return e&&(l={type:e instanceof it?"Physical":"Logical",data:e}),m("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:(n==null?void 0:n.label)??null,at:l})}async setAsWindowsMenuForNSApp(){return m("plugin:menu|set_as_windows_menu_for_nsapp",{rid:this.rid})}async setAsHelpMenuForNSApp(){return m("plugin:menu|set_as_help_menu_for_nsapp",{rid:this.rid})}}function Pl([t,e,n]){switch(n){case"Submenu":return new Bn(t,e);case"Predefined":return new Un(t,e);case"Check":return new dn(t,e);case"Icon":return new Hn(t,e);case"MenuItem":default:return new Fn(t,e)}}class bt extends cn{constructor(e,n){super(e,n,"Menu")}static async new(e){return on("Menu",e).then(([n,l])=>new bt(n,l))}static async default(){return m("plugin:menu|default").then(([e,n])=>new bt(e,n))}async append(e){return m("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async prepend(e){return m("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async insert(e,n){return m("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(l=>"rid"in l?[l.rid,l.kind]:l),position:n})}async remove(e){return m("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return m("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(Pl)}async items(){return m("plugin:menu|items",{rid:this.rid,kind:this.kind}).then(e=>e.map(Pl))}async get(e){return m("plugin:menu|get",{rid:this.rid,kind:this.kind,id:e}).then(n=>n?Pl(n):null)}async popup(e,n){let l=null;return e&&(l={type:e instanceof it?"Physical":"Logical",data:e}),m("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:(n==null?void 0:n.label)??null,at:l})}async setAsAppMenu(){return m("plugin:menu|set_as_app_menu",{rid:this.rid}).then(e=>e?new bt(e[0],e[1]):null)}async setAsWindowMenu(e){return m("plugin:menu|set_as_window_menu",{rid:this.rid,window:(e==null?void 0:e.label)??null}).then(n=>n?new bt(n[0],n[1]):null)}}function Gs(t,e,n){const l=t.slice();return l[16]=e[n],l[17]=e,l[18]=n,l}function Ks(t,e,n){const l=t.slice();return l[19]=e[n],l[20]=e,l[21]=n,l}function Xs(t){let e,n,l,s,u,d,o=t[19]+"",c,h,w,_,A;function k(){t[9].call(n,t[20],t[21])}return{c(){e=r("div"),n=r("input"),u=p(),d=r("label"),c=b(o),w=p(),a(n,"id",l=t[19]+"Input"),n.checked=s=t[0]===t[19],a(n,"type","radio"),a(n,"name","kind"),a(d,"for",h=t[19]+"Input"),a(e,"class","flex gap-1")},m(y,L){C(y,e,L),i(e,n),I(n,t[19]),i(e,u),i(e,d),i(d,c),i(e,w),_||(A=[S(n,"change",t[6]),S(n,"change",k)],_=!0)},p(y,L){t=y,L&16&&l!==(l=t[19]+"Input")&&a(n,"id",l),L&17&&s!==(s=t[0]===t[19])&&(n.checked=s),L&16&&I(n,t[19]),L&16&&o!==(o=t[19]+"")&&re(c,o),L&16&&h!==(h=t[19]+"Input")&&a(d,"for",h)},d(y){y&&v(e),_=!1,Ce(A)}}}function Ys(t){let e,n,l;return{c(){e=r("input"),a(e,"class","input"),a(e,"type","text"),a(e,"placeholder","Text")},m(s,u){C(s,e,u),I(e,t[1]),n||(l=S(e,"input",t[10]),n=!0)},p(s,u){u&2&&e.value!==s[1]&&I(e,s[1])},d(s){s&&v(e),n=!1,l()}}}function oa(t){let e,n=fe(t[5]),l=[];for(let s=0;sl("itemClick",{id:z,text:E})},P=await Fn.new(O);break;case"Icon":O={text:u,icon:d,action:z=>l("itemClick",{id:z,text:E})},P=await Hn.new(O);break;case"Check":O={text:u,checked:c,action:z=>l("itemClick",{id:z,text:E})},P=await dn.new(O);break;case"Predefined":O={item:o},P=await Un.new(O);break}l("new",{item:P,options:O}),n(1,u=""),o=""}function y(O,P){O[P]=this.value,n(4,h)}function L(){u=this.value,n(1,u)}function M(){d=this.value,n(2,d)}function B(){c=this.checked,n(3,c)}function D(O,P){O[P]=this.value,n(5,w)}return[s,u,d,c,h,w,_,A,k,y,L,M,B,D]}class pa extends xe{constructor(e){super(),Ze(this,e,fa,ha,je,{})}}function Js(t,e,n){const l=t.slice();return l[5]=e[n],l}function Zs(t){let e,n,l,s,u,d=xs(t[5])+"",o,c;return{c(){e=r("div"),n=r("div"),s=p(),u=r("p"),o=b(d),c=p(),a(n,"class",l=t[3](t[5])),a(e,"class","flex flex-row gap-1")},m(h,w){C(h,e,w),i(e,n),i(e,s),i(e,u),i(u,o),i(e,c)},p(h,w){w&1&&l!==(l=h[3](h[5]))&&a(n,"class",l),w&1&&d!==(d=xs(h[5])+"")&&re(o,d)},d(h){h&&v(e)}}}function ma(t){let e,n,l,s,u;n=new pa({}),n.$on("new",t[1]),n.$on("itemClick",t[2]);let d=fe(t[0]),o=[];for(let c=0;c{"items"in c&&n(0,l=c.items)},[l,u,d,o]}class kr extends xe{constructor(e){super(),Ze(this,e,ga,ma,je,{items:0})}}function _a(t){let e,n,l,s,u,d,o,c,h,w;function _(k){t[5](k)}let A={};return t[0]!==void 0&&(A.items=t[0]),n=new kr({props:A}),sn.push(()=>fr(n,"items",_)),n.$on("itemClick",t[3]),{c(){e=r("div"),In(n.$$.fragment),s=p(),u=r("button"),u.textContent="Create menu",d=p(),o=r("button"),o.textContent="Popup",a(u,"class","btn"),a(o,"class","btn")},m(k,y){C(k,e,y),an(n,e,null),i(e,s),i(e,u),i(e,d),i(e,o),c=!0,h||(w=[S(u,"click",t[1]),S(o,"click",t[2])],h=!0)},p(k,[y]){const L={};!l&&y&1&&(l=!0,L.items=k[0],dr(()=>l=!1)),n.$set(L)},i(k){c||(rn(n.$$.fragment,k),c=!0)},o(k){Wn(n.$$.fragment,k),c=!1},d(k){k&&v(e),un(n),h=!1,Ce(w)}}}function ba(t,e,n){let{onMessage:l}=e,s=[],u=null,d=null,o=0;const c=navigator.userAgent.includes("Macintosh");async function h(){d=await Bn.new({text:"app",items:s.map(y=>y.item)})}async function w(){await h(),o=s.length,u=await bt.new({items:[d]}),await(c?u.setAsAppMenu():u.setAsWindowMenu())}async function _(){(!d||o!==s.length)&&await h(),(await bt.new({items:[d]})).popup()}function A(y){l(`Item ${y.detail.text} clicked`)}function k(y){s=y,n(0,s)}return t.$$set=y=>{"onMessage"in y&&n(4,l=y.onMessage)},[s,w,_,A,l,k]}class wa extends xe{constructor(e){super(),Ze(this,e,ba,_a,je,{onMessage:4})}}class Dl extends mr{constructor(e,n){super(e),this.id=n}static async new(e){e!=null&&e.menu&&(e.menu=[e.menu.rid,e.menu.kind]),e!=null&&e.icon&&(e.icon=typeof e.icon=="string"?e.icon:Array.from(e.icon));const n=new Il;return e!=null&&e.action&&(n.onmessage=e.action,delete e.action),m("plugin:tray|new",{options:e??{},handler:n}).then(([l,s])=>new Dl(l,s))}async setIcon(e){let n=null;return e&&(n=typeof e=="string"?e:Array.from(e)),m("plugin:tray|set_icon",{rid:this.rid,icon:n})}async setMenu(e){return e&&(e=[e.rid,e.kind]),m("plugin:tray|set_menu",{rid:this.rid,menu:e})}async setTooltip(e){return m("plugin:tray|set_tooltip",{rid:this.rid,tooltip:e})}async setTitle(e){return m("plugin:tray|set_title",{rid:this.rid,title:e})}async setVisible(e){return m("plugin:tray|set_visible",{rid:this.rid,visible:e})}async setTempDirPath(e){return m("plugin:tray|set_temp_dir_path",{rid:this.rid,path:e})}async setIconAsTemplate(e){return m("plugin:tray|set_icon_as_template",{rid:this.rid,asTemplate:e})}async setMenuOnLeftClick(e){return m("plugin:tray|set_show_menu_on_left_click",{rid:this.rid,onLeft:e})}}function ka(t){let e,n,l,s,u,d,o,c,h,w,_,A,k,y,L,M,B,D,O,P,E,z,R,J,V,Z;function le(q){t[14](q)}let te={};return t[5]!==void 0&&(te.items=t[5]),O=new kr({props:te}),sn.push(()=>fr(O,"items",le)),O.$on("itemClick",t[6]),{c(){e=r("div"),n=r("div"),l=r("input"),s=p(),u=r("input"),d=p(),o=r("label"),c=b(`Menu on left click + `),D=r("div"),O=r("input"),P=p(),E=r("input"),z=p(),R=r("input"),J=p(),V=r("input"),Z=p(),le=r("div"),te=r("button"),te.textContent="Add",q=p(),G=r("div"),T=r("div"),K=b("Applied effects: "),be=b(X),ke=p(),de=r("button"),de.textContent="Clear",a(u,"class","input"),t[36]===void 0&&kt(()=>t[89].call(u)),a(h,"class","input"),t[37]===void 0&&kt(()=>t[90].call(h)),a(k,"class","input"),a(k,"type","number"),a(n,"class","flex"),$t(O,"max-width","120px"),a(O,"class","input"),a(O,"type","number"),a(O,"placeholder","R"),$t(E,"max-width","120px"),a(E,"class","input"),a(E,"type","number"),a(E,"placeholder","G"),$t(R,"max-width","120px"),a(R,"class","input"),a(R,"type","number"),a(R,"placeholder","B"),$t(V,"max-width","120px"),a(V,"class","input"),a(V,"type","number"),a(V,"placeholder","A"),a(D,"class","flex"),a(L,"class","flex"),a(te,"class","btn"),$t(te,"width","80px"),a(le,"class","flex"),a(de,"class","btn"),$t(de,"width","80px"),a(G,"class","flex"),a(e,"class","flex flex-col gap-1")},m(W,x){C(W,e,x),i(e,n),i(n,l),i(l,s),i(l,u);for(let H=0;H=1,w,_,A,k=h&&Fs(t),y=t[1][t[0]]&&Us(t);return{c(){e=r("div"),n=r("div"),l=r("input"),s=p(),u=r("button"),u.textContent="New window",d=p(),o=r("br"),c=p(),k&&k.c(),w=p(),y&&y.c(),a(l,"class","input grow"),a(l,"type","text"),a(l,"placeholder","New Window label.."),a(u,"class","btn"),a(n,"class","flex gap-1"),a(e,"class","flex flex-col children:grow gap-2")},m(L,M){C(L,e,M),i(e,n),i(n,l),I(l,t[28]),i(n,s),i(n,u),i(e,d),i(e,o),i(e,c),k&&k.m(e,null),i(e,w),y&&y.m(e,null),_||(A=[S(l,"input",t[58]),S(u,"click",t[53])],_=!0)},p(L,M){M[0]&268435456&&l.value!==L[28]&&I(l,L[28]),M[0]&2&&(h=Object.keys(L[1]).length>=1),h?k?k.p(L,M):(k=Fs(L),k.c(),k.m(e,w)):k&&(k.d(1),k=null),L[1][L[0]]?y?y.p(L,M):(y=Us(L),y.c(),y.m(e,null)):y&&(y.d(1),y=null)},i:ie,o:ie,d(L){L&&v(e),k&&k.d(),y&&y.d(),_=!1,Ce(A)}}}function ta(t,e,n){const l=br();let s=l.label;const u={[l.label]:l},d=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"],o=["mica","blur","acrylic","tabbed","tabbedDark","tabbedLight"],c=navigator.appVersion.includes("Windows"),h=navigator.appVersion.includes("Macintosh");let w=c?o:Object.keys(Ji).map(N=>Ji[N]).filter(N=>!o.includes(N));const _=Object.keys(Zi).map(N=>Zi[N]),A=Object.keys(Qi).map(N=>Qi[N]);let{onMessage:k}=e;const y=document.querySelector("main");let L,M=!0,B=!0,D=!0,O=!0,P=!1,E=!0,z=!1,R=!1,J=!0,V=!1,Z=null,le=null,te=null,q=null,G=null,T=null,K=null,X=null,be=1,ke=new it(K,X),de=new it(K,X),ae=new sn(Z,le),$=new sn(Z,le),pe,Y,se=!1,ne=!0,W=null,x=null,H="default",ue=!1,Ae="Awesome Tauri Example!",we=[],me,We,Me,Ie,ge,_e,Se,Pe="none",he=0,Le;function oe(){u[s].setTitle(Ae)}function Re(){u[s].hide(),setTimeout(u[s].show,2e3)}function De(){u[s].minimize(),setTimeout(u[s].unminimize,2e3)}function Ee(){if(!L)return;const N=`main-${L}`,ut=new Dn(N);n(1,u[N]=ut,u),ut.once("tauri://error",function(){k("Error creating new webview")})}function ce(){u[s].innerSize().then(N=>{n(32,ae=N),n(12,Z=ae.width),n(13,le=ae.height)}),u[s].outerSize().then(N=>{n(33,$=N)})}function F(){u[s].innerPosition().then(N=>{n(30,ke=N)}),u[s].outerPosition().then(N=>{n(31,de=N),n(18,K=de.x),n(19,X=de.y)})}async function ee(N){N&&(pe&&pe(),Y&&Y(),Y=await N.listen("tauri://move",F),pe=await N.listen("tauri://resize",ce))}async function U(){await u[s].minimize(),await u[s].requestUserAttention(Yi.Critical),await new Promise(N=>setTimeout(N,3e3)),await u[s].requestUserAttention(null)}async function Te(){we.includes(me)||n(35,we=[...we,me]);const N={effects:we,state:We,radius:Me};Number.isInteger(Ie)&&Number.isInteger(ge)&&Number.isInteger(_e)&&Number.isInteger(Se)&&(N.color=[Ie,ge,_e,Se]),y.classList.remove("bg-primary"),y.classList.remove("dark:bg-darkPrimary"),await u[s].clearEffects(),await u[s].setEffects(N)}async function Vn(){n(35,we=[]),await u[s].clearEffects(),y.classList.add("bg-primary"),y.classList.add("dark:bg-darkPrimary")}function Fe(){L=this.value,n(28,L)}function qn(){s=En(this),n(0,s),n(1,u)}function Wt(){Le=this.value,n(43,Le)}const Nn=()=>u[s].center();function He(){P=this.checked,n(6,P)}function jn(){M=this.checked,n(2,M)}function lt(){B=this.checked,n(3,B)}function It(){D=this.checked,n(4,D)}function Gn(){O=this.checked,n(5,O)}function Ue(){E=this.checked,n(7,E)}function Kn(){z=this.checked,n(8,z)}function Rt(){R=this.checked,n(9,R)}function Xn(){J=this.checked,n(10,J)}function Be(){V=this.checked,n(11,V)}function Yn(){K=Q(this.value),n(18,K)}function st(){X=Q(this.value),n(19,X)}function Dt(){Z=Q(this.value),n(12,Z)}function Qn(){le=Q(this.value),n(13,le)}function Ge(){te=Q(this.value),n(14,te)}function Jn(){q=Q(this.value),n(15,q)}function Ft(){G=Q(this.value),n(16,G)}function Zn(){T=Q(this.value),n(17,T)}function Ke(){se=this.checked,n(20,se)}function xn(){ne=this.checked,n(21,ne)}function rt(){ue=this.checked,n(25,ue)}function Ht(){H=En(this),n(24,H),n(44,d)}function $n(){W=Q(this.value),n(22,W)}function Ve(){x=Q(this.value),n(23,x)}function ei(){Ae=this.value,n(34,Ae)}function Ut(){Pe=En(this),n(26,Pe),n(49,A)}function ti(){he=Q(this.value),n(27,he)}function qe(){me=En(this),n(36,me),n(47,w)}function fn(){We=En(this),n(37,We),n(48,_)}function pn(){Me=Q(this.value),n(38,Me)}function mn(){Ie=Q(this.value),n(39,Ie)}function ze(){ge=Q(this.value),n(40,ge)}function at(){_e=Q(this.value),n(41,_e)}function Xe(){Se=Q(this.value),n(42,Se)}return t.$$set=N=>{"onMessage"in N&&n(57,k=N.onMessage)},t.$$.update=()=>{var N,ut,yt,gn,vt,Bt,_n,Ct,bn,St,Vt,wn,Ne,Lt,kn,At,yn,Mt,qt,vn,Pt,Cn,Et,Nt;t.$$.dirty[0]&3&&(u[s],F(),ce()),t.$$.dirty[0]&7&&((N=u[s])==null||N.setResizable(M)),t.$$.dirty[0]&11&&((ut=u[s])==null||ut.setMaximizable(B)),t.$$.dirty[0]&19&&((yt=u[s])==null||yt.setMinimizable(D)),t.$$.dirty[0]&35&&((gn=u[s])==null||gn.setClosable(O)),t.$$.dirty[0]&67&&(P?(vt=u[s])==null||vt.maximize():(Bt=u[s])==null||Bt.unmaximize()),t.$$.dirty[0]&131&&((_n=u[s])==null||_n.setDecorations(E)),t.$$.dirty[0]&259&&((Ct=u[s])==null||Ct.setAlwaysOnTop(z)),t.$$.dirty[0]&515&&((bn=u[s])==null||bn.setAlwaysOnBottom(R)),t.$$.dirty[0]&1027&&((St=u[s])==null||St.setContentProtected(J)),t.$$.dirty[0]&2051&&((Vt=u[s])==null||Vt.setFullscreen(V)),t.$$.dirty[0]&12291&&Z&&le&&((wn=u[s])==null||wn.setSize(new sn(Z,le))),t.$$.dirty[0]&49155&&(te&&q?(Ne=u[s])==null||Ne.setMinSize(new zl(te,q)):(Lt=u[s])==null||Lt.setMinSize(null)),t.$$.dirty[0]&196611&&(G>800&&T>400?(kn=u[s])==null||kn.setMaxSize(new zl(G,T)):(At=u[s])==null||At.setMaxSize(null)),t.$$.dirty[0]&786435&&K!==null&&X!==null&&((yn=u[s])==null||yn.setPosition(new it(K,X))),t.$$.dirty[0]&3&&((Mt=u[s])==null||Mt.scaleFactor().then(ni=>n(29,be=ni))),t.$$.dirty[0]&3&&ee(u[s]),t.$$.dirty[0]&1048579&&((qt=u[s])==null||qt.setCursorGrab(se)),t.$$.dirty[0]&2097155&&((vn=u[s])==null||vn.setCursorVisible(ne)),t.$$.dirty[0]&16777219&&((Pt=u[s])==null||Pt.setCursorIcon(H)),t.$$.dirty[0]&12582915&&W!==null&&x!==null&&((Cn=u[s])==null||Cn.setCursorPosition(new it(W,x))),t.$$.dirty[0]&33554435&&((Et=u[s])==null||Et.setIgnoreCursorEvents(ue)),t.$$.dirty[0]&201326595&&((Nt=u[s])==null||Nt.setProgressBar({status:Pe,progress:he}))},[s,u,M,B,D,O,P,E,z,R,J,V,Z,le,te,q,G,T,K,X,se,ne,W,x,H,ue,Pe,he,L,be,ke,de,ae,$,Ae,we,me,We,Me,Ie,ge,_e,Se,Le,d,c,h,w,_,A,oe,Re,De,Ee,U,Te,Vn,k,Fe,qn,Wt,Nn,He,jn,lt,It,Gn,Ue,Kn,Rt,Xn,Be,Yn,st,Dt,Qn,Ge,Jn,Ft,Zn,Ke,xn,rt,Ht,$n,Ve,ei,Ut,ti,qe,fn,pn,mn,ze,at,Xe]}class na extends xe{constructor(e){super(),Ze(this,e,ta,ea,je,{onMessage:57},null,[-1,-1,-1,-1])}}function ia(t){let e;return{c(){e=r("div"),e.innerHTML='
Not available for Linux
',a(e,"class","flex flex-col gap-2")},m(n,l){C(n,e,l)},p:ie,i:ie,o:ie,d(n){n&&v(e)}}}function la(t,e,n){let{onMessage:l}=e;const s=window.constraints={audio:!0,video:!0};function u(o){const c=document.querySelector("video"),h=o.getVideoTracks();l("Got stream with constraints:",s),l(`Using video device: ${h[0].label}`),window.stream=o,c.srcObject=o}function d(o){if(o.name==="ConstraintNotSatisfiedError"){const c=s.video;l(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else o.name==="PermissionDeniedError"&&l("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");l(`getUserMedia error: ${o.name}`,o)}return Ki(async()=>{try{const o=await navigator.mediaDevices.getUserMedia(s);u(o)}catch(o){d(o)}}),ar(()=>{var o;(o=window.stream)==null||o.getTracks().forEach(function(c){c.stop()})}),t.$$set=o=>{"onMessage"in o&&n(0,l=o.onMessage)},[l]}class sa extends xe{constructor(e){super(),Ze(this,e,la,ia,je,{onMessage:0})}}function ra(t){let e,n,l,s,u,d;return{c(){e=r("div"),n=r("button"),n.textContent="Show",l=p(),s=r("button"),s.textContent="Hide",a(n,"class","btn"),a(n,"id","show"),a(n,"title","Hides and shows the app after 2 seconds"),a(s,"class","btn"),a(s,"id","hide")},m(o,c){C(o,e,c),i(e,n),i(e,l),i(e,s),u||(d=[S(n,"click",t[0]),S(s,"click",t[1])],u=!0)},p:ie,i:ie,o:ie,d(o){o&&v(e),u=!1,Ce(d)}}}function aa(t,e,n){let{onMessage:l}=e;function s(){u().then(()=>{setTimeout(()=>{Vr().then(()=>l("Shown app")).catch(l)},2e3)}).catch(l)}function u(){return qr().then(()=>l("Hide app")).catch(l)}return t.$$set=d=>{"onMessage"in d&&n(2,l=d.onMessage)},[s,u,l]}class ua extends xe{constructor(e){super(),Ze(this,e,aa,ra,je,{onMessage:2})}}var ji,Gi;function wr(t){var e;if("items"in t)t.items=(e=t.items)==null?void 0:e.map(n=>"rid"in n?n:wr(n));else if("action"in t&&t.action){const n=new Il;return n.onmessage=t.action,delete t.action,{...t,handler:n}}return t}async function cn(t,e){const n=new Il;let l=null;return e&&typeof e=="object"&&("action"in e&&e.action&&(n.onmessage=e.action,delete e.action),"items"in e&&e.items&&(l=e.items.map(s=>"rid"in s?[s.rid,s.kind]:wr(s)))),m("plugin:menu|new",{kind:t,options:e?{...e,items:l}:void 0,handler:n})}class dn extends mr{get id(){return Rn(this,ji,"f")}get kind(){return Rn(this,Gi,"f")}constructor(e,n,l){super(e),ji.set(this,void 0),Gi.set(this,void 0),Xi(this,ji,n,"f"),Xi(this,Gi,l,"f")}}ji=new WeakMap,Gi=new WeakMap;class Fn extends dn{constructor(e,n){super(e,n,"MenuItem")}static async new(e){return cn("MenuItem",e).then(([n,l])=>new Fn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}}class hn extends dn{constructor(e,n){super(e,n,"Check")}static async new(e){return cn("Check",e).then(([n,l])=>new hn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async isChecked(){return m("plugin:menu|is_checked",{rid:this.rid})}async setChecked(e){return m("plugin:menu|set_checked",{rid:this.rid,checked:e})}}var js;(function(t){t.Add="Add",t.Advanced="Advanced",t.Bluetooth="Bluetooth",t.Bookmarks="Bookmarks",t.Caution="Caution",t.ColorPanel="ColorPanel",t.ColumnView="ColumnView",t.Computer="Computer",t.EnterFullScreen="EnterFullScreen",t.Everyone="Everyone",t.ExitFullScreen="ExitFullScreen",t.FlowView="FlowView",t.Folder="Folder",t.FolderBurnable="FolderBurnable",t.FolderSmart="FolderSmart",t.FollowLinkFreestanding="FollowLinkFreestanding",t.FontPanel="FontPanel",t.GoLeft="GoLeft",t.GoRight="GoRight",t.Home="Home",t.IChatTheater="IChatTheater",t.IconView="IconView",t.Info="Info",t.InvalidDataFreestanding="InvalidDataFreestanding",t.LeftFacingTriangle="LeftFacingTriangle",t.ListView="ListView",t.LockLocked="LockLocked",t.LockUnlocked="LockUnlocked",t.MenuMixedState="MenuMixedState",t.MenuOnState="MenuOnState",t.MobileMe="MobileMe",t.MultipleDocuments="MultipleDocuments",t.Network="Network",t.Path="Path",t.PreferencesGeneral="PreferencesGeneral",t.QuickLook="QuickLook",t.RefreshFreestanding="RefreshFreestanding",t.Refresh="Refresh",t.Remove="Remove",t.RevealFreestanding="RevealFreestanding",t.RightFacingTriangle="RightFacingTriangle",t.Share="Share",t.Slideshow="Slideshow",t.SmartBadge="SmartBadge",t.StatusAvailable="StatusAvailable",t.StatusNone="StatusNone",t.StatusPartiallyAvailable="StatusPartiallyAvailable",t.StatusUnavailable="StatusUnavailable",t.StopProgressFreestanding="StopProgressFreestanding",t.StopProgress="StopProgress",t.TrashEmpty="TrashEmpty",t.TrashFull="TrashFull",t.User="User",t.UserAccounts="UserAccounts",t.UserGroup="UserGroup",t.UserGuest="UserGuest"})(js||(js={}));class Hn extends dn{constructor(e,n){super(e,n,"Icon")}static async new(e){return cn("Icon",e).then(([n,l])=>new Hn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async setIcon(e){return m("plugin:menu|set_icon",{rid:this.rid,icon:e})}}class Un extends dn{constructor(e,n){super(e,n,"Predefined")}static async new(e){return cn("Predefined",e).then(([n,l])=>new Un(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}}function Ml([t,e,n]){switch(n){case"Submenu":return new Bn(t,e);case"Predefined":return new Un(t,e);case"Check":return new hn(t,e);case"Icon":return new Hn(t,e);case"MenuItem":default:return new Fn(t,e)}}class Bn extends dn{constructor(e,n){super(e,n,"Submenu")}static async new(e){return cn("Submenu",e).then(([n,l])=>new Bn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async append(e){return m("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async prepend(e){return m("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async insert(e,n){return m("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(l=>"rid"in l?[l.rid,l.kind]:l),position:n})}async remove(e){return m("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return m("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(Ml)}async items(){return m("plugin:menu|items",{rid:this.rid,kind:this.kind}).then(e=>e.map(Ml))}async get(e){return m("plugin:menu|get",{rid:this.rid,kind:this.kind,id:e}).then(n=>n?Ml(n):null)}async popup(e,n){let l=null;return e&&(l={type:e instanceof it?"Physical":"Logical",data:e}),m("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:(n==null?void 0:n.label)??null,at:l})}async setAsWindowsMenuForNSApp(){return m("plugin:menu|set_as_windows_menu_for_nsapp",{rid:this.rid})}async setAsHelpMenuForNSApp(){return m("plugin:menu|set_as_help_menu_for_nsapp",{rid:this.rid})}}function Pl([t,e,n]){switch(n){case"Submenu":return new Bn(t,e);case"Predefined":return new Un(t,e);case"Check":return new hn(t,e);case"Icon":return new Hn(t,e);case"MenuItem":default:return new Fn(t,e)}}class wt extends dn{constructor(e,n){super(e,n,"Menu")}static async new(e){return cn("Menu",e).then(([n,l])=>new wt(n,l))}static async default(){return m("plugin:menu|create_default").then(([e,n])=>new wt(e,n))}async append(e){return m("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async prepend(e){return m("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async insert(e,n){return m("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(l=>"rid"in l?[l.rid,l.kind]:l),position:n})}async remove(e){return m("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return m("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(Pl)}async items(){return m("plugin:menu|items",{rid:this.rid,kind:this.kind}).then(e=>e.map(Pl))}async get(e){return m("plugin:menu|get",{rid:this.rid,kind:this.kind,id:e}).then(n=>n?Pl(n):null)}async popup(e,n){let l=null;return e&&(l={type:e instanceof it?"Physical":"Logical",data:e}),m("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:(n==null?void 0:n.label)??null,at:l})}async setAsAppMenu(){return m("plugin:menu|set_as_app_menu",{rid:this.rid}).then(e=>e?new wt(e[0],e[1]):null)}async setAsWindowMenu(e){return m("plugin:menu|set_as_window_menu",{rid:this.rid,window:(e==null?void 0:e.label)??null}).then(n=>n?new wt(n[0],n[1]):null)}}function Gs(t,e,n){const l=t.slice();return l[16]=e[n],l[17]=e,l[18]=n,l}function Ks(t,e,n){const l=t.slice();return l[19]=e[n],l[20]=e,l[21]=n,l}function Xs(t){let e,n,l,s,u,d,o=t[19]+"",c,h,w,_,A;function k(){t[9].call(n,t[20],t[21])}return{c(){e=r("div"),n=r("input"),u=p(),d=r("label"),c=b(o),w=p(),a(n,"id",l=t[19]+"Input"),n.checked=s=t[0]===t[19],a(n,"type","radio"),a(n,"name","kind"),a(d,"for",h=t[19]+"Input"),a(e,"class","flex gap-1")},m(y,L){C(y,e,L),i(e,n),I(n,t[19]),i(e,u),i(e,d),i(d,c),i(e,w),_||(A=[S(n,"change",t[6]),S(n,"change",k)],_=!0)},p(y,L){t=y,L&16&&l!==(l=t[19]+"Input")&&a(n,"id",l),L&17&&s!==(s=t[0]===t[19])&&(n.checked=s),L&16&&I(n,t[19]),L&16&&o!==(o=t[19]+"")&&re(c,o),L&16&&h!==(h=t[19]+"Input")&&a(d,"for",h)},d(y){y&&v(e),_=!1,Ce(A)}}}function Ys(t){let e,n,l;return{c(){e=r("input"),a(e,"class","input"),a(e,"type","text"),a(e,"placeholder","Text")},m(s,u){C(s,e,u),I(e,t[1]),n||(l=S(e,"input",t[10]),n=!0)},p(s,u){u&2&&e.value!==s[1]&&I(e,s[1])},d(s){s&&v(e),n=!1,l()}}}function oa(t){let e,n=fe(t[5]),l=[];for(let s=0;sl("itemClick",{id:z,text:E})},P=await Fn.new(O);break;case"Icon":O={text:u,icon:d,action:z=>l("itemClick",{id:z,text:E})},P=await Hn.new(O);break;case"Check":O={text:u,checked:c,action:z=>l("itemClick",{id:z,text:E})},P=await hn.new(O);break;case"Predefined":O={item:o},P=await Un.new(O);break}l("new",{item:P,options:O}),n(1,u=""),o=""}function y(O,P){O[P]=this.value,n(4,h)}function L(){u=this.value,n(1,u)}function M(){d=this.value,n(2,d)}function B(){c=this.checked,n(3,c)}function D(O,P){O[P]=this.value,n(5,w)}return[s,u,d,c,h,w,_,A,k,y,L,M,B,D]}class pa extends xe{constructor(e){super(),Ze(this,e,fa,ha,je,{})}}function Js(t,e,n){const l=t.slice();return l[5]=e[n],l}function Zs(t){let e,n,l,s,u,d=xs(t[5])+"",o,c;return{c(){e=r("div"),n=r("div"),s=p(),u=r("p"),o=b(d),c=p(),a(n,"class",l=t[3](t[5])),a(e,"class","flex flex-row gap-1")},m(h,w){C(h,e,w),i(e,n),i(e,s),i(e,u),i(u,o),i(e,c)},p(h,w){w&1&&l!==(l=h[3](h[5]))&&a(n,"class",l),w&1&&d!==(d=xs(h[5])+"")&&re(o,d)},d(h){h&&v(e)}}}function ma(t){let e,n,l,s,u;n=new pa({}),n.$on("new",t[1]),n.$on("itemClick",t[2]);let d=fe(t[0]),o=[];for(let c=0;c{"items"in c&&n(0,l=c.items)},[l,u,d,o]}class kr extends xe{constructor(e){super(),Ze(this,e,ga,ma,je,{items:0})}}function _a(t){let e,n,l,s,u,d,o,c,h,w;function _(k){t[5](k)}let A={};return t[0]!==void 0&&(A.items=t[0]),n=new kr({props:A}),rn.push(()=>fr(n,"items",_)),n.$on("itemClick",t[3]),{c(){e=r("div"),In(n.$$.fragment),s=p(),u=r("button"),u.textContent="Create menu",d=p(),o=r("button"),o.textContent="Popup",a(u,"class","btn"),a(o,"class","btn")},m(k,y){C(k,e,y),un(n,e,null),i(e,s),i(e,u),i(e,d),i(e,o),c=!0,h||(w=[S(u,"click",t[1]),S(o,"click",t[2])],h=!0)},p(k,[y]){const L={};!l&&y&1&&(l=!0,L.items=k[0],dr(()=>l=!1)),n.$set(L)},i(k){c||(an(n.$$.fragment,k),c=!0)},o(k){Wn(n.$$.fragment,k),c=!1},d(k){k&&v(e),on(n),h=!1,Ce(w)}}}function ba(t,e,n){let{onMessage:l}=e,s=[],u=null,d=null,o=0;const c=navigator.userAgent.includes("Macintosh");async function h(){d=await Bn.new({text:"app",items:s.map(y=>y.item)})}async function w(){await h(),o=s.length,u=await wt.new({items:[d]}),await(c?u.setAsAppMenu():u.setAsWindowMenu())}async function _(){(!d||o!==s.length)&&await h(),(await wt.new({items:[d]})).popup()}function A(y){l(`Item ${y.detail.text} clicked`)}function k(y){s=y,n(0,s)}return t.$$set=y=>{"onMessage"in y&&n(4,l=y.onMessage)},[s,w,_,A,l,k]}class wa extends xe{constructor(e){super(),Ze(this,e,ba,_a,je,{onMessage:4})}}class Dl extends mr{constructor(e,n){super(e),this.id=n}static async new(e){e!=null&&e.menu&&(e.menu=[e.menu.rid,e.menu.kind]),e!=null&&e.icon&&(e.icon=typeof e.icon=="string"?e.icon:Array.from(e.icon));const n=new Il;return e!=null&&e.action&&(n.onmessage=e.action,delete e.action),m("plugin:tray|new",{options:e??{},handler:n}).then(([l,s])=>new Dl(l,s))}async setIcon(e){let n=null;return e&&(n=typeof e=="string"?e:Array.from(e)),m("plugin:tray|set_icon",{rid:this.rid,icon:n})}async setMenu(e){return e&&(e=[e.rid,e.kind]),m("plugin:tray|set_menu",{rid:this.rid,menu:e})}async setTooltip(e){return m("plugin:tray|set_tooltip",{rid:this.rid,tooltip:e})}async setTitle(e){return m("plugin:tray|set_title",{rid:this.rid,title:e})}async setVisible(e){return m("plugin:tray|set_visible",{rid:this.rid,visible:e})}async setTempDirPath(e){return m("plugin:tray|set_temp_dir_path",{rid:this.rid,path:e})}async setIconAsTemplate(e){return m("plugin:tray|set_icon_as_template",{rid:this.rid,asTemplate:e})}async setMenuOnLeftClick(e){return m("plugin:tray|set_show_menu_on_left_click",{rid:this.rid,onLeft:e})}}function ka(t){let e,n,l,s,u,d,o,c,h,w,_,A,k,y,L,M,B,D,O,P,E,z,R,J,V,Z;function le(q){t[14](q)}let te={};return t[5]!==void 0&&(te.items=t[5]),O=new kr({props:te}),rn.push(()=>fr(O,"items",le)),O.$on("itemClick",t[6]),{c(){e=r("div"),n=r("div"),l=r("input"),s=p(),u=r("input"),d=p(),o=r("label"),c=b(`Menu on left click `),h=r("input"),w=p(),_=r("div"),A=r("input"),k=p(),y=r("label"),L=b(`Icon as template - `),M=r("input"),B=p(),D=r("div"),In(O.$$.fragment),E=p(),z=r("div"),R=r("button"),R.textContent="Create tray",a(l,"class","input grow"),a(l,"type","text"),a(l,"placeholder","Title"),a(u,"class","input grow"),a(u,"type","text"),a(u,"placeholder","Tooltip"),a(h,"type","checkbox"),a(n,"class","flex gap-1"),a(A,"class","input grow"),a(A,"type","text"),a(A,"placeholder","Icon path"),a(M,"type","checkbox"),a(_,"class","flex gap-1"),a(D,"class","flex children:grow"),a(R,"class","btn"),a(R,"title","Creates the tray icon"),a(z,"class","flex"),a(e,"class","flex flex-col children:grow gap-2")},m(q,G){C(q,e,G),i(e,n),i(n,l),I(l,t[2]),i(n,s),i(n,u),I(u,t[1]),i(n,d),i(n,o),i(o,c),i(o,h),h.checked=t[4],i(e,w),i(e,_),i(_,A),I(A,t[0]),i(_,k),i(_,y),i(y,L),i(y,M),M.checked=t[3],i(e,B),i(e,D),an(O,D,null),i(e,E),i(e,z),i(z,R),J=!0,V||(Z=[S(l,"input",t[9]),S(u,"input",t[10]),S(h,"change",t[11]),S(A,"input",t[12]),S(M,"change",t[13]),S(R,"click",t[7])],V=!0)},p(q,[G]){G&4&&l.value!==q[2]&&I(l,q[2]),G&2&&u.value!==q[1]&&I(u,q[1]),G&16&&(h.checked=q[4]),G&1&&A.value!==q[0]&&I(A,q[0]),G&8&&(M.checked=q[3]);const T={};!P&&G&32&&(P=!0,T.items=q[5],dr(()=>P=!1)),O.$set(T)},i(q){J||(rn(O.$$.fragment,q),J=!0)},o(q){Wn(O.$$.fragment,q),J=!1},d(q){q&&v(e),un(O),V=!1,Ce(Z)}}}function ya(t,e,n){let{onMessage:l}=e,s=null,u=null,d=null,o=!1,c=!0,h=[];function w(D){l(`Item ${D.detail.text} clicked`)}async function _(){Dl.new({icon:s,tooltip:u,title:d,iconAsTemplate:o,menuOnLeftClick:c,menu:await bt.new({items:h.map(D=>D.item)}),action:D=>l(D)}).catch(l)}function A(){d=this.value,n(2,d)}function k(){u=this.value,n(1,u)}function y(){c=this.checked,n(4,c)}function L(){s=this.value,n(0,s)}function M(){o=this.checked,n(3,o)}function B(D){h=D,n(5,h)}return t.$$set=D=>{"onMessage"in D&&n(8,l=D.onMessage)},[s,u,d,o,c,h,w,_,l,A,k,y,L,M,B]}class va extends xe{constructor(e){super(),Ze(this,e,ya,ka,je,{onMessage:8})}}function $s(t,e,n){const l=t.slice();return l[28]=e[n],l}function er(t,e,n){const l=t.slice();return l[31]=e[n],l}function Ca(t){let e;return{c(){e=r("span"),a(e,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,l){C(n,e,l)},d(n){n&&v(e)}}}function Sa(t){let e;return{c(){e=r("span"),a(e,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,l){C(n,e,l)},d(n){n&&v(e)}}}function La(t){let e,n;return{c(){e=b(`Switch to Dark mode + `),M=r("input"),B=p(),D=r("div"),In(O.$$.fragment),E=p(),z=r("div"),R=r("button"),R.textContent="Create tray",a(l,"class","input grow"),a(l,"type","text"),a(l,"placeholder","Title"),a(u,"class","input grow"),a(u,"type","text"),a(u,"placeholder","Tooltip"),a(h,"type","checkbox"),a(n,"class","flex gap-1"),a(A,"class","input grow"),a(A,"type","text"),a(A,"placeholder","Icon path"),a(M,"type","checkbox"),a(_,"class","flex gap-1"),a(D,"class","flex children:grow"),a(R,"class","btn"),a(R,"title","Creates the tray icon"),a(z,"class","flex"),a(e,"class","flex flex-col children:grow gap-2")},m(q,G){C(q,e,G),i(e,n),i(n,l),I(l,t[2]),i(n,s),i(n,u),I(u,t[1]),i(n,d),i(n,o),i(o,c),i(o,h),h.checked=t[4],i(e,w),i(e,_),i(_,A),I(A,t[0]),i(_,k),i(_,y),i(y,L),i(y,M),M.checked=t[3],i(e,B),i(e,D),un(O,D,null),i(e,E),i(e,z),i(z,R),J=!0,V||(Z=[S(l,"input",t[9]),S(u,"input",t[10]),S(h,"change",t[11]),S(A,"input",t[12]),S(M,"change",t[13]),S(R,"click",t[7])],V=!0)},p(q,[G]){G&4&&l.value!==q[2]&&I(l,q[2]),G&2&&u.value!==q[1]&&I(u,q[1]),G&16&&(h.checked=q[4]),G&1&&A.value!==q[0]&&I(A,q[0]),G&8&&(M.checked=q[3]);const T={};!P&&G&32&&(P=!0,T.items=q[5],dr(()=>P=!1)),O.$set(T)},i(q){J||(an(O.$$.fragment,q),J=!0)},o(q){Wn(O.$$.fragment,q),J=!1},d(q){q&&v(e),on(O),V=!1,Ce(Z)}}}function ya(t,e,n){let{onMessage:l}=e,s=null,u=null,d=null,o=!1,c=!0,h=[];function w(D){l(`Item ${D.detail.text} clicked`)}async function _(){Dl.new({icon:s,tooltip:u,title:d,iconAsTemplate:o,menuOnLeftClick:c,menu:await wt.new({items:h.map(D=>D.item)}),action:D=>l(D)}).catch(l)}function A(){d=this.value,n(2,d)}function k(){u=this.value,n(1,u)}function y(){c=this.checked,n(4,c)}function L(){s=this.value,n(0,s)}function M(){o=this.checked,n(3,o)}function B(D){h=D,n(5,h)}return t.$$set=D=>{"onMessage"in D&&n(8,l=D.onMessage)},[s,u,d,o,c,h,w,_,l,A,k,y,L,M,B]}class va extends xe{constructor(e){super(),Ze(this,e,ya,ka,je,{onMessage:8})}}function $s(t,e,n){const l=t.slice();return l[28]=e[n],l}function er(t,e,n){const l=t.slice();return l[31]=e[n],l}function Ca(t){let e;return{c(){e=r("span"),a(e,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,l){C(n,e,l)},d(n){n&&v(e)}}}function Sa(t){let e;return{c(){e=r("span"),a(e,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,l){C(n,e,l)},d(n){n&&v(e)}}}function La(t){let e,n;return{c(){e=b(`Switch to Dark mode `),n=r("div"),a(n,"class","i-ph-moon")},m(l,s){C(l,e,s),C(l,n,s)},d(l){l&&(v(e),v(n))}}}function Aa(t){let e,n;return{c(){e=b(`Switch to Light mode `),n=r("div"),a(n,"class","i-ph-sun")},m(l,s){C(l,e,s),C(l,n,s)},d(l){l&&(v(e),v(n))}}}function Ma(t){let e,n,l,s,u,d,o;function c(){return t[15](t[31])}return{c(){e=r("a"),n=r("div"),l=p(),s=r("p"),s.textContent=`${t[31].label}`,a(n,"class",t[31].icon+" mr-2"),a(e,"href","##"),a(e,"class",u="nv "+(t[1]===t[31]?"nv_selected":""))},m(h,w){C(h,e,w),i(e,n),i(e,l),i(e,s),d||(o=S(e,"click",c),d=!0)},p(h,w){t=h,w[0]&2&&u!==(u="nv "+(t[1]===t[31]?"nv_selected":""))&&a(e,"class",u)},d(h){h&&v(e),d=!1,o()}}}function tr(t){let e,n=t[31]&&Ma(t);return{c(){n&&n.c(),e=Ol()},m(l,s){n&&n.m(l,s),C(l,e,s)},p(l,s){l[31]&&n.p(l,s)},d(l){l&&v(e),n&&n.d(l)}}}function nr(t){let e,n=t[28].html+"",l;return{c(){e=new Tr(!1),l=Ol(),e.a=l},m(s,u){e.m(n,s,u),C(s,l,u)},p(s,u){u[0]&32&&n!==(n=s[28].html+"")&&e.p(n)},d(s){s&&(v(l),e.d())}}}function Pa(t){let e,n,l,s,u,d,o,c,h,w,_,A,k,y,L,M,B,D,O,P,E,z,R,J,V,Z,le,te,q,G,T,K,X=t[1].label+"",be,ke,de,ae,$,pe,Y,se,ne,W,x,H,ue,Ae,we,me,We,Me;function Ie(F,ee){return F[0]?Sa:Ca}let ge=Ie(t),_e=ge(t);function Se(F,ee){return F[2]?Aa:La}let Pe=Se(t),he=Pe(t),Le=fe(t[6]),oe=[];for(let F=0;F`,B=p(),D=r("a"),D.innerHTML=`GitHub `,O=p(),P=r("a"),P.innerHTML=`Source - `,E=p(),z=r("br"),R=p(),J=r("div"),V=p(),Z=r("br"),le=p(),te=r("div");for(let F=0;F',Ae=p(),we=r("div");for(let F=0;F{un(U,1)}),Ir()}Re?($=Es(Re,De(F)),In($.$$.fragment),rn($.$$.fragment,1),an($,ae,null)):$=null}if(ee[0]&32){Ee=fe(F[5]);let U;for(U=0;U{T.ctrlKey&&T.key==="b"&&m("toggle_menu")});const s=navigator.userAgent.toLowerCase(),u=s.includes("android")||s.includes("iphone"),d=[{label:"Welcome",component:Gr,icon:"i-ph-hand-waving"},{label:"Communication",component:Qr,icon:"i-codicon-radio-tower"},!u&&{label:"App",component:ua,icon:"i-codicon-hubot"},{label:"Window",component:na,icon:"i-codicon-window"},{label:"Menu",component:wa,icon:"i-ph-list"},{label:"Tray",component:va,icon:"i-ph-tray"},{label:"WebRTC",component:sa,icon:"i-ph-broadcast"}];let o=d[0];function c(T){n(1,o=T)}let h;Ki(()=>{n(2,h=localStorage&&localStorage.getItem("theme")=="dark"),lr(h)});function w(){n(2,h=!h),lr(h)}let _=Fr([]);Ar(t,_,T=>n(5,l=T));let A;async function k(T){_.update(K=>[...K,{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof T=="string"?T:JSON.stringify(T,null,1))+"
"}]),await Ts(),A&&n(3,A.scrollTop=A.scrollHeight,A)}async function y(T){_.update(K=>[...K,{html:`
[${new Date().toLocaleTimeString()}]: `+T+"
"}]),await Ts(),A&&n(3,A.scrollTop=A.scrollHeight,A)}function L(){_.update(()=>[])}let M,B,D;function O(T){D=T.clientY;const K=window.getComputedStyle(M);B=parseInt(K.height,10);const X=ke=>{const de=ke.clientY-D,ae=B-de;n(4,M.style.height=`${ae{document.removeEventListener("mouseup",be),document.removeEventListener("mousemove",X)};document.addEventListener("mouseup",be),document.addEventListener("mousemove",X)}let P=!1,E,z,R=!1,J=0,V=0;const Z=(T,K,X)=>Math.min(Math.max(K,T),X);Ki(()=>{n(14,E=document.querySelector("#sidebar")),z=document.querySelector("#sidebarToggle"),document.addEventListener("click",T=>{z.contains(T.target)?n(0,P=!P):P&&!E.contains(T.target)&&n(0,P=!1)}),document.addEventListener("touchstart",T=>{if(z.contains(T.target))return;const K=T.touches[0].clientX;(0{if(R){const K=T.touches[0].clientX;V=K;const X=(K-J)/10;E.style.setProperty("--translate-x",`-${Z(0,P?0-X:18.75-X,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(R){const T=(V-J)/10;n(0,P=P?T>-(18.75/2):T>18.75/2)}R=!1})});const le=T=>{c(T),n(0,P=!1)},te=T=>T.key==="Enter"?L():{};function q(T){sn[T?"unshift":"push"](()=>{A=T,n(3,A)})}function G(T){sn[T?"unshift":"push"](()=>{M=T,n(4,M)})}return t.$$.update=()=>{if(t.$$.dirty[0]&1){const T=document.querySelector("#sidebar");T&&Ea(T,P)}},[P,o,h,A,M,l,d,c,w,_,k,y,L,O,E,le,te,q,G]}class za extends xe{constructor(e){super(),Ze(this,e,Ta,Pa,je,{},null,[-1,-1])}}new za({target:document.querySelector("#app")}); + `,E=p(),z=r("br"),R=p(),J=r("div"),V=p(),Z=r("br"),le=p(),te=r("div");for(let F=0;F',Ae=p(),we=r("div");for(let F=0;F{on(U,1)}),Ir()}Re?($=Es(Re,De(F)),In($.$$.fragment),an($.$$.fragment,1),un($,ae,null)):$=null}if(ee[0]&32){Ee=fe(F[5]);let U;for(U=0;U{T.ctrlKey&&T.key==="b"&&m("toggle_menu")});const s=navigator.userAgent.toLowerCase(),u=s.includes("android")||s.includes("iphone"),d=[{label:"Welcome",component:Gr,icon:"i-ph-hand-waving"},{label:"Communication",component:Qr,icon:"i-codicon-radio-tower"},!u&&{label:"App",component:ua,icon:"i-codicon-hubot"},{label:"Window",component:na,icon:"i-codicon-window"},{label:"Menu",component:wa,icon:"i-ph-list"},{label:"Tray",component:va,icon:"i-ph-tray"},{label:"WebRTC",component:sa,icon:"i-ph-broadcast"}];let o=d[0];function c(T){n(1,o=T)}let h;Ki(()=>{n(2,h=localStorage&&localStorage.getItem("theme")=="dark"),lr(h)});function w(){n(2,h=!h),lr(h)}let _=Fr([]);Ar(t,_,T=>n(5,l=T));let A;async function k(T){_.update(K=>[...K,{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof T=="string"?T:JSON.stringify(T,null,1))+"
"}]),await Ts(),A&&n(3,A.scrollTop=A.scrollHeight,A)}async function y(T){_.update(K=>[...K,{html:`
[${new Date().toLocaleTimeString()}]: `+T+"
"}]),await Ts(),A&&n(3,A.scrollTop=A.scrollHeight,A)}function L(){_.update(()=>[])}let M,B,D;function O(T){D=T.clientY;const K=window.getComputedStyle(M);B=parseInt(K.height,10);const X=ke=>{const de=ke.clientY-D,ae=B-de;n(4,M.style.height=`${ae{document.removeEventListener("mouseup",be),document.removeEventListener("mousemove",X)};document.addEventListener("mouseup",be),document.addEventListener("mousemove",X)}let P=!1,E,z,R=!1,J=0,V=0;const Z=(T,K,X)=>Math.min(Math.max(K,T),X);Ki(()=>{n(14,E=document.querySelector("#sidebar")),z=document.querySelector("#sidebarToggle"),document.addEventListener("click",T=>{z.contains(T.target)?n(0,P=!P):P&&!E.contains(T.target)&&n(0,P=!1)}),document.addEventListener("touchstart",T=>{if(z.contains(T.target))return;const K=T.touches[0].clientX;(0{if(R){const K=T.touches[0].clientX;V=K;const X=(K-J)/10;E.style.setProperty("--translate-x",`-${Z(0,P?0-X:18.75-X,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(R){const T=(V-J)/10;n(0,P=P?T>-(18.75/2):T>18.75/2)}R=!1})});const le=T=>{c(T),n(0,P=!1)},te=T=>T.key==="Enter"?L():{};function q(T){rn[T?"unshift":"push"](()=>{A=T,n(3,A)})}function G(T){rn[T?"unshift":"push"](()=>{M=T,n(4,M)})}return t.$$.update=()=>{if(t.$$.dirty[0]&1){const T=document.querySelector("#sidebar");T&&Ea(T,P)}},[P,o,h,A,M,l,d,c,w,_,k,y,L,O,E,le,te,q,G]}class za extends xe{constructor(e){super(),Ze(this,e,Ta,Pa,je,{},null,[-1,-1])}}new za({target:document.querySelector("#app")}); diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index 6067f2a8f5a1..8bd15757cd0d 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -160,6 +160,12 @@ dependencies = [ "window-shadows", ] +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" + [[package]] name = "ascii" version = "1.1.0" @@ -298,7 +304,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -333,7 +339,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -470,6 +476,20 @@ name = "bytemuck" version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] [[package]] name = "byteorder" @@ -511,6 +531,38 @@ dependencies = [ "system-deps", ] +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "cargo_toml" version = "0.17.0" @@ -804,7 +856,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -814,7 +866,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37e366bff8cd32dd8754b0991fb66b279dc48f598c3a18914852a6673deef583" dependencies = [ "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -847,7 +899,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -858,7 +910,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -932,6 +984,56 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" +[[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading 0.7.4", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "drm" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb1b703ffbc7ebd216eba7900008049a56ace55580ecb2ee7fa801e8d8be87" +dependencies = [ + "bitflags 2.4.1", + "bytemuck", + "drm-ffi", + "drm-fourcc", + "nix 0.27.1", +] + +[[package]] +name = "drm-ffi" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba7d1c19c4b6270e89d59fb27dc6d02a317c658a8a54e54781e1db9b5947595d" +dependencies = [ + "drm-sys", + "nix 0.27.1", +] + +[[package]] +name = "drm-fourcc" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" + +[[package]] +name = "drm-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4f1c0468062a56cd5705f1e3b5409eb286d5596a2028ec8e947595d7e715ae" + [[package]] name = "dtoa" version = "1.0.9" @@ -953,6 +1055,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +[[package]] +name = "dyn-clone" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" + [[package]] name = "embed-resource" version = "2.4.0" @@ -999,7 +1107,7 @@ checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -1113,7 +1221,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -1206,7 +1314,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -1369,6 +1477,16 @@ dependencies = [ "version_check", ] +[[package]] +name = "gethostname" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb65d4ba3173c56a500b555b532f72c42e8d1fe64962b518897f8959fae2c177" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "getrandom" version = "0.1.16" @@ -1473,7 +1591,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -1552,7 +1670,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -1938,7 +2056,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" dependencies = [ "gtk-sys", - "libloading", + "libloading 0.7.4", "once_cell", ] @@ -1958,6 +2076,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "libloading" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "line-wrap" version = "0.1.1" @@ -2060,6 +2188,15 @@ version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +[[package]] +name = "memmap2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.7.1" @@ -2133,7 +2270,7 @@ dependencies = [ "jni-sys", "ndk-sys", "num_enum", - "raw-window-handle", + "raw-window-handle 0.5.2", "thiserror", ] @@ -2170,6 +2307,17 @@ dependencies = [ "memoffset 0.7.1", ] +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.4.1", + "cfg-if", + "libc", +] + [[package]] name = "nodrop" version = "0.1.14" @@ -2476,7 +2624,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -2544,7 +2692,7 @@ dependencies = [ "base64", "indexmap 1.9.3", "line-wrap", - "quick-xml", + "quick-xml 0.29.0", "serde", "time", ] @@ -2664,9 +2812,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] @@ -2680,11 +2828,20 @@ dependencies = [ "memchr", ] +[[package]] +name = "quick-xml" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" +dependencies = [ + "memchr", +] + [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -2776,6 +2933,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +[[package]] +name = "raw-window-handle" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" + [[package]] name = "redox_syscall" version = "0.2.16" @@ -2955,6 +3118,31 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schemars" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", + "url", +] + +[[package]] +name = "schemars_derive" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 1.0.109", +] + [[package]] name = "scoped-tls" version = "1.0.1" @@ -2992,25 +3180,39 @@ name = "semver" version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +dependencies = [ + "serde", +] [[package]] name = "serde" -version = "1.0.189" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", +] + +[[package]] +name = "serde_derive_internals" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -3032,7 +3234,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -3082,7 +3284,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -3204,6 +3406,37 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "softbuffer" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa97594e034a52bfc0f7a2764f0445bd6dcf1c27136779b244473f9c24f9c5e" +dependencies = [ + "as-raw-xcb-connection", + "bytemuck", + "cfg_aliases", + "cocoa", + "core-graphics", + "drm", + "fastrand 2.0.1", + "foreign-types", + "js-sys", + "log", + "memmap2", + "objc", + "raw-window-handle 0.6.0", + "redox_syscall 0.4.1", + "rustix 0.38.21", + "tiny-xlib", + "wasm-bindgen", + "wayland-backend", + "wayland-client", + "wayland-sys", + "web-sys", + "windows-sys 0.48.0", + "x11rb", +] + [[package]] name = "soup3" version = "0.5.0" @@ -3313,9 +3546,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -3385,7 +3618,8 @@ dependencies = [ "once_cell", "parking_lot", "png", - "raw-window-handle", + "raw-window-handle 0.5.2", + "raw-window-handle 0.6.0", "scopeguard", "tao-macros", "unicode-segmentation", @@ -3416,7 +3650,7 @@ checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tauri" -version = "2.0.0-alpha.20" +version = "2.0.0-alpha.21" dependencies = [ "anyhow", "bytes", @@ -3440,13 +3674,14 @@ dependencies = [ "objc", "percent-encoding", "png", - "raw-window-handle", + "raw-window-handle 0.5.2", "reqwest", "serde", "serde_json", "serde_repr", "serialize-to-javascript", "state", + "static_assertions", "swift-rs", "tauri-build", "tauri-macros", @@ -3466,15 +3701,17 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.0.0-alpha.13" +version = "2.0.0-alpha.14" dependencies = [ "anyhow", "cargo_toml", "dirs-next", + "glob", "heck", "json-patch", "plist", "quote", + "schemars", "semver", "serde", "serde_json", @@ -3482,12 +3719,13 @@ dependencies = [ "tauri-codegen", "tauri-utils", "tauri-winres", + "toml 0.8.2", "walkdir", ] [[package]] name = "tauri-codegen" -version = "2.0.0-alpha.12" +version = "2.0.0-alpha.13" dependencies = [ "base64", "brotli", @@ -3511,16 +3749,29 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.0-alpha.12" +version = "2.0.0-alpha.13" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", "tauri-codegen", "tauri-utils", ] +[[package]] +name = "tauri-plugin" +version = "0.1.0" +dependencies = [ + "cargo_metadata", + "glob", + "serde", + "serde_json", + "tauri", + "tauri-utils", + "toml 0.8.2", +] + [[package]] name = "tauri-plugin-cli" version = "2.0.0-alpha.3" @@ -3542,17 +3793,18 @@ dependencies = [ "serde", "tauri", "tauri-build", + "tauri-plugin", "thiserror", ] [[package]] name = "tauri-runtime" -version = "1.0.0-alpha.7" +version = "1.0.0-alpha.8" dependencies = [ "gtk", "http", "jni", - "raw-window-handle", + "raw-window-handle 0.5.2", "serde", "serde_json", "tauri-utils", @@ -3563,14 +3815,15 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "1.0.0-alpha.8" +version = "1.0.0-alpha.9" dependencies = [ "cocoa", "gtk", "http", "jni", "percent-encoding", - "raw-window-handle", + "raw-window-handle 0.5.2", + "softbuffer", "tao", "tauri-runtime", "tauri-utils", @@ -3582,10 +3835,11 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.0.0-alpha.12" +version = "2.0.0-alpha.13" dependencies = [ "aes-gcm", "brotli", + "cargo_metadata", "ctor", "dunce", "getrandom 0.2.10", @@ -3600,12 +3854,14 @@ dependencies = [ "phf 0.11.2", "proc-macro2", "quote", + "schemars", "semver", "serde", "serde_json", "serde_with", "serialize-to-javascript", "thiserror", + "toml 0.8.2", "url", "walkdir", ] @@ -3667,7 +3923,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -3709,6 +3965,18 @@ dependencies = [ "time-core", ] +[[package]] +name = "tiny-xlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4098d49269baa034a8d1eae9bd63e9fa532148d772121dace3bcd6a6c98eb6d" +dependencies = [ + "as-raw-xcb-connection", + "ctor", + "libloading 0.8.1", + "tracing", +] + [[package]] name = "tiny_http" version = "0.11.0" @@ -3851,7 +4119,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -4110,7 +4378,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", "wasm-bindgen-shared", ] @@ -4144,7 +4412,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4168,6 +4436,55 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wayland-backend" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19152ddd73f45f024ed4534d9ca2594e0ef252c1847695255dae47f34df9fbe4" +dependencies = [ + "cc", + "downcast-rs", + "nix 0.26.4", + "scoped-tls", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca7d52347346f5473bf2f56705f360e8440873052e575e55890c4fa57843ed3" +dependencies = [ + "bitflags 2.4.1", + "nix 0.26.4", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb8e28403665c9f9513202b7e1ed71ec56fde5c107816843fb14057910b2c09c" +dependencies = [ + "proc-macro2", + "quick-xml 0.30.0", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +dependencies = [ + "dlib", + "log", + "once_cell", + "pkg-config", +] + [[package]] name = "web-sys" version = "0.3.64" @@ -4244,7 +4561,7 @@ checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -4283,6 +4600,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "winapi-wsapoll" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -4297,7 +4623,7 @@ checksum = "67ff424735b1ac21293b0492b069394b0a189c8a463fb015a16dea7c2e221c08" dependencies = [ "cocoa", "objc", - "raw-window-handle", + "raw-window-handle 0.5.2", "windows-sys 0.48.0", ] @@ -4309,7 +4635,7 @@ checksum = "5931735e675b972fada30c7a402915d4d827aa5ef6c929c133d640c4b785e963" dependencies = [ "cocoa", "objc", - "raw-window-handle", + "raw-window-handle 0.5.2", "windows-sys 0.48.0", ] @@ -4360,7 +4686,7 @@ checksum = "12168c33176773b86799be25e2a2ba07c7aab9968b37541f1094dbd7a60c8946" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -4371,7 +4697,7 @@ checksum = "9d8dc32e0095a7eeccebd0e3f09e9509365ecb3fc6ac4d6f5f14a3f6392942d1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -4612,9 +4938,9 @@ dependencies = [ [[package]] name = "wry" -version = "0.35.0" +version = "0.35.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "764ce8212721205a90c79f5fa04f5135af597bea9072f22a5e7f39dcd0669f2e" +checksum = "d3016c47c9b6f7029a9da7cd48af8352327226bba0e955f3c92e2966651365a9" dependencies = [ "base64", "block", @@ -4638,7 +4964,7 @@ dependencies = [ "objc", "objc_id", "once_cell", - "raw-window-handle", + "raw-window-handle 0.5.2", "serde", "serde_json", "sha2", @@ -4676,13 +5002,39 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "x11rb" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1641b26d4dec61337c35a1b1aaf9e3cba8f46f0b43636c609ab0291a648040a" +dependencies = [ + "as-raw-xcb-connection", + "gethostname", + "libc", + "libloading 0.7.4", + "nix 0.26.4", + "once_cell", + "winapi", + "winapi-wsapoll", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d6c3f9a0fb6701fab8f6cea9b0c0bd5d6876f1f89f7fada07e558077c344bc" +dependencies = [ + "nix 0.26.4", +] + [[package]] name = "xdg-home" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" dependencies = [ - "nix", + "nix 0.26.4", "winapi", ] @@ -4710,7 +5062,7 @@ dependencies = [ "futures-sink", "futures-util", "hex", - "nix", + "nix 0.26.4", "once_cell", "ordered-stream", "rand 0.8.5", diff --git a/examples/api/src-tauri/build.rs b/examples/api/src-tauri/build.rs index 2154ff35f5e3..e7b35e0b38c5 100644 --- a/examples/api/src-tauri/build.rs +++ b/examples/api/src-tauri/build.rs @@ -7,6 +7,7 @@ fn main() { if !cfg!(feature = "custom-protocol") { codegen = codegen.dev(); } - codegen.build(); - tauri_build::build(); + + tauri_build::try_build(tauri_build::Attributes::new().codegen(codegen)) + .expect("failed to run tauri-build"); } diff --git a/examples/api/src-tauri/capabilities/.gitignore b/examples/api/src-tauri/capabilities/.gitignore new file mode 100644 index 000000000000..c75f615b12f1 --- /dev/null +++ b/examples/api/src-tauri/capabilities/.gitignore @@ -0,0 +1 @@ +schemas/ diff --git a/examples/api/src-tauri/capabilities/run-app.json b/examples/api/src-tauri/capabilities/run-app.json new file mode 100644 index 000000000000..8052a8958e7b --- /dev/null +++ b/examples/api/src-tauri/capabilities/run-app.json @@ -0,0 +1,89 @@ +{ + "$schema": "./schemas/desktop-schema.json", + "identifier": "run-app", + "description": "permissions to run the app", + "windows": [ + "main", + "main-*" + ], + "permissions": [ + "path:default", + "event:default", + "window:default", + "app:default", + "resources:default", + "menu:default", + "tray:default", + "app:allow-app-hide", + "app:allow-app-show", + "window:allow-create", + "window:allow-center", + "window:allow-request-user-attention", + "window:allow-set-resizable", + "window:allow-set-maximizable", + "window:allow-set-minimizable", + "window:allow-set-closable", + "window:allow-set-title", + "window:allow-maximize", + "window:allow-unmaximize", + "window:allow-minimize", + "window:allow-unminimize", + "window:allow-show", + "window:allow-hide", + "window:allow-close", + "window:allow-set-decorations", + "window:allow-set-shadow", + "window:allow-set-effects", + "window:allow-set-always-on-top", + "window:allow-set-always-on-bottom", + "window:allow-set-content-protected", + "window:allow-set-size", + "window:allow-set-min-size", + "window:allow-set-max-size", + "window:allow-set-position", + "window:allow-set-fullscreen", + "window:allow-set-focus", + "window:allow-set-skip-taskbar", + "window:allow-set-cursor-grab", + "window:allow-set-cursor-visible", + "window:allow-set-cursor-icon", + "window:allow-set-cursor-position", + "window:allow-set-ignore-cursor-events", + "window:allow-start-dragging", + "window:allow-set-progress-bar", + "window:allow-print", + "window:allow-set-icon", + "window:allow-toggle-maximize", + "menu:allow-new", + "menu:allow-append", + "menu:allow-prepend", + "menu:allow-insert", + "menu:allow-remove", + "menu:allow-remove-at", + "menu:allow-items", + "menu:allow-get", + "menu:allow-popup", + "menu:allow-create-default", + "menu:allow-set-as-app-menu", + "menu:allow-set-as-window-menu", + "menu:allow-text", + "menu:allow-set-text", + "menu:allow-is-enabled", + "menu:allow-set-enabled", + "menu:allow-set-accelerator", + "menu:allow-set-as-windows-menu-for-nsapp", + "menu:allow-set-as-help-menu-for-nsapp", + "menu:allow-is-checked", + "menu:allow-set-checked", + "menu:allow-set-icon", + "tray:allow-new", + "tray:allow-set-icon", + "tray:allow-set-menu", + "tray:allow-set-tooltip", + "tray:allow-set-title", + "tray:allow-set-visible", + "tray:allow-set-temp-dir-path", + "tray:allow-set-icon-as-template", + "tray:allow-set-show-menu-on-left-click" + ] +} \ No newline at end of file diff --git a/examples/api/src-tauri/tauri-plugin-sample/Cargo.toml b/examples/api/src-tauri/tauri-plugin-sample/Cargo.toml index 41c002a1a098..4d3131b6aba0 100644 --- a/examples/api/src-tauri/tauri-plugin-sample/Cargo.toml +++ b/examples/api/src-tauri/tauri-plugin-sample/Cargo.toml @@ -12,3 +12,4 @@ thiserror = "1" [build-dependencies] tauri-build = { path = "../../../../core/tauri-build/" } +tauri-plugin = { path = "../../../../core/tauri-plugin", features = ["build"] } diff --git a/examples/api/src-tauri/tauri-plugin-sample/build.rs b/examples/api/src-tauri/tauri-plugin-sample/build.rs index 35bb9b5a57cc..64afa2311a22 100644 --- a/examples/api/src-tauri/tauri-plugin-sample/build.rs +++ b/examples/api/src-tauri/tauri-plugin-sample/build.rs @@ -4,6 +4,8 @@ use std::process::exit; +const COMMANDS: &[&str] = &["ping"]; + fn main() { if let Err(error) = tauri_build::mobile::PluginBuilder::new() .android_path("android") @@ -13,4 +15,6 @@ fn main() { println!("{error:#}"); exit(1); } + + tauri_plugin::Builder::new(COMMANDS).build(); } diff --git a/examples/api/src-tauri/tauri-plugin-sample/permissions/.gitignore b/examples/api/src-tauri/tauri-plugin-sample/permissions/.gitignore new file mode 100644 index 000000000000..9fe3b17f12ec --- /dev/null +++ b/examples/api/src-tauri/tauri-plugin-sample/permissions/.gitignore @@ -0,0 +1 @@ +.schema.json diff --git a/examples/api/src-tauri/tauri-plugin-sample/permissions/autogenerated/commands/ping.toml b/examples/api/src-tauri/tauri-plugin-sample/permissions/autogenerated/commands/ping.toml new file mode 100644 index 000000000000..7a6387ec69c5 --- /dev/null +++ b/examples/api/src-tauri/tauri-plugin-sample/permissions/autogenerated/commands/ping.toml @@ -0,0 +1,13 @@ +# Automatically generated - DO NOT EDIT! + +"$schema" = "../../.schema.json" + +[[permission]] +identifier = "allow-ping" +description = "Enables the ping command without any pre-configured scope." +commands.allow = ["ping"] + +[[permission]] +identifier = "deny-ping" +description = "Denies the ping command without any pre-configured scope." +commands.deny = ["ping"] diff --git a/examples/api/src-tauri/tauri-plugin-sample/permissions/global-scope.toml b/examples/api/src-tauri/tauri-plugin-sample/permissions/global-scope.toml new file mode 100644 index 000000000000..197422645b6d --- /dev/null +++ b/examples/api/src-tauri/tauri-plugin-sample/permissions/global-scope.toml @@ -0,0 +1,7 @@ +"$schema" = ".schema.json" + +[[permission]] +identifier = "global-scope" +description = "Sets a global scope." +[[permission.scope.allow]] +path = "global" diff --git a/examples/api/src-tauri/tauri-plugin-sample/permissions/ping-scoped.toml b/examples/api/src-tauri/tauri-plugin-sample/permissions/ping-scoped.toml new file mode 100644 index 000000000000..70205ac1e002 --- /dev/null +++ b/examples/api/src-tauri/tauri-plugin-sample/permissions/ping-scoped.toml @@ -0,0 +1,8 @@ +"$schema" = ".schema.json" + +[[permission]] +identifier = "allow-ping-scoped" +description = "Enables the ping command with a test scope." +commands.allow = ["ping"] +[[permission.scope.allow]] +path = "x" diff --git a/examples/api/src-tauri/tauri-plugin-sample/src/lib.rs b/examples/api/src-tauri/tauri-plugin-sample/src/lib.rs index 39b2d9a3f5c9..72e5cd8096bc 100644 --- a/examples/api/src-tauri/tauri-plugin-sample/src/lib.rs +++ b/examples/api/src-tauri/tauri-plugin-sample/src/lib.rs @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +use serde::Deserialize; +use std::path::PathBuf; use tauri::{ plugin::{Builder, TauriPlugin}, Manager, Runtime, @@ -35,6 +37,36 @@ impl> crate::SampleExt for T { } } +#[allow(dead_code)] +#[derive(Debug, Deserialize)] +struct PingScope { + path: PathBuf, +} + +#[allow(dead_code)] +#[derive(Debug, Deserialize)] +struct SampleScope { + path: PathBuf, +} + +#[tauri::command] +fn ping( + app: tauri::AppHandle, + value: Option, + scope: tauri::command::CommandScope, + global_scope: tauri::command::GlobalScope, +) -> std::result::Result { + println!("local scope {:?}", scope); + println!("global scope {:?}", global_scope); + app + .sample() + .ping(PingRequest { + value, + on_event: tauri::ipc::Channel::new(|_| Ok(())), + }) + .map_err(|e| e.to_string()) +} + pub fn init() -> TauriPlugin { Builder::new("sample") .setup(|app, api| { @@ -46,6 +78,7 @@ pub fn init() -> TauriPlugin { Ok(()) }) + .invoke_handler(tauri::generate_handler![ping]) .on_navigation(|window, url| { println!("navigation {} {url}", window.label()); true diff --git a/examples/api/src-tauri/tauri-plugin-sample/src/models.rs b/examples/api/src-tauri/tauri-plugin-sample/src/models.rs index 3c824a58912c..02db95608c7e 100644 --- a/examples/api/src-tauri/tauri-plugin-sample/src/models.rs +++ b/examples/api/src-tauri/tauri-plugin-sample/src/models.rs @@ -12,7 +12,7 @@ pub struct PingRequest { pub on_event: Channel, } -#[derive(Debug, Clone, Default, Deserialize)] +#[derive(Debug, Clone, Default, Deserialize, Serialize)] pub struct PingResponse { pub value: Option, } diff --git a/examples/api/src/views/Window.svelte b/examples/api/src/views/Window.svelte index 7e31d7f4f8d3..8e5474320353 100644 --- a/examples/api/src/views/Window.svelte +++ b/examples/api/src/views/Window.svelte @@ -79,7 +79,9 @@ (state) => EffectState[state] ) - const progressBarStatusOptions = Object.keys(ProgressBarStatus).map(s => ProgressBarStatus[s]) + const progressBarStatusOptions = Object.keys(ProgressBarStatus).map( + (s) => ProgressBarStatus[s] + ) export let onMessage const mainEl = document.querySelector('main') @@ -152,8 +154,9 @@ function createWindow() { if (!newWindowLabel) return - const webview = new Window(newWindowLabel) - windowMap[newWindowLabel] = webview + const label = `main-${newWindowLabel}` + const webview = new Window(label) + windowMap[label] = webview webview.once('tauri://error', function () { onMessage('Error creating new webview') }) @@ -282,7 +285,10 @@ new PhysicalPosition(cursorX, cursorY) ) $: windowMap[selectedWindow]?.setIgnoreCursorEvents(cursorIgnoreEvents) - $: windowMap[selectedWindow]?.setProgressBar({ status: selectedProgressBarStatus, progress }) + $: windowMap[selectedWindow]?.setProgressBar({ + status: selectedProgressBarStatus, + progress + })
@@ -310,7 +316,11 @@
- +
@@ -557,7 +567,13 @@
diff --git a/examples/plugins/tauri-plugin-example/.gitignore b/examples/plugins/tauri-plugin-example/.gitignore new file mode 100644 index 000000000000..ea8c4bf7f35f --- /dev/null +++ b/examples/plugins/tauri-plugin-example/.gitignore @@ -0,0 +1 @@ +/target diff --git a/examples/plugins/tauri-plugin-example/Cargo.lock b/examples/plugins/tauri-plugin-example/Cargo.lock new file mode 100644 index 000000000000..78a672832769 --- /dev/null +++ b/examples/plugins/tauri-plugin-example/Cargo.lock @@ -0,0 +1,3622 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "atk" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4af014b17dd80e8af9fa689b2d4a211ddba6eb583c1622f35d0cb543f6b17e4" +dependencies = [ + "atk-sys", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "251e0b7d90e33e0ba930891a505a9a35ece37b2dd37a14f3ffc306c13b980009" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +dependencies = [ + "serde", +] + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +dependencies = [ + "serde", +] + +[[package]] +name = "cairo-rs" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f33613627f0dea6a731b0605101fad59ba4f193a52c96c4687728d822605a8a1" +dependencies = [ + "bitflags 2.4.1", + "cairo-sys-rs", + "glib", + "libc", + "once_cell", + "thiserror", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cargo_toml" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d1ece59890e746567b467253aea0adbe8a21784d0b025d8a306f66c391c2957" +dependencies = [ + "serde", + "toml 0.8.8", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +dependencies = [ + "byteorder", + "fnv", + "uuid", +] + +[[package]] +name = "cfg-expr" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "serde", + "windows-targets 0.48.5", +] + +[[package]] +name = "cocoa" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" +dependencies = [ + "bitflags 1.3.2", + "block", + "cocoa-foundation", + "core-foundation", + "core-graphics", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-foundation", + "core-graphics-types", + "libc", + "objc", +] + +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "core-graphics" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "970a29baf4110c26fedbc7f82107d42c23f7e88e404c4577ed73fe99ff85a212" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bb142d41022986c1d8ff29103a1411c8a3dfad3552f87a4f8dc50d61d4f4e33" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cssparser" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa 0.4.8", + "matches", + "phf 0.8.0", + "proc-macro2", + "quote", + "smallvec", + "syn 1.0.109", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +dependencies = [ + "quote", + "syn 2.0.39", +] + +[[package]] +name = "ctor" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37e366bff8cd32dd8754b0991fb66b279dc48f598c3a18914852a6673deef583" +dependencies = [ + "quote", + "syn 2.0.39", +] + +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.39", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "deranged" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dtoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" + +[[package]] +name = "dtoa-short" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbaceec3c6e4211c79e7b1800fb9680527106beb2f9c51904a3210c03a448c74" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + +[[package]] +name = "dyn-clone" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" + +[[package]] +name = "embed-resource" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f54cc3e827ee1c3812239a9a41dede7b4d7d5d5464faa32d71bd7cba28ce2cb2" +dependencies = [ + "cc", + "rustc_version", + "toml 0.8.8", + "vswhom", + "winreg 0.51.0", +] + +[[package]] +name = "embed_plist" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "fdeflate" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + +[[package]] +name = "futures-channel" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" + +[[package]] +name = "futures-executor" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" + +[[package]] +name = "futures-macro" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "futures-sink" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" + +[[package]] +name = "futures-task" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" + +[[package]] +name = "futures-util" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "gdk" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5ba081bdef3b75ebcdbfc953699ed2d7417d6bd853347a42a37d76406a33646" +dependencies = [ + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "446f32b74d22c33b7b258d4af4ffde53c2bf96ca2e29abdf1a785fe59bd6c82c" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", + "once_cell", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gdk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31ff856cb3386dae1703a920f803abafcc580e9b5f711ca62ed1620c25b51ff2" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + +[[package]] +name = "generator" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows 0.48.0", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "gio" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d809baf02bdf1b5ef4ad3bf60dd9d4977149db4612b7bbb58e56aef168193b" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys", + "glib", + "libc", + "once_cell", + "pin-project-lite", + "smallvec", + "thiserror", +] + +[[package]] +name = "gio-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "winapi", +] + +[[package]] +name = "glib" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cf801b6f7829fa76db37449ab67c9c98a2b1bf21076d9113225621e61a0fa6" +dependencies = [ + "bitflags 2.4.1", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "once_cell", + "smallvec", + "thiserror", +] + +[[package]] +name = "glib-macros" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72793962ceece3863c2965d7f10c8786323b17c7adea75a515809fa20ab799a5" +dependencies = [ + "heck", + "proc-macro-crate 2.0.0", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "glib-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "gobject-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gtk" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93c4f5e0e20b60e10631a5f06da7fe3dda744b05ad0ea71fee2f47adf865890c" +dependencies = [ + "atk", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771437bf1de2c1c0b496c11505bdf748e26066bbe942dfc8f614c9460f6d7722" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "gtk3-macros" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6063efb63db582968fb7df72e1ae68aa6360dcfb0a75143f34fc7d616bad75e" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "h2" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.1.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "html5ever" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7" +dependencies = [ + "log", + "mac", + "markup5ever", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "http" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa 1.0.9", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa 1.0.9", + "pin-project-lite", + "socket2 0.4.10", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core 0.51.1", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ico" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3804960be0bb5e4edb1e1ad67afd321a9ecfd875c3e65c099468fd2717d7cae" +dependencies = [ + "byteorder", + "png", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", + "serde", +] + +[[package]] +name = "infer" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb33622da908807a06f9513c19b3c1ad50fab3e4137d82a78107d502075aa199" +dependencies = [ + "cfb", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "javascriptcore-rs" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" +dependencies = [ + "bitflags 1.3.2", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "js-sys" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ff1e1486799e3f64129f8ccad108b38290df9cd7015cd31bed17239f0789d6" +dependencies = [ + "serde", + "serde_json", + "thiserror", + "treediff", +] + +[[package]] +name = "keyboard-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" +dependencies = [ + "bitflags 2.4.1", + "serde", + "unicode-segmentation", +] + +[[package]] +name = "kuchikiki" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e4755b7b995046f510a7520c42b2fed58b77bd94d5a87a8eb43d2fd126da8" +dependencies = [ + "cssparser", + "html5ever", + "indexmap 1.9.3", + "matches", + "selectors", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" + +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall", +] + +[[package]] +name = "line-wrap" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" +dependencies = [ + "safemem", +] + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "markup5ever" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016" +dependencies = [ + "log", + "phf 0.10.1", + "phf_codegen 0.10.0", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "memchr" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "muda" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b564d551449738387fb4541aef5fbfceaa81b2b732f2534c1c7c89dc7d673eaa" +dependencies = [ + "cocoa", + "crossbeam-channel", + "gtk", + "keyboard-types", + "objc", + "once_cell", + "png", + "serde", + "thiserror", + "windows-sys 0.52.0", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "pango" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" +dependencies = [ + "gio", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +dependencies = [ + "phf_macros 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", +] + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_shared 0.10.0", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros 0.11.2", + "phf_shared 0.11.2", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", +] + +[[package]] +name = "phf_codegen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +dependencies = [ + "phf_shared 0.8.0", + "rand 0.7.3", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared 0.10.0", + "rand 0.8.5", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator 0.11.2", + "phf_shared 0.11.2", + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "plist" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" +dependencies = [ + "base64", + "indexmap 2.1.0", + "line-wrap", + "quick-xml", + "serde", + "time", +] + +[[package]] +name = "png" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.7", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-xml" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.11", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "raw-window-handle" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +dependencies = [ + "getrandom 0.2.11", + "libredox", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "system-configuration", + "tokio", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "winreg 0.50.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schemars" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", + "url", +] + +[[package]] +name = "schemars_derive" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 1.0.109", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "selectors" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" +dependencies = [ + "bitflags 1.3.2", + "cssparser", + "derive_more", + "fxhash", + "log", + "matches", + "phf 0.8.0", + "phf_codegen 0.8.0", + "precomputed-hash", + "servo_arc", + "smallvec", + "thin-slice", +] + +[[package]] +name = "semver" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "serde_derive_internals" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "serde_json" +version = "1.0.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +dependencies = [ + "itoa 1.0.9", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "serde_spanned" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa 1.0.9", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" +dependencies = [ + "base64", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.1.0", + "serde", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "serialize-to-javascript" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9823f2d3b6a81d98228151fdeaf848206a7855a7a042bbf9bf870449a66cafb" +dependencies = [ + "serde", + "serde_json", + "serialize-to-javascript-impl", +] + +[[package]] +name = "serialize-to-javascript-impl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "servo_arc" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432" +dependencies = [ + "nodrop", + "stable_deref_trait", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "soup3" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" +dependencies = [ + "futures-channel", + "gio", + "glib", + "libc", + "soup3-sys", +] + +[[package]] +name = "soup3-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "state" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" +dependencies = [ + "loom", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared 0.10.0", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro2", + "quote", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "swift-rs" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bbdb58577b6301f8d17ae2561f32002a5bae056d444e0f69e611e504a276204" +dependencies = [ + "base64", + "serde", + "serde_json", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "system-deps" +version = "6.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2d580ff6a20c55dfb86be5f9c238f67835d0e81cbdea8bf5680e0897320331" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml 0.8.8", + "version-compare", +] + +[[package]] +name = "target-lexicon" +version = "0.12.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" + +[[package]] +name = "tauri" +version = "2.0.0-alpha.21" +dependencies = [ + "anyhow", + "bytes", + "cocoa", + "dirs-next", + "embed_plist", + "futures-util", + "getrandom 0.2.11", + "glob", + "gtk", + "heck", + "http", + "jni", + "libc", + "log", + "mime", + "muda", + "objc", + "percent-encoding", + "raw-window-handle", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "serialize-to-javascript", + "state", + "static_assertions", + "swift-rs", + "tauri-build", + "tauri-macros", + "tauri-runtime", + "tauri-utils", + "thiserror", + "tokio", + "url", + "webkit2gtk", + "webview2-com", + "window-vibrancy", + "windows 0.52.0", +] + +[[package]] +name = "tauri-build" +version = "2.0.0-alpha.14" +dependencies = [ + "anyhow", + "cargo_toml", + "dirs-next", + "glob", + "heck", + "json-patch", + "plist", + "schemars", + "semver", + "serde", + "serde_json", + "swift-rs", + "tauri-utils", + "tauri-winres", + "toml 0.8.8", + "walkdir", +] + +[[package]] +name = "tauri-codegen" +version = "2.0.0-alpha.13" +dependencies = [ + "base64", + "ico", + "json-patch", + "plist", + "png", + "proc-macro2", + "quote", + "semver", + "serde", + "serde_json", + "sha2", + "tauri-utils", + "thiserror", + "time", + "url", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-macros" +version = "2.0.0-alpha.13" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.39", + "tauri-codegen", + "tauri-utils", +] + +[[package]] +name = "tauri-plugin" +version = "0.1.0" +dependencies = [ + "cargo_metadata", + "glob", + "serde", + "serde_json", + "tauri", + "tauri-utils", + "toml 0.8.8", +] + +[[package]] +name = "tauri-plugin-example" +version = "0.1.0" +dependencies = [ + "tauri-plugin", +] + +[[package]] +name = "tauri-runtime" +version = "1.0.0-alpha.8" +dependencies = [ + "gtk", + "http", + "jni", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror", + "url", + "windows 0.52.0", +] + +[[package]] +name = "tauri-utils" +version = "2.0.0-alpha.13" +dependencies = [ + "cargo_metadata", + "ctor", + "dunce", + "glob", + "heck", + "html5ever", + "infer", + "json-patch", + "kuchikiki", + "log", + "memchr", + "phf 0.11.2", + "proc-macro2", + "quote", + "schemars", + "semver", + "serde", + "serde_json", + "serde_with", + "thiserror", + "toml 0.8.8", + "url", + "walkdir", +] + +[[package]] +name = "tauri-winres" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5993dc129e544393574288923d1ec447c857f3f644187f4fbf7d9a875fbfc4fb" +dependencies = [ + "embed-resource", + "toml 0.7.8", +] + +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + +[[package]] +name = "thin-slice" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" + +[[package]] +name = "thiserror" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +dependencies = [ + "deranged", + "itoa 1.0.9", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2 0.5.5", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.15", +] + +[[package]] +name = "toml" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.21.0", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.1.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap 2.1.0", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap 2.1.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "treediff" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52984d277bdf2a751072b5df30ec0377febdb02f7696d64c2d7d54630bac4303" +dependencies = [ + "serde_json", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "uuid" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" +dependencies = [ + "getrandom 0.2.11", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "version-compare" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b17ae1f6c8a2b28506cd96d412eebf83b4a0ff2cbefeeb952f2f9dfa44ba18" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.39", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" + +[[package]] +name = "wasm-streams" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webkit2gtk" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76b1bc1e54c581da1e9f179d0b38512ba358fb1af2d634a1affe42e37172361a" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup3", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62daa38afc514d1f8f12b8693d30d5993ff77ced33ce30cd04deebc267a6d57c" +dependencies = [ + "bitflags 1.3.2", + "cairo-sys-rs", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pkg-config", + "soup3-sys", + "system-deps", +] + +[[package]] +name = "webview2-com" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ae9c7e420783826cf769d2c06ac9ba462f450eca5893bb8c6c6529a4e5dd33" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows 0.52.0", + "windows-core 0.52.0", + "windows-implement", + "windows-interface", +] + +[[package]] +name = "webview2-com-macros" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "webview2-com-sys" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6ad85fceee6c42fa3d61239eba5a11401bf38407a849ed5ea1b407df08cca72" +dependencies = [ + "thiserror", + "windows 0.52.0", + "windows-core 0.52.0", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "window-vibrancy" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af6abc2b9c56bd95887825a1ce56cde49a2a97c07e28db465d541f5098a2656c" +dependencies = [ + "cocoa", + "objc", + "raw-window-handle", + "windows-sys 0.52.0", + "windows-version", +] + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core 0.52.0", + "windows-implement", + "windows-interface", + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-implement" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12168c33176773b86799be25e2a2ba07c7aab9968b37541f1094dbd7a60c8946" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "windows-interface" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d8dc32e0095a7eeccebd0e3f09e9509365ecb3fc6ac4d6f5f14a3f6392942d1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows-version" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75aa004c988e080ad34aff5739c39d0312f4684699d6d71fc8a198d057b8b9b4" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winnow" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "winreg" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "937f3df7948156640f46aacef17a70db0de5917bda9c92b0f751f3a955b588fc" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] diff --git a/examples/plugins/tauri-plugin-example/Cargo.toml b/examples/plugins/tauri-plugin-example/Cargo.toml new file mode 100644 index 000000000000..334b8070f521 --- /dev/null +++ b/examples/plugins/tauri-plugin-example/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "tauri-plugin-example" +version = "0.1.0" +edition = "2021" +links = "tauri-plugin-example" + +[build-dependencies] +tauri-plugin = { path = "../../../core/tauri-plugin", features = ["build"] } + +[dependencies] +tauri-plugin = { path = "../../../core/tauri-plugin" } diff --git a/examples/plugins/tauri-plugin-example/build.rs b/examples/plugins/tauri-plugin-example/build.rs new file mode 100644 index 000000000000..d5d61c7b2591 --- /dev/null +++ b/examples/plugins/tauri-plugin-example/build.rs @@ -0,0 +1,9 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +const COMMANDS: &[&str] = &[]; + +fn main() { + tauri_plugin::Builder::new(COMMANDS).build() +} diff --git a/examples/plugins/tauri-plugin-example/permissions/.gitignore b/examples/plugins/tauri-plugin-example/permissions/.gitignore new file mode 100644 index 000000000000..9fe3b17f12ec --- /dev/null +++ b/examples/plugins/tauri-plugin-example/permissions/.gitignore @@ -0,0 +1 @@ +.schema.json diff --git a/examples/plugins/tauri-plugin-example/permissions/home-config.toml b/examples/plugins/tauri-plugin-example/permissions/home-config.toml new file mode 100644 index 000000000000..52fff8928234 --- /dev/null +++ b/examples/plugins/tauri-plugin-example/permissions/home-config.toml @@ -0,0 +1,9 @@ +"$schema" = ".schema.json" + +[[permission]] +version = 1 +identifier = "deny-home-dir-config" +description = "Denies read access to the complete $HOME folder." + +[[scope.deny]] +path = "$HOME/.config" diff --git a/examples/plugins/tauri-plugin-example/permissions/home-dir.toml b/examples/plugins/tauri-plugin-example/permissions/home-dir.toml new file mode 100644 index 000000000000..1698107a14af --- /dev/null +++ b/examples/plugins/tauri-plugin-example/permissions/home-dir.toml @@ -0,0 +1,10 @@ +"$schema" = ".schema.json" + +[[permission]] +version = 1 +identifier = "allow-home-dir" +description = "Allows read access to the complete $HOME folder." +commands.allow = ["readDirectory", "readFile"] + +[[scope.allow]] +path = "$HOME/**" diff --git a/examples/plugins/tauri-plugin-example/permissions/set.toml b/examples/plugins/tauri-plugin-example/permissions/set.toml new file mode 100644 index 000000000000..9b36a41d165d --- /dev/null +++ b/examples/plugins/tauri-plugin-example/permissions/set.toml @@ -0,0 +1,15 @@ +"$schema" = ".schema.json" + +[default] +description = "Default permissions granted" +permissions = ["allow-home-read-only"] + +[[set]] +identifier = "allow-full-homefolder-access" +description = "Allows read and write access to the complete $HOME folder." +permissions = ["allow-home-read-only", "allow-home-write-only"] + +[[set]] +identifier = "deny-homefolder-config-access" +description = "Denies access to the $HOME/.config folder." +permissions = ["deny-home-dir-config"] diff --git a/examples/plugins/tauri-plugin-example/src/lib.rs b/examples/plugins/tauri-plugin-example/src/lib.rs new file mode 100644 index 000000000000..d23660817c7b --- /dev/null +++ b/examples/plugins/tauri-plugin-example/src/lib.rs @@ -0,0 +1,18 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/tooling/api/src/menu/menu.ts b/tooling/api/src/menu/menu.ts index a4120cbde061..7ede3a98a0cc 100644 --- a/tooling/api/src/menu/menu.ts +++ b/tooling/api/src/menu/menu.ts @@ -82,7 +82,7 @@ export class Menu extends MenuItemBase { /** Create a default menu. */ static async default(): Promise { - return invoke<[number, string]>('plugin:menu|default').then( + return invoke<[number, string]>('plugin:menu|create_default').then( ([rid, id]) => new Menu(rid, id) ) } diff --git a/tooling/cli/schema.json b/tooling/cli/schema.json index ddc1fff4291c..aa64fe31f97b 100644 --- a/tooling/cli/schema.json +++ b/tooling/cli/schema.json @@ -96,7 +96,6 @@ "scope": [] }, "dangerousDisableAssetCspModification": false, - "dangerousRemoteDomainIpcAccess": [], "freezePrototype": false }, "windows": [] @@ -254,7 +253,6 @@ "scope": [] }, "dangerousDisableAssetCspModification": false, - "dangerousRemoteDomainIpcAccess": [], "freezePrototype": false }, "allOf": [ @@ -2227,14 +2225,6 @@ } ] }, - "dangerousRemoteDomainIpcAccess": { - "description": "Allow external domains to send command to Tauri.\n\nBy default, external domains do not have access to `window.__TAURI__`, which means they cannot communicate with the commands defined in Rust. This prevents attacks where an externally loaded malicious or compromised sites could start executing commands on the user's device.\n\nThis configuration allows a set of external domains to have access to the Tauri commands. When you configure a domain to be allowed to access the IPC, all subpaths are allowed. Subdomains are not allowed.\n\n**WARNING:** Only use this option if you either have internal checks against malicious external sites or you can trust the allowed external sites. You application might be vulnerable to dangerous Tauri command related attacks otherwise.", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/RemoteDomainAccessScope" - } - }, "assetProtocol": { "description": "Custom protocol config.", "default": { @@ -2298,43 +2288,6 @@ } ] }, - "RemoteDomainAccessScope": { - "description": "External command access definition.", - "type": "object", - "required": [ - "domain", - "windows" - ], - "properties": { - "scheme": { - "description": "The URL scheme to allow. By default, all schemas are allowed.", - "type": [ - "string", - "null" - ] - }, - "domain": { - "description": "The domain to allow.", - "type": "string" - }, - "windows": { - "description": "The list of window labels this scope applies to.", - "type": "array", - "items": { - "type": "string" - } - }, - "plugins": { - "description": "The list of plugins that are allowed in this scope. The names should be without the `tauri-plugin-` prefix, for example `\"store\"` for `tauri-plugin-store`.", - "default": [], - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - }, "AssetProtocolConfig": { "description": "Config for the asset custom protocol.\n\nSee more: ", "type": "object",