mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
Merge branch 'refs/heads/master' into v3-alpha
# Conflicts: # .github/workflows/build-and-test.yml # .github/workflows/pr.yml # v2/go.mod # website/src/pages/changelog.mdx
This commit is contained in:
commit
8a7057b3b0
2188 changed files with 128600 additions and 11704 deletions
|
|
@ -158,7 +158,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"login": "codydbentley",
|
||||
"login": "sircodemane",
|
||||
"name": "Cody Bentley",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/6968902?v=4",
|
||||
"profile": "https://codybentley.dev/",
|
||||
|
|
|
|||
50
.github/workflows/build-and-test.yml
vendored
50
.github/workflows/build-and-test.yml
vendored
|
|
@ -12,16 +12,24 @@ jobs:
|
|||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-11]
|
||||
go-version: ['1.22']
|
||||
os: [ubuntu-22.04, ubuntu-24.04, windows-latest, macos-latest, macos-11]
|
||||
go-version: ['1.21']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install linux dependencies
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
|
||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
if: matrix.os == 'ubuntu-22.04'
|
||||
with:
|
||||
packages: libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
|
||||
version: 1.0
|
||||
|
||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
if: matrix.os == 'ubuntu-24.04'
|
||||
with:
|
||||
packages: libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config
|
||||
version: 1.0
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
|
|
@ -37,10 +45,15 @@ jobs:
|
|||
run: go test -v ./...
|
||||
|
||||
- name: Run tests (!mac)
|
||||
if: matrix.os != 'macos-latest' && matrix.os != 'macos-11'
|
||||
if: matrix.os != 'macos-latest' && matrix.os != 'macos-11' && matrix.os != 'ubuntu-24.04'
|
||||
working-directory: ./v2
|
||||
run: go test -v ./...
|
||||
|
||||
- name: Run tests (Ubuntu 24.04)
|
||||
if: matrix.os == 'ubuntu-24.04'
|
||||
working-directory: ./v2
|
||||
run: go test -v -tags webkit2_41 ./...
|
||||
|
||||
test_js:
|
||||
name: Run JS Tests
|
||||
if: github.repository == 'wailsapp/wails'
|
||||
|
|
@ -73,7 +86,7 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
os: [ubuntu-22.04, windows-latest, macos-latest, ubuntu-24.04, macos-11]
|
||||
template:
|
||||
[
|
||||
svelte,
|
||||
|
|
@ -90,7 +103,7 @@ jobs:
|
|||
vanilla-ts,
|
||||
plain,
|
||||
]
|
||||
go-version: ['1.22']
|
||||
go-version: ['1.21']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
|
@ -107,14 +120,29 @@ jobs:
|
|||
go install
|
||||
wails -help
|
||||
|
||||
- name: Install linux dependencies
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
- name: Install linux dependencies ( 22.04 )
|
||||
if: matrix.os == 'ubuntu-22.04'
|
||||
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
|
||||
|
||||
- name: Generate template '${{ matrix.template }}'
|
||||
- name: Install linux dependencies ( 24.04 )
|
||||
if: matrix.os == 'ubuntu-24.04'
|
||||
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config
|
||||
|
||||
- name: Generate & Build template '${{ matrix.template }}'
|
||||
if: matrix.os != 'ubuntu-24.04'
|
||||
run: |
|
||||
mkdir -p ./test-${{ matrix.template }}
|
||||
cd ./test-${{ matrix.template }}
|
||||
wails init -n ${{ matrix.template }} -t ${{ matrix.template }} -ci
|
||||
cd ${{ matrix.template }}
|
||||
wails build -v 2
|
||||
|
||||
- name: Generate & Build template '${{ matrix.template }}' (ubuntu-24.04)
|
||||
if: matrix.os == 'ubuntu-24.04'
|
||||
run: |
|
||||
mkdir -p ./test-${{ matrix.template }}
|
||||
cd ./test-${{ matrix.template }}
|
||||
wails init -n ${{ matrix.template }} -t ${{ matrix.template }} -ci
|
||||
cd ${{ matrix.template }}
|
||||
wails build -v 2 -tags webkit2_41
|
||||
|
||||
|
|
|
|||
45
.github/workflows/pr.yml
vendored
45
.github/workflows/pr.yml
vendored
|
|
@ -14,7 +14,7 @@ jobs:
|
|||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Verify Changed files
|
||||
uses: tj-actions/verify-changed-files@v11.1
|
||||
uses: tj-actions/verify-changed-files@v17
|
||||
id: verify-changed-files
|
||||
with:
|
||||
files: |
|
||||
|
|
@ -55,48 +55,39 @@ jobs:
|
|||
if: github.event.review.state == 'approved'
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
go-version: ['1.22']
|
||||
os: [ubuntu-22.04, windows-latest, macos-latest, ubuntu-24.04]
|
||||
go-version: ['1.21']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install linux dependencies (v3)
|
||||
if: ${{ matrix.os == 'ubuntu-latest' && github.event.pull_request.base.ref == 'v3-alpha' }}
|
||||
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config
|
||||
|
||||
- name: Install linux dependencies (v2)
|
||||
if: ${{ matrix.os == 'ubuntu-latest' && github.event.pull_request.base.ref == 'master' }}
|
||||
- name: Install linux dependencies ( 22.04 )
|
||||
if: matrix.os == 'ubuntu-22.04'
|
||||
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
|
||||
|
||||
- name: Install linux dependencies ( 24.04 )
|
||||
if: matrix.os == 'ubuntu-24.04'
|
||||
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
|
||||
- name: Run tests (mac) | v2
|
||||
if: ${{ matrix.os == 'macos-latest' && github.event.pull_request.base.ref == 'master' }}
|
||||
- name: Run tests (mac)
|
||||
if: matrix.os == 'macos-latest'
|
||||
env:
|
||||
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
|
||||
CGO_CFLAGS: -mmacosx-version-min=10.13
|
||||
working-directory: ./v2
|
||||
run: go test -v ./...
|
||||
|
||||
- name: Run tests (!mac) | v2
|
||||
if: ${{ matrix.os != 'macos-latest' && github.event.pull_request.base.ref == 'master' }}
|
||||
working-directory: ./v2
|
||||
- name: Run tests (!mac)
|
||||
if: matrix.os != 'macos-latest' && matrix.os != 'ubuntu-24.04'
|
||||
working-directory: ./v2
|
||||
run: go test -v ./...
|
||||
|
||||
- name: Run tests (mac) | v3
|
||||
if: ${{ matrix.os == 'macos-latest' && github.event.pull_request.base.ref == 'v3-alpha' }}
|
||||
env:
|
||||
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
|
||||
CGO_CFLAGS: -mmacosx-version-min=10.13
|
||||
working-directory: ./v3
|
||||
run: go test -v ./...
|
||||
|
||||
- name: Run tests (!mac) | v3
|
||||
if: ${{ matrix.os != 'macos-latest' && github.event.pull_request.base.ref == 'v3-alpha' }}
|
||||
working-directory: ./v3
|
||||
run: go test -v ./...
|
||||
- name: Run tests (Ubuntu 24.04)
|
||||
if: matrix.os == 'ubuntu-24.04'
|
||||
working-directory: ./v2
|
||||
run: go test -v -tags webkit2_41 ./...
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ jobs:
|
|||
|
||||
- name: Verify Changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v35
|
||||
uses: tj-actions/changed-files@v41
|
||||
with:
|
||||
files: |
|
||||
website/**/*.mdx
|
||||
|
|
|
|||
160
README.de.md
Normal file
160
README.de.md
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
<p align="center" style="text-align: center">
|
||||
<img src="./assets/images/logo-universal.png" width="55%"><br/>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
Erschaffe Desktop Anwendungen mit Go & Web Technologien.
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="https://github.com/wailsapp/wails/blob/master/LICENSE">
|
||||
<img alt="GitHub" src="https://img.shields.io/github/license/wailsapp/wails"/>
|
||||
</a>
|
||||
<a href="https://goreportcard.com/report/github.com/wailsapp/wails">
|
||||
<img src="https://goreportcard.com/badge/github.com/wailsapp/wails" />
|
||||
</a>
|
||||
<a href="https://pkg.go.dev/github.com/wailsapp/wails">
|
||||
<img src="https://pkg.go.dev/badge/github.com/wailsapp/wails.svg" alt="Go Reference"/>
|
||||
</a>
|
||||
<a href="https://github.com/wailsapp/wails/issues">
|
||||
<img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="CodeFactor" />
|
||||
</a>
|
||||
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_shield" alt="FOSSA Status">
|
||||
<img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwailsapp%2Fwails.svg?type=shield" />
|
||||
</a>
|
||||
<a href="https://github.com/avelino/awesome-go" rel="nofollow">
|
||||
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome" />
|
||||
</a>
|
||||
<a href="https://discord.gg/BrRSWTaxVK">
|
||||
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/BrRSWTaxVK?style=flat"/>
|
||||
</a>
|
||||
<br/>
|
||||
<a href="https://github.com/wailsapp/wails/actions/workflows/build-and-test.yml" rel="nofollow">
|
||||
<img src="https://img.shields.io/github/actions/workflow/status/wailsapp/wails/build-and-test.yml?branch=master&logo=Github" alt="Build" />
|
||||
</a>
|
||||
<a href="https://github.com/wailsapp/wails/tags" rel="nofollow">
|
||||
<img alt="GitHub tag (latest SemVer pre-release)" src="https://img.shields.io/github/v/tag/wailsapp/wails?include_prereleases&label=version"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
<strong>
|
||||
<samp>
|
||||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
## Inhaltsverzeichnis
|
||||
|
||||
- [Inhaltsverzeichnis](#inhaltsverzeichnis)
|
||||
- [Einführung](#einführung)
|
||||
- [Funktionen](#funktionen)
|
||||
- [Roadmap](#roadmap)
|
||||
- [Loslegen](#loslegen)
|
||||
- [Sponsoren](#sponsoren)
|
||||
- [FAQ](#faq)
|
||||
- [Sterne Überblick](#sterne-überblick)
|
||||
- [Mitwirkende](#mitwirkende)
|
||||
- [Lizenz](#lizenz)
|
||||
- [Inspiration](#inspiration)
|
||||
|
||||
## Einführung
|
||||
|
||||
Die herkömmliche Methode zur Bereitstellung von Web-Interfaces für Go ist über einen eingebauten Webserver.
|
||||
Wails nutzt einen anderen Weg. Es kann sowohl Go-Code als auch ein Web-Frontend in eine einzige Datei bauen.
|
||||
Beigelieferte Werkzeuge übernehmen die Projekterstellung, den Kompilierungsprozess und das bauen.
|
||||
Du musst nur kreativ werden.
|
||||
|
||||
## Funktionen
|
||||
|
||||
- Nutze Standard Go für das Backend
|
||||
- Nutze eine Frontend Technologie mit der du dich bereits auskennst um dein UI zu bauen.
|
||||
- Erschaffe schnell und einfach Frontends mit vorgefertigten Vorlagen für deine Go-Programme
|
||||
- Nutze Javascript um Go Methoden aufzurufen
|
||||
- Automatisch generierte Typescript Definitionen für deine Go Strukturen und Methoden
|
||||
- Native Dialoge und Menüs
|
||||
- Native Dark-/Lightmode Unterstützung
|
||||
- Unterstützt moderne Transluzenz- und Milchglaseffekte
|
||||
- Vereinheitlichtes Eventsystem zwischen Go und Javascript
|
||||
- Leistungsstarkes CLI-Tool zum einfachen erstellen und bauen von Projekten
|
||||
- Multiplattformen
|
||||
- Nutze native Render-Engines - _keine eingebetteten Browser_!
|
||||
|
||||
### Roadmap
|
||||
|
||||
Die Projekt Roadmap kann [hier](https://github.com/wailsapp/wails/discussions/1484) gefunden werden. Bitte lies diese
|
||||
durch bevor du eine Idee vorschlägst
|
||||
|
||||
## Loslegen
|
||||
|
||||
Die Installationsinstruktionen sind auf der [offiziellen Website](https://wails.io/docs/gettingstarted/installation).
|
||||
|
||||
## Sponsoren
|
||||
|
||||
Dieses Projekt wird von diesen freundlichen Leuten und Firmen unterstützt:
|
||||
<img src="website/static/img/sponsors.svg" style="width:100%;max-width:800px;"/>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://wails.io/img/sponsor/jetbrains-grayscale.webp" style="width: 100px"/>
|
||||
</p>
|
||||
|
||||
## FAQ
|
||||
|
||||
- Ist das eine Alternative zu Electron?
|
||||
|
||||
Hängt von deinen Anforderungen ab. Wails wurde entwickelt um das Go-Programmieren leicht zu machen und effiziente
|
||||
Desktop-Anwendungen zu erstellen oder ein Frontend zu einer bestehenden Anwendung hinzuzufügen.
|
||||
Wails bietet native Elemente wie Dialoge und Menüs und könnte somit als eine leichte effiziente Electron-Alternative
|
||||
betrachtet werden.
|
||||
|
||||
- Für wen ist dieses projekt geeignet?
|
||||
|
||||
Go Entwickler, die ein HTML/CSS/JS-Frontend in ihre Anwendung integrieren möchten, ohne einen Webserver zu erstellen und
|
||||
einen Browser öffnen zu müssen, um dieses zu sehen
|
||||
|
||||
- Wie kam es zu diesem Namen?
|
||||
|
||||
Als ich WebView sah dachte ich "Was ich wirklich will, ist ein Werkzeug für die Erstellung von WebView Anwendungen so wie Rails für Ruby".
|
||||
Also war es zunächst ein Wortspiel (Webview on Rails). Zufälligerweise ist es auch ein Homophon des englischen Namens des [Landes](https://en.wikipedia.org/wiki/Wales), aus dem ich komme.
|
||||
Also ist es dabei geblieben.
|
||||
|
||||
## Sterne Überblick
|
||||
|
||||
<a href="https://star-history.com/#wailsapp/wails&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date&theme=dark" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date" />
|
||||
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
## Mitwirkende
|
||||
|
||||
Die Liste der Mitwirkenden wird zu groß für diese Readme. All die fantastischen Menschen, die zu diesem
|
||||
Projekt beigetragen haben, haben [hier](https://wails.io/credits#contributors) ihre eigene Seite.
|
||||
|
||||
## Lizenz
|
||||
|
||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_large)
|
||||
|
||||
## Inspiration
|
||||
|
||||
Dieses Projekt wurde hauptsächlich zu den folgenden Alben entwickelt
|
||||
|
||||
- [Manic Street Preachers - Resistance Is Futile](https://open.spotify.com/album/1R2rsEUqXjIvAbzM0yHrxA)
|
||||
- [Manic Street Preachers - This Is My Truth, Tell Me Yours](https://open.spotify.com/album/4VzCL9kjhgGQeKCiojK1YN)
|
||||
- [The Midnight - Endless Summer](https://open.spotify.com/album/4Krg8zvprquh7TVn9OxZn8)
|
||||
- [Gary Newman - Savage (Songs from a Broken World)](https://open.spotify.com/album/3kMfsD07Q32HRWKRrpcexr)
|
||||
- [Steve Vai - Passion & Warfare](https://open.spotify.com/album/0oL0OhrE2rYVns4IGj8h2m)
|
||||
- [Ben Howard - Every Kingdom](https://open.spotify.com/album/1nJsbWm3Yy2DW1KIc1OKle)
|
||||
- [Ben Howard - Noonday Dream](https://open.spotify.com/album/6astw05cTiXEc2OvyByaPs)
|
||||
- [Adwaith - Melyn](https://open.spotify.com/album/2vBE40Rp60tl7rNqIZjaXM)
|
||||
- [Gwidaith Hen Fran - Cedors Hen Wrach](https://open.spotify.com/album/3v2hrfNGINPLuDP0YDTOjm)
|
||||
- [Metallica - Metallica](https://open.spotify.com/album/2Kh43m04B1UkVcpcRa1Zug)
|
||||
- [Bloc Party - Silent Alarm](https://open.spotify.com/album/6SsIdN05HQg2GwYLfXuzLB)
|
||||
- [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF)
|
||||
- [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v)
|
||||
|
|
@ -42,7 +42,8 @@
|
|||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md)
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
|
||||
[Türkçe](README.tr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@
|
|||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md)
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
|
||||
[Türkçe](README.tr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@
|
|||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md)
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
|
||||
[Türkçe](README.tr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@
|
|||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md)
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
|
||||
[Türkçe](README.tr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@
|
|||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md)
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
|
||||
[Türkçe](README.tr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
|
|
@ -86,7 +87,7 @@ make this easy for you by handling project creation, compilation and bundling. A
|
|||
### Roadmap
|
||||
|
||||
The project roadmap may be found [here](https://github.com/wailsapp/wails/discussions/1484). Please consult
|
||||
this before open up an enhancement request.
|
||||
it before creating an enhancement request.
|
||||
|
||||
## Getting Started
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@
|
|||
<samp>
|
||||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md)
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
|
||||
[Türkçe](README.tr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
|
|
|
|||
34
README.ru.md
34
README.ru.md
|
|
@ -41,7 +41,8 @@
|
|||
<samp>
|
||||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md)
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
|
||||
[Türkçe](README.tr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
|
|
@ -73,12 +74,12 @@
|
|||
- Использование Go для backend
|
||||
- Поддержка любой frontend технологии, с которой вы уже знакомы для создания вашего UI
|
||||
- Быстрое создание frontend для ваших программ, используя готовые шаблоны
|
||||
- Очень лёгкий вызов функция Go из JavaScript
|
||||
- Автогене рация TypeScript типов для Go структур и функций
|
||||
- Очень лёгкий вызов функций Go из JavaScript
|
||||
- Автогенерация TypeScript типов для Go структур и функций
|
||||
- Нативные диалоги и меню
|
||||
- Нативная поддержка тёмной и светлой темы
|
||||
- Поддержка современной прозрачности и эффекта "матового окна"
|
||||
- Единая система Эвентов для Go и JavaScript
|
||||
- Поддержка современных эффектов прозрачности и "матового окна"
|
||||
- Единая система эвентов для Go и JavaScript
|
||||
- Мощный CLI для быстрого создания ваших проектов
|
||||
- Мультиплатформенность
|
||||
- Использование нативного движка рендеринга - нет встроенному браузеру!
|
||||
|
|
@ -105,29 +106,28 @@ Roadmap проекта вы можете найти [здесь](https://github.
|
|||
|
||||
- Это альтернатива Electron?
|
||||
|
||||
Зависит от ваших требований. Wails разработан для легкого создания Desktop приложений или расширения интерфейсной
|
||||
части к своим существующим приложениям программистам Go. Wails действительно предлагает встроенные элементы, такие как
|
||||
меню и диалоги, так что его можно считать облегченной альтернативой Electron.
|
||||
Зависит от ваших требований. Wails разработан для легкого создания Desktop приложений или
|
||||
расширения интерфейсной части существующих приложений для программистов на Go. Wails действительно
|
||||
предлагает встроенные элементы, такие как меню и диалоги, так что его можно считать облегченной альтернативой Electron.
|
||||
|
||||
- Для кого нацелен этот проект?
|
||||
- Для кого предназначен этот проект?
|
||||
|
||||
Для Golang программистов, которые хотят создавать приложение используя HTML JS и CSS, без создания Web сервера и
|
||||
открытия браузера для его просмотра.
|
||||
Для Golang программистов, которые хотят создавать приложения, используя HTML, JS и CSS,
|
||||
без создания веб-сервера и открытия браузера для их просмотра.
|
||||
|
||||
- Что это за название?
|
||||
|
||||
Когда я увидел WebView, я подумал: "Что мне действительно нужно, так это инструменты для создания приложения WebView,
|
||||
немного похожие на Rails для Ruby". Итак, изначально это была игра слов (Webview on Rails). Просто так получилось, что
|
||||
это также омофон английского названия для [Страны](https://en.wikipedia.org/wiki/Wales) от куда я родом. Так что это
|
||||
прижилось.
|
||||
немного похожие на Rails для Ruby". Изначально это была игра слов (Webview on Rails). Просто так получилось, что это
|
||||
также омофон английского названия для [Страны](https://en.wikipedia.org/wiki/Wales) от куда я родом. Так что это прижилось.
|
||||
|
||||
## График звёздочек репозитория, относительно времени
|
||||
## График звёздочек репозитория по времени
|
||||
|
||||
[](https://star-history.com/#wailsapp/wails&Date)
|
||||
|
||||
## Контребьюторы
|
||||
## Контрибьюторы
|
||||
|
||||
Список участников слишком большой для README! У всех замечательных людей, которые внесли свой вклад в этот
|
||||
Список участников слишком велик для README! У всех замечательных людей, которые внесли свой вклад в этот
|
||||
проект, есть своя [страничка](https://wails.io/credits#contributors).
|
||||
|
||||
## Лицензия
|
||||
|
|
|
|||
156
README.tr.md
Normal file
156
README.tr.md
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
<p align="center" style="text-align: center">
|
||||
<img src="./assets/images/logo-universal.png" width="55%"><br/>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
Go ve Web Teknolojilerini kullanarak masaüstü uygulamaları oluşturun.
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="https://github.com/wailsapp/wails/blob/master/LICENSE">
|
||||
<img alt="GitHub" src="https://img.shields.io/github/license/wailsapp/wails"/>
|
||||
</a>
|
||||
<a href="https://goreportcard.com/report/github.com/wailsapp/wails">
|
||||
<img src="https://goreportcard.com/badge/github.com/wailsapp/wails" />
|
||||
</a>
|
||||
<a href="https://pkg.go.dev/github.com/wailsapp/wails">
|
||||
<img src="https://pkg.go.dev/badge/github.com/wailsapp/wails.svg" alt="Go Reference"/>
|
||||
</a>
|
||||
<a href="https://github.com/wailsapp/wails/issues">
|
||||
<img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="CodeFactor" />
|
||||
</a>
|
||||
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_shield" alt="FOSSA Status">
|
||||
<img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwailsapp%2Fwails.svg?type=shield" />
|
||||
</a>
|
||||
<a href="https://github.com/avelino/awesome-go" rel="nofollow">
|
||||
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome" />
|
||||
</a>
|
||||
<a href="https://discord.gg/BrRSWTaxVK">
|
||||
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/BrRSWTaxVK?style=flat"/>
|
||||
</a>
|
||||
<br/>
|
||||
<a href="https://github.com/wailsapp/wails/actions/workflows/build-and-test.yml" rel="nofollow">
|
||||
<img src="https://img.shields.io/github/actions/workflow/status/wailsapp/wails/build-and-test.yml?branch=master&logo=Github" alt="Build" />
|
||||
</a>
|
||||
<a href="https://github.com/wailsapp/wails/tags" rel="nofollow">
|
||||
<img alt="GitHub tag (latest SemVer pre-release)" src="https://img.shields.io/github/v/tag/wailsapp/wails?include_prereleases&label=version"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
<strong>
|
||||
<samp>
|
||||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) ·
|
||||
[Türkçe](README.tr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
## İçerik
|
||||
|
||||
- [İçerik](#içerik)
|
||||
- [Giriş](#giriş)
|
||||
- [Özellikler](#özellikler)
|
||||
- [Yol Haritası](#yol-haritası)
|
||||
- [Başlarken](#başlarken)
|
||||
- [Sponsorlar](#sponsorlar)
|
||||
- [Sıkça sorulan sorular](#sıkça-sorulan-sorular)
|
||||
- [Zaman içinda yıldızlayanlar](#zaman-içinde-yıldızlayanlar)
|
||||
- [Katkıda bulunanlar](#katkıda-bulunanlar)
|
||||
- [Lisans](#lisans)
|
||||
- [İlham](#ilham)
|
||||
|
||||
## Giriş
|
||||
|
||||
Go programlarına web arayüzleri sağlamak için geleneksel yöntem, yerleşik bir web sunucusu kullanmaktır. Wails, farklı bir yaklaşım sunar: Hem Go kodunu hem de bir web ön yüzünü tek bir ikili dosyada paketleme yeteneği sağlar. Proje oluşturma, derleme ve paketleme işlemlerini kolaylaştıran araçlar sunar. Tek yapmanız gereken yaratıcı olmaktır!
|
||||
|
||||
## Özellikler
|
||||
|
||||
- Backend için standart Go kullanın
|
||||
- Kullanıcı arayüzünüzü oluşturmak için zaten aşina olduğunuz herhangi bir frontend teknolojisini kullanın
|
||||
- Hazır şablonlar kullanarak Go programlarınız için hızlıca zengin ön yüzler oluşturun
|
||||
- Javascript'ten Go metodlarını kolayca çağırın
|
||||
- Go yapı ve metodlarınız için otomatik oluşturulan Typescript tanımları
|
||||
- Yerel Diyaloglar ve Menüler
|
||||
- Yerel Karanlık / Aydınlık mod desteği
|
||||
- Modern saydamlık ve "buzlu cam" efektlerini destekler
|
||||
- Go ve Javascript arasında birleşik olay sistemi
|
||||
- Projelerinizi hızlıca oluşturmak ve derlemek için güçlü bir komut satırı aracı
|
||||
- Çoklu platform desteği
|
||||
- Yerel render motorlarını kullanır - _gömülü tarayıcı yok_!
|
||||
|
||||
|
||||
### Yol Haritesı
|
||||
|
||||
Proje yol haritasına [buradan](https://github.com/wailsapp/wails/discussions/1484) ulaşabilirsiniz. Lütfen bir iyileştirme talebi oluşturmadan önce danışın.
|
||||
|
||||
|
||||
## Başlarken
|
||||
|
||||
Kurulum talimatları [resmi web sitesinde](https://wails.io/docs/gettingstarted/installation) bulunmaktadır.
|
||||
|
||||
|
||||
## Sponsorlar
|
||||
|
||||
Bu proje, aşağıdaki nazik insanlar / şirketler tarafından desteklenmektedir:
|
||||
<img src="website/static/img/sponsors.svg" style="width:100%;max-width:800px;"/>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://wails.io/img/sponsor/jetbrains-grayscale.webp" style="width: 100px"/>
|
||||
</p>
|
||||
|
||||
## Sıkça Sorulan Sorular
|
||||
|
||||
- Bu Electron'a alternatif mi?
|
||||
|
||||
Gereksinimlerinize bağlıdır. Go programcılarının hafif masaüstü uygulamaları yapmasını veya mevcut uygulamalarına bir ön yüz eklemelerini kolaylaştırmak için tasarlanmıştır. Wails, menüler ve diyaloglar gibi yerel öğeler sunduğundan, hafif bir Electron alternatifi olarak kabul edilebilir.
|
||||
|
||||
- Bu proje kimlere yöneliktir?
|
||||
|
||||
HTML/JS/CSS ön yüzünü uygulamalarıyla birlikte paketlemek isteyen, ancak bir sunucu oluşturup bir tarayıcı açmaya başvurmadan bunu yapmak isteyen Go programcıları için.
|
||||
|
||||
- İsmin anlamı nedir?
|
||||
|
||||
WebView'i gördüğümde, "Aslında istediğim şey, WebView uygulaması oluşturmak için araçlar, biraz Rails'in Ruby için olduğu gibi" diye düşündüm. Bu nedenle başlangıçta kelime oyunu (Rails üzerinde Webview) olarak ortaya çıktı. Ayrıca, benim geldiğim [ülkenin](https://en.wikipedia.org/wiki/Wales) İngilizce adıyla homofon olması tesadüf oldu. Bu yüzden bu isim kaldı.
|
||||
|
||||
|
||||
## Zaman içinda yıldızlayanlar
|
||||
|
||||
<a href="https://star-history.com/#wailsapp/wails&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date&theme=dark" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date" />
|
||||
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
## Katkıda Bulunanlar
|
||||
|
||||
Katkıda bulunanların listesi, README için çok büyük hale geldi! Bu projeye katkıda bulunan tüm harika insanların kendi sayfaları [burada](https://wails.io/credits#contributors) bulunmaktadır.
|
||||
|
||||
|
||||
## Lisans
|
||||
|
||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_large)
|
||||
|
||||
## İlham
|
||||
|
||||
Bu proje esas olarak aşağıdaki albümler dinlenilerek kodlandı:
|
||||
|
||||
- [Manic Street Preachers - Resistance Is Futile](https://open.spotify.com/album/1R2rsEUqXjIvAbzM0yHrxA)
|
||||
- [Manic Street Preachers - This Is My Truth, Tell Me Yours](https://open.spotify.com/album/4VzCL9kjhgGQeKCiojK1YN)
|
||||
- [The Midnight - Endless Summer](https://open.spotify.com/album/4Krg8zvprquh7TVn9OxZn8)
|
||||
- [Gary Newman - Savage (Songs from a Broken World)](https://open.spotify.com/album/3kMfsD07Q32HRWKRrpcexr)
|
||||
- [Steve Vai - Passion & Warfare](https://open.spotify.com/album/0oL0OhrE2rYVns4IGj8h2m)
|
||||
- [Ben Howard - Every Kingdom](https://open.spotify.com/album/1nJsbWm3Yy2DW1KIc1OKle)
|
||||
- [Ben Howard - Noonday Dream](https://open.spotify.com/album/6astw05cTiXEc2OvyByaPs)
|
||||
- [Adwaith - Melyn](https://open.spotify.com/album/2vBE40Rp60tl7rNqIZjaXM)
|
||||
- [Gwidaith Hen Fran - Cedors Hen Wrach](https://open.spotify.com/album/3v2hrfNGINPLuDP0YDTOjm)
|
||||
- [Metallica - Metallica](https://open.spotify.com/album/2Kh43m04B1UkVcpcRa1Zug)
|
||||
- [Bloc Party - Silent Alarm](https://open.spotify.com/album/6SsIdN05HQg2GwYLfXuzLB)
|
||||
- [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF)
|
||||
- [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v)
|
||||
|
||||
|
|
@ -42,7 +42,8 @@
|
|||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz)
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz) · [Deutsch](README.de.md) ·
|
||||
[Türkçe](README.tr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@
|
|||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md)
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
|
||||
[Türkçe](README.tr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
|
|
|
|||
38
SECURITY.md
Normal file
38
SECURITY.md
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 2.x.x | :white_check_mark: |
|
||||
| 3.0.x-alpha | :x: |
|
||||
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you believe you have found a security vulnerability in our project, we encourage you to let us know right away.
|
||||
We will investigate all legitimate reports and do our best to quickly fix the problem.
|
||||
|
||||
Before reporting though, please review our security policy below.
|
||||
|
||||
### How to Report
|
||||
|
||||
To report a security vulnerability, please use GitHub's [private vulnerability reporting](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability) feature. If possible, please include as much information as possible.
|
||||
This may include steps to reproduce, impact of the vulnerability, and anything else you believe would help us understand the problem.
|
||||
**Please do not include any sensitive or personal information in your report**.
|
||||
|
||||
### What to Expect
|
||||
|
||||
When you report a vulnerability, here's what you can expect:
|
||||
|
||||
- **Acknowledgement**: We will acknowledge your email within 48 hours, and you'll receive a more detailed response to your email within 72 hours indicating the next steps in handling your report.
|
||||
|
||||
- **Updates**: After the initial reply to your report, our team will keep you informed of the progress being made towards a fix and full announcement. These updates will be sent at least once a week.
|
||||
|
||||
- **Confidentiality**: We will maintain strict confidentiality of your report until the security issue is resolved.
|
||||
|
||||
- **Issue Resolution**: If the issue is confirmed, we will release a patch as soon as possible depending on complexity of the fix.
|
||||
|
||||
- **Recognition**: We recognize and appreciate every individual who helps us identify and fix vulnerabilities in our project. While we do not currently have a bounty program, we would be happy to publicly acknowledge your responsible disclosure.
|
||||
|
||||
We strive to make Wails safe for everyone, and we greatly appreciate the assistance of security researchers and users in helping us identify and fix vulnerabilities. Thank you for your contribution to the security of this project.
|
||||
1944
scripts/sponsors/package-lock.json
generated
1944
scripts/sponsors/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -10,6 +10,6 @@
|
|||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"sponsorkit": "^0.8.2"
|
||||
"sponsorkit": "^0.9.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ func buildApplication(f *flags.Build) error {
|
|||
{"Tags", "[" + strings.Join(f.GetTags(), ",") + "]"},
|
||||
{"Race Detector", bool2Str(f.RaceDetector)},
|
||||
}...)
|
||||
if len(buildOptions.OutputFile) > 0 && len(f.GetTargets()) == 1 {
|
||||
if len(buildOptions.OutputFile) > 0 && f.GetTargets().Length() == 1 {
|
||||
tableData = append(tableData, []string{"Output File", f.OutputFilename})
|
||||
}
|
||||
pterm.DefaultSection.Println("Build Options")
|
||||
|
|
@ -145,11 +145,16 @@ func buildApplication(f *flags.Build) error {
|
|||
|
||||
// Allows cancelling the build after the first error. It would be nice if targets.Each would support funcs
|
||||
// returning an error.
|
||||
var targetErr error
|
||||
targets := f.GetTargets()
|
||||
for _, target := range targets {
|
||||
if !validPlatformArch.Contains(target.Platform) {
|
||||
buildOptions.Logger.Println("platform '%s' is not supported - skipping. Supported platforms: %s", target.Platform, validPlatformArch.Join(","))
|
||||
continue
|
||||
targets.Each(func(platform string) {
|
||||
if targetErr != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if !validPlatformArch.Contains(platform) {
|
||||
buildOptions.Logger.Println("platform '%s' is not supported - skipping. Supported platforms: %s", platform, validPlatformArch.Join(","))
|
||||
return
|
||||
}
|
||||
|
||||
desiredFilename := projectOptions.OutputFilename
|
||||
|
|
@ -158,13 +163,17 @@ func buildApplication(f *flags.Build) error {
|
|||
}
|
||||
desiredFilename = strings.TrimSuffix(desiredFilename, ".exe")
|
||||
|
||||
buildOptions.Platform = target.Platform
|
||||
buildOptions.Arch = target.Arch
|
||||
|
||||
// Calculate platform and arch
|
||||
platformSplit := strings.Split(platform, "/")
|
||||
buildOptions.Platform = platformSplit[0]
|
||||
buildOptions.Arch = f.GetDefaultArch()
|
||||
if len(platformSplit) > 1 {
|
||||
buildOptions.Arch = platformSplit[1]
|
||||
}
|
||||
banner := "Building target: " + buildOptions.Platform + "/" + buildOptions.Arch
|
||||
pterm.DefaultSection.Println(banner)
|
||||
|
||||
if f.Upx && target.String() == "darwin/universal" {
|
||||
if f.Upx && platform == "darwin/universal" {
|
||||
pterm.Warning.Println("Warning: compress flag unsupported for universal binaries. Ignoring.")
|
||||
f.Upx = false
|
||||
}
|
||||
|
|
@ -173,19 +182,22 @@ func buildApplication(f *flags.Build) error {
|
|||
case "linux":
|
||||
if runtime.GOOS != "linux" {
|
||||
pterm.Warning.Println("Crosscompiling to Linux not currently supported.")
|
||||
continue
|
||||
return
|
||||
}
|
||||
case "darwin":
|
||||
if runtime.GOOS != "darwin" {
|
||||
pterm.Warning.Println("Crosscompiling to Mac not currently supported.")
|
||||
continue
|
||||
return
|
||||
}
|
||||
if targets.MacTargetsCount() == 2 {
|
||||
macTargets := targets.Filter(func(platform string) bool {
|
||||
return strings.HasPrefix(platform, "darwin")
|
||||
})
|
||||
if macTargets.Length() == 2 {
|
||||
buildOptions.BundleName = fmt.Sprintf("%s-%s.app", desiredFilename, buildOptions.Arch)
|
||||
}
|
||||
}
|
||||
|
||||
if len(targets) > 1 {
|
||||
if targets.Length() > 1 {
|
||||
// target filename
|
||||
switch buildOptions.Platform {
|
||||
case "windows":
|
||||
|
|
@ -207,27 +219,32 @@ func buildApplication(f *flags.Build) error {
|
|||
pterm.Warning.Println("obfuscated flag overrides skipbindings flag.")
|
||||
buildOptions.SkipBindings = false
|
||||
}
|
||||
}
|
||||
|
||||
if !f.DryRun {
|
||||
// Start Time
|
||||
start := time.Now()
|
||||
if !f.DryRun {
|
||||
// Start Time
|
||||
start := time.Now()
|
||||
|
||||
compiledBinary, err := build.Build(buildOptions)
|
||||
if err != nil {
|
||||
pterm.Error.Println(err.Error())
|
||||
return err
|
||||
compiledBinary, err := build.Build(buildOptions)
|
||||
if err != nil {
|
||||
pterm.Error.Println(err.Error())
|
||||
targetErr = err
|
||||
return
|
||||
}
|
||||
|
||||
buildOptions.IgnoreFrontend = true
|
||||
buildOptions.CleanBinDirectory = false
|
||||
|
||||
// Output stats
|
||||
buildOptions.Logger.Println(fmt.Sprintf("Built '%s' in %s.\n", compiledBinary, time.Since(start).Round(time.Millisecond).String()))
|
||||
|
||||
outputBinaries[buildOptions.Platform+"/"+buildOptions.Arch] = compiledBinary
|
||||
} else {
|
||||
pterm.Info.Println("Dry run: skipped build.")
|
||||
}
|
||||
})
|
||||
|
||||
buildOptions.IgnoreFrontend = true
|
||||
buildOptions.CleanBinDirectory = false
|
||||
|
||||
// Output stats
|
||||
buildOptions.Logger.Println(fmt.Sprintf("Built '%s' in %s.\n", compiledBinary, time.Since(start).Round(time.Millisecond).String()))
|
||||
|
||||
outputBinaries[buildOptions.Platform+"/"+buildOptions.Arch] = compiledBinary
|
||||
} else {
|
||||
pterm.Info.Println("Dry run: skipped build.")
|
||||
if targetErr != nil {
|
||||
return targetErr
|
||||
}
|
||||
|
||||
if f.DryRun {
|
||||
|
|
|
|||
|
|
@ -2,10 +2,13 @@ package flags
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/leaanthony/slicer"
|
||||
"github.com/wailsapp/wails/v2/internal/system"
|
||||
"github.com/wailsapp/wails/v2/pkg/commands/build"
|
||||
"github.com/wailsapp/wails/v2/pkg/commands/buildtags"
|
||||
)
|
||||
|
|
@ -21,8 +24,7 @@ type Build struct {
|
|||
Common
|
||||
BuildCommon
|
||||
|
||||
NoPackage bool `name:"noPackage" description:"Skips platform specific packaging"`
|
||||
SkipModTidy bool `name:"m" description:"Skip mod tidy before compile"`
|
||||
NoPackage bool `description:"Skips platform specific packaging"`
|
||||
Upx bool `description:"Compress final binary with UPX (if installed)"`
|
||||
UpxFlags string `description:"Flags to pass to upx"`
|
||||
Platform string `description:"Platform to target. Comma separate multiple platforms"`
|
||||
|
|
@ -46,15 +48,29 @@ type Build struct {
|
|||
compilerPath string
|
||||
userTags []string
|
||||
wv2rtstrategy string // WebView2 runtime strategy
|
||||
defaultArch string // Default architecture
|
||||
}
|
||||
|
||||
func (b *Build) Default() *Build {
|
||||
target := defaultTarget()
|
||||
defaultPlatform := os.Getenv("GOOS")
|
||||
if defaultPlatform == "" {
|
||||
defaultPlatform = runtime.GOOS
|
||||
}
|
||||
defaultArch := os.Getenv("GOARCH")
|
||||
if defaultArch == "" {
|
||||
if system.IsAppleSilicon {
|
||||
defaultArch = "arm64"
|
||||
} else {
|
||||
defaultArch = runtime.GOARCH
|
||||
}
|
||||
}
|
||||
|
||||
result := &Build{
|
||||
Platform: target.Platform,
|
||||
Platform: defaultPlatform + "/" + defaultArch,
|
||||
WebView2: "download",
|
||||
GarbleArgs: "-literals -tiny -seed=random",
|
||||
|
||||
defaultArch: defaultArch,
|
||||
}
|
||||
result.BuildCommon = result.BuildCommon.Default()
|
||||
return result
|
||||
|
|
@ -71,8 +87,11 @@ func (b *Build) GetWebView2Strategy() string {
|
|||
return b.wv2rtstrategy
|
||||
}
|
||||
|
||||
func (b *Build) GetTargets() TargetsCollection {
|
||||
return parseTargets(b.Platform)
|
||||
func (b *Build) GetTargets() *slicer.StringSlicer {
|
||||
var targets slicer.StringSlicer
|
||||
targets.AddSlice(strings.Split(b.Platform, ","))
|
||||
targets.Deduplicate()
|
||||
return &targets
|
||||
}
|
||||
|
||||
func (b *Build) GetCompilerPath() string {
|
||||
|
|
@ -124,6 +143,10 @@ func (b *Build) GetBuildModeAsString() string {
|
|||
return "production"
|
||||
}
|
||||
|
||||
func (b *Build) GetDefaultArch() string {
|
||||
return b.defaultArch
|
||||
}
|
||||
|
||||
/*
|
||||
_, _ = fmt.Fprintf(w, "Frontend Directory: \t%s\n", projectOptions.GetFrontendDir())
|
||||
_, _ = fmt.Fprintf(w, "Obfuscated: \t%t\n", buildOptions.Obfuscated)
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ type BuildCommon struct {
|
|||
Verbosity int `name:"v" description:"Verbosity level (0 = quiet, 1 = normal, 2 = verbose)"`
|
||||
Tags string `description:"Build tags to pass to Go compiler. Must be quoted. Space or comma (but not both) separated"`
|
||||
NoSyncGoMod bool `description:"Don't sync go.mod"`
|
||||
SkipModTidy bool `name:"m" description:"Skip mod tidy before compile"`
|
||||
}
|
||||
|
||||
func (c BuildCommon) Default() BuildCommon {
|
||||
|
|
|
|||
|
|
@ -1,103 +1,5 @@
|
|||
package flags
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/leaanthony/slicer"
|
||||
"github.com/pterm/pterm"
|
||||
"github.com/wailsapp/wails/v2/internal/system"
|
||||
)
|
||||
|
||||
type Common struct {
|
||||
NoColour bool `description:"Disable colour in output"`
|
||||
}
|
||||
|
||||
type Target struct {
|
||||
Platform string
|
||||
Arch string
|
||||
}
|
||||
|
||||
func defaultTarget() Target {
|
||||
defaultPlatform := os.Getenv("GOOS")
|
||||
if defaultPlatform == "" {
|
||||
defaultPlatform = runtime.GOOS
|
||||
}
|
||||
defaultArch := os.Getenv("GOARCH")
|
||||
if defaultArch == "" {
|
||||
if system.IsAppleSilicon {
|
||||
defaultArch = "arm64"
|
||||
} else {
|
||||
defaultArch = runtime.GOARCH
|
||||
}
|
||||
}
|
||||
|
||||
return Target{
|
||||
Platform: defaultPlatform,
|
||||
Arch: defaultArch,
|
||||
}
|
||||
}
|
||||
|
||||
type TargetsCollection []Target
|
||||
|
||||
func (c TargetsCollection) MacTargetsCount() int {
|
||||
count := 0
|
||||
|
||||
for _, t := range c {
|
||||
if strings.HasPrefix(t.Platform, "darwin") {
|
||||
count++
|
||||
}
|
||||
}
|
||||
|
||||
return count
|
||||
}
|
||||
|
||||
func (t Target) String() string {
|
||||
if t.Arch != "" {
|
||||
return fmt.Sprintf("%s/%s", t.Platform, t.Arch)
|
||||
}
|
||||
|
||||
return t.Platform
|
||||
}
|
||||
|
||||
func parseTargets(platform string) TargetsCollection {
|
||||
allowedPlatforms := map[string]bool{
|
||||
"windows": true,
|
||||
"linux": true,
|
||||
"darwin": true,
|
||||
}
|
||||
|
||||
if !allowedPlatforms[platform] {
|
||||
pterm.Error.Println("platform argument must be one of 'windows', 'linux', or 'darwin'")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
var result []Target
|
||||
var targets slicer.StringSlicer
|
||||
|
||||
targets.AddSlice(strings.Split(platform, ","))
|
||||
targets.Deduplicate()
|
||||
|
||||
targets.Each(func(platform string) {
|
||||
target := Target{
|
||||
Platform: "",
|
||||
Arch: "",
|
||||
}
|
||||
|
||||
platformSplit := strings.Split(platform, "/")
|
||||
|
||||
target.Platform = platformSplit[0]
|
||||
|
||||
if len(platformSplit) > 1 {
|
||||
target.Arch = platformSplit[1]
|
||||
} else {
|
||||
target.Arch = defaultTarget().Arch
|
||||
}
|
||||
|
||||
result = append(result, target)
|
||||
})
|
||||
|
||||
return result
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import (
|
|||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"github.com/samber/lo"
|
||||
"github.com/wailsapp/wails/v2/internal/project"
|
||||
|
|
@ -16,7 +17,6 @@ type Dev struct {
|
|||
BuildCommon
|
||||
|
||||
AssetDir string `flag:"assetdir" description:"Serve assets from the given directory instead of using the provided asset FS"`
|
||||
Platform string `flag:"platform" description:"Platform to target"`
|
||||
Extensions string `flag:"e" description:"Extensions to trigger rebuilds (comma separated) eg go"`
|
||||
ReloadDirs string `flag:"reloaddirs" description:"Additional directories to trigger reloads (comma separated)"`
|
||||
Browser bool `flag:"browser" description:"Open the application in a browser"`
|
||||
|
|
@ -38,13 +38,10 @@ type Dev struct {
|
|||
}
|
||||
|
||||
func (*Dev) Default() *Dev {
|
||||
target := defaultTarget()
|
||||
result := &Dev{
|
||||
Extensions: "go",
|
||||
Debounce: 100,
|
||||
Platform: target.Platform,
|
||||
}
|
||||
|
||||
result.BuildCommon = result.BuildCommon.Default()
|
||||
return result
|
||||
}
|
||||
|
|
@ -119,15 +116,13 @@ func (d *Dev) loadAndMergeProjectConfig() error {
|
|||
|
||||
// GenerateBuildOptions creates a build.Options using the flags
|
||||
func (d *Dev) GenerateBuildOptions() *build.Options {
|
||||
targets := parseTargets(d.Platform)
|
||||
|
||||
result := &build.Options{
|
||||
OutputType: "dev",
|
||||
Mode: build.Dev,
|
||||
Devtools: true,
|
||||
Arch: targets[0].Arch,
|
||||
Arch: runtime.GOARCH,
|
||||
Pack: true,
|
||||
Platform: targets[0].Platform,
|
||||
Platform: runtime.GOOS,
|
||||
LDFlags: d.LdFlags,
|
||||
Compiler: d.Compiler,
|
||||
ForceBuild: d.ForceBuild,
|
||||
|
|
|
|||
|
|
@ -125,6 +125,12 @@ func initProject(f *flags.Init) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// Change the module name to project name
|
||||
err = updateModuleNameToProjectName(options, quiet)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !f.CIMode {
|
||||
// Run `go mod tidy` to ensure `go.sum` is up to date
|
||||
cmd := exec.Command("go", "mod", "tidy")
|
||||
|
|
@ -276,3 +282,14 @@ func updateReplaceLine(targetPath string) {
|
|||
fatal(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func updateModuleNameToProjectName(options *templates.Options, quiet bool) error {
|
||||
cmd := exec.Command("go", "mod", "edit", "-module", options.ProjectName)
|
||||
cmd.Dir = options.TargetDir
|
||||
cmd.Stderr = os.Stderr
|
||||
if !quiet {
|
||||
cmd.Stdout = os.Stdout
|
||||
}
|
||||
|
||||
return cmd.Run()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,10 +60,12 @@ func Application(f *flags.Dev, logger *clilogger.CLILogger) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// Run go mod tidy to ensure we're up-to-date
|
||||
err = runCommand(cwd, false, f.Compiler, "mod", "tidy")
|
||||
if err != nil {
|
||||
return err
|
||||
if !f.SkipModTidy {
|
||||
// Run go mod tidy to ensure we're up-to-date
|
||||
err = runCommand(cwd, false, f.Compiler, "mod", "tidy")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
buildOptions := f.GenerateBuildOptions()
|
||||
|
|
@ -268,16 +270,6 @@ func runFrontendDevWatcherCommand(frontendDirectory string, devCommand string, d
|
|||
}, viteServerURL, viteVersion, nil
|
||||
}
|
||||
|
||||
func isWsl() bool {
|
||||
version, err := os.ReadFile("/proc/version")
|
||||
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return strings.Contains(strings.ToLower(string(version)), "wsl")
|
||||
}
|
||||
|
||||
// restartApp does the actual rebuilding of the application when files change
|
||||
func restartApp(buildOptions *build.Options, debugBinaryProcess *process.Process, f *flags.Dev, exitCodeChannel chan int, legacyUseDevServerInsteadofCustomScheme bool) (*process.Process, string, error) {
|
||||
appBinary, err := build.Build(buildOptions)
|
||||
|
|
@ -316,12 +308,6 @@ func restartApp(buildOptions *build.Options, debugBinaryProcess *process.Process
|
|||
os.Setenv("devserver", f.DevServer)
|
||||
os.Setenv("frontenddevserverurl", f.FrontendDevServerURL)
|
||||
|
||||
if buildOptions.IsWindowsTargetPlatform() && isWsl() {
|
||||
// In the case of building a Windows executable under WSL, we need to specify this variable with a list of
|
||||
// variables that will be passed through
|
||||
os.Setenv("WSLENV", "loglevel/w:frontenddevserverurl/w:devserver/w:assetdir/w")
|
||||
}
|
||||
|
||||
// Start up new binary with correct args
|
||||
newProcess := process.NewProcess(appBinary, args...)
|
||||
err = newProcess.Start(exitCodeChannel)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
v2.7.1
|
||||
v2.9.1
|
||||
|
|
@ -9,6 +9,7 @@ require github.com/wailsapp/wails/v2 v2.1.0
|
|||
require (
|
||||
github.com/bep/debounce v1.2.1 // indirect
|
||||
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||
github.com/godbus/dbus/v5 v5.1.0 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
|
||||
github.com/labstack/echo/v4 v4.10.2 // indirect
|
||||
|
|
@ -28,11 +29,11 @@ require (
|
|||
github.com/valyala/fasttemplate v1.2.2 // indirect
|
||||
github.com/wailsapp/go-webview2 v1.0.10 // indirect
|
||||
github.com/wailsapp/mimetype v1.4.1 // indirect
|
||||
golang.org/x/crypto v0.14.0 // indirect
|
||||
golang.org/x/crypto v0.17.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
|
||||
golang.org/x/net v0.17.0 // indirect
|
||||
golang.org/x/sys v0.13.0 // indirect
|
||||
golang.org/x/text v0.13.0 // indirect
|
||||
golang.org/x/sys v0.15.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
)
|
||||
|
||||
replace github.com/wailsapp/wails/v2 v2.1.0 => ../..
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ 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/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
|
||||
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
|
||||
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e h1:Q3+PugElBCf4PFpxhErSzU3/PY5sFL5Z6rfv4AbGAck=
|
||||
|
|
@ -47,6 +49,7 @@ github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXn
|
|||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/tkrajina/go-reflector v0.5.6 h1:hKQ0gyocG7vgMD2M3dRlYN6WBBOmdoOzJ6njQSepKdE=
|
||||
github.com/tkrajina/go-reflector v0.5.6/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4=
|
||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||
|
|
@ -54,13 +57,12 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC
|
|||
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
||||
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
|
||||
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
||||
github.com/wailsapp/go-webview2 v1.0.7 h1:s95+7irJsAsTy1RsjJ6N0cYX7tZ4gP7Uzawds0L2urs=
|
||||
github.com/wailsapp/go-webview2 v1.0.7/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
|
||||
github.com/wailsapp/go-webview2 v1.0.10 h1:PP5Hug6pnQEAhfRzLCoOh2jJaPdrqeRgJKZhyYyDV/w=
|
||||
github.com/wailsapp/go-webview2 v1.0.10/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
|
||||
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
|
||||
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
|
||||
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
|
||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
|
||||
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc=
|
||||
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
|
||||
golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
|
|
@ -76,14 +78,15 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
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/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
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.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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=
|
||||
|
|
|
|||
41
v2/go.mod
41
v2/go.mod
|
|
@ -2,8 +2,6 @@ module github.com/wailsapp/wails/v2
|
|||
|
||||
go 1.21
|
||||
|
||||
toolchain go1.22.0
|
||||
|
||||
require (
|
||||
github.com/Masterminds/semver v1.5.0
|
||||
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
|
||||
|
|
@ -12,7 +10,7 @@ require (
|
|||
github.com/charmbracelet/glamour v0.5.0
|
||||
github.com/flytam/filenamify v1.0.0
|
||||
github.com/fsnotify/fsnotify v1.4.9
|
||||
github.com/go-git/go-git/v5 v5.3.0
|
||||
github.com/go-git/go-git/v5 v5.11.0
|
||||
github.com/go-ole/go-ole v1.2.6
|
||||
github.com/godbus/dbus/v5 v5.1.0
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
||||
|
|
@ -34,42 +32,45 @@ require (
|
|||
github.com/pterm/pterm v0.12.49
|
||||
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
|
||||
github.com/samber/lo v1.38.1
|
||||
github.com/stretchr/testify v1.8.1
|
||||
github.com/stretchr/testify v1.8.4
|
||||
github.com/tc-hib/winres v0.2.1
|
||||
github.com/tidwall/sjson v1.1.7
|
||||
github.com/tkrajina/go-reflector v0.5.6
|
||||
github.com/wailsapp/go-webview2 v1.0.10
|
||||
github.com/wailsapp/mimetype v1.4.1
|
||||
github.com/wzshiming/ctc v1.2.3
|
||||
golang.org/x/mod v0.12.0
|
||||
golang.org/x/net v0.17.0
|
||||
golang.org/x/sys v0.13.0
|
||||
golang.org/x/tools v0.6.0
|
||||
golang.org/x/mod v0.14.0
|
||||
golang.org/x/net v0.25.0
|
||||
golang.org/x/sys v0.20.0
|
||||
golang.org/x/tools v0.17.0
|
||||
)
|
||||
|
||||
require (
|
||||
atomicgo.dev/cursor v0.1.1 // indirect
|
||||
atomicgo.dev/keyboard v0.2.8 // indirect
|
||||
bitbucket.org/creachadair/shell v0.0.7 // indirect
|
||||
github.com/Microsoft/go-winio v0.4.16 // indirect
|
||||
dario.cat/mergo v1.0.0 // indirect
|
||||
github.com/Microsoft/go-winio v0.6.1 // indirect
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
|
||||
github.com/StackExchange/wmi v1.2.1 // indirect
|
||||
github.com/alecthomas/chroma v0.10.0 // indirect
|
||||
github.com/aymerick/douceur v0.2.0 // indirect
|
||||
github.com/cloudflare/circl v1.3.7 // indirect
|
||||
github.com/containerd/console v1.0.3 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/dlclark/regexp2 v1.4.0 // indirect
|
||||
github.com/emirpasic/gods v1.12.0 // indirect
|
||||
github.com/emirpasic/gods v1.18.1 // indirect
|
||||
github.com/ghodss/yaml v1.0.0 // indirect
|
||||
github.com/go-git/gcfg v1.5.0 // indirect
|
||||
github.com/go-git/go-billy/v5 v5.2.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/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/gookit/color v1.5.2 // indirect
|
||||
github.com/gorilla/css v1.0.0 // indirect
|
||||
github.com/imdario/mergo v0.3.12 // indirect
|
||||
github.com/jaypipes/pcidb v1.0.0 // indirect
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
|
||||
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
|
||||
github.com/kr/pretty v0.3.0 // indirect
|
||||
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
||||
github.com/lithammer/fuzzysearch v1.1.5 // indirect
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
|
|
@ -81,24 +82,26 @@ require (
|
|||
github.com/muesli/termenv v0.9.0 // indirect
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
|
||||
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
||||
github.com/pjbgf/sha1cd v0.3.0 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/rivo/uniseg v0.4.4 // indirect
|
||||
github.com/sergi/go-diff v1.2.0 // indirect
|
||||
github.com/skeema/knownhosts v1.2.1 // indirect
|
||||
github.com/tidwall/gjson v1.9.3 // indirect
|
||||
github.com/tidwall/match v1.1.1 // indirect
|
||||
github.com/tidwall/pretty v1.2.0 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasttemplate v1.2.2 // indirect
|
||||
github.com/wzshiming/winseq v0.0.0-20200112104235-db357dc107ae // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.0 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
|
||||
github.com/yuin/goldmark v1.4.13 // indirect
|
||||
github.com/yuin/goldmark-emoji v1.0.1 // indirect
|
||||
golang.org/x/crypto v0.14.0 // indirect
|
||||
golang.org/x/crypto v0.23.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
|
||||
golang.org/x/image v0.12.0 // indirect
|
||||
golang.org/x/term v0.13.0 // indirect
|
||||
golang.org/x/text v0.13.0 // indirect
|
||||
golang.org/x/term v0.20.0 // indirect
|
||||
golang.org/x/text v0.15.0 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
|
|
|
|||
153
v2/go.sum
153
v2/go.sum
|
|
@ -4,6 +4,8 @@ atomicgo.dev/keyboard v0.2.8 h1:Di09BitwZgdTV1hPyX/b9Cqxi8HVuJQwWivnZUEqlj4=
|
|||
atomicgo.dev/keyboard v0.2.8/go.mod h1:BC4w9g00XkxH/f1HXhW2sXmJFOCWbKn9xrOunSFtExQ=
|
||||
bitbucket.org/creachadair/shell v0.0.7 h1:Z96pB6DkSb7F3Y3BBnJeOZH2gazyMTWlvecSD4vDqfk=
|
||||
bitbucket.org/creachadair/shell v0.0.7/go.mod h1:oqtXSSvSYr4624lnnabXHaBsYW6RD80caLi2b3hJk0U=
|
||||
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
|
||||
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
|
||||
github.com/MarvinJWendt/testza v0.1.0/go.mod h1:7AxNvlfeHP7Z/hDQ5JtE3OKYT3XFUeLCDE2DQninSqs=
|
||||
github.com/MarvinJWendt/testza v0.2.1/go.mod h1:God7bhG8n6uQxwdScay+gjm9/LnO4D3kkcZX4hv9Rp8=
|
||||
github.com/MarvinJWendt/testza v0.2.8/go.mod h1:nwIcjmr0Zz+Rcwfh3/4UhBp7ePKVhuBExvZqnKYWlII=
|
||||
|
|
@ -12,21 +14,22 @@ github.com/MarvinJWendt/testza v0.2.12/go.mod h1:JOIegYyV7rX+7VZ9r77L/eH6CfJHHzX
|
|||
github.com/MarvinJWendt/testza v0.3.0/go.mod h1:eFcL4I0idjtIx8P9C6KkAuLgATNKpX4/2oUqKc6bF2c=
|
||||
github.com/MarvinJWendt/testza v0.4.2/go.mod h1:mSdhXiKH8sg/gQehJ63bINcCKp7RtYewEjXsvsVUPbE=
|
||||
github.com/MarvinJWendt/testza v0.4.3 h1:u2XaM4IqGp9dsdUmML8/Z791fu4yjQYzOiufOtJwTII=
|
||||
github.com/MarvinJWendt/testza v0.4.3/go.mod h1:CpXaOfceNEYnLDtNIyTrPPcCpDJYqzZnu2aiA2Wp33U=
|
||||
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
|
||||
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
|
||||
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
|
||||
github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk=
|
||||
github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
|
||||
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
|
||||
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
|
||||
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg=
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
|
||||
github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA=
|
||||
github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8=
|
||||
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=
|
||||
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo=
|
||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
|
||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
|
||||
github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek=
|
||||
github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
||||
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/atomicgo/cursor v0.0.1/go.mod h1:cBON2QmmrysudxNBFthvMtN32r3jxVRIvzkUiF/RuIk=
|
||||
|
|
@ -36,46 +39,52 @@ github.com/bep/debounce v1.2.1 h1:v67fRdBA9UQu2NhLFXrSg0Brw7CexQekrBwDMM8bzeY=
|
|||
github.com/bep/debounce v1.2.1/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0=
|
||||
github.com/bitfield/script v0.19.0 h1:W24f+FQuPab9gXcW8bhcbo5qO8AtrXyu3XOnR4zhHN0=
|
||||
github.com/bitfield/script v0.19.0/go.mod h1:ana6F8YOSZ3ImT8SauIzuYSqXgFVkSUJ6kgja+WMmIY=
|
||||
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
|
||||
github.com/charmbracelet/glamour v0.5.0 h1:wu15ykPdB7X6chxugG/NNfDUbyyrCLV9XBalj5wdu3g=
|
||||
github.com/charmbracelet/glamour v0.5.0/go.mod h1:9ZRtG19AUIzcTm7FGLGbq3D5WKQ5UyZBbQsMQN0XIqc=
|
||||
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
|
||||
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
|
||||
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
|
||||
github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw=
|
||||
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
|
||||
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
|
||||
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/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
|
||||
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
|
||||
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
|
||||
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
|
||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
||||
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/flytam/filenamify v1.0.0 h1:ewx6BY2dj7U6h2zGPJmt33q/BjkSf/YsY/woQvnUNIs=
|
||||
github.com/flytam/filenamify v1.0.0/go.mod h1:Dzf9kVycwcsBlr2ATg6uxjqiFgKGH+5SKFuhdeP5zu8=
|
||||
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/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
|
||||
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
||||
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
|
||||
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
|
||||
github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
|
||||
github.com/go-git/go-billy/v5 v5.1.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
|
||||
github.com/go-git/go-billy/v5 v5.2.0 h1:GcoouCP9J+5slw2uXAocL70z8ml4A8B/H8nEPt6CLPk=
|
||||
github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
|
||||
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12 h1:PbKy9zOy4aAKrJ5pibIRpVO2BXnK1Tlcg+caKI7Ox5M=
|
||||
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
|
||||
github.com/go-git/go-git/v5 v5.3.0 h1:8WKMtJR2j8RntEXR/uvTKagfEt4GYlwQ7mntE4+0GWc=
|
||||
github.com/go-git/go-git/v5 v5.3.0/go.mod h1:xdX4bWJ48aOrdhnl2XqHYstHbbp6+LFS4r4X+lNVprw=
|
||||
github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
|
||||
github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4=
|
||||
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.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4=
|
||||
github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY=
|
||||
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
|
||||
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
|
||||
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
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.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
|
||||
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/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
|
||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||
|
|
@ -86,8 +95,6 @@ github.com/gookit/color v1.5.2 h1:uLnfXcaFjlrDnQDT+NCBcfhrXqYTx/rcCa6xn01Y8yI=
|
|||
github.com/gookit/color v1.5.2/go.mod h1:w8h4bGiHeeBpvQVePTutdbERIUf3oJE5lZ8HM0UgXyg=
|
||||
github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=
|
||||
github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c=
|
||||
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/jackmordaunt/icns v1.0.0 h1:RYSxplerf/l/DUd09AHtITwckkv/mqjVv4DjYdPmAMQ=
|
||||
github.com/jackmordaunt/icns v1.0.0/go.mod h1:7TTQVEuGzVVfOPPlLNHJIkzA6CoV7aH1Dv9dW351oOo=
|
||||
github.com/jaypipes/ghw v0.12.0 h1:xU2/MDJfWmBhJnujHY9qwXQLs3DBsf0/Xa9vECY0Tho=
|
||||
|
|
@ -99,18 +106,16 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i
|
|||
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e h1:Q3+PugElBCf4PFpxhErSzU3/PY5sFL5Z6rfv4AbGAck=
|
||||
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e/go.mod h1:alcuEEnZsY1WQsagKhZDsoPCRoOijYqhZvPwLG0kzVs=
|
||||
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
|
||||
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck=
|
||||
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
|
||||
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/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/klauspost/cpuid/v2 v2.0.10/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
|
||||
github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
|
||||
github.com/klauspost/cpuid/v2 v2.1.0 h1:eyi1Ad2aNJMW95zcSbmGg7Cg6cq3ADwLpMAP96d8rF0=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/klauspost/cpuid/v2 v2.1.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
||||
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=
|
||||
|
|
@ -163,12 +168,14 @@ github.com/muesli/termenv v0.9.0 h1:wnbOaGz+LUR3jNT0zOzinPnyDaCZUQRZj9GxK8eRVl8=
|
|||
github.com/muesli/termenv v0.9.0/go.mod h1:R/LzAKf+suGs4IsO95y7+7DpFHO0KABgnZqtlyx2mBw=
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
|
||||
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
|
||||
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/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
|
||||
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
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=
|
||||
|
|
@ -186,28 +193,27 @@ github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ
|
|||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
|
||||
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
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/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
|
||||
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
|
||||
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
|
||||
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
|
||||
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
|
||||
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ=
|
||||
github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
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.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/tc-hib/winres v0.2.1 h1:YDE0FiP0VmtRaDn7+aaChp1KiF4owBiJa5l964l5ujA=
|
||||
github.com/tc-hib/winres v0.2.1/go.mod h1:C/JaNhH3KBvhNKVbvdlDWkbMDO9H4fKKDaN7/07SSuk=
|
||||
github.com/tidwall/gjson v1.8.0/go.mod h1:5/xDoumyyDNerp2U36lyolv46b3uF/9Bu6OfyQ9GImk=
|
||||
|
|
@ -236,8 +242,8 @@ github.com/wzshiming/ctc v1.2.3 h1:q+hW3IQNsjIlOFBTGZZZeIXTElFM4grF4spW/errh/c=
|
|||
github.com/wzshiming/ctc v1.2.3/go.mod h1:2tVAtIY7SUyraSk0JxvwmONNPFL4ARavPuEsg5+KA28=
|
||||
github.com/wzshiming/winseq v0.0.0-20200112104235-db357dc107ae h1:tpXvBXC3hpQBDCc9OojJZCQMVRAbT3TTdUMP8WguXkY=
|
||||
github.com/wzshiming/winseq v0.0.0-20200112104235-db357dc107ae/go.mod h1:VTAq37rkGeV+WOybvZwjXiJOicICdpLCN8ifpISjK20=
|
||||
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
|
||||
github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0=
|
||||
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/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8=
|
||||
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
|
|
@ -246,12 +252,13 @@ github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=
|
|||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yuin/goldmark-emoji v1.0.1 h1:ctuWEyzGBwiucEqxzwe0SOYDXPAucOrE9NQC18Wa1os=
|
||||
github.com/yuin/goldmark-emoji v1.0.1/go.mod h1:2w1E6FEWLcDQkoTE+7HU6QF1F6SLlNGjRIBbIZQFqkQ=
|
||||
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
|
||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||
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.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc=
|
||||
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
|
||||
golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
|
|
@ -259,34 +266,33 @@ golang.org/x/image v0.12.0 h1:w13vZbU4o5rKOFFR8y7M+c4A5jXDC0uXTdHYRP8X2DQ=
|
|||
golang.org/x/image v0.12.0/go.mod h1:Lu90jvHG7GfemOIcldsh9A2hS01ocl6oNO7ype5mEnk=
|
||||
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/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
|
||||
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
|
||||
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
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-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
|
||||
golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
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.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
|
||||
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
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 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
|
||||
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/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-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/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=
|
||||
|
|
@ -297,47 +303,52 @@ golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/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.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
golang.org/x/sys v0.20.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-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
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.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
|
||||
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
|
||||
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
|
||||
golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
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.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
|
||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
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 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc=
|
||||
golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/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-20200227125254-8fa46927fb4f/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/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
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.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
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=
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ export namespace binding_test {
|
|||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export namespace binding_test {
|
|||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ export namespace binding_test {
|
|||
return a;
|
||||
}
|
||||
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export namespace binding_test {
|
|||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
@ -62,7 +62,7 @@ export namespace binding_test_import {
|
|||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export namespace binding_test {
|
|||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
@ -62,7 +62,7 @@ export namespace binding_test_import {
|
|||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export namespace binding_test {
|
|||
return a;
|
||||
}
|
||||
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
@ -63,7 +63,7 @@ export namespace binding_test_import {
|
|||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export namespace binding_test {
|
|||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
package binding_test
|
||||
|
||||
type WithoutFields struct {
|
||||
}
|
||||
|
||||
func (s WithoutFields) Get() WithoutFields {
|
||||
return s
|
||||
}
|
||||
|
||||
var WithoutFieldsTest = BindingTest{
|
||||
name: "StructWithoutFields",
|
||||
structs: []interface{}{
|
||||
&WithoutFields{},
|
||||
},
|
||||
exemptions: nil,
|
||||
shouldError: false,
|
||||
want: `
|
||||
export namespace binding_test {
|
||||
|
||||
export class WithoutFields {
|
||||
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new WithoutFields(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}`,
|
||||
}
|
||||
|
|
@ -47,7 +47,9 @@ func TestBindings_GenerateModels(t *testing.T) {
|
|||
AnonymousSubStructTest,
|
||||
AnonymousSubStructMultiLevelTest,
|
||||
GeneratedJsEntityWithNestedStructTest,
|
||||
EntityWithDiffNamespaces,
|
||||
EntityWithDiffNamespacesTest,
|
||||
SpecialCharacterFieldTest,
|
||||
WithoutFieldsTest,
|
||||
}
|
||||
|
||||
testLogger := &logger.Logger{}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ export namespace binding_test {
|
|||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
@ -140,7 +140,7 @@ type ChildPackageEntity struct {
|
|||
ImportedPackage binding_test_import.AWrapper `json:"importedPackage"`
|
||||
}
|
||||
|
||||
var EntityWithDiffNamespaces = BindingTest{
|
||||
var EntityWithDiffNamespacesTest = BindingTest{
|
||||
name: "EntityWithDiffNamespaces ",
|
||||
structs: []interface{}{
|
||||
&ParentPackageEntity{},
|
||||
|
|
@ -172,7 +172,7 @@ export namespace binding_test {
|
|||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
@ -204,7 +204,7 @@ export namespace binding_test {
|
|||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
@ -239,7 +239,7 @@ export namespace binding_test {
|
|||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
package binding_test
|
||||
|
||||
type SpecialCharacterField struct {
|
||||
ID string `json:"@ID,omitempty"`
|
||||
}
|
||||
|
||||
func (s SpecialCharacterField) Get() SpecialCharacterField {
|
||||
return s
|
||||
}
|
||||
|
||||
var SpecialCharacterFieldTest = BindingTest{
|
||||
name: "SpecialCharacterField",
|
||||
structs: []interface{}{
|
||||
&SpecialCharacterField{},
|
||||
},
|
||||
exemptions: nil,
|
||||
shouldError: false,
|
||||
want: `
|
||||
export namespace binding_test {
|
||||
export class SpecialCharacterField {
|
||||
"@ID"?: string;
|
||||
static createFrom(source: any = {}) {
|
||||
return new SpecialCharacterField(source);
|
||||
}
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this["@ID"] = source["@ID"];
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ func isFunction(value interface{}) bool {
|
|||
return reflect.ValueOf(value).Kind() == reflect.Func
|
||||
}
|
||||
|
||||
// isStructPtr returns true if the value given is a struct
|
||||
// isStruct returns true if the value given is a struct
|
||||
func isStruct(value interface{}) bool {
|
||||
return reflect.ValueOf(value).Kind() == reflect.Struct
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#import "AppDelegate.h"
|
||||
#import "message.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
-(BOOL)application:(NSApplication *)sender openFile:(NSString *)filename
|
||||
|
|
@ -22,6 +23,11 @@
|
|||
return NO;
|
||||
}
|
||||
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
|
||||
processMessage("Q");
|
||||
return NSTerminateCancel;
|
||||
}
|
||||
|
||||
- (void)applicationWillFinishLaunching:(NSNotification *)aNotification {
|
||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||
if (self.alwaysOnTop) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#define WindowStartsMinimised 2
|
||||
#define WindowStartsFullscreen 3
|
||||
|
||||
WailsContext* Create(const char* title, int width, int height, int frameless, int resizable, int fullscreen, int fullSizeContent, int hideTitleBar, int titlebarAppearsTransparent, int hideTitle, int useToolbar, int hideToolbarSeparator, int webviewIsTransparent, int alwaysOnTop, int hideWindowOnClose, const char *appearance, int windowIsTranslucent, int devtoolsEnabled, int defaultContextMenuEnabled, int windowStartState, int startsHidden, int minWidth, int minHeight, int maxWidth, int maxHeight, bool fraudulentWebsiteWarningEnabled, struct Preferences preferences, int singleInstanceEnabled, const char* singleInstanceUniqueId);
|
||||
WailsContext* Create(const char* title, int width, int height, int frameless, int resizable, int zoomable, int fullscreen, int fullSizeContent, int hideTitleBar, int titlebarAppearsTransparent, int hideTitle, int useToolbar, int hideToolbarSeparator, int webviewIsTransparent, int alwaysOnTop, int hideWindowOnClose, const char *appearance, int windowIsTranslucent, int devtoolsEnabled, int defaultContextMenuEnabled, int windowStartState, int startsHidden, int minWidth, int minHeight, int maxWidth, int maxHeight, bool fraudulentWebsiteWarningEnabled, struct Preferences preferences, int singleInstanceEnabled, const char* singleInstanceUniqueId, bool enableDragAndDrop, bool disableWebViewDragAndDrop);
|
||||
void Run(void*, const char* url);
|
||||
|
||||
void SetTitle(void* ctx, const char *title);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#import "WailsMenu.h"
|
||||
#import "WailsMenuItem.h"
|
||||
|
||||
WailsContext* Create(const char* title, int width, int height, int frameless, int resizable, int fullscreen, int fullSizeContent, int hideTitleBar, int titlebarAppearsTransparent, int hideTitle, int useToolbar, int hideToolbarSeparator, int webviewIsTransparent, int alwaysOnTop, int hideWindowOnClose, const char *appearance, int windowIsTranslucent, int devtoolsEnabled, int defaultContextMenuEnabled, int windowStartState, int startsHidden, int minWidth, int minHeight, int maxWidth, int maxHeight, bool fraudulentWebsiteWarningEnabled, struct Preferences preferences, int singleInstanceLockEnabled, const char* singleInstanceUniqueId) {
|
||||
WailsContext* Create(const char* title, int width, int height, int frameless, int resizable, int zoomable, int fullscreen, int fullSizeContent, int hideTitleBar, int titlebarAppearsTransparent, int hideTitle, int useToolbar, int hideToolbarSeparator, int webviewIsTransparent, int alwaysOnTop, int hideWindowOnClose, const char *appearance, int windowIsTranslucent, int devtoolsEnabled, int defaultContextMenuEnabled, int windowStartState, int startsHidden, int minWidth, int minHeight, int maxWidth, int maxHeight, bool fraudulentWebsiteWarningEnabled, struct Preferences preferences, int singleInstanceLockEnabled, const char* singleInstanceUniqueId, bool enableDragAndDrop, bool disableWebViewDragAndDrop) {
|
||||
|
||||
[NSApplication sharedApplication];
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ WailsContext* Create(const char* title, int width, int height, int frameless, in
|
|||
fullscreen = 1;
|
||||
}
|
||||
|
||||
[result CreateWindow:width :height :frameless :resizable :fullscreen :fullSizeContent :hideTitleBar :titlebarAppearsTransparent :hideTitle :useToolbar :hideToolbarSeparator :webviewIsTransparent :hideWindowOnClose :safeInit(appearance) :windowIsTranslucent :minWidth :minHeight :maxWidth :maxHeight :fraudulentWebsiteWarningEnabled :preferences];
|
||||
[result CreateWindow:width :height :frameless :resizable :zoomable :fullscreen :fullSizeContent :hideTitleBar :titlebarAppearsTransparent :hideTitle :useToolbar :hideToolbarSeparator :webviewIsTransparent :hideWindowOnClose :safeInit(appearance) :windowIsTranslucent :minWidth :minHeight :maxWidth :maxHeight :fraudulentWebsiteWarningEnabled :preferences :enableDragAndDrop :disableWebViewDragAndDrop];
|
||||
[result SetTitle:safeInit(title)];
|
||||
[result Center];
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <WebKit/WebKit.h>
|
||||
#import "WailsWebView.h"
|
||||
|
||||
#if __has_include(<UniformTypeIdentifiers/UTType.h>)
|
||||
#define USE_NEW_FILTERS
|
||||
|
|
@ -32,7 +33,7 @@
|
|||
@interface WailsContext : NSObject <WKURLSchemeHandler,WKScriptMessageHandler,WKNavigationDelegate,WKUIDelegate>
|
||||
|
||||
@property (retain) WailsWindow* mainWindow;
|
||||
@property (retain) WKWebView* webview;
|
||||
@property (retain) WailsWebView* webview;
|
||||
@property (nonatomic, assign) id appdelegate;
|
||||
|
||||
@property bool hideOnClose;
|
||||
|
|
@ -64,7 +65,7 @@ struct Preferences {
|
|||
bool *fullscreenEnabled;
|
||||
};
|
||||
|
||||
- (void) CreateWindow:(int)width :(int)height :(bool)frameless :(bool)resizable :(bool)fullscreen :(bool)fullSizeContent :(bool)hideTitleBar :(bool)titlebarAppearsTransparent :(bool)hideTitle :(bool)useToolbar :(bool)hideToolbarSeparator :(bool)webviewIsTransparent :(bool)hideWindowOnClose :(NSString *)appearance :(bool)windowIsTranslucent :(int)minWidth :(int)minHeight :(int)maxWidth :(int)maxHeight :(bool)fraudulentWebsiteWarningEnabled :(struct Preferences)preferences;
|
||||
- (void) CreateWindow:(int)width :(int)height :(bool)frameless :(bool)resizable :(bool)zoomable :(bool)fullscreen :(bool)fullSizeContent :(bool)hideTitleBar :(bool)titlebarAppearsTransparent :(bool)hideTitle :(bool)useToolbar :(bool)hideToolbarSeparator :(bool)webviewIsTransparent :(bool)hideWindowOnClose :(NSString *)appearance :(bool)windowIsTranslucent :(int)minWidth :(int)minHeight :(int)maxWidth :(int)maxHeight :(bool)fraudulentWebsiteWarningEnabled :(struct Preferences)preferences :(bool)enableDragAndDrop :(bool)disableWebViewDragAndDrop;
|
||||
- (void) SetSize:(int)width :(int)height;
|
||||
- (void) SetPosition:(int)x :(int) y;
|
||||
- (void) SetMinSize:(int)minWidth :(int)minHeight;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
//go:build darwin
|
||||
//
|
||||
// WailsContext.m
|
||||
// test
|
||||
|
|
@ -11,6 +10,7 @@
|
|||
#import "WailsContext.h"
|
||||
#import "WailsAlert.h"
|
||||
#import "WailsMenu.h"
|
||||
#import "WailsWebView.h"
|
||||
#import "WindowDelegate.h"
|
||||
#import "message.h"
|
||||
#import "Role.h"
|
||||
|
|
@ -39,9 +39,9 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
@implementation WailsContext
|
||||
|
||||
- (void) SetSize:(int)width :(int)height {
|
||||
|
||||
|
||||
if (self.shuttingDown) return;
|
||||
|
||||
|
||||
NSRect frame = [self.mainWindow frame];
|
||||
frame.origin.y += frame.size.height - height;
|
||||
frame.size.width = width;
|
||||
|
|
@ -50,22 +50,22 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
}
|
||||
|
||||
- (void) SetPosition:(int)x :(int)y {
|
||||
|
||||
|
||||
if (self.shuttingDown) return;
|
||||
|
||||
|
||||
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;
|
||||
|
||||
|
||||
[self.mainWindow setFrame:windowFrame display:TRUE animate:FALSE];
|
||||
}
|
||||
|
||||
- (void) SetMinSize:(int)minWidth :(int)minHeight {
|
||||
|
||||
|
||||
if (self.shuttingDown) return;
|
||||
|
||||
|
||||
NSSize size = { minWidth, minHeight };
|
||||
self.mainWindow.userMinSize = size;
|
||||
[self.mainWindow setMinSize:size];
|
||||
|
|
@ -74,14 +74,14 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
|
||||
|
||||
- (void) SetMaxSize:(int)maxWidth :(int)maxHeight {
|
||||
|
||||
|
||||
if (self.shuttingDown) return;
|
||||
|
||||
|
||||
NSSize size = { FLT_MAX, FLT_MAX };
|
||||
|
||||
|
||||
size.width = maxWidth > 0 ? maxWidth : FLT_MAX;
|
||||
size.height = maxHeight > 0 ? maxHeight : FLT_MAX;
|
||||
|
||||
|
||||
self.mainWindow.userMaxSize = size;
|
||||
[self.mainWindow setMaxSize:size];
|
||||
[self adjustWindowSize];
|
||||
|
|
@ -89,18 +89,18 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
|
||||
|
||||
- (void) adjustWindowSize {
|
||||
|
||||
|
||||
if (self.shuttingDown) return;
|
||||
|
||||
|
||||
NSRect currentFrame = [self.mainWindow frame];
|
||||
|
||||
|
||||
if ( currentFrame.size.width > self.mainWindow.userMaxSize.width ) currentFrame.size.width = self.mainWindow.userMaxSize.width;
|
||||
if ( currentFrame.size.width < self.mainWindow.userMinSize.width ) currentFrame.size.width = self.mainWindow.userMinSize.width;
|
||||
if ( currentFrame.size.height > self.mainWindow.userMaxSize.height ) currentFrame.size.height = self.mainWindow.userMaxSize.height;
|
||||
if ( currentFrame.size.height < self.mainWindow.userMinSize.height ) currentFrame.size.height = self.mainWindow.userMinSize.height;
|
||||
|
||||
[self.mainWindow setFrame:currentFrame display:YES animate:FALSE];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void) dealloc {
|
||||
|
|
@ -136,16 +136,16 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
return NO;
|
||||
}
|
||||
|
||||
- (void) CreateWindow:(int)width :(int)height :(bool)frameless :(bool)resizable :(bool)fullscreen :(bool)fullSizeContent :(bool)hideTitleBar :(bool)titlebarAppearsTransparent :(bool)hideTitle :(bool)useToolbar :(bool)hideToolbarSeparator :(bool)webviewIsTransparent :(bool)hideWindowOnClose :(NSString*)appearance :(bool)windowIsTranslucent :(int)minWidth :(int)minHeight :(int)maxWidth :(int)maxHeight :(bool)fraudulentWebsiteWarningEnabled :(struct Preferences)preferences {
|
||||
- (void) CreateWindow:(int)width :(int)height :(bool)frameless :(bool)resizable :(bool)zoomable :(bool)fullscreen :(bool)fullSizeContent :(bool)hideTitleBar :(bool)titlebarAppearsTransparent :(bool)hideTitle :(bool)useToolbar :(bool)hideToolbarSeparator :(bool)webviewIsTransparent :(bool)hideWindowOnClose :(NSString*)appearance :(bool)windowIsTranslucent :(int)minWidth :(int)minHeight :(int)maxWidth :(int)maxHeight :(bool)fraudulentWebsiteWarningEnabled :(struct Preferences)preferences :(bool)enableDragAndDrop :(bool)disableWebViewDragAndDrop {
|
||||
NSWindowStyleMask styleMask = 0;
|
||||
|
||||
|
||||
if( !frameless ) {
|
||||
if (!hideTitleBar) {
|
||||
styleMask |= NSWindowStyleMaskTitled;
|
||||
}
|
||||
styleMask |= NSWindowStyleMaskClosable;
|
||||
}
|
||||
|
||||
|
||||
styleMask |= NSWindowStyleMaskMiniaturizable;
|
||||
|
||||
if( fullSizeContent || frameless || titlebarAppearsTransparent ) {
|
||||
|
|
@ -155,23 +155,22 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
if (resizable) {
|
||||
styleMask |= NSWindowStyleMaskResizable;
|
||||
}
|
||||
|
||||
|
||||
self.mainWindow = [[WailsWindow alloc] initWithContentRect:NSMakeRect(0, 0, width, height)
|
||||
styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
|
||||
|
||||
if (!frameless && useToolbar) {
|
||||
id toolbar = [[NSToolbar alloc] initWithIdentifier:@"wails.toolbar"];
|
||||
[toolbar autorelease];
|
||||
[toolbar setShowsBaselineSeparator:!hideToolbarSeparator];
|
||||
[self.mainWindow setToolbar:toolbar];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
[self.mainWindow setTitleVisibility:hideTitle];
|
||||
[self.mainWindow setTitlebarAppearsTransparent:titlebarAppearsTransparent];
|
||||
|
||||
|
||||
// [self.mainWindow canBecomeKeyWindow];
|
||||
|
||||
|
||||
id contentView = [self.mainWindow contentView];
|
||||
if (windowIsTranslucent) {
|
||||
NSVisualEffectView *effectView = [NSVisualEffectView alloc];
|
||||
|
|
@ -182,12 +181,17 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
[effectView setState:NSVisualEffectStateActive];
|
||||
[contentView addSubview:effectView positioned:NSWindowBelow relativeTo:nil];
|
||||
}
|
||||
|
||||
|
||||
if (appearance != nil) {
|
||||
NSAppearance *nsAppearance = [NSAppearance appearanceNamed:appearance];
|
||||
[self.mainWindow setAppearance:nsAppearance];
|
||||
}
|
||||
|
||||
|
||||
if (!zoomable && resizable) {
|
||||
NSButton *button = [self.mainWindow standardWindowButton:NSWindowZoomButton];
|
||||
[button setEnabled: NO];
|
||||
}
|
||||
|
||||
|
||||
NSSize minSize = { minWidth, minHeight };
|
||||
NSSize maxSize = { maxWidth, maxHeight };
|
||||
|
|
@ -199,16 +203,16 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
}
|
||||
self.mainWindow.userMaxSize = maxSize;
|
||||
self.mainWindow.userMinSize = minSize;
|
||||
|
||||
|
||||
if( !fullscreen ) {
|
||||
[self.mainWindow applyWindowConstraints];
|
||||
}
|
||||
|
||||
|
||||
WindowDelegate *windowDelegate = [WindowDelegate new];
|
||||
windowDelegate.hideOnClose = hideWindowOnClose;
|
||||
windowDelegate.ctx = self;
|
||||
[self.mainWindow setDelegate:windowDelegate];
|
||||
|
||||
|
||||
// Webview stuff here!
|
||||
WKWebViewConfiguration *config = [WKWebViewConfiguration new];
|
||||
config.suppressesIncrementalRendering = true;
|
||||
|
|
@ -258,25 +262,28 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
forMainFrameOnly:false];
|
||||
[userContentController addUserScript:initScript];
|
||||
}
|
||||
|
||||
self.webview = [WKWebView alloc];
|
||||
|
||||
self.webview = [WailsWebView alloc];
|
||||
self.webview.enableDragAndDrop = enableDragAndDrop;
|
||||
self.webview.disableWebViewDragAndDrop = disableWebViewDragAndDrop;
|
||||
|
||||
CGRect init = { 0,0,0,0 };
|
||||
[self.webview initWithFrame:init configuration:config];
|
||||
[contentView addSubview:self.webview];
|
||||
[self.webview setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable];
|
||||
CGRect contentViewBounds = [contentView bounds];
|
||||
[self.webview setFrame:contentViewBounds];
|
||||
|
||||
|
||||
if (webviewIsTransparent) {
|
||||
[self.webview setValue:[NSNumber numberWithBool:!webviewIsTransparent] forKey:@"drawsBackground"];
|
||||
}
|
||||
|
||||
|
||||
[self.webview setNavigationDelegate:self];
|
||||
self.webview.UIDelegate = self;
|
||||
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults setBool:FALSE forKey:@"NSAutomaticQuoteSubstitutionEnabled"];
|
||||
|
||||
|
||||
// Mouse monitors
|
||||
[NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskLeftMouseDown handler:^NSEvent * _Nullable(NSEvent * _Nonnull event) {
|
||||
id window = [event window];
|
||||
|
|
@ -285,7 +292,7 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
}
|
||||
return event;
|
||||
}];
|
||||
|
||||
|
||||
[NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskLeftMouseUp handler:^NSEvent * _Nullable(NSEvent * _Nonnull event) {
|
||||
id window = [event window];
|
||||
if (window == self.mainWindow) {
|
||||
|
|
@ -294,9 +301,9 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
}
|
||||
return event;
|
||||
}];
|
||||
|
||||
|
||||
self.applicationMenu = [NSMenu new];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (NSMenuItem*) newMenuItem :(NSString*)title :(SEL)selector :(NSString*)key :(NSEventModifierFlags)flags {
|
||||
|
|
@ -332,9 +339,9 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
float green = g/255.0;
|
||||
float blue = b/255.0;
|
||||
float alpha = a/255.0;
|
||||
|
||||
|
||||
id colour = [NSColor colorWithCalibratedRed:red green:green blue:blue alpha:alpha ];
|
||||
|
||||
|
||||
[self.mainWindow setBackgroundColor:colour];
|
||||
}
|
||||
|
||||
|
|
@ -430,9 +437,9 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
[self.webview evaluateJavaScript:script completionHandler:nil];
|
||||
}
|
||||
|
||||
- (void)webView:(WKWebView *)webView runOpenPanelWithParameters:(WKOpenPanelParameters *)parameters
|
||||
- (void)webView:(WKWebView *)webView runOpenPanelWithParameters:(WKOpenPanelParameters *)parameters
|
||||
initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSArray<NSURL *> * URLs))completionHandler {
|
||||
|
||||
|
||||
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
|
||||
openPanel.allowsMultipleSelection = parameters.allowsMultipleSelection;
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
|
||||
|
|
@ -440,7 +447,7 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
openPanel.canChooseDirectories = parameters.allowsDirectories;
|
||||
}
|
||||
#endif
|
||||
[openPanel
|
||||
[openPanel
|
||||
beginSheetModalForWindow:webView.window
|
||||
completionHandler:^(NSInteger result) {
|
||||
if (result == NSModalResponseOK)
|
||||
|
|
@ -471,7 +478,7 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
|
||||
- (void)userContentController:(nonnull WKUserContentController *)userContentController didReceiveScriptMessage:(nonnull WKScriptMessage *)message {
|
||||
NSString *m = message.body;
|
||||
|
||||
|
||||
// Check for drag
|
||||
if ( [m isEqualToString:@"drag"] ) {
|
||||
if( [self IsFullScreen] ) {
|
||||
|
|
@ -482,9 +489,9 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const char *_m = [m UTF8String];
|
||||
|
||||
|
||||
processMessage(_m);
|
||||
}
|
||||
|
||||
|
|
@ -493,7 +500,7 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
-(void) MessageDialog :(NSString*)dialogType :(NSString*)title :(NSString*)message :(NSString*)button1 :(NSString*)button2 :(NSString*)button3 :(NSString*)button4 :(NSString*)defaultButton :(NSString*)cancelButton :(void*)iconData :(int)iconDataLength {
|
||||
|
||||
WailsAlert *alert = [WailsAlert new];
|
||||
|
||||
|
||||
int style = NSAlertStyleInformational;
|
||||
if (dialogType != nil ) {
|
||||
if( [dialogType isEqualToString:@"warning"] ) {
|
||||
|
|
@ -510,12 +517,12 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
if( message != nil ) {
|
||||
[alert setInformativeText:message];
|
||||
}
|
||||
|
||||
|
||||
[alert addButton:button1 :defaultButton :cancelButton];
|
||||
[alert addButton:button2 :defaultButton :cancelButton];
|
||||
[alert addButton:button3 :defaultButton :cancelButton];
|
||||
[alert addButton:button4 :defaultButton :cancelButton];
|
||||
|
||||
|
||||
NSImage *icon = nil;
|
||||
if (iconData != nil) {
|
||||
NSData *imageData = [NSData dataWithBytes:iconData length:iconDataLength];
|
||||
|
|
@ -544,8 +551,8 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
}
|
||||
|
||||
-(void) OpenFileDialog :(NSString*)title :(NSString*)defaultFilename :(NSString*)defaultDirectory :(bool)allowDirectories :(bool)allowFiles :(bool)canCreateDirectories :(bool)treatPackagesAsDirectories :(bool)resolveAliases :(bool)showHiddenFiles :(bool)allowMultipleSelection :(NSString*)filters {
|
||||
|
||||
|
||||
|
||||
|
||||
// Create the dialog
|
||||
NSOpenPanel *dialog = [NSOpenPanel openPanel];
|
||||
|
||||
|
|
@ -585,7 +592,7 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
if( defaultFilename != nil ) {
|
||||
[dialog setNameFieldStringValue:defaultFilename];
|
||||
}
|
||||
|
||||
|
||||
[dialog setAllowsMultipleSelection: allowMultipleSelection];
|
||||
[dialog setShowsHiddenFiles: showHiddenFiles];
|
||||
|
||||
|
|
@ -621,19 +628,19 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
[nsjson release];
|
||||
[arr release];
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
-(void) SaveFileDialog :(NSString*)title :(NSString*)defaultFilename :(NSString*)defaultDirectory :(bool)canCreateDirectories :(bool)treatPackagesAsDirectories :(bool)showHiddenFiles :(NSString*)filters; {
|
||||
|
||||
|
||||
|
||||
|
||||
// Create the dialog
|
||||
NSSavePanel *dialog = [NSSavePanel savePanel];
|
||||
|
||||
// Do not hide extension
|
||||
[dialog setExtensionHidden:false];
|
||||
|
||||
|
||||
// Valid but appears to do nothing.... :/
|
||||
if( title != nil ) {
|
||||
[dialog setTitle:title];
|
||||
|
|
@ -674,7 +681,7 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
if( defaultFilename != nil ) {
|
||||
[dialog setNameFieldStringValue:defaultFilename];
|
||||
}
|
||||
|
||||
|
||||
// Default Directory
|
||||
if( defaultDirectory != nil ) {
|
||||
NSURL *url = [NSURL fileURLWithPath:defaultDirectory];
|
||||
|
|
@ -699,19 +706,19 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
}
|
||||
processSaveFileDialogResponse("");
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void) SetAbout :(NSString*)title :(NSString*)description :(void*)imagedata :(int)datalen {
|
||||
self.aboutTitle = title;
|
||||
self.aboutDescription = description;
|
||||
|
||||
|
||||
NSData *imageData = [NSData dataWithBytes:imagedata length:datalen];
|
||||
self.aboutImage = [[NSImage alloc] initWithData:imageData];
|
||||
}
|
||||
|
||||
-(void) About {
|
||||
|
||||
|
||||
WailsAlert *alert = [WailsAlert new];
|
||||
[alert setAlertStyle:NSAlertStyleInformational];
|
||||
if( self.aboutTitle != nil ) {
|
||||
|
|
@ -720,8 +727,8 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
|||
if( self.aboutDescription != nil ) {
|
||||
[alert setInformativeText:self.aboutDescription];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
[alert.window setLevel:NSFloatingWindowLevel];
|
||||
if ( self.aboutImage != nil) {
|
||||
[alert setIcon:self.aboutImage];
|
||||
|
|
|
|||
14
v2/internal/frontend/desktop/darwin/WailsWebView.h
Normal file
14
v2/internal/frontend/desktop/darwin/WailsWebView.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#ifndef WailsWebView_h
|
||||
#define WailsWebView_h
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <WebKit/WebKit.h>
|
||||
|
||||
// We will override WKWebView, so we can detect file drop in obj-c
|
||||
// and grab their file path, to then inject into JS
|
||||
@interface WailsWebView : WKWebView
|
||||
@property bool disableWebViewDragAndDrop;
|
||||
@property bool enableDragAndDrop;
|
||||
@end
|
||||
|
||||
#endif /* WailsWebView_h */
|
||||
122
v2/internal/frontend/desktop/darwin/WailsWebView.m
Normal file
122
v2/internal/frontend/desktop/darwin/WailsWebView.m
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
#import "WailsWebView.h"
|
||||
#import "message.h"
|
||||
|
||||
|
||||
@implementation WailsWebView
|
||||
@synthesize disableWebViewDragAndDrop;
|
||||
@synthesize enableDragAndDrop;
|
||||
|
||||
- (BOOL)prepareForDragOperation:(id<NSDraggingInfo>)sender
|
||||
{
|
||||
if ( !enableDragAndDrop ) {
|
||||
return [super prepareForDragOperation: sender];
|
||||
}
|
||||
|
||||
if ( disableWebViewDragAndDrop ) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
return [super prepareForDragOperation: sender];
|
||||
}
|
||||
|
||||
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
|
||||
{
|
||||
if ( !enableDragAndDrop ) {
|
||||
return [super performDragOperation: sender];
|
||||
}
|
||||
|
||||
NSPasteboard *pboard = [sender draggingPasteboard];
|
||||
|
||||
// if no types, then we'll just let the WKWebView handle the drag-n-drop as normal
|
||||
NSArray<NSPasteboardType> * types = [pboard types];
|
||||
if( !types )
|
||||
return [super performDragOperation: sender];
|
||||
|
||||
// getting all NSURL types
|
||||
NSArray<Class> *url_class = @[[NSURL class]];
|
||||
NSDictionary *options = @{};
|
||||
NSArray<NSURL*> *files = [pboard readObjectsForClasses:url_class options:options];
|
||||
|
||||
// collecting all file paths
|
||||
NSMutableArray *files_strs = [[NSMutableArray alloc] init];
|
||||
for (NSURL *url in files)
|
||||
{
|
||||
const char *fs_path = [url fileSystemRepresentation]; //Will be UTF-8 encoded
|
||||
NSString *fs_path_str = [[NSString alloc] initWithCString:fs_path encoding:NSUTF8StringEncoding];
|
||||
[files_strs addObject:fs_path_str];
|
||||
// NSLog( @"performDragOperation: file path: %s", fs_path );
|
||||
}
|
||||
|
||||
NSString *joined=[files_strs componentsJoinedByString:@"\n"];
|
||||
|
||||
// Release the array of file paths
|
||||
[files_strs release];
|
||||
|
||||
int dragXLocation = [sender draggingLocation].x - [self frame].origin.x;
|
||||
int dragYLocation = [self frame].size.height - [sender draggingLocation].y; // Y coordinate is inverted, so we need to subtract from the height
|
||||
|
||||
// NSLog( @"draggingUpdated: X coord: %d", dragXLocation );
|
||||
// NSLog( @"draggingUpdated: Y coord: %d", dragYLocation );
|
||||
|
||||
NSString *message = [NSString stringWithFormat:@"DD:%d:%d:%@", dragXLocation, dragYLocation, joined];
|
||||
|
||||
const char* res = message.UTF8String;
|
||||
|
||||
processMessage(res);
|
||||
|
||||
if ( disableWebViewDragAndDrop ) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
return [super performDragOperation: sender];
|
||||
}
|
||||
|
||||
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender {
|
||||
if ( !enableDragAndDrop ) {
|
||||
return [super draggingUpdated: sender];
|
||||
}
|
||||
|
||||
NSPasteboard *pboard = [sender draggingPasteboard];
|
||||
|
||||
// if no types, then we'll just let the WKWebView handle the drag-n-drop as normal
|
||||
NSArray<NSPasteboardType> * types = [pboard types];
|
||||
if( !types ) {
|
||||
return [super draggingUpdated: sender];
|
||||
}
|
||||
|
||||
if ( disableWebViewDragAndDrop ) {
|
||||
// we should call supper as otherwise events will not pass
|
||||
[super draggingUpdated: sender];
|
||||
|
||||
// pass NSDragOperationGeneric = 4 to show regular hover for drag and drop. As we want to ignore webkit behaviours that depends on webpage
|
||||
return 4;
|
||||
}
|
||||
|
||||
return [super draggingUpdated: sender];
|
||||
}
|
||||
|
||||
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender {
|
||||
if ( !enableDragAndDrop ) {
|
||||
return [super draggingEntered: sender];
|
||||
}
|
||||
|
||||
NSPasteboard *pboard = [sender draggingPasteboard];
|
||||
|
||||
// if no types, then we'll just let the WKWebView handle the drag-n-drop as normal
|
||||
NSArray<NSPasteboardType> * types = [pboard types];
|
||||
if( !types ) {
|
||||
return [super draggingEntered: sender];
|
||||
}
|
||||
|
||||
if ( disableWebViewDragAndDrop ) {
|
||||
// we should call supper as otherwise events will not pass
|
||||
[super draggingEntered: sender];
|
||||
|
||||
// pass NSDragOperationGeneric = 4 to show regular hover for drag and drop. As we want to ignore webkit behaviours that depends on webpage
|
||||
return 4;
|
||||
}
|
||||
|
||||
return [super draggingEntered: sender];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -10,5 +10,7 @@ import (
|
|||
// BrowserOpenURL Use the default browser to open the url
|
||||
func (f *Frontend) BrowserOpenURL(url string) {
|
||||
// Specific method implementation
|
||||
_ = browser.OpenURL(url)
|
||||
if err := browser.OpenURL(url); err != nil {
|
||||
f.logger.Error("Unable to open default system browser")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import (
|
|||
"log"
|
||||
"net"
|
||||
"net/url"
|
||||
"os"
|
||||
"unsafe"
|
||||
|
||||
"github.com/wailsapp/wails/v2/pkg/assetserver"
|
||||
|
|
@ -55,6 +56,9 @@ type Frontend struct {
|
|||
debug bool
|
||||
devtoolsEnabled bool
|
||||
|
||||
// Keep single instance lock file, so that it will not be GC and lock will exist while app is running
|
||||
singleInstanceLockFile *os.File
|
||||
|
||||
// Assets
|
||||
assets *assetserver.AssetServer
|
||||
startURL *url.URL
|
||||
|
|
@ -186,7 +190,7 @@ func (f *Frontend) Run(ctx context.Context) error {
|
|||
f.ctx = ctx
|
||||
|
||||
if f.frontendOptions.SingleInstanceLock != nil {
|
||||
SetupSingleInstance(f.frontendOptions.SingleInstanceLock.UniqueId)
|
||||
f.singleInstanceLockFile = SetupSingleInstance(f.frontendOptions.SingleInstanceLock.UniqueId)
|
||||
}
|
||||
|
||||
_debug := ctx.Value("debug")
|
||||
|
|
@ -364,6 +368,11 @@ func (f *Frontend) processMessage(message string) {
|
|||
if message == "runtime:ready" {
|
||||
cmd := fmt.Sprintf("window.wails.setCSSDragProperties('%s', '%s');", f.frontendOptions.CSSDragProperty, f.frontendOptions.CSSDragValue)
|
||||
f.ExecJS(cmd)
|
||||
|
||||
if f.frontendOptions.DragAndDrop != nil && f.frontendOptions.DragAndDrop.EnableFileDrop {
|
||||
f.ExecJS("window.wails.flags.enableWailsDragAndDrop = true;")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -203,6 +203,7 @@ int main(int argc, const char * argv[]) {
|
|||
// insert code here...
|
||||
int frameless = 0;
|
||||
int resizable = 1;
|
||||
int zoomable = 0;
|
||||
int fullscreen = 1;
|
||||
int fullSizeContent = 1;
|
||||
int hideTitleBar = 0;
|
||||
|
|
@ -219,7 +220,7 @@ int main(int argc, const char * argv[]) {
|
|||
int defaultContextMenuEnabled = 1;
|
||||
int windowStartState = 0;
|
||||
int startsHidden = 0;
|
||||
WailsContext *result = Create("OI OI!",400,400, frameless, resizable, fullscreen, fullSizeContent, hideTitleBar, titlebarAppearsTransparent, hideTitle, useToolbar, hideToolbarSeparator, webviewIsTransparent, alwaysOnTop, hideWindowOnClose, appearance, windowIsTranslucent, devtoolsEnabled, defaultContextMenuEnabled, windowStartState,
|
||||
WailsContext *result = Create("OI OI!",400,400, frameless, resizable, zoomable, fullscreen, fullSizeContent, hideTitleBar, titlebarAppearsTransparent, hideTitle, useToolbar, hideToolbarSeparator, webviewIsTransparent, alwaysOnTop, hideWindowOnClose, appearance, windowIsTranslucent, devtoolsEnabled, defaultContextMenuEnabled, windowStartState,
|
||||
startsHidden, 400, 400, 600, 600, false);
|
||||
SetBackgroundColour(result, 255, 0, 0, 255);
|
||||
void *m = NewMenu("");
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@ import (
|
|||
"github.com/wailsapp/wails/v2/pkg/options"
|
||||
)
|
||||
|
||||
func SetupSingleInstance(uniqueID string) {
|
||||
func SetupSingleInstance(uniqueID string) *os.File {
|
||||
lockFilePath := getTempDir()
|
||||
lockFileName := uniqueID + ".lock"
|
||||
_, err := createLockFile(lockFilePath + "/" + lockFileName)
|
||||
file, err := createLockFile(lockFilePath + "/" + lockFileName)
|
||||
// if lockFile exist – send notification to second instance
|
||||
if err != nil {
|
||||
c := NewCalloc()
|
||||
|
|
@ -34,18 +34,20 @@ func SetupSingleInstance(uniqueID string) {
|
|||
|
||||
data, err := options.NewSecondInstanceData()
|
||||
if err != nil {
|
||||
return
|
||||
return nil
|
||||
}
|
||||
|
||||
serialized, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
return
|
||||
return nil
|
||||
}
|
||||
|
||||
C.SendDataToFirstInstance(singleInstanceUniqueId, c.String(string(serialized)))
|
||||
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
return file
|
||||
}
|
||||
|
||||
//export HandleSecondInstanceData
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ func NewWindow(frontendOptions *options.App, debug bool, devtools bool) *Window
|
|||
defaultContextMenuEnabled := bool2Cint(debug || frontendOptions.EnableDefaultContextMenu)
|
||||
singleInstanceEnabled := bool2Cint(frontendOptions.SingleInstanceLock != nil)
|
||||
|
||||
var fullSizeContent, hideTitleBar, hideTitle, useToolbar, webviewIsTransparent C.int
|
||||
var fullSizeContent, hideTitleBar, zoomable, hideTitle, useToolbar, webviewIsTransparent C.int
|
||||
var titlebarAppearsTransparent, hideToolbarSeparator, windowIsTranslucent C.int
|
||||
var appearance, title *C.char
|
||||
var preferences C.struct_Preferences
|
||||
|
|
@ -83,6 +83,9 @@ func NewWindow(frontendOptions *options.App, debug bool, devtools bool) *Window
|
|||
|
||||
enableFraudulentWebsiteWarnings := C.bool(frontendOptions.EnableFraudulentWebsiteDetection)
|
||||
|
||||
enableDragAndDrop := C.bool(frontendOptions.DragAndDrop != nil && frontendOptions.DragAndDrop.EnableFileDrop)
|
||||
disableWebViewDragAndDrop := C.bool(frontendOptions.DragAndDrop != nil && frontendOptions.DragAndDrop.DisableWebViewDrop)
|
||||
|
||||
if frontendOptions.Mac != nil {
|
||||
mac := frontendOptions.Mac
|
||||
if mac.TitleBar != nil {
|
||||
|
|
@ -108,16 +111,18 @@ func NewWindow(frontendOptions *options.App, debug bool, devtools bool) *Window
|
|||
}
|
||||
}
|
||||
|
||||
zoomable = bool2Cint(!frontendOptions.Mac.DisableZoom)
|
||||
|
||||
windowIsTranslucent = bool2Cint(mac.WindowIsTranslucent)
|
||||
webviewIsTransparent = bool2Cint(mac.WebviewIsTransparent)
|
||||
|
||||
appearance = c.String(string(mac.Appearance))
|
||||
}
|
||||
var context *C.WailsContext = C.Create(title, width, height, frameless, resizable, fullscreen, fullSizeContent,
|
||||
var context *C.WailsContext = C.Create(title, width, height, frameless, resizable, zoomable, fullscreen, fullSizeContent,
|
||||
hideTitleBar, titlebarAppearsTransparent, hideTitle, useToolbar, hideToolbarSeparator, webviewIsTransparent,
|
||||
alwaysOnTop, hideWindowOnClose, appearance, windowIsTranslucent, devtoolsEnabled, defaultContextMenuEnabled,
|
||||
windowStartState, startsHidden, minWidth, minHeight, maxWidth, maxHeight, enableFraudulentWebsiteWarnings,
|
||||
preferences, singleInstanceEnabled, singleInstanceUniqueId,
|
||||
preferences, singleInstanceEnabled, singleInstanceUniqueId, enableDragAndDrop, disableWebViewDragAndDrop,
|
||||
)
|
||||
|
||||
// Create menu
|
||||
|
|
|
|||
|
|
@ -8,5 +8,7 @@ import "github.com/pkg/browser"
|
|||
// BrowserOpenURL Use the default browser to open the url
|
||||
func (f *Frontend) BrowserOpenURL(url string) {
|
||||
// Specific method implementation
|
||||
_ = browser.OpenURL(url)
|
||||
if err := browser.OpenURL(url); err != nil {
|
||||
f.logger.Error("Unable to open default system browser")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
@ -442,12 +444,24 @@ func (f *Frontend) processMessage(message string) {
|
|||
if message == "runtime:ready" {
|
||||
cmd := fmt.Sprintf(
|
||||
"window.wails.setCSSDragProperties('%s', '%s');\n"+
|
||||
"window.wails.flags.deferDragToMouseMove = true;", f.frontendOptions.CSSDragProperty, f.frontendOptions.CSSDragValue)
|
||||
"window.wails.setCSSDropProperties('%s', '%s');\n"+
|
||||
"window.wails.flags.deferDragToMouseMove = true;",
|
||||
f.frontendOptions.CSSDragProperty,
|
||||
f.frontendOptions.CSSDragValue,
|
||||
f.frontendOptions.DragAndDrop.CSSDropProperty,
|
||||
f.frontendOptions.DragAndDrop.CSSDropValue,
|
||||
)
|
||||
|
||||
f.ExecJS(cmd)
|
||||
|
||||
if f.frontendOptions.Frameless && f.frontendOptions.DisableResize == false {
|
||||
f.ExecJS("window.wails.flags.enableResize = true;")
|
||||
}
|
||||
|
||||
if f.frontendOptions.DragAndDrop.EnableFileDrop {
|
||||
f.ExecJS("window.wails.flags.enableWailsDragAndDrop = true;")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"encoding/json"
|
||||
"github.com/godbus/dbus/v5"
|
||||
"github.com/wailsapp/wails/v2/pkg/options"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
|
@ -55,8 +56,15 @@ func SetupSingleInstance(uniqueID string) {
|
|||
data := options.SecondInstanceData{
|
||||
Args: os.Args[1:],
|
||||
}
|
||||
data.WorkingDirectory, err = os.Getwd()
|
||||
if err != nil {
|
||||
log.Printf("Failed to get working directory: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
serialized, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
log.Printf("Failed to marshal data: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,6 +4,7 @@
|
|||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include "window.h"
|
||||
|
||||
|
|
@ -245,7 +246,7 @@ void SetMinMaxSize(GtkWindow *window, int min_width, int min_height, int max_wid
|
|||
gtk_window_set_geometry_hints(window, NULL, &size, flags);
|
||||
}
|
||||
|
||||
// function to disable the context menu but propogate the event
|
||||
// function to disable the context menu but propagate the event
|
||||
static gboolean disableContextMenu(GtkWidget *widget, WebKitContextMenu *context_menu, GdkEvent *event, WebKitHitTestResult *hit_test_result, gpointer data)
|
||||
{
|
||||
// return true to disable the context menu
|
||||
|
|
@ -254,7 +255,7 @@ static gboolean disableContextMenu(GtkWidget *widget, WebKitContextMenu *context
|
|||
|
||||
void DisableContextMenu(void *webview)
|
||||
{
|
||||
// Disable the context menu but propogate the event
|
||||
// Disable the context menu but propagate the event
|
||||
g_signal_connect(WEBKIT_WEB_VIEW(webview), "context-menu", G_CALLBACK(disableContextMenu), NULL);
|
||||
}
|
||||
|
||||
|
|
@ -429,14 +430,92 @@ gboolean close_button_pressed(GtkWidget *widget, GdkEvent *event, void *data)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
char *droppedFiles = NULL;
|
||||
|
||||
static void onDragDataReceived(GtkWidget *self, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint target_type, guint time, gpointer data)
|
||||
{
|
||||
if(selection_data == NULL || (gtk_selection_data_get_length(selection_data) <= 0) || target_type != 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(droppedFiles != NULL) {
|
||||
free(droppedFiles);
|
||||
droppedFiles = NULL;
|
||||
}
|
||||
|
||||
gchar **filenames = NULL;
|
||||
filenames = g_uri_list_extract_uris((const gchar *)gtk_selection_data_get_data(selection_data));
|
||||
if (filenames == NULL) // If unable to retrieve filenames:
|
||||
{
|
||||
g_strfreev(filenames);
|
||||
return;
|
||||
}
|
||||
|
||||
droppedFiles = calloc((size_t)gtk_selection_data_get_length(selection_data), 1);
|
||||
|
||||
int iter = 0;
|
||||
while(filenames[iter] != NULL) // The last URI list element is NULL.
|
||||
{
|
||||
if(iter != 0)
|
||||
{
|
||||
strncat(droppedFiles, "\n", 1);
|
||||
}
|
||||
char *filename = g_filename_from_uri(filenames[iter], NULL, NULL);
|
||||
if (filename == NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
strncat(droppedFiles, filename, strlen(filename));
|
||||
|
||||
free(filename);
|
||||
iter++;
|
||||
}
|
||||
|
||||
g_strfreev(filenames);
|
||||
}
|
||||
|
||||
static gboolean onDragDrop(GtkWidget* self, GdkDragContext* context, gint x, gint y, guint time, gpointer user_data)
|
||||
{
|
||||
if(droppedFiles == NULL)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
size_t resLen = strlen(droppedFiles)+(sizeof(gint)*2)+6;
|
||||
char *res = calloc(resLen, 1);
|
||||
|
||||
snprintf(res, resLen, "DD:%d:%d:%s", x, y, droppedFiles);
|
||||
|
||||
if(droppedFiles != NULL) {
|
||||
free(droppedFiles);
|
||||
droppedFiles = NULL;
|
||||
}
|
||||
|
||||
processMessage(res);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// WebView
|
||||
GtkWidget *SetupWebview(void *contentManager, GtkWindow *window, int hideWindowOnClose, int gpuPolicy)
|
||||
GtkWidget *SetupWebview(void *contentManager, GtkWindow *window, int hideWindowOnClose, int gpuPolicy, int disableWebViewDragAndDrop, int enableDragAndDrop)
|
||||
{
|
||||
GtkWidget *webview = webkit_web_view_new_with_user_content_manager((WebKitUserContentManager *)contentManager);
|
||||
// gtk_container_add(GTK_CONTAINER(window), webview);
|
||||
WebKitWebContext *context = webkit_web_context_get_default();
|
||||
webkit_web_context_register_uri_scheme(context, "wails", (WebKitURISchemeRequestCallback)processURLRequest, NULL, NULL);
|
||||
g_signal_connect(G_OBJECT(webview), "load-changed", G_CALLBACK(webviewLoadChanged), NULL);
|
||||
|
||||
if(disableWebViewDragAndDrop)
|
||||
{
|
||||
gtk_drag_dest_unset(webview);
|
||||
}
|
||||
|
||||
if(enableDragAndDrop)
|
||||
{
|
||||
g_signal_connect(G_OBJECT(webview), "drag-data-received", G_CALLBACK(onDragDataReceived), NULL);
|
||||
g_signal_connect(G_OBJECT(webview), "drag-drop", G_CALLBACK(onDragDrop), NULL);
|
||||
}
|
||||
|
||||
if (hideWindowOnClose)
|
||||
{
|
||||
g_signal_connect(GTK_WIDGET(window), "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), NULL);
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -101,6 +103,8 @@ func NewWindow(appoptions *options.App, debug bool, devtoolsEnabled bool) *Windo
|
|||
result.asGTKWindow(),
|
||||
bool2Cint(appoptions.HideWindowOnClose),
|
||||
C.int(webviewGpuPolicy),
|
||||
bool2Cint(appoptions.DragAndDrop != nil && appoptions.DragAndDrop.DisableWebViewDrop),
|
||||
bool2Cint(appoptions.DragAndDrop != nil && appoptions.DragAndDrop.EnableFileDrop),
|
||||
)
|
||||
result.webview = unsafe.Pointer(webview)
|
||||
buttonPressedName := C.CString("button-press-event")
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ gboolean Fullscreen(gpointer data);
|
|||
gboolean UnFullscreen(gpointer data);
|
||||
|
||||
// WebView
|
||||
GtkWidget *SetupWebview(void *contentManager, GtkWindow *window, int hideWindowOnClose, int gpuPolicy);
|
||||
GtkWidget *SetupWebview(void *contentManager, GtkWindow *window, int hideWindowOnClose, int gpuPolicy, int disableWebViewDragAndDrop, int enableDragAndDrop);
|
||||
void LoadIndex(void *webview, char *url);
|
||||
void DevtoolsEnabled(void *webview, int enabled, bool showInspector);
|
||||
void ExecuteJS(void *data);
|
||||
|
|
|
|||
|
|
@ -5,10 +5,31 @@ package windows
|
|||
|
||||
import (
|
||||
"github.com/pkg/browser"
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
var fallbackBrowserPaths = []string{
|
||||
`\Program Files (x86)\Microsoft\Edge\Application\msedge.exe`,
|
||||
`\Program Files\Google\Chrome\Application\chrome.exe`,
|
||||
`\Program Files (x86)\Google\Chrome\Application\chrome.exe`,
|
||||
`\Program Files\Mozilla Firefox\firefox.exe`,
|
||||
}
|
||||
|
||||
// BrowserOpenURL Use the default browser to open the url
|
||||
func (f *Frontend) BrowserOpenURL(url string) {
|
||||
// Specific method implementation
|
||||
_ = browser.OpenURL(url)
|
||||
err := browser.OpenURL(url)
|
||||
if err == nil {
|
||||
return
|
||||
}
|
||||
for _, fallback := range fallbackBrowserPaths {
|
||||
if err := openBrowser(fallback, url); err == nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
f.logger.Error("Unable to open default system browser")
|
||||
}
|
||||
|
||||
func openBrowser(path, url string) error {
|
||||
return windows.ShellExecute(0, nil, windows.StringToUTF16Ptr(path), windows.StringToUTF16Ptr(url), nil, windows.SW_SHOWNORMAL)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,6 +121,10 @@ func (f *Frontend) SaveFileDialog(options frontend.SaveDialogOptions) (string, e
|
|||
Folder: defaultFolder,
|
||||
}
|
||||
|
||||
if len(options.Filters) > 0 {
|
||||
config.DefaultExtension = strings.TrimPrefix(strings.Split(options.Filters[0].Pattern, ";")[0], "*")
|
||||
}
|
||||
|
||||
result, err := f.showCfdDialog(
|
||||
func() (cfd.Dialog, error) {
|
||||
return cfd.NewSaveFileDialog(config)
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import (
|
|||
"sync"
|
||||
"text/template"
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/bep/debounce"
|
||||
"github.com/wailsapp/go-webview2/pkg/edge"
|
||||
|
|
@ -461,7 +462,14 @@ func (f *Frontend) setupChromium() {
|
|||
chromium.AdditionalBrowserArgs = append(chromium.AdditionalBrowserArgs, arg)
|
||||
}
|
||||
|
||||
if f.frontendOptions.DragAndDrop != nil && f.frontendOptions.DragAndDrop.DisableWebViewDrop {
|
||||
if err := chromium.AllowExternalDrag(false); err != nil {
|
||||
f.logger.Warning("WebView failed to set AllowExternalDrag to false!")
|
||||
}
|
||||
}
|
||||
|
||||
chromium.MessageCallback = f.processMessage
|
||||
chromium.MessageWithAdditionalObjectsCallback = f.processMessageWithAdditionalObjects
|
||||
chromium.WebResourceRequestedCallback = f.processRequest
|
||||
chromium.NavigationCompletedCallback = f.navigationCompleted
|
||||
chromium.AcceleratorKeyCallback = func(vkey uint) bool {
|
||||
|
|
@ -673,7 +681,15 @@ func (f *Frontend) processMessage(message string) {
|
|||
}
|
||||
|
||||
if message == "runtime:ready" {
|
||||
cmd := fmt.Sprintf("window.wails.setCSSDragProperties('%s', '%s');", f.frontendOptions.CSSDragProperty, f.frontendOptions.CSSDragValue)
|
||||
cmd := fmt.Sprintf(
|
||||
"window.wails.setCSSDragProperties('%s', '%s');\n"+
|
||||
"window.wails.setCSSDropProperties('%s', '%s');",
|
||||
f.frontendOptions.CSSDragProperty,
|
||||
f.frontendOptions.CSSDragValue,
|
||||
f.frontendOptions.DragAndDrop.CSSDropProperty,
|
||||
f.frontendOptions.DragAndDrop.CSSDropValue,
|
||||
)
|
||||
|
||||
f.ExecJS(cmd)
|
||||
return
|
||||
}
|
||||
|
|
@ -694,25 +710,81 @@ func (f *Frontend) processMessage(message string) {
|
|||
return
|
||||
}
|
||||
|
||||
go func() {
|
||||
result, err := f.dispatcher.ProcessMessage(message, f)
|
||||
if err != nil {
|
||||
f.logger.Error(err.Error())
|
||||
f.Callback(result)
|
||||
go f.dispatchMessage(message)
|
||||
}
|
||||
|
||||
func (f *Frontend) processMessageWithAdditionalObjects(message string, sender *edge.ICoreWebView2, args *edge.ICoreWebView2WebMessageReceivedEventArgs) {
|
||||
if strings.HasPrefix(message, "file:drop") {
|
||||
if !f.frontendOptions.DragAndDrop.EnableFileDrop {
|
||||
return
|
||||
}
|
||||
if result == "" {
|
||||
objs, err := args.GetAdditionalObjects()
|
||||
if err != nil {
|
||||
f.logger.Error(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
switch result[0] {
|
||||
case 'c':
|
||||
// Callback from a method call
|
||||
f.Callback(result[1:])
|
||||
default:
|
||||
f.logger.Info("Unknown message returned from dispatcher: %+v", result)
|
||||
defer objs.Release()
|
||||
|
||||
count, err := objs.GetCount()
|
||||
if err != nil {
|
||||
f.logger.Error(err.Error())
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
files := make([]string, count)
|
||||
for i := uint32(0); i < count; i++ {
|
||||
_file, err := objs.GetValueAtIndex(i)
|
||||
if err != nil {
|
||||
f.logger.Error("cannot get value at %d : %s", i, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
file := (*edge.ICoreWebView2File)(unsafe.Pointer(_file))
|
||||
defer file.Release()
|
||||
|
||||
filepath, err := file.GetPath()
|
||||
if err != nil {
|
||||
f.logger.Error("cannot get path for object at %d : %s", i, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
files[i] = filepath
|
||||
}
|
||||
|
||||
var (
|
||||
x = "0"
|
||||
y = "0"
|
||||
)
|
||||
coords := strings.SplitN(message[10:], ":", 2)
|
||||
if len(coords) == 2 {
|
||||
x = coords[0]
|
||||
y = coords[1]
|
||||
}
|
||||
|
||||
go f.dispatchMessage(fmt.Sprintf("DD:%s:%s:%s", x, y, strings.Join(files, "\n")))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func (f *Frontend) dispatchMessage(message string) {
|
||||
result, err := f.dispatcher.ProcessMessage(message, f)
|
||||
if err != nil {
|
||||
f.logger.Error(err.Error())
|
||||
f.Callback(result)
|
||||
return
|
||||
}
|
||||
if result == "" {
|
||||
return
|
||||
}
|
||||
|
||||
switch result[0] {
|
||||
case 'c':
|
||||
// Callback from a method call
|
||||
f.Callback(result[1:])
|
||||
default:
|
||||
f.logger.Info("Unknown message returned from dispatcher: %+v", result)
|
||||
}
|
||||
}
|
||||
|
||||
func (f *Frontend) Callback(message string) {
|
||||
|
|
@ -758,6 +830,10 @@ func (f *Frontend) navigationCompleted(sender *edge.ICoreWebView2, args *edge.IC
|
|||
f.ExecJS("window.wails.flags.enableResize = true;")
|
||||
}
|
||||
|
||||
if f.frontendOptions.DragAndDrop != nil && f.frontendOptions.DragAndDrop.EnableFileDrop {
|
||||
f.ExecJS("window.wails.flags.enableWailsDragAndDrop = true;")
|
||||
}
|
||||
|
||||
if f.hasStarted {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32"
|
||||
"github.com/wailsapp/wails/v2/pkg/options"
|
||||
"golang.org/x/sys/windows"
|
||||
"log"
|
||||
"os"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
|
@ -51,7 +52,16 @@ func SetupSingleInstance(uniqueId string) {
|
|||
data := options.SecondInstanceData{
|
||||
Args: os.Args[1:],
|
||||
}
|
||||
serialized, _ := json.Marshal(data)
|
||||
data.WorkingDirectory, err = os.Getwd()
|
||||
if err != nil {
|
||||
log.Printf("Failed to get working directory: %v", err)
|
||||
return
|
||||
}
|
||||
serialized, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
log.Printf("Failed to marshal data: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
SendMessage(hwnd, string(serialized))
|
||||
// exit second instance of app after sending message
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func init() {
|
|||
w32.InitCommonControlsEx(&initCtrls)
|
||||
}
|
||||
|
||||
// SetAppIconID sets recource icon ID for the apps windows.
|
||||
// SetAppIcon sets resource icon ID for the apps windows.
|
||||
func SetAppIcon(appIconID int) {
|
||||
AppIconID = appIconID
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ func (cb *ComboBox) OnSelectedChange() *EventManager {
|
|||
return &cb.onSelectedChange
|
||||
}
|
||||
|
||||
// Message processer
|
||||
// Message processor
|
||||
func (cb *ComboBox) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
|
||||
switch msg {
|
||||
case w32.WM_COMMAND:
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ type SimpleDock struct {
|
|||
loadedState bool
|
||||
}
|
||||
|
||||
// DockState gets saved and loaded from json
|
||||
// CtlState gets saved and loaded from json
|
||||
type CtlState struct {
|
||||
X, Y, Width, Height int
|
||||
}
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ func (lv *ListView) OnEndScroll() *EventManager {
|
|||
return &lv.onEndScroll
|
||||
}
|
||||
|
||||
// Message processer
|
||||
// Message processor
|
||||
func (lv *ListView) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
|
||||
switch msg {
|
||||
/*case w32.WM_ERASEBKGND:
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ func (tv *TreeView) OnViewChange() *EventManager {
|
|||
return &tv.onViewChange
|
||||
}
|
||||
|
||||
// Message processer
|
||||
// Message processor
|
||||
func (tv *TreeView) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
|
||||
switch msg {
|
||||
case w32.WM_NOTIFY:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package dispatcher
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/wailsapp/wails/v2/internal/binding"
|
||||
"github.com/wailsapp/wails/v2/internal/frontend"
|
||||
|
|
@ -47,6 +46,8 @@ func (d *Dispatcher) ProcessMessage(message string, sender frontend.Frontend) (s
|
|||
return d.processWindowMessage(message, sender)
|
||||
case 'B':
|
||||
return d.processBrowserMessage(message, sender)
|
||||
case 'D':
|
||||
return d.processDragAndDropMessage(message)
|
||||
case 'Q':
|
||||
sender.Quit()
|
||||
return "", nil
|
||||
|
|
|
|||
38
v2/internal/frontend/dispatcher/draganddrop.go
Normal file
38
v2/internal/frontend/dispatcher/draganddrop.go
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
package dispatcher
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (d *Dispatcher) processDragAndDropMessage(message string) (string, error) {
|
||||
switch message[1] {
|
||||
case 'D':
|
||||
msg := strings.SplitN(message[3:], ":", 3)
|
||||
if len(msg) != 3 {
|
||||
return "", errors.New("Invalid drag and drop Message: " + message)
|
||||
}
|
||||
|
||||
x, err := strconv.Atoi(msg[0])
|
||||
if err != nil {
|
||||
return "", errors.New("Invalid x coordinate in drag and drop Message: " + message)
|
||||
}
|
||||
|
||||
y, err := strconv.Atoi(msg[1])
|
||||
if err != nil {
|
||||
return "", errors.New("Invalid y coordinate in drag and drop Message: " + message)
|
||||
}
|
||||
|
||||
paths := strings.Split(msg[2], "\n")
|
||||
if len(paths) < 1 {
|
||||
return "", errors.New("Invalid drag and drop Message: " + message)
|
||||
}
|
||||
|
||||
d.events.Emit("wails:file-drop", x, y, paths)
|
||||
default:
|
||||
return "", errors.New("Invalid drag and drop Message: " + message)
|
||||
}
|
||||
|
||||
return "", nil
|
||||
}
|
||||
243
v2/internal/frontend/runtime/desktop/draganddrop.js
Normal file
243
v2/internal/frontend/runtime/desktop/draganddrop.js
Normal file
|
|
@ -0,0 +1,243 @@
|
|||
/*
|
||||
_ __ _ __
|
||||
| | / /___ _(_) /____
|
||||
| | /| / / __ `/ / / ___/
|
||||
| |/ |/ / /_/ / / (__ )
|
||||
|__/|__/\__,_/_/_/____/
|
||||
The electron alternative for Go
|
||||
(c) Lea Anthony 2019-present
|
||||
*/
|
||||
|
||||
/* jshint esversion: 9 */
|
||||
|
||||
import {EventsOn, EventsOff} from "./events";
|
||||
|
||||
const flags = {
|
||||
registered: false,
|
||||
defaultUseDropTarget: true,
|
||||
useDropTarget: true,
|
||||
nextDeactivate: null,
|
||||
nextDeactivateTimeout: null,
|
||||
};
|
||||
|
||||
const DROP_TARGET_ACTIVE = "wails-drop-target-active";
|
||||
|
||||
/**
|
||||
* checkStyleDropTarget checks if the style has the drop target attribute
|
||||
*
|
||||
* @param {CSSStyleDeclaration} style
|
||||
* @returns
|
||||
*/
|
||||
function checkStyleDropTarget(style) {
|
||||
const cssDropValue = style.getPropertyValue(window.wails.flags.cssDropProperty).trim();
|
||||
if (cssDropValue) {
|
||||
if (cssDropValue === window.wails.flags.cssDropValue) {
|
||||
return true;
|
||||
}
|
||||
// if the element has the drop target attribute, but
|
||||
// the value is not correct, terminate finding process.
|
||||
// This can be useful to block some child elements from being drop targets.
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* onDragOver is called when the dragover event is emitted.
|
||||
* @param {DragEvent} e
|
||||
* @returns
|
||||
*/
|
||||
function onDragOver(e) {
|
||||
if (!window.wails.flags.enableWailsDragAndDrop) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
|
||||
if (!flags.useDropTarget) {
|
||||
return;
|
||||
}
|
||||
|
||||
const element = e.target;
|
||||
|
||||
// Trigger debounce function to deactivate drop targets
|
||||
if(flags.nextDeactivate) flags.nextDeactivate();
|
||||
|
||||
// if the element is null or element is not child of drop target element
|
||||
if (!element || !checkStyleDropTarget(getComputedStyle(element))) {
|
||||
return;
|
||||
}
|
||||
|
||||
let currentElement = element;
|
||||
while (currentElement) {
|
||||
// check if currentElement is drop target element
|
||||
if (checkStyleDropTarget(currentElement.style)) {
|
||||
currentElement.classList.add(DROP_TARGET_ACTIVE);
|
||||
}
|
||||
currentElement = currentElement.parentElement;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* onDragLeave is called when the dragleave event is emitted.
|
||||
* @param {DragEvent} e
|
||||
* @returns
|
||||
*/
|
||||
function onDragLeave(e) {
|
||||
if (!window.wails.flags.enableWailsDragAndDrop) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
|
||||
if (!flags.useDropTarget) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the close drop target element
|
||||
if (!e.target || !checkStyleDropTarget(getComputedStyle(e.target))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Trigger debounce function to deactivate drop targets
|
||||
if(flags.nextDeactivate) flags.nextDeactivate();
|
||||
|
||||
// Use debounce technique to tacle dragleave events on overlapping elements and drop target elements
|
||||
flags.nextDeactivate = () => {
|
||||
// Deactivate all drop targets, new drop target will be activated on next dragover event
|
||||
Array.from(document.getElementsByClassName(DROP_TARGET_ACTIVE)).forEach(el => el.classList.remove(DROP_TARGET_ACTIVE));
|
||||
// Reset nextDeactivate
|
||||
flags.nextDeactivate = null;
|
||||
// Clear timeout
|
||||
if (flags.nextDeactivateTimeout) {
|
||||
clearTimeout(flags.nextDeactivateTimeout);
|
||||
flags.nextDeactivateTimeout = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Set timeout to deactivate drop targets if not triggered by next drag event
|
||||
flags.nextDeactivateTimeout = setTimeout(() => {
|
||||
if(flags.nextDeactivate) flags.nextDeactivate();
|
||||
}, 50);
|
||||
}
|
||||
|
||||
/**
|
||||
* onDrop is called when the drop event is emitted.
|
||||
* @param {DragEvent} e
|
||||
* @returns
|
||||
*/
|
||||
function onDrop(e) {
|
||||
if (!window.wails.flags.enableWailsDragAndDrop) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
|
||||
if (!flags.useDropTarget) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Trigger debounce function to deactivate drop targets
|
||||
if(flags.nextDeactivate) flags.nextDeactivate();
|
||||
|
||||
// Deactivate all drop targets
|
||||
Array.from(document.getElementsByClassName(DROP_TARGET_ACTIVE)).forEach(el => el.classList.remove(DROP_TARGET_ACTIVE));
|
||||
|
||||
if (CanResolveFilePaths()) {
|
||||
// process files
|
||||
let files = [];
|
||||
if (e.dataTransfer.items) {
|
||||
files = [...e.dataTransfer.items].map((item, i) => {
|
||||
if (item.kind === 'file') {
|
||||
return item.getAsFile();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
files = [...e.dataTransfer.files];
|
||||
}
|
||||
window.runtime.ResolveFilePaths(e.x, e.y, files);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* postMessageWithAdditionalObjects checks the browser's capability of sending postMessageWithAdditionalObjects
|
||||
*
|
||||
* @returns {boolean}
|
||||
* @constructor
|
||||
*/
|
||||
export function CanResolveFilePaths() {
|
||||
return window.chrome?.webview?.postMessageWithAdditionalObjects != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* ResolveFilePaths sends drop events to the GO side to resolve file paths on windows.
|
||||
*
|
||||
* @param {number} x
|
||||
* @param {number} y
|
||||
* @param {any[]} files
|
||||
* @constructor
|
||||
*/
|
||||
export function ResolveFilePaths(x, y, files) {
|
||||
// Only for windows webview2 >= 1.0.1774.30
|
||||
// https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2webmessagereceivedeventargs2?view=webview2-1.0.1823.32#applies-to
|
||||
if (window.chrome?.webview?.postMessageWithAdditionalObjects) {
|
||||
chrome.webview.postMessageWithAdditionalObjects(`file:drop:${x}:${y}`, files);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for OnFileDrop returns a slice of file path strings when a drop is finished.
|
||||
*
|
||||
* @export
|
||||
* @callback OnFileDropCallback
|
||||
* @param {number} x - x coordinate of the drop
|
||||
* @param {number} y - y coordinate of the drop
|
||||
* @param {string[]} paths - A list of file paths.
|
||||
*/
|
||||
|
||||
/**
|
||||
* OnFileDrop listens to drag and drop events and calls the callback with the coordinates of the drop and an array of path strings.
|
||||
*
|
||||
* @export
|
||||
* @param {OnFileDropCallback} callback - Callback for OnFileDrop returns a slice of file path strings when a drop is finished.
|
||||
* @param {boolean} [useDropTarget=true] - Only call the callback when the drop finished on an element that has the drop target style. (--wails-drop-target)
|
||||
*/
|
||||
export function OnFileDrop(callback, useDropTarget) {
|
||||
if (typeof callback !== "function") {
|
||||
console.error("DragAndDropCallback is not a function");
|
||||
return;
|
||||
}
|
||||
|
||||
if (flags.registered) {
|
||||
return;
|
||||
}
|
||||
flags.registered = true;
|
||||
|
||||
const uDTPT = typeof useDropTarget;
|
||||
flags.useDropTarget = uDTPT === "undefined" || uDTPT !== "boolean" ? flags.defaultUseDropTarget : useDropTarget;
|
||||
window.addEventListener('dragover', onDragOver);
|
||||
window.addEventListener('dragleave', onDragLeave);
|
||||
window.addEventListener('drop', onDrop);
|
||||
|
||||
let cb = callback;
|
||||
if (flags.useDropTarget) {
|
||||
cb = function (x, y, paths) {
|
||||
const element = document.elementFromPoint(x, y)
|
||||
// if the element is null or element is not child of drop target element, return null
|
||||
if (!element || !checkStyleDropTarget(getComputedStyle(element))) {
|
||||
return null;
|
||||
}
|
||||
callback(x, y, paths);
|
||||
}
|
||||
}
|
||||
|
||||
EventsOn("wails:file-drop", cb);
|
||||
}
|
||||
|
||||
/**
|
||||
* OnFileDropOff removes the drag and drop listeners and handlers.
|
||||
*/
|
||||
export function OnFileDropOff() {
|
||||
window.removeEventListener('dragover', onDragOver);
|
||||
window.removeEventListener('dragleave', onDragLeave);
|
||||
window.removeEventListener('drop', onDrop);
|
||||
EventsOff("wails:file-drop");
|
||||
flags.registered = false;
|
||||
}
|
||||
|
|
@ -16,9 +16,9 @@ import * as Window from "./window";
|
|||
import * as Screen from "./screen";
|
||||
import * as Browser from "./browser";
|
||||
import * as Clipboard from "./clipboard";
|
||||
import * as DragAndDrop from "./draganddrop";
|
||||
import * as ContextMenu from "./contextmenu";
|
||||
|
||||
|
||||
export function Quit() {
|
||||
window.WailsInvoke('Q');
|
||||
}
|
||||
|
|
@ -42,6 +42,7 @@ window.runtime = {
|
|||
...Browser,
|
||||
...Screen,
|
||||
...Clipboard,
|
||||
...DragAndDrop,
|
||||
EventsOn,
|
||||
EventsOnce,
|
||||
EventsOnMultiple,
|
||||
|
|
@ -70,6 +71,9 @@ window.wails = {
|
|||
deferDragToMouseMove: true,
|
||||
cssDragProperty: "--wails-draggable",
|
||||
cssDragValue: "drag",
|
||||
cssDropProperty: "--wails-drop-target",
|
||||
cssDropValue: "drop",
|
||||
enableWailsDragAndDrop: false,
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -112,8 +116,12 @@ window.wails.setCSSDragProperties = function (property, value) {
|
|||
window.wails.flags.cssDragValue = value;
|
||||
}
|
||||
|
||||
window.addEventListener('mousedown', (e) => {
|
||||
window.wails.setCSSDropProperties = function (property, value) {
|
||||
window.wails.flags.cssDropProperty = property;
|
||||
window.wails.flags.cssDropValue = value;
|
||||
}
|
||||
|
||||
window.addEventListener('mousedown', (e) => {
|
||||
// Check for resizing
|
||||
if (window.wails.flags.resizeEdge) {
|
||||
window.WailsInvoke("resize:" + window.wails.flags.resizeEdge);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ function handleDisconnect() {
|
|||
|
||||
function _connect() {
|
||||
if (websocket == null) {
|
||||
websocket = new WebSocket('ws://' + window.location.host + '/wails/ipc');
|
||||
websocket = new WebSocket((window.location.protocol.startsWith("https") ? "wss://" : "ws://") + window.location.host + "/wails/ipc");
|
||||
websocket.onopen = handleConnect;
|
||||
websocket.onerror = function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
64
v2/internal/frontend/runtime/package-lock.json
generated
64
v2/internal/frontend/runtime/package-lock.json
generated
|
|
@ -784,9 +784,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"optional": true,
|
||||
|
|
@ -1514,9 +1514,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/rollup": {
|
||||
"version": "2.78.1",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.78.1.tgz",
|
||||
"integrity": "sha512-VeeCgtGi4P+o9hIg+xz4qQpRl6R401LWEXBmxYKOV4zlF82lyhgh2hTZnheFUbANE8l2A41F458iwj2vEYaXJg==",
|
||||
"version": "2.79.1",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz",
|
||||
"integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"rollup": "dist/bin/rollup"
|
||||
|
|
@ -1541,9 +1541,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver"
|
||||
|
|
@ -1865,15 +1865,15 @@
|
|||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "3.1.8",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-3.1.8.tgz",
|
||||
"integrity": "sha512-m7jJe3nufUbuOfotkntGFupinL/fmuTNuQmiVE7cH2IZMuf4UbfbGYMUT3jVWgGYuRVLY9j8NnrRqgw5rr5QTg==",
|
||||
"version": "3.2.10",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-3.2.10.tgz",
|
||||
"integrity": "sha512-Dx3olBo/ODNiMVk/cA5Yft9Ws+snLOXrhLtrI3F4XLt4syz2Yg8fayZMWScPKoz12v5BUv7VEmQHnsfpY80fYw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.15.9",
|
||||
"postcss": "^8.4.16",
|
||||
"postcss": "^8.4.18",
|
||||
"resolve": "^1.22.1",
|
||||
"rollup": "~2.78.0"
|
||||
"rollup": "^2.79.1"
|
||||
},
|
||||
"bin": {
|
||||
"vite": "bin/vite.js"
|
||||
|
|
@ -1885,12 +1885,17 @@
|
|||
"fsevents": "~2.3.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/node": ">= 14",
|
||||
"less": "*",
|
||||
"sass": "*",
|
||||
"stylus": "*",
|
||||
"sugarss": "*",
|
||||
"terser": "^5.4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/node": {
|
||||
"optional": true
|
||||
},
|
||||
"less": {
|
||||
"optional": true
|
||||
},
|
||||
|
|
@ -1900,6 +1905,9 @@
|
|||
"stylus": {
|
||||
"optional": true
|
||||
},
|
||||
"sugarss": {
|
||||
"optional": true
|
||||
},
|
||||
"terser": {
|
||||
"optional": true
|
||||
}
|
||||
|
|
@ -2528,9 +2536,9 @@
|
|||
}
|
||||
},
|
||||
"fsevents": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
|
|
@ -3046,9 +3054,9 @@
|
|||
}
|
||||
},
|
||||
"rollup": {
|
||||
"version": "2.78.1",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.78.1.tgz",
|
||||
"integrity": "sha512-VeeCgtGi4P+o9hIg+xz4qQpRl6R401LWEXBmxYKOV4zlF82lyhgh2hTZnheFUbANE8l2A41F458iwj2vEYaXJg==",
|
||||
"version": "2.79.1",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz",
|
||||
"integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fsevents": "~2.3.2"
|
||||
|
|
@ -3067,9 +3075,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||
"dev": true
|
||||
},
|
||||
"shebang-command": {
|
||||
|
|
@ -3330,16 +3338,16 @@
|
|||
}
|
||||
},
|
||||
"vite": {
|
||||
"version": "3.1.8",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-3.1.8.tgz",
|
||||
"integrity": "sha512-m7jJe3nufUbuOfotkntGFupinL/fmuTNuQmiVE7cH2IZMuf4UbfbGYMUT3jVWgGYuRVLY9j8NnrRqgw5rr5QTg==",
|
||||
"version": "3.2.10",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-3.2.10.tgz",
|
||||
"integrity": "sha512-Dx3olBo/ODNiMVk/cA5Yft9Ws+snLOXrhLtrI3F4XLt4syz2Yg8fayZMWScPKoz12v5BUv7VEmQHnsfpY80fYw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esbuild": "^0.15.9",
|
||||
"fsevents": "~2.3.2",
|
||||
"postcss": "^8.4.16",
|
||||
"postcss": "^8.4.18",
|
||||
"resolve": "^1.22.1",
|
||||
"rollup": "~2.78.0"
|
||||
"rollup": "^2.79.1"
|
||||
}
|
||||
},
|
||||
"vitest": {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -233,3 +233,17 @@ export function ClipboardGetText(): Promise<string>;
|
|||
// [ClipboardSetText](https://wails.io/docs/reference/runtime/clipboard#clipboardsettext)
|
||||
// Sets a text on the clipboard
|
||||
export function ClipboardSetText(text: string): Promise<boolean>;
|
||||
|
||||
// [OnFileDrop](https://wails.io/docs/reference/runtime/draganddrop#onfiledrop)
|
||||
// OnFileDrop listens to drag and drop events and calls the callback with the coordinates of the drop and an array of path strings.
|
||||
export function OnFileDrop(callback: (x: number, y: number ,paths: string[]) => void, useDropTarget: boolean) :void
|
||||
|
||||
// [OnFileDropOff](https://wails.io/docs/reference/runtime/draganddrop#dragandddropoff)
|
||||
// OnFileDropOff removes the drag and drop listeners and handlers.
|
||||
export function OnFileDropOff() :void
|
||||
|
||||
// Check if the file path resolver is available
|
||||
export function CanResolveFilePaths(): boolean;
|
||||
|
||||
// Resolves file paths for an array of files
|
||||
export function ResolveFilePaths(files: File[]): void
|
||||
|
|
@ -199,4 +199,40 @@ export function ClipboardGetText() {
|
|||
|
||||
export function ClipboardSetText(text) {
|
||||
return window.runtime.ClipboardSetText(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for OnFileDrop returns a slice of file path strings when a drop is finished.
|
||||
*
|
||||
* @export
|
||||
* @callback OnFileDropCallback
|
||||
* @param {number} x - x coordinate of the drop
|
||||
* @param {number} y - y coordinate of the drop
|
||||
* @param {string[]} paths - A list of file paths.
|
||||
*/
|
||||
|
||||
/**
|
||||
* OnFileDrop listens to drag and drop events and calls the callback with the coordinates of the drop and an array of path strings.
|
||||
*
|
||||
* @export
|
||||
* @param {OnFileDropCallback} callback - Callback for OnFileDrop returns a slice of file path strings when a drop is finished.
|
||||
* @param {boolean} [useDropTarget=true] - Only call the callback when the drop finished on an element that has the drop target style. (--wails-drop-target)
|
||||
*/
|
||||
export function OnFileDrop(callback, useDropTarget) {
|
||||
return window.runtime.OnFileDrop(callback, useDropTarget);
|
||||
}
|
||||
|
||||
/**
|
||||
* OnFileDropOff removes the drag and drop listeners and handlers.
|
||||
*/
|
||||
export function OnFileDropOff() {
|
||||
return window.runtime.OnFileDropOff();
|
||||
}
|
||||
|
||||
export function CanResolveFilePaths() {
|
||||
return window.runtime.CanResolveFilePaths();
|
||||
}
|
||||
|
||||
export function ResolveFilePaths(files) {
|
||||
return window.runtime.ResolveFilePaths(files);
|
||||
}
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
package goversion
|
||||
|
||||
const MinRequirement string = "1.18"
|
||||
const MinRequirement string = "1.20"
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ type Project struct {
|
|||
// The address to bind the wails dev server to. Default "localhost:34115"
|
||||
DevServer string `json:"devServer"`
|
||||
|
||||
// Arguments that are forwared to the application in dev mode
|
||||
// Arguments that are forward to the application in dev mode
|
||||
AppArgs string `json:"appargs"`
|
||||
|
||||
// NSISType to be build
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ func COPY(source string, target string) {
|
|||
defer closefile(src)
|
||||
d, err := os.Create(target)
|
||||
checkError(err)
|
||||
defer closefile(d)
|
||||
_, err = io.Copy(d, src)
|
||||
checkError(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,24 +52,31 @@ func GetEmbedDetailsForFile(file *ast.File, baseDir string) []*EmbedDetails {
|
|||
for _, c := range comment.List {
|
||||
if strings.HasPrefix(c.Text, "//go:embed") {
|
||||
sl := strings.Split(c.Text, " ")
|
||||
path := ""
|
||||
all := false
|
||||
if len(sl) == 1 {
|
||||
continue
|
||||
}
|
||||
embedPath := strings.TrimSpace(sl[1])
|
||||
switch true {
|
||||
case strings.HasPrefix(embedPath, "all:"):
|
||||
path = strings.TrimPrefix(embedPath, "all:")
|
||||
all = true
|
||||
default:
|
||||
path = embedPath
|
||||
// support for multiple paths in one comment
|
||||
for _, arg := range sl[1:] {
|
||||
embedPath := strings.TrimSpace(arg)
|
||||
// ignores all pattern matching characters except escape sequence
|
||||
if strings.Contains(embedPath, "*") || strings.Contains(embedPath, "?") || strings.Contains(embedPath, "[") {
|
||||
continue
|
||||
}
|
||||
if strings.HasPrefix(embedPath, "all:") {
|
||||
result = append(result, &EmbedDetails{
|
||||
EmbedPath: strings.TrimPrefix(embedPath, "all:"),
|
||||
All: true,
|
||||
BaseDir: baseDir,
|
||||
})
|
||||
} else {
|
||||
result = append(result, &EmbedDetails{
|
||||
EmbedPath: embedPath,
|
||||
All: false,
|
||||
BaseDir: baseDir,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
result = append(result, &EmbedDetails{
|
||||
EmbedPath: path,
|
||||
All: all,
|
||||
BaseDir: baseDir,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
package staticanalysis
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestGetEmbedDetails(t *testing.T) {
|
||||
|
|
@ -25,6 +26,10 @@ func TestGetEmbedDetails(t *testing.T) {
|
|||
EmbedPath: "frontend/dist",
|
||||
All: true,
|
||||
},
|
||||
{
|
||||
EmbedPath: "frontend/static",
|
||||
All: false,
|
||||
},
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -25,11 +25,11 @@ require (
|
|||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasttemplate v1.2.1 // indirect
|
||||
github.com/wailsapp/mimetype v1.4.1 // indirect
|
||||
golang.org/x/crypto v0.14.0 // indirect
|
||||
golang.org/x/crypto v0.17.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect
|
||||
golang.org/x/net v0.17.0 // indirect
|
||||
golang.org/x/sys v0.13.0 // indirect
|
||||
golang.org/x/text v0.13.0 // indirect
|
||||
golang.org/x/sys v0.15.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
)
|
||||
|
||||
// replace github.com/wailsapp/wails/v2 v2.0.0 => C:\Users\leaan
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhw
|
|||
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
|
||||
github.com/wailsapp/wails/v2 v2.3.1 h1:ZJz+pyIBKyASkgO8JO31NuHO1gTTHmvwiHYHwei1CqM=
|
||||
github.com/wailsapp/wails/v2 v2.3.1/go.mod h1:zlNLI0E2c2qA6miiuAHtp0Bac8FaGH0tlhA19OssR/8=
|
||||
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
|
||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
|
||||
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 h1:3MTrJm4PyNL9NBqvYDSj3DHl46qQakyfqfWo4jgfaEM=
|
||||
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE=
|
||||
golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
|
|
@ -73,12 +73,12 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
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/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
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.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
|
|
|||
|
|
@ -8,9 +8,12 @@ import (
|
|||
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
||||
)
|
||||
|
||||
//go:embed all:frontend/dist
|
||||
//go:embed all:frontend/dist frontend/static
|
||||
var assets embed.FS
|
||||
|
||||
//go:embed frontend/src/*.json
|
||||
var srcjson embed.FS
|
||||
|
||||
func main() {
|
||||
// Create an instance of the app structure
|
||||
app := NewApp()
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package typescriptify
|
|||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
|
|
@ -24,7 +24,7 @@ const (
|
|||
if (!a) {
|
||||
return a;
|
||||
}
|
||||
if (a.slice) {
|
||||
if (a.slice && a.map) {
|
||||
return (a as any[]).map(elem => this.convertValues(elem, classs));
|
||||
} else if ("object" === typeof a) {
|
||||
if (asMap) {
|
||||
|
|
@ -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 {
|
||||
|
|
@ -586,9 +586,6 @@ func (t *TypeScriptify) convertType(depth int, typeOf reflect.Type, customCode m
|
|||
return "", nil
|
||||
}
|
||||
fields := t.deepFields(typeOf)
|
||||
if len(fields) == 0 {
|
||||
return "", nil
|
||||
}
|
||||
t.logf(depth, "Converting type %s", typeOf.String())
|
||||
if differentNamespaces(t.Namespace, typeOf) {
|
||||
return "", nil
|
||||
|
|
@ -894,7 +891,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 += "?"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ func (d *assetHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
// serveFile will try to load the file from the fs.FS and write it to the response
|
||||
// serveFSFile will try to load the file from the fs.FS and write it to the response
|
||||
func (d *assetHandler) serveFSFile(rw http.ResponseWriter, req *http.Request, filename string) error {
|
||||
if d.fs == nil {
|
||||
return os.ErrNotExist
|
||||
|
|
|
|||
|
|
@ -1,18 +1,22 @@
|
|||
//go:build dev
|
||||
// +build dev
|
||||
|
||||
package assetserver
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"net/url"
|
||||
|
||||
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
||||
)
|
||||
|
||||
func NewProxyServer(proxyURL string) http.Handler {
|
||||
parsedURL, err := url.Parse(proxyURL)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return httputil.NewSingleHostReverseProxy(parsedURL)
|
||||
}
|
||||
|
||||
func NewExternalAssetsHandler(logger Logger, options assetserver.Options, url *url.URL) http.Handler {
|
||||
baseHandler := options.Handler
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"golang.org/x/net/html"
|
||||
"html/template"
|
||||
|
||||
"github.com/wailsapp/wails/v2/pkg/options"
|
||||
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
||||
|
|
@ -67,9 +68,11 @@ func NewAssetServer(bindingsJSON string, options assetserver.Options, servingFro
|
|||
}
|
||||
|
||||
func NewAssetServerWithHandler(handler http.Handler, bindingsJSON string, servingFromDisk bool, logger Logger, runtime RuntimeAssets) (*AssetServer, error) {
|
||||
|
||||
var buffer bytes.Buffer
|
||||
if bindingsJSON != "" {
|
||||
buffer.WriteString(`window.wailsbindings='` + bindingsJSON + `';` + "\n")
|
||||
escapedBindingsJSON := template.JSEscapeString(bindingsJSON)
|
||||
buffer.WriteString(`window.wailsbindings='` + escapedBindingsJSON + `';` + "\n")
|
||||
}
|
||||
buffer.Write(runtime.RuntimeDesktopJS())
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ func (d *AssetServer) processWebViewRequest(r webview.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
// processHTTPRequest processes the HTTP Request by faking a golang HTTP Server.
|
||||
// processWebViewRequestInternal processes the HTTP Request by faking a golang HTTP Server.
|
||||
// The request will be finished with a StatusNotImplemented code if no handler has written to the response.
|
||||
func (d *AssetServer) processWebViewRequestInternal(r webview.Request) {
|
||||
uri := "unknown"
|
||||
|
|
@ -131,7 +131,7 @@ func (d *AssetServer) processWebViewRequestInternal(r webview.Request) {
|
|||
}
|
||||
|
||||
if req.ContentLength == 0 {
|
||||
req.ContentLength, _ = strconv.ParseInt(req.Header.Get(HeaderContentLength), 10, 64)
|
||||
req.ContentLength = -1
|
||||
} else {
|
||||
size := strconv.FormatInt(req.ContentLength, 10)
|
||||
req.Header.Set(HeaderContentLength, size)
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue