be683e2ac (#11199 by @lucasfernog) Publish package with the latest NPM tag.637285790 Promote to v2 stable!9014a3f17 (#11066 by @amrbashir) Add WebviewWindow.clearAllBrowsingData and Webview.clearAllBrowsingData to clear the webview browsing data.95df53a2e (#11143 by @Legend-Master) Add the ability to set theme dynamically using Window.setTheme or setTheme function from the app moduled9d2502b4 (#11140 by @amrbashir) Add Webview.hide and Webview.show methods.de7414aab (#11154 by @amrbashir) Add Window::setEnabled and Window::isEnabled methods948772a65 (#11114 by @lucasfernog) Change the button_state tray event field to camelCase buttonState.0b4495996 (#11121 by @amrbashir) Simplified emitted tray event JS value and updated TrayIconEvent type definition to match it.ddf69157b (#11031 by @amrbashir) Add toPhysical method on LogicalPositon and LogicalSize classes.f81929e25 (#10799 by @lucasfernog) Added PermissionState, checkPermissions and requestPermissions base APIs to the core module, designed for plugin authors to extend.fbe76a955 (#10797 by @lucasfernog) Uint8Arrays and ArrayBuffers are now properly serialized as an array of numbers.f4d5241b3 (#10731 by @amrbashir) Update documentation icon path.c689521a7 (#10681 by @lucasfernog) Fix tslib path in dist.b6dca99ff (#10630 by @lucasfernog) Changed WebviewWindow.getAll, WebviewWindow.getByLabel, getAllWebviewWindows,
Window.getAll, Window.getByLabel, getAllWindows,
Webview.getAll, Webview.getByLabel, getAllWebviews
to be async so their return value are synchronized with the state from the Rust side,
meaning new and destroyed windows are reflected.da25f7353 (#10242 by @amrbashir) Add APIs to enable setting window size constraints separately:
WindowSizeConstraints interface in window and webviewWindow modules.Window.setSizeConstraints and WebviewWindow.setSizeConstraints3c17fb64f (#10277 by @Legend-Master) Fix Webview.reparent pointing to set_webview_focus instead of reparent Rust APIda25f7353 (#10242 by @amrbashir) Apply minWidth, minHieght, maxWidth and maxHeight constraints separately, which fixes a long standing bug where these constraints were never applied unless width and height were constrained together.080b6e127 (#10246 by @Legend-Master) Use EventName on Window, Webview and WebviewWindow's once so you can get auto complete for tauri's built-in events080b6e127 (#10246 by @Legend-Master) Fix once doesn't detached after one callback if event handler throws261c9f942 (#10170 by @amrbashir) Renamed drag and drop events in TauriEvent enum to better convey when they are triggered:
TauriEvent.DRAG -> TauriEvent.DRAG_ENTERTauriEvent.DROP_OVER -> TauriEvent.DRAG_OVERTauriEvent.DROP -> TauriEvent.DRAG_DROPTauriEvent.DROP_CANCELLED -> TauriEvent::DRAG_LEAVEAlso the type field values in Window/Webview/WebviewWindow.onDropEvent and DragDropEvent have changed:
dragged -> enterdragOver -> overdropped -> dropcancelled -> leave2b1ceb40d (#10229 by @amrbashir) Renamed the JS getCurrent and getAll functions to a clearer name to avoid ambiguity:
getCurrent in window module has been renamed to getCurrentWindowgetCurrent in webview module has been renamed to getCurrentWebviewgetCurrent in webviewWindow module has been renamed to getCurrentWebviewWindowgetAll in window module has been renamed to getAllWindowsgetAll in webview module has been renamed to getAllWebviewsgetAll in webviewWindow module has been renamed to getAllWebviewWindows148f04887 (#9979) Add defaultWindowIcon to the JS app module to retrieve the default window icon in JS.c4410daa8(#9777) This release contains breaking changes to the tray event structure because of newly added events:
TrayIconEvent to be an enum instead of a struct.MouseButtonState and MouseButton enums.ClickType enum and replaced it with MouseButton enum.MouseButtonState enum.ec0e092ec(#9770) Add monitorFromPoint function in window module to get the monitor from a given point.be7eab209(#9486) Set the exports > types package.json field.cf615e8e4(#9463) Fixes a bug when processing channel messages out of order.35b25f7e5(#9530) Do not use JS optional chaining to prevent script errors on older webviews such as macOS 10.14.58a7a552d(#9378) Added the set_zoom function to the webview API.58a7a552d(#9378) Add zoom_hotkeys_enabled to enable browser native zoom controls on creating webviews.48a7a78f8(#9376) Fix Window/Webview/WebviewWindow.setSize, Window/Webview/WebviewWindow.setPostion, Window/WebviewWindow.setMinSize, Window/WebviewWindow.setMaxSize, Window/WebviewWindow.setCursorPosition and Menu/Submenu.popup methods failing with invalid args.06833f4fa(#9100) Rename FileDrop to DragDrop on structs, enums and enum variants. Also renamed file_drop to drag_drop on fields and function names.379cc2b35(#9165) Fix basename(path, 'ext') JS API when removing all occurances of ext where it should only remove the last one.ea0242db4(#9179) Image::rgba() now returns Promise<Uint8Array>.ea0242db4(#9179) Removed width and height methods on the JS Image class, use size instead.db0a24a97(#9132) Remove the Image.fromPngBytes and Image.fromIcoBytes APIs. Use Image.fromBytes instead.16e550ec(#8844) Add a new webviewWindow module that exports WebviewWindow class and related methods such as getCurrent and getAll.16e550ec(#8844) Add Window.onFileDropEvent method.16e550ec(#8844) Renamed the following enum variants of TauriEvent enum:
TauriEvent.WEBVIEW_FILE_DROP -> TauriEvent.FILE_DROPTauriEvent.WEBVIEW_FILE_DROP_HOVER -> TauriEvent.FILE_DROP_HOVERTauriEvent.WEBVIEW_FILE_DROP_CANCELLED -> TauriEvent.FILE_DROP_CANCELLED16e550ec(#8844) Move WebviewWindow class from webview module to a new webviewWindow module.
74a2a603(#8661) Implement access control list for IPC usage.a093682d(#8621) Added emitTo api to event module which is equivalent to the rust emit_to method. Also added emitTo method on Window, Webivew and WebviewWindow classes.a2fc3a63(#8657) Add visibleOnAllWorkspaces option when creating the window in JS and Window.setVisibleOnAllWorkspaces method.7f033f6d(#8537) Add Window.startResizeDragging.9eaeb5a8(#8622) Add parent option when creating a window.af610232(#8710) Added Window::destroy to force close a window.c77b4032(#8280) Added support to multiwebview via the new window and webview modules.c77b4032(#8280) Removed event callback's windowLabel.c77b4032(#8280) The event target is now an object so you can target either a window or a webview.c77b4032(#8280) Moved webview-specific APIs from the Window class to the Webview class.c77b4032(#8280) Renamed TauriEvent.WINDOW_FILE_DROP to TauriEvent.WEBVIEW_FILE_DROP, TauriEvent.WINDOW_FILE_DROP_HOVER to TauriEvent.WEBVIEW_FILE_DROP_HOVER and TauriEvent.WINDOW_FILE_DROP_CANCELLED to TauriEvent.WEBVIEW_FILE_DROP_CANCELLED.c77b4032(#8280) Added back the WebviewWindow API that exposes functionality of a window that hosts a single webview. The dedicated Window and Webview types are exposed for multiwebview features.af610232(#8710) Window::close now triggers a close requested event instead of forcing the window to be closed.428ea652(#8370) Exposed Resource class which should be extended for Rust-backed resources created through tauri::Manager::resources_table.ef21b681(#8391) Fix a regression where typescript could not find types when using "moduleResolution": "node"46451aee(#8268) Add top-level main, module and types fields in package.json to be compliant with typescripts's "moduleResolution": "node"f93148ea(#7709) Add tray and menu modules to create and manage tray icons and menus from Javascript.c6c59cf2 Pull changes from Tauri 1.5 release.287066b2(#8071) No longer crashing in tests without mocks when clearMocks is defined in afterEach hook.c1ec0f15(#7933) Added setAlwaysOnBottom function on Window and the alwaysOnBottom option when creating a window.fb10b879(#8039) Add the app module back.ed32257d(#7794) On Windows, add Effect.Tabbed,Effect.TabbedDark and Effect.TabbedLight effects.c9a9246c(#8007) Add the window module back.c085adda(#8009) Added the setProgressBar API on the Window class.a63e71f9(#7942) Changed tauri module to primitives and removed the undocumented invoke export from the root module.e0f0dce2(#6442) Added the windowEffects option when creating a window and setWindowEffects method to change it at runtime.9e3a18e0(#7132) Expose the window target option on event APIs.6d3f3138(#7160) Changed sep and delimiter from path module into functions to fix import in frameworks like next.js4652c446(#7144) Add tempDir function to path module0ab5f40d(#6813) Add channel API for sending data across the IPC.3245d14b(#6895) Moved the app feature to its own plugin in the plugins-workspace repository.09376af5(#6704) Moved the cli feature to its own plugin in the plugins-workspace repository.2d5378bf(#6717) Moved the dialog APIs to its own plugin in the plugins-workspace repository.39f1b04f(#6943) Moved the event JS APIs to a plugin.fc4d687e(#6716) Moved the file system APIs to its own plugin in the plugins-workspace repository.f78a3783(#6742) Moved the http feature to its own plugin in the plugins-workspace repository.29ce9ce2(#6902) Moved the os feature to its own plugin in the plugins-workspace repository.60cf9ed2(#6905) Moved the process feature to its own plugin in the plugins-workspace repository.96639ca2(#6749) Moved the shell functionality to its own plugin in the plugins-workspace repository.b072daa3(#6919) Moved the updater feature to its own plugin in the plugins-workspace repository.cebd7526(#6728) Moved the clipboard feature to its own plugin in the plugins-workspace repository.3f17ee82(#6737) Moved the global-shortcut feature to its own plugin in the plugins-workspace repository.9a79dc08(#6947) Moved the window JS APIs to its own plugin in the plugins-workspace repository.open function to have better TS result types.
raw encoding option to read stdout and stderr raw bytes.
Command constructor and added the Command.create static function instead.
shadow option when creating a window and setShadow function.
1c582a94(#8392) Fix a regression where typescript could not find types when using "moduleResolution": "node"50462702(#8267) Add top-level main, module and types fields in package.json to be compliant with typescripts's "moduleResolution": "node"14544e4b(#8219) Avoid crashing in clearMocks58d6b899(#7636) Add append option to FsOptions in the fs JS module, used in writeTextFile and writeBinaryFile, to be able to append to existing files instead of overwriting it.2eab1505(#7394) Fix Body.form static not reading and sending entries of type Blob (including subclasses such as File)359058ce(#5939) Add locale function in the os module to get the system locale.c4d6fb4b(#2353) Added the maximizable, minimizable and closable fields on WindowOptions.c4d6fb4b(#2353) Added the setMaximizable, setMinimizable, setClosable, isMaximizable, isMinimizable and isClosable methods.000104bc(#6472) Add WebviewWindow.is_focused and WebviewWindow.getFocusedWindow getters.event.payload in onResized and onMoved window event handlers.
WindowOptions::contentProtected option and WebviewWindow#setContentProtected to change it at runtime.
is_minimized() window method.
title getter on window.
acceptFirstMouse window option.
fs/exists
Monitor instances with the correct classes for position and size fields instead of plain object.
BaseDirectory enum variants AppConfig, AppData, AppLocalData, AppCache and AppLog along with equivalent functions in path module and deprecated ambiguous variants Log and App along with their equivalent functions in path module.
dialog.save return type
FormData on the Body.form function.
show and hide methods on the app module.
tabbingIdentifier window option for macOS.
tabbing_identifier to the window builder on macOS.
user_agent option when creating a window.
mockIPC() handler signature to allow async handler functions.
Command, Command.stdout and Command.stderr events with new once, off, listenerCount, prependListener, prependOnceListener and removeAllListeners functions.
encoding option to the Command options.
exists function to the fs module.
ArrayBuffer in Body.bytes and writeBinaryFile.
toString() on message/confirm/ask dialogs title and message values.
type-fest dependency, changing the OS types to the specific enum instead of allowing any string.
writeBinaryFile sending an empty file contents when only the first argument is passed.
dialog.open.
stable!
FilePart usage in http.Body.form by renaming the value property to file.
isPermissionGranted function now returns boolean instead of boolean | null. The response is never null because we won't check the permission for now, always returning true instead.
resolveResource API to the path module.
writeFile to writeTextFile but kept the original function for backwards compatibility.
(path, contents[, options]) overload to the writeTextFile and writeBinaryFile APIs.
title option in the message dialog API.
http > connectTimeout.
convertFileSrc function.
theme getter to WebviewWindow.
theme field to WindowOptions.
setCursorGrab, setCursorVisible, setCursorIcon and setCursorPosition methods to the WebviewWindow class.
\r.
tauri://theme-changed event.
appWindow type.
Temp to the BaseDirectory enum.
__TAURI_METADATA__ is not set, log an error instead.
unlisten command.
Add fileDropEnabled property to WindowOptions so you can now disable it when creating windows from js.
Add logDir function to the path module to access the suggested log directory.
Add BaseDirectory.Log to the fs module.
Expose ask, message and confirm APIs on the dialog module.
Event emit now automatically serialize non-string types.
Fix http.fetch throwing error if the response is successful but the body is empty.
Add title option to file open/save dialogs.
Fix os.platform returning macos and windows instead of darwin and win32.
The formatCallback helper function now returns a number instead of a string.
Added rawHeaders to http > Response.
Removed the currentDir API from the path module.
currentDir API from the path module on 2022-02-04Remove .ts files on the published package.
Breaking change: Replaces all usages of number[] with Uint8Array to be closer aligned with the wider JS ecosystem.
WindowManager methods innerPosition outerPosition now correctly return instance of PhysicalPosition.
WindowManager methods innerSize outerSize now correctly return instance of PhysicalSize.
Change the event field of the Event interface to type EventName instead of string.
Now resolve(), join() and normalize() from the path module, won't throw errors if the path doesn't exist, which matches NodeJS behavior.
Fixes the dialog defaultPath usage on Linux.
Fixes window.label property returning null instead of the actual label.
Remove the BaseDirectory::Current enum variant for security reasons.
BaseDirectory::Current variant on 2022-01-26Change WindowLabel type to string.
When building Universal macOS Binaries through the virtual target universal-apple-darwin:
Expect a universal binary to be created by the user
Ensure that binary is bundled and accessed correctly at runtime
3035e458 Remove target triple from sidecar bin paths, closes #3355 (#3356) on 2022-02-07
https://asset.localhost/path/to/file on Windows. Linux and macOS
is still asset://path/to/file.
bundle now exports clipboard module so you can import { clipboard } from "@tauri-apps/api".
os module which exports EOL, platform(), version(), type(), arch(), tempdir()
join, resolve, normalize, dirname, basename and extname.sep and delimiter constants.resolvePath API, use resolve instead.path module (#2310) on 2021-08-02toggleMaximize() function to the WebviewWindow class.
@ts-expect error usage
file-drop-hover on drop and file-drop on hover).
EventName type using type-fest's LiteralUnion.
convertFileSrc helper to the tauri module, simplifying the process of using file paths as webview source (img, video, etc).
emit, listen and once using the appWindow exported by the window module.
WebviewWindow, which now extends WindowManager.
Response and ResponseType as value instead of type.
BaseDirectory in path module
export type to export TS types, enums and interfaces.
focus?: boolean to the WindowOptions interface.
isDecorated getter on the window API.
is_decorated Window getter on 2021-05-30isResizable getter on the window API.
is_resizable Window getter on 2021-05-30isVisible getter on the window API.
is_visible API on 2021-05-30requestUserAttention API to the window module.
setFocus to the window API.
setSkipTaskbar to the window API.
set_skip_taskbar API on 2021-05-30skipTaskbar?: boolean to the WindowOptions interface.
skip_taskbar API to the WindowBuilder/WindowOptions on 2021-05-30center?: boolean to WindowOptions and center() API to the appWindow.
clipboard APIs (write and read text).
http APIs now resolve the returned promise when the API call finishes with an error status code.
withGlobalTauri (window.__TAURI__) usage.
WebviewWindow constructor as public.
setLocation, setSize, setMinSize and setMaxSize API.
package.json to the exports object.
.cjs extension
transparent?: boolean to the WindowOptions interface.
options argument to the shell command API (env and cwd configuration).
startDragging API on the window module.
exit and relaunch APIs from app to process module.
setX, setY, setWidth, setHeight APIs, renamed resize to setSize and the size and position APIs now allow defining both logical and physical values.
@tauri-apps/api package for older bundlers.
files property in the package.json which mean that the dist directory was not published and used.
{ name: string, extensions: string[] }.