Repository navigation
@tauri-apps/api v2.13.0
PNPM Audit
No known vulnerabilities found
[2.13.0]
New Features
-
9eda95fa0(#8656 by @naman-crabnebula) Add thepacmanbundle target for Arch Linux. It produces a.tar.gzarchive with aPKGBUILDand.SRCINFOready to be published to the AUR; seebundle > linux > pacmanfor the package name (<name>-binby default), release, dependencies, install script, changelog and source options.bundle > licenseFileis installed to/usr/share/licenses/<pkgname>/.The
pacmantarget is part of"all", so Linux builds that bundle all targets now also produce the pacman package; list the targets explicitly inbundle > targetsto opt out. -
d267da039(#16375 by @spokodev) AddedPhysicalSize.round,PhysicalPosition.round,LogicalSize.roundandLogicalPosition.round, which round to whole pixels the same way Rust does, for examplenew LogicalSize(301, 201).toPhysical(1.5).round(). APIs that take aSizeorPosition, such asWindow.setSizeandWindow.setPosition, only accept whole physical pixels. -
ab4d547dc(#16652 by @lucasfernog) Added iOS support forWindow::set_badge_count,WebviewWindow::set_badge_countand the JavaScriptWindow#setBadgeCount, which sets the app icon badge. They were only available on desktop: the methods were desktop-only and the window plugin only registered theset_badge_countcommand there. They are now available on mobile too (a no-op on Android). -
740a270c6(#14289 by @lucasfernog) AddedonNewWindowoption to configure whether to allow the webview to open URLs whenwindow.openis used. -
05afd6e12(#16175 by @amrbashir) Add more predefined menu itemsPredefinedMenuItem::section_header,paste_and_match_style,delete,zoom(an alias formaximize, named after the macOS window action),actual_size,zoom_in,zoom_out,start_speaking,stop_speaking,start_dictationandemoji_and_symbols. They are also available in JavaScript as theSectionHeader,PasteAndMatchStyle,Delete,Zoom,ActualSize,ZoomIn,ZoomOut,StartSpeaking,StopSpeaking,StartDictationandEmojiAndSymbolsvalues ofPredefinedMenuItemOptions.item. -
d03f76daf(#16054 by @jhasheng) AddAppHandle::fetch_profile_identifiersandAppHandle::remove_profile, and thefetchProfileIdentifiersandremoveProfileJS functions, to list and delete the browsing data profiles created withprofile_identifieron macOS, iOS and Windows. -
d03f76daf(#16054 by @jhasheng) AddWebviewBuilder::profile_identifier,WebviewWindowBuilder::profile_identifier, theprofileIdentifierwindow config option and theprofileIdentifierJS webview option to isolate a webview's browsing data. On macOS and iOS it maps to aWKWebsiteDataStoreidentifier, 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) AddedPathResolver::resolve_external_binand theresolveExternalBinpath API to resolve the path to a sidecar binary configured inbundle > externalBin. -
89bb3c82f(#16179 by @amrbashir) AddTrayIconBuilder::autosave_name(theautosaveNameoption of the JavaScriptTrayIcon.new), which setsNSStatusItem.autosaveNameon 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 theapp > trayIcon > iconIsTemplateconfiguration option and the matchingiconIsTemplateoption of the JavaScriptTrayIcon.new, which draw the configured tray icon as a template image on macOS.Deprecate the previous
iconAsTemplatenames (TrayIconConfig::icon_as_templatein Rust) in favour of them. Both names keep working, and either one set totruedraws the icon as a template. -
2d6b0e572(#16176 by @amrbashir) AddTrayIconBuilder::icon_templatedandTrayIcon::set_icon_templated(TrayIcon.setIconTemplatedin 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 addTrayIcon::icon_is_templateto read that state back.Deprecate
TrayIconBuilder::icon_as_template,TrayIcon::set_icon_as_template(TrayIcon.setIconAsTemplatein JavaScript) andTrayIcon::set_icon_with_as_template(TrayIcon.setIconWithAsTemplatein JavaScript) in favour of them. -
d2b5ef751(#16177 by @amrbashir) AddTrayIconBuilder::native_iconandTrayIcon::set_native_icon(thenativeIconoption of the JavaScriptTrayIcon.newandTrayIcon.setNativeIcon), to use a platform-native icon such asNativeIcon::StatusAvailablefor 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) AddTrayIconBuilder::show_menu_on_right_clickandTrayIcon::set_show_menu_on_right_click(theshowMenuOnRightClickoption of the JavaScriptTrayIcon.newandTrayIcon.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) AddTrayIcon::show_menu(TrayIcon.showMenuin JavaScript), which shows the tray menu at the current cursor position, so an app that disabledshowMenuOnLeftClickandshowMenuOnRightClickcan decide when the menu shows up, for instance after updating its items.
Enhancements
1c8ab0375(#16181 by @amrbashir)IconMenuItem::set_native_iconandSubmenu::set_native_iconare no longer macOS-only. KnownNativeIconvariants now map to freedesktop icon names on Linux and stock shell icons on Windows, the same asTrayIcon::set_native_icon.
What's Changed
d03f76daf(#16054 by @jhasheng) Deprecate the macOS / iOS onlyWebviewBuilder::data_store_identifier,WebviewWindowBuilder::data_store_identifier, thedataStoreIdentifierwindow config option and thedataStoreIdentifierJS webview option in favor ofprofile_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 onlyAppHandle::fetch_data_store_identifiers,AppHandle::remove_data_store,fetchDataStoreIdentifiersandremoveDataStorein favor ofAppHandle::fetch_profile_identifiers,AppHandle::remove_profile,fetchProfileIdentifiersandremoveProfile.
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