github tauri-apps/tauri @tauri-apps/api-v2.13.0
@tauri-apps/api v2.13.0

PNPM Audit

No known vulnerabilities found

[2.13.0]

New Features

  • 9eda95fa0 (#8656 by @naman-crabnebula) Add the pacman bundle target for Arch Linux. It produces a .tar.gz archive with a PKGBUILD and .SRCINFO ready to be published to the AUR; see bundle > linux > pacman for the package name (<name>-bin by default), release, dependencies, install script, changelog and source options. bundle > licenseFile is installed to /usr/share/licenses/<pkgname>/.

    The pacman target is part of "all", so Linux builds that bundle all targets now also produce the pacman package; list the targets explicitly in bundle > targets to opt out.

  • d267da039 (#16375 by @spokodev) Added PhysicalSize.round, PhysicalPosition.round, LogicalSize.round and LogicalPosition.round, which round to whole pixels the same way Rust does, for example new LogicalSize(301, 201).toPhysical(1.5).round(). APIs that take a Size or Position, such as Window.setSize and Window.setPosition, only accept whole physical pixels.

  • ab4d547dc (#16652 by @lucasfernog) Added iOS support for Window::set_badge_count, WebviewWindow::set_badge_count and the JavaScript Window#setBadgeCount, which sets the app icon badge. They were only available on desktop: the methods were desktop-only and the window plugin only registered the set_badge_count command there. They are now available on mobile too (a no-op on Android).

  • 740a270c6 (#14289 by @lucasfernog) Added onNewWindow option to configure whether to allow the webview to open URLs when window.open is used.

  • 05afd6e12 (#16175 by @amrbashir) Add more predefined menu items PredefinedMenuItem::section_header, paste_and_match_style, delete, zoom (an alias for maximize, named after the macOS window action), actual_size, zoom_in, zoom_out, start_speaking, stop_speaking, start_dictation and emoji_and_symbols. They are also available in JavaScript as the SectionHeader, PasteAndMatchStyle, Delete, Zoom, ActualSize, ZoomIn, ZoomOut, StartSpeaking, StopSpeaking, StartDictation and EmojiAndSymbols values of PredefinedMenuItemOptions.item.

  • d03f76daf (#16054 by @jhasheng) Add AppHandle::fetch_profile_identifiers and AppHandle::remove_profile, and the fetchProfileIdentifiers and removeProfile JS functions, to list and delete the browsing data profiles created with profile_identifier on macOS, iOS and Windows.

  • d03f76daf (#16054 by @jhasheng) Add WebviewBuilder::profile_identifier, WebviewWindowBuilder::profile_identifier, the profileIdentifier window config option and the profileIdentifier JS webview option to isolate a webview's browsing data. On macOS and iOS it maps to a WKWebsiteDataStore identifier, and on Windows to a WebView2 named profile, so webviews sharing a data directory get isolated cookies and storage while still sharing a single browser process.

  • ecab48cc1 (#16265 by @lucasfernog) Added PathResolver::resolve_external_bin and the resolveExternalBin path API to resolve the path to a sidecar binary configured in bundle > externalBin.

  • 89bb3c82f (#16179 by @amrbashir) Add TrayIconBuilder::autosave_name (the autosaveName option of the JavaScript TrayIcon.new), which sets NSStatusItem.autosaveName on macOS. macOS already restores where the user Cmd+dragged a tray icon on the next launch, keyed by the order in which the app created its tray icons (Item-0, Item-1, and so on); an autosave name replaces that generated key with a stable one, so an app that creates several tray icons, or that creates one conditionally, doesn't have icons come back holding each other's positions.

  • 2d6b0e572 (#16176 by @amrbashir) Add the app > trayIcon > iconIsTemplate configuration option and the matching iconIsTemplate option of the JavaScript TrayIcon.new, which draw the configured tray icon as a template image on macOS.

    Deprecate the previous iconAsTemplate names (TrayIconConfig::icon_as_template in Rust) in favour of them. Both names keep working, and either one set to true draws the icon as a template.

  • 2d6b0e572 (#16176 by @amrbashir) Add TrayIconBuilder::icon_templated and TrayIcon::set_icon_templated (TrayIcon.setIconTemplated in JavaScript), which set the tray icon and draw it as a template image in one call, so the template flag can never be left describing an icon that has since been replaced. Also add TrayIcon::icon_is_template to read that state back.

    Deprecate TrayIconBuilder::icon_as_template, TrayIcon::set_icon_as_template (TrayIcon.setIconAsTemplate in JavaScript) and TrayIcon::set_icon_with_as_template (TrayIcon.setIconWithAsTemplate in JavaScript) in favour of them.

  • d2b5ef751 (#16177 by @amrbashir) Add TrayIconBuilder::native_icon and TrayIcon::set_native_icon (the nativeIcon option of the JavaScript TrayIcon.new and TrayIcon.setNativeIcon), to use a platform-native icon such as NativeIcon::StatusAvailable for the tray icon. Known variants map to freedesktop icon names on Linux, AppKit image names on macOS and stock shell icons on Windows, so the icon follows the system theme instead of being shipped with the app.

  • 9d4d3caac (#16178 by @amrbashir) Add TrayIconBuilder::show_menu_on_right_click and TrayIcon::set_show_menu_on_right_click (the showMenuOnRightClick option of the JavaScript TrayIcon.new and TrayIcon.setShowMenuOnRightClick), to stop the menu from showing on right click, the same way it can already be disabled for left click.

  • 9d4d3caac (#16178 by @amrbashir) Add TrayIcon::show_menu (TrayIcon.showMenu in JavaScript), which shows the tray menu at the current cursor position, so an app that disabled showMenuOnLeftClick and showMenuOnRightClick can decide when the menu shows up, for instance after updating its items.

Enhancements

  • 1c8ab0375 (#16181 by @amrbashir) IconMenuItem::set_native_icon and Submenu::set_native_icon are no longer macOS-only. Known NativeIcon variants now map to freedesktop icon names on Linux and stock shell icons on Windows, the same as TrayIcon::set_native_icon.

What's Changed

  • d03f76daf (#16054 by @jhasheng) Deprecate the macOS / iOS only WebviewBuilder::data_store_identifier, WebviewWindowBuilder::data_store_identifier, the dataStoreIdentifier window config option and the dataStoreIdentifier JS webview option in favor of profile_identifier / profileIdentifier. They are not applied on Windows, so apps that already set them keep using the default WebView2 profile.
  • d03f76daf (#16054 by @jhasheng) Deprecate the macOS / iOS only AppHandle::fetch_data_store_identifiers, AppHandle::remove_data_store, fetchDataStoreIdentifiers and removeDataStore in favor of AppHandle::fetch_profile_identifiers, AppHandle::remove_profile, fetchProfileIdentifiers and removeProfile.

PNPM Publish

$ pnpm build && cd ./dist && pnpm publish --access public --loglevel debug --no-git-checks
$ rollup -c --configPlugin typescript
�[36m
�[1msrc/app.ts, src/core.ts, src/dpi.ts, src/event.ts, src/image.ts, src/index.ts, src/menu.ts, src/mocks.ts, src/path.ts, src/tray.ts, src/webview.ts, src/webviewWindow.ts, src/window.ts�[22m → �[1m./dist, ./dist�[22m...�[39m
�[32mcreated �[1m./dist, ./dist�[22m in �[1m847ms�[22m�[39m
�[36m
�[1msrc/index.ts�[22m → �[1m../../crates/tauri/scripts/bundle.global.js�[22m...�[39m
�[32mcreated �[1m../../crates/tauri/scripts/bundle.global.js�[22m in �[1m995ms�[22m�[39m
GET https://run-actions-2-azure-eastus.actions.githubusercontent.com/212//idtoken/e0c09b81-88c9-83d3-8902-fbc2096b430e/c40a0e00-8b86-5037-8b88-09f2e335937d?api-version=2.0&audience=npm%3Aregistry.npmjs.org 200 96ms
📦 @tauri-apps/api@2.13.0 → https://registry.npmjs.org/
GET https://run-actions-2-azure-eastus.actions.githubusercontent.com/212//idtoken/e0c09b81-88c9-83d3-8902-fbc2096b430e/c40a0e00-8b86-5037-8b88-09f2e335937d?api-version=2.0&audience=sigstore 200 53ms
Signed provenance statement with source and build information
✅ Published package @tauri-apps/api@2.13.0

Don't miss a new tauri release

NewReleases is sending notifications on new releases.