mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 20:03:01 +08:00
Docs change
This commit is contained in:
parent
d03f4ce54a
commit
a0ff53b629
2
.github/workflows/build-and-test-alpha.yml
vendored
2
.github/workflows/build-and-test-alpha.yml
vendored
@ -4,7 +4,7 @@ on:
|
||||
push:
|
||||
branches: [v3-alpha, v3/*, v3-*]
|
||||
paths-ignore:
|
||||
- 'mkdocs-website/**/*'
|
||||
- '../../docs/**/*'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -38,5 +38,5 @@ v2/cmd/wails/internal/commands/initialise/templates/testtemplates/
|
||||
/v3/examples/plugins/bin/testapp
|
||||
|
||||
# Temporary called mkdocs, should be renamed to more standard -website or similar
|
||||
/mkdocs-website/site
|
||||
/docs/site
|
||||
.aider*
|
||||
|
@ -17,8 +17,8 @@ includes:
|
||||
optional: true
|
||||
|
||||
docs:
|
||||
taskfile: mkdocs-website
|
||||
dir: mkdocs-website
|
||||
taskfile: docs
|
||||
dir: docs
|
||||
optional: true
|
||||
|
||||
tasks:
|
||||
|
30
docs/Taskfile.yml
Normal file
30
docs/Taskfile.yml
Normal file
@ -0,0 +1,30 @@
|
||||
# https://taskfile.dev
|
||||
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
|
||||
setup:
|
||||
summary: Setup the project
|
||||
preconditions:
|
||||
- sh: npm --version
|
||||
msg: "Looks like npm isn't installed."
|
||||
cmds:
|
||||
- npm install
|
||||
|
||||
dev:
|
||||
summary: Run the dev server
|
||||
preconditions:
|
||||
- sh: npm --version
|
||||
msg: "Looks like npm isn't installed."
|
||||
cmds:
|
||||
- npm run dev
|
||||
|
||||
build:
|
||||
summary: Build the docs
|
||||
preconditions:
|
||||
- sh: npm --version
|
||||
msg: "Looks like npm isn't installed."
|
||||
cmds:
|
||||
- npm run build
|
||||
|
@ -21,10 +21,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Added
|
||||
|
||||
- `app.OpenDirectory(dir string)` to open the system file explorer to the directory `dir` by [@leaanthony](https://github.com/leaanthony)
|
||||
- `app.OpenFileManager(path string, selectFile bool)` to open the system file manager to the path `path` with optional highlighting via `selectFile` by [@Krzysztofz01](https://github.com/Krzysztofz01) [@rcalixte](https://github.com/rcalixte)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix Sveltekit template CSS referance by @atterpac in [#3945](https://github.com/wailsapp/wails/pull/3945)
|
||||
- [darwin] Ensure `windowDidBecomeKey` callback is running on main thread by [@leaanthony](https://github.com/leaanthony)
|
||||
- Ensure key callbacks in window run() are called on the main thread by [@leaanthony](https://github.com/leaanthony)
|
||||
- [darwin] Support fullscreen for frameless windows by [@leaanthony](https://github.com/leaanthony)
|
||||
@ -63,7 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Added Support for darwin universal builds and packages by
|
||||
[ansxuman](https://github.com/ansxuman) in
|
||||
[#3902](https://github.com/wailsapp/wails/pull/3902)
|
||||
- Events documentation to the mkdocs webite by
|
||||
- Events documentation to the website by
|
||||
[atterpac](https://github.com/atterpac) in
|
||||
[#3867](https://github.com/wailsapp/wails/pull/3867)
|
||||
- Templates for sveltekit and sveltekit-ts that are set for non-SSR development
|
||||
|
@ -1 +0,0 @@
|
||||
v3alpha.wails.io
|
@ -1,2 +0,0 @@
|
||||
FROM squidfunk/mkdocs-material
|
||||
RUN python3 -m pip install mkdocs-table-reader-plugin mkdocs-git-committers-plugin-2 mkdocs-static-i18n
|
@ -1,45 +0,0 @@
|
||||
# v3 Docs
|
||||
|
||||
This is the documentation for Wails v3. It is currently a work in progress.
|
||||
|
||||
If you do not wish to build it locally, it is available online at
|
||||
[https://wailsapp.github.io/wails/](https://wailsapp.github.io/wails/).
|
||||
|
||||
## Recommended Setup Steps
|
||||
|
||||
Install the wails3 CLI if you haven't already:
|
||||
|
||||
```shell
|
||||
go install github.com/wailsapp/wails/v3/cmd/wails3@latest
|
||||
```
|
||||
|
||||
The documentation uses mkdocs, so you will need to install
|
||||
[Python](https://www.python.org/). Once installed, you can setup the
|
||||
documentation by running the following command:
|
||||
|
||||
```bash
|
||||
wails3 task docs:setup
|
||||
```
|
||||
|
||||
This will install the required dependencies for you.
|
||||
|
||||
If you have installed the wails3 CLI, you can run the following command to build
|
||||
the documentation and serve it locally:
|
||||
|
||||
```bash
|
||||
wails3 task docs:serve
|
||||
```
|
||||
|
||||
### Manual Setup
|
||||
|
||||
To install manually, you will need to do the following:
|
||||
|
||||
- Install [Python](https://www.python.org/)
|
||||
- Run `pip install -r requirements.txt` to install the required dependencies
|
||||
- Run `mkdocs serve` to serve the documentation locally
|
||||
- Run `mkdocs build` to build the documentation
|
||||
|
||||
## Contributing
|
||||
|
||||
If you would like to contribute to the documentation, please feel free to open a
|
||||
PR!
|
@ -1,60 +0,0 @@
|
||||
# https://taskfile.dev
|
||||
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
|
||||
setup:
|
||||
summary: Setup the project
|
||||
preconditions:
|
||||
- sh: python3{{exeExt}} --version
|
||||
msg: "Looks like Python isn't installed. Python is required to build the documentation: https://www.python.org/downloads/"
|
||||
cmds:
|
||||
- python3 -m pip install -r requirements.txt --user
|
||||
|
||||
setup:insiders:
|
||||
summary: Setup the project (insiders)
|
||||
preconditions:
|
||||
- sh: python3{{exeExt}} --version
|
||||
msg: "Looks like Python isn't installed. Python is required to build the documentation: https://www.python.org/downloads/"
|
||||
cmds:
|
||||
- python3 -m pip install -r requirements.insiders.txt --user
|
||||
|
||||
build:docker:
|
||||
cmds:
|
||||
- docker build -t wailsapp/mkdocs .
|
||||
|
||||
upgrade:insiders:
|
||||
summary: Upgrade the project (insiders)
|
||||
preconditions:
|
||||
- sh: python3{{exeExt}} --version
|
||||
msg: "Looks like Python isn't installed. Python is required to build the documentation: https://www.python.org/downloads/"
|
||||
cmds:
|
||||
- python3 -m pip install -r requirements.insiders.txt --upgrade --user
|
||||
|
||||
build:
|
||||
summary: Builds the documentation
|
||||
preconditions:
|
||||
- sh: mkdocs --version
|
||||
msg: "Looks like mkdocs isn't installed. Run `wails3 task setup` or `task setup` in the documentation directory to install it."
|
||||
cmds:
|
||||
- mkdocs build
|
||||
|
||||
serve:
|
||||
summary: Builds the documentation and serves it locally
|
||||
cmds:
|
||||
- docker run --rm -it -p 8000:8000 -v $PWD:/docs wailsapp/mkdocs
|
||||
|
||||
serve:insiders:
|
||||
summary: Builds the documentation and serves it locally
|
||||
preconditions:
|
||||
- sh: mkdocs --version
|
||||
msg: "Looks like mkdocs isn't installed. Run `wails3 task setup` or `task setup` in the documentation directory to install it."
|
||||
cmds:
|
||||
- mkdocs serve --config-file mkdocs.insiders.yml
|
||||
|
||||
update:api:
|
||||
summary: Updates the API documentation
|
||||
dir: generate
|
||||
cmds:
|
||||
- go run .
|
@ -1 +0,0 @@
|
||||
v3alpha.wails.io
|
@ -1,202 +0,0 @@
|
||||
# Application
|
||||
|
||||
The application API assists in creating an application using the Wails
|
||||
framework.
|
||||
|
||||
### New
|
||||
|
||||
API: `New(appOptions Options) *App`
|
||||
|
||||
`New(appOptions Options)` creates a new application using the given application
|
||||
options . It applies default values for unspecified options, merges them with
|
||||
the provided ones, initializes and returns an instance of the application.
|
||||
|
||||
In case of an error during initialization, the application is stopped with the
|
||||
error message provided.
|
||||
|
||||
It should be noted that if a global application instance already exists, that
|
||||
instance will be returned instead of creating a new one.
|
||||
|
||||
```go title="main.go" hl_lines="6-9"
|
||||
package main
|
||||
|
||||
import "github.com/wailsapp/wails/v3/pkg/application"
|
||||
|
||||
func main() {
|
||||
app := application.New(application.Options{
|
||||
Name: "WebviewWindow Demo",
|
||||
// Other options
|
||||
})
|
||||
|
||||
// Rest of application
|
||||
}
|
||||
```
|
||||
|
||||
### Get
|
||||
|
||||
`Get()` returns the global application instance. It's useful when you need to
|
||||
access the application from different parts of your code.
|
||||
|
||||
```go
|
||||
// Get the application instance
|
||||
app := application.Get()
|
||||
```
|
||||
|
||||
### Capabilities
|
||||
|
||||
API: `Capabilities() capabilities.Capabilities`
|
||||
|
||||
`Capabilities()` retrieves a map of capabilities that the application currently
|
||||
has. Capabilities can be about different features the operating system provides,
|
||||
like webview features.
|
||||
|
||||
```go
|
||||
// Get the application capabilities
|
||||
capabilities := app.Capabilities()
|
||||
if capabilities.HasNativeDrag {
|
||||
// Do something
|
||||
}
|
||||
```
|
||||
|
||||
### GetPID
|
||||
|
||||
API: `GetPID() int`
|
||||
|
||||
`GetPID()` returns the Process ID of the application.
|
||||
|
||||
```go
|
||||
pid := app.GetPID()
|
||||
```
|
||||
|
||||
### Run
|
||||
|
||||
API: `Run() error`
|
||||
|
||||
`Run()` starts the execution of the application and its components.
|
||||
|
||||
```go
|
||||
app := application.New(application.Options{
|
||||
//options
|
||||
})
|
||||
// Run the application
|
||||
err := application.Run()
|
||||
if err != nil {
|
||||
// Handle error
|
||||
}
|
||||
```
|
||||
|
||||
### Quit
|
||||
|
||||
API: `Quit()`
|
||||
|
||||
`Quit()` quits the application by destroying windows and potentially other
|
||||
components.
|
||||
|
||||
```go
|
||||
// Quit the application
|
||||
app.Quit()
|
||||
```
|
||||
|
||||
### IsDarkMode
|
||||
|
||||
API: `IsDarkMode() bool`
|
||||
|
||||
`IsDarkMode()` checks if the application is running in dark mode. It returns a
|
||||
boolean indicating whether dark mode is enabled.
|
||||
|
||||
```go
|
||||
// Check if dark mode is enabled
|
||||
if app.IsDarkMode() {
|
||||
// Do something
|
||||
}
|
||||
```
|
||||
|
||||
### Hide
|
||||
|
||||
API: `Hide()`
|
||||
|
||||
`Hide()` hides the application window.
|
||||
|
||||
```go
|
||||
// Hide the application window
|
||||
app.Hide()
|
||||
```
|
||||
|
||||
### Show
|
||||
|
||||
API: `Show()`
|
||||
|
||||
`Show()` shows the application window.
|
||||
|
||||
```go
|
||||
// Show the application window
|
||||
app.Show()
|
||||
```
|
||||
|
||||
### Path
|
||||
|
||||
API: `Path(selector Path) string`
|
||||
|
||||
`Path(selector Path)` returns the full path for the given path type. It provides a cross-platform way to query common application directories.
|
||||
|
||||
The `Path` type is an enum with the following values:
|
||||
- `PathHome`: Returns the user's home directory
|
||||
- `PathDataHome`: Returns the path to the user's data directory
|
||||
- `PathConfigHome`: Returns the path to the user's configuration directory
|
||||
- `PathStateHome`: Returns the path to the user's state directory
|
||||
- `PathCacheHome`: Returns the path to the user's cache directory
|
||||
- `PathRuntimeDir`: Returns the path to the user's runtime directory
|
||||
- `PathDesktop`: Returns the path to the user's desktop directory
|
||||
- `PathDownload`: Returns the path to the user's download directory
|
||||
- `PathDocuments`: Returns the path to the user's documents directory
|
||||
- `PathMusic`: Returns the path to the user's music directory
|
||||
- `PathPictures`: Returns the path to the user's pictures directory
|
||||
- `PathVideos`: Returns the path to the user's videos directory
|
||||
- `PathTemplates`: Returns the path to the user's templates directory
|
||||
- `PathPublicShare`: Returns the path to the user's public share directory
|
||||
|
||||
```go
|
||||
// Get the data home directory path
|
||||
dataHomePath := app.Path(application.PathDataHome)
|
||||
fmt.Println("DataHome path:", dataHomePath)
|
||||
|
||||
// Output: DataHome path: /home/username/.local/share // Linux
|
||||
// Output: DataHome path: /Users/username/Library/Application Support // macOS
|
||||
// Output: DataHome path: C:\Users\Username\AppData\Roaming // Windows
|
||||
|
||||
// Get the CacheHome directory path
|
||||
cacheHomePath := app.Path(application.CacheHome)
|
||||
fmt.Println("CacheHome path:", cacheHomePath)
|
||||
|
||||
// Output: CacheHome path: /home/username/.cache // Linux
|
||||
// Output: CacheHome path: /Users/username/Library/Caches // macOS
|
||||
// Output: CacheHome path: C:\Users\Username\AppData\Local\Temp // Windows
|
||||
```
|
||||
|
||||
## Paths
|
||||
API: `Paths(selector Paths) []string`
|
||||
`Paths(selector Path)` returns a list of paths for the given path type. It provides a cross-platform way to query common directory paths.
|
||||
|
||||
The `Paths` type is an enum with the following values:
|
||||
- `PathsDataDirs`: Returns the list of data directories
|
||||
- `PathsConfigDirs`: Returns the list of configuration directories
|
||||
- `PathsCacheDirs`: Returns the list of cache directories
|
||||
- `PathsRuntimeDirs`: Returns the list of runtime directories
|
||||
|
||||
|
||||
--8<--
|
||||
./docs/en/API/application_window.md
|
||||
./docs/en/API/application_menu.md
|
||||
./docs/en/API/application_dialogs.md
|
||||
./docs/en/API/application_events.md
|
||||
./docs/en/API/application_screens.md
|
||||
--8<--
|
||||
|
||||
|
||||
## Options
|
||||
|
||||
```go title="pkg/application/application_options.go"
|
||||
--8<--
|
||||
../v3/pkg/application/application_options.go
|
||||
--8<--
|
||||
```
|
@ -1,96 +0,0 @@
|
||||
|
||||
!!! warning "MacOS Dialogs and Application Lifecycle"
|
||||
|
||||
If you show dialogs during application startup or file open events, you should set `ApplicationShouldTerminateAfterLastWindowClosed` to `false` to prevent the application from terminating when those dialogs close. Otherwise, the application may quit before your main window appears.
|
||||
|
||||
```go
|
||||
app := application.New(application.Options{
|
||||
Mac: application.MacOptions{
|
||||
ApplicationShouldTerminateAfterLastWindowClosed: false,
|
||||
},
|
||||
// ... rest of options
|
||||
})
|
||||
```
|
||||
|
||||
Alternatively, you can show startup dialogs after the main window has been displayed:
|
||||
|
||||
```go
|
||||
var filename string
|
||||
app.OnApplicationEvent(events.Common.ApplicationOpenedWithFile, func(event *application.ApplicationEvent) {
|
||||
filename = event.Context().Filename()
|
||||
})
|
||||
|
||||
window.OnWindowEvent(events.Common.WindowShow, func(event *application.WindowEvent) {
|
||||
application.InfoDialog().
|
||||
SetTitle("File Opened").
|
||||
SetMessage("Application opened with file: " + filename).
|
||||
Show()
|
||||
})
|
||||
```
|
||||
|
||||
### ShowAboutDialog
|
||||
|
||||
API: `ShowAboutDialog()`
|
||||
|
||||
`ShowAboutDialog()` shows an "About" dialog box. It can show the application's
|
||||
name, description and icon.
|
||||
|
||||
```go
|
||||
// Show the about dialog
|
||||
app.ShowAboutDialog()
|
||||
```
|
||||
|
||||
### Info
|
||||
|
||||
API: `InfoDialog()`
|
||||
|
||||
`InfoDialog()` creates and returns a new instance of `MessageDialog` with an
|
||||
`InfoDialogType`. This dialog is typically used to display informational
|
||||
messages to the user.
|
||||
|
||||
### Question
|
||||
|
||||
API: `QuestionDialog()`
|
||||
|
||||
`QuestionDialog()` creates and returns a new instance of `MessageDialog` with a
|
||||
`QuestionDialogType`. This dialog is often used to ask a question to the user
|
||||
and expect a response.
|
||||
|
||||
### Warning
|
||||
|
||||
API: `WarningDialog()`
|
||||
|
||||
`WarningDialog()` creates and returns a new instance of `MessageDialog` with a
|
||||
`WarningDialogType`. As the name suggests, this dialog is primarily used to
|
||||
display warning messages to the user.
|
||||
|
||||
### Error
|
||||
|
||||
API: `ErrorDialog()`
|
||||
|
||||
`ErrorDialog()` creates and returns a new instance of `MessageDialog` with an
|
||||
`ErrorDialogType`. This dialog is designed to be used when you need to display
|
||||
an error message to the user.
|
||||
|
||||
### OpenFile
|
||||
|
||||
API: `OpenFileDialog()`
|
||||
|
||||
`OpenFileDialog()` creates and returns a new `OpenFileDialogStruct`. This dialog
|
||||
prompts the user to select one or more files from their file system.
|
||||
|
||||
### SaveFile
|
||||
|
||||
API: `SaveFileDialog()`
|
||||
|
||||
`SaveFileDialog()` creates and returns a new `SaveFileDialogStruct`. This dialog
|
||||
prompts the user to choose a location on their file system where a file should
|
||||
be saved.
|
||||
|
||||
### OpenDirectory
|
||||
|
||||
API: `OpenDirectoryDialog()`
|
||||
|
||||
`OpenDirectoryDialog()` creates and returns a new instance of `MessageDialog`
|
||||
with an `OpenDirectoryDialogType`. This dialog enables the user to choose a
|
||||
directory from their file system.
|
@ -1,48 +0,0 @@
|
||||
### OnEvent
|
||||
|
||||
API:
|
||||
`OnEvent(name string, callback func(event *CustomEvent)) func()`
|
||||
|
||||
`OnEvent()` registers an event listener for specific application events. The callback
|
||||
function provided will be triggered when the corresponding event occurs.
|
||||
|
||||
### OffEvent
|
||||
API:
|
||||
`OffEvent(name string)`
|
||||
|
||||
`OffEvent()` removes an event listener for a specific named event specified.
|
||||
|
||||
### OnMultipleEvent
|
||||
API:
|
||||
`OnMultipleEvent(name string, callback func(event *CustomEvent), counter int) func()`
|
||||
|
||||
`OnMultipleEvent()` registers an event listener for X number of Events. The callback
|
||||
function provided will be triggered `counter` times when the corresponding event occurs.
|
||||
|
||||
### ResetEvents
|
||||
API:
|
||||
`ResetEvents()`
|
||||
|
||||
`ResetEvents()` removes all event listeners for all application events.
|
||||
|
||||
### OnApplicationEvent
|
||||
API:
|
||||
`OnApplicationEvent(eventType events.ApplicationEventType, callback func(event *ApplicationEvent)) func()`
|
||||
|
||||
`OnApplicationEvent()` registers an event listener for specific application events.
|
||||
The `eventType` is based on events.ApplicationEventType. See [ApplicationEventType](/API/events/#applicationevent)
|
||||
|
||||
### RegisterApplicationHook
|
||||
API:
|
||||
`RegisterApplicationEventHook(eventType events.ApplicationEventType, callback func(event *ApplicationEvent)) func()`
|
||||
|
||||
`RegisterApplicationEventHook()` registers a callback to be triggered based on specific application events.
|
||||
|
||||
### RegisterHook
|
||||
|
||||
API:
|
||||
`RegisterHook(eventType events.ApplicationEventType, callback func(event *Event)) func()`
|
||||
|
||||
`RegisterHook()` registers a callback to be run as a hook during specific
|
||||
events. These hooks are run before listeners attached with `On()`. The function
|
||||
returns a function that can be called to remove the hook.
|
@ -1,31 +0,0 @@
|
||||
### RegisterContextMenu
|
||||
|
||||
API: `RegisterContextMenu(name string, menu *Menu)`
|
||||
|
||||
`RegisterContextMenu()` registers a context menu with a given name. This menu
|
||||
can be used later in the application.
|
||||
|
||||
```go
|
||||
|
||||
// Create a new menu
|
||||
ctxmenu := app.NewMenu()
|
||||
|
||||
// Register the menu as a context menu
|
||||
app.RegisterContextMenu("MyContextMenu", ctxmenu)
|
||||
```
|
||||
|
||||
### SetMenu
|
||||
|
||||
API: `SetMenu(menu *Menu)`
|
||||
|
||||
`SetMenu()` sets the menu for the application. On Mac, this will be the global
|
||||
menu. For Windows and Linux, this will be the default menu for any new window
|
||||
created.
|
||||
|
||||
```go
|
||||
// Create a new menu
|
||||
menu := app.NewMenu()
|
||||
|
||||
// Set the menu for the application
|
||||
app.SetMenu(menu)
|
||||
```
|
@ -1,15 +0,0 @@
|
||||
### GetPrimaryScreen
|
||||
|
||||
API: `GetPrimaryScreen() (*Screen, error)`
|
||||
|
||||
`GetPrimaryScreen()` returns the primary screen of the system.
|
||||
|
||||
### GetScreens
|
||||
|
||||
API: `GetScreens() ([]*Screen, error)`
|
||||
|
||||
`GetScreens()` returns information about all screens attached to the system.
|
||||
|
||||
This is a brief summary of the exported methods in the provided `App` struct. Do
|
||||
note that for more detailed functionality or considerations, refer to the actual
|
||||
Go code or further internal documentation.
|
@ -1,67 +0,0 @@
|
||||
### NewWebviewWindow
|
||||
|
||||
API: `NewWebviewWindow() *WebviewWindow`
|
||||
|
||||
`NewWebviewWindow()` creates a new Webview window with default options, and
|
||||
returns it.
|
||||
|
||||
```go
|
||||
// Create a new webview window
|
||||
window := app.NewWebviewWindow()
|
||||
```
|
||||
|
||||
### NewWebviewWindowWithOptions
|
||||
|
||||
API:
|
||||
`NewWebviewWindowWithOptions(windowOptions WebviewWindowOptions) *WebviewWindow`
|
||||
|
||||
`NewWebviewWindowWithOptions()` creates a new webview window with custom
|
||||
options. The newly created window is added to a map of windows managed by the
|
||||
application.
|
||||
|
||||
```go
|
||||
// Create a new webview window with custom options
|
||||
window := app.NewWebviewWindowWithOptions(WebviewWindowOptions{
|
||||
Name: "Main",
|
||||
Title: "My Window",
|
||||
Width: 800,
|
||||
Height: 600,
|
||||
})
|
||||
```
|
||||
|
||||
### OnWindowCreation
|
||||
|
||||
API: `OnWindowCreation(callback func(window *WebviewWindow))`
|
||||
|
||||
`OnWindowCreation()` registers a callback function to be called when a window is
|
||||
created.
|
||||
|
||||
```go
|
||||
// Register a callback to be called when a window is created
|
||||
app.OnWindowCreation(func(window *WebviewWindow) {
|
||||
// Do something
|
||||
})
|
||||
```
|
||||
|
||||
### GetWindowByName
|
||||
|
||||
API: `GetWindowByName(name string) *WebviewWindow`
|
||||
|
||||
`GetWindowByName()` fetches and returns a window with a specific name.
|
||||
|
||||
```go
|
||||
// Get a window by name
|
||||
window := app.GetWindowByName("Main")
|
||||
```
|
||||
|
||||
### CurrentWindow
|
||||
|
||||
API: `CurrentWindow() *WebviewWindow`
|
||||
|
||||
`CurrentWindow()` fetches and returns a pointer to the currently active window
|
||||
in the application. If there is no window, it returns nil.
|
||||
|
||||
```go
|
||||
// Get the current window
|
||||
window := app.CurrentWindow()
|
||||
```
|
@ -1,119 +0,0 @@
|
||||
wails3 provides an event system that allows for hooking into application and window events
|
||||
|
||||
```go
|
||||
// Notification of application start
|
||||
application.RegisterApplicationEventHook(events.Common.ApplicationStarted, func(event *application.ApplicationEvent) {
|
||||
app.Logger.Info("Application started!")
|
||||
})
|
||||
```
|
||||
|
||||
```go
|
||||
// Notification of system theme change
|
||||
application.OnApplicationEvent(events.Common.ThemeChanged, func(event *application.ApplicationEvent) {
|
||||
app.Logger.Info("System theme changed!")
|
||||
if event.Context().IsDarkMode() {
|
||||
app.Logger.Info("System is now using dark mode!")
|
||||
} else {
|
||||
app.Logger.Info("System is now using light mode!")
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
```go
|
||||
// Disable window closing by canceling the event
|
||||
window.RegisterHook(events.Common.WindowClosing, func(e *application.WindowEvent) {
|
||||
app.Logger.Info("Window 1 Closing? Nope! Not closing!")
|
||||
e.Cancel()
|
||||
})
|
||||
```
|
||||
|
||||
```go
|
||||
// Notification of window focus
|
||||
window.OnWindowEvent(events.Common.WindowFocus, func(e *application.WindowEvent) {
|
||||
app.Logger.Info("[ApplicationEvent] Window focus!")
|
||||
})
|
||||
```
|
||||
|
||||
### Application Events
|
||||
|
||||
Application events are hookable events that can be registered with `application.RegisterApplicationEventHook()`
|
||||
and `application.OnApplicationEvent()`. These events are based on `events.ApplicationEventType`.
|
||||
|
||||
`events.Common.ApplicationStarted`
|
||||
: Triggered when the application starts
|
||||
|
||||
`events.Common.ThemeChanged`
|
||||
: Triggered when the application theme changes
|
||||
|
||||
|
||||
### Window Events
|
||||
|
||||
`events.Common.WindowMaximised`
|
||||
: Triggered when the window is maximised
|
||||
|
||||
`events.Common.WindowUnmaximised`
|
||||
: Triggered when the window is unmaximised
|
||||
|
||||
`events.Common.WindowMinimised`
|
||||
: Triggered when the window is minimised
|
||||
|
||||
`events.Common.WindowUnminimised`
|
||||
: Triggered when the window is unminimised
|
||||
|
||||
`events.Common.WindowFullscreen`
|
||||
: Triggered when the window is set to fullscreen
|
||||
|
||||
`events.Common.WindowUnfullscreen`
|
||||
: Triggered when the window is unfullscreened
|
||||
|
||||
`events.Common.WindowRestored`
|
||||
: Triggered when the window is restored
|
||||
|
||||
`events.Common.WindowClosing`
|
||||
: Triggered before the window closes
|
||||
|
||||
`events.Common.WindowZoom`
|
||||
: Triggered when the window is zoomed
|
||||
|
||||
`events.Common.WindowZoomOut`
|
||||
: Triggered when the window is zoomed out
|
||||
|
||||
`events.Common.WindowZoomIn`
|
||||
: Triggered when the window is zoomed in
|
||||
|
||||
`events.Common.WindowZoomReset`
|
||||
: Triggered when the window zoom is reset
|
||||
|
||||
`events.Common.WindowFocus`
|
||||
: Triggered when the window gains focus
|
||||
|
||||
`events.Common.WindowLostFocus`
|
||||
: Triggered when the window loses focus
|
||||
|
||||
`events.Common.WindowShow`
|
||||
: Triggered when the window is shown
|
||||
|
||||
`events.Common.WindowHide`
|
||||
: Triggered when the window is hidden
|
||||
|
||||
`events.Common.WindowDPIChanged`
|
||||
: Triggered when the window DPI changes
|
||||
|
||||
`events.Common.WindowFilesDropped`
|
||||
: Triggered when files are dropped on the window
|
||||
|
||||
`events.Common.WindowRuntimeReady`
|
||||
: Triggered when the window runtime is ready
|
||||
|
||||
`events.Common.WindowDidMove`
|
||||
: Triggered when the window is moved
|
||||
|
||||
`events.Common.WindowDidResize`
|
||||
: Triggered when the window is resized
|
||||
|
||||
### OS-Specific Events
|
||||
--8<--
|
||||
./docs/en/API/events_linux.md
|
||||
./docs/en/API/events_windows.md
|
||||
./docs/en/API/events_mac.md
|
||||
--8<--
|
@ -1,131 +0,0 @@
|
||||
# Events
|
||||
|
||||
## Event Hooks
|
||||
|
||||
--8<--
|
||||
./docs/en/API/event_hooks.md
|
||||
--8<--
|
||||
|
||||
## Custom Events
|
||||
You can create your own custom events that can be emitted and received on both the frontend and backend.
|
||||
Events are able to emitted at both the application and the window level. The receiver of the event gets data of where the
|
||||
event was emitted from along with the data that was sent with the event. Events can be cancelled by the receiver.
|
||||
|
||||
=== "Go"
|
||||
```go
|
||||
app.OnEvent("event1", func(e *application.CustomEvent) {
|
||||
app.Logger.Info("[Go] CustomEvent received", "name", e.Name, "data", e.Data, "sender", e.Sender, "cancelled", e.Cancelled)
|
||||
app.Logger.Info("[Go]", e.Data[0].(string)) // Logs "Hello from JS" to the terminal
|
||||
})
|
||||
|
||||
window.EmitEvent("event2", "Hello from Go")
|
||||
```
|
||||
=== "JS"
|
||||
```javascript
|
||||
wails.Events.Emit("event1", "Hello from JS")
|
||||
|
||||
wails.Events.On("event2", function(event) {
|
||||
console.log("[JS] CustomEvent received", event)
|
||||
console.log(event.data) // prints "Hello from Go" to the webview console
|
||||
})
|
||||
|
||||
```
|
||||
|
||||
### Emitting Events
|
||||
|
||||
`application.EmitEvent(name string, data ...any)`
|
||||
: Emits an event from the application instance
|
||||
|
||||
`window.EmitEvent(name string, data ...any)`
|
||||
: Emits an event from the window instance
|
||||
|
||||
`wails.Events.Emit(event:wails.Events.EventData)`
|
||||
: Emits an event from the frontend sending an object with `name` and `data` properties or the typescript type WailsEvent
|
||||
|
||||
### Receiving Events
|
||||
Events can be received on the application instance and the frontend with a couple options of how
|
||||
you chose to receive them. You can register a single event listener that will trigger every time the event is emitted
|
||||
or you can register an event listener that will only trigger a specific number of times.
|
||||
|
||||
Golang
|
||||
|
||||
`application.OnEvent(name string, handler func(data ...any))`
|
||||
: Registers an event on the application instance this will trigger every time the event is emitted
|
||||
|
||||
`application.OnMultipleEvent(name string, handler func(data ...any), count int)`
|
||||
: Registers an event on the application instance this will trigger every time the event is emitted up to the count specified
|
||||
|
||||
Frontend
|
||||
|
||||
`wails.Events.On(name: string, callback: ()=>void)`,
|
||||
: Registers an event on the frontend, this function returns a function that can be called to remove the event listener
|
||||
|
||||
`wails.Events.Once(name: string, callback: ()=>void)`,
|
||||
: Registers an event on the frontend that will only be called once, this function returns a function that can be called to remove the event listener
|
||||
|
||||
`wails.Events.OnMultiple(name: string, callback: ()=>void, count: number)`,
|
||||
: Registers an event on the frontend that will only be called `count` times, this function returns a function that can be called to remove the event listener
|
||||
|
||||
### Removing Events
|
||||
There are a few ways to remove events that are registered. All of the registration functions return a function that can be called to remove the event listeneer
|
||||
in the frontend. There are additional functions provided to help remove events as well.
|
||||
|
||||
Golang
|
||||
|
||||
`application.OffEvent(name string, ...additionalNames string)`
|
||||
: Removes an event listener with the specificed name
|
||||
|
||||
`application.ResetEvents()`
|
||||
: Removes all registered events and hooks
|
||||
|
||||
Frontend
|
||||
|
||||
`wails.Events.OffAll()`
|
||||
: Removes all registered events
|
||||
|
||||
`wails.Events.Off(name: string)`
|
||||
: Removes an event listener with the specified name
|
||||
|
||||
|
||||
## Event Types
|
||||
|
||||
### ApplicationEvent
|
||||
Returned when an application hook event is triggered. The event can be cancelled by calling the `Cancel()` method on the event.
|
||||
```go
|
||||
type ApplicationEvent struct {
|
||||
Id uint
|
||||
ctx *ApplicationEventContext
|
||||
Cancelled bool
|
||||
}
|
||||
|
||||
// Cancel the event
|
||||
func (a *ApplicationEvent) Cancel() {}
|
||||
```
|
||||
|
||||
### WindowEvent
|
||||
Returned when a window hook event is triggered. The event can be cancelled by calling the `Cancel()` method on the event.
|
||||
```go
|
||||
type WindowEvent struct {
|
||||
ctx *WindowEventContext
|
||||
Cancelled bool
|
||||
}
|
||||
|
||||
// Cancel the event
|
||||
func (w *WindowEvent) Cancel() {}
|
||||
```
|
||||
|
||||
### CustomEvent
|
||||
|
||||
CustomEvent is returned when an event is being recieved it includes the name of the event, the data that was sent with the event,
|
||||
the sender of the event, application or a specific window. The event can be cancelled by calling the `Cancel()` method on the event.
|
||||
```go
|
||||
type CustomEvent struct {
|
||||
Name string `json:"name"`
|
||||
Data any `json:"data"`
|
||||
Sender string `json:"sender"`
|
||||
Cancelled bool
|
||||
}
|
||||
|
||||
// Cancel the event
|
||||
func (c *CustomEvent) Cancel() {}
|
||||
```
|
@ -1,30 +0,0 @@
|
||||
#### Linux Events
|
||||
|
||||
##### Application Events
|
||||
|
||||
`events.Linux.ApplicationStartup`
|
||||
: Triggered when the application starts
|
||||
|
||||
`events.Linux.SystemThemeChanged`
|
||||
: Triggered when the system theme changes
|
||||
|
||||
##### Window Events
|
||||
|
||||
`events.Linux.WindowLoadChanged`
|
||||
: Triggered when the window load changes
|
||||
|
||||
`events.Linux.WindowDeleteEvent`
|
||||
: Triggered when the window is deleted
|
||||
|
||||
`events.Linux.WindowDidMove`
|
||||
: Triggered when the window is moved
|
||||
|
||||
`events.Linux.WindowDidResize`
|
||||
: Triggered when the window is resized
|
||||
|
||||
`events.Linux.WindowFocusIn`
|
||||
: Triggered when the window gains focus
|
||||
|
||||
`events.Linux.WindowFocusOut`
|
||||
: Triggered when the window loses focus
|
||||
|
@ -1,371 +0,0 @@
|
||||
#### macOS Events
|
||||
|
||||
##### Application Events
|
||||
|
||||
`events.Mac.ApplicationDidBecomeActive`
|
||||
: Triggered when the application becomes active
|
||||
|
||||
`events.Mac.ApplicationDidChangeBackingProperties`
|
||||
: Triggered when the application changes backing properties
|
||||
|
||||
`events.Mac.ApplicationDidChangeEffectiveAppearance`
|
||||
: Triggered when the application changes effective appearance
|
||||
|
||||
`events.Mac.ApplicationDidChangeIcon`
|
||||
: Triggered when the application changes icon
|
||||
|
||||
`events.Mac.ApplicationDidChangeOcclusionState`
|
||||
: Triggered when the application changes occlusion state
|
||||
|
||||
`events.Mac.ApplicationDidChangeScreenParameters`
|
||||
: Triggered when the application changes screen parameters
|
||||
|
||||
`events.Mac.ApplicationDidChangeStatusBarFrame`
|
||||
: Triggered when the application changes status bar frame
|
||||
|
||||
`events.Mac.ApplicationDidChangeStatusBarOrientation`
|
||||
: Triggered when the application changes status bar orientation
|
||||
|
||||
`events.Mac.ApplicationDidFinishLaunching`
|
||||
: Triggered when the application finishes launching
|
||||
|
||||
`events.Mac.ApplicationDidResignActiveNotification`
|
||||
: Triggered when the application is no longer active
|
||||
|
||||
`events.Mac.ApplicationDidHide`
|
||||
: Triggered when the application is hidden
|
||||
|
||||
`events.Mac.ApplicationDidUpdate`
|
||||
: Triggered when the application updates
|
||||
|
||||
`events.Mac.ApplicationWillBecomeActive`
|
||||
: Triggered when the application is about to become active
|
||||
|
||||
`events.Mac.ApplicationWillFinishLaunching`
|
||||
: Triggered when the application is about to finish launching
|
||||
|
||||
`events.Mac.ApplicationWillHide`
|
||||
: Triggered when the application is about to hide
|
||||
|
||||
`events.Mac.ApplicationWillResignActive`
|
||||
: Triggered when the application is about to lose focus
|
||||
|
||||
`events.Mac.ApplicationWillTerminate`
|
||||
: Triggered when the application is about to terminate
|
||||
|
||||
`events.Mac.ApplicationWillUnhide`
|
||||
: Triggered when the application is about to unhide
|
||||
|
||||
`events.Mac.ApplicationWillUpdate`
|
||||
: Triggered when the application is about to update
|
||||
|
||||
`events.Mac.ApplicationDidChangeTheme`
|
||||
: Triggered when the application changes theme
|
||||
|
||||
`events.Mac.MenuWillOpen`
|
||||
: Triggered when the menu is about to open
|
||||
|
||||
`events.Mac.MenuDidOpen`
|
||||
: Triggered when the menu opens
|
||||
|
||||
`events.Mac.MenuDidClose`
|
||||
: Triggered when the menu closes
|
||||
|
||||
`events.Mac.MenuWillSendAction`
|
||||
: Triggered when the menu is about to send an action
|
||||
|
||||
`events.Mac.MenuDidSendAction`
|
||||
: Triggered when the menu sends an action
|
||||
|
||||
`events.Mac.MenuWillHighlightItem`
|
||||
: Triggered when the menu is about to highlight an item
|
||||
|
||||
`events.Mac.MenuDidHighlightItem`
|
||||
: Triggered when the menu highlights an item
|
||||
|
||||
`events.Mac.MenuWillDisplayItem`
|
||||
: Triggered when the menu is about to display an item
|
||||
|
||||
`events.Mac.MenuDidDisplayItem`
|
||||
: Triggered when the menu displays an item
|
||||
|
||||
`events.Mac.MenuWillAddItem`
|
||||
: Triggered when the menu is about to add an item
|
||||
|
||||
`events.Mac.MenuDidAddItem`
|
||||
: Triggered when the menu adds an item
|
||||
|
||||
`events.Mac.MenuWillRemoveItem`
|
||||
: Triggered when the menu is about to remove an item
|
||||
|
||||
`events.Mac.MenuDidRemoveItem`
|
||||
: Triggered when the menu removes an item
|
||||
|
||||
`events.Mac.MenuWillBeginTracking`
|
||||
: Triggered when the menu is about to begin tracking
|
||||
|
||||
`events.Mac.MenuDidBeginTracking`
|
||||
: Triggered when the menu begins tracking
|
||||
|
||||
`events.Mac.MenuWillEndTracking`
|
||||
: Triggered when the menu is about to end tracking
|
||||
|
||||
`events.Mac.MenuDidEndTracking`
|
||||
: Triggered when the menu ends tracking
|
||||
|
||||
`events.Mac.MenuWillUpdate`
|
||||
: Triggered when the menu is about to update
|
||||
|
||||
`events.Mac.MenuDidUpdate`
|
||||
: Triggered when the menu updates
|
||||
|
||||
`events.Mac.MenuWillPopUp`
|
||||
: Triggered when the menu is about to pop up
|
||||
|
||||
`events.Mac.MenuDidPopUp`
|
||||
: Triggered when the menu pops up
|
||||
|
||||
`events.Mac.MenuWillSendActionToItem`
|
||||
: Triggered when the menu is about to send an action to an item
|
||||
|
||||
`events.Mac.MenuDidSendActionToItem`
|
||||
: Triggered when the menu sends an action to an item
|
||||
|
||||
##### Window Events
|
||||
|
||||
`events.Mac.WindowDidBecomeKey`
|
||||
: Triggered when the window becomes key
|
||||
|
||||
`events.Mac.WindowDidBecomeMain`
|
||||
: Triggered when the window becomes main
|
||||
|
||||
`events.Mac.WindowDidBeginSheet`
|
||||
: Triggered when the window begins a sheet
|
||||
|
||||
`events.Mac.WindowDidChangeAlpha`
|
||||
: Triggered when the window alpha changes
|
||||
|
||||
`events.Mac.WindowDidChangeBackingLocation`
|
||||
: Triggered when the window backing location changes
|
||||
|
||||
`events.Mac.WindowDidChangeBackingProperties`
|
||||
: Triggered when the window backing properties change
|
||||
|
||||
`events.Mac.WindowDidChangeCollectionBehavior`
|
||||
: Triggered when the window collection behavior changes
|
||||
|
||||
`events.Mac.WindowDidChangeEffectiveAppearance`
|
||||
: Triggered when the window effective appearance changes
|
||||
|
||||
`events.Mac.WindowDidChangeOcclusionState`
|
||||
: Triggered when the window occlusion state changes
|
||||
|
||||
`events.Mac.WindowDidChangeOrderingMode`
|
||||
: Triggered when the window ordering mode changes
|
||||
|
||||
`events.Mac.WindowDidChangeScreen`
|
||||
: Triggered when the window screen changes
|
||||
|
||||
`events.Mac.WindowDidChangeScreenParameters`
|
||||
: Triggered when the window screen parameters change
|
||||
|
||||
`events.Mac.WindowDidChangeScreenProfile`
|
||||
: Triggered when the window screen profile changes
|
||||
|
||||
`events.Mac.WindowDidChangeScreenSpace`
|
||||
: Triggered when the window screen space changes
|
||||
|
||||
`events.Mac.WindowDidChangeScreenSpaceProperties`
|
||||
: Triggered when the window screen space properties change
|
||||
|
||||
`events.Mac.WindowDidChangeSharingType`
|
||||
: Triggered when the window sharing type changes
|
||||
|
||||
`events.Mac.WindowDidChangeSpace`
|
||||
: Triggered when the window space changes
|
||||
|
||||
`events.Mac.WindowDidChangeSpaceOrderingMode`
|
||||
: Triggered when the window space ordering mode changes
|
||||
|
||||
`events.Mac.WindowDidChangeTitle`
|
||||
: Triggered when the window title changes
|
||||
|
||||
`events.Mac.WindowDidChangeToolbar`
|
||||
: Triggered when the window toolbar changes
|
||||
|
||||
`events.Mac.WindowDidChangeVisibility`
|
||||
: Triggered when the window visibility changes
|
||||
|
||||
`events.Mac.WindowDidDeminiaturize`
|
||||
: Triggered when the window is deminiaturized
|
||||
|
||||
`events.Mac.WindowDidEndSheet`
|
||||
: Triggered when the window ends a sheet
|
||||
|
||||
`events.Mac.WindowDidEnterFullScreen`
|
||||
: Triggered when the window enters fullscreen
|
||||
|
||||
`events.Mac.WindowDidEnterVersionBrowser`
|
||||
: Triggered when the window enters version browser
|
||||
|
||||
`events.Mac.WindowDidExitFullScreen`
|
||||
: Triggered when the window exits fullscreen
|
||||
|
||||
`events.Mac.WindowDidExitVersionBrowser`
|
||||
: Triggered when the window exits version browser
|
||||
|
||||
`events.Mac.WindowDidExpose`
|
||||
: Triggered when the window is exposed
|
||||
|
||||
`events.Mac.WindowDidFocus`
|
||||
: Triggered when the window is focused
|
||||
|
||||
`events.Mac.WindowDidMiniaturize`
|
||||
: Triggered when the window is miniaturized
|
||||
|
||||
`events.Mac.WindowDidMove`
|
||||
: Triggered when the window is moved
|
||||
|
||||
`events.Mac.WindowDidOrderOffScreen`
|
||||
: Triggered when the window is ordered off-screen
|
||||
|
||||
`events.Mac.WindowDidOrderOnScreen`
|
||||
: Triggered when the window is ordered on screen
|
||||
|
||||
`events.Mac.WindowDidResignKey`
|
||||
: Triggered when the window resigns key
|
||||
|
||||
`events.Mac.WindowDidResignMain`
|
||||
: Triggered when the window resigns main
|
||||
|
||||
`events.Mac.WindowDidResize`
|
||||
: Triggered when the window is resized
|
||||
|
||||
`events.Mac.WindowDidUpdate`
|
||||
: Triggered when the window updates
|
||||
|
||||
`events.Mac.WindowDidUpdateAlpha`
|
||||
: Triggered when the window alpha updates
|
||||
|
||||
`events.Mac.WindowDidUpdateCollectionBehavior`
|
||||
: Triggered when the window collection behavior updates
|
||||
|
||||
`events.Mac.WindowDidUpdateCollectionProperties`
|
||||
: Triggered when the window collection properties update
|
||||
|
||||
`events.Mac.WindowDidUpdateShadow`
|
||||
: Triggered when the window shadow updates
|
||||
|
||||
`events.Mac.WindowDidUpdateTitle`
|
||||
: Triggered when the window title updates
|
||||
|
||||
`events.Mac.WindowDidUpdateToolbar`
|
||||
: Triggered when the window toolbar updates
|
||||
|
||||
`events.Mac.WindowDidUpdateVisibility`
|
||||
: Triggered when the window visibility updates
|
||||
|
||||
`events.Mac.WindowShouldClose`
|
||||
: Triggered when the window should close
|
||||
|
||||
`events.Mac.WindowWillBecomeKey`
|
||||
: Triggered when the window will become key
|
||||
|
||||
`events.Mac.WindowWillBecomeMain`
|
||||
: Triggered when the window will become main
|
||||
|
||||
`events.Mac.WindowWillBeginSheet`
|
||||
: Triggered when the window will begin a sheet
|
||||
|
||||
`events.Mac.WindowWillChangeOrderingMode`
|
||||
: Triggered when the window will change ordering mode
|
||||
|
||||
`events.Mac.WindowWillClose`
|
||||
: Triggered when the window will close
|
||||
|
||||
`events.Mac.WindowWillDeminiaturize`
|
||||
: Triggered when the window will deminiaturize
|
||||
|
||||
`events.Mac.WindowWillEnterFullScreen`
|
||||
: Triggered when the window will enter fullscreen
|
||||
|
||||
`events.Mac.WindowWillEnterVersionBrowser`
|
||||
: Triggered when the window will enter version browser
|
||||
|
||||
`events.Mac.WindowWillExitFullScreen`
|
||||
: Triggered when the window will exit fullscreen
|
||||
|
||||
`events.Mac.WindowWillExitVersionBrowser`
|
||||
: Triggered when the window will exit version browser
|
||||
|
||||
`events.Mac.WindowWillFocus`
|
||||
: Triggered when the window will focus
|
||||
|
||||
`events.Mac.WindowWillMiniaturize`
|
||||
: Triggered when the window will miniaturize
|
||||
|
||||
`events.Mac.WindowWillMove`
|
||||
: Triggered when the window will move
|
||||
|
||||
`events.Mac.WindowWillOrderOffScreen`
|
||||
: Triggered when the window will order off-screen
|
||||
|
||||
`events.Mac.WindowWillOrderOnScreen`
|
||||
: Triggered when the window will order on screen`
|
||||
|
||||
`events.Mac.WindowWillResignMain`
|
||||
: Triggered when the window will resign main
|
||||
|
||||
`events.Mac.WindowWillResize`
|
||||
: Triggered when the window will resize
|
||||
|
||||
`events.Mac.WindowWillUnfocus`
|
||||
: Triggered when the window will unfocus`
|
||||
|
||||
`events.Mac.WindowWillUpdate`
|
||||
: Triggered when the window will update
|
||||
|
||||
`events.Mac.WindowWillUpdateAlpha`
|
||||
: Triggered when the window will update alpha
|
||||
|
||||
`events.Mac.WindowWillUpdateCollectionBehavior`
|
||||
: Triggered when the window will update collection behavior
|
||||
|
||||
`events.Mac.WindowWillUpdateCollectionProperties`
|
||||
: Triggered when the window will update collection properties
|
||||
|
||||
`events.Mac.WindowWillUpdateShadow`
|
||||
: Triggered when the window will update shadow
|
||||
|
||||
`events.Mac.WindowWillUpdateTitle`
|
||||
: Triggered when the window will update title
|
||||
|
||||
`events.Mac.WindowWillUpdateToolbar`
|
||||
: Triggered when the window will update toolbar
|
||||
|
||||
`events.Mac.WindowWillUpdateVisibility`
|
||||
: Triggered when the window will update visibility
|
||||
|
||||
`events.Mac.WindowWillUseStandardFrame`
|
||||
: Triggered when the window will use standard frame
|
||||
|
||||
`events.Mac.WebviewDidStartProvisionalNavigation`
|
||||
: Triggered when the webview starts a provisional navigation
|
||||
|
||||
`events.Mac.WebviewDidReceiveServerRedirectForProvisionalNavigation`
|
||||
: Triggered when the webview receives a server redirect for a provisional navigation
|
||||
|
||||
`events.Mac.WebviewDidFinishNavigation`
|
||||
: Triggered when the webview finishes navigation
|
||||
|
||||
`events.Mac.WebviewDidCommitNavigation`
|
||||
: Triggered when the webview commits navigation
|
||||
|
||||
`events.Mac.WindowFileDraggingEntered`
|
||||
: Triggered when files are dragged into the window`
|
||||
|
||||
`events.Mac.WindowFileDraggingPerformed`
|
||||
: Triggered when files are dragged in the window
|
||||
|
||||
`events.Mac.WindowFileDraggingExited`
|
||||
: Triggered when files are dragged out of the window
|
@ -1,79 +0,0 @@
|
||||
#### Windows Events
|
||||
|
||||
##### Application Events
|
||||
|
||||
`events.Windows.ApplicationStarted`
|
||||
: Triggered when the application starts
|
||||
|
||||
`events.Windows.SystemThemeChanged`
|
||||
: Triggered when the system theme changes
|
||||
|
||||
`events.Windows.APMPowerStatusChange`
|
||||
: Triggered when the system power status changes
|
||||
|
||||
`events.Windows.APMSuspend`
|
||||
: Triggered when the system suspends
|
||||
|
||||
`events.Windows.APMResumeAutomatic`
|
||||
: Triggered when the system resumes after a sleep
|
||||
|
||||
`events.Windows.APMResumeSuspend`
|
||||
: Triggered when the system resumes after a suspend and resume was triggered by the user
|
||||
|
||||
##### Window Events
|
||||
|
||||
`events.Windows.WebviewNavigationCompleted`
|
||||
: Triggered when the webview navigation is completed
|
||||
|
||||
`events.Windows.WindowInactive`
|
||||
: Triggered when the window is inactive
|
||||
|
||||
`events.Windows.WindowActive`
|
||||
: Triggered when the window is active
|
||||
|
||||
`events.Windows.ClickActive`
|
||||
: Triggered when the window is activated via a click
|
||||
|
||||
`events.Windows.MaximiseActive`
|
||||
: Triggered when the window is maximised
|
||||
|
||||
`events.Windows.UnMaximise`
|
||||
: Triggered when the window is unmaximised
|
||||
|
||||
`events.Windows.Fullscreen`
|
||||
: Triggered when the window is set to fullscreen
|
||||
|
||||
`events.Windows.UnFullscreen`
|
||||
: Triggered when the window is exited from fullscreene
|
||||
|
||||
`events.Windows.WindowRestore`
|
||||
: Triggered when the window is restored
|
||||
|
||||
`events.Windows.WindowMinimise`
|
||||
: Triggered when the window is minimised
|
||||
|
||||
`events.Windows.WindowUnminimise`
|
||||
: Triggered when the window is unminimised
|
||||
|
||||
`events.Windows.WindowClose`
|
||||
: Triggered before the window closes
|
||||
`events.Windows.WindowSetFocus`
|
||||
: Triggered when the window gains keyboard focus
|
||||
|
||||
`events.Windows.WindowKillFocus`
|
||||
: Triggered when the window loses keyboard focus
|
||||
|
||||
`events.Windows.WindowDragDrop`
|
||||
: Triggered when files are dropped on the window
|
||||
|
||||
`events.Windows.WindowDragEnter`
|
||||
: Triggered when a drag enters the window
|
||||
|
||||
`events.Windows.WindowDragLeave`
|
||||
: Triggered when a drag leaves the window
|
||||
|
||||
`events.Windows.WindowDragOver`
|
||||
: Triggered when a drag is over the window
|
||||
|
||||
`events.Windows.WindowDidMove`
|
||||
: Triggered after a window has moved
|
@ -1,50 +0,0 @@
|
||||
# Main Thread Functions
|
||||
|
||||
These methods are utility functions to run code on the main thread. This is
|
||||
required when you want to run custom code on the UI thread.
|
||||
|
||||
### InvokeSync
|
||||
|
||||
API: `InvokeSync(fn func())`
|
||||
|
||||
This function runs the passed function (`fn`) synchronously. It uses a WaitGroup
|
||||
(`wg`) to ensure that the main thread waits for the `fn` function to finish
|
||||
before it continues. If a panic occurs inside `fn`, it will be passed to the
|
||||
handler function `PanicHandler`, defined in the application options.
|
||||
|
||||
### InvokeSyncWithResult
|
||||
|
||||
API: `InvokeSyncWithResult[T any](fn func() T) (res T)`
|
||||
|
||||
This function works similarly to `InvokeSync(fn func())`, however, it yields a
|
||||
result. Use this for calling any function with a single return.
|
||||
|
||||
### InvokeSyncWithError
|
||||
|
||||
API: `InvokeSyncWithError(fn func() error) (err error)`
|
||||
|
||||
This function runs `fn` synchronously and returns any error that `fn` produces.
|
||||
Note that this function will recover from a panic if one occurs during `fn`'s
|
||||
execution.
|
||||
|
||||
### InvokeSyncWithResultAndError
|
||||
|
||||
API:
|
||||
`InvokeSyncWithResultAndError[T any](fn func() (T, error)) (res T, err error)`
|
||||
|
||||
This function runs `fn` synchronously and returns both a result of type `T` and
|
||||
an error.
|
||||
|
||||
### InvokeAsync
|
||||
|
||||
API: `InvokeAsync(fn func())`
|
||||
|
||||
This function runs `fn` asynchronously. It runs the given function on the main
|
||||
thread. If a panic occurs inside `fn`, it will be passed to the handler function
|
||||
`PanicHandler`, defined in the application options.
|
||||
|
||||
---
|
||||
|
||||
_Note_: These functions will block execution until `fn` has finished. It's
|
||||
critical to ensure that `fn` doesn't block. If you need to run a function that
|
||||
blocks, use `InvokeAsync` instead.
|
@ -1,69 +0,0 @@
|
||||
# Menu
|
||||
|
||||
Menus can be created and added to the application. They can be used to create
|
||||
context menus, system tray menus and application menus.
|
||||
|
||||
To create a new menu, call:
|
||||
|
||||
```go
|
||||
// Create a new menu
|
||||
menu := app.NewMenu()
|
||||
```
|
||||
|
||||
The following operations are then available on the `Menu` type:
|
||||
|
||||
### Add
|
||||
|
||||
API: `Add(label string) *MenuItem`
|
||||
|
||||
This method takes a `label` of type `string` as an input and adds a new
|
||||
`MenuItem` with the given label to the menu. It returns the `MenuItem` added.
|
||||
|
||||
### AddSeparator
|
||||
|
||||
API: `AddSeparator()`
|
||||
|
||||
This method adds a new separator `MenuItem` to the menu.
|
||||
|
||||
### AddCheckbox
|
||||
|
||||
API: `AddCheckbox(label string, enabled bool) *MenuItem`
|
||||
|
||||
This method takes a `label` of type `string` and `enabled` of type `bool` as
|
||||
inputs and adds a new checkbox `MenuItem` with the given label and enabled state
|
||||
to the menu. It returns the `MenuItem` added.
|
||||
|
||||
### AddRadio
|
||||
|
||||
API: `AddRadio(label string, enabled bool) *MenuItem`
|
||||
|
||||
This method takes a `label` of type `string` and `enabled` of type `bool` as
|
||||
inputs and adds a new radio `MenuItem` with the given label and enabled state to
|
||||
the menu. It returns the `MenuItem` added.
|
||||
|
||||
### Update
|
||||
|
||||
API: `Update()`
|
||||
|
||||
This method processes any radio groups and updates the menu if a menu
|
||||
implementation is not initialized.
|
||||
|
||||
### AddSubmenu
|
||||
|
||||
API: `AddSubmenu(s string) *Menu`
|
||||
|
||||
This method takes a `s` of type `string` as input and adds a new submenu
|
||||
`MenuItem` with the given label to the menu. It returns the submenu added.
|
||||
|
||||
### AddRole
|
||||
|
||||
API: `AddRole(role Role) *Menu`
|
||||
|
||||
This method takes `role` of type `Role` as input, adds it to the menu if it is
|
||||
not `nil` and returns the `Menu`.
|
||||
|
||||
### SetLabel
|
||||
|
||||
API: `SetLabel(label string)`
|
||||
|
||||
This method sets the `label` of the `Menu`.
|
@ -1,112 +0,0 @@
|
||||
# System Tray
|
||||
|
||||
The system tray houses notification area on a desktop environment, which can
|
||||
contain both icons of currently-running applications and specific system
|
||||
notifications.
|
||||
|
||||
You create a system tray by calling `app.NewSystemTray()`:
|
||||
|
||||
```go
|
||||
// Create a new system tray
|
||||
tray := app.NewSystemTray()
|
||||
```
|
||||
|
||||
The following methods are available on the `SystemTray` type:
|
||||
|
||||
### SetLabel
|
||||
|
||||
API: `SetLabel(label string)`
|
||||
|
||||
The `SetLabel` method sets the tray's label.
|
||||
|
||||
### Label
|
||||
|
||||
API: `Label() string`
|
||||
|
||||
The `Label` method retrieves the tray's label.
|
||||
|
||||
### PositionWindow
|
||||
|
||||
API: `PositionWindow(*WebviewWindow, offset int) error`
|
||||
|
||||
The `PositionWindow` method calls both `AttachWindow` and `WindowOffset`
|
||||
methods.
|
||||
|
||||
### SetIcon
|
||||
|
||||
API: `SetIcon(icon []byte) *SystemTray`
|
||||
|
||||
The `SetIcon` method sets the system tray's icon.
|
||||
|
||||
### SetDarkModeIcon
|
||||
|
||||
API: `SetDarkModeIcon(icon []byte) *SystemTray`
|
||||
|
||||
The `SetDarkModeIcon` method sets the system tray's icon when in dark mode.
|
||||
|
||||
### SetMenu
|
||||
|
||||
API: `SetMenu(menu *Menu) *SystemTray`
|
||||
|
||||
The `SetMenu` method sets the system tray's menu.
|
||||
|
||||
### Destroy
|
||||
|
||||
API: `Destroy()`
|
||||
|
||||
The `Destroy` method destroys the system tray instance.
|
||||
|
||||
### OnClick
|
||||
|
||||
API: `OnClick(handler func()) *SystemTray`
|
||||
|
||||
The `OnClick` method sets the function to execute when the tray icon is clicked.
|
||||
|
||||
### OnRightClick
|
||||
|
||||
API: `OnRightClick(handler func()) *SystemTray`
|
||||
|
||||
The `OnRightClick` method sets the function to execute when right-clicking the
|
||||
tray icon.
|
||||
|
||||
### OnDoubleClick
|
||||
|
||||
API: `OnDoubleClick(handler func()) *SystemTray`
|
||||
|
||||
The `OnDoubleClick` method sets the function to execute when double-clicking the
|
||||
tray icon.
|
||||
|
||||
### OnRightDoubleClick
|
||||
|
||||
API: `OnRightDoubleClick(handler func()) *SystemTray`
|
||||
|
||||
The `OnRightDoubleClick` method sets the function to execute when right
|
||||
double-clicking the tray icon.
|
||||
|
||||
### AttachWindow
|
||||
|
||||
API: `AttachWindow(window *WebviewWindow) *SystemTray`
|
||||
|
||||
The `AttachWindow` method attaches a window to the system tray. The window will
|
||||
be shown when the system tray icon is clicked.
|
||||
|
||||
### WindowOffset
|
||||
|
||||
API: `WindowOffset(offset int) *SystemTray`
|
||||
|
||||
The `WindowOffset` method sets the gap in pixels between the system tray and the
|
||||
window.
|
||||
|
||||
### WindowDebounce
|
||||
|
||||
API: `WindowDebounce(debounce time.Duration) *SystemTray`
|
||||
|
||||
The `WindowDebounce` method sets a debounce time. In the context of Windows,
|
||||
this is used to specify how long to wait before responding to a mouse up event
|
||||
on the notification icon.
|
||||
|
||||
### OpenMenu
|
||||
|
||||
API: `OpenMenu()`
|
||||
|
||||
The `OpenMenu` method opens the menu associated with the system tray.
|
@ -1,114 +0,0 @@
|
||||
# Window
|
||||
|
||||
To create a window, use
|
||||
[Application.NewWebviewWindow](application.md#newwebviewwindow) or
|
||||
[Application.NewWebviewWindowWithOptions](application.md#newwebviewwindowwithoptions).
|
||||
The former creates a window with default options, while the latter allows you to
|
||||
specify custom options.
|
||||
|
||||
These methods are callable on the returned WebviewWindow object:
|
||||
|
||||
### SetTitle
|
||||
|
||||
API: `SetTitle(title string) *WebviewWindow`
|
||||
|
||||
This method updates the window title to the provided string. It returns the
|
||||
WebviewWindow object, allowing for method chaining.
|
||||
|
||||
### Name
|
||||
|
||||
API: `Name() string`
|
||||
|
||||
This function returns the name of the WebviewWindow.
|
||||
|
||||
### SetSize
|
||||
|
||||
API: `SetSize(width, height int) *WebviewWindow`
|
||||
|
||||
This method sets the size of the WebviewWindow to the provided width and height
|
||||
parameters. If the dimensions provided exceed the constraints, they are adjusted
|
||||
appropriately.
|
||||
|
||||
### SetAlwaysOnTop
|
||||
|
||||
API: `SetAlwaysOnTop(b bool) *WebviewWindow`
|
||||
|
||||
This function sets the window to stay on top based on the boolean flag provided.
|
||||
|
||||
### Show
|
||||
|
||||
API: `Show() *WebviewWindow`
|
||||
|
||||
`Show` method is used to make the window visible. If the window is not running,
|
||||
it first invokes the `run` method to start the window and then makes it visible.
|
||||
|
||||
### Hide
|
||||
|
||||
API: `Hide() *WebviewWindow`
|
||||
|
||||
`Hide` method is used to hide the window. It sets the hidden status of the
|
||||
window to true and emits the window hide event.
|
||||
|
||||
### SetURL
|
||||
|
||||
API: `SetURL(s string) *WebviewWindow`
|
||||
|
||||
`SetURL` method is used to set the URL of the window to the given URL string.
|
||||
|
||||
### SetZoom
|
||||
|
||||
API: `SetZoom(magnification float64) *WebviewWindow`
|
||||
|
||||
`SetZoom` method sets the zoom level of the window content to the provided
|
||||
magnification level.
|
||||
|
||||
### GetZoom
|
||||
|
||||
API: `GetZoom() float64`
|
||||
|
||||
`GetZoom` function returns the current zoom level of the window content.
|
||||
|
||||
### GetScreen
|
||||
|
||||
API: `GetScreen() (*Screen, error)`
|
||||
|
||||
`GetScreen` method returns the screen on which the window is displayed.
|
||||
|
||||
### SetFrameless
|
||||
|
||||
API: `SetFrameless(frameless bool) *WebviewWindow`
|
||||
|
||||
This function is used to remove the window frame and title bar. It toggles the
|
||||
framelessness of the window according to the boolean value provided (true for
|
||||
frameless, false for framed).
|
||||
|
||||
### RegisterContextMenu
|
||||
|
||||
API: `RegisterContextMenu(name string, menu *Menu)`
|
||||
|
||||
This function is used to register a context menu and assigns it the given name.
|
||||
|
||||
### NativeWindowHandle
|
||||
|
||||
API: `NativeWindowHandle() (uintptr, error)`
|
||||
|
||||
This function is used to fetch the platform native window handle for the window.
|
||||
|
||||
### Focus
|
||||
|
||||
API: `Focus()`
|
||||
|
||||
This function is used to focus the window.
|
||||
|
||||
### SetEnabled
|
||||
|
||||
API: `SetEnabled(enabled bool)`
|
||||
|
||||
This function is used to enable/disable the window based on the provided boolean
|
||||
value.
|
||||
|
||||
### SetPosition
|
||||
|
||||
API: `SetPosition(x int, y int)`
|
||||
|
||||
This function sets the absolute position of the window in the screen.
|
@ -1,204 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
<!--
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
- `Added` for new features.
|
||||
- `Changed` for changes in existing functionality.
|
||||
- `Deprecated` for soon-to-be removed features.
|
||||
- `Removed` for now removed features.
|
||||
- `Fixed` for any bug fixes.
|
||||
- `Security` in case of vulnerabilities.
|
||||
|
||||
-->
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- `app.OpenFileManager(path string, selectFile bool)` to open the system file manager to the path `path` with optional highlighting via `selectFile` by [@Krzysztofz01](https://github.com/Krzysztofz01) [@rcalixte](https://github.com/rcalixte)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix Sveltekit template CSS referance by @atterpac in [#3945](https://github.com/wailsapp/wails/pull/3945)
|
||||
- [darwin] Ensure `windowDidBecomeKey` callback is running on main thread by [@leaanthony](https://github.com/leaanthony)
|
||||
- Ensure key callbacks in window run() are called on the main thread by [@leaanthony](https://github.com/leaanthony)
|
||||
- [darwin] Support fullscreen for frameless windows by [@leaanthony](https://github.com/leaanthony)
|
||||
|
||||
## v3.0.0-alpha.8.3 - 2024-12-07
|
||||
|
||||
### Changed
|
||||
|
||||
- Ensure for of taskfile is used by @leaanthony
|
||||
|
||||
## v3.0.0-alpha.8.2 - 2024-12-07
|
||||
|
||||
### Changed
|
||||
- Update fork of Taskfile to fix version issues when installing using `go install` by @leaanthony
|
||||
|
||||
## v3.0.0-alpha.8.1 - 2024-12-07
|
||||
|
||||
### Changed
|
||||
- Using fork of Taskfile to fix version issues when installing using `go install` by @leaanthony
|
||||
|
||||
## v3.0.0-alpha.8 - 2024-12-06
|
||||
|
||||
### Added
|
||||
- Support of linux packaging of deb,rpm, and arch linux packager builds by @atterpac in [#3909](https://github.com/wailsapp/wails/3909)
|
||||
- Added Support for darwin universal builds and packages by [ansxuman](https://github.com/ansxuman) in [#3902](https://github.com/wailsapp/wails/pull/3902)
|
||||
- Events documentation to the mkdocs webite by [atterpac](https://github.com/atterpac) in [#3867](https://github.com/wailsapp/wails/pull/3867)
|
||||
- Templates for sveltekit and sveltekit-ts that are set for non-SSR development by [atterpac](https://github.com/atterpac) in [#3829](https://github.com/wailsapp/wails/pull/3829)
|
||||
- Update build assets using new `wails3 update build-assets` command by [leaanthony](https://github.com/leaanthony)
|
||||
- Example to test the HTML Drag and Drop API by [FerroO2000](https://github.com/FerroO2000) in [#3856](https://github.com/wailsapp/wails/pull/3856)
|
||||
- File Association support by [leaanthony](https://github.com/leaanthony) in [#3873](https://github.com/wailsapp/wails/pull/3873)
|
||||
- New `wails3 generate runtime` command by [leaanthony](https://github.com/leaanthony)
|
||||
- New `InitialPosition` option to specify if the window should be centered or positioned at the given X/Y location by [leaanthony](https://github.com/leaanthony) in [#3885](https://github.com/wailsapp/wails/pull/3885)
|
||||
- Add `Path` & `Paths` methods to `application` package by [ansxuman](https://github.com/ansxuman) and [leaanthony](https://github.com/leaanthony) in [#3823](https://github.com/wailsapp/wails/pull/3823)
|
||||
- Added `GeneralAutofillEnabled` and `PasswordAutosaveEnabled` Windows options by [leaanthony](https://github.com/leaanthony) in [#3766](https://github.com/wailsapp/wails/pull/3766)
|
||||
- Added the ability to retrieve the window calling a service method by [leaanthony](https://github.com/leaanthony)
|
||||
in [#3888](https://github.com/wailsapp/wails/pull/3888)
|
||||
- Added `EnabledFeatures` and `DisabledFeatures` options for Webview2 by [leaanthony](https://github.com/leaanthony).
|
||||
-
|
||||
### Changed
|
||||
- `service.OnStartup` now shutdowns the application on error and runs `service.OnShutdown`for any prior services that started by @atterpac in [#3920](https://github.com/wailsapp/wails/pull/3920)
|
||||
- Refactored systray click messaging to better align with user interactions by @atterpac in [#3907](https://github.com/wailsapp/wails/pull/3907)
|
||||
- Asset embed to include `all:frontend/dist` to support frameworks that generate subfolders by @atterpac in [#3887](https://github.com/wailsapp/wails/pull/3887)
|
||||
- Taskfile refactor by [leaanthony](https://github.com/leaanthony) in [#3748](https://github.com/wailsapp/wails/pull/3748)
|
||||
- Upgrade to `go-webview2` v1.0.16 by [leaanthony](https://github.com/leaanthony)
|
||||
- Fixed `Screen` type to include `ID` not `Id` by [etesam913](https://github.com/etesam913) in [#3778](https://github.com/wailsapp/wails/pull/3778)
|
||||
- Update `go.mod.tmpl` wails version to support `application.ServiceOptions` by [northes](https://github.com/northes) in [#3836](https://github.com/wailsapp/wails/pull/3836)
|
||||
- Fixed service name determination by [windom](https://github.com/windom/) in [#3827](https://github.com/wailsapp/wails/pull/3827)
|
||||
- mkdocs serve now uses docker by [leaanthony](https://github.com/leaanthony)
|
||||
- Consolidated dev config into `config.yml` by [leaanthony](https://github.com/leaanthony)
|
||||
- Systray dialog now defaults to the application icon if available (Windows) by [@leaanthony](https://github.com/leaanthony)
|
||||
- Better reporting of GPU + Memory for macOS by [@leaanthony](https://github.com/leaanthony)
|
||||
- Removed `WebviewGpuIsDisabled` and `EnableFraudulentWebsiteWarnings` (superseded by `EnabledFeatures` and `DisabledFeatures` options) by [leaanthony](https://github.com/leaanthony)
|
||||
|
||||
### Fixed
|
||||
- Fixed deadlock in Linux dialog for multiple selections caused by unclosed channel variable by @michael-freling in [#3925](https://github.com/wailsapp/wails/pull/3925)
|
||||
- Fixed cross-platform cleanup for .syso files during Windows build by [ansxuman](https://github.com/ansxuman) in [#3924](https://github.com/wailsapp/wails/pull/3924)
|
||||
- Fixed amd64 appimage compile by @atterpac in [#3898](https://github.com/wailsapp/wails/pull/3898)
|
||||
- Fixed build assets update by @ansxuman in [#3901](https://github.com/wailsapp/wails/pull/3901)
|
||||
- Fixed Linux systray `OnClick` and `OnRightClick` implementation by @atterpac in [#3886](https://github.com/wailsapp/wails/pull/3886)
|
||||
- Fixed `AlwaysOnTop` not working on Mac by [leaanthony](https://github.com/leaanthony) in [#3841](https://github.com/wailsapp/wails/pull/3841)
|
||||
- [darwin] Fixed `application.NewEditMenu` including a duplicate `PasteAndMatchStyle` role in the edit menu on Darwin by [johnmccabe](https://github.com/johnmccabe) in [#3839](https://github.com/wailsapp/wails/pull/3839)
|
||||
- [linux] Fixed aarch64 compilation [#3840](https://github.com/wailsapp/wails/issues/3840) in [#3854](https://github.com/wailsapp/wails/pull/3854) by [kodflow](https://github.com/kodflow)
|
||||
- [windows] Fixed radio group menu items by [@leaanthony](https://github.com/leaanthony)
|
||||
- Fix error on building runnable .app on MacOS when 'name' and 'outputfilename' are different. by @nickisworking in https://github.com/wailsapp/wails/pull/3789
|
||||
|
||||
## v3.0.0-alpha.7 - 2024-09-18
|
||||
|
||||
### Added
|
||||
- [windows] New DIP system for Enhanced High DPI Monitor Support by [mmghv](https://github.com/mmghv) in [#3665](https://github.com/wailsapp/wails/pull/3665)
|
||||
- [windows] Window class name option by [windom](https://github.com/windom/) in [#3682](https://github.com/wailsapp/wails/pull/3682)
|
||||
- Services have been expanded to provide plugin functionality. By [atterpac](https://github.com/atterpac) and [leaanthony](https://github.com/leaanthony) in [#3570](https://github.com/wailsapp/wails/pull/3570)
|
||||
|
||||
### Changed
|
||||
- Events API change: `On`/`Emit` -> user events, `OnApplicationEvent` -> Application Events `OnWindowEvent` -> Window Events, by [leaanthony](https://github.com/leaanthony)
|
||||
- Fix for Events API on Linux by [TheGB0077](https://github.com/TheGB0077) in [#3734](https://github.com/wailsapp/wails/pull/3734)
|
||||
- [CI] improvements to actions & enable to run actions also in forks and branches prefixed with `v3/` or `v3-` by [stendler](https://github.com/stendler) in [#3747](https://github.com/wailsapp/wails/pull/3747)
|
||||
|
||||
### Fixed
|
||||
- Fixed bug with usage of customEventProcessor in drag-n-drop example by [etesam913](https://github.com/etesam913) in [#3742](https://github.com/wailsapp/wails/pull/3742)
|
||||
- [linux] Fixed linux compile error introduced by IgnoreMouseEvents addition by [atterpac](https://github.com/atterpac) in [#3721](https://github.com/wailsapp/wails/pull/3721)
|
||||
- [windows] Fixed syso icon file generation bug by [atterpac](https://github.com/atterpac) in [#3675](https://github.com/wailsapp/wails/pull/3675)
|
||||
- [linux] Fix to run natively in wayland incorporated from [#1811](https://github.com/wailsapp/wails/pull/1811) in [#3614](https://github.com/wailsapp/wails/pull/3614) by [@stendler](https://github.com/stendler)
|
||||
- Do not bind internal service methods in [#3720](https://github.com/wailsapp/wails/pull/3720) by [leaanthony](https://github.com/leaanthony)
|
||||
- [windows] Fixed system tray startup panic in [#3693](https://github.com/wailsapp/wails/issues/3693) by [@DeltaLaboratory](https://github.com/DeltaLaboratory)
|
||||
- Do not bind internal service methods in [#3720](https://github.com/wailsapp/wails/pull/3720) by [leaanthony](https://github.com/leaanthony)
|
||||
- [windows] Fixed system tray startup panic in [#3693](https://github.com/wailsapp/wails/issues/3693) by [@DeltaLaboratory](https://github.com/DeltaLaboratory)
|
||||
- Major menu item refactor and event handling. Mainly improves macOS for now. By [leaanthony](https://github.com/leaanthony)
|
||||
- Fix tests after plugins and event refactor in [#3746](https://github.com/wailsapp/wails/pull/3746) by [@stendler](https://github.com/stendler)
|
||||
- [windows] Fixed `Failed to unregister class Chrome_WidgetWin_0` warning. By [leaanthony](https://github.com/leaanthony)
|
||||
|
||||
## v3.0.0-alpha.6 - 2024-07-30
|
||||
|
||||
### Fixed
|
||||
- Module issues
|
||||
|
||||
## v3.0.0-alpha.5 - 2024-07-30
|
||||
|
||||
|
||||
### Added
|
||||
- [linux] WindowDidMove / WindowDidResize events in [#3580](https://github.com/wailsapp/wails/pull/3580)
|
||||
- [windows] WindowDidResize event in (https://github.com/wailsapp/wails/pull/3580)
|
||||
- [darwin] add Event ApplicationShouldHandleReopen to be able to handle dock icon click by @5aaee9 in [#2991](https://github.com/wailsapp/wails/pull/2991)
|
||||
- [darwin] add getPrimaryScreen/getScreens to impl by @tmclane in [#2618](https://github.com/wailsapp/wails/pull/2618)
|
||||
- [darwin] add option for showing the toolbar in fullscreen mode on macOS by [@fbbdev](https://github.com/fbbdev) in [#3282](https://github.com/wailsapp/wails/pull/3282)
|
||||
- [linux] add onKeyPress logic to convert linux keypress into an accelerator @[Atterpac](https://github.com/Atterpac) in[#3022](https://github.com/wailsapp/wails/pull/3022])
|
||||
- [linux] add task `run:linux` by [@marcus-crane](https://github.com/marcus-crane) in [#3146](https://github.com/wailsapp/wails/pull/3146)
|
||||
- Export `SetIcon` method by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3147)
|
||||
- Improve `OnShutdown` by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3189)
|
||||
- Restore `ToggleMaximise` method in `Window` interface by [@fbbdev](https://github.com/fbbdev) in [#3281](https://github.com/wailsapp/wails/pull/3281)
|
||||
- Added more information to `Environment()`. By @leaanthony in [aba82cc](https://github.com/wailsapp/wails/commit/aba82cc52787c97fb99afa58b8b63a0004b7ff6c) based on [PR](https://github.com/wailsapp/wails/pull/2044) by @Mai-Lapyst
|
||||
- Expose the `WebviewWindow.IsFocused` method on the `Window` interface by [@fbbdev](https://github.com/fbbdev) in [#3295](https://github.com/wailsapp/wails/pull/3295)
|
||||
- Support multiple space-separated trigger events in the WML system by [@fbbdev](https://github.com/fbbdev) in [#3295](https://github.com/wailsapp/wails/pull/3295)
|
||||
- Add ESM exports from the bundled JS runtime script by [@fbbdev](https://github.com/fbbdev) in [#3295](https://github.com/wailsapp/wails/pull/3295)
|
||||
- Add binding generator flag for using the bundled JS runtime script instead of the npm package by [@fbbdev](https://github.com/fbbdev) in [#3334](https://github.com/wailsapp/wails/pull/3334)
|
||||
- Implement `setIcon` on linux by [@abichinger](https://github.com/abichinger) in [#3354](https://github.com/wailsapp/wails/pull/3354)
|
||||
- Add flag `-port` to dev command and support environment variable `WAILS_VITE_PORT` by [@abichinger](https://github.com/abichinger) in [#3429](https://github.com/wailsapp/wails/pull/3429)
|
||||
- Add tests for bound method calls by [@abichinger](https://github.com/abichinger) in [#3431](https://github.com/wailsapp/wails/pull/3431)
|
||||
- [windows] add `SetIgnoreMouseEvents` for already created window by [@bruxaodev](https://github.com/bruxaodev) in [#3667](https://github.com/wailsapp/wails/pull/3667)
|
||||
- [darwin] Add ability to set a window's stacking level (order) by [@OlegGulevskyy](https://github.com/OlegGulevskyy) in [#3674](https://github.com/wailsapp/wails/pull/3674)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed resize event messaging by [atterpac](https://github.com/atterpac) in [#3606](https://github.com/wailsapp/wails/pull/3606)
|
||||
- [linux] Fixed theme handling error on NixOS by [tmclane](https://github.com/tmclane) in [#3515)(https://github.com/wailsapp/wails/pull/3515)
|
||||
- Fixed cross volume project install for windows by [atterpac](https://github.com/atterac) in [#3512](https://github.com/wailsapp/wails/pull/3512)
|
||||
- Fixed react template css to show footer by [atterpac](https://github.com/atterpac) in [#3477](https://github.com/wailsapp/wails/pull/3477)
|
||||
- Fixed zombie processes when working in devmode by updating to latest refresh by [Atterpac](https://github.com/atterpac) in [#3320](https://github.com/wailsapp/wails/pull/3320).
|
||||
- Fixed appimage webkit file sourcing by [Atterpac](https://github.com/atterpac) in [#3306](https://github.com/wailsapp/wails/pull/3306).
|
||||
- Fixed Doctor apt package verify by [Atterpac](https://github.com/Atterpac) in [#2972](https://github.com/wailsapp/wails/pull/2972).
|
||||
- Fixed application frozen when quit (Darwin) by @5aaee9 in [#2982](https://github.com/wailsapp/wails/pull/2982)
|
||||
- Fixed background colours of examples on Windows by [mmghv](https://github.com/mmghv) in [#2750](https://github.com/wailsapp/wails/pull/2750).
|
||||
- Fixed default context menus by [mmghv](https://github.com/mmghv) in [#2753](https://github.com/wailsapp/wails/pull/2753).
|
||||
- Fixed hex values for arrow keys on Darwin by [jaybeecave](https://github.com/jaybeecave) in [#3052](https://github.com/wailsapp/wails/pull/3052).
|
||||
- Set drag-n-drop for windows to working. Added by [@pylotlight](https://github.com/pylotlight) in [PR](https://github.com/wailsapp/wails/pull/3039)
|
||||
- Fixed bug for linux in doctor in the event user doesn't have proper drivers installed. Added by [@pylotlight](https://github.com/pylotlight) in [PR](https://github.com/wailsapp/wails/pull/3032)
|
||||
- Fix dpi scaling on start up (windows). Changed by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3145)
|
||||
- Fix replace line in `go.mod` to use relative paths. Fixes Windows paths with spaces - @leaanthony.
|
||||
- Fix MacOS systray click handling when no attached window by [thomas-senechal](https://github.com/thomas-senechal) in PR [#3207](https://github.com/wailsapp/wails/pull/3207)
|
||||
- Fix failing Windows build due to unknown option by [thomas-senechal](https://github.com/thomas-senechal) in PR [#3208](https://github.com/wailsapp/wails/pull/3208)
|
||||
- Fix crash on windows left clicking the systray icon when not having an attached window [tw1nk](https://github.com/tw1nk) in PR [#3271](https://github.com/wailsapp/wails/pull/3271)
|
||||
- Fix wrong baseURL when open window twice by @5aaee9 in PR [#3273](https://github.com/wailsapp/wails/pull/3273)
|
||||
- Fix ordering of if branches in `WebviewWindow.Restore` method by [@fbbdev](https://github.com/fbbdev) in [#3279](https://github.com/wailsapp/wails/pull/3279)
|
||||
- Correctly compute `startURL` across multiple `GetStartURL` invocations when `FRONTEND_DEVSERVER_URL` is present. [#3299](https://github.com/wailsapp/wails/pull/3299)
|
||||
- Fix the JS type of the `Screen` struct to match its Go counterpart by [@fbbdev](https://github.com/fbbdev) in [#3295](https://github.com/wailsapp/wails/pull/3295)
|
||||
- Fix the `WML.Reload` method to ensure proper cleanup of registered event listeners by [@fbbdev](https://github.com/fbbdev) in [#3295](https://github.com/wailsapp/wails/pull/3295)
|
||||
- Fix custom context menu closing immediately on linux by [@abichinger](https://github.com/abichinger) in [#3330](https://github.com/wailsapp/wails/pull/3330)
|
||||
- Fix the output path and extension of model files produced by the binding generator by [@fbbdev](https://github.com/fbbdev) in [#3334](https://github.com/wailsapp/wails/pull/3334)
|
||||
- Fix the import paths of model files in JS code produced by the binding generator by [@fbbdev](https://github.com/fbbdev) in [#3334](https://github.com/wailsapp/wails/pull/3334)
|
||||
- Fix drag-n-drop on some linux distros by [@abichinger](https://github.com/abichinger) in [#3346](https://github.com/wailsapp/wails/pull/3346)
|
||||
- Fix missing task for macOS when using `wails3 task dev` by [@hfoxy](https://github.com/hfoxy) in [#3417](https://github.com/wailsapp/wails/pull/3417)
|
||||
- Fix registering events causing a nil map assignment by [@hfoxy](https://github.com/hfoxy) in [#3426](https://github.com/wailsapp/wails/pull/3426)
|
||||
- Fix unmarshaling of bound method parameters by [@fbbdev](https://github.com/fbbdev) in [#3431](https://github.com/wailsapp/wails/pull/3431)
|
||||
- Fix handling of multiple return values from bound methods by [@fbbdev](https://github.com/fbbdev) in [#3431](https://github.com/wailsapp/wails/pull/3431)
|
||||
- Fix doctor detection of npm that is not installed with system package manager by [@pekim](https://github.com/pekim) in [#3458](https://github.com/wailsapp/wails/pull/3458)
|
||||
- Fix missing MicrosoftEdgeWebview2Setup.exe. Thanks to [@robin-samuel](https://github.com/robin-samuel).
|
||||
- Fix random crash on linux due to window ID handling by @leaanthony. Based on PR [#3466](https://github.com/wailsapp/wails/pull/3622) by [@5aaee9](https://github.com/5aaee9).
|
||||
- Fix systemTray.setIcon crashing on Linux by [@windom](https://github.com/windom/) in [#3636](https://github.com/wailsapp/wails/pull/3636).
|
||||
- Fix Ensure Window Frame is Applied on First Call in `setFrameless` Function on Windows by [@bruxaodev](https://github.com/bruxaodev/) in [#3691](https://github.com/wailsapp/wails/pull/3691).
|
||||
|
||||
### Changed
|
||||
|
||||
- Renamed `AbsolutePosition()` to `Position()` by [mmghv](https://github.com/mmghv) in [#3611](https://github.com/wailsapp/wails/pull/3611)
|
||||
- Update linux webkit dependency to webkit2gtk-4.1 over webkitgtk2-4.0 to support Ubuntu 24.04 LTS by [atterpac](https://github.com/atterpac) in [#3461](https://github.com/wailsapp/wails/pull/3461)
|
||||
- The bundled JS runtime script is now an ESM module: script tags importing it must have the `type="module"` attribute. By [@fbbdev](https://github.com/fbbdev) in [#3295](https://github.com/wailsapp/wails/pull/3295)
|
||||
- The `@wailsio/runtime` package does not publish its API on the `window.wails` object, and does not start the WML system. This has been done to improve encapsulation. The WML system can be started manually if desired by calling the new `WML.Enable` method. The bundled JS runtime script still performs both operations automatically. By [@fbbdev](https://github.com/fbbdev) in [#3295](https://github.com/wailsapp/wails/pull/3295)
|
||||
- The Window API module `@wailsio/runtime/src/window` now exposes the containing window object as a default export. It is not possible anymore to import individual methods through ESM named or namespace import syntax.
|
||||
- The JS window API has been updated to match the current Go `WebviewWindow` API. Some methods have changed name or prototype, specifically: `Screen` becomes `GetScreen`; `GetZoomLevel`/`SetZoomLevel` become `GetZoom`/`SetZoom`; `GetZoom`, `Width` and `Height` now return values directly instead of wrapping them within objects. By [@fbbdev](https://github.com/fbbdev) in [#3295](https://github.com/wailsapp/wails/pull/3295)
|
||||
- The binding generator now uses calls by ID by default. The `-id` CLI option has been removed. Use the `-names` CLI option to switch back to calls by name. By [@fbbdev](https://github.com/fbbdev) in [#3468](https://github.com/wailsapp/wails/pull/3468)
|
||||
- New binding code layout: output files were previously organised in folders named after their containing package; now full Go import paths are used, including the module path. By [@fbbdev](https://github.com/fbbdev) in [#3468](https://github.com/wailsapp/wails/pull/3468)
|
||||
- The struct field `application.Options.Bind` has been renamed to `application.Options.Services`. By [@fbbdev](https://github.com/fbbdev) in [#3468](https://github.com/wailsapp/wails/pull/3468)
|
||||
- New syntax for binding services: service instances must now be wrapped in a call to `application.NewService`. By [@fbbdev](https://github.com/fbbdev) in [#3468](https://github.com/wailsapp/wails/pull/3468)
|
||||
- Disable spinner on Non-Terminal or CI Environment by [@DeltaLaboratory](https://github.com/DeltaLaboratory) in [#3574](https://github.com/wailsapp/wails/pull/3574)
|
||||
|
||||
### Removed
|
||||
|
||||
### Deprecated
|
||||
|
||||
### Security
|
@ -1,22 +0,0 @@
|
||||
# Changes for v3
|
||||
|
||||
!!! note
|
||||
This is currently an unsorted brain dump of changes. It will be organised into a more readable format soon.
|
||||
|
||||
--8<--
|
||||
./docs/en/development/changes_events.md
|
||||
./docs/en/development/changes_window.md
|
||||
./docs/en/development/changes_systray.md
|
||||
./docs/en/development/changes_bindings.md
|
||||
./docs/en/development/changes_dragndrop.md
|
||||
./docs/en/development/changes_context_menus.md
|
||||
./docs/en/development/changes_dialogs.md
|
||||
./docs/en/development/changes_clipboard.md
|
||||
./docs/en/development/changes_wml.md
|
||||
./docs/en/development/changes_plugins.md
|
||||
./docs/en/development/changes_enums.md
|
||||
./docs/en/development/changes_logging.md
|
||||
./docs/en/development/changes_misc.md
|
||||
--8<--
|
||||
|
||||
|
@ -1,87 +0,0 @@
|
||||
## Bindings
|
||||
|
||||
Bindings work in a similar way to v2, by providing a means to bind struct
|
||||
methods to the frontend. These can be called in the frontend using the binding
|
||||
wrappers generated by the `wails3 generate bindings` command:
|
||||
|
||||
```javascript
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
import { main } from "./models";
|
||||
|
||||
window.go = window.go || {};
|
||||
window.go.main = {
|
||||
GreetService: {
|
||||
/**
|
||||
* GreetService.Greet
|
||||
* Greet greets a person
|
||||
* @param name {string}
|
||||
* @returns {Promise<string>}
|
||||
**/
|
||||
Greet: function (name) {
|
||||
wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0));
|
||||
},
|
||||
|
||||
/**
|
||||
* GreetService.GreetPerson
|
||||
* GreetPerson greets a person
|
||||
* @param person {main.Person}
|
||||
* @returns {Promise<string>}
|
||||
**/
|
||||
GreetPerson: function (person) {
|
||||
wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0));
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
Bound methods are obfuscated by default, and are identified using uint32 IDs,
|
||||
calculated using the
|
||||
[FNV hashing algorithm](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function).
|
||||
This is to prevent the method name from being exposed in production builds. In
|
||||
debug mode, the method IDs are logged along with the calculated ID of the method
|
||||
to aid in debugging. If you wish to add an extra layer of obfuscation, you can
|
||||
use the `BindAliases` option. This allows you to specify a map of alias IDs to
|
||||
method IDs. When the frontend calls a method using an ID, the method ID will be
|
||||
looked up in the alias map first for a match. If it does not find it, it assumes
|
||||
it's a standard method ID and tries to find the method in the usual way.
|
||||
|
||||
Example:
|
||||
|
||||
```go
|
||||
app := application.New(application.Options{
|
||||
Bind: []any{
|
||||
&GreetService{},
|
||||
},
|
||||
BindAliases: map[uint32]uint32{
|
||||
1: 1411160069,
|
||||
2: 4021313248,
|
||||
},
|
||||
Assets: application.AssetOptions{
|
||||
Handler: application.AssetFileServerFS(assets),
|
||||
},
|
||||
Mac: application.MacOptions{
|
||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
We can now call using this alias in the frontend: `wails.Call(1, "world!")`.
|
||||
|
||||
### Insecure calls
|
||||
|
||||
If you don't mind your calls being available in plain text in your binary and
|
||||
have no intention of using [garble](https://github.com/burrowers/garble), then
|
||||
you can use the insecure `wails.CallByName()` method. This method takes the
|
||||
fully qualified name of the method to call and the arguments to pass to it.
|
||||
Example:
|
||||
|
||||
```go
|
||||
wails.CallByName("main.GreetService.Greet", "world!")
|
||||
```
|
||||
|
||||
!!! danger
|
||||
|
||||
This is only provided as a convenience method for development. It is not recommended to use this in production.
|
@ -1,6 +0,0 @@
|
||||
## ClipBoard
|
||||
|
||||
The clipboard API has been simplified. There is now a single `Clipboard` object
|
||||
that can be used to read and write to the clipboard. The `Clipboard` object is
|
||||
available in both Go and JS. `SetText()` to set the text and `Text()` to get the
|
||||
text.
|
@ -1,17 +0,0 @@
|
||||
## Context Menus
|
||||
|
||||
Context menus are contextual menus that are shown when the user right-clicks on
|
||||
an element. Creating a context menu is the same as creating a standard menu , by
|
||||
using `app.NewMenu()`. To make the context menu available to a window, call
|
||||
`window.RegisterContextMenu(name, menu)`. The name will be the id of the context
|
||||
menu and used by the frontend.
|
||||
|
||||
To indicate that an element has a context menu, add the `data-contextmenu`
|
||||
attribute to the element. The value of this attribute should be the name of a
|
||||
context menu previously registered with the window.
|
||||
|
||||
It is possible to register a context menu at the application level, making it
|
||||
available to all windows. This can be done using
|
||||
`app.RegisterContextMenu(name, menu)`. If a context menu cannot be found at the
|
||||
window level, the application context menus will be checked. A demo of this can
|
||||
be found in `v3/examples/contextmenus`.
|
@ -1,25 +0,0 @@
|
||||
## Dialogs
|
||||
|
||||
Dialogs are now available in JavaScript!
|
||||
|
||||
### Windows
|
||||
|
||||
Dialog buttons in Windows are not configurable and are constant depending on the
|
||||
type of dialog. To trigger a callback when a button is pressed, create a button
|
||||
with the same name as the button you wish to have the callback attached to.
|
||||
Example: Create a button with the label `Ok` and use `OnClick()` to set the
|
||||
callback method:
|
||||
|
||||
```go
|
||||
dialog := app.QuestionDialog().
|
||||
SetTitle("Update").
|
||||
SetMessage("The cancel button is selected when pressing escape")
|
||||
ok := dialog.AddButton("Ok")
|
||||
ok.OnClick(func() {
|
||||
// Do something
|
||||
})
|
||||
no := dialog.AddButton("Cancel")
|
||||
dialog.SetDefaultButton(ok)
|
||||
dialog.SetCancelButton(no)
|
||||
dialog.Show()
|
||||
```
|
@ -1,8 +0,0 @@
|
||||
## Drag and Drop
|
||||
|
||||
Native drag and drop can be enabled per-window. Simply set the
|
||||
`EnableDragAndDrop` window config option to `true` and the window will allow
|
||||
files to be dragged onto it. When this happens, the `events.FilesDropped` event
|
||||
will be emitted. The filenames can then be retrieved from the
|
||||
`WindowEvent.Context()` using the `DroppedFiles()` method. This returns a slice
|
||||
of strings containing the filenames.
|
@ -1,42 +0,0 @@
|
||||
#### Enums
|
||||
|
||||
In Go, enums are often defined as a type and a set of constants. For example:
|
||||
|
||||
```go
|
||||
type MyEnum int
|
||||
|
||||
const (
|
||||
MyEnumOne MyEnum = iota
|
||||
MyEnumTwo
|
||||
MyEnumThree
|
||||
)
|
||||
```
|
||||
|
||||
Due to incompatibility between Go and JavaScript, custom types cannot be used in
|
||||
this way. The best strategy is to use a type alias for float64:
|
||||
|
||||
```go
|
||||
type MyEnum = float64
|
||||
|
||||
const (
|
||||
MyEnumOne MyEnum = iota
|
||||
MyEnumTwo
|
||||
MyEnumThree
|
||||
)
|
||||
```
|
||||
|
||||
In Javascript, you can then use the following:
|
||||
|
||||
```js
|
||||
const MyEnum = {
|
||||
MyEnumOne: 0,
|
||||
MyEnumTwo: 1,
|
||||
MyEnumThree: 2,
|
||||
};
|
||||
```
|
||||
|
||||
- Why use `float64`? Can't we use `int`?
|
||||
- Because JavaScript doesn't have a concept of `int`. Everything is a
|
||||
`number`, which translates to `float64` in Go. There are also restrictions
|
||||
on casting types in Go's reflection package, which means using `int` doesn't
|
||||
work.
|
@ -1,62 +0,0 @@
|
||||
## Events
|
||||
|
||||
In v3, there are 3 types of events:
|
||||
|
||||
- Application Events
|
||||
- Window Events
|
||||
- Custom Events
|
||||
|
||||
### Application Events
|
||||
|
||||
Application events are events that are emitted by the application. These events
|
||||
include native events such as `ApplicationDidFinishLaunching` on macOS.
|
||||
|
||||
### Window Events
|
||||
|
||||
Window events are events that are emitted by a window. These events include
|
||||
native events such as `WindowDidBecomeMain` on macOS. Common events are also
|
||||
defined, so they work cross-platform, e.g. `WindowClosing`.
|
||||
|
||||
### Custom Events
|
||||
|
||||
Events that the user defines are called `WailsEvents`. This is to differentiate
|
||||
them from the `Event` object that is used to communicate with the browser.
|
||||
WailsEvents are now objects that encapsulate all the details of an event. This
|
||||
includes the event name, the data, and the source of the event.
|
||||
|
||||
The data associated with a WailsEvent is now a single value. If multiple values
|
||||
are required, then a struct can be used.
|
||||
|
||||
### Event callbacks and `Emit` function signature
|
||||
|
||||
The signatures events callbacks (as used by `On`, `Once` & `OnMultiple`) have
|
||||
changed. In v2, the callback function received optional data. In v3, the
|
||||
callback function receives a `WailsEvent` object that contains all data related
|
||||
to the event.
|
||||
|
||||
Similarly, the `Emit` function has changed. Instead of taking a name and
|
||||
optional data, it now takes a single `WailsEvent` object that it will emit.
|
||||
|
||||
### `Off` and `OffAll`
|
||||
|
||||
In v2, `Off` and `OffAll` calls would remove events in both JS and Go. Due to
|
||||
the multi-window nature of v3, this has been changed so that these methods only
|
||||
apply to the context they are called in. For example, if you call `Off` in a
|
||||
window, it will only remove events for that window. If you use `Off` in Go, it
|
||||
will only remove events for Go.
|
||||
|
||||
### Hooks
|
||||
|
||||
Event Hooks are a new feature in v3. They allow you to hook into the event
|
||||
system and perform actions when certain events are emitted. For example, you can
|
||||
hook into the `WindowClosing` event and perform some cleanup before the window
|
||||
closes. Hooks can be registered at the application level or at the window level
|
||||
using `RegisterHook`. Application level are for application events. Window level
|
||||
hooks will only be called for the window they are registered with.
|
||||
|
||||
### Developer notes
|
||||
|
||||
When emitting an event in Go, it will dispatch the event to local Go listeners
|
||||
and also each window in the application. When emitting an event in JS, it now
|
||||
sends the event to the application. This will be processed as if it was emitted
|
||||
in Go, however the sender ID will be that of the window.
|
@ -1,11 +0,0 @@
|
||||
### Logging
|
||||
|
||||
Logging in v2 was confusing as both application logs and system (internal) logs
|
||||
were using the same logger. We have simplified this as follows:
|
||||
|
||||
- Internal logs are now handled using the standard Go `slog` logger. This is
|
||||
configured using the `logger` option in the application options. By default,
|
||||
this uses the [tint](https://github.com/lmittmann/tint) logger.
|
||||
- Application logs can now be achieved through the new `log` plugin which
|
||||
utilises `slog` under the hood. This plugin provides a simple API for logging
|
||||
to the console. It is available in both Go and JS.
|
@ -1,42 +0,0 @@
|
||||
### Misc
|
||||
|
||||
## Windows Application Options
|
||||
|
||||
### WndProcInterceptor
|
||||
|
||||
If this is set, the WndProc will be intercepted and the function will be called.
|
||||
This allows you to handle Windows messages directly. The function should have
|
||||
the following signature:
|
||||
|
||||
```go
|
||||
func(hwnd uintptr, msg uint32, wParam, lParam uintptr) (returnValue uintptr, shouldReturn)
|
||||
```
|
||||
|
||||
The `shouldReturn` value should be set to `true` if the returnValue should be
|
||||
returned by the main wndProc method. If it is set to `false`, the return value
|
||||
will be ignored and the message will continue to be processed by the main
|
||||
wndProc method.
|
||||
|
||||
## Hide Window on Close + OnBeforeClose
|
||||
|
||||
In v2, there was the `HideWindowOnClose` flag to hide the window when it closed.
|
||||
There was a logical overlap between this flag and the `OnBeforeClose` callback.
|
||||
In v3, the `HideWindowOnClose` flag has been removed and the `OnBeforeClose`
|
||||
callback has been renamed to `ShouldClose`. The `ShouldClose` callback is called
|
||||
when the user attempts to close a window. If the callback returns `true`, the
|
||||
window will close. If it returns `false`, the window will not close. This can be
|
||||
used to hide the window instead of closing it.
|
||||
|
||||
## Window Drag
|
||||
|
||||
In v2, the `--wails-drag` attribute was used to indicate that an element could
|
||||
be used to drag the window. In v3, this has been replaced with
|
||||
`--webkit-app-region` to be more in line with the way other frameworks handle
|
||||
this. The `--webkit-app-region` attribute can be set to any of the following
|
||||
values:
|
||||
|
||||
- `drag` - The element can be used to drag the window
|
||||
- `no-drag` - The element cannot be used to drag the window
|
||||
|
||||
We would have ideally liked to use `app-region`, however this is not supported
|
||||
by the `getComputedStyle` call on webkit on macOS.
|
@ -1,34 +0,0 @@
|
||||
## Plugins
|
||||
|
||||
Plugins are a way to extend the functionality of your Wails application.
|
||||
|
||||
### Creating a plugin
|
||||
|
||||
Plugins are standard Go structure that adhere to the following interface:
|
||||
|
||||
```go
|
||||
type Plugin interface {
|
||||
Name() string
|
||||
Init(*application.App) error
|
||||
Shutdown()
|
||||
CallableByJS() []string
|
||||
InjectJS() string
|
||||
}
|
||||
```
|
||||
|
||||
The `Name()` method returns the name of the plugin. This is used for logging
|
||||
purposes.
|
||||
|
||||
The `Init(*application.App) error` method is called when the plugin is loaded.
|
||||
The `*application.App` parameter is the application that the plugin is being
|
||||
loaded into. Any errors will prevent the application from starting.
|
||||
|
||||
The `Shutdown()` method is called when the application is shutting down.
|
||||
|
||||
The `CallableByJS()` method returns a list of exported functions that can be
|
||||
called from the frontend. These method names must exactly match the names of the
|
||||
methods exported by the plugin.
|
||||
|
||||
The `InjectJS()` method returns JavaScript that should be injected into all
|
||||
windows as they are created. This is useful for adding custom JavaScript
|
||||
functions that complement the plugin.
|
@ -1,13 +0,0 @@
|
||||
## Systray
|
||||
|
||||
Wails 3 comes with a built-in systray. This is a fully featured systray that has
|
||||
been designed to be as simple as possible to use. It is possible to set the
|
||||
icon, tooltip and menu of the systray. It is possible to also "attach" a window
|
||||
to the systray. Doing this will provide the following functionality:
|
||||
|
||||
- Clicking the systray icon with toggle the window visibility
|
||||
- Right-clicking the systray will open the menu, if there is one
|
||||
|
||||
On macOS, if there is no attached window, the systray will use the default
|
||||
method of displaying the menu (any button). If there is an attached window but
|
||||
no menu, the systray will toggle the window regardless of the button pressed.
|
@ -1,36 +0,0 @@
|
||||
## Window
|
||||
|
||||
The Window API has largely remained the same, however the methods are now on an
|
||||
instance of a window rather than the runtime. Some notable differences are:
|
||||
|
||||
- Windows now have a Name that identifies them. This is used to identify the
|
||||
window when emitting events.
|
||||
- Windows have even more methods that were previously unavailable, such
|
||||
as `SetFrameless` and `ToggleDevTools`.
|
||||
- Windows can now accept files via native drag and drop. See the Drag and Drop
|
||||
section for more details.
|
||||
|
||||
### BackgroundColour
|
||||
|
||||
In v2, this was a pointer to an `RGBA` struct. In v3, this is an `RGBA` struct
|
||||
value.
|
||||
|
||||
### WindowIsTranslucent
|
||||
|
||||
This flag has been removed. Now there is a `BackgroundType` flag that can be
|
||||
used to set the type of background the window should have. This flag can be set
|
||||
to any of the following values:
|
||||
|
||||
- `BackgroundTypeSolid` - The window will have a solid background
|
||||
- `BackgroundTypeTransparent` - The window will have a transparent background
|
||||
- `BackgroundTypeTranslucent` - The window will have a translucent background
|
||||
|
||||
On Windows, if the `BackgroundType` is set to `BackgroundTypeTranslucent`, the
|
||||
type of translucency can be set using the `BackdropType` flag in the
|
||||
`WindowsWindow` options. This can be set to any of the following values:
|
||||
|
||||
- `Auto` - The window will use an effect determined by the system
|
||||
- `None` - The window will have no background
|
||||
- `Mica` - The window will use the Mica effect
|
||||
- `Acrylic` - The window will use the acrylic effect
|
||||
- `Tabbed` - The window will use the tabbed effect
|
@ -1,50 +0,0 @@
|
||||
## Wails Markup Language (WML)
|
||||
|
||||
The Wails Markup Language is a simple markup language that allows you to add
|
||||
functionality to standard HTML elements without the use of Javascript.
|
||||
|
||||
The following tags are currently supported:
|
||||
|
||||
### `data-wml-event`
|
||||
|
||||
This specifies that a Wails event will be emitted when the element is clicked.
|
||||
The value of the attribute should be the name of the event to emit.
|
||||
|
||||
Example:
|
||||
|
||||
```html
|
||||
<button data-wml-event="myevent">Click Me</button>
|
||||
```
|
||||
|
||||
Sometimes you need the user to confirm an action. This can be done by adding the
|
||||
`data-wml-confirm` attribute to the element. The value of this attribute will be
|
||||
the message to display to the user.
|
||||
|
||||
Example:
|
||||
|
||||
```html
|
||||
<button data-wml-event="delete-all-items" data-wml-confirm="Are you sure?">
|
||||
Delete All Items
|
||||
</button>
|
||||
```
|
||||
|
||||
### `data-wml-window`
|
||||
|
||||
Any `wails.window` method can be called by adding the `data-wml-window`
|
||||
attribute to an element. The value of the attribute should be the name of the
|
||||
method to call. The method name should be in the same case as the method.
|
||||
|
||||
```html
|
||||
<button data-wml-window="Close">Close Window</button>
|
||||
```
|
||||
|
||||
### `data-wml-trigger`
|
||||
|
||||
This attribute specifies which javascript event should trigger the action. The
|
||||
default is `click`.
|
||||
|
||||
```html
|
||||
<button data-wml-event="hover-box" data-wml-trigger="mouseover">
|
||||
Hover over me!
|
||||
</button>
|
||||
```
|
@ -1,217 +0,0 @@
|
||||
# Introduction
|
||||
|
||||
!!! note
|
||||
This guide is a work in progress.
|
||||
|
||||
Thanks for wanting to help out with development of Wails! This guide will help
|
||||
you get started.
|
||||
|
||||
## Getting Started
|
||||
|
||||
- Git clone this repository. Checkout the `v3-alpha` branch.
|
||||
- Install the CLI: `cd v3/cmd/wails3 && go install`
|
||||
|
||||
- Optional: If you are wanting to use the build system to build frontend code,
|
||||
you will need to install [npm](https://nodejs.org/en/download).
|
||||
|
||||
## Building
|
||||
|
||||
For simple programs, you can use the standard `go build` command. It's also
|
||||
possible to use `go run`.
|
||||
|
||||
Wails also comes with a build system that can be used to build more complex
|
||||
projects. It utilises the awesome [Task](https://taskfile.dev) build system. For
|
||||
more information, check out the task homepage or run `wails task --help`.
|
||||
|
||||
## Project layout
|
||||
|
||||
The project has the following structure:
|
||||
|
||||
```
|
||||
v3
|
||||
├── cmd/wails3 // CLI
|
||||
├── examples // Examples of Wails apps
|
||||
├── internal // Internal packages
|
||||
| ├── runtime // The Wails JS runtime
|
||||
| └── templates // The supported project templates
|
||||
├── pkg
|
||||
| ├── application // The core Wails library
|
||||
| └── events // The event definitions
|
||||
| └── mac // macOS specific code used by plugins
|
||||
| └── w32 // Windows specific code
|
||||
├── plugins // Supported plugins
|
||||
├── tasks // General tasks
|
||||
└── Taskfile.yaml // Development tasks configuration
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
### Alpha Todo List
|
||||
|
||||
We are currently tracking known issues and tasks in the
|
||||
[Alpha Todo List](https://github.com/orgs/wailsapp/projects/6). If you want to
|
||||
help out, please check this list and follow the instructions in the
|
||||
[Feedback](../getting-started/feedback.md) page.
|
||||
|
||||
### Adding window functionality
|
||||
|
||||
The preferred way to add window functionality is to add a new function to the
|
||||
`pkg/application/webview_window.go` file. This should implement all the
|
||||
functionality required for all platforms. Any platform specific code should be
|
||||
called via a `webviewWindowImpl` interface method. This interface is implemented
|
||||
by each of the target platforms to provide the platform specific functionality.
|
||||
In some cases, this may do nothing. Once you've added the interface method,
|
||||
ensure each platform implements it. A good example of this is the `SetMinSize`
|
||||
method.
|
||||
|
||||
- Mac: `webview_window_darwin.go`
|
||||
- Windows: `webview_window_windows.go`
|
||||
- Linux: `webview_window_linux.go`
|
||||
|
||||
Most, if not all, of the platform specific code should be run on the main
|
||||
thread. To simplify this, there are a number of `invokeSync` methods defined in
|
||||
`application.go`.
|
||||
|
||||
### Updating the runtime
|
||||
|
||||
The runtime is located in `v3/internal/runtime`. When the runtime is updated,
|
||||
the following steps need to be taken:
|
||||
|
||||
```shell
|
||||
wails3 task runtime:build
|
||||
```
|
||||
|
||||
### Events
|
||||
|
||||
Events are defined in `v3/pkg/events`. When adding a new event, the following
|
||||
steps need to be taken:
|
||||
|
||||
- Add the event to the `events.txt` file
|
||||
- Run `wails3 task events:generate`
|
||||
|
||||
There are a number of types of events: platform specific application and window
|
||||
events + common events. The common events are useful for cross-platform event
|
||||
handling, but you aren't limited to the "lowest common denominator". You can use
|
||||
the platform specific events if you need to.
|
||||
|
||||
When adding a common event, ensure that the platform specific events are mapped.
|
||||
An example of this is in `window_webview_darwin.go`:
|
||||
|
||||
```go
|
||||
// Translate ShouldClose to common WindowClosing event
|
||||
w.parent.On(events.Mac.WindowShouldClose, func(_ *WindowEventContext) {
|
||||
w.parent.emit(events.Common.WindowClosing)
|
||||
})
|
||||
```
|
||||
|
||||
NOTE: We may try to automate this in the future by adding the mapping to the
|
||||
event definition.
|
||||
|
||||
### Plugins
|
||||
|
||||
Plugins are a way to extend the functionality of your Wails application.
|
||||
|
||||
#### Creating a plugin
|
||||
|
||||
Plugins are standard Go structure that adhere to the following interface:
|
||||
|
||||
```go
|
||||
type Plugin interface {
|
||||
Name() string
|
||||
Init(*application.App) error
|
||||
Shutdown()
|
||||
CallableByJS() []string
|
||||
InjectJS() string
|
||||
}
|
||||
```
|
||||
|
||||
The `Name()` method returns the name of the plugin. This is used for logging
|
||||
purposes.
|
||||
|
||||
The `Init(*application.App) error` method is called when the plugin is loaded.
|
||||
The `*application.App` parameter is the application that the plugin is being
|
||||
loaded into. Any errors will prevent the application from starting.
|
||||
|
||||
The `Shutdown()` method is called when the application is shutting down.
|
||||
|
||||
The `CallableByJS()` method returns a list of exported functions that can be
|
||||
called from the frontend. These method names must exactly match the names of the
|
||||
methods exported by the plugin.
|
||||
|
||||
The `InjectJS()` method returns JavaScript that should be injected into all
|
||||
windows as they are created. This is useful for adding custom JavaScript
|
||||
functions that complement the plugin.
|
||||
|
||||
The built-in plugins can be found in the `v3/plugins` directory. Check them out
|
||||
for inspiration.
|
||||
|
||||
## Tasks
|
||||
|
||||
The Wails CLI uses the [Task](https://taskfile.dev) build system. It is imported
|
||||
as a library and used to run the tasks defined in `Taskfile.yaml`. The main
|
||||
interfacing with Task happens in `v3/internal/commands/task.go`.
|
||||
|
||||
### Upgrading Taskfile
|
||||
|
||||
To check if there's an upgrade for Taskfile, run `wails3 task -version` and
|
||||
check against the Task website.
|
||||
|
||||
To upgrade the version of Taskfile used, run:
|
||||
|
||||
```shell
|
||||
wails3 task taskfile:upgrade
|
||||
```
|
||||
|
||||
If there are incompatibilities then they should appear in the
|
||||
`v3/internal/commands/task.go` file.
|
||||
|
||||
Usually the best way to fix incompatibilities is to clone the task repo at
|
||||
`https://github.com/go-task/task` and look at the git history to determine what
|
||||
has changed and why.
|
||||
|
||||
To check all changes have worked correctly, re-install the CLI and check the
|
||||
version again:
|
||||
|
||||
```shell
|
||||
wails3 task cli:install
|
||||
wails3 task -version
|
||||
```
|
||||
|
||||
## Opening a PR
|
||||
|
||||
Make sure that all PRs have a ticket associated with them providing context to
|
||||
the change. If there is no ticket, please create one first. Ensure that all PRs
|
||||
have updated the CHANGELOG.md file with the changes made. The CHANGELOG.md file
|
||||
is located in the `mkdocs-website/docs` directory.
|
||||
|
||||
## Misc Tasks
|
||||
|
||||
### Upgrading Taskfile
|
||||
|
||||
The Wails CLI uses the [Task](https://taskfile.dev) build system. It is imported
|
||||
as a library and used to run the tasks defined in `Taskfile.yaml`. The main
|
||||
interfacing with Task happens in `v3/internal/commands/task.go`.
|
||||
|
||||
To check if there's an upgrade for Taskfile, run `wails3 task -version` and
|
||||
check against the Task website.
|
||||
|
||||
To upgrade the version of Taskfile used, run:
|
||||
|
||||
```shell
|
||||
wails3 task taskfile:upgrade
|
||||
```
|
||||
|
||||
If there are incompatibilities then they should appear in the
|
||||
`v3/internal/commands/task.go` file.
|
||||
|
||||
Usually the best way to fix incompatibilities is to clone the task repo at
|
||||
`https://github.com/go-task/task` and look at the git history to determine what
|
||||
has changed and why.
|
||||
|
||||
To check all changes have worked correctly, re-install the CLI and check the
|
||||
version again:
|
||||
|
||||
```shell
|
||||
wails3 task cli:install
|
||||
wails3 task -version
|
||||
```
|
@ -1,387 +0,0 @@
|
||||
# Status
|
||||
|
||||
Status of features in v3.
|
||||
|
||||
!!! note
|
||||
|
||||
This list is a mixture of public and internal API support.<br/>
|
||||
It is not complete and probably not up to date.
|
||||
|
||||
## Known Issues
|
||||
|
||||
- Linux is not yet up to feature parity with Windows/Mac
|
||||
|
||||
## Application
|
||||
|
||||
Application interface methods
|
||||
|
||||
| Method | Windows | Linux | Mac | Notes |
|
||||
| ------------------------------------------------------------- | ------- | ----- | --- | ----- |
|
||||
| run() error | Y | Y | Y | |
|
||||
| destroy() | | Y | Y | |
|
||||
| setApplicationMenu(menu \*Menu) | Y | Y | Y | |
|
||||
| name() string | | Y | Y | |
|
||||
| getCurrentWindowID() uint | Y | Y | Y | |
|
||||
| showAboutDialog(name string, description string, icon []byte) | | Y | Y | |
|
||||
| setIcon(icon []byte) | - | Y | Y | |
|
||||
| on(id uint) | | | Y | |
|
||||
| dispatchOnMainThread(fn func()) | Y | Y | Y | |
|
||||
| hide() | Y | Y | Y | |
|
||||
| show() | Y | Y | Y | |
|
||||
| getPrimaryScreen() (\*Screen, error) | | Y | Y | |
|
||||
| getScreens() ([]\*Screen, error) | | Y | Y | |
|
||||
|
||||
## Webview Window
|
||||
|
||||
Webview Window Interface Methods
|
||||
|
||||
| Method | Windows | Linux | Mac | Notes |
|
||||
| -------------------------------------------------- | ------- | ----- | --- | ---------------------------------------- |
|
||||
| center() | Y | Y | Y | |
|
||||
| close() | y | Y | Y | |
|
||||
| destroy() | | Y | Y | |
|
||||
| execJS(js string) | y | Y | Y | |
|
||||
| focus() | Y | Y | | |
|
||||
| forceReload() | | Y | Y | |
|
||||
| fullscreen() | Y | Y | Y | |
|
||||
| getScreen() (\*Screen, error) | y | Y | Y | |
|
||||
| getZoom() float64 | | Y | Y | |
|
||||
| height() int | Y | Y | Y | |
|
||||
| hide() | Y | Y | Y | |
|
||||
| isFullscreen() bool | Y | Y | Y | |
|
||||
| isMaximised() bool | Y | Y | Y | |
|
||||
| isMinimised() bool | Y | Y | Y | |
|
||||
| maximise() | Y | Y | Y | |
|
||||
| minimise() | Y | Y | Y | |
|
||||
| nativeWindowHandle() (uintptr, error) | Y | Y | Y | |
|
||||
| on(eventID uint) | y | | Y | |
|
||||
| openContextMenu(menu *Menu, data *ContextMenuData) | y | Y | Y | |
|
||||
| relativePosition() (int, int) | Y | Y | Y | |
|
||||
| reload() | y | Y | Y | |
|
||||
| run() | Y | Y | Y | |
|
||||
| setAlwaysOnTop(alwaysOnTop bool) | Y | Y | Y | |
|
||||
| setBackgroundColour(color RGBA) | Y | Y | Y | |
|
||||
| setEnabled(bool) | | Y | Y | |
|
||||
| setFrameless(bool) | | Y | Y | |
|
||||
| setFullscreenButtonEnabled(enabled bool) | - | Y | Y | There is no fullscreen button in Windows |
|
||||
| setHTML(html string) | Y | Y | Y | |
|
||||
| setMaxSize(width, height int) | Y | Y | Y | |
|
||||
| setMinSize(width, height int) | Y | Y | Y | |
|
||||
| setRelativePosition(x int, y int) | Y | Y | Y | |
|
||||
| setResizable(resizable bool) | Y | Y | Y | |
|
||||
| setSize(width, height int) | Y | Y | Y | |
|
||||
| setTitle(title string) | Y | Y | Y | |
|
||||
| setURL(url string) | Y | Y | Y | |
|
||||
| setZoom(zoom float64) | Y | Y | Y | |
|
||||
| show() | Y | Y | Y | |
|
||||
| size() (int, int) | Y | Y | Y | |
|
||||
| toggleDevTools() | Y | Y | Y | |
|
||||
| unfullscreen() | Y | Y | Y | |
|
||||
| unmaximise() | Y | Y | Y | |
|
||||
| unminimise() | Y | Y | Y | |
|
||||
| width() int | Y | Y | Y | |
|
||||
| zoom() | | Y | Y | |
|
||||
| zoomIn() | Y | Y | Y | |
|
||||
| zoomOut() | Y | Y | Y | |
|
||||
| zoomReset() | Y | Y | Y | |
|
||||
|
||||
## Runtime
|
||||
|
||||
### Application
|
||||
|
||||
| Feature | Windows | Linux | Mac | Notes |
|
||||
| ------- | ------- | ----- | --- | ----- |
|
||||
| Quit | Y | Y | Y | |
|
||||
| Hide | Y | Y | Y | |
|
||||
| Show | Y | | Y | |
|
||||
|
||||
### Dialogs
|
||||
|
||||
| Feature | Windows | Linux | Mac | Notes |
|
||||
| -------- | ------- | ----- | --- | ----- |
|
||||
| Info | Y | Y | Y | |
|
||||
| Warning | Y | Y | Y | |
|
||||
| Error | Y | Y | Y | |
|
||||
| Question | Y | Y | Y | |
|
||||
| OpenFile | Y | Y | Y | |
|
||||
| SaveFile | Y | Y | Y | |
|
||||
|
||||
### Clipboard
|
||||
|
||||
| Feature | Windows | Linux | Mac | Notes |
|
||||
|---------|---------|-------|-----|-------|
|
||||
| SetText | Y | Y | Y | |
|
||||
| Text | Y | Y | Y | |
|
||||
|
||||
### ContextMenu
|
||||
|
||||
| Feature | Windows | Linux | Mac | Notes |
|
||||
|------------------|---------|-------|-----|-------|
|
||||
| OpenContextMenu | Y | Y | Y | |
|
||||
| On By Default | | | | |
|
||||
| Control via HTML | Y | | | |
|
||||
|
||||
The default context menu is enabled by default for all elements that are
|
||||
`contentEditable: true`, `<input>` or `<textarea>` tags or have the
|
||||
`--default-contextmenu: true` style set. The `--default-contextmenu: show` style
|
||||
will always show the context menu The `--default-contextmenu: hide` style will
|
||||
always hide the context menu
|
||||
|
||||
Anything nested under a tag with `--default-contextmenu: hide` style will not
|
||||
show the context menu unless it is explicitly set with
|
||||
`--default-contextmenu: show`.
|
||||
|
||||
### Screens
|
||||
|
||||
| Feature | Windows | Linux | Mac | Notes |
|
||||
| ---------- | ------- | ----- | --- | ----- |
|
||||
| GetAll | Y | Y | Y | |
|
||||
| GetPrimary | Y | Y | Y | |
|
||||
| GetCurrent | Y | Y | Y | |
|
||||
|
||||
### System
|
||||
|
||||
| Feature | Windows | Linux | Mac | Notes |
|
||||
| ---------- | ------- | ----- | --- | ----- |
|
||||
| IsDarkMode | | | Y | |
|
||||
|
||||
### Window
|
||||
|
||||
Y = Supported U = Untested
|
||||
|
||||
- = Not available
|
||||
|
||||
| Feature | Windows | Linux | Mac | Notes |
|
||||
| ------------------- | ------- | ----- | --- | ------------------------------------------------------------------------------------ |
|
||||
| Center | Y | Y | Y | |
|
||||
| Focus | Y | Y | | |
|
||||
| FullScreen | Y | Y | Y | |
|
||||
| GetZoom | Y | Y | Y | Get current view scale |
|
||||
| Height | Y | Y | Y | |
|
||||
| Hide | Y | Y | Y | |
|
||||
| Maximise | Y | Y | Y | |
|
||||
| Minimise | Y | Y | Y | |
|
||||
| RelativePosition | Y | Y | Y | |
|
||||
| Screen | Y | Y | Y | Get screen for window |
|
||||
| SetAlwaysOnTop | Y | Y | Y | |
|
||||
| SetBackgroundColour | Y | Y | Y | https://github.com/MicrosoftEdge/WebView2Feedback/issues/1621#issuecomment-938234294 |
|
||||
| SetEnabled | Y | U | - | Set the window to be enabled/disabled |
|
||||
| SetMaxSize | Y | Y | Y | |
|
||||
| SetMinSize | Y | Y | Y | |
|
||||
| SetRelativePosition | Y | Y | Y | |
|
||||
| SetResizable | Y | Y | Y | |
|
||||
| SetSize | Y | Y | Y | |
|
||||
| SetTitle | Y | Y | Y | |
|
||||
| SetZoom | Y | Y | Y | Set view scale |
|
||||
| Show | Y | Y | Y | |
|
||||
| Size | Y | Y | Y | |
|
||||
| UnFullscreen | Y | Y | Y | |
|
||||
| UnMaximise | Y | Y | Y | |
|
||||
| UnMinimise | Y | Y | Y | |
|
||||
| Width | Y | Y | Y | |
|
||||
| ZoomIn | Y | Y | Y | Increase view scale |
|
||||
| ZoomOut | Y | Y | Y | Decrease view scale |
|
||||
| ZoomReset | Y | Y | Y | Reset view scale |
|
||||
|
||||
### Window Options
|
||||
|
||||
A 'Y' in the table below indicates that the option has been tested and is
|
||||
applied when the window is created. An 'X' indicates that the option is not
|
||||
supported by the platform.
|
||||
|
||||
| Feature | Windows | Linux | Mac | Notes |
|
||||
|---------------------------------|---------|-------|-----|--------------------------------------------|
|
||||
| AlwaysOnTop | Y | Y | | |
|
||||
| BackgroundColour | Y | Y | | |
|
||||
| BackgroundType | | | | Acrylic seems to work but the others don't |
|
||||
| CSS | Y | Y | | |
|
||||
| DevToolsEnabled | Y | Y | Y | |
|
||||
| DisableResize | Y | Y | | |
|
||||
| EnableDragAndDrop | | Y | | |
|
||||
| EnableFraudulentWebsiteWarnings | | | | |
|
||||
| Focused | Y | Y | | |
|
||||
| Frameless | Y | Y | | |
|
||||
| FullscreenButtonEnabled | Y | | | |
|
||||
| Height | Y | Y | | |
|
||||
| Hidden | Y | Y | | |
|
||||
| HTML | Y | Y | | |
|
||||
| JS | Y | Y | | |
|
||||
| Mac | - | - | | |
|
||||
| MaxHeight | Y | Y | | |
|
||||
| MaxWidth | Y | Y | | |
|
||||
| MinHeight | Y | Y | | |
|
||||
| MinWidth | Y | Y | | |
|
||||
| Name | Y | Y | | |
|
||||
| OpenInspectorOnStartup | | | | |
|
||||
| StartState | Y | | | |
|
||||
| Title | Y | Y | | |
|
||||
| URL | Y | Y | | |
|
||||
| Width | Y | Y | | |
|
||||
| Windows | Y | - | - | |
|
||||
| X | Y | Y | | |
|
||||
| Y | Y | Y | | |
|
||||
| Zoom | | | | |
|
||||
| ZoomControlEnabled | | | | |
|
||||
|
||||
### Log
|
||||
|
||||
To log or not to log? System logger vs custom logger.
|
||||
|
||||
## Menu
|
||||
|
||||
| Event | Windows | Linux | Mac | Notes |
|
||||
| ------------------------ | ------- | ----- | --- | ----- |
|
||||
| Default Application Menu | Y | Y | Y | |
|
||||
|
||||
## Tray Menus
|
||||
|
||||
| Feature | Windows | Linux | Mac | Notes |
|
||||
|--------------------|---------|-------|-----|----------------------------------------------------------------------|
|
||||
| Icon | Y | Y | Y | Windows has default icons for light/dark mode & supports PNG or ICO. |
|
||||
| Label | - | Y | Y | |
|
||||
| Label (ANSI Codes) | - | | | |
|
||||
| Menu | Y | Y | Y | |
|
||||
|
||||
### Methods
|
||||
|
||||
| Method | Windows | Linux | Mac | Notes |
|
||||
| ----------------------------- | ------- | ----- | --- | ----- |
|
||||
| setLabel(label string) | - | Y | Y | |
|
||||
| run() | Y | Y | Y | |
|
||||
| setIcon(icon []byte) | Y | Y | Y | |
|
||||
| setMenu(menu \*Menu) | Y | Y | Y | |
|
||||
| setIconPosition(position int) | - | Y | Y | |
|
||||
| setTemplateIcon(icon []byte) | - | Y | Y | |
|
||||
| destroy() | Y | Y | Y | |
|
||||
| setDarkModeIcon(icon []byte) | Y | Y | Y | Darkmode isn't handled yet (linux) |
|
||||
|
||||
## Cross Platform Events
|
||||
|
||||
Mapping native events to cross-platform events.
|
||||
|
||||
| Event | Windows | Linux | Mac | Notes |
|
||||
| ------------------------ | ------- | ----- | --------------- | ----- |
|
||||
| WindowWillClose | | | WindowWillClose | |
|
||||
| WindowDidClose | | | | |
|
||||
| WindowDidResize | | | | |
|
||||
| WindowDidHide | | | | |
|
||||
| ApplicationWillTerminate | | | | |
|
||||
|
||||
... Add more
|
||||
|
||||
## Bindings Generation
|
||||
|
||||
Working well.
|
||||
|
||||
## Models Generation
|
||||
|
||||
Working well.
|
||||
|
||||
## Task file
|
||||
|
||||
Contains a lot needed for development.
|
||||
|
||||
## Theme
|
||||
|
||||
| Mode | Windows | Linux | Mac | Notes |
|
||||
| ------ | ------- | ----- | --- | ----- |
|
||||
| Dark | Y | | | |
|
||||
| Light | Y | | | |
|
||||
| System | Y | | | |
|
||||
|
||||
## NSIS Installer
|
||||
|
||||
TBD
|
||||
|
||||
## Templates
|
||||
|
||||
All templates are working.
|
||||
|
||||
## Plugins
|
||||
|
||||
Built-in plugin support:
|
||||
|
||||
| Plugin | Windows | Linux | Mac | Notes |
|
||||
| --------------- | ------- | ----- | --- | ----- |
|
||||
| Browser | Y | | Y | |
|
||||
| KV Store | Y | Y | Y | |
|
||||
| Log | Y | Y | Y | |
|
||||
| Single Instance | Y | | Y | |
|
||||
| SQLite | Y | Y | Y | |
|
||||
| Start at login | Y | | Y | |
|
||||
| Server | | | | |
|
||||
|
||||
TODO:
|
||||
|
||||
- Ensure each plugin has a JS wrapper that can be injected into the window.
|
||||
|
||||
## Packaging
|
||||
|
||||
| | Windows | Linux | Mac | Notes |
|
||||
| --------------- | ------- | ----- | --- | ----- |
|
||||
| Icon Generation | Y | | Y | |
|
||||
| Icon Embedding | Y | | Y | |
|
||||
| Info.plist | - | | Y | |
|
||||
| NSIS Installer | | | - | |
|
||||
| Mac bundle | - | | Y | |
|
||||
| Windows exe | Y | | - | |
|
||||
|
||||
## Frameless Windows
|
||||
|
||||
| Feature | Windows | Linux | Mac | Notes |
|
||||
| ------- | ------- | ----- | --- | ---------------------------------------------- |
|
||||
| Resize | Y | | Y | |
|
||||
| Drag | Y | Y | Y | Linux - can always drag with `Meta`+left mouse |
|
||||
|
||||
## Mac Specific
|
||||
|
||||
- [x] Translucency
|
||||
|
||||
### Mac Options
|
||||
|
||||
| Feature | Default | Notes |
|
||||
| ----------------------- | ----------------- | ---------------------------------------------------- |
|
||||
| Backdrop | MacBackdropNormal | Standard solid window |
|
||||
| DisableShadow | false | |
|
||||
| TitleBar | | Standard window decorations by default |
|
||||
| Appearance | DefaultAppearance | |
|
||||
| InvisibleTitleBarHeight | 0 | Creates an invisible title bar for frameless windows |
|
||||
| DisableShadow | false | Disables the window drop shadow |
|
||||
|
||||
## Windows Specific
|
||||
|
||||
- [x] Translucency
|
||||
- [x] Custom Themes
|
||||
|
||||
### Windows Options
|
||||
|
||||
| Feature | Default | Notes |
|
||||
| --------------------------------- | ------------- | ------------------------------------------- |
|
||||
| BackdropType | Solid | |
|
||||
| DisableIcon | false | |
|
||||
| Theme | SystemDefault | |
|
||||
| CustomTheme | nil | |
|
||||
| DisableFramelessWindowDecorations | false | |
|
||||
| WindowMask | nil | Makes the window the contents of the bitmap |
|
||||
|
||||
## Linux Specific
|
||||
|
||||
Implementation details for the functions utilized by the `*_linux.go` files are
|
||||
located in the following files:
|
||||
|
||||
- linux_cgo.go: CGo implementation
|
||||
- linux_purego.go: PureGo implementation
|
||||
|
||||
### CGO
|
||||
|
||||
By default CGO is utilized to compile the Linux port. This prevents easy
|
||||
cross-compilation and so the PureGo implementation is also being simultaneously
|
||||
developed.
|
||||
|
||||
### Purego
|
||||
|
||||
The examples can be compiled using the following command:
|
||||
|
||||
CGO_ENABLED=0 go build -tags purego
|
||||
|
||||
Note: things are currently not working after the refactor
|
Binary file not shown.
Before Width: | Height: | Size: 15 KiB |
@ -1,4 +0,0 @@
|
||||
{
|
||||
"label": "Getting Started",
|
||||
"position": 10
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
# Feedback
|
||||
|
||||
We welcome (and encourage) your feedback! Please search for existing tickets or
|
||||
posts before creating new ones. Here are the different ways to provide feedback:
|
||||
|
||||
=== "Bugs"
|
||||
|
||||
If you find a bug, please let us know by posting into the [v3 Alpha Feedback](https://discord.gg/Vgff2p8gsy) channel on Discord.
|
||||
|
||||
- The post should clearly state what the bug is and have a simple reproducible example. If the docs are unclear what *should* happen, please include that in the post.
|
||||
- The post should be given the `Bug` tag.
|
||||
- Please include the output of `wails doctor` in your post.
|
||||
- If the bug is behaviour that does not align with current documentation, e.g. a window does not resize properly, please do the following:
|
||||
- Update an existing example in the `v3/example` directory or create a new example in the `v3/examples` folder that clearly shows the issue.
|
||||
- Open a [PR](https://github.com/wailsapp/wails/pulls) with the title `[v3 alpha test] <description of bug>`.
|
||||
- Please include a link to the PR in your post.
|
||||
|
||||
!!! warning
|
||||
*Remember*, unexpected behaviour isn't necessarily a bug - it might just not do what you expect it to do. Use [Suggestions](#__tabbed_1_3) for this.
|
||||
|
||||
|
||||
=== "Fixes"
|
||||
|
||||
If you have a fix for a bug or an update for documentation, please do the following:
|
||||
|
||||
- Open a pull request on the [Wails repository](https://github.com/wailsapp/wails). The title of the PR should start with `[v3 alpha]`.
|
||||
- Create a post in the [v3 Alpha Feedback](https://discord.gg/Vgff2p8gsy) channel.
|
||||
- The post should be given the `PR` tag.
|
||||
- Please include a link to the PR in your post.
|
||||
|
||||
=== "Suggestions"
|
||||
|
||||
If you have a suggestion, please let us know by posting into the [v3 Alpha Feedback](https://discord.gg/Vgff2p8gsy) channel on Discord:
|
||||
|
||||
- The post should be given the `Suggestion` tag.
|
||||
|
||||
Please feel free to reach out to us on [Discord](https://discord.gg/Vgff2p8gsy) if you have any questions.
|
||||
|
||||
=== "Upvoting"
|
||||
|
||||
- Posts can be "upvoted" by using the :thumbsup: emoji. Please apply to any posts that are a priority for you.
|
||||
- Please *don't* just add comments like "+1" or "me too".
|
||||
- Please feel free to comment if there is more to add to the post, such as "this bug also affect ARM builds" or "Another option would be to ....."
|
||||
|
||||
There is a list of known issues & work in progress can be found
|
||||
[here](https://github.com/orgs/wailsapp/projects/6).
|
||||
|
||||
## Things we are looking for feedback on
|
||||
|
||||
- The API
|
||||
- Is it easy to use?
|
||||
- Does it do what you expect?
|
||||
- Is it missing anything?
|
||||
- Is there anything that should be removed?
|
||||
- Is it consistent between Go and JS?
|
||||
- The build system
|
||||
- Is it easy to use?
|
||||
- Can we improve it?
|
||||
- The examples
|
||||
- Are they clear?
|
||||
- Do they cover the basics?
|
||||
- Features
|
||||
- What features are missing?
|
||||
- What features are not needed?
|
||||
- Documentation
|
||||
- What could be clearer?
|
@ -1,94 +0,0 @@
|
||||
# Installation
|
||||
|
||||
To install the Wails CLI, first ensure you have the correct dependencies installed:
|
||||
|
||||
## Supported Platforms
|
||||
|
||||
- Windows 10/11 AMD64/ARM64
|
||||
- MacOS 10.13+ AMD64
|
||||
- MacOS 11.0+ ARM64
|
||||
- Ubuntu 22.04 AMD64/ARM64 (other Linux may work too!)
|
||||
|
||||
## Dependencies
|
||||
|
||||
Wails has a number of common dependencies that are required before installation:
|
||||
|
||||
=== "Go (At least 1.22.4)"
|
||||
|
||||
Download Go from the [Go Downloads Page](https://go.dev/dl/).
|
||||
|
||||
Ensure that you follow the official [Go installation instructions](https://go.dev/doc/install). You will also need to ensure that your `PATH` environment variable also includes the path to your `~/go/bin` directory. Restart your terminal and do the following checks:
|
||||
|
||||
- Check Go is installed correctly: `go version`
|
||||
- Check `~/go/bin` is in your PATH variable
|
||||
- Mac / Linux: `echo $PATH | grep go/bin`
|
||||
- Windows: `$env:PATH -split ';' | Where-Object { $_ -like '*\go\bin' }`
|
||||
|
||||
=== "npm (Optional)"
|
||||
|
||||
Although Wails doesn't require npm to be installed, it is needed by most of the bundled templates.
|
||||
|
||||
Download the latest node installer from the [Node Downloads Page](https://nodejs.org/en/download/). It is best to use the latest release as that is what we generally test against.
|
||||
|
||||
Run `npm --version` to verify.
|
||||
|
||||
=== "Task (Optional)"
|
||||
|
||||
The Wails CLI embeds a task runner called [Task](https://taskfile.dev/#/installation). It is optional, but recommended. If you do not wish to install Task, you can use the `wails3 task` command instead of `task`.
|
||||
Installing Task will give you the greatest flexibility.
|
||||
|
||||
## Platform Specific Dependencies
|
||||
|
||||
You will also need to install platform specific dependencies:
|
||||
|
||||
=== "Mac"
|
||||
|
||||
Wails requires that the xcode command line tools are installed. This can be
|
||||
done by running:
|
||||
|
||||
```
|
||||
xcode-select --install
|
||||
```
|
||||
|
||||
=== "Windows"
|
||||
|
||||
Wails requires that the [WebView2 Runtime](https://developer.microsoft.com/en-us/microsoft-edge/webview2/) is installed. Some Windows installations will already have this installed. You can check using the `wails doctor` command.
|
||||
|
||||
=== "Linux"
|
||||
|
||||
Linux requires the standard `gcc` build tools plus `gtk3` and `webkit2gtk`. Run <code>wails doctor</code> after installation to be shown how to install the dependencies. If your distro/package manager is not supported, please let us know on discord.
|
||||
|
||||
## Installation
|
||||
|
||||
To install the Wails CLI using Go Modules, run the following commands:
|
||||
|
||||
```shell
|
||||
go install -v github.com/wailsapp/wails/v3/cmd/wails3@latest
|
||||
```
|
||||
|
||||
If you would like to install the latest development version, run the following commands:
|
||||
|
||||
```shell
|
||||
git clone https://github.com/wailsapp/wails.git
|
||||
cd wails
|
||||
git checkout v3-alpha
|
||||
cd v3/cmd/wails3
|
||||
go install
|
||||
```
|
||||
|
||||
When using the development version, all generated projects will use Go's [replace(https://go.dev/ref/mod#go-mod-file-replace) directive
|
||||
to ensure projects use the development version of Wails.
|
||||
|
||||
## System Check
|
||||
|
||||
Running `wails3 doctor` will check if you have the correct dependencies
|
||||
installed. If not, it will advise on what is missing and help on how to rectify
|
||||
any problems.
|
||||
|
||||
## The `wails3` command appears to be missing?
|
||||
|
||||
If your system is reporting that the `wails3` command is missing, check the
|
||||
following:
|
||||
|
||||
- Make sure you have followed the [Go installation guide](#__tabbed_1_1) correctly and that the `go/bin` directory is in the `PATH` environment variable.
|
||||
- Close/Reopen current terminals to pick up the new `PATH` variable.
|
@ -1,20 +0,0 @@
|
||||
# Next Steps
|
||||
|
||||
Now that you have created your first application, you can start exploring the other features that v3 alpha provides.
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
The best place to start is the `examples` directory in the Wails repository.
|
||||
This contains a number of examples that you can run and play with.
|
||||
|
||||
To run an example, you can simply use:
|
||||
|
||||
```shell
|
||||
go run .
|
||||
```
|
||||
|
||||
in the example directory.
|
||||
|
||||
!!! note
|
||||
Some examples may not work during alpha development.
|
@ -1,120 +0,0 @@
|
||||
# Your First Application
|
||||
|
||||
Creating your first application with Wails v3 Alpha is an exciting journey into the world of modern desktop app development. This guide will walk you through the process of creating a basic application, showcasing the power and simplicity of Wails.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you begin, ensure you have the following installed:
|
||||
|
||||
- Go (version 1.21 or later)
|
||||
- Node.js (LTS version)
|
||||
- Wails v3 Alpha (see the [installation guide](installation.md) for instructions)
|
||||
|
||||
## Step 1: Creating a New Project
|
||||
|
||||
Open your terminal and run the following command to create a new Wails project:
|
||||
|
||||
`wails3 init -n myfirstapp`
|
||||
|
||||
This command creates a new directory called `myfirstapp` with all the necessary files.
|
||||
|
||||
## Step 2: Exploring the Project Structure
|
||||
|
||||
Navigate to the `myfirstapp` directory. You'll find several files and folders:
|
||||
|
||||
- `build`: Contains files used by the build process.
|
||||
- `frontend`: Contains your web frontend code.
|
||||
- `go.mod` & `go.sum`: Go module files.
|
||||
- `main.go`: The entry point for your Wails application.
|
||||
- `Taskfile.yml`: Defines all the tasks used by the build system. Learn more at the [Task](https://taskfile.dev/) website.
|
||||
|
||||
Take a moment to explore these files and familiarize yourself with the structure.
|
||||
|
||||
!!! note
|
||||
Although Wails v3 uses [Task](https://taskfile.dev/) as its default build system, there is nothing stopping you from using `make` or any other alternative build system.
|
||||
|
||||
## Step 3: Building Your Application
|
||||
|
||||
To build your application, execute:
|
||||
|
||||
`wails3 build`
|
||||
|
||||
This command compiles a debug version of your application and saves it in a new `bin` directory.
|
||||
You can run this like you would any normal application:
|
||||
|
||||
|
||||
=== "Mac"
|
||||
|
||||
`./bin/myfirstapp`
|
||||
|
||||
=== "Windows"
|
||||
|
||||
`bin\myfirstapp.exe`
|
||||
|
||||
=== "Linux"
|
||||
|
||||
`./bin/myfirstapp`
|
||||
|
||||
You'll see a simple UI, the starting point for your application. As it is the debug version, you'll also see logs in the console window. This is useful for debugging purposes.
|
||||
|
||||
## Step 4: Dev Mode
|
||||
|
||||
We can also run the application in development mode. This mode allows you to make changes to your frontend code and see the changes reflected in the running application without having to rebuild the entire application.
|
||||
|
||||
1. Open a new terminal window.
|
||||
2. Run `wails3 dev`.
|
||||
3. Open `frontend/main.js`.
|
||||
4. Change the line that has `<h1>Hello Wails!</h1>` to `<h1>Hello World!</h1>`.
|
||||
5. Save the file.
|
||||
|
||||
The application will update automatically, and you'll see the changes reflected in the running application.
|
||||
|
||||
## Step 5: Building the Application Again
|
||||
|
||||
Once you're happy with your changes, build your application again:
|
||||
|
||||
`wails3 build`
|
||||
|
||||
You'll notice that the build time was faster this time. That's because the new build system only builds the parts of your application that have changed.
|
||||
|
||||
You should see a new executable in the `build` directory.
|
||||
|
||||
## Step 6: Packaging Your Application
|
||||
|
||||
Once your application is ready for distribution, you can create platform-specific packages:
|
||||
|
||||
=== "Mac"
|
||||
|
||||
To create a `.app` bundle:
|
||||
```bash
|
||||
wails3 package
|
||||
```
|
||||
This will create a production build and package it into a `.app` bundle in the `bin` directory.
|
||||
|
||||
=== "Windows"
|
||||
|
||||
To create an NSIS installer:
|
||||
```bash
|
||||
wails3 package
|
||||
```
|
||||
This will create a production build and package it into an NSIS installer in the `bin` directory.
|
||||
|
||||
=== "Linux"
|
||||
|
||||
Wails supports multiple package formats for Linux distribution:
|
||||
```bash
|
||||
# Create all package types (AppImage, deb, rpm, and Arch Linux)
|
||||
wails3 package
|
||||
|
||||
# Or create specific package types
|
||||
wails3 task linux:create:appimage # AppImage format
|
||||
wails3 task linux:create:deb # Debian package
|
||||
wails3 task linux:create:rpm # Red Hat package
|
||||
wails3 task linux:create:aur # Arch Linux package
|
||||
```
|
||||
|
||||
For more detailed information about packaging options and configuration, check out our [Packaging Guide](../learn/guides/packaging.md).
|
||||
|
||||
## Conclusion
|
||||
|
||||
Congratulations! You've just created, developed and packaged your first Wails application. This is just the beginning of what you can achieve with Wails v3. Explore the documentation, experiment with different features, and start building amazing applications!
|
@ -1,42 +0,0 @@
|
||||
# Home
|
||||
|
||||
Welcome to the Wails v3 Alpha documentation. This is your starting point for exploring the latest version of Wails, a powerful framework for building desktop applications using Go and modern web technologies.
|
||||
|
||||
## Introduction
|
||||
|
||||
Wails v3 Alpha is the latest iteration of the Wails project, bringing new features and improvements to make desktop application development more efficient and enjoyable. This version is still in alpha, so some features might change before the final release.
|
||||
|
||||
## Status
|
||||
|
||||
Please consult our [Status Page](status.md) for up-to-date status.
|
||||
|
||||
## What's New
|
||||
|
||||
Here are some of the exciting new features and improvements in Wails v3 Alpha:
|
||||
|
||||
- Multiple Windows
|
||||
- System Trays
|
||||
- Improved bindings generation
|
||||
- Improved build system
|
||||
- Improved events system
|
||||
|
||||
More information about these features and other changes can be found in the [What's new](whats-new.md) section.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To get started with Wails v3 Alpha:
|
||||
|
||||
1. [Installation](getting-started/installation.md): Follow our simple guide to install Wails on your system.
|
||||
2. [Create Your First Application](getting-started/your-first-app.md): Learn how to create your first Wails application with our step-by-step tutorial.
|
||||
3. [Explore the API Reference](./API/application.md): Dive deeper into the API documentation.
|
||||
|
||||
## Alpha Version Notice
|
||||
|
||||
Please note that this is an alpha version of Wails v3. Features may be added, removed, or changed in future updates. This version is intended for early adopters and those who wish to contribute to the development of Wails.
|
||||
|
||||
## Feedback and Contributions
|
||||
|
||||
Your feedback is vital to making Wails better. If you encounter any issues or have suggestions, please use our [Feedback process](getting-started/feedback.md). Contributions to the project are also welcome!
|
||||
|
||||
Thank you for trying out Wails v3 Alpha!
|
||||
|
@ -1,378 +0,0 @@
|
||||
# Bindings Generator Guide
|
||||
|
||||
## Introduction
|
||||
|
||||
One of the key features of Wails is the ability to seamlessly integrate backend Go code with the frontend, enabling
|
||||
efficient communication between the two. This can be done manually by sending messages between the frontend and
|
||||
backend, but this can be cumbersome and error-prone, especially when dealing with complex data types.
|
||||
|
||||
The bindings generator in Wails v3 simplifies this process by automatically generating JavaScript or TypeScript
|
||||
functions and models that reflect the methods and data structures defined in your Go code. This means you can write
|
||||
your backend logic in Go and easily expose it to the frontend without the need for manual binding or complex integration.
|
||||
|
||||
This guide is designed to help you understand and utilise this powerful binding tool.
|
||||
|
||||
## Core Concepts
|
||||
|
||||
In Wails v3, services can be added to your application. These services act as a bridge between the backend and frontend,
|
||||
allowing you to define methods and state that can be accessed and manipulated from the frontend.
|
||||
|
||||
### Services
|
||||
|
||||
1. Services can hold state and expose methods that operate on that state.
|
||||
2. Services can be used similar to controllers in HTTP web applications or as services.
|
||||
3. Only public methods on the service are bound, following Go's convention.
|
||||
|
||||
Here's a simple example of how you can define a service and add it to your Wails application:
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
)
|
||||
|
||||
type GreetService struct {}
|
||||
|
||||
func (g *GreetService) Greet(name string) string {
|
||||
return "Hello " + name
|
||||
}
|
||||
|
||||
func main() {
|
||||
app := application.New(application.Options{
|
||||
Services: []application.Service{
|
||||
application.NewService(&GreetService{}),
|
||||
},
|
||||
})
|
||||
// ....
|
||||
err := app.Run()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In this example, we define a `GreetService` services with a public `Greet` method. The `Greet` method takes a `name`
|
||||
parameter and returns a greeting string.
|
||||
|
||||
We then create a new Wails application using `application.New` and add the `GreetService` service to the
|
||||
application using the `Services` option in the `application.Options`. The `application.NewService` method must always be given an *instance* of
|
||||
the service struct, not the service struct type itself.
|
||||
|
||||
### Generating the Bindings
|
||||
|
||||
By binding the struct, Wails is able to generate the necessary JavaScript or TypeScript code by running the following
|
||||
command in the project directory:
|
||||
|
||||
```bash
|
||||
wails3 generate bindings
|
||||
```
|
||||
The bindings generator will scan the project and dependencies for anything that needs generating.
|
||||
Note: It will take longer the very first time you run the bindings generator, as it will be building up a cache of
|
||||
packages to scan.
|
||||
You should see output similar to the following:
|
||||
|
||||
```bash
|
||||
% wails3 generate bindings
|
||||
INFO 347 Packages, 1 Service, 1 Method, 0 Enums, 0 Models in 1.981036s.
|
||||
INFO Output directory: /Users/me/myproject/frontend/bindings
|
||||
```
|
||||
If we look in the `frontend/bindings` directory, we should see the following files:
|
||||
|
||||
```bash
|
||||
frontend/bindings
|
||||
└── changeme
|
||||
├── greetservice.js
|
||||
└── index.js
|
||||
```
|
||||
|
||||
NOTE: The `changeme` directory is the name of the module defined in `go.mod` and is used to namespace the generated
|
||||
files.
|
||||
|
||||
The generated `greetservice.js` file contains the JavaScript code that mirrors the Go struct and its methods:
|
||||
|
||||
```javascript
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {Promise<string> & { cancel(): void }}
|
||||
*/
|
||||
export function Greet(name) {
|
||||
let $resultPromise = /** @type {any} */($Call.ByID(1411160069, name));
|
||||
return $resultPromise;
|
||||
}
|
||||
```
|
||||
As you can see, it also generates all the necessary JSDoc type information to ensure type safety in your frontend code.
|
||||
|
||||
### Using the Bindings
|
||||
|
||||
You can import and use this file in your frontend code to interact with the backend.
|
||||
|
||||
```javascript
|
||||
import { Greet } from './bindings/changeme/greetservice.js';
|
||||
|
||||
console.log(Greet('Alice')); // Output: Hello Alice
|
||||
```
|
||||
|
||||
### Binding Models
|
||||
|
||||
In addition to binding methods, you can also use structs as input or output parameters in your bound methods. When structs are used as parameters, Wails generates corresponding JavaScript versions of those types.
|
||||
|
||||
Let's extend the previous example to use a `Person` type that has a `Name` field:
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
"log"
|
||||
)
|
||||
|
||||
// Person defines a person
|
||||
type Person struct {
|
||||
// Name of the person
|
||||
Name string
|
||||
}
|
||||
|
||||
type GreetService struct{}
|
||||
|
||||
func (g *GreetService) Greet(person Person) string {
|
||||
return "Hello " + person.Name
|
||||
}
|
||||
|
||||
func main() {
|
||||
app := application.New(application.Options{
|
||||
Services: []application.Service{
|
||||
application.NewService(&GreetService{}),
|
||||
},
|
||||
})
|
||||
// ....
|
||||
app.NewWebviewWindow()
|
||||
err := app.Run()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
In this updated example, we define a `Person` struct with a `Name` field. The `Greet` method in the `GreetService` service
|
||||
now takes a `Person` as an input parameter.
|
||||
|
||||
When you run the bindings generator, Wails will generate a corresponding JavaScript `Person` type that mirrors the Go
|
||||
struct. This allows you to create instances of the `Person` type in your frontend code and pass them to the bound
|
||||
`Greet` method.
|
||||
|
||||
If we run the bindings generator again, we should see the following output:
|
||||
|
||||
```bash
|
||||
% wails3 generate bindings
|
||||
INFO Processed: 347 Packages, 1 Service, 1 Method, 0 Enums, 1 Model in 1.9943997s.
|
||||
INFO Output directory: /Users/me/myproject/frontend/bindings
|
||||
```
|
||||
|
||||
In the `frontend/bindings/changeme` directory, you should see a new `models.js` file containing the following code:
|
||||
|
||||
```javascript
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import {Create as $Create} from "@wailsio/runtime";
|
||||
|
||||
/**
|
||||
* Person defines a person
|
||||
*/
|
||||
export class Person {
|
||||
/**
|
||||
* Creates a new Person instance.
|
||||
* @param {Partial<Person>} [$$source = {}] - The source object to create the Person.
|
||||
*/
|
||||
constructor($$source = {}) {
|
||||
if (!("Name" in $$source)) {
|
||||
/**
|
||||
* Name of the person
|
||||
* @member
|
||||
* @type {string}
|
||||
*/
|
||||
this["Name"] = "";
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Person instance from a string or object.
|
||||
* @param {any} [$$source = {}]
|
||||
* @returns {Person}
|
||||
*/
|
||||
static createFrom($$source = {}) {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new Person(/** @type {Partial<Person>} */($$parsedSource));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
```
|
||||
|
||||
The `Person` class is generated with a constructor that takes an optional `source` parameter, which allows you to
|
||||
create a new `Person` instance from an object. It also has a static `createFrom` method that can create a `Person`
|
||||
instance from a string or object.
|
||||
|
||||
You may also notice that comments in the Go struct are kept in the generated JavaScript code! This can be helpful for
|
||||
understanding the purpose of the fields and methods in the generated models and should be picked up by your IDE.
|
||||
|
||||
### Using Bound Models
|
||||
|
||||
Here's an example of how you can use the generated JavaScript `Person` type in your frontend code:
|
||||
|
||||
```javascript
|
||||
import {Greet} from "./bindings/changeme/GreetService.js";
|
||||
import {Person} from "./bindings/changeme/models.js";
|
||||
|
||||
const resultElement = document.getElementById('result');
|
||||
|
||||
async function doGreet() {
|
||||
let person = new Person({Name: document.getElementById('name').value});
|
||||
if (!person.Name) {
|
||||
person.Name = 'anonymous';
|
||||
}
|
||||
resultElement.innerText = await Greet(person);
|
||||
}
|
||||
```
|
||||
|
||||
In this example, we import the generated `Person` type from the `models` module. We create a new instance of `Person`,
|
||||
set its `Name` property, and pass it to the `Greet` method.
|
||||
|
||||
Using bound models allows you to work with complex data structures and seamlessly pass them between the frontend and
|
||||
backend of your Wails application.
|
||||
|
||||
### Using Typescript
|
||||
|
||||
To generate TypeScript bindings instead of JavaScript, you can use the `-ts` flag:
|
||||
|
||||
```bash
|
||||
% wails3 generate bindings -ts
|
||||
```
|
||||
|
||||
This will generate TypeScript files in the `frontend/bindings` directory:
|
||||
|
||||
```bash
|
||||
frontend/bindings
|
||||
└── main
|
||||
├── greetservice.ts
|
||||
├── index.ts
|
||||
└── models.ts
|
||||
````
|
||||
|
||||
The generated files include `greetservice.ts`, which contains the TypeScript code for the bound struct and its methods,
|
||||
and `models.ts`, which contains the TypeScript types for the bound models:
|
||||
|
||||
```typescript title="GreetService.ts"
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import * as $models from "./models.js";
|
||||
|
||||
export function Greet(person: $models.Person): Promise<string> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(1411160069, person) as any;
|
||||
return $resultPromise;
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
```typescript title="models.ts"
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
/**
|
||||
* Person defines a person
|
||||
*/
|
||||
export class Person {
|
||||
/**
|
||||
* Name of the person
|
||||
*/
|
||||
"Name": string;
|
||||
|
||||
/** Creates a new Person instance. */
|
||||
constructor(source: Partial<Person> = {}) {
|
||||
if (!("Name" in source)) {
|
||||
this["Name"] = "";
|
||||
}
|
||||
|
||||
Object.assign(this, source);
|
||||
}
|
||||
|
||||
/** Creates a new Person instance from a string or object. */
|
||||
static createFrom(source: string | object = {}): Person {
|
||||
let parsedSource = typeof source === 'string' ? JSON.parse(source) : source;
|
||||
return new Person(parsedSource as Partial<Person>);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Using TypeScript bindings provides type safety and improved IDE support when working with the generated code in your frontend.
|
||||
|
||||
### Using `context.Context`
|
||||
|
||||
When defining service methods in Go, you can include `context.Context` as the first parameter. The runtime will automatically provide a context when the method is called from the frontend.
|
||||
|
||||
The context provides several powerful features:
|
||||
|
||||
1. **Cancellation Support**: Long-running operations can be cancelled from the frontend, which will raise an error through the Promise chain.
|
||||
|
||||
2. **Window Information**: You can determine which window made the call using these context keys:
|
||||
- `application.WindowNameKey` - Returns the name of the calling window
|
||||
- `application.WindowIDKey` - Returns the ID of the calling window
|
||||
|
||||
Here are some examples:
|
||||
|
||||
```go
|
||||
// Basic context usage with cancellation
|
||||
func (s *MyService) LongRunningTask(ctx context.Context, input string) (string, error) {
|
||||
select {
|
||||
// Check if the context has been cancelled from the frontend
|
||||
case <-ctx.Done():
|
||||
return "", ctx.Err()
|
||||
default:
|
||||
// Process task
|
||||
return "completed", nil
|
||||
}
|
||||
}
|
||||
|
||||
// Getting caller window information
|
||||
func (s *MyService) WindowAwareMethod(ctx context.Context) (string, error) {
|
||||
windowName := ctx.Value(application.WindowNameKey).(string)
|
||||
windowID := ctx.Value(application.WindowIDKey).(string)
|
||||
return fmt.Sprintf("Called from window: %s (ID: %s)", windowName, windowID), nil
|
||||
}
|
||||
```
|
||||
|
||||
From the frontend, these methods can be called normally. If you need to cancel a long-running operation, the Promise will be rejected with the cancellation error:
|
||||
|
||||
```javascript
|
||||
// Call the method
|
||||
const promise = MyService.LongRunningTask("input");
|
||||
|
||||
// Cancel it later if needed
|
||||
// This will cause the context to be cancelled in the Go method
|
||||
promise.cancel();
|
||||
```
|
||||
|
@ -1,226 +0,0 @@
|
||||
# Wails v3 Build System
|
||||
|
||||
## Overview
|
||||
|
||||
The Wails v3 build system is a flexible and powerful tool designed to streamline the build process for your Wails applications.
|
||||
It leverages [Task](https://taskfile.dev), a task runner that allows you to define and run tasks easily.
|
||||
While the v3 build system is the default, Wails encourages a "bring your own tooling" approach, allowing developers to customize their build process as needed.
|
||||
|
||||
Learn more about how to use Task in the [official documentation](https://taskfile.dev/usage/).
|
||||
|
||||
## Task: The Heart of the Build System
|
||||
|
||||
[Task](https://taskfile.dev) is a modern alternative to Make, written in Go. It uses a YAML file to define tasks and their dependencies. In the Wails v3 build system, [Task](https://taskfile.dev) plays a central role in orchestrating the build process.
|
||||
|
||||
The main `Taskfile.yml` is located in the project root, while platform-specific tasks are defined in `build/Taskfile.<platform>.yml` files.
|
||||
|
||||
```
|
||||
Project Root
|
||||
│
|
||||
├── Taskfile.yml
|
||||
│
|
||||
└── build
|
||||
├── Taskfile.windows.yml
|
||||
├── Taskfile.darwin.yml
|
||||
├── Taskfile.linux.yml
|
||||
└── Taskfile.common.yml
|
||||
```
|
||||
|
||||
The `Taskfile.common.yml` file contains common tasks that are shared across platforms.
|
||||
|
||||
## Taskfile.yml
|
||||
|
||||
The `Taskfile.yml` file is the main entry point for the build system. It defines the tasks and their dependencies. Here's the default ``Taskfile.yml`` file:
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
|
||||
includes:
|
||||
common: ./build/Taskfile.common.yml
|
||||
windows: ./build/Taskfile.windows.yml
|
||||
darwin: ./build/Taskfile.darwin.yml
|
||||
linux: ./build/Taskfile.linux.yml
|
||||
|
||||
vars:
|
||||
APP_NAME: "{{.ProjectName}}"
|
||||
BIN_DIR: "bin"
|
||||
VITE_PORT: '{{.WAILS_VITE_PORT | default 9245}}'
|
||||
|
||||
tasks:
|
||||
build:
|
||||
summary: Builds the application
|
||||
cmds:
|
||||
- task: "{{OS}}:build"
|
||||
|
||||
package:
|
||||
summary: Packages a production build of the application
|
||||
cmds:
|
||||
- task: "{{OS}}:package"
|
||||
|
||||
run:
|
||||
summary: Runs the application
|
||||
cmds:
|
||||
- task: "{{OS}}:run"
|
||||
|
||||
dev:
|
||||
summary: Runs the application in development mode
|
||||
cmds:
|
||||
- wails3 dev -config ./build/devmode.config.yaml -port {{.VITE_PORT}}
|
||||
|
||||
dev:reload:
|
||||
summary: Reloads the application
|
||||
cmds:
|
||||
- task: run
|
||||
```
|
||||
|
||||
## Platform-Specific Taskfiles
|
||||
|
||||
Each platform has its own Taskfile, located in the `build` directory. These files define the core tasks for that
|
||||
platform. Each taskfile includes common tasks from the `Taskfile.common.yml` file.
|
||||
|
||||
### Windows
|
||||
|
||||
Location: `build/Taskfile.windows.yml`
|
||||
|
||||
The Windows-specific Taskfile includes tasks for building, packaging, and running the application on Windows. Key features include:
|
||||
|
||||
- Building with optional production flags
|
||||
- Generating Windows ``.syso`` file
|
||||
- Creating an NSIS installer for packaging
|
||||
|
||||
### Linux
|
||||
|
||||
Location: `build/Taskfile.linux.yml`
|
||||
|
||||
The Linux-specific Taskfile includes tasks for building, packaging, and running the application on Linux. Key features include:
|
||||
|
||||
- Building with optional production flags
|
||||
- Creating an AppImage for packaging
|
||||
- Generating ``.desktop`` file for Linux applications
|
||||
|
||||
### macOS
|
||||
|
||||
Location: `build/Taskfile.darwin.yml`
|
||||
|
||||
The macOS-specific Taskfile includes tasks for building, packaging, and running the application on macOS. Key features include:
|
||||
|
||||
- Building with optional production flags
|
||||
- Creating an ``.app`` bundle for packaging
|
||||
- Setting macOS-specific build flags and environment variables
|
||||
|
||||
## Wails3 Commands and Task Execution
|
||||
|
||||
The `wails3 task` command is an embedded version of taskfile.dev, which executes the tasks defined in your Taskfile.yml.
|
||||
|
||||
The `wails3 build` and `wails3 package` commands are aliases for `wails3 task build` and `wails3 task package` respectively. When you run these commands, Wails internally translates them to the appropriate task execution:
|
||||
|
||||
- `wails3 build` → `wails3 task build`
|
||||
- `wails3 package` → `wails3 task package`
|
||||
|
||||
## Common Build Process
|
||||
|
||||
Across all platforms, the build process typically includes the following steps:
|
||||
|
||||
1. Tidying Go modules
|
||||
2. Building the frontend
|
||||
3. Generating icons
|
||||
4. Compiling the Go code with platform-specific flags
|
||||
5. Packaging the application (platform-specific)
|
||||
|
||||
## Customising the Build Process
|
||||
|
||||
While the v3 build system provides a solid default configuration, you can easily customise it to fit your project's needs. By modifying the `Taskfile.yml` and platform-specific Taskfiles, you can:
|
||||
|
||||
- Add new tasks
|
||||
- Modify existing tasks
|
||||
- Change the order of task execution
|
||||
- Integrate with other tools and scripts
|
||||
|
||||
This flexibility allows you to tailor the build process to your specific requirements while still benefiting from the structure provided by the Wails v3 build system.
|
||||
|
||||
## Development Mode
|
||||
|
||||
The Wails v3 build system includes a powerful development mode that enhances the developer experience by providing live reloading and hot module replacement.
|
||||
This mode is activated using the `wails3 dev` command.
|
||||
|
||||
### How It Works
|
||||
|
||||
When you run `wails3 dev`, the following process occurs:
|
||||
|
||||
1. The command checks for an available port, defaulting to 9245 if not specified.
|
||||
2. It sets up the environment variables for the frontend dev server (Vite).
|
||||
3. It starts the file watcher using the `refresh` library.
|
||||
|
||||
The [refresh](https://github.com/atterpac/refresh) library is responsible for monitoring file changes and triggering rebuilds.
|
||||
It uses a configuration file, typically located at `./build/devmode.config.yaml`, to determine which files to watch and what
|
||||
actions to take when changes are detected.
|
||||
|
||||
### Configuration
|
||||
|
||||
The development mode can be configured using the `devmode.config.yaml` file. Here's an example of its structure:
|
||||
|
||||
```yaml
|
||||
config:
|
||||
root_path: .
|
||||
log_level: warn
|
||||
debounce: 1000
|
||||
ignore:
|
||||
dir:
|
||||
- .git
|
||||
- node_modules
|
||||
- frontend
|
||||
- bin
|
||||
file:
|
||||
- .DS_Store
|
||||
- .gitignore
|
||||
- .gitkeep
|
||||
watched_extension:
|
||||
- "*.go"
|
||||
git_ignore: true
|
||||
executes:
|
||||
- cmd: wails3 task common:install:frontend:deps
|
||||
type: once
|
||||
- cmd: wails3 task common:dev:frontend
|
||||
type: background
|
||||
- cmd: go mod tidy
|
||||
type: blocking
|
||||
- cmd: wails3 task build
|
||||
type: blocking
|
||||
- cmd: wails3 task run
|
||||
type: primary
|
||||
```
|
||||
|
||||
This configuration file allows you to:
|
||||
|
||||
- Set the root path for file watching
|
||||
- Configure logging level
|
||||
- Set a debounce time for file change events
|
||||
- Ignore specific directories, files, or file extensions
|
||||
- Define commands to execute on file changes
|
||||
|
||||
### Customising Development Mode
|
||||
|
||||
You can customise the development mode experience by modifying the `devmode.config.yaml` file.
|
||||
|
||||
Some ways to customise include:
|
||||
|
||||
1. Changing the watched directories or files
|
||||
2. Adjusting the debounce time to control how quickly the system responds to changes
|
||||
3. Adding or modifying the execute commands to fit your project's needs
|
||||
|
||||
You can also specify a custom configuration file and port:
|
||||
|
||||
```shell
|
||||
wails3 dev -config ./path/to/custom/config.yaml -port 8080
|
||||
```
|
||||
|
||||
### Using a browser for development
|
||||
|
||||
Whilst v2 fully supported the use of a browser for development, it caused a lot of confusion. Applications that would
|
||||
work in the browser would not necessarily work in the desktop application, as not all browser APIs are available in
|
||||
webviews.
|
||||
|
||||
For UI-focused development work, you still have the flexibility to use a browser in v3, by accessing the Vite URL at
|
||||
http://localhost:9245 in dev mode. This gives you access to powerful browser dev tools while working on styling and
|
||||
layout. When you're ready to test functionality like bindings and events, simply switch to the desktop view to ensure
|
||||
everything works perfectly in the production environment.
|
@ -1,111 +0,0 @@
|
||||
# Customising Window Controls in Wails
|
||||
|
||||
Wails provides an API to control the appearance and functionality of the controls of a window.
|
||||
This functionality is available on Windows and macOS, but not on Linux.
|
||||
|
||||
## Setting the Window Button States
|
||||
|
||||
The button states are defined by the `ButtonState` enum:
|
||||
|
||||
```go
|
||||
type ButtonState int
|
||||
|
||||
const (
|
||||
ButtonEnabled ButtonState = 0
|
||||
ButtonDisabled ButtonState = 1
|
||||
ButtonHidden ButtonState = 2
|
||||
)
|
||||
```
|
||||
|
||||
- `ButtonEnabled`: The button is enabled and visible.
|
||||
- `ButtonDisabled`: The button is visible but disabled (grayed out).
|
||||
- `ButtonHidden`: The button is hidden from the titlebar.
|
||||
|
||||
The button states can be set during window creation or at runtime.
|
||||
|
||||
### Setting Button States During Window Creation
|
||||
|
||||
When creating a new window, you can set the initial state of the buttons using the `WebviewWindowOptions` struct:
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := application.New(application.Options{
|
||||
Name: "My Application",
|
||||
})
|
||||
|
||||
app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
|
||||
MinimiseButtonState: application.ButtonHidden,
|
||||
MaximiseButtonState: application.ButtonDisabled,
|
||||
CloseButtonState: application.ButtonEnabled,
|
||||
})
|
||||
|
||||
app.Run()
|
||||
}
|
||||
```
|
||||
|
||||
In the example above, the minimise button is hidden, the maximise button is inactive (grayed out), and the close button is active.
|
||||
|
||||
### Setting Button States at Runtime
|
||||
|
||||
You can also change the button states at runtime using the following methods on the `Window` interface:
|
||||
|
||||
```go
|
||||
window.SetMinimiseButtonState(wails.ButtonHidden)
|
||||
window.SetMaximiseButtonState(wails.ButtonEnabled)
|
||||
window.SetCloseButtonState(wails.ButtonDisabled)
|
||||
```
|
||||
|
||||
### Platform Differences
|
||||
|
||||
The button state functionality behaves slightly differently on Windows and macOS:
|
||||
|
||||
| | Windows | Mac |
|
||||
|-----------------------|------------------------|------------------------|
|
||||
| Disable Min/Max/Close | Disables Min/Max/Close | Disables Min/Max/Close |
|
||||
| Hide Min | Disables Min | Hides Min button |
|
||||
| Hide Max | Disables Max | Hides Max button |
|
||||
| Hide Close | Hides all controls | Hides Close |
|
||||
|
||||
Note: On Windows, it is not possible to hide the Min/Max buttons individually.
|
||||
However, disabling both will hide both of the controls and only show the
|
||||
close button.
|
||||
|
||||
### Controlling Window Style (Windows)
|
||||
|
||||
To control the style of the titlebar on Windows, you can use the `ExStyle` field in the `WebviewWindowOptions` struct:
|
||||
|
||||
Example:
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
"github.com/wailsapp/wails/v3/pkg/w32"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := application.New(application.Options{
|
||||
Name: "My Application",
|
||||
})
|
||||
|
||||
app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
|
||||
Windows: application.WindowsWindow{
|
||||
ExStyle: w32.WS_EX_TOOLWINDOW | w32.WS_EX_NOREDIRECTIONBITMAP | w32.WS_EX_TOPMOST,
|
||||
},
|
||||
})
|
||||
|
||||
app.Run()
|
||||
}
|
||||
```
|
||||
|
||||
Other options that affect the Extended Style of a window will be overridden by this setting:
|
||||
- HiddenOnTaskbar
|
||||
- AlwaysOnTop
|
||||
- IgnoreMouseEvents
|
||||
- BackgroundType
|
@ -1,139 +0,0 @@
|
||||
# File Associations
|
||||
|
||||
File associations allow your application to handle specific file types when users open them. This is particularly useful for text editors, image viewers, or any application that works with specific file formats. This guide explains how to implement file associations in your Wails v3 application.
|
||||
|
||||
## Overview
|
||||
|
||||
File association support in Wails v3 is currently available for:
|
||||
|
||||
- Windows (NSIS installer packages)
|
||||
- macOS (application bundles)
|
||||
|
||||
## Configuration
|
||||
|
||||
File associations are configured in the `config.yml` file located in your project's `build` directory.
|
||||
|
||||
### Basic Configuration
|
||||
|
||||
To set up file associations:
|
||||
|
||||
1. Open `build/config.yml`
|
||||
2. Add your file associations under the `fileAssociations` section
|
||||
3. Run `wails3 update build-assets` to update the build assets
|
||||
4. Set the `FileAssociations` field in the application options
|
||||
5. Package your application using `wails3 package`
|
||||
|
||||
Here's an example configuration:
|
||||
|
||||
```yaml
|
||||
fileAssociations:
|
||||
- ext: myapp
|
||||
name: MyApp Document
|
||||
description: MyApp Document File
|
||||
iconName: myappFileIcon
|
||||
role: Editor
|
||||
- ext: custom
|
||||
name: Custom Format
|
||||
description: Custom File Format
|
||||
iconName: customFileIcon
|
||||
role: Editor
|
||||
```
|
||||
|
||||
### Configuration Properties
|
||||
|
||||
| Property | Description | Platform |
|
||||
|-------------|------------------------------------------------------------------|----------|
|
||||
| ext | File extension without the leading period (e.g., `txt`) | All |
|
||||
| name | Display name for the file type | All |
|
||||
| description | Description shown in file properties | Windows |
|
||||
| iconName | Name of the icon file (without extension) in the build folder | All |
|
||||
| role | Application's role for this file type (e.g., `Editor`, `Viewer`) | macOS |
|
||||
|
||||
## Listening for File Open Events
|
||||
|
||||
To handle file open events in your application, you can listen for the `events.Common.ApplicationOpenedWithFile` event:
|
||||
|
||||
```go
|
||||
func main() {
|
||||
app := application.New(application.Options{
|
||||
Name: "MyApp",
|
||||
FileAssociations: []string{".txt", ".md"}, // Specify supported extensions
|
||||
})
|
||||
|
||||
// Listen for files being used to open the application
|
||||
app.OnApplicationEvent(events.Common.ApplicationOpenedWithFile, func(event *application.ApplicationEvent) {
|
||||
associatedFile := event.Context().Filename()
|
||||
application.InfoDialog().SetMessage("Application opened with file: " + associatedFile).Show()
|
||||
})
|
||||
|
||||
// Create your window and run the app...
|
||||
}
|
||||
|
||||
```
|
||||
## Step-by-Step Tutorial
|
||||
|
||||
Let's walk through setting up file associations for a simple text editor:
|
||||
|
||||
### 1. Create Icons
|
||||
|
||||
- Create icons for your file type (recommended sizes: 16x16, 32x32, 48x48, 256x256)
|
||||
- Save the icons in your project's `build` folder
|
||||
- Name them according to your `iconName` configuration (e.g., `textFileIcon.png`)
|
||||
|
||||
!!! tip
|
||||
You can use `wails3 generate icons` to generate the required icons for you. Run `wails3 generate icons --help` for more information.
|
||||
|
||||
### 2. Configure File Associations
|
||||
|
||||
Edit the `build/config.yml` file to add your file associations:
|
||||
|
||||
```yaml
|
||||
# build/config.yml
|
||||
fileAssociations:
|
||||
- ext: txt
|
||||
name: Text Document
|
||||
description: Plain Text Document
|
||||
iconName: textFileIcon
|
||||
role: Editor
|
||||
```
|
||||
|
||||
### 3. Update Build Assets
|
||||
|
||||
Run the following command to update the build assets:
|
||||
|
||||
```bash
|
||||
wails3 update build-assets
|
||||
```
|
||||
|
||||
### 4. Set File Associations in the Application Options
|
||||
|
||||
In your `main.go` file, set the `FileAssociations` field in the application options:
|
||||
|
||||
```go
|
||||
app := application.New(application.Options{
|
||||
Name: "MyApp",
|
||||
FileAssociations: []string{".txt", ".md"}, // Specify supported extensions
|
||||
})
|
||||
```
|
||||
|
||||
??? question "Why do the file extensions need to be set in the application config when it's set in `config.yml`?"
|
||||
|
||||
On Windows, when a file is opened with a file association, the application is launched with the filename as the first argument to the application.
|
||||
The application has no way of knowing if the first argument is a file or a command line argument, so it uses the `FileAssociations` field in the application options to determine if the first argument is an associated file or not.
|
||||
|
||||
### 5. Package Your Application
|
||||
|
||||
Package your application using the following command:
|
||||
|
||||
```bash
|
||||
wails3 package
|
||||
```
|
||||
|
||||
The packaged application will be created in the `bin` directory. You can then install and test the application.
|
||||
|
||||
## Additional Notes
|
||||
|
||||
- Icons should be provided in PNG format in the build folder
|
||||
- Testing file associations requires installing the packaged application
|
||||
|
||||
|
@ -1,68 +0,0 @@
|
||||
# Packaging Your Application
|
||||
|
||||
This guide explains how to package your Wails application for different platforms.
|
||||
|
||||
## Windows
|
||||
|
||||
Windows applications are packaged as `.exe` files. Wails automatically handles this during the build process, creating a standalone executable that includes all necessary resources.
|
||||
|
||||
## macOS
|
||||
|
||||
macOS applications are packaged as `.app` bundles. Wails creates these bundles automatically during the build process, including proper code signing and notarization if configured.
|
||||
|
||||
## Linux
|
||||
|
||||
Linux applications can be packaged in various formats. Wails v3 uses [nfpm](https://github.com/goreleaser/nfpm), an excellent packaging tool that makes it easy to create `.deb`, `.rpm`, and Arch Linux packages. nfpm is a powerful tool that handles the complexities of Linux packaging, making it easy to create professional-grade packages.
|
||||
|
||||
### Package Types
|
||||
|
||||
Wails supports creating the following types of Linux packages:
|
||||
- Debian packages (`.deb`) - for Debian, Ubuntu, and related distributions
|
||||
- Red Hat packages (`.rpm`) - for Red Hat, Fedora, CentOS, and related distributions
|
||||
- Arch Linux packages - for Arch Linux and related distributions
|
||||
- AppImage - a distribution-independent package format
|
||||
|
||||
### Building Packages
|
||||
|
||||
Wails provides several task commands for building Linux packages. These are defined in `Taskfile.linux.yml` and can be invoked using the `wails3 task` command:
|
||||
|
||||
```bash
|
||||
# Build all package types (AppImage, deb, rpm, and Arch Linux)
|
||||
wails3 task linux:package
|
||||
|
||||
# Build specific package types
|
||||
wails3 task linux:create:appimage # Create an AppImage
|
||||
wails3 task linux:create:deb # Create a Debian package
|
||||
wails3 task linux:create:rpm # Create a Red Hat package
|
||||
wails3 task linux:create:aur # Create an Arch Linux package
|
||||
```
|
||||
|
||||
Each of these tasks will:
|
||||
1. Build your application in production mode
|
||||
2. Generate necessary desktop integration files
|
||||
3. Create the appropriate package using nfpm
|
||||
|
||||
### Configuration
|
||||
|
||||
The package configuration file should follow the nfpm configuration format and is typically located at `build/nfpm/nfpm.yaml`. Here's an example:
|
||||
|
||||
```yaml
|
||||
name: "myapp"
|
||||
arch: "amd64"
|
||||
version: "v1.0.0"
|
||||
maintainer: "Your Name <your.email@example.com>"
|
||||
description: |
|
||||
A short description of your application
|
||||
vendor: "Your Company"
|
||||
homepage: "https://yourcompany.com"
|
||||
license: "MIT"
|
||||
contents:
|
||||
- src: ./build/bin/myapp
|
||||
dst: /usr/bin/myapp
|
||||
- src: ./assets/icon.png
|
||||
dst: /usr/share/icons/myapp.png
|
||||
- src: ./assets/myapp.desktop
|
||||
dst: /usr/share/applications/myapp.desktop
|
||||
```
|
||||
|
||||
For detailed information about all available configuration options, please refer to the [nfpm configuration documentation](https://nfpm.goreleaser.com/configuration/).
|
@ -1,57 +0,0 @@
|
||||
# Runtime
|
||||
|
||||
The Wails runtime is the standard library for Wails applications. It provides a number of features that may
|
||||
be used in your applications, including:
|
||||
|
||||
- Window management
|
||||
- Dialogs
|
||||
- Browser integration
|
||||
- Clipboard
|
||||
- Frameless dragging
|
||||
- Tray icons
|
||||
- Menu management
|
||||
- System information
|
||||
- Events
|
||||
- Calling Go code
|
||||
- Context Menus
|
||||
- Screens
|
||||
- WML (Wails Markup Language)
|
||||
|
||||
The runtime is required for integration between Go and the frontend. There are 2 ways to integrate the runtime:
|
||||
|
||||
- Using the `@wailsio/runtime` package
|
||||
- Using a pre-built version of the runtime
|
||||
|
||||
## Using the `@wailsio/runtime` package
|
||||
|
||||
The `@wailsio/runtime` package is a JavaScript package that provides access to the Wails runtime. It is used in by all
|
||||
the standard templates and is the recommended way to integrate the runtime into your application. By using the package,
|
||||
you will only include the parts of the runtime that you use.
|
||||
|
||||
The package is available on npm and can be installed using:
|
||||
|
||||
```shell
|
||||
npm install --save @wailsio/runtime
|
||||
```
|
||||
|
||||
## Using a pre-built version of the runtime
|
||||
|
||||
Some projects will not use a Javascript bundler and may prefer to use a pre-built version of the runtime. This is
|
||||
the default for the examples in `v3/examples`. The pre-built version of the runtime can be generated using the
|
||||
following command:
|
||||
|
||||
```shell
|
||||
wails3 generate runtime
|
||||
```
|
||||
|
||||
This will generate a `runtime.js` (and `runtime.debug.js`) file in the current directory.
|
||||
This file can be used by your application by adding it to your assets directory (normally `frontend/dist`) and then including it in your HTML:
|
||||
|
||||
```html
|
||||
<html>
|
||||
<head>
|
||||
<script src="/runtime.js"></script>
|
||||
</head>
|
||||
<!--- ... -->
|
||||
</>
|
||||
```
|
@ -1,145 +0,0 @@
|
||||
# Services
|
||||
|
||||
Services in Wails v3 provide a powerful way to extend the functionality of your application. They allow you to create
|
||||
modular, reusable components that can be easily integrated into your Wails application.
|
||||
|
||||
## Overview
|
||||
|
||||
Services are designed to encapsulate specific functionality and can be registered with the application at startup.
|
||||
They can handle various tasks such as file serving, database operations, logging, and more.
|
||||
Services can also interact with the application lifecycle and respond to HTTP requests.
|
||||
|
||||
## Creating a Service
|
||||
|
||||
To create a service, you simply define a struct. Here's a basic structure of a service:
|
||||
|
||||
```go
|
||||
type MyService struct {
|
||||
// Your service fields
|
||||
}
|
||||
|
||||
func NewMyService() *MyService {
|
||||
// Initialize and return your service
|
||||
}
|
||||
|
||||
func (s *MyService) Greet(name string) string {
|
||||
return fmt.Sprintf("Hello, %s!", name)
|
||||
}
|
||||
```
|
||||
|
||||
This service has a single method, `Greet`, which accepts a name and returns a greeting.
|
||||
|
||||
## Registering a Service
|
||||
|
||||
To register a service with the application, you need to provide an instance of the service to the `Services` field of
|
||||
the `application.Options` struct (All services need to be wrapped by an `application.NewService` call. Here's an example:
|
||||
|
||||
```go
|
||||
app := application.New(application.Options{
|
||||
Services: []application.Service{
|
||||
application.NewService(NewMyService()),
|
||||
},
|
||||
})
|
||||
|
||||
```
|
||||
|
||||
## Optional Methods
|
||||
|
||||
Services can implement optional methods to hook into the application lifecycle:
|
||||
|
||||
### Name
|
||||
|
||||
```go
|
||||
func (s *Service) Name() string
|
||||
```
|
||||
|
||||
This method returns the name of the service. It is used for logging purposes only.
|
||||
|
||||
### OnStartup
|
||||
|
||||
```go
|
||||
func (s *Service) OnStartup(ctx context.Context, options application.ServiceOptions) error
|
||||
```
|
||||
|
||||
This method is called when the application is starting up. You can use it to initialize resources, set up connections,
|
||||
or perform any necessary setup tasks. The context is the application context, and the `options` parameter provides
|
||||
additional information about the service.
|
||||
|
||||
### OnShutdown
|
||||
|
||||
```go
|
||||
func (s *Service) OnShutdown() error
|
||||
```
|
||||
|
||||
This method is called when the application is shutting down. Use it to clean up resources, close connections, or
|
||||
perform any necessary cleanup tasks.
|
||||
|
||||
### ServeHTTP
|
||||
|
||||
```go
|
||||
func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)
|
||||
```
|
||||
|
||||
If your service needs to handle HTTP requests, implement this method. It allows your service to act as an HTTP handler.
|
||||
The route of the handler is defined in the service options:
|
||||
|
||||
```go
|
||||
application.NewService(fileserver.New(&fileserver.Config{
|
||||
RootPath: rootPath,
|
||||
}), application.ServiceOptions{
|
||||
Route: "/files",
|
||||
}),
|
||||
```
|
||||
|
||||
## Example: File Server Service
|
||||
|
||||
Let's look at a simplified version of the `fileserver` service as an example:
|
||||
|
||||
```go
|
||||
type Service struct {
|
||||
config *Config
|
||||
fs http.Handler
|
||||
}
|
||||
|
||||
func New(config *Config) *Service {
|
||||
return &Service{
|
||||
config: config,
|
||||
fs: http.FileServer(http.Dir(config.RootPath)),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Service) Name() string {
|
||||
return "github.com/wailsapp/wails/v3/services/fileserver"
|
||||
}
|
||||
|
||||
func (s *Service) OnStartup(ctx context.Context, options application.ServiceOptions) error {
|
||||
// Any initialization code here
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
s.fs.ServeHTTP(w, r)
|
||||
}
|
||||
```
|
||||
|
||||
We can now use this service in our application:
|
||||
|
||||
```go
|
||||
app := application.New(application.Options{
|
||||
Services: []application.Service{
|
||||
application.NewService(fileserver.New(&fileserver.Config{
|
||||
RootPath: rootPath,
|
||||
}), application.ServiceOptions{
|
||||
Route: "/files",
|
||||
}),
|
||||
```
|
||||
All requests to `/files` will be handled by the `fileserver` service.
|
||||
|
||||
## Application Lifecycle and Services
|
||||
|
||||
1. During application initialization, services are registered with the application.
|
||||
2. When the application starts (`app.Run()`), the `OnStartup` method of each service is called with the application
|
||||
context and service options.
|
||||
3. Throughout the application's lifetime, services can perform their specific tasks.
|
||||
4. If a service implements `ServeHTTP`, it can handle HTTP requests at the specified path.
|
||||
5. When the application is shutting down, the `OnShutdown` method of each service is called as well as the context being cancelled.
|
@ -1,27 +0,0 @@
|
||||
# Roadmap
|
||||
|
||||
## Current Status: Alpha 7
|
||||
|
||||
Our goal is to reach Beta status. This roadmap outlines the key features and improvements we need to implement before transitioning to Beta. Please note that this is a living document and may be updated as priorities shift or new insights emerge.
|
||||
|
||||
## How You Can Contribute
|
||||
|
||||
- Test the latest alpha release and report any issues
|
||||
- Contribute to documentation and examples
|
||||
- Participate in discussions and provide feedback on proposed features
|
||||
- Submit pull requests for bug fixes or new features
|
||||
|
||||
We welcome contributions from the community. If you'd like to help with any of these objectives or have suggestions for the roadmap, please open an issue or join our community discussions.
|
||||
|
||||
## Feedback and Updates
|
||||
|
||||
This roadmap is subject to change based on community feedback and project priorities. We'll update it regularly to reflect our progress and any changes in direction. Your input is valuable in shaping the future of Wails!
|
||||
The roadmap is a living document and is subject to change. If you have any
|
||||
suggestions, please open an issue. Each milestone will have a set of goals that
|
||||
we are aiming to achieve. These are subject to change.
|
||||
|
||||
## Alpha 8 Status
|
||||
|
||||
- In Progress: Add support for File Associations
|
||||
- In Progress: Drag and Drop support for Linux
|
||||
|
@ -1,22 +0,0 @@
|
||||
|
||||
[data-md-color-scheme="slate"] {
|
||||
--md-hue: 208;
|
||||
--md-primary-fg-color--light: #ECB7B7;
|
||||
--md-primary-fg-color--dark: #90030C;
|
||||
--md-accent-fg-color: #ff4646;
|
||||
--md-primary-fg-color: #2a2a2a;
|
||||
--md-default-bg-color: #191919;
|
||||
--md-footer-bg-color--dark: #2a2a2a;
|
||||
--md-default-fg-color: #e0e0e0;
|
||||
}
|
||||
|
||||
.md-header__button.md-logo img, .md-header__button.md-logo svg {
|
||||
fill: currentcolor;
|
||||
display: block;
|
||||
height: 2rem;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.md-typeset {
|
||||
font-weight: 100;
|
||||
}
|
@ -1,351 +0,0 @@
|
||||
# What's New in Wails v3 Alpha
|
||||
|
||||
Wails v3 Alpha introduces significant changes from v2. It replaces the single-window,
|
||||
declarative API with a more flexible procedural approach. This new API design improves
|
||||
code readability and simplifies development, especially for complex multi-window
|
||||
applications.
|
||||
|
||||
Wails v3 Alpha represents a substantial evolution in how desktop applications can be
|
||||
built using Go and web technologies.
|
||||
|
||||
## Multiple Windows
|
||||
|
||||
Wails v3 introduces the ability to create and manage multiple windows within a single application.
|
||||
This feature allows developers to design more complex and versatile user interfaces, moving
|
||||
beyond the limitations of single-window applications.
|
||||
|
||||
Each window can be independently configured, providing flexibility in terms of size, position, content, and behavior. This enables the creation of applications with separate windows for different functionalities, such as main interfaces, settings panels, or auxiliary views.
|
||||
|
||||
Developers can create, manipulate, and manage these windows programmatically, allowing for dynamic user interfaces that adapt to user needs and application states.
|
||||
|
||||
???+ example "Multiple Windows"
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"log"
|
||||
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
)
|
||||
|
||||
//go:embed assets/*
|
||||
var assets embed.FS
|
||||
|
||||
func main() {
|
||||
|
||||
app := application.New(application.Options{
|
||||
Name: "Multi Window Demo",
|
||||
Assets: application.AssetOptions{
|
||||
Handler: application.AssetFileServerFS(assets),
|
||||
},
|
||||
})
|
||||
|
||||
window1 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
|
||||
Title: "Window 1",
|
||||
})
|
||||
|
||||
window2 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
|
||||
Title: "Window 2",
|
||||
})
|
||||
|
||||
// load the embedded html from the embed.FS
|
||||
window1.SetURL("/")
|
||||
window1.Center()
|
||||
|
||||
// Load an external URL
|
||||
window2.SetURL("https://wails.app")
|
||||
|
||||
err := app.Run()
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## System Tray Integration
|
||||
|
||||
Wails v3 introduces robust support for system tray functionality, allowing your application to maintain a persistent presence on the user's desktop. This feature is particularly useful for applications that need to run in the background or provide quick access to key functions.
|
||||
|
||||
Key features of the Wails v3 system tray integration include:
|
||||
|
||||
1. Window Attachment: You can associate a window with the system tray icon. When activated, this window will be centered relative to the icon's position, providing a seamless user experience.
|
||||
|
||||
2. Comprehensive Menu Support: Create rich, interactive menus that users can access directly from the system tray icon. This allows for quick actions without needing to open the full application window.
|
||||
|
||||
3. Adaptive Icon Display: Support for both light and dark mode icons ensures your application's system tray icon remains visible and aesthetically pleasing across different system themes.
|
||||
???+ example "Systray"
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"log"
|
||||
"runtime"
|
||||
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
"github.com/wailsapp/wails/v3/pkg/icons"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := application.New(application.Options{
|
||||
Name: "Systray Demo",
|
||||
Mac: application.MacOptions{
|
||||
ActivationPolicy: application.ActivationPolicyAccessory,
|
||||
},
|
||||
})
|
||||
|
||||
window := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
|
||||
Width: 500,
|
||||
Height: 800,
|
||||
Frameless: true,
|
||||
AlwaysOnTop: true,
|
||||
Hidden: true,
|
||||
Windows: application.WindowsWindow{
|
||||
HiddenOnTaskbar: true,
|
||||
},
|
||||
})
|
||||
|
||||
systemTray := app.NewSystemTray()
|
||||
|
||||
// Support for template icons on macOS
|
||||
if runtime.GOOS == "darwin" {
|
||||
systemTray.SetTemplateIcon(icons.SystrayMacTemplate)
|
||||
} else {
|
||||
// Support for light/dark mode icons
|
||||
systemTray.SetDarkModeIcon(icons.SystrayDark)
|
||||
systemTray.SetIcon(icons.SystrayLight)
|
||||
}
|
||||
|
||||
// Support for menu
|
||||
myMenu := app.NewMenu()
|
||||
myMenu.Add("Hello World!").OnClick(func(_ *application.Context) {
|
||||
println("Hello World!")
|
||||
})
|
||||
systemTray.SetMenu(myMenu)
|
||||
|
||||
// This will center the window to the systray icon with a 5px offset
|
||||
// It will automatically be shown when the systray icon is clicked
|
||||
// and hidden when the window loses focus
|
||||
systemTray.AttachWindow(window).WindowOffset(5)
|
||||
|
||||
err := app.Run()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Improved bindings generation
|
||||
|
||||
Wails v3 introduces a significant improvement in how bindings are generated for your project. Bindings are the glue that connects your Go backend to your frontend, allowing seamless communication between the two.
|
||||
|
||||
Binding generation is now done using a sophisticated static analyzer that radically improves the binding generation process.
|
||||
It offers enhanced speed and preserves code quality by maintaining comments and parameter names.
|
||||
|
||||
The binding generation process has been simplified, requiring only a single command: `wails3 generate bindings`.
|
||||
|
||||
???+ example "Bindings"
|
||||
|
||||
```js
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
import { main } from "./models";
|
||||
|
||||
window.go = window.go || {};
|
||||
window.go.main = {
|
||||
GreetService: {
|
||||
/**
|
||||
* GreetService.Greet
|
||||
* Greet greets a person
|
||||
* @param name {string}
|
||||
* @returns {Promise<string>}
|
||||
**/
|
||||
Greet: function (name) {
|
||||
wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0));
|
||||
},
|
||||
|
||||
/**
|
||||
* GreetService.GreetPerson
|
||||
* GreetPerson greets a person
|
||||
* @param person {main.Person}
|
||||
* @returns {Promise<string>}
|
||||
**/
|
||||
GreetPerson: function (person) {
|
||||
wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0));
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## Improved build system
|
||||
|
||||
Wails v3 introduces a more flexible and transparent build system, addressing the limitations of its predecessor.
|
||||
In v2, the build process was largely opaque and difficult to customise, which could be frustrating for developers
|
||||
seeking more control over their project's build process.
|
||||
|
||||
All the heavy lifting that the v2 build system did, such as icon generation and manifest creation,
|
||||
have been added as tool commands in the CLI. We have incorporated
|
||||
[Taskfile](https://taskfile.dev) into the CLI to orchestrate these calls to
|
||||
bring the same developer experience as v2. However, this approach brings the
|
||||
ultimate balance of flexibility and ease of use as you can now customise the
|
||||
build process to your needs.
|
||||
|
||||
You can even use make if that's your thing!
|
||||
|
||||
???+ example "Taskfile.yml"
|
||||
```yaml title="Snippet from Taskfile.yml"
|
||||
build:darwin:
|
||||
summary: Builds the application
|
||||
platforms:
|
||||
- darwin
|
||||
cmds:
|
||||
- task: pre-build
|
||||
- task: build-frontend
|
||||
- go build -gcflags=all="-N -l" -o bin/{{.APP_NAME}}
|
||||
- task: post-build
|
||||
env:
|
||||
CGO_CFLAGS: "-mmacosx-version-min=10.13"
|
||||
CGO_LDFLAGS: "-mmacosx-version-min=10.13"
|
||||
MACOSX_DEPLOYMENT_TARGET: "10.13"
|
||||
```
|
||||
|
||||
## Improved events
|
||||
|
||||
Wails now emits events for various runtime operations and system activities.
|
||||
This allows your application to respond to these events in real-time. Additionally,
|
||||
cross-platform (common) events are available, enabling you to write consistent event
|
||||
handling methods that work across different operating systems.
|
||||
|
||||
Event hooks can be registered to handle specific events synchronously. Unlike the `On`
|
||||
method, these hooks allow you to cancel the event if needed. A common use case is
|
||||
displaying a confirmation dialog before closing a window. This gives you more control
|
||||
over the event flow and user experience.
|
||||
|
||||
???+ example "Example of event handling"
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
"github.com/wailsapp/wails/v3/pkg/events"
|
||||
)
|
||||
|
||||
//go:embed assets
|
||||
var assets embed.FS
|
||||
|
||||
func main() {
|
||||
|
||||
app := application.New(application.Options{
|
||||
Name: "Events Demo",
|
||||
Description: "A demo of the Events API",
|
||||
Assets: application.AssetOptions{
|
||||
Handler: application.AssetFileServerFS(assets),
|
||||
},
|
||||
Mac: application.MacOptions{
|
||||
ApplicationShouldTerminateAfterLastWindowClosed: true,
|
||||
},
|
||||
})
|
||||
|
||||
// Custom event handling
|
||||
app.Events.On("myevent", func(e *application.WailsEvent) {
|
||||
log.Printf("[Go] WailsEvent received: %+v\n", e)
|
||||
})
|
||||
|
||||
// OS specific application events
|
||||
app.On(events.Mac.ApplicationDidFinishLaunching, func(event *application.Event) {
|
||||
println("events.Mac.ApplicationDidFinishLaunching fired!")
|
||||
})
|
||||
|
||||
// Platform agnostic events
|
||||
app.On(events.Common.ApplicationStarted, func(event *application.Event) {
|
||||
println("events.Common.ApplicationStarted fired!")
|
||||
})
|
||||
|
||||
win1 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
|
||||
Title: "Takes 3 attempts to close me!",
|
||||
})
|
||||
|
||||
var countdown = 3
|
||||
|
||||
// Register a hook to cancel the window closing
|
||||
win1.RegisterHook(events.Common.WindowClosing, func(e *application.WindowEvent) {
|
||||
countdown--
|
||||
if countdown == 0 {
|
||||
println("Closing!")
|
||||
return
|
||||
}
|
||||
println("Nope! Not closing!")
|
||||
e.Cancel()
|
||||
})
|
||||
|
||||
win1.On(events.Common.WindowFocus, func(e *application.WindowEvent) {
|
||||
println("[Event] Window focus!")
|
||||
})
|
||||
|
||||
err := app.Run()
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Wails Markup Language (wml)
|
||||
|
||||
An experimental feature to call runtime methods using plain html, similar to
|
||||
[htmx](https://htmx.org).
|
||||
|
||||
???+ example "Example of wml"
|
||||
|
||||
```html
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Wails ML Demo</title>
|
||||
</head>
|
||||
<body style="margin-top:50px; color: white; background-color: #191919">
|
||||
<h2>Wails ML Demo</h2>
|
||||
<p>This application contains no Javascript!</p>
|
||||
<button wml-event="button-pressed">Press me!</button>
|
||||
<button wml-event="delete-things" wml-confirm="Are you sure?">
|
||||
Delete all the things!
|
||||
</button>
|
||||
<button wml-window="Close" wml-confirm="Are you sure?">
|
||||
Close the Window?
|
||||
</button>
|
||||
<button wml-window="Center">Center</button>
|
||||
<button wml-window="Minimise">Minimise</button>
|
||||
<button wml-window="Maximise">Maximise</button>
|
||||
<button wml-window="UnMaximise">UnMaximise</button>
|
||||
<button wml-window="Fullscreen">Fullscreen</button>
|
||||
<button wml-window="UnFullscreen">UnFullscreen</button>
|
||||
<button wml-window="Restore">Restore</button>
|
||||
<div
|
||||
style="width: 200px; height: 200px; border: 2px solid white;"
|
||||
wml-event="hover"
|
||||
wml-trigger="mouseover"
|
||||
>
|
||||
Hover over me
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
There are more examples available in the [examples](https://github.com/wailsapp/wails/tree/v3-alpha/v3/examples) directory. Check them out!
|
@ -1,3 +0,0 @@
|
||||
module claude
|
||||
|
||||
go 1.22
|
@ -1,185 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
var apiKey string
|
||||
|
||||
type Message struct {
|
||||
Role string `json:"role"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type RequestBody struct {
|
||||
Model string `json:"model"`
|
||||
MaxTokens int `json:"max_tokens"`
|
||||
Messages []Message `json:"messages"`
|
||||
System string `json:"system"`
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
ID string `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Role string `json:"role"`
|
||||
Content []struct {
|
||||
Type string `json:"type"`
|
||||
Text string `json:"text"`
|
||||
} `json:"content"`
|
||||
Model string `json:"model"`
|
||||
StopReason string `json:"stop_reason"`
|
||||
StopSequence any `json:"stop_sequence"`
|
||||
Usage struct {
|
||||
InputTokens int `json:"input_tokens"`
|
||||
OutputTokens int `json:"output_tokens"`
|
||||
} `json:"usage"`
|
||||
}
|
||||
|
||||
func sendRequest(apiKey string, userPrompt string) (*Response, error) {
|
||||
time.Sleep(2 * time.Second)
|
||||
url := "https://api.anthropic.com/v1/messages"
|
||||
|
||||
requestBody := RequestBody{
|
||||
Model: "claude-3-haiku-20240307",
|
||||
MaxTokens: 4096,
|
||||
System: `You are a highly skilled translator with expertise in many languages. Your task is to identify the language of the text I provide and accurately translate it into the specified target language, indicated by a language code e.g. 'zh' for chinese, while preserving the meaning, tone, and nuance of the original text. Please maintain proper grammar, spelling, and punctuation in the translated version. It will contain special Markdown syntax which must be preserved. You must also ensure that the translated text is culturally appropriate and sensitive to the target audience. You are responsible for the quality of the translation. If you are unable to provide a high-quality translation, please let me know.`,
|
||||
Messages: []Message{
|
||||
{
|
||||
Role: "user",
|
||||
Content: userPrompt,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
jsonData, err := json.Marshal(requestBody)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error marshalling request body")
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error creating request")
|
||||
}
|
||||
|
||||
req.Header.Set("x-api-key", apiKey)
|
||||
req.Header.Set("anthropic-version", "2023-06-01")
|
||||
req.Header.Set("content-type", "application/json")
|
||||
|
||||
client := &http.Client{}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error sending request")
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error reading response body")
|
||||
}
|
||||
|
||||
//unmarshal the response
|
||||
var response Response
|
||||
err = json.Unmarshal(body, &response)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error unmarshalling response")
|
||||
}
|
||||
|
||||
return &response, nil
|
||||
}
|
||||
|
||||
func translateDirectory(rootpath string, langcode string, langname string) error {
|
||||
// Walk through the files in the directory
|
||||
// for each file, read the file, print out the full path and filesize
|
||||
// if the file is a directory, call this function recursively
|
||||
err := filepath.Walk(rootpath, func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if path == rootpath {
|
||||
return nil
|
||||
}
|
||||
// Skip if not `.md` file or _category_.json
|
||||
if filepath.Ext(path) != ".md" || strings.Contains(path, "_category_.json") {
|
||||
return nil
|
||||
}
|
||||
if info.IsDir() {
|
||||
return translateDirectory(path, langcode, langname)
|
||||
}
|
||||
// Calculate the target filename. This is the same path, but with using "../../docs/langcode" instead of "../../docs/en"
|
||||
targetPath := strings.Replace(path, "/en/", "/"+langcode+"/", 1)
|
||||
// If target file exists, skip it.
|
||||
if _, err := os.Stat(targetPath); err == nil {
|
||||
fmt.Printf("Skipping: %s\n", path)
|
||||
return nil
|
||||
}
|
||||
fmt.Printf("Translating: %s, Size: %d\n", path, info.Size())
|
||||
// Load the file
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
user := fmt.Sprintf("Translate the following text from English to %s (%s):\n\n%s", langname, langcode, string(data))
|
||||
// Send the request
|
||||
response, err := sendRequest(apiKey, user)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Create the target directory
|
||||
err = os.MkdirAll(filepath.Dir(targetPath), 0755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Write the content
|
||||
if len(response.Content) == 0 {
|
||||
fmt.Printf("No content returned for: %v\n", response)
|
||||
return nil
|
||||
}
|
||||
err = os.WriteFile(targetPath, []byte(response.Content[0].Text), 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
// Read the first argument. It is a language code. If it is not provided, show an error message
|
||||
if len(os.Args) < 2 {
|
||||
fmt.Println("Please provide the language as the first argument")
|
||||
return
|
||||
}
|
||||
lang := os.Args[1]
|
||||
|
||||
if len(os.Args) < 3 {
|
||||
fmt.Println("Please provide the language code as the second argument")
|
||||
return
|
||||
}
|
||||
langcode := os.Args[2]
|
||||
|
||||
// load the API key from the .env file
|
||||
data, err := os.ReadFile(".env")
|
||||
if err != nil {
|
||||
fmt.Println("Error reading .env file:", err)
|
||||
return
|
||||
}
|
||||
apiKey = strings.TrimSpace(string(data))
|
||||
|
||||
rootPath := "../../docs/en"
|
||||
err = translateDirectory(rootPath, langcode, lang)
|
||||
if err != nil {
|
||||
fmt.Println("Error translating directory:", err)
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"go/build"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/princjef/gomarkdoc"
|
||||
"github.com/princjef/gomarkdoc/lang"
|
||||
"github.com/princjef/gomarkdoc/logger"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a renderer to output data
|
||||
out, err := gomarkdoc.NewRenderer()
|
||||
if err != nil {
|
||||
// handle error
|
||||
}
|
||||
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
// handle error
|
||||
}
|
||||
|
||||
packagePath := filepath.Join(wd, "../../v3/pkg/application")
|
||||
|
||||
buildPkg, err := build.ImportDir(packagePath, build.ImportComment)
|
||||
if err != nil {
|
||||
// handle error
|
||||
}
|
||||
|
||||
// Create a documentation package from the build representation of our
|
||||
// package.
|
||||
log := logger.New(logger.DebugLevel)
|
||||
pkg, err := lang.NewPackageFromBuild(log, buildPkg)
|
||||
if err != nil {
|
||||
// handle error
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Write the documentation out to console.
|
||||
data, err := out.Package(pkg)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
println(cwd)
|
||||
|
||||
err = os.WriteFile(filepath.Join("..", "docs", "API", "fullapi.md"), []byte(data), 0644)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
module generate
|
||||
|
||||
go 1.21
|
||||
|
||||
require github.com/princjef/gomarkdoc v1.1.0
|
||||
|
||||
require (
|
||||
dario.cat/mergo v1.0.1 // indirect
|
||||
github.com/Microsoft/go-winio v0.6.2 // indirect
|
||||
github.com/ProtonMail/go-crypto v1.0.0 // indirect
|
||||
github.com/VividCortex/ewma v1.2.0 // indirect
|
||||
github.com/cheggaaa/pb/v3 v3.1.5 // indirect
|
||||
github.com/cloudflare/circl v1.4.0 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.3.2 // indirect
|
||||
github.com/emirpasic/gods v1.18.1 // indirect
|
||||
github.com/fatih/color v1.17.0 // indirect
|
||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
||||
github.com/go-git/go-billy/v5 v5.5.0 // indirect
|
||||
github.com/go-git/go-git/v5 v5.12.0 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
|
||||
github.com/nxadm/tail v1.4.8 // indirect
|
||||
github.com/pjbgf/sha1cd v0.3.0 // indirect
|
||||
github.com/princjef/mageutil v1.0.0 // indirect
|
||||
github.com/rivo/uniseg v0.4.7 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/skeema/knownhosts v1.3.0 // indirect
|
||||
github.com/x-cray/logrus-prefixed-formatter v0.5.2 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||
golang.org/x/crypto v0.27.0 // indirect
|
||||
golang.org/x/net v0.29.0 // indirect
|
||||
golang.org/x/sys v0.25.0 // indirect
|
||||
golang.org/x/term v0.24.0 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
mvdan.cc/xurls/v2 v2.5.0 // indirect
|
||||
)
|
@ -1,206 +0,0 @@
|
||||
dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
|
||||
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
|
||||
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
|
||||
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
|
||||
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
|
||||
github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78=
|
||||
github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
|
||||
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
|
||||
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
|
||||
github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
|
||||
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
|
||||
github.com/cheggaaa/pb v2.0.7+incompatible/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s=
|
||||
github.com/cheggaaa/pb/v3 v3.0.4/go.mod h1:7rgWxLrAUcFMkvJuv09+DYi7mMUYi8nO9iOWcvGJPfw=
|
||||
github.com/cheggaaa/pb/v3 v3.1.5 h1:QuuUzeM2WsAqG2gMqtzaWithDJv0i+i6UlnwSCI4QLk=
|
||||
github.com/cheggaaa/pb/v3 v3.1.5/go.mod h1:CrxkeghYTXi1lQBEI7jSn+3svI3cuc19haAj6jM60XI=
|
||||
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
|
||||
github.com/cloudflare/circl v1.4.0 h1:BV7h5MgrktNzytKmWjpOtdYrf0lkkbF8YMlBGPhJQrY=
|
||||
github.com/cloudflare/circl v1.4.0/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU=
|
||||
github.com/cyphar/filepath-securejoin v0.3.2 h1:QhZu5AxQ+o1XZH0Ye05YzvJ0kAdK6VQc0z9NNMek7gc=
|
||||
github.com/cyphar/filepath-securejoin v0.3.2/go.mod h1:F7i41x/9cBF7lzCrVsYs9fuzwRZm4NQsGTBdpp6mETc=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU=
|
||||
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
|
||||
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
|
||||
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
|
||||
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
|
||||
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
|
||||
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE=
|
||||
github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8=
|
||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
|
||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
|
||||
github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=
|
||||
github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow=
|
||||
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
|
||||
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
|
||||
github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys=
|
||||
github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
|
||||
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
|
||||
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/matryer/is v1.3.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
|
||||
github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE=
|
||||
github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU=
|
||||
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
|
||||
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
|
||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M=
|
||||
github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
|
||||
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
|
||||
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
|
||||
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
|
||||
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/princjef/gomarkdoc v1.1.0 h1:xtl7mESKQWVuGiFdd1AO3dFA6OenWG86bZu97IqBNPE=
|
||||
github.com/princjef/gomarkdoc v1.1.0/go.mod h1:HI3w0Zv8H03ecak/IqVAcPFTuPt7sn7Top6xbgCs1Qk=
|
||||
github.com/princjef/mageutil v1.0.0 h1:1OfZcJUMsooPqieOz2ooLjI+uHUo618pdaJsbCXcFjQ=
|
||||
github.com/princjef/mageutil v1.0.0/go.mod h1:mkShhaUomCYfAoVvTKRcbAs8YSVPdtezI5j6K+VXhrs=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
||||
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
|
||||
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
|
||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
|
||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/skeema/knownhosts v1.3.0 h1:AM+y0rI04VksttfwjkSTNQorvGqmwATnvnAHpSgc0LY=
|
||||
github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5LvTDjFK7M=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg=
|
||||
github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE=
|
||||
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
|
||||
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
|
||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
|
||||
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
|
||||
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
|
||||
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
|
||||
golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
|
||||
golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
|
||||
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/VividCortex/ewma.v1 v1.1.1/go.mod h1:TekXuFipeiHWiAlO1+wSS23vTcyFau5u3rxXUSXj710=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/cheggaaa/pb.v2 v2.0.7/go.mod h1:0CiZ1p8pvtxBlQpLXkHuUTpdJ1shm3OqCF1QugkjHL4=
|
||||
gopkg.in/fatih/color.v1 v1.7.0/go.mod h1:P7yosIhqIl/sX8J8UypY5M+dDpD2KmyfP5IRs5v/fo0=
|
||||
gopkg.in/mattn/go-colorable.v0 v0.1.0/go.mod h1:BVJlBXzARQxdi3nZo6f6bnl5yR20/tOL6p+V0KejgSY=
|
||||
gopkg.in/mattn/go-isatty.v0 v0.0.4/go.mod h1:wt691ab7g0X4ilKZNmMII3egK0bTxl37fEn/Fwbd8gc=
|
||||
gopkg.in/mattn/go-runewidth.v0 v0.0.4/go.mod h1:BmXejnxvhwdaATwiJbB1vZ2dtXkQKZGu9yLFCZb4msQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
|
||||
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
mvdan.cc/xurls/v2 v2.5.0 h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
|
||||
mvdan.cc/xurls/v2 v2.5.0/go.mod h1:yQgaGQ1rFtJUzkmKiHYSSfuQxqfYmd//X6PxvholpeE=
|
@ -1,8 +0,0 @@
|
||||
INHERIT: mkdocs.yml
|
||||
plugins:
|
||||
- search
|
||||
# - social:
|
||||
# debug: true
|
||||
# cards_layout_options:
|
||||
# font_family: Roboto
|
||||
- tags
|
@ -1,179 +0,0 @@
|
||||
site_name: "alpha"
|
||||
repo_url: https://github.com/wailsapp/wails
|
||||
edit_uri: edit/v3-alpha/mkdocs-website/docs/
|
||||
site_url: https://v3alpha.wails.io
|
||||
site_description: The Wails Project - Build beautiful cross-platform applications using Go
|
||||
site_author: Lea Anthony
|
||||
theme:
|
||||
name: material
|
||||
custom_dir: overrides
|
||||
logo: assets/images/wails-logo-horizontal-dark.svg
|
||||
icon:
|
||||
repo: fontawesome/brands/github
|
||||
favicon: /favicon.ico
|
||||
features:
|
||||
- navigation.tabs
|
||||
- navigation.sections
|
||||
- navigation.expand
|
||||
- navigation.instant.prefetch
|
||||
- navigation.top
|
||||
- navigation.footer
|
||||
- navigation.path
|
||||
- navigation.prune
|
||||
|
||||
- toc.integrate
|
||||
- toc.follow
|
||||
|
||||
- search.suggest
|
||||
- search.highlight
|
||||
- search.share
|
||||
|
||||
- content.tabs.link
|
||||
- content.tabs.annotation
|
||||
- content.tabs.copy
|
||||
- content.code.copy
|
||||
- content.code.annotate
|
||||
- content.action.edit
|
||||
language: en
|
||||
palette:
|
||||
# Palette toggle for light mode
|
||||
- media: "(prefers-color-scheme: light)"
|
||||
scheme: default
|
||||
toggle:
|
||||
icon: material/toggle-switch-off-outline
|
||||
name: Switch to dark mode
|
||||
|
||||
# Palette toggle for dark mode
|
||||
- media: "(prefers-color-scheme: dark)"
|
||||
scheme: slate
|
||||
toggle:
|
||||
icon: material/toggle-switch
|
||||
name: Switch to light mode
|
||||
markdown_extensions:
|
||||
- pymdownx.tabbed:
|
||||
alternate_style: true
|
||||
- pymdownx.highlight:
|
||||
anchor_linenums: true
|
||||
- pymdownx.tasklist:
|
||||
custom_checkbox: true
|
||||
- pymdownx.inlinehilite
|
||||
- pymdownx.snippets:
|
||||
restrict_base_path: false
|
||||
- pymdownx.details
|
||||
- pymdownx.superfences
|
||||
- pymdownx.mark
|
||||
- attr_list
|
||||
- admonition
|
||||
- footnotes
|
||||
- md_in_html
|
||||
- def_list
|
||||
- toc:
|
||||
permalink: '#'
|
||||
- pymdownx.emoji:
|
||||
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
||||
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
||||
|
||||
plugins:
|
||||
- table-reader:
|
||||
data_path: "shared"
|
||||
allow_missing_files: False
|
||||
- i18n:
|
||||
docs_structure: folder
|
||||
languages:
|
||||
- locale: en
|
||||
default: true
|
||||
name: English
|
||||
build: true
|
||||
# - locale: cy
|
||||
# name: Cymraeg
|
||||
# build: true
|
||||
# site_description: Y Prosiect Wails - Adeiladu cymwysiadau croesrwyd hardd gan ddefnyddio Go
|
||||
# extra:
|
||||
# announcement: Mae'r wefan hon wedi'i chyfieithu'n awtomatig. Rhowch wybod i ni os oes unrhyw gamgymeriadau.
|
||||
# nav:
|
||||
# - Cartref: index.md
|
||||
# - Cychwyn:
|
||||
# - Gosod: getting-started/installation.md
|
||||
# - Eich Cais Cyntaf: getting-started/your-first-app.md
|
||||
# - Camau Nesaf: getting-started/next-steps.md
|
||||
# - Dysgu Rhagor:
|
||||
# - Runtime: learn/runtime.md
|
||||
# - Adborth: getting-started/feedback.md
|
||||
# - Adborth: getting-started/feedback.md
|
||||
# - Beth sydd Newydd yn v3?: whats-new.md
|
||||
# - API:
|
||||
# - Cais: API/application.md
|
||||
# - Ffenestr: API/window.md
|
||||
# - Bar Tasg: API/systray.md
|
||||
# - Dewislen: API/menu.md
|
||||
# - Prif Linell: API/mainthread.md
|
||||
# - Datblygu:
|
||||
# - Cyflwyniad: development/introduction.md
|
||||
# - Status: development/status.md
|
||||
# - Newidiadau v3: development/changes.md
|
||||
# - Cynllun Ffordd Ymlaen: roadmap.md
|
||||
# - Cofnod Newidiadau: changelog.md
|
||||
# - Noddwr❤️: https://github.com/sponsors/leaanthony
|
||||
|
||||
|
||||
extra:
|
||||
alternate:
|
||||
- name: English
|
||||
link: /
|
||||
lang: en
|
||||
# - name: Cymraeg
|
||||
# link: /cy/
|
||||
# lang: cy
|
||||
|
||||
social:
|
||||
- icon: fontawesome/brands/github-alt
|
||||
link: https://github.com/wailsapp/wails
|
||||
- icon: fontawesome/brands/twitter
|
||||
link: https://twitter.com/wailsapp
|
||||
- icon: fontawesome/brands/discord
|
||||
link: https://discord.gg/JDdSxwjhGf
|
||||
|
||||
version:
|
||||
provider: mike
|
||||
|
||||
extra_css:
|
||||
- stylesheets/extra.css
|
||||
|
||||
nav:
|
||||
- Home: index.md
|
||||
- Getting started:
|
||||
- Installation: getting-started/installation.md
|
||||
- Your First Application: getting-started/your-first-app.md
|
||||
- Next Steps: getting-started/next-steps.md
|
||||
- Learn More:
|
||||
- Services: learn/services.md
|
||||
- Bindings: learn/bindings.md
|
||||
- Runtime: learn/runtime.md
|
||||
- Build System: learn/build.md
|
||||
- Guides:
|
||||
- Customising Windows: learn/guides/customising-windows.md
|
||||
- File Associations: learn/guides/file-associations.md
|
||||
- Packaging: learn/guides/packaging.md
|
||||
- Feedback: getting-started/feedback.md
|
||||
- Feedback: getting-started/feedback.md
|
||||
- What's New in v3?: whats-new.md
|
||||
- API:
|
||||
- Application: API/application.md
|
||||
- Window: API/window.md
|
||||
- Events: API/events.md
|
||||
- System Tray: API/systray.md
|
||||
- Menu: API/menu.md
|
||||
- Main Thread: API/mainthread.md
|
||||
- Development:
|
||||
- Introduction: development/introduction.md
|
||||
- Status: development/status.md
|
||||
- v3 Changes: development/changes.md
|
||||
- Status: status.md
|
||||
- Change Log: changelog.md
|
||||
- Sponsor❤️: https://github.com/sponsors/leaanthony
|
||||
|
||||
watch:
|
||||
- overrides
|
||||
- shared
|
||||
copyright:
|
||||
Copyright 2024 Lea Anthony
|
Binary file not shown.
Before Width: | Height: | Size: 109 KiB |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" version="1.1" viewBox="0 0 180 167" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><g><path d="M196,19.285C196,14.712 192.095,11 187.286,11L27.714,11C22.905,11 19,14.712 19,19.285L19,158.715C19,163.288 22.905,167 27.714,167L187.286,167C192.095,167 196,163.288 196,158.715L196,19.285Z" transform="matrix(1.00565,0,0,1.05769,-18.1073,-10.6346)" style="fill:#fff"/></g><g><path d="M0,-51.891L14.429,-51.891L13.043,-21.183L22.568,-51.891L34.226,-51.891L34.084,-21.183L42.365,-51.891L56.794,-51.891L38.526,0L25.198,0L25.34,-32.45L15.211,0L1.919,0L0,-51.891Z" transform="matrix(2.51258,0,0,2.51258,20.0103,151.138)" style="fill-rule:nonzero"/></g></svg>
|
Before Width: | Height: | Size: 774 B |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 5.4 KiB |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 5.4 KiB |
@ -1,144 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 2016-2023 Martin Donath <martin.donath@squidfunk.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
-->
|
||||
|
||||
{% extends "main.html" %}
|
||||
|
||||
<!-- Render hero under tabs -->
|
||||
{% block tabs %}
|
||||
{{ super() }}
|
||||
|
||||
<!-- Additional styles for landing page -->
|
||||
<style>
|
||||
|
||||
/* Application header should be static for the landing page */
|
||||
.md-header {
|
||||
position: initial;
|
||||
}
|
||||
|
||||
/* Remove spacing, as we cannot hide it completely */
|
||||
.md-main__inner {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Hide main content for now */
|
||||
.md-content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Hide table of contents */
|
||||
@media screen and (min-width: 60em) {
|
||||
.md-sidebar--secondary {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide navigation */
|
||||
@media screen and (min-width: 76.25em) {
|
||||
.md-sidebar--primary {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Hero for landing page -->
|
||||
<section class="mdx-container">
|
||||
<div class="md-grid md-typeset">
|
||||
<div class="mdx-hero">
|
||||
|
||||
<!-- Hero content -->
|
||||
<div class="mdx-hero__content">
|
||||
<br/>
|
||||
<br/>
|
||||
<div style="text-align: center">
|
||||
This is the Wails v3 Alpha website.
|
||||
|
||||
This site will be updated as we progress through the alpha and beta releases.<br/><br/>
|
||||
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Warning</p>
|
||||
<h3>The v3 alpha release is intended for testers and contributors. It is not ready for use in any other capacity. Expect things to fail. Expect things to change. Expect the documentation to be wrong.<br/><br/>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<h2>Status</h2>
|
||||
<br/>
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th>Operating System</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Windows</td>
|
||||
<td>All examples are working</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mac</td>
|
||||
<td>All examples are working</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Linux</td>
|
||||
<td>Most examples are working</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/><br/>
|
||||
|
||||
<div style="width: 50%; margin: 0 auto; text-align: justify; padding-bottom: 75px;">
|
||||
<h2>FAQ</h2>
|
||||
<h3>What is the aim of the alpha release?</h3>
|
||||
The aim of the alpha release is to get feedback on the new API and to get people experimenting with it.
|
||||
We want to make sure that the API is easy to use and that it is possible to build applications with it.
|
||||
<br/><br/>
|
||||
<h3>How do I provide feedback?</h3>
|
||||
Please read <a href="/getting-started/feedback/">this page</a> for details on how to provide feedback.
|
||||
</div>
|
||||
<h3>Is there a Roadmap</h3>
|
||||
Yes, you can find it <a href="/roadmap/">here</a>.
|
||||
|
||||
Please feel free to raise PRs against this website. Every single PR helps us get closer to a release.<br/><br/>
|
||||
Thank you for sharing this journey with us.<br/><br/>
|
||||
<br/>
|
||||
<a
|
||||
href="{{ page.next_page.url | url }}"
|
||||
title="{{ page.next_page.title | e }}"
|
||||
class="md-button md-button--primary"
|
||||
>
|
||||
Get started
|
||||
</a>
|
||||
</div>
|
||||
<!-- <a-->
|
||||
<!-- href="{{ 'introduction' | url }}"-->
|
||||
<!-- title="Material for MkDocs Insiders"-->
|
||||
<!-- class="md-button"-->
|
||||
<!-- >-->
|
||||
<!-- Learn more-->
|
||||
<!-- </a>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
<!-- Content -->
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
<!-- Application footer -->
|
||||
{% block footer %}{% endblock %}
|
@ -1,145 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 2016-2023 Martin Donath <martin.donath@squidfunk.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
-->
|
||||
|
||||
{% extends "main.zh.html" %}
|
||||
|
||||
<!-- Render hero under tabs -->
|
||||
{% block tabs %}
|
||||
{{ super() }}
|
||||
|
||||
<!-- Additional styles for landing page -->
|
||||
<style>
|
||||
|
||||
/* Application header should be static for the landing page */
|
||||
.md-header {
|
||||
position: initial;
|
||||
}
|
||||
|
||||
/* Remove spacing, as we cannot hide it completely */
|
||||
.md-main__inner {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Hide main content for now */
|
||||
.md-content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Hide table of contents */
|
||||
@media screen and (min-width: 60em) {
|
||||
.md-sidebar--secondary {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide navigation */
|
||||
@media screen and (min-width: 76.25em) {
|
||||
.md-sidebar--primary {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Hero for landing page -->
|
||||
<section class="mdx-container">
|
||||
<div class="md-grid md-typeset">
|
||||
<div class="mdx-hero">
|
||||
|
||||
<!-- Hero content -->
|
||||
<div class="mdx-hero__content">
|
||||
<br/>
|
||||
<br/>
|
||||
<div style="text-align: center">
|
||||
这是 Wails v3 Alpha 网站。
|
||||
|
||||
随着 alpha 和 beta 版本的推进,本站将会有所更新。<br/><br/>
|
||||
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">警告</p>
|
||||
<h3>v3 alpha版本主要用于测试和贡献者。它还不适用于其他任何容量。请预料可能会出现故障,可能会有变化,文档可能会有错误。<br/><br/>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<h2>状态</h2>
|
||||
<br/>
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th>操作系统</th>
|
||||
<th>状态</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Windows</td>
|
||||
<td>所有示例都可以运行</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mac</td>
|
||||
<td>所有示例都可以运行</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Linux</td>
|
||||
<td>大多数示例可以运行</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/><br/>
|
||||
|
||||
<div style="width: 50%; margin: 0 auto; text-align: justify; padding-bottom: 75px;">
|
||||
<h2>常见问题</h2>
|
||||
<h3>alpha版本的目的是什么?</h3>
|
||||
alpha版本的目的是获得有关新 API 的反馈,并让人们尝试使用它。
|
||||
我们想确保 API 易于使用,并且可以使用它构建应用程序。
|
||||
<br/><br/>
|
||||
<h3>如何提供反馈?</h3>
|
||||
请阅读 <a href="/getting-started/feedback/">此页面</a>以获取有关如何提供反馈的详细信息。
|
||||
</div>
|
||||
<h3>有路线图吗?</h3>
|
||||
是的,你可以在 <a href="/roadmap/">这里</a> 找到它。
|
||||
|
||||
请随时提出针对此网站的PR。每一个PR都会帮助我们更接近发布。<br/><br/>
|
||||
感谢您与我们共度此旅程。<br/><br/>
|
||||
<br/>
|
||||
<a
|
||||
href="{{ page.next_page.url | url }}"
|
||||
title="{{ page.next_page.title | e }}"
|
||||
class="md-button md-button--primary"
|
||||
>
|
||||
开始
|
||||
</a>
|
||||
</div>
|
||||
<!-- <a-->
|
||||
<!-- href="{{ 'introduction' | url }}"-->
|
||||
<!-- title="Material for MkDocs Insiders"-->
|
||||
<!-- class="md-button"-->
|
||||
<!-- >-->
|
||||
<!-- 了解更多-->
|
||||
<!-- </a>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
<!-- Content -->
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
<!-- Application footer -->
|
||||
{% block footer %}{% endblock %}
|
@ -1,44 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 2016-2023 Martin Donath <martin.donath@squidfunk.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
-->
|
||||
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block announce %}
|
||||
{%
|
||||
set announcement = {
|
||||
"en": "Translations are autogenerated. Please report mistakes.",
|
||||
"zh": "这些文档是自动生成的。 如有错误,请告知我们。",
|
||||
}
|
||||
%}
|
||||
|
||||
<div class="announcement__translation">
|
||||
{{ announcement[i18n_page_locale] }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
<!-- Theme-related JavaScript -->
|
||||
{% block scripts %}
|
||||
{{ super() }}
|
||||
|
||||
<!-- Extra JavaScript (can't be set in mkdocs.yml due to content hash) -->
|
||||
<script src="{{ 'assets/javascripts/custom.js' | url }}"></script>
|
||||
{% endblock %}
|
@ -1,35 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 2016-2023 Martin Donath <martin.donath@squidfunk.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
-->
|
||||
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block announce %}
|
||||
这些文档是自动生成的。 如有错误,请告知我们。
|
||||
{% endblock %}
|
||||
|
||||
<!-- Theme-related JavaScript -->
|
||||
{% block scripts %}
|
||||
{{ super() }}
|
||||
|
||||
<!-- Extra JavaScript (can't be set in mkdocs.yml due to content hash) -->
|
||||
<script src="{{ 'assets/javascripts/custom.js' | url }}"></script>
|
||||
{% endblock %}
|
@ -1,60 +0,0 @@
|
||||
{#-
|
||||
This file was automatically generated - do not edit
|
||||
-#}
|
||||
|
||||
{% macro t(key) %}{{ {
|
||||
"language": "cy",
|
||||
"direction": "ltr",
|
||||
"action.edit": "Golygu'r dudalen hon",
|
||||
"action.skip": "Symud i'r cynnwys",
|
||||
"action.view": "Gweld cod y dudalen hon",
|
||||
"announce.dismiss": "Peidio â dangos hwn eto",
|
||||
"blog.archive": "Archif",
|
||||
"blog.categories": "Categorïau",
|
||||
"blog.categories.in": "yn",
|
||||
"blog.continue": "Parhau i ddarllen",
|
||||
"blog.draft": "Drafft",
|
||||
"blog.index": "Yn ôl i'r mynegai",
|
||||
"blog.meta": "Metadata",
|
||||
"blog.references": "Dolenni cysylltiedig",
|
||||
"clipboard.copy": "Copïo i'r clipfwrdd",
|
||||
"clipboard.copied": "Wedi'i gopïo i'r clipfwrdd",
|
||||
"consent.accept": "Derbyn",
|
||||
"consent.manage": "Rheoli gosodiadau",
|
||||
"consent.reject": "Gwrthod",
|
||||
"footer": "Troedyn",
|
||||
"footer.next": "Nesaf",
|
||||
"footer.previous": "Blaenorol",
|
||||
"header": "Pennyn",
|
||||
"meta.comments": "Sylwadau",
|
||||
"meta.source": "Ffynhonnell",
|
||||
"nav": "Llywio",
|
||||
"readtime.one": "1 munud i'w ddarllen",
|
||||
"readtime.other": "# munud i'w ddarllen",
|
||||
"rss.created": "Bwydo RSS",
|
||||
"rss.updated": "Bwydo RSS o gynnwys wedi'i ddiweddaru",
|
||||
"search": "Chwilio",
|
||||
"search.config.lang": "cy",
|
||||
"search.config.pipeline": "stopWordFilter",
|
||||
"search.config.separator": "[\\s\\-]+",
|
||||
"search.placeholder": "Chwilio",
|
||||
"search.share": "Rhannu",
|
||||
"search.reset": "Clirio",
|
||||
"search.result.initializer": "Yn cychwyn chwilio",
|
||||
"search.result.placeholder": "Teipiwch i ddechrau chwilio",
|
||||
"search.result.none": "Dim dogfennau cyfatebol",
|
||||
"search.result.one": "1 dogfen gyfatebol",
|
||||
"search.result.other": "# dogfen gyfatebol",
|
||||
"search.result.more.one": "1 arall ar y dudalen hon",
|
||||
"search.result.more.other": "# arall ar y dudalen hon",
|
||||
"search.result.term.missing": "Ar goll",
|
||||
"select.language": "Dewis iaith",
|
||||
"select.version": "Dewis fersiwn",
|
||||
"source": "Mynd i'r storfa",
|
||||
"source.file.contributors": "Cyfranwyr",
|
||||
"source.file.date.created": "Wedi'i greu",
|
||||
"source.file.date.updated": "Diweddariad diwethaf",
|
||||
"tabs": "Tabiau",
|
||||
"toc": "Tabl cynnwys",
|
||||
"top": "Yn ôl i'r brig"
|
||||
}[key] }}{% endmacro %}
|
Binary file not shown.
Binary file not shown.
@ -1,12 +0,0 @@
|
||||
Title,Description,Status,Priority,Windows,Mac,Linux
|
||||
Implement user authentication,Add user login and registration functionality,Not Started,High,Planned,Planned,Planned
|
||||
Create dashboard interface,Design and develop main dashboard for users,In Progress,High,In Progress,In Progress,In Progress
|
||||
Integrate data visualization,Add charts and graphs to display user data,Not Started,Medium,Planned,Planned,Planned
|
||||
Implement search functionality,Add search feature across the platform,Not Started,Medium,Planned,Planned,Planned
|
||||
Optimize database queries,Improve performance of database operations,Not Started,High,Planned,Planned,Planned
|
||||
Add export functionality,Allow users to export data in various formats,Not Started,Low,Planned,Planned,Planned
|
||||
Implement notifications system,Create a system for user notifications,Not Started,Medium,Planned,Planned,Planned
|
||||
Mobile responsive design,Ensure the platform works well on mobile devices,In Progress,High,In Progress,In Progress,In Progress
|
||||
Add multi-language support,Implement internationalization for the platform,Not Started,Low,Planned,Planned,Planned
|
||||
Implement user roles and permissions,Create different access levels for users,Not Started,High,Planned,Planned,Planned
|
||||
|
|
@ -17,8 +17,8 @@ includes:
|
||||
optional: true
|
||||
|
||||
docs:
|
||||
taskfile: ../mkdocs-website
|
||||
dir: ../mkdocs-website
|
||||
taskfile: ../docs
|
||||
dir: ../docs
|
||||
optional: true
|
||||
|
||||
tasks:
|
||||
@ -127,15 +127,6 @@ tasks:
|
||||
- task: reinstall-cli
|
||||
- echo "Generated templates"
|
||||
|
||||
format:md:
|
||||
dir: ../mkdocs-website
|
||||
cmds:
|
||||
- npx prettier --write "**/*.md"
|
||||
|
||||
format:
|
||||
cmds:
|
||||
- task: format:md
|
||||
|
||||
precommit:
|
||||
cmds:
|
||||
- go test ./...
|
||||
|
@ -20,7 +20,7 @@
|
||||
"build:types": "npx -p typescript tsc src/index.js --declaration --allowJs --emitDeclarationOnly --outDir types",
|
||||
"postbuild:types": "wails3 task generate:events",
|
||||
"build:docs": "npx typedoc ./src/index.js",
|
||||
"build:docs:md": "npx typedoc --plugin typedoc-plugin-markdown --namedAnchors true --hideBreadcrumbs true --out ../../../../../../mkdocs-website/docs/en/api/js ./src/index.js"
|
||||
"build:docs:md": "npx typedoc --plugin typedoc-plugin-markdown --namedAnchors true --hideBreadcrumbs true --out ../../../../../../old_mkdocs/docs/en/api/js ./src/index.js"
|
||||
},
|
||||
"author": "The Wails Team",
|
||||
"license": "MIT",
|
||||
|
@ -70,10 +70,10 @@ func main() {
|
||||
}
|
||||
|
||||
// Update ChangeLog
|
||||
s.CD("../../../mkdocs-website")
|
||||
s.CD("../../../docs")
|
||||
|
||||
// Read in `src/pages/changelog.mdx`
|
||||
changelogData, err := os.ReadFile("docs/en/changelog.md")
|
||||
// Read in `src/pages/changelog.md`
|
||||
changelogData, err := os.ReadFile("docs/src/content/docs/changelog.md")
|
||||
checkError(err)
|
||||
changelog := string(changelogData)
|
||||
// Split on the line that has `## [Unreleased]`
|
||||
@ -83,7 +83,7 @@ func main() {
|
||||
// Add the new version to the top of the changelog
|
||||
newChangelog := changelogSplit[0] + "## [Unreleased]\n\n## " + newVersion + " - " + today + changelogSplit[1]
|
||||
// Write the changelog back
|
||||
err = os.WriteFile("docs/en/changelog.md", []byte(newChangelog), 0o755)
|
||||
err = os.WriteFile("docs/src/content/docs/changelog.md", []byte(newChangelog), 0o755)
|
||||
checkError(err)
|
||||
|
||||
// TODO: Documentation Versioning and Translations
|
||||
|
Loading…
Reference in New Issue
Block a user