mirror of
https://github.com/wavetermdev/wails.git
synced 2026-04-22 15:26:15 -07:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 204f33805f | |||
| c96cc3ff27 | |||
| 130fab6c01 | |||
| b5f1eab59b | |||
| 5988cdca9a | |||
| 93d7c6b5f3 | |||
| 7d28ad1a3b | |||
| a7278b4224 | |||
| e2b7b68ec9 | |||
| 47af68a8cb | |||
| 77f053068c | |||
| e3edea1cb3 | |||
| a0b7eb4ab6 | |||
| 6ed0eb217d | |||
| a2c1c507e1 | |||
| 4bffc57cb5 | |||
| 5dba18c853 | |||
| 4cd873fecb | |||
| e339c40e85 | |||
| 050ac9e613 | |||
| 58986237b9 | |||
| 7cb4c7b505 | |||
| e3816e714e | |||
| 1684894b52 |
@@ -34,3 +34,4 @@ v2/cmd/wails/internal/commands/initialise/templates/testtemplates/
|
||||
|
||||
/v3/.task
|
||||
/v3/examples/build/bin/testapp
|
||||
/websitev3/site/
|
||||
|
||||
@@ -97,6 +97,7 @@ This project is supported by these kind people / companies:
|
||||
<p align="center">
|
||||
<img src="https://wails.io/img/sponsor/jetbrains-grayscale.webp" style="width: 100px"/>
|
||||
</p>
|
||||
|
||||
## FAQ
|
||||
|
||||
- Is this an alternative to Electron?
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
cd ../website
|
||||
|
||||
npx @crowdin/cli@latest pull -b master
|
||||
npx @crowdin/cli@latest pull -b master --export-only-approved
|
||||
@@ -1 +1 @@
|
||||
v2.4.0
|
||||
v2.4.1
|
||||
@@ -4,6 +4,7 @@
|
||||
package edge
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"runtime"
|
||||
"syscall"
|
||||
@@ -249,7 +250,7 @@ func (e *ICoreWebView2Environment) CreateWebResourceResponse(content []byte, sta
|
||||
return nil, err
|
||||
}
|
||||
var response *ICoreWebView2WebResourceResponse
|
||||
_, _, err = e.vtbl.CreateWebResourceResponse.Call(
|
||||
hr, _, err := e.vtbl.CreateWebResourceResponse.Call(
|
||||
uintptr(unsafe.Pointer(e)),
|
||||
stream,
|
||||
uintptr(statusCode),
|
||||
@@ -257,7 +258,14 @@ func (e *ICoreWebView2Environment) CreateWebResourceResponse(content []byte, sta
|
||||
uintptr(unsafe.Pointer(_headers)),
|
||||
uintptr(unsafe.Pointer(&response)),
|
||||
)
|
||||
if err != windows.ERROR_SUCCESS {
|
||||
if windows.Handle(hr) != windows.S_OK {
|
||||
return nil, syscall.Errno(hr)
|
||||
}
|
||||
|
||||
if response == nil {
|
||||
if err == nil {
|
||||
err = fmt.Errorf("unknown error")
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
return response, nil
|
||||
|
||||
@@ -62,9 +62,13 @@ func (d *DevWebServer) Run(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
var myLogger assetserver.Logger
|
||||
if _logger := ctx.Value("logger"); _logger != nil {
|
||||
myLogger = _logger.(*logger.Logger)
|
||||
}
|
||||
|
||||
var assetHandler http.Handler
|
||||
var wsHandler http.Handler
|
||||
var myLogger *logger.Logger
|
||||
|
||||
_fronendDevServerURL, _ := ctx.Value("frontenddevserverurl").(string)
|
||||
if _fronendDevServerURL == "" {
|
||||
@@ -73,9 +77,6 @@ func (d *DevWebServer) Run(ctx context.Context) error {
|
||||
return c.String(http.StatusOK, assetdir)
|
||||
})
|
||||
|
||||
if _logger := ctx.Value("logger"); _logger != nil {
|
||||
myLogger = _logger.(*logger.Logger)
|
||||
}
|
||||
var err error
|
||||
assetHandler, err = assetserver.NewAssetHandler(assetServerConfig, myLogger)
|
||||
if err != nil {
|
||||
|
||||
@@ -66,7 +66,7 @@ window.wails = {
|
||||
defaultCursor: null,
|
||||
borderThickness: 6,
|
||||
shouldDrag: false,
|
||||
deferDragToMouseMove: false,
|
||||
deferDragToMouseMove: true,
|
||||
cssDragProperty: "--wails-draggable",
|
||||
cssDragValue: "drag",
|
||||
}
|
||||
@@ -130,7 +130,7 @@ window.addEventListener('mousedown', (e) => {
|
||||
}
|
||||
}
|
||||
if (window.wails.flags.deferDragToMouseMove) {
|
||||
window.wails.flags.shouldDrag = true;
|
||||
window.wails.flags.shouldDrag = true;
|
||||
} else {
|
||||
e.preventDefault()
|
||||
window.WailsInvoke("drag");
|
||||
@@ -152,10 +152,9 @@ function setResize(cursor) {
|
||||
|
||||
window.addEventListener('mousemove', function (e) {
|
||||
if (window.wails.flags.shouldDrag) {
|
||||
window.wails.flags.shouldDrag = false;
|
||||
let mousePressed = e.buttons !== undefined ? e.buttons : e.which;
|
||||
if(mousePressed <= 0) {
|
||||
window.wails.flags.shouldDrag = false;
|
||||
} else {
|
||||
if (mousePressed > 0) {
|
||||
window.WailsInvoke("drag");
|
||||
return;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -43,6 +43,7 @@ type AssetServer struct {
|
||||
runtimeHandler RuntimeHandler
|
||||
|
||||
assetServerWebView
|
||||
disableRuntime bool
|
||||
}
|
||||
|
||||
func NewAssetServerMainPage(bindingsJSON string, options *options.App, servingFromDisk bool, logger Logger, runtime RuntimeAssets) (*AssetServer, error) {
|
||||
@@ -166,8 +167,10 @@ func (d *AssetServer) processIndexHTML(indexHTML []byte) ([]byte, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if err := insertScriptInHead(htmlNode, runtimeJSPath); err != nil {
|
||||
return nil, err
|
||||
if !d.disableRuntime {
|
||||
if err := insertScriptInHead(htmlNode, runtimeJSPath); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if err := insertScriptInHead(htmlNode, ipcJSPath); err != nil {
|
||||
@@ -206,3 +209,7 @@ func (d *AssetServer) logError(message string, args ...interface{}) {
|
||||
d.logger.Error("[AssetServer] "+message, args...)
|
||||
}
|
||||
}
|
||||
|
||||
func (d *AssetServer) DisableRuntime() {
|
||||
d.disableRuntime = true
|
||||
}
|
||||
|
||||
+2
-1
@@ -31,7 +31,8 @@ Informal and incomplete list of things needed in v3.
|
||||
- [x] Screens
|
||||
- [x] Clipboard
|
||||
- [x] Application
|
||||
- [ ] Create `.d.ts` file
|
||||
- [ ] Move to typescript module
|
||||
- [ ] Move WML to plugin
|
||||
|
||||
## Templates
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ go 1.20
|
||||
require github.com/wailsapp/wails/v3 v3.0.0-alpha.0
|
||||
|
||||
require (
|
||||
github.com/imdario/mergo v0.3.12 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/leaanthony/slicer v1.5.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
|
||||
@@ -14,8 +13,9 @@ require (
|
||||
github.com/wailsapp/mimetype v1.4.1 // indirect
|
||||
github.com/wailsapp/wails/v2 v2.3.2-0.20230117193915-45c3a501d9e6 // indirect
|
||||
golang.org/x/exp v0.0.0-20220930202632-ec3f01382ef9 // indirect
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
|
||||
golang.org/x/net v0.7.0 // indirect
|
||||
)
|
||||
|
||||
replace github.com/wailsapp/wails/v3 => ../..
|
||||
replace github.com/wailsapp/wails/v2 => ../../../v2
|
||||
|
||||
replace github.com/wailsapp/wails/v2 => ../../../v2
|
||||
|
||||
@@ -2,8 +2,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
|
||||
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/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
|
||||
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/leaanthony/slicer v1.5.0 h1:aHYTN8xbCCLxJmkNKiLB6tgcMARl4eWmH9/F+S/0HtY=
|
||||
@@ -22,19 +20,14 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
|
||||
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
|
||||
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
|
||||
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
|
||||
github.com/wailsapp/wails/v2 v2.3.2-0.20230117193915-45c3a501d9e6 h1:Wn+nhnS+VytzE0PegUzSh4T3hXJCtggKGD/4U5H9+wQ=
|
||||
github.com/wailsapp/wails/v2 v2.3.2-0.20230117193915-45c3a501d9e6/go.mod h1:zlNLI0E2c2qA6miiuAHtp0Bac8FaGH0tlhA19OssR/8=
|
||||
golang.org/x/exp v0.0.0-20220930202632-ec3f01382ef9 h1:RjggHMcaTVp0LOVZcW0bo8alwHrOaCrGUDgfWUHhnN4=
|
||||
golang.org/x/exp v0.0.0-20220930202632-ec3f01382ef9/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
|
||||
golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
|
||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
dist
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
// jshint esversion: 9
|
||||
const { build } = require("esbuild");
|
||||
const { dependencies, peerDependencies } = require('./package.json');
|
||||
|
||||
let deps = dependencies || {};
|
||||
let peerDeps = peerDependencies || {};
|
||||
|
||||
const sharedConfig = {
|
||||
entryPoints: ["src/index.ts"],
|
||||
bundle: true,
|
||||
minify: true,
|
||||
external: Object.keys(deps).concat(Object.keys(peerDeps)),
|
||||
};
|
||||
|
||||
build({
|
||||
...sharedConfig,
|
||||
platform: 'node', // for CJS
|
||||
outfile: "dist/index.js",
|
||||
});
|
||||
|
||||
build({
|
||||
...sharedConfig,
|
||||
outfile: "dist/index.esm.js",
|
||||
platform: 'neutral', // for ESM
|
||||
format: "esm",
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,22 @@
|
||||
:root {
|
||||
--light-code-background: #FFFFFF;
|
||||
--dark-code-background: #1E1E1E;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) { :root {
|
||||
--code-background: var(--light-code-background);
|
||||
} }
|
||||
|
||||
@media (prefers-color-scheme: dark) { :root {
|
||||
--code-background: var(--dark-code-background);
|
||||
} }
|
||||
|
||||
:root[data-theme='light'] {
|
||||
--code-background: var(--light-code-background);
|
||||
}
|
||||
|
||||
:root[data-theme='dark'] {
|
||||
--code-background: var(--dark-code-background);
|
||||
}
|
||||
|
||||
pre, code { background: var(--code-background); }
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user