mirror of
https://github.com/wavetermdev/wails.git
synced 2026-04-22 15:26:15 -07:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d4dabc1289 | |||
| cf18fcfc1e | |||
| 035ede4701 | |||
| 0f66a98449 | |||
| cb67c266cf | |||
| 8d2a353bce | |||
| 05bdeb0844 | |||
| 1193fe9799 |
@@ -13,7 +13,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-11]
|
||||
go-version: ['1.20']
|
||||
go-version: ['1.22']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -90,7 +90,7 @@ jobs:
|
||||
vanilla-ts,
|
||||
plain,
|
||||
]
|
||||
go-version: ['1.20']
|
||||
go-version: ['1.22']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
go-version: ['1.20']
|
||||
go-version: ['1.22']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
||||
@@ -55,7 +55,7 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
||||
|
||||
NSScreen* screen = [self getCurrentScreen];
|
||||
NSRect windowFrame = [self.mainWindow frame];
|
||||
NSRect screenFrame = [screen frame];
|
||||
NSRect screenFrame = [screen visibleFrame];
|
||||
windowFrame.origin.x = screenFrame.origin.x + (float)x;
|
||||
windowFrame.origin.y = (screenFrame.origin.y + screenFrame.size.height) - windowFrame.size.height - (float)y;
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
package linux
|
||||
|
||||
/*
|
||||
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0
|
||||
#cgo linux pkg-config: gtk+-3.0
|
||||
#cgo !webkit2_41 pkg-config: webkit2gtk-4.0
|
||||
#cgo webkit2_41 pkg-config: webkit2gtk-4.1
|
||||
|
||||
#include "gtk/gtk.h"
|
||||
#include "webkit2/webkit2.h"
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
package linux
|
||||
|
||||
/*
|
||||
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0
|
||||
#cgo linux pkg-config: gtk+-3.0
|
||||
#cgo !webkit2_41 pkg-config: webkit2gtk-4.0
|
||||
#cgo webkit2_41 pkg-config: webkit2gtk-4.1
|
||||
|
||||
#include "gtk/gtk.h"
|
||||
#include "webkit2/webkit2.h"
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
package linux
|
||||
|
||||
/*
|
||||
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0
|
||||
#cgo linux pkg-config: gtk+-3.0
|
||||
#cgo !webkit2_41 pkg-config: webkit2gtk-4.0
|
||||
#cgo webkit2_41 pkg-config: webkit2gtk-4.1
|
||||
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
package linux
|
||||
|
||||
/*
|
||||
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0
|
||||
#cgo linux pkg-config: gtk+-3.0
|
||||
#cgo !webkit2_41 pkg-config: webkit2gtk-4.0
|
||||
#cgo webkit2_41 pkg-config: webkit2gtk-4.1
|
||||
|
||||
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
package linux
|
||||
|
||||
/*
|
||||
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0
|
||||
#cgo linux pkg-config: gtk+-3.0
|
||||
#cgo !webkit2_41 pkg-config: webkit2gtk-4.0
|
||||
#cgo webkit2_41 pkg-config: webkit2gtk-4.1
|
||||
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
package linux
|
||||
|
||||
/*
|
||||
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0
|
||||
#cgo linux pkg-config: gtk+-3.0
|
||||
#cgo !webkit2_41 pkg-config: webkit2gtk-4.0
|
||||
#cgo webkit2_41 pkg-config: webkit2gtk-4.1
|
||||
|
||||
#cgo CFLAGS: -w
|
||||
#include <stdio.h>
|
||||
#include "webkit2/webkit2.h"
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
package linux
|
||||
|
||||
/*
|
||||
#cgo linux pkg-config: webkit2gtk-4.0
|
||||
#cgo !webkit2_41 pkg-config: webkit2gtk-4.0
|
||||
#cgo webkit2_41 pkg-config: webkit2gtk-4.1
|
||||
#include "webkit2/webkit2.h"
|
||||
*/
|
||||
import "C"
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
package linux
|
||||
|
||||
/*
|
||||
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0
|
||||
#cgo linux pkg-config: gtk+-3.0
|
||||
#cgo !webkit2_41 pkg-config: webkit2gtk-4.0
|
||||
#cgo webkit2_41 pkg-config: webkit2gtk-4.1
|
||||
|
||||
#include <JavaScriptCore/JavaScript.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
@@ -3,7 +3,7 @@ package typescriptify
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
@@ -394,7 +394,7 @@ func loadCustomCode(fileName string) (map[string]string, error) {
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
bytes, err := ioutil.ReadAll(f)
|
||||
bytes, err := io.ReadAll(f)
|
||||
if err != nil {
|
||||
return result, err
|
||||
}
|
||||
@@ -430,7 +430,7 @@ func (t TypeScriptify) backup(fileName string) error {
|
||||
}
|
||||
defer fileIn.Close()
|
||||
|
||||
bytes, err := ioutil.ReadAll(fileIn)
|
||||
bytes, err := io.ReadAll(fileIn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -440,7 +440,7 @@ func (t TypeScriptify) backup(fileName string) error {
|
||||
backupFn = path.Join(t.BackupDir, backupFn)
|
||||
}
|
||||
|
||||
return ioutil.WriteFile(backupFn, bytes, os.FileMode(0o700))
|
||||
return os.WriteFile(backupFn, bytes, os.FileMode(0o700))
|
||||
}
|
||||
|
||||
func (t TypeScriptify) ConvertToFile(fileName string, packageName string) error {
|
||||
@@ -894,7 +894,7 @@ func (t *typeScriptClassBuilder) addField(fld, fldType string, isAnyType bool) {
|
||||
isOptional := strings.HasSuffix(fld, "?")
|
||||
strippedFieldName := strings.ReplaceAll(fld, "?", "")
|
||||
if !regexp.MustCompile(jsVariableNameRegex).Match([]byte(strippedFieldName)) {
|
||||
fld = fmt.Sprintf(`"%s"`, fld)
|
||||
fld = fmt.Sprintf(`"%s"`, strippedFieldName)
|
||||
if isOptional {
|
||||
fld += "?"
|
||||
}
|
||||
|
||||
@@ -3,12 +3,10 @@ package assetserver
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"net/url"
|
||||
"runtime"
|
||||
|
||||
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
||||
)
|
||||
|
||||
func NewProxyServer(proxyURL string) http.Handler {
|
||||
@@ -16,10 +14,7 @@ func NewProxyServer(proxyURL string) http.Handler {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return NewExternalAssetsHandler(nil,
|
||||
assetserver.Options{},
|
||||
parsedURL)
|
||||
|
||||
return httputil.NewSingleHostReverseProxy(parsedURL)
|
||||
}
|
||||
|
||||
func NewExternalAssetsHandler(logger Logger, options assetserver.Options, url *url.URL) http.Handler {
|
||||
@@ -68,7 +63,7 @@ func NewExternalAssetsHandler(logger Logger, options assetserver.Options, url *u
|
||||
|
||||
var result http.Handler = http.HandlerFunc(
|
||||
func(rw http.ResponseWriter, req *http.Request) {
|
||||
if runtime.GOOS == "darwin" || req.Method == http.MethodGet {
|
||||
if req.Method == http.MethodGet {
|
||||
proxy.ServeHTTP(rw, req)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
package webview
|
||||
|
||||
/*
|
||||
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0 gio-unix-2.0
|
||||
#cgo linux pkg-config: gtk+-3.0 gio-unix-2.0
|
||||
#cgo !webkit2_41 pkg-config: webkit2gtk-4.0
|
||||
#cgo webkit2_41 pkg-config: webkit2gtk-4.1
|
||||
|
||||
#include "gtk/gtk.h"
|
||||
#include "webkit2/webkit2.h"
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
package webview
|
||||
|
||||
/*
|
||||
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0 gio-unix-2.0
|
||||
#cgo linux pkg-config: gtk+-3.0 gio-unix-2.0
|
||||
#cgo !webkit2_41 pkg-config: webkit2gtk-4.0
|
||||
#cgo webkit2_41 pkg-config: webkit2gtk-4.1
|
||||
|
||||
#include "gtk/gtk.h"
|
||||
#include "webkit2/webkit2.h"
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
//go:build linux && (webkit2_36 || webkit2_40)
|
||||
//go:build linux && (webkit2_36 || webkit2_40 || webkit2_41 )
|
||||
|
||||
package webview
|
||||
|
||||
/*
|
||||
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0 libsoup-2.4
|
||||
#cgo linux pkg-config: gtk+-3.0
|
||||
#cgo !webkit2_41 pkg-config: webkit2gtk-4.0 libsoup-2.4
|
||||
#cgo webkit2_41 pkg-config: webkit2gtk-4.1 libsoup-3.0
|
||||
|
||||
#include "gtk/gtk.h"
|
||||
#include "webkit2/webkit2.h"
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
//go:build linux && webkit2_40
|
||||
//go:build linux && (webkit2_40 || webkit2_41)
|
||||
|
||||
package webview
|
||||
|
||||
/*
|
||||
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0 gio-unix-2.0
|
||||
#cgo linux pkg-config: gtk+-3.0 gio-unix-2.0
|
||||
#cgo !webkit2_41 pkg-config: webkit2gtk-4.0
|
||||
#cgo webkit2_41 pkg-config: webkit2gtk-4.1
|
||||
|
||||
#include "gtk/gtk.h"
|
||||
#include "webkit2/webkit2.h"
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
//go:build linux && webkit2_41
|
||||
|
||||
package webview
|
||||
|
||||
const Webkit2MinMinorVersion = 41
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build linux && !(webkit2_36 || webkit2_40)
|
||||
//go:build linux && !(webkit2_36 || webkit2_40 || webkit2_41)
|
||||
|
||||
package webview
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ This example has the following options set:
|
||||
- `OnShutdown` - A callback for when the application is about to quit
|
||||
- `Bind` - A slice of struct instances that we wish to expose to the frontend
|
||||
|
||||
A full list of application options can be found in the [Options Reference](reference/options).
|
||||
A full list of application options can be found in the [Options Reference](reference/options.mdx).
|
||||
|
||||
#### Assets
|
||||
|
||||
@@ -466,4 +466,4 @@ tasks such as emit an event or perform logging operations:
|
||||
window.runtime.EventsEmit("my-event", 1);
|
||||
```
|
||||
|
||||
More details about the JS runtime can be found in the [Runtime Reference](reference/runtime/intro).
|
||||
More details about the JS runtime can be found in the [Runtime Reference](reference/runtime/intro.mdx).
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user