Compare commits
5 commits
master
...
claude/fix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
742eccfdc0 |
||
|
|
b58ccc8236 |
||
|
|
d8f9db065a |
||
|
|
f369a298ef |
||
|
|
e57400c49d |
|
|
@ -11,6 +11,7 @@ type Init struct {
|
|||
InitGit bool `name:"g" description:"Initialise git repository"`
|
||||
IDE string `name:"ide" description:"Generate IDE project files"`
|
||||
List bool `name:"l" description:"List templates"`
|
||||
Force bool `name:"f" description:"Force init in non-empty directory (use with caution)"`
|
||||
}
|
||||
|
||||
func (i *Init) Default() *Init {
|
||||
|
|
|
|||
|
|
@ -105,6 +105,15 @@ func initProject(f *flags.Init) error {
|
|||
// Try to discover author details from git config
|
||||
findAuthorDetails(options)
|
||||
|
||||
// Safety check: fail if target directory is non-empty
|
||||
absTargetDir, err := GetAbsoluteTargetDir(f.ProjectDir)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to resolve target directory path: %w", err)
|
||||
}
|
||||
if err := CheckDirectorySafety(absTargetDir, f.Force); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Start Time
|
||||
start := time.Now()
|
||||
|
||||
|
|
|
|||
51
v2/cmd/wails/init_safety.go
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/wailsapp/wails/v2/internal/fs"
|
||||
)
|
||||
|
||||
// GetAbsoluteTargetDir returns the absolute path of the target directory.
|
||||
// If targetDir is empty, it returns an empty string (no target directory specified).
|
||||
func GetAbsoluteTargetDir(targetDir string) (string, error) {
|
||||
if targetDir == "" {
|
||||
return "", nil
|
||||
}
|
||||
return filepath.Abs(targetDir)
|
||||
}
|
||||
|
||||
// CheckDirectorySafety checks if the target directory is safe to initialize a project in.
|
||||
// It returns an error if the directory exists and is non-empty, unless force is true.
|
||||
// The absTargetDir should be an absolute path obtained from GetAbsoluteTargetDir.
|
||||
func CheckDirectorySafety(absTargetDir string, force bool) error {
|
||||
// If no target directory is specified, the default behavior creates a new directory
|
||||
// with the project name, so we don't need to check safety
|
||||
if absTargetDir == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
// If directory doesn't exist, it's safe
|
||||
if !fs.DirExists(absTargetDir) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Check if directory is empty
|
||||
isEmpty, err := fs.DirIsEmpty(absTargetDir)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to check target directory: %w", err)
|
||||
}
|
||||
|
||||
// If directory is empty, it's safe
|
||||
if isEmpty {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Directory is non-empty - fail unless force flag is set
|
||||
if force {
|
||||
return nil
|
||||
}
|
||||
|
||||
return fmt.Errorf("target directory '%s' is not empty. Aborting to prevent data loss. Use -f to force init in a non-empty directory", absTargetDir)
|
||||
}
|
||||
177
v2/cmd/wails/init_safety_test.go
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGetAbsoluteTargetDir(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
targetDir string
|
||||
wantEmpty bool
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "empty string returns empty",
|
||||
targetDir: "",
|
||||
wantEmpty: true,
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "relative path returns absolute",
|
||||
targetDir: "relative/path",
|
||||
wantEmpty: false,
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "absolute path returns absolute",
|
||||
targetDir: "/absolute/path",
|
||||
wantEmpty: false,
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "current directory returns absolute",
|
||||
targetDir: ".",
|
||||
wantEmpty: false,
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result, err := GetAbsoluteTargetDir(tt.targetDir)
|
||||
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("GetAbsoluteTargetDir() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
}
|
||||
|
||||
if tt.wantEmpty && result != "" {
|
||||
t.Errorf("GetAbsoluteTargetDir() = %v, want empty string", result)
|
||||
}
|
||||
|
||||
if !tt.wantEmpty {
|
||||
if result == "" {
|
||||
t.Error("GetAbsoluteTargetDir() returned empty string, want non-empty")
|
||||
}
|
||||
if !filepath.IsAbs(result) {
|
||||
t.Errorf("GetAbsoluteTargetDir() = %v, want absolute path", result)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckDirectorySafety(t *testing.T) {
|
||||
// Create a temporary directory for testing
|
||||
tempDir := t.TempDir()
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
force bool
|
||||
setup func(t *testing.T) string // returns absolute path to use, may create files
|
||||
wantErr bool
|
||||
errMsg string // substring to check in error message
|
||||
}{
|
||||
{
|
||||
name: "empty target dir string - should be safe",
|
||||
force: false,
|
||||
setup: func(t *testing.T) string { return "" },
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "non-existent directory - should be safe",
|
||||
force: false,
|
||||
setup: func(t *testing.T) string {
|
||||
return filepath.Join(tempDir, "nonexistent")
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "empty existing directory - should be safe",
|
||||
force: false,
|
||||
setup: func(t *testing.T) string {
|
||||
dir := filepath.Join(tempDir, "empty_dir")
|
||||
if err := os.Mkdir(dir, 0755); err != nil {
|
||||
t.Fatalf("failed to create test directory: %v", err)
|
||||
}
|
||||
return dir
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "non-empty directory with force flag - should be safe",
|
||||
force: true,
|
||||
setup: func(t *testing.T) string {
|
||||
dir := filepath.Join(tempDir, "nonempty_force")
|
||||
if err := os.Mkdir(dir, 0755); err != nil {
|
||||
t.Fatalf("failed to create test directory: %v", err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(dir, "file.txt"), []byte("content"), 0644); err != nil {
|
||||
t.Fatalf("failed to create test file: %v", err)
|
||||
}
|
||||
return dir
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "non-empty directory without force - should return error",
|
||||
force: false,
|
||||
setup: func(t *testing.T) string {
|
||||
dir := filepath.Join(tempDir, "nonempty_no_force")
|
||||
if err := os.Mkdir(dir, 0755); err != nil {
|
||||
t.Fatalf("failed to create test directory: %v", err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(dir, "file.txt"), []byte("content"), 0644); err != nil {
|
||||
t.Fatalf("failed to create test file: %v", err)
|
||||
}
|
||||
return dir
|
||||
},
|
||||
wantErr: true,
|
||||
errMsg: "Use -f to force",
|
||||
},
|
||||
{
|
||||
name: "non-empty directory with .git folder - should return error",
|
||||
force: false,
|
||||
setup: func(t *testing.T) string {
|
||||
dir := filepath.Join(tempDir, "with_git")
|
||||
if err := os.Mkdir(dir, 0755); err != nil {
|
||||
t.Fatalf("failed to create test directory: %v", err)
|
||||
}
|
||||
if err := os.Mkdir(filepath.Join(dir, ".git"), 0755); err != nil {
|
||||
t.Fatalf("failed to create .git directory: %v", err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(dir, ".git", "config"), []byte("[core]"), 0644); err != nil {
|
||||
t.Fatalf("failed to create test file: %v", err)
|
||||
}
|
||||
return dir
|
||||
},
|
||||
wantErr: true,
|
||||
errMsg: "not empty",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
absTargetDir := tt.setup(t)
|
||||
|
||||
err := CheckDirectorySafety(absTargetDir, tt.force)
|
||||
|
||||
// Check error expectation
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("CheckDirectorySafety() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
}
|
||||
|
||||
// Check error message contains expected substring
|
||||
if tt.wantErr && tt.errMsg != "" {
|
||||
if !strings.Contains(err.Error(), tt.errMsg) {
|
||||
t.Errorf("CheckDirectorySafety() error = %v, want error containing %q", err, tt.errMsg)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
12
v3/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
examples/kitchensink/kitchensink
|
||||
cmd/wails3/wails
|
||||
/examples/systray-menu/systray
|
||||
/examples/window/window
|
||||
/examples/dialogs/dialogs
|
||||
/examples/menu/menu
|
||||
/examples/clipboard/clipboard
|
||||
/examples/plain/plain
|
||||
/cmd/wails3/ui/.task/
|
||||
!internal/commands/webview2/MicrosoftEdgeWebview2Setup.exe
|
||||
internal/commands/appimage_testfiles/appimage_testfiles
|
||||
testiosapp/
|
||||
1
v3/.prettierignore
Normal file
|
|
@ -0,0 +1 @@
|
|||
website
|
||||
6
v3/.prettierrc.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
overrides:
|
||||
- files:
|
||||
- "**/*.md"
|
||||
options:
|
||||
printWidth: 80
|
||||
proseWrap: always
|
||||
1025
v3/ANDROID_ARCHITECTURE.md
Normal file
419
v3/IOS_ARCHITECTURE.md
Normal file
|
|
@ -0,0 +1,419 @@
|
|||
# Wails v3 iOS Architecture
|
||||
|
||||
## Executive Summary
|
||||
|
||||
This document provides a comprehensive technical architecture for iOS support in Wails v3. The implementation enables Go applications to run natively on iOS with a WKWebView frontend, maintaining the Wails philosophy of using web technologies for UI while leveraging Go for business logic.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
1. [Architecture Overview](#architecture-overview)
|
||||
2. [Core Components](#core-components)
|
||||
3. [Layer Architecture](#layer-architecture)
|
||||
4. [Implementation Details](#implementation-details)
|
||||
5. [Battery Optimization](#battery-optimization)
|
||||
6. [Build System](#build-system)
|
||||
7. [Security Considerations](#security-considerations)
|
||||
8. [API Reference](#api-reference)
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
### Design Principles
|
||||
|
||||
1. **Battery Efficiency First**: All architectural decisions prioritize battery life
|
||||
2. **No Network Ports**: Asset serving happens in-process via native APIs
|
||||
3. **Minimal WebView Instances**: Maximum 2 concurrent WebViews (1 primary, 1 for transitions)
|
||||
4. **Native Integration**: Deep iOS integration using Objective-C runtime
|
||||
5. **Wails v3 Compatibility**: Maintain API compatibility with existing Wails v3 applications
|
||||
|
||||
### High-Level Architecture
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ iOS Application │
|
||||
├─────────────────────────────────────────────────────────────┤
|
||||
│ UIKit Framework │
|
||||
│ ┌─────────────────────────────────────────────────────┐ │
|
||||
│ │ WailsViewController │ │
|
||||
│ │ ┌───────────────────────────────────────────────┐ │ │
|
||||
│ │ │ WKWebView Instance │ │ │
|
||||
│ │ │ ┌─────────────────────────────────────────┐ │ │ │
|
||||
│ │ │ │ Web Application (HTML/JS) │ │ │ │
|
||||
│ │ │ └─────────────────────────────────────────┘ │ │ │
|
||||
│ │ └───────────────────────────────────────────────┘ │ │
|
||||
│ └─────────────────────────────────────────────────────┘ │
|
||||
├─────────────────────────────────────────────────────────────┤
|
||||
│ Bridge Layer (CGO) │
|
||||
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
|
||||
│ │URL Handler │ │JS Bridge │ │Message Handler│ │
|
||||
│ └──────────────┘ └──────────────┘ └──────────────┘ │
|
||||
├─────────────────────────────────────────────────────────────┤
|
||||
│ Go Runtime │
|
||||
│ ┌──────────────────────────────────────────────────────┐ │
|
||||
│ │ Wails Application │ │
|
||||
│ │ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │ │
|
||||
│ │ │App Logic │ │Services │ │Asset Server │ │ │
|
||||
│ │ └──────────┘ └──────────┘ └──────────────────┘ │ │
|
||||
│ └──────────────────────────────────────────────────────┘ │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## Core Components
|
||||
|
||||
### 1. Platform Layer (`application_ios.go`)
|
||||
|
||||
**Purpose**: Go interface for iOS platform operations
|
||||
|
||||
**Key Functions**:
|
||||
- `platformRun()`: Initialize and run the iOS application
|
||||
- `platformQuit()`: Gracefully shutdown the application
|
||||
- `isDarkMode()`: Detect iOS dark mode state
|
||||
- `ExecuteJavaScript(windowID uint, js string)`: Execute JS in WebView
|
||||
|
||||
**Exported Go Functions (Called from Objective-C)**:
|
||||
- `ServeAssetRequest(windowID C.uint, urlStr *C.char, callbackID C.uint)`
|
||||
- `HandleJSMessage(windowID C.uint, message *C.char)`
|
||||
|
||||
### 2. Native iOS Layer (`application_ios.m`)
|
||||
|
||||
**Components**:
|
||||
|
||||
#### WailsSchemeHandler
|
||||
```objc
|
||||
@interface WailsSchemeHandler : NSObject <WKURLSchemeHandler>
|
||||
```
|
||||
- Implements `WKURLSchemeHandler` protocol
|
||||
- Intercepts `wails://` URL requests
|
||||
- Bridges to Go for asset serving
|
||||
- Manages pending requests with callback IDs
|
||||
|
||||
**Methods**:
|
||||
- `startURLSchemeTask:`: Intercept request, call Go handler
|
||||
- `stopURLSchemeTask:`: Cancel pending request
|
||||
- `completeRequest:withData:mimeType:`: Complete request with data from Go
|
||||
|
||||
#### WailsMessageHandler
|
||||
```objc
|
||||
@interface WailsMessageHandler : NSObject <WKScriptMessageHandler>
|
||||
```
|
||||
- Implements JavaScript to Go communication
|
||||
- Handles `window.webkit.messageHandlers.external.postMessage()`
|
||||
- Serializes messages to JSON for Go processing
|
||||
|
||||
**Methods**:
|
||||
- `userContentController:didReceiveScriptMessage:`: Process JS messages
|
||||
|
||||
#### WailsViewController
|
||||
```objc
|
||||
@interface WailsViewController : UIViewController
|
||||
```
|
||||
- Main view controller containing WKWebView
|
||||
- Manages WebView lifecycle
|
||||
- Handles JavaScript execution requests
|
||||
|
||||
**Properties**:
|
||||
- `webView`: WKWebView instance
|
||||
- `schemeHandler`: Custom URL scheme handler
|
||||
- `messageHandler`: JS message handler
|
||||
- `windowID`: Unique window identifier
|
||||
|
||||
**Methods**:
|
||||
- `viewDidLoad`: Initialize WebView with configuration
|
||||
- `executeJavaScript:`: Run JS code in WebView
|
||||
|
||||
### 3. Bridge Layer (CGO)
|
||||
|
||||
**C Interface Functions**:
|
||||
```c
|
||||
void ios_app_init(void); // Initialize iOS app
|
||||
void ios_app_run(void); // Run main loop
|
||||
void ios_app_quit(void); // Quit application
|
||||
bool ios_is_dark_mode(void); // Check dark mode
|
||||
unsigned int ios_create_webview(void); // Create WebView
|
||||
void ios_execute_javascript(unsigned int windowID, const char* js);
|
||||
void ios_complete_request(unsigned int callbackID, const char* data, const char* mimeType);
|
||||
```
|
||||
|
||||
## Layer Architecture
|
||||
|
||||
### Layer 1: Presentation Layer (WebView)
|
||||
|
||||
**Responsibilities**:
|
||||
- Render HTML/CSS/JavaScript UI
|
||||
- Handle user interactions
|
||||
- Communicate with native layer
|
||||
|
||||
**Key Features**:
|
||||
- WKWebView for modern web standards
|
||||
- Hardware-accelerated rendering
|
||||
- Efficient memory management
|
||||
|
||||
### Layer 2: Communication Layer
|
||||
|
||||
**Request Interception**:
|
||||
```
|
||||
WebView Request → WKURLSchemeHandler → Go ServeAssetRequest → AssetServer → Response
|
||||
```
|
||||
|
||||
**JavaScript Bridge**:
|
||||
```
|
||||
JS postMessage → WKScriptMessageHandler → Go HandleJSMessage → Process → ExecuteJavaScript
|
||||
```
|
||||
|
||||
### Layer 3: Application Layer (Go)
|
||||
|
||||
**Components**:
|
||||
- Application lifecycle management
|
||||
- Service binding and method calls
|
||||
- Asset serving from embedded fs.FS
|
||||
- Business logic execution
|
||||
|
||||
### Layer 4: Platform Integration Layer
|
||||
|
||||
**iOS-Specific Features**:
|
||||
- Dark mode detection
|
||||
- System appearance integration
|
||||
- iOS-specific optimizations
|
||||
|
||||
## Implementation Details
|
||||
|
||||
### Request Handling Flow
|
||||
|
||||
1. **WebView makes request** to `wails://localhost/path`
|
||||
2. **WKURLSchemeHandler intercepts** request
|
||||
3. **Creates callback ID** and stores `WKURLSchemeTask`
|
||||
4. **Calls Go function** `ServeAssetRequest` with URL and callback ID
|
||||
5. **Go processes request** through AssetServer
|
||||
6. **Go calls** `ios_complete_request` with response data
|
||||
7. **Objective-C completes** the `WKURLSchemeTask` with response
|
||||
|
||||
### JavaScript Execution Flow
|
||||
|
||||
1. **Go calls** `ios_execute_javascript` with JS code
|
||||
2. **Bridge dispatches** to main thread
|
||||
3. **WKWebView evaluates** JavaScript
|
||||
4. **Completion handler** logs any errors
|
||||
|
||||
### Message Passing Flow
|
||||
|
||||
1. **JavaScript calls** `window.webkit.messageHandlers.wails.postMessage(data)`
|
||||
2. **WKScriptMessageHandler receives** message
|
||||
3. **Serializes to JSON** and passes to Go
|
||||
4. **Go processes** message in `HandleJSMessage`
|
||||
5. **Go can respond** via `ExecuteJavaScript`
|
||||
|
||||
## Battery Optimization
|
||||
|
||||
### WebView Configuration
|
||||
|
||||
```objc
|
||||
// Disable unnecessary features
|
||||
config.suppressesIncrementalRendering = NO;
|
||||
config.allowsInlineMediaPlayback = YES;
|
||||
config.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone;
|
||||
```
|
||||
|
||||
### Memory Management
|
||||
|
||||
1. **Single WebView Instance**: Reuse instead of creating new instances
|
||||
2. **Automatic Reference Counting**: Use ARC for Objective-C objects
|
||||
3. **Lazy Loading**: Initialize components only when needed
|
||||
4. **Resource Cleanup**: Properly release resources when done
|
||||
|
||||
### Request Optimization
|
||||
|
||||
1. **In-Process Serving**: No network overhead
|
||||
2. **Direct Memory Transfer**: Pass data directly without serialization
|
||||
3. **Efficient Caching**: Leverage WKWebView's built-in cache
|
||||
4. **Minimal Wake Locks**: No background network activity
|
||||
|
||||
## Build System
|
||||
|
||||
### Build Tags
|
||||
|
||||
```go
|
||||
//go:build ios
|
||||
```
|
||||
|
||||
### CGO Configuration
|
||||
|
||||
```go
|
||||
#cgo CFLAGS: -x objective-c -fobjc-arc
|
||||
#cgo LDFLAGS: -framework Foundation -framework UIKit -framework WebKit
|
||||
```
|
||||
|
||||
### Build Script (`build_ios.sh`)
|
||||
|
||||
**Steps**:
|
||||
1. Check dependencies (go, xcodebuild, xcrun)
|
||||
2. Set up iOS cross-compilation environment
|
||||
3. Build Go binary with iOS tags
|
||||
4. Create app bundle structure
|
||||
5. Generate Info.plist
|
||||
6. Sign for simulator
|
||||
7. Create launch script
|
||||
|
||||
**Environment Variables**:
|
||||
```bash
|
||||
export CGO_ENABLED=1
|
||||
export GOOS=ios
|
||||
export GOARCH=arm64
|
||||
export SDK_PATH=$(xcrun --sdk iphonesimulator --show-sdk-path)
|
||||
```
|
||||
|
||||
### Simulator Deployment
|
||||
|
||||
```bash
|
||||
xcrun simctl install "$DEVICE_ID" "WailsIOSDemo.app"
|
||||
xcrun simctl launch "$DEVICE_ID" "com.wails.iosdemo"
|
||||
```
|
||||
|
||||
## Security Considerations
|
||||
|
||||
### URL Scheme Security
|
||||
|
||||
1. **Custom Scheme**: Use `wails://` to avoid conflicts
|
||||
2. **Origin Validation**: Only serve to authorized WebViews
|
||||
3. **No External Access**: Scheme handler only responds to app's WebView
|
||||
|
||||
### JavaScript Execution
|
||||
|
||||
1. **Input Validation**: Sanitize JS code before execution
|
||||
2. **Sandboxed Execution**: WKWebView provides isolation
|
||||
3. **No eval()**: Avoid dynamic code evaluation
|
||||
|
||||
### Data Protection
|
||||
|
||||
1. **In-Memory Only**: No temporary files on disk
|
||||
2. **ATS Compliance**: App Transport Security enabled
|
||||
3. **Secure Communication**: All data stays within app process
|
||||
|
||||
## API Reference
|
||||
|
||||
### Go API
|
||||
|
||||
#### Application Functions
|
||||
|
||||
```go
|
||||
// Create new iOS application
|
||||
app := application.New(application.Options{
|
||||
Name: "App Name",
|
||||
Description: "App Description",
|
||||
})
|
||||
|
||||
// Run the application
|
||||
app.Run()
|
||||
|
||||
// Execute JavaScript
|
||||
app.ExecuteJavaScript(windowID, "console.log('Hello')")
|
||||
```
|
||||
|
||||
#### Service Binding
|
||||
|
||||
```go
|
||||
type MyService struct{}
|
||||
|
||||
func (s *MyService) Greet(name string) string {
|
||||
return fmt.Sprintf("Hello, %s!", name)
|
||||
}
|
||||
|
||||
app := application.New(application.Options{
|
||||
Services: []application.Service{
|
||||
application.NewService(&MyService{}),
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
### JavaScript API
|
||||
|
||||
#### Send Message to Go
|
||||
|
||||
```javascript
|
||||
window.webkit.messageHandlers.wails.postMessage({
|
||||
type: 'methodCall',
|
||||
service: 'MyService',
|
||||
method: 'Greet',
|
||||
args: ['World']
|
||||
});
|
||||
```
|
||||
|
||||
#### Receive from Go
|
||||
|
||||
```javascript
|
||||
window.wailsCallback = function(data) {
|
||||
console.log('Received:', data);
|
||||
};
|
||||
```
|
||||
|
||||
### Objective-C Bridge API
|
||||
|
||||
#### From Go to Objective-C
|
||||
|
||||
```c
|
||||
// Execute JavaScript
|
||||
ios_execute_javascript(windowID, "alert('Hello')");
|
||||
|
||||
// Complete asset request
|
||||
ios_complete_request(callbackID, htmlData, "text/html");
|
||||
```
|
||||
|
||||
#### From Objective-C to Go
|
||||
|
||||
```c
|
||||
// Serve asset request
|
||||
ServeAssetRequest(windowID, urlString, callbackID);
|
||||
|
||||
// Handle JavaScript message
|
||||
HandleJSMessage(windowID, jsonMessage);
|
||||
```
|
||||
|
||||
## Performance Metrics
|
||||
|
||||
### Target Metrics
|
||||
|
||||
- **WebView Creation**: < 100ms
|
||||
- **Asset Request**: < 10ms for cached, < 50ms for first load
|
||||
- **JS Execution**: < 5ms for simple scripts
|
||||
- **Message Passing**: < 2ms round trip
|
||||
- **Memory Usage**: < 50MB baseline
|
||||
- **Battery Impact**: < 2% per hour active use
|
||||
|
||||
### Monitoring
|
||||
|
||||
1. **Xcode Instruments**: CPU, Memory, Energy profiling
|
||||
2. **WebView Inspector**: JavaScript performance
|
||||
3. **Go Profiling**: pprof for Go code analysis
|
||||
|
||||
## Future Enhancements
|
||||
|
||||
### Phase 1: Core Stability
|
||||
- [ ] Production-ready error handling
|
||||
- [ ] Comprehensive test suite
|
||||
- [ ] Performance optimization
|
||||
|
||||
### Phase 2: Feature Parity
|
||||
- [ ] Multiple window support
|
||||
- [ ] System tray integration
|
||||
- [ ] Native menu implementation
|
||||
|
||||
### Phase 3: iOS-Specific Features
|
||||
- [ ] Widget extension support
|
||||
- [ ] App Clip support
|
||||
- [ ] ShareSheet integration
|
||||
- [ ] Siri Shortcuts
|
||||
|
||||
### Phase 4: Advanced Features
|
||||
- [ ] Background task support
|
||||
- [ ] Push notifications
|
||||
- [ ] CloudKit integration
|
||||
- [ ] Apple Watch companion app
|
||||
|
||||
## Conclusion
|
||||
|
||||
This architecture provides a solid foundation for iOS support in Wails v3. The design prioritizes battery efficiency, native performance, and seamless integration with the existing Wails ecosystem. The proof of concept demonstrates all four required capabilities:
|
||||
|
||||
1. ✅ **WebView Creation**: Native WKWebView with optimized configuration
|
||||
2. ✅ **Request Interception**: Custom scheme handler without network ports
|
||||
3. ✅ **JavaScript Execution**: Bidirectional communication bridge
|
||||
4. ✅ **iOS Simulator Support**: Complete build and deployment pipeline
|
||||
|
||||
The architecture is designed to scale from this proof of concept to a full production implementation while maintaining the simplicity and elegance that Wails developers expect.
|
||||
100
v3/IOS_FEATURES_TODO.md
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
# iOS Features TODO (Prioritized)
|
||||
|
||||
This document lists potential iOS features and platform options to enhance the Wails v3 iOS runtime. Items are ordered by importance for typical app development workflows.
|
||||
|
||||
## Top Priority (Implement first)
|
||||
|
||||
1) Input accessory bar control
|
||||
- Status: Implemented as `IOSOptions.DisableInputAccessoryView` (default false = shown). Native toggle + WKWebView subclass.
|
||||
|
||||
2) Scrolling and bounce behavior
|
||||
- Options:
|
||||
- `DisableScroll` (default true in current runtime to preserve no-scroll template behavior)
|
||||
- `DisableBounce` (default true in current runtime)
|
||||
- `HideScrollIndicators` (default true in current runtime)
|
||||
- Purpose: control elastic bounce, page scrolling, and indicators.
|
||||
|
||||
3) Web Inspector / Debug
|
||||
- Options:
|
||||
- `DisableInspectable` (default false; inspector enabled by default in dev)
|
||||
- Purpose: enable/disable WKWebView inspector.
|
||||
|
||||
4) Back/forward navigation gestures
|
||||
- Options:
|
||||
- `AllowsBackForwardNavigationGestures` (default false)
|
||||
- Purpose: enable iOS edge-swipe navigation.
|
||||
|
||||
5) Link previews
|
||||
- Options:
|
||||
- `DisableLinkPreview` (default false)
|
||||
- Purpose: allow long-press link previews.
|
||||
|
||||
6) Media autoplay and inline playback
|
||||
- Options:
|
||||
- `DisableInlineMediaPlayback` (default false)
|
||||
- `RequireUserActionForMediaPlayback` (default false)
|
||||
- Purpose: control media playback UX.
|
||||
|
||||
7) User agent customization
|
||||
- Options:
|
||||
- `UserAgent` (string)
|
||||
- `ApplicationNameForUserAgent` (string; default "wails.io")
|
||||
- Purpose: customize UA / identify app.
|
||||
|
||||
8) Keyboard behavior
|
||||
- Options:
|
||||
- Already: `DisableInputAccessoryView`
|
||||
- Future: `KeyboardDismissMode` (none | onDrag | interactive)
|
||||
- Purpose: refine keyboard UX.
|
||||
|
||||
9) Safe-area and content inset behavior
|
||||
- Options (future):
|
||||
- `ContentInsetAdjustment` (automatic | never | always)
|
||||
- `UseSafeArea` (bool)
|
||||
- Purpose: fine-tune layout under notch/home indicator.
|
||||
|
||||
10) Data detectors (future feasibility)
|
||||
- Options: `DataDetectorTypes []string` (phoneNumber, link, address)
|
||||
- Note: Not all are directly available on WKWebView; feasibility TBD.
|
||||
|
||||
## Medium Priority
|
||||
|
||||
11) Pull-to-refresh (custom)
|
||||
12) File picker / photo access bridges
|
||||
13) Haptics feedback helpers
|
||||
14) Clipboard read/write helpers (partially present)
|
||||
15) Share sheet / activity view bridges
|
||||
16) Background audio / PiP controls
|
||||
17) App lifecycle event hooks (background/foreground)
|
||||
18) Permissions prompts helpers (camera, mic, photos)
|
||||
19) Open in external browser vs in-app policy
|
||||
20) Cookie / storage policy helpers
|
||||
|
||||
## Low Priority
|
||||
|
||||
21) Theme/dynamic color helpers bridging to CSS vars
|
||||
22) Orientation lock helpers per window
|
||||
23) Status bar style control from Go
|
||||
24) Network reachability events bridge
|
||||
25) Push notifications
|
||||
|
||||
---
|
||||
|
||||
# Implementation Plan (Top 10)
|
||||
|
||||
Implement the following immediately:
|
||||
- DisableScroll, DisableBounce, HideScrollIndicators
|
||||
- AllowsBackForwardNavigationGestures
|
||||
- DisableLinkPreview
|
||||
- DisableInlineMediaPlayback
|
||||
- RequireUserActionForMediaPlayback
|
||||
- DisableInspectable
|
||||
- UserAgent
|
||||
- ApplicationNameForUserAgent
|
||||
|
||||
Approach:
|
||||
- Extend `IOSOptions` in `pkg/application/application_options.go` with these fields.
|
||||
- Add native globals + C setters in `pkg/application/application_ios.h/.m`.
|
||||
- Apply options in `pkg/application/webview_window_ios.m` during WKWebView configuration and on the scrollView.
|
||||
- Wire from Go in `pkg/application/application_ios.go`.
|
||||
- Maintain current template behavior as defaults (no scroll/bounce/indicators) to avoid regressions in existing tests.
|
||||
53
v3/IOS_RUNTIME.md
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# iOS Runtime Feature Plan
|
||||
|
||||
This document outlines proposed iOS-only runtime features for Wails v3, the initial milestones, and method shapes exposed to the frontend runtime as `IOS.*`.
|
||||
|
||||
## Goals
|
||||
- Provide a first-class iOS runtime namespace: `IOS`.
|
||||
- Expose UX-critical features with a small, well-defined, promise-based API.
|
||||
- Follow the existing runtime pattern: JS -> /wails/runtime -> Go -> ObjC.
|
||||
|
||||
## Object: IOS
|
||||
- Object ID: 11 (reserved in runtime objectNames)
|
||||
|
||||
## Milestone 1 (MVP)
|
||||
- Haptics
|
||||
- `IOS.Haptics.Impact(style: "light"|"medium"|"heavy"|"soft"|"rigid"): Promise<void>`
|
||||
- Device
|
||||
- `IOS.Device.Info(): Promise<{ model: string; systemName: string; systemVersion: string; isSimulator: boolean }>`
|
||||
|
||||
## Milestone 2
|
||||
- Permissions
|
||||
- `IOS.Permissions.Request("camera"|"microphone"|"photos"|"notifications"): Promise<"granted"|"denied"|"limited">`
|
||||
- `IOS.Permissions.Status(kind): Promise<"granted"|"denied"|"limited"|"restricted"|"not_determined">`
|
||||
- Camera
|
||||
- `IOS.Camera.PickPhoto(options?): Promise<{ uri: string }>`
|
||||
- `IOS.Camera.PickVideo(options?): Promise<{ uri: string, duration?: number }>`
|
||||
- Photos
|
||||
- `IOS.Photos.SaveImage(dataURL|blob, options?): Promise<void>`
|
||||
- `IOS.Photos.SaveVideo(fileURI, options?): Promise<void>`
|
||||
|
||||
## Milestone 3
|
||||
- Share
|
||||
- `IOS.Share.Sheet({ text?, url?, imageDataURL? }): Promise<void>`
|
||||
- Files
|
||||
- `IOS.Files.Pick({ types?, multiple? }): Promise<Array<{ uri: string, name: string, size?: number }>>`
|
||||
- Biometric
|
||||
- `IOS.Biometric.CanAuthenticate(): Promise<boolean>`
|
||||
- `IOS.Biometric.Authenticate(reason: string): Promise<boolean>`
|
||||
- Notifications
|
||||
- `IOS.Notifications.RequestPermission(): Promise<boolean>`
|
||||
- `IOS.Notifications.Schedule(localNotification): Promise<string /* id */>`
|
||||
|
||||
## Notes
|
||||
- All APIs should be safe no-ops on other platforms (reject with a meaningful error) or be tree-shaken by frontend bundlers.
|
||||
- UI-affecting APIs must ensure main-thread execution in ObjC.
|
||||
- File/Photo APIs will use security-scoped bookmarks where relevant.
|
||||
|
||||
## Implementation Status
|
||||
- [x] Define plan (this document)
|
||||
- [ ] JS runtime: add IOS object ID + IOS module exports
|
||||
- [ ] Go: message dispatcher for IOS object
|
||||
- [ ] iOS: Haptics.Impact(style) native bridge
|
||||
- [ ] JS->Go->ObjC wiring for Haptics
|
||||
- [ ] Device.Info() basic implementation
|
||||
9
v3/README.md
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# v3 Alpha
|
||||
|
||||
Thanks for wanting to help out with testing/developing Wails v3! This guide will help you get started.
|
||||
|
||||
## Getting Started
|
||||
|
||||
All the instructions for getting started are in the v3 documentation directory: `mkdocs-website`.
|
||||
Please read the README.md file in that directory for more information.
|
||||
|
||||
452
v3/TESTING.md
Normal file
|
|
@ -0,0 +1,452 @@
|
|||
# Cross-Platform Testing Guide for Wails v3
|
||||
|
||||
This document describes the comprehensive cross-platform testing system for Wails v3 examples, supporting Mac, Linux, and Windows compilation.
|
||||
|
||||
## Overview
|
||||
|
||||
The testing system ensures all Wails v3 examples build successfully across all supported platforms:
|
||||
- **macOS (Darwin)** - Native compilation
|
||||
- **Windows** - Cross-compilation from any platform
|
||||
- **Linux** - Multi-architecture Docker compilation (ARM64 + x86_64)
|
||||
|
||||
## Test Directory Structure
|
||||
|
||||
The testing infrastructure is organized in a dedicated test directory:
|
||||
|
||||
```bash
|
||||
v3/
|
||||
├── test/
|
||||
│ └── docker/
|
||||
│ ├── Dockerfile.linux-arm64 # ARM64 native compilation
|
||||
│ └── Dockerfile.linux-x86_64 # x86_64 native compilation
|
||||
├── Taskfile.yaml # Build task definitions
|
||||
└── TESTING.md # This documentation
|
||||
```
|
||||
|
||||
**Benefits of the organized structure:**
|
||||
- **Separation of Concerns**: Testing files are isolated from application code
|
||||
- **Clear Organization**: All Docker-related files in one location
|
||||
- **Easier Maintenance**: Centralized testing infrastructure
|
||||
- **Better Git Management**: Clean separation for .gitignore patterns
|
||||
|
||||
## Available Commands
|
||||
|
||||
### 🚀 Complete Cross-Platform Testing
|
||||
```bash
|
||||
# Build all examples for ALL platforms (macOS + Windows + Linux)
|
||||
task test:examples:all
|
||||
```
|
||||
**Total: 129 builds** (43 examples × 3 platforms) + CLI code testing
|
||||
|
||||
### All Examples (No DIR Parameter Needed)
|
||||
```bash
|
||||
# Current platform only (all 43 examples + CLI code)
|
||||
task test:examples
|
||||
|
||||
# All examples for specific Linux architectures
|
||||
task test:examples:linux:docker # Auto-detect architecture
|
||||
task test:examples:linux:docker:arm64 # ARM64 native
|
||||
task test:examples:linux:docker:x86_64 # x86_64 native
|
||||
|
||||
# CLI code testing only
|
||||
task test:cli
|
||||
```
|
||||
|
||||
### Single Example Builds (Requires DIR=example)
|
||||
```bash
|
||||
# macOS/Darwin single example
|
||||
task test:example:darwin DIR=badge
|
||||
|
||||
# Windows cross-compilation single example
|
||||
task test:example:windows DIR=badge
|
||||
|
||||
# Linux native builds (on Linux systems)
|
||||
task test:example:linux DIR=badge
|
||||
|
||||
# Linux Docker builds (multi-architecture)
|
||||
task test:example:linux:docker DIR=badge # Auto-detect architecture
|
||||
task test:example:linux:docker:arm64 DIR=badge # ARM64 native
|
||||
task test:example:linux:docker:x86_64 DIR=badge # x86_64 native
|
||||
```
|
||||
|
||||
## Build Artifacts
|
||||
|
||||
All builds generate platform-specific binaries with clear naming:
|
||||
- **macOS**: `testbuild-{example}-darwin`
|
||||
- **Windows**: `testbuild-{example}-windows.exe`
|
||||
- **Linux**: `testbuild-{example}-linux`
|
||||
- **Linux ARM64**: `testbuild-{example}-linux-arm64` (Docker)
|
||||
- **Linux x86_64**: `testbuild-{example}-linux-x86_64` (Docker)
|
||||
|
||||
Example outputs:
|
||||
```text
|
||||
examples/badge/testbuild-badge-darwin
|
||||
examples/badge/testbuild-badge-windows.exe
|
||||
examples/badge/testbuild-badge-linux-arm64
|
||||
examples/badge/testbuild-badge-linux-x86_64
|
||||
```
|
||||
|
||||
## Validation Status
|
||||
|
||||
### ✅ **Production Ready (v3.0.0-alpha)**
|
||||
- **Total Examples**: 43 examples fully tested
|
||||
- **macOS**: ✅ All examples compile successfully (100%)
|
||||
- **Windows**: ✅ All examples cross-compile successfully (100%)
|
||||
- **Linux**: ✅ Multi-architecture Docker compilation (ARM64 + x86_64)
|
||||
- **Build System**: Comprehensive Taskfile.yaml integration
|
||||
- **Git Integration**: Complete .gitignore patterns for build artifacts
|
||||
- **Total Build Capacity**: 129 cross-platform builds per test cycle
|
||||
|
||||
## Supported Examples
|
||||
|
||||
The system builds all 43 Wails v3 examples:
|
||||
- badge, badge-custom, binding, build
|
||||
- cancel-async, cancel-chaining, clipboard, contextmenus
|
||||
- dev, dialogs, dialogs-basic, drag-n-drop
|
||||
- environment, events, events-bug, file-association
|
||||
- frameless, gin-example, gin-routing, gin-service
|
||||
- hide-window, html-dnd-api, ignore-mouse, keybindings
|
||||
- menu, notifications, panic-handling, plain
|
||||
- raw-message, screen, services, show-macos-toolbar
|
||||
- single-instance, systray-basic, systray-custom, systray-menu
|
||||
- video, window, window-api, window-call
|
||||
- window-menu, wml
|
||||
|
||||
**Recently Added (v3.0.0-alpha):**
|
||||
- dev, events-bug, gin-example, gin-routing, gin-service
|
||||
- html-dnd-api, notifications
|
||||
|
||||
## Platform Requirements
|
||||
|
||||
### macOS (Darwin)
|
||||
- Go 1.23+
|
||||
- Xcode Command Line Tools
|
||||
- No additional dependencies required
|
||||
|
||||
**Environment Variables:**
|
||||
```bash
|
||||
CGO_LDFLAGS="-framework UniformTypeIdentifiers -mmacosx-version-min=10.13"
|
||||
CGO_CFLAGS="-mmacosx-version-min=10.13"
|
||||
```
|
||||
|
||||
### Windows (Cross-compilation)
|
||||
- Go 1.23+
|
||||
- No additional dependencies for cross-compilation
|
||||
|
||||
**Environment Variables:**
|
||||
```bash
|
||||
GOOS=windows
|
||||
GOARCH=amd64
|
||||
```
|
||||
|
||||
### Linux (Docker) - ✅ Multi-Architecture Support
|
||||
Uses Ubuntu 24.04 base image with full GTK development environment:
|
||||
|
||||
**Current Status:** Complete multi-architecture Docker compilation system
|
||||
- ✅ ARM64 native compilation (Ubuntu 24.04)
|
||||
- ✅ x86_64 native compilation (Ubuntu 24.04)
|
||||
- ✅ Automatic architecture detection
|
||||
- ✅ All dependencies install correctly (GTK + WebKit)
|
||||
- ✅ Go 1.24 environment configured for each architecture
|
||||
- ✅ Native compilation eliminates cross-compilation CGO issues
|
||||
|
||||
**Architecture Support:**
|
||||
- **ARM64**: Native compilation using `Dockerfile.linux-arm64`
|
||||
- **x86_64**: Native compilation using `Dockerfile.linux-x86_64` with `--platform=linux/amd64`
|
||||
- **Auto-detect**: Taskfile automatically selects appropriate architecture
|
||||
|
||||
**Core Dependencies:**
|
||||
- `build-essential` - GCC compiler toolchain (architecture-specific)
|
||||
- `pkg-config` - Package configuration tool
|
||||
- `libgtk-3-dev` - GTK+ 3.x development files
|
||||
- `libwebkit2gtk-4.1-dev` - WebKit2GTK development files
|
||||
- `git` - Version control (for go mod operations)
|
||||
- `ca-certificates` - HTTPS support
|
||||
|
||||
**Docker Images:**
|
||||
- `wails-v3-linux-arm64` - Ubuntu 24.04 ARM64 native compilation (built from `test/docker/Dockerfile.linux-arm64`)
|
||||
- `wails-v3-linux-x86_64` - Ubuntu 24.04 x86_64 native compilation (built from `test/docker/Dockerfile.linux-x86_64`)
|
||||
- `wails-v3-linux-fixed` - Legacy unified image (deprecated)
|
||||
|
||||
## Docker Configuration
|
||||
|
||||
### Multi-Architecture Build System
|
||||
|
||||
#### ARM64 Native Build Environment (`test/docker/Dockerfile.linux-arm64`)
|
||||
```dockerfile
|
||||
FROM ubuntu:24.04
|
||||
# ARM64 native compilation environment
|
||||
# Go 1.24.0 ARM64 binary (go1.24.0.linux-arm64.tar.gz)
|
||||
# Native GCC toolchain for ARM64
|
||||
# All GTK/WebKit dependencies for ARM64
|
||||
# Build script: /build/build-linux-arm64.sh
|
||||
# Output: testbuild-{example}-linux-arm64
|
||||
```
|
||||
|
||||
#### x86_64 Native Build Environment (`test/docker/Dockerfile.linux-x86_64`)
|
||||
```dockerfile
|
||||
FROM --platform=linux/amd64 ubuntu:24.04
|
||||
# x86_64 native compilation environment
|
||||
# Go 1.24.0 x86_64 binary (go1.24.0.linux-amd64.tar.gz)
|
||||
# Native GCC toolchain for x86_64
|
||||
# All GTK/WebKit dependencies for x86_64
|
||||
# Build script: /build/build-linux-x86_64.sh
|
||||
# Output: testbuild-{example}-linux-x86_64
|
||||
```
|
||||
|
||||
### Available Docker Tasks
|
||||
|
||||
#### Architecture-Specific Tasks
|
||||
```bash
|
||||
# ARM64 builds
|
||||
task test:example:linux:docker:arm64 DIR=badge
|
||||
task test:examples:linux:docker:arm64
|
||||
|
||||
# x86_64 builds
|
||||
task test:example:linux:docker:x86_64 DIR=badge
|
||||
task test:examples:linux:docker:x86_64
|
||||
```
|
||||
|
||||
#### Auto-Detection Tasks (Recommended)
|
||||
```bash
|
||||
# Single example (auto-detects host architecture)
|
||||
task test:example:linux:docker DIR=badge
|
||||
|
||||
# All examples (auto-detects host architecture)
|
||||
task test:examples:linux:docker
|
||||
```
|
||||
|
||||
## Implementation Details
|
||||
|
||||
### Key Fixes Applied in v3.0.0-alpha
|
||||
|
||||
#### 1. **Complete Example Coverage**
|
||||
- **Before**: 35 examples tested
|
||||
- **After**: 43 examples tested (100% coverage)
|
||||
- **Added**: dev, events-bug, gin-example, gin-routing, gin-service, html-dnd-api, notifications
|
||||
|
||||
#### 2. **Go Module Resolution**
|
||||
- **Issue**: Inconsistent replace directives across examples
|
||||
- **Fix**: Standardized all examples to use `replace github.com/wailsapp/wails/v3 => ../..`
|
||||
- **Examples Fixed**: gin-example, gin-routing, notifications
|
||||
|
||||
#### 3. **Frontend Asset Embedding**
|
||||
- **Issue**: Some examples referenced missing `frontend/dist` directories
|
||||
- **Fix**: Updated embed paths from `//go:embed all:frontend/dist` to `//go:embed all:frontend`
|
||||
- **Examples Fixed**: file-association, notifications
|
||||
|
||||
#### 4. **Manager API Migration**
|
||||
- **Issue**: Windows badge service using deprecated API
|
||||
- **Fix**: Updated `app.CurrentWindow()` → `app.Windows.Current()`
|
||||
- **Files Fixed**: pkg/services/badge/badge_windows.go
|
||||
|
||||
#### 5. **File Association Example**
|
||||
- **Issue**: Undefined window variable
|
||||
- **Fix**: Added proper window assignment from `app.Windows.NewWithOptions()`
|
||||
- **Files Fixed**: examples/file-association/main.go
|
||||
|
||||
### Build Performance
|
||||
- **macOS**: ~2-3 minutes for all 43 examples
|
||||
- **Windows Cross-Compile**: ~2-3 minutes for all 43 examples
|
||||
- **Linux Docker**: ~5-10 minutes for all 43 examples (includes image build)
|
||||
- **Total Build Time**: ~10-15 minutes for complete cross-platform validation (129 builds)
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Single Example Testing (Requires DIR Parameter)
|
||||
```bash
|
||||
# Test the badge example on all platforms
|
||||
task test:example:darwin DIR=badge # macOS native
|
||||
task test:example:windows DIR=badge # Windows cross-compile
|
||||
task test:example:linux:docker DIR=badge # Linux Docker (auto-detect arch)
|
||||
```
|
||||
|
||||
### All Examples Testing (No DIR Parameter)
|
||||
```bash
|
||||
# Test everything - all 43 examples, all platforms
|
||||
task test:examples:all
|
||||
|
||||
# This runs:
|
||||
# 1. All Darwin builds (43 examples)
|
||||
# 2. All Windows cross-compilation (43 examples)
|
||||
# 3. All Linux Docker builds (43 examples, auto-architecture)
|
||||
|
||||
# Platform-specific all examples
|
||||
task test:examples # Current platform (43 examples)
|
||||
task test:examples:linux:docker:arm64 # ARM64 builds (43 examples)
|
||||
task test:examples:linux:docker:x86_64 # x86_64 builds (43 examples)
|
||||
```
|
||||
|
||||
### Continuous Integration
|
||||
```bash
|
||||
# For CI/CD pipelines
|
||||
task test:examples:all # Complete cross-platform (129 builds)
|
||||
task test:examples # Current platform only (43 builds)
|
||||
```
|
||||
|
||||
## Build Process Details
|
||||
|
||||
### macOS Builds
|
||||
1. Sets macOS-specific CGO flags for compatibility
|
||||
2. Runs `go mod tidy` in each example directory
|
||||
3. Compiles with `go build -o testbuild-{example}-darwin`
|
||||
4. Links against UniformTypeIdentifiers framework
|
||||
|
||||
### Windows Cross-Compilation
|
||||
1. Sets `GOOS=windows GOARCH=amd64` environment
|
||||
2. Runs `go mod tidy` in each example directory
|
||||
3. Cross-compiles with `go build -o testbuild-{example}-windows.exe`
|
||||
4. No CGO dependencies required (uses Windows APIs)
|
||||
|
||||
### Linux Docker Builds
|
||||
1. **Auto-Detection**: Detects host architecture (ARM64 or x86_64)
|
||||
2. **Image Selection**: Uses appropriate Ubuntu 24.04 image for target architecture
|
||||
3. **Native Compilation**: Eliminates cross-compilation CGO issues
|
||||
4. **Environment Setup**: Full GTK/WebKit development environment
|
||||
5. **Build Process**: Runs `go mod tidy && go build` with native toolchain
|
||||
6. **Output**: Architecture-specific binaries (`-linux-arm64` or `-linux-x86_64`)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues (All Resolved in v3.0.0-alpha)
|
||||
|
||||
#### **Go Module Resolution Errors**
|
||||
```bash
|
||||
Error: replacement directory ../wails/v3 does not exist
|
||||
```
|
||||
**Solution**: All examples now use standardized `replace github.com/wailsapp/wails/v3 => ../..`
|
||||
|
||||
#### **Frontend Asset Embedding Errors**
|
||||
```bash
|
||||
Error: pattern frontend/dist: no matching files found
|
||||
```
|
||||
**Solution**: Updated to `//go:embed all:frontend` for examples without dist directories
|
||||
|
||||
#### **Manager API Errors**
|
||||
```bash
|
||||
Error: app.CurrentWindow undefined
|
||||
```
|
||||
**Solution**: Updated to use new manager pattern `app.Windows.Current()`
|
||||
|
||||
#### **Build Warnings**
|
||||
Some examples may show compatibility warnings (e.g., notifications using macOS 10.14+ APIs with 10.13 target). These are non-blocking warnings that can be addressed separately.
|
||||
|
||||
### Performance Optimization
|
||||
|
||||
#### **Parallel Builds**
|
||||
```bash
|
||||
# The task system automatically runs builds in parallel where possible
|
||||
task v3:test:examples:all # Optimized for maximum throughput
|
||||
```
|
||||
|
||||
#### **Selective Testing**
|
||||
```bash
|
||||
# Test specific examples to debug issues
|
||||
task v3:test:example:darwin DIR=badge
|
||||
task v3:test:example:windows DIR=contextmenus
|
||||
```
|
||||
|
||||
### Performance Tips
|
||||
|
||||
**Parallel Builds:**
|
||||
```bash
|
||||
# Build multiple examples simultaneously
|
||||
task v3:test:example:darwin DIR=badge &
|
||||
task v3:test:example:darwin DIR=binding &
|
||||
task v3:test:example:darwin DIR=build &
|
||||
wait
|
||||
```
|
||||
|
||||
**Docker Image Caching:**
|
||||
```bash
|
||||
# Pre-build Docker images
|
||||
docker build -f Dockerfile.linux -t wails-v3-linux-builder .
|
||||
docker build -f Dockerfile.linux-simple -t wails-v3-linux-simple .
|
||||
```
|
||||
|
||||
## Integration with Git
|
||||
|
||||
### Ignored Files
|
||||
All build artifacts are automatically ignored via `.gitignore`:
|
||||
```gitignore
|
||||
/v3/examples/*/testbuild-*
|
||||
```
|
||||
|
||||
### Clean Build Environment
|
||||
```bash
|
||||
# Remove all test build artifacts
|
||||
find v3/examples -name "testbuild-*" -delete
|
||||
```
|
||||
|
||||
## Validation Results
|
||||
|
||||
### Current Status (as of implementation):
|
||||
- ✅ **macOS**: All 43 examples compile successfully
|
||||
- ✅ **Windows**: All 43 examples cross-compile successfully
|
||||
- ✅ **Linux**: Multi-architecture Docker system fully functional
|
||||
|
||||
### Build Time Estimates:
|
||||
- **macOS**: ~2-3 minutes for all examples
|
||||
- **Windows**: ~2-3 minutes for all examples (cross-compile)
|
||||
- **Linux Docker**: ~5-10 minutes for all examples (includes image build and compilation)
|
||||
- **Complete Cross-Platform**: ~10-15 minutes for 129 total builds
|
||||
|
||||
## Future Enhancements
|
||||
|
||||
### Planned Improvements:
|
||||
1. **Automated Testing**: Add runtime testing in addition to compilation
|
||||
2. **Multi-Architecture**: Support ARM64 builds for Apple Silicon and Windows ARM
|
||||
3. **Build Caching**: Implement Go build cache for faster repeated builds
|
||||
4. **Parallel Docker**: Multi-stage Docker builds for faster Linux compilation
|
||||
5. **Platform Matrix**: GitHub Actions integration for automated CI/CD
|
||||
|
||||
### Platform Extensions:
|
||||
- **FreeBSD**: Add BSD build support
|
||||
- **Android/iOS**: Mobile platform compilation (when supported)
|
||||
- **WebAssembly**: WASM target compilation
|
||||
|
||||
## Changelog
|
||||
|
||||
### v3.0.0-alpha (2025-06-20)
|
||||
#### 🎯 Complete Cross-Platform Testing System
|
||||
|
||||
#### **✨ New Features**
|
||||
- **Complete Example Coverage**: All 43 examples now tested (was 35)
|
||||
- **Cross-Platform Validation**: Mac + Windows builds for all examples
|
||||
- **Standardized Build Artifacts**: Consistent platform-specific naming
|
||||
- **Enhanced Git Integration**: Complete .gitignore patterns for build artifacts
|
||||
|
||||
#### **🐛 Major Fixes**
|
||||
- **Go Module Resolution**: Standardized replace directives across all examples
|
||||
- **Frontend Asset Embedding**: Fixed missing frontend/dist directory references
|
||||
- **Manager API Migration**: Updated deprecated Windows badge service calls
|
||||
- **File Association**: Fixed undefined window variable
|
||||
- **Build Completeness**: Added 8 missing examples to test suite
|
||||
|
||||
#### **🔧 Infrastructure Improvements**
|
||||
- **Taskfile Integration**: Comprehensive cross-platform build tasks
|
||||
- **Performance Optimization**: Parallel builds where possible
|
||||
- **Error Handling**: Clear build failure reporting and debugging
|
||||
- **Documentation**: Complete testing guide with troubleshooting
|
||||
|
||||
#### **📊 Validation Results**
|
||||
- **macOS**: ✅ 43/43 examples compile successfully
|
||||
- **Windows**: ✅ 43/43 examples cross-compile successfully
|
||||
- **Build Time**: ~5-6 minutes for complete cross-platform validation
|
||||
- **Reliability**: 100% success rate with proper error handling
|
||||
|
||||
## Support
|
||||
|
||||
For issues with cross-platform builds:
|
||||
1. Check platform-specific requirements above
|
||||
2. Review the troubleshooting section for resolved issues
|
||||
3. Verify Go 1.24+ is installed
|
||||
4. Check build logs for specific error messages
|
||||
5. Use selective testing to isolate problems
|
||||
|
||||
## References
|
||||
|
||||
- [Wails v3 Documentation](https://wails.io/docs/)
|
||||
- [Go Cross Compilation](https://golang.org/doc/install/cross)
|
||||
- [GTK Development Libraries](https://www.gtk.org/docs/installations/linux)
|
||||
- [Task Runner Documentation](https://taskfile.dev/)
|
||||
401
v3/Taskfile.yaml
Normal file
|
|
@ -0,0 +1,401 @@
|
|||
# https://taskfile.dev
|
||||
|
||||
version: "3"
|
||||
|
||||
includes:
|
||||
generator:
|
||||
taskfile: ./internal/generator
|
||||
dir: ./internal/generator
|
||||
|
||||
runtime:
|
||||
taskfile: ./internal/runtime
|
||||
dir: ./internal/runtime
|
||||
|
||||
website:
|
||||
taskfile: ./website
|
||||
dir: ./website
|
||||
optional: true
|
||||
|
||||
docs:
|
||||
taskfile: ../docs
|
||||
dir: ../docs
|
||||
optional: true
|
||||
|
||||
tasks:
|
||||
recreate-template-dir:
|
||||
dir: internal/templates
|
||||
internal: true
|
||||
silent: true
|
||||
cmds:
|
||||
- rm -rf {{.TEMPLATE_DIR}}
|
||||
- mkdir -p {{.TEMPLATE_DIR}}
|
||||
|
||||
install:
|
||||
dir: cmd/wails3
|
||||
silent: true
|
||||
cmds:
|
||||
- go install
|
||||
- echo "Installed wails CLI"
|
||||
|
||||
release:
|
||||
summary: Release a new version of Wails. Call with `task v3:release -- <version>`
|
||||
dir: tasks/release
|
||||
cmds:
|
||||
- go run release.go {{.CLI_ARGS}}
|
||||
|
||||
taskfile:upgrade:
|
||||
cmds:
|
||||
- go get -u github.com/go-task/task/v3
|
||||
|
||||
reinstall-cli:
|
||||
dir: cmd/wails3
|
||||
internal: true
|
||||
silent: true
|
||||
cmds:
|
||||
- go install
|
||||
- echo "Reinstalled wails CLI"
|
||||
|
||||
generate:events:
|
||||
dir: tasks/events
|
||||
cmds:
|
||||
- go run generate.go
|
||||
- go fmt ../../pkg/events/events.go
|
||||
|
||||
precommit:
|
||||
cmds:
|
||||
- go test ./...
|
||||
- task: format
|
||||
# - task: docs:update:api
|
||||
|
||||
test:example:darwin:
|
||||
dir: 'examples/{{.DIR}}'
|
||||
platforms:
|
||||
- darwin
|
||||
cmds:
|
||||
- echo "Building example {{.DIR}} for Darwin"
|
||||
- go mod tidy
|
||||
- go build -o "testbuild-{{.DIR}}-darwin{{exeExt}}"
|
||||
env:
|
||||
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
|
||||
CGO_CFLAGS: -mmacosx-version-min=10.13
|
||||
|
||||
test:example:windows:
|
||||
dir: 'examples/{{.DIR}}'
|
||||
platforms:
|
||||
- windows
|
||||
cmds:
|
||||
- echo "Building example {{.DIR}} for Windows"
|
||||
- go mod tidy
|
||||
- go build -o "testbuild-{{.DIR}}-windows.exe"
|
||||
env:
|
||||
GOOS: windows
|
||||
GOARCH: amd64
|
||||
|
||||
test:example:linux:
|
||||
dir: 'examples/{{.DIR}}'
|
||||
platforms:
|
||||
- linux
|
||||
cmds:
|
||||
- echo "Building example {{.DIR}} for Linux"
|
||||
- go mod tidy
|
||||
- go build -o "testbuild-{{.DIR}}-linux"
|
||||
|
||||
test:example:linux:docker:arm64:
|
||||
summary: Build a single example for Linux ARM64 using Docker (Ubuntu 24.04)
|
||||
cmds:
|
||||
- echo "Building example {{.DIR}} for Linux ARM64 using Docker"
|
||||
- docker build --pull -f test/docker/Dockerfile.linux-arm64 -t wails-v3-linux-arm64 .
|
||||
- docker run --rm wails-v3-linux-arm64 /build/build-linux-arm64.sh {{.DIR}}
|
||||
|
||||
test:example:linux:docker:x86_64:
|
||||
summary: Build a single example for Linux x86_64 using Docker (Ubuntu 24.04)
|
||||
cmds:
|
||||
- echo "Building example {{.DIR}} for Linux x86_64 using Docker"
|
||||
- docker build --pull -f test/docker/Dockerfile.linux-x86_64 -t wails-v3-linux-x86_64 .
|
||||
- docker run --rm wails-v3-linux-x86_64 /build/build-linux-x86_64.sh {{.DIR}}
|
||||
|
||||
test:examples:linux:docker:arm64:
|
||||
summary: Build all examples for Linux ARM64 using Docker (Ubuntu 24.04)
|
||||
cmds:
|
||||
- echo "Building Docker image for Linux ARM64 compilation..."
|
||||
- docker build --pull -f test/docker/Dockerfile.linux-arm64 -t wails-v3-linux-arm64 .
|
||||
- echo "Running Linux ARM64 compilation in Docker container..."
|
||||
- docker run --rm wails-v3-linux-arm64
|
||||
|
||||
test:examples:linux:docker:x86_64:
|
||||
summary: Build all examples for Linux x86_64 using Docker (Ubuntu 24.04)
|
||||
cmds:
|
||||
- echo "Building Docker image for Linux x86_64 compilation..."
|
||||
- docker build --pull -f test/docker/Dockerfile.linux-x86_64 -t wails-v3-linux-x86_64 .
|
||||
- echo "Running Linux x86_64 compilation in Docker container..."
|
||||
- docker run --rm wails-v3-linux-x86_64
|
||||
|
||||
test:example:linux:docker:
|
||||
summary: Build a single example for Linux using Docker (auto-detect architecture)
|
||||
cmds:
|
||||
- echo "Auto-detecting architecture for Linux Docker build..."
|
||||
- |
|
||||
if [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "aarch64" ]; then
|
||||
echo "Detected ARM64, using ARM64 Docker image"
|
||||
task test:example:linux:docker:arm64 DIR={{.DIR}}
|
||||
else
|
||||
echo "Detected x86_64, using x86_64 Docker image"
|
||||
task test:example:linux:docker:x86_64 DIR={{.DIR}}
|
||||
fi
|
||||
|
||||
test:examples:linux:docker:
|
||||
summary: Build all examples for Linux using Docker (auto-detect architecture)
|
||||
cmds:
|
||||
- echo "Auto-detecting architecture for Linux Docker build..."
|
||||
- |
|
||||
if [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "aarch64" ]; then
|
||||
echo "Detected ARM64, using ARM64 Docker image"
|
||||
task test:examples:linux:docker:arm64
|
||||
else
|
||||
echo "Detected x86_64, using x86_64 Docker image"
|
||||
task test:examples:linux:docker:x86_64
|
||||
fi
|
||||
|
||||
test:examples:all:
|
||||
summary: Builds all examples for all platforms (Mac + Windows + Linux via Docker)
|
||||
vars:
|
||||
EXAMPLEDIRS: |
|
||||
badge
|
||||
badge-custom
|
||||
binding
|
||||
build
|
||||
cancel-async
|
||||
cancel-chaining
|
||||
clipboard
|
||||
contextmenus
|
||||
dev
|
||||
dialogs
|
||||
dialogs-basic
|
||||
drag-n-drop
|
||||
environment
|
||||
events
|
||||
events-bug
|
||||
file-association
|
||||
frameless
|
||||
gin-example
|
||||
gin-routing
|
||||
gin-service
|
||||
hide-window
|
||||
ignore-mouse
|
||||
keybindings
|
||||
liquid-glass
|
||||
menu
|
||||
notifications
|
||||
panic-handling
|
||||
plain
|
||||
raw-message
|
||||
screen
|
||||
services
|
||||
show-macos-toolbar
|
||||
single-instance
|
||||
systray-basic
|
||||
systray-custom
|
||||
systray-menu
|
||||
video
|
||||
window
|
||||
window-api
|
||||
window-call
|
||||
window-menu
|
||||
wml
|
||||
cmds:
|
||||
- echo "Building all examples for all platforms..."
|
||||
- echo "=== Building for Darwin ==="
|
||||
- for: { var: EXAMPLEDIRS }
|
||||
task: test:example:darwin
|
||||
vars:
|
||||
DIR: "{{.ITEM}}"
|
||||
- echo "=== Building for Windows (cross-compile) ==="
|
||||
- for: { var: EXAMPLEDIRS }
|
||||
task: test:example:windows
|
||||
vars:
|
||||
DIR: "{{.ITEM}}"
|
||||
- echo "=== Building for Linux (Docker) ==="
|
||||
- task: test:examples:linux:docker
|
||||
- echo "=== Testing CLI Code ==="
|
||||
- task: test:cli
|
||||
- echo "=== Cleaning Up Test Binaries ==="
|
||||
- task: clean:test:binaries
|
||||
|
||||
test:cli:
|
||||
summary: Test CLI-related code compilation
|
||||
cmds:
|
||||
- echo "Testing CLI appimage testfiles compilation..."
|
||||
- cd internal/commands/appimage_testfiles && go mod tidy && go build
|
||||
- echo "✅ CLI appimage testfiles compile successfully"
|
||||
|
||||
test:cli:all:
|
||||
summary: Test all CLI components and critical test files
|
||||
cmds:
|
||||
- echo "Testing CLI appimage testfiles..."
|
||||
- cd internal/commands/appimage_testfiles && go mod tidy && go build
|
||||
- echo "Testing window visibility test..."
|
||||
- cd tests/window-visibility-test && go mod tidy && go build
|
||||
- echo "Testing service implementations..."
|
||||
- cd pkg/services/badge && go build
|
||||
- echo "✅ All CLI components compile successfully"
|
||||
|
||||
test:generator:
|
||||
summary: Test code generator test cases compilation
|
||||
cmds:
|
||||
- echo "Testing generator test cases (sample)..."
|
||||
- cd internal/generator/testcases/function_single && go mod tidy && go build
|
||||
- cd internal/generator/testcases/complex_method && go mod tidy && go build
|
||||
- cd internal/generator/testcases/struct_literal_single && go mod tidy && go build
|
||||
- echo "✅ Generator test cases compile successfully"
|
||||
|
||||
test:templates:
|
||||
summary: Test template generation for core templates
|
||||
cmds:
|
||||
- echo "Testing template generation (core templates)..."
|
||||
- task: install
|
||||
- echo "Testing lit template generation..."
|
||||
- rm -rf ./test-template-lit && wails3 init -n test-template-lit -t lit
|
||||
- mkdir -p ./test-template-lit/frontend/dist && touch ./test-template-lit/frontend/dist/.keep
|
||||
- cd ./test-template-lit && go mod tidy && go build
|
||||
- rm -rf ./test-template-lit
|
||||
- echo "Testing react template generation..."
|
||||
- rm -rf ./test-template-react && wails3 init -n test-template-react -t react
|
||||
- mkdir -p ./test-template-react/frontend/dist && touch ./test-template-react/frontend/dist/.keep
|
||||
- cd ./test-template-react && go mod tidy && go build
|
||||
- rm -rf ./test-template-react
|
||||
- echo "✅ Template generation tests completed successfully"
|
||||
|
||||
test:infrastructure:
|
||||
summary: Test critical infrastructure components
|
||||
cmds:
|
||||
- echo "=== Testing CLI Components ==="
|
||||
- task: test:cli:all
|
||||
- echo "=== Testing Generator ==="
|
||||
- task: test:generator
|
||||
- echo "=== Testing Templates ==="
|
||||
- task: test:templates
|
||||
- echo "=== Testing pkg/application ==="
|
||||
- cd pkg/application && go test -c -o /dev/null ./...
|
||||
- echo "=== Cleaning Up Test Binaries ==="
|
||||
- task: clean:test:binaries
|
||||
- echo "✅ All infrastructure components test successfully"
|
||||
|
||||
test:examples:
|
||||
summary: Builds the examples for current platform only
|
||||
vars:
|
||||
EXAMPLEDIRS: |
|
||||
badge
|
||||
badge-custom
|
||||
binding
|
||||
build
|
||||
cancel-async
|
||||
cancel-chaining
|
||||
clipboard
|
||||
contextmenus
|
||||
dev
|
||||
dialogs
|
||||
dialogs-basic
|
||||
drag-n-drop
|
||||
environment
|
||||
events
|
||||
events-bug
|
||||
file-association
|
||||
frameless
|
||||
gin-example
|
||||
gin-routing
|
||||
gin-service
|
||||
hide-window
|
||||
ignore-mouse
|
||||
keybindings
|
||||
liquid-glass
|
||||
menu
|
||||
notifications
|
||||
panic-handling
|
||||
plain
|
||||
raw-message
|
||||
screen
|
||||
services
|
||||
show-macos-toolbar
|
||||
single-instance
|
||||
systray-basic
|
||||
systray-custom
|
||||
systray-menu
|
||||
video
|
||||
window
|
||||
window-api
|
||||
window-call
|
||||
window-menu
|
||||
wml
|
||||
cmds:
|
||||
- echo "Testing examples compilation..."
|
||||
- for: { var: EXAMPLEDIRS }
|
||||
task: test:example:darwin
|
||||
vars:
|
||||
DIR: "{{.ITEM}}"
|
||||
platforms: [darwin]
|
||||
- for: { var: EXAMPLEDIRS }
|
||||
task: test:example:linux
|
||||
vars:
|
||||
DIR: "{{.ITEM}}"
|
||||
platforms: [linux]
|
||||
- for: { var: EXAMPLEDIRS }
|
||||
task: test:example:windows
|
||||
vars:
|
||||
DIR: "{{.ITEM}}"
|
||||
platforms: [windows]
|
||||
- echo "Testing CLI code..."
|
||||
- task: test:cli
|
||||
- echo "=== Cleaning Up Test Binaries ==="
|
||||
- task: clean:test:binaries
|
||||
|
||||
clean:test:binaries:
|
||||
summary: Clean up all test-generated binary files and directories (cross-platform)
|
||||
cmds:
|
||||
- echo "🧹 Cleaning up test binaries..."
|
||||
- go run tasks/cleanup/cleanup.go
|
||||
- echo "✅ Test binaries cleaned up"
|
||||
|
||||
test:all:
|
||||
summary: Run all tests including examples, infrastructure, and Go unit tests
|
||||
cmds:
|
||||
- echo "=== Running Go Unit Tests ==="
|
||||
- go test ./...
|
||||
- echo "=== Testing Examples (Current Platform) ==="
|
||||
- task: test:examples
|
||||
- echo "=== Testing Infrastructure Components ==="
|
||||
- task: test:infrastructure
|
||||
- echo "=== Cleaning Up Test Binaries ==="
|
||||
- task: clean:test:binaries
|
||||
- echo "✅ All tests completed successfully"
|
||||
|
||||
build:server:
|
||||
summary: Build an application in server mode (no GUI, HTTP server only)
|
||||
desc: |
|
||||
Builds a Wails application in server mode using the -tags server build tag.
|
||||
Server mode enables running the application as a pure HTTP server without
|
||||
native GUI dependencies.
|
||||
|
||||
Usage: task build:server DIR=examples/server
|
||||
dir: '{{.DIR | default "."}}'
|
||||
cmds:
|
||||
- echo "Building {{.DIR | default `.`}} in server mode..."
|
||||
- go build -tags server -o '{{.OUTPUT | default "server-app"}}' .
|
||||
- echo "Server mode build complete"
|
||||
|
||||
test:example:server:
|
||||
summary: Build and test the server mode example
|
||||
dir: 'examples/server'
|
||||
cmds:
|
||||
- echo "Building server example with -tags server..."
|
||||
- go mod tidy
|
||||
- go build -tags server -o "testbuild-server"
|
||||
- echo "✅ Server example builds successfully"
|
||||
- rm -f testbuild-server
|
||||
|
||||
test:server:
|
||||
summary: Run server mode unit tests
|
||||
dir: 'pkg/application'
|
||||
cmds:
|
||||
- echo "Running server mode tests..."
|
||||
- go test -tags server -v -run TestServerMode .
|
||||
- echo "✅ Server mode tests passed"
|
||||
62
v3/UNRELEASED_CHANGELOG.md
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
# Unreleased Changes
|
||||
|
||||
<!--
|
||||
This file is used to collect changelog entries for the next v3-alpha release.
|
||||
Add your changes under the appropriate sections below.
|
||||
|
||||
Guidelines:
|
||||
- Follow the "Keep a Changelog" format (https://keepachangelog.com/)
|
||||
- Write clear, concise descriptions of changes
|
||||
- Include the impact on users when relevant
|
||||
- Use present tense ("Add feature" not "Added feature")
|
||||
- Reference issue/PR numbers when applicable
|
||||
|
||||
This file is automatically processed by the nightly release workflow.
|
||||
After processing, the content will be moved to the main changelog and this file will be reset.
|
||||
-->
|
||||
|
||||
## Added
|
||||
<!-- New features, capabilities, or enhancements -->
|
||||
- Add `UseApplicationMenu` option to `WebviewWindowOptions` allowing windows on Windows/Linux to inherit the application menu set via `app.Menu.Set()` by @leaanthony
|
||||
|
||||
## Changed
|
||||
<!-- Changes in existing functionality -->
|
||||
- Move `EnabledFeatures`, `DisabledFeatures`, and `AdditionalBrowserArgs` from per-window options to application-level `Options.Windows` (#4559) by @leaanthony
|
||||
|
||||
## Fixed
|
||||
<!-- Bug fixes -->
|
||||
- Fix potential panic when setting empty icon or bitmap on Linux (#4923) by @ddmoney420
|
||||
- Fix ErrorDialog crash when called from service binding on macOS (#3631) by @leaanthony
|
||||
- Make menus to be displayed on Windows OS in `v3\examples\dialogs` by @ndianabasi
|
||||
- Fix race condition causing TypeError during page reload (#4872) by @ddmoney420
|
||||
|
||||
- Fix incorrect output from binding generator tests by removing global state in the `Collector.IsVoidAlias()` method (#4941) by @fbbdev
|
||||
|
||||
## Deprecated
|
||||
<!-- Soon-to-be removed features -->
|
||||
|
||||
## Removed
|
||||
<!-- Features removed in this release -->
|
||||
- **BREAKING**: Remove `EnabledFeatures`, `DisabledFeatures`, and `AdditionalLaunchArgs` from per-window `WindowsWindow` options. Use application-level `Options.Windows.EnabledFeatures`, `Options.Windows.DisabledFeatures`, and `Options.Windows.AdditionalBrowserArgs` instead. These flags apply globally to the shared WebView2 environment (#4559) by @leaanthony
|
||||
|
||||
## Security
|
||||
<!-- Security-related changes -->
|
||||
|
||||
---
|
||||
|
||||
### Example Entries:
|
||||
|
||||
**Added:**
|
||||
- Add support for custom window icons in application options
|
||||
- Add new `SetWindowIcon()` method to runtime API (#1234)
|
||||
|
||||
**Changed:**
|
||||
- Update minimum Go version requirement to 1.21
|
||||
- Improve error messages for invalid configuration files
|
||||
|
||||
**Fixed:**
|
||||
- Fix memory leak in event system during window close operations (#5678)
|
||||
- Fix crash when using context menus on Linux with Wayland
|
||||
|
||||
**Security:**
|
||||
- Update dependencies to address CVE-2024-12345 in third-party library
|
||||
233
v3/build_ios.sh
Executable file
|
|
@ -0,0 +1,233 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Wails v3 iOS Build Script
|
||||
# This script builds a Wails application for iOS Simulator
|
||||
|
||||
set -e
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
echo -e "${GREEN}Wails v3 iOS Build Script${NC}"
|
||||
echo "==============================="
|
||||
|
||||
# Check for required tools
|
||||
check_command() {
|
||||
if ! command -v $1 &> /dev/null; then
|
||||
echo -e "${RED}Error: $1 is not installed${NC}"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Checking dependencies..."
|
||||
check_command go
|
||||
check_command xcodebuild
|
||||
check_command xcrun
|
||||
|
||||
# Configuration
|
||||
APP_NAME="${APP_NAME:-WailsIOSDemo}"
|
||||
BUNDLE_ID="${BUNDLE_ID:-com.wails.iosdemo}"
|
||||
BUILD_DIR="build/ios"
|
||||
SIMULATOR_SDK="iphonesimulator"
|
||||
MIN_IOS_VERSION="13.0"
|
||||
|
||||
# Clean build directory
|
||||
echo "Cleaning build directory..."
|
||||
rm -rf $BUILD_DIR
|
||||
mkdir -p $BUILD_DIR
|
||||
|
||||
# Create the iOS app structure
|
||||
echo "Creating iOS app structure..."
|
||||
APP_DIR="$BUILD_DIR/$APP_NAME.app"
|
||||
mkdir -p "$APP_DIR"
|
||||
|
||||
# Create Info.plist
|
||||
echo "Creating Info.plist..."
|
||||
cat > "$BUILD_DIR/Info.plist" << EOF
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$APP_NAME</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$BUNDLE_ID</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$APP_NAME</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>$MIN_IOS_VERSION</string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
|
||||
cp "$BUILD_DIR/Info.plist" "$APP_DIR/"
|
||||
|
||||
# Build the Go application for iOS Simulator
|
||||
echo -e "${YELLOW}Building Go application for iOS Simulator...${NC}"
|
||||
|
||||
# Set up environment for iOS cross-compilation
|
||||
export CGO_ENABLED=1
|
||||
export GOOS=ios
|
||||
export GOARCH=arm64
|
||||
export SDK_PATH=$(xcrun --sdk $SIMULATOR_SDK --show-sdk-path)
|
||||
export CGO_CFLAGS="-isysroot $SDK_PATH -mios-simulator-version-min=$MIN_IOS_VERSION -arch arm64 -fembed-bitcode"
|
||||
export CGO_LDFLAGS="-isysroot $SDK_PATH -mios-simulator-version-min=$MIN_IOS_VERSION -arch arm64"
|
||||
|
||||
# Find clang for the simulator
|
||||
export CC=$(xcrun --sdk $SIMULATOR_SDK --find clang)
|
||||
export CXX=$(xcrun --sdk $SIMULATOR_SDK --find clang++)
|
||||
|
||||
echo "SDK Path: $SDK_PATH"
|
||||
echo "CC: $CC"
|
||||
|
||||
# Build the demo app using the example
|
||||
echo "Building demo application..."
|
||||
|
||||
# Create a simplified main.go that uses local packages
|
||||
cat > "$BUILD_DIR/main.go" << 'EOF'
|
||||
//go:build ios
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
)
|
||||
|
||||
// Since we're building a proof of concept, we'll create a minimal app
|
||||
// that demonstrates the iOS integration
|
||||
|
||||
func main() {
|
||||
fmt.Println("Wails iOS Demo Starting...")
|
||||
|
||||
// For the PoC, we'll import the iOS platform code directly
|
||||
// In production, this would use the full Wails v3 application package
|
||||
|
||||
log.Println("iOS application would start here")
|
||||
// The actual iOS app initialization happens in the Objective-C layer
|
||||
// This is just a placeholder for the build process
|
||||
}
|
||||
EOF
|
||||
|
||||
# Try to build the binary
|
||||
cd "$BUILD_DIR"
|
||||
echo "Attempting to build iOS binary..."
|
||||
|
||||
# For now, let's create a simple test binary to verify the build toolchain
|
||||
go build -tags ios -o "$APP_NAME" main.go 2>&1 || {
|
||||
echo -e "${YELLOW}Note: Full iOS build requires gomobile or additional setup${NC}"
|
||||
echo "Creating placeholder binary for demonstration..."
|
||||
|
||||
# Create a placeholder executable
|
||||
cat > "$APP_NAME.c" << 'EOF'
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
printf("Wails iOS Demo Placeholder\n");
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
||||
$CC -isysroot $SDK_PATH -arch arm64 -mios-simulator-version-min=$MIN_IOS_VERSION \
|
||||
-o "$APP_NAME" "$APP_NAME.c"
|
||||
}
|
||||
|
||||
# Sign the app for simulator (no actual certificate needed)
|
||||
echo "Preparing app for simulator..."
|
||||
codesign --force --sign - "$APP_NAME" 2>/dev/null || true
|
||||
mv "$APP_NAME" "$APP_DIR/"
|
||||
|
||||
# Create a simple launch script
|
||||
echo "Creating launch script..."
|
||||
cd - > /dev/null
|
||||
cat > "$BUILD_DIR/run_simulator.sh" << 'EOF'
|
||||
#!/bin/bash
|
||||
|
||||
echo "iOS Simulator Launch Script"
|
||||
echo "============================"
|
||||
|
||||
# Check if Simulator is available
|
||||
if ! command -v open &> /dev/null; then
|
||||
echo "Error: Cannot open Simulator"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Open Xcode Simulator
|
||||
echo "Opening iOS Simulator..."
|
||||
open -a Simulator 2>/dev/null || {
|
||||
echo "Error: Could not open Simulator. Make sure Xcode is installed."
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo ""
|
||||
echo "Simulator should now be opening..."
|
||||
echo ""
|
||||
echo "Note: This is a proof of concept demonstrating:"
|
||||
echo " 1. ✅ WebView creation (application_ios.m)"
|
||||
echo " 2. ✅ Request interception via WKURLSchemeHandler"
|
||||
echo " 3. ✅ JavaScript execution bridge"
|
||||
echo " 4. ✅ iOS Simulator build support"
|
||||
echo ""
|
||||
echo "The full implementation would require:"
|
||||
echo " - gomobile for proper Go/iOS integration"
|
||||
echo " - Proper Xcode project generation"
|
||||
echo " - Full CGO bindings compilation"
|
||||
echo ""
|
||||
echo "See IOS_ARCHITECTURE.md for complete technical details."
|
||||
EOF
|
||||
|
||||
chmod +x "$BUILD_DIR/run_simulator.sh"
|
||||
|
||||
echo -e "${GREEN}Build complete!${NC}"
|
||||
echo ""
|
||||
echo "Build artifacts created in: $BUILD_DIR"
|
||||
echo ""
|
||||
echo "To open the iOS Simulator:"
|
||||
echo " cd $BUILD_DIR && ./run_simulator.sh"
|
||||
echo ""
|
||||
echo "The proof of concept demonstrates:"
|
||||
echo " 1. ✅ WebView creation code (pkg/application/application_ios.m)"
|
||||
echo " 2. ✅ Request interception (WKURLSchemeHandler implementation)"
|
||||
echo " 3. ✅ JavaScript execution (bidirectional bridge)"
|
||||
echo " 4. ✅ iOS build configuration and simulator support"
|
||||
echo ""
|
||||
echo "Full implementation requires gomobile integration."
|
||||
echo "See IOS_ARCHITECTURE.md for complete technical documentation."
|
||||
83
v3/cmd/wails3/README.md
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
# The Wails CLI
|
||||
|
||||
The Wails CLI is a command line tool that allows you to create, build and run Wails applications.
|
||||
There are a number of commands related to tooling, such as icon generation and asset bundling.
|
||||
|
||||
## Commands
|
||||
|
||||
### task
|
||||
|
||||
The `task` command is for running tasks defined in `Taskfile.yml`. It is a wrapper around [Task](https://taskfile.dev).
|
||||
|
||||
### generate
|
||||
|
||||
The `generate` command is used to generate resources and assets for your Wails project.
|
||||
It can be used to generate many things including:
|
||||
- application icons,
|
||||
- resource files for Windows applications
|
||||
- Info.plist files for macOS deployments
|
||||
|
||||
#### icon
|
||||
|
||||
The `icon` command generates icons for your project.
|
||||
|
||||
| Flag | Type | Description | Default |
|
||||
|--------------------|--------|------------------------------------------------------|----------------------|
|
||||
| `-example` | bool | Generates example icon file (appicon.png) | |
|
||||
| `-input` | string | The input image file | |
|
||||
| `-sizes` | string | The sizes to generate in .ico file (comma separated) | "256,128,64,48,32,16" |
|
||||
| `-windowsFilename` | string | The output filename for the Windows icon | icon.ico |
|
||||
| `-macFilename` | string | The output filename for the Mac icon bundle | icons.icns |
|
||||
|
||||
```bash
|
||||
wails3 generate icon -input myicon.png -sizes "32,64,128" -windowsFilename myicon.ico -macFilename myicon.icns
|
||||
```
|
||||
|
||||
This will generate icons for mac and windows and save them in the current directory as `myicon.ico`
|
||||
and `myicons.icns`.
|
||||
|
||||
#### syso
|
||||
|
||||
The `syso` command generates a Windows resource file (aka `.syso`).
|
||||
|
||||
```bash
|
||||
wails3 generate syso <options>
|
||||
```
|
||||
|
||||
| Flag | Type | Description | Default |
|
||||
|-------------|--------|--------------------------------------------|------------------|
|
||||
| `-example` | bool | Generates example manifest & info files | |
|
||||
| `-manifest` | string | The manifest file | |
|
||||
| `-info` | string | The info.json file | |
|
||||
| `-icon` | string | The icon file | |
|
||||
| `-out` | string | The output filename for the syso file | `wails.exe.syso` |
|
||||
| `-arch` | string | The target architecture (amd64,arm64,386) | `runtime.GOOS` |
|
||||
|
||||
If `-example` is provided, the command will generate example manifest and info files
|
||||
in the current directory and exit.
|
||||
|
||||
If `-manifest` is provided, the command will use the provided manifest file to generate
|
||||
the syso file.
|
||||
|
||||
If `-info` is provided, the command will use the provided info.json file to set the version
|
||||
information in the syso file.
|
||||
|
||||
NOTE: We use [winres](https://github.com/tc-hib/winres) to generate the syso file. Please
|
||||
refer to the winres documentation for more information.
|
||||
|
||||
NOTE: Whilst the tool will work for 32-bit Windows, it is not supported. Please use 64-bit.
|
||||
|
||||
#### defaults
|
||||
|
||||
```bash
|
||||
wails3 generate defaults
|
||||
```
|
||||
This will generate all the default assets and resources in the current directory.
|
||||
|
||||
#### bindings
|
||||
|
||||
```bash
|
||||
wails3 generate bindings
|
||||
```
|
||||
|
||||
Generates bindings and models for your bound Go methods and structs.
|
||||
174
v3/cmd/wails3/main.go
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"runtime/debug"
|
||||
|
||||
"github.com/pkg/browser"
|
||||
|
||||
"github.com/pterm/pterm"
|
||||
"github.com/samber/lo"
|
||||
|
||||
"github.com/leaanthony/clir"
|
||||
"github.com/wailsapp/wails/v3/internal/commands"
|
||||
"github.com/wailsapp/wails/v3/internal/flags"
|
||||
"github.com/wailsapp/wails/v3/internal/term"
|
||||
)
|
||||
|
||||
func init() {
|
||||
buildInfo, ok := debug.ReadBuildInfo()
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
commands.BuildSettings = lo.Associate(buildInfo.Settings, func(setting debug.BuildSetting) (string, string) {
|
||||
return setting.Key, setting.Value
|
||||
})
|
||||
// Iterate over the Deps and add them to the build settings using a prefix of "mod."
|
||||
for _, dep := range buildInfo.Deps {
|
||||
commands.BuildSettings["mod."+dep.Path] = dep.Version
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
app := clir.NewCli("wails", "The Wails3 CLI", "v3")
|
||||
app.NewSubCommand("docs", "Open the docs").Action(openDocs)
|
||||
app.NewSubCommandFunction("init", "Initialise a new project", commands.Init)
|
||||
|
||||
build := app.NewSubCommand("build", "Build the project")
|
||||
var buildFlags flags.Build
|
||||
build.AddFlags(&buildFlags)
|
||||
build.Action(func() error {
|
||||
return commands.Build(&buildFlags, build.OtherArgs())
|
||||
})
|
||||
|
||||
app.NewSubCommandFunction("dev", "Run in Dev mode", commands.Dev)
|
||||
|
||||
pkg := app.NewSubCommand("package", "Package application")
|
||||
var pkgFlags flags.Package
|
||||
pkg.AddFlags(&pkgFlags)
|
||||
pkg.Action(func() error {
|
||||
return commands.Package(&pkgFlags, pkg.OtherArgs())
|
||||
})
|
||||
app.NewSubCommandFunction("doctor", "System status report", commands.Doctor)
|
||||
app.NewSubCommandFunction("releasenotes", "Show release notes", commands.ReleaseNotes)
|
||||
|
||||
task := app.NewSubCommand("task", "Run and list tasks")
|
||||
var taskFlags commands.RunTaskOptions
|
||||
task.AddFlags(&taskFlags)
|
||||
task.Action(func() error {
|
||||
return commands.RunTask(&taskFlags, task.OtherArgs())
|
||||
})
|
||||
task.LongDescription("\nUsage: wails3 task [taskname] [flags]\n\nTasks are defined in the `Taskfile.yaml` file. See https://taskfile.dev for more information.")
|
||||
|
||||
generate := app.NewSubCommand("generate", "Generation tools")
|
||||
generate.NewSubCommandFunction("build-assets", "Generate build assets", commands.GenerateBuildAssets)
|
||||
generate.NewSubCommandFunction("icons", "Generate icons", commands.GenerateIcons)
|
||||
generate.NewSubCommandFunction("syso", "Generate Windows .syso file", commands.GenerateSyso)
|
||||
generate.NewSubCommandFunction("runtime", "Generate the pre-built version of the runtime", commands.GenerateRuntime)
|
||||
generate.NewSubCommandFunction("webview2bootstrapper", "Generate WebView2 bootstrapper", commands.GenerateWebView2Bootstrapper)
|
||||
generate.NewSubCommandFunction("template", "Generate a new template", commands.GenerateTemplate)
|
||||
|
||||
update := app.NewSubCommand("update", "Update tools")
|
||||
update.NewSubCommandFunction("build-assets", "Updates the build assets using the given config file", commands.UpdateBuildAssets)
|
||||
update.NewSubCommandFunction("cli", "Updates the Wails CLI", commands.UpdateCLI)
|
||||
|
||||
bindgen := generate.NewSubCommand("bindings", "Generate bindings + models")
|
||||
var bindgenFlags flags.GenerateBindingsOptions
|
||||
bindgen.AddFlags(&bindgenFlags)
|
||||
bindgen.Action(func() error {
|
||||
return commands.GenerateBindings(&bindgenFlags, bindgen.OtherArgs())
|
||||
})
|
||||
bindgen.LongDescription("\nUsage: wails3 generate bindings [flags] [patterns...]\n\nPatterns match packages to scan for bound types.\nPattern format is analogous to that of the Go build tool,\ne.g. './...' matches packages in the current directory and all descendants.\nIf no pattern is given, the tool will fall back to the current directory.")
|
||||
generate.NewSubCommandFunction("constants", "Generate JS constants from Go", commands.GenerateConstants)
|
||||
generate.NewSubCommandFunction(".desktop", "Generate .desktop file", commands.GenerateDotDesktop)
|
||||
generate.NewSubCommandFunction("appimage", "Generate Linux AppImage", commands.GenerateAppImage)
|
||||
|
||||
plugin := app.NewSubCommand("service", "Service tools")
|
||||
plugin.NewSubCommandFunction("init", "Initialise a new service", commands.ServiceInit)
|
||||
|
||||
tool := app.NewSubCommand("tool", "Various tools")
|
||||
tool.NewSubCommandFunction("checkport", "Checks if a port is open. Useful for testing if vite is running.", commands.ToolCheckPort)
|
||||
tool.NewSubCommandFunction("watcher", "Watches files and runs a command when they change", commands.Watcher)
|
||||
tool.NewSubCommandFunction("cp", "Copy files", commands.Cp)
|
||||
tool.NewSubCommandFunction("buildinfo", "Show Build Info", commands.BuildInfo)
|
||||
tool.NewSubCommandFunction("package", "Generate Linux packages (deb, rpm, archlinux)", commands.ToolPackage)
|
||||
tool.NewSubCommandFunction("version", "Bump semantic version", commands.ToolVersion)
|
||||
tool.NewSubCommandFunction("lipo", "Create macOS universal binary from multiple architectures", commands.ToolLipo)
|
||||
|
||||
// Low-level sign tool (used by Taskfiles)
|
||||
toolSign := tool.NewSubCommand("sign", "Sign a binary or package directly")
|
||||
var toolSignFlags flags.Sign
|
||||
toolSign.AddFlags(&toolSignFlags)
|
||||
toolSign.Action(func() error {
|
||||
return commands.Sign(&toolSignFlags)
|
||||
})
|
||||
|
||||
// Setup commands
|
||||
setup := app.NewSubCommand("setup", "Project setup wizards")
|
||||
setupSigning := setup.NewSubCommand("signing", "Configure code signing")
|
||||
var setupSigningFlags flags.SigningSetup
|
||||
setupSigning.AddFlags(&setupSigningFlags)
|
||||
setupSigning.Action(func() error {
|
||||
return commands.SigningSetup(&setupSigningFlags)
|
||||
})
|
||||
|
||||
setupEntitlements := setup.NewSubCommand("entitlements", "Configure macOS entitlements")
|
||||
var setupEntitlementsFlags flags.EntitlementsSetup
|
||||
setupEntitlements.AddFlags(&setupEntitlementsFlags)
|
||||
setupEntitlements.Action(func() error {
|
||||
return commands.EntitlementsSetup(&setupEntitlementsFlags)
|
||||
})
|
||||
|
||||
// Sign command (wrapper that calls platform-specific tasks)
|
||||
sign := app.NewSubCommand("sign", "Sign binaries and packages for current or specified platform")
|
||||
var signWrapperFlags flags.SignWrapper
|
||||
sign.AddFlags(&signWrapperFlags)
|
||||
sign.Action(func() error {
|
||||
return commands.SignWrapper(&signWrapperFlags, sign.OtherArgs())
|
||||
})
|
||||
|
||||
// iOS tools
|
||||
ios := app.NewSubCommand("ios", "iOS tooling")
|
||||
ios.NewSubCommandFunction("overlay:gen", "Generate Go overlay for iOS bridge shim", commands.IOSOverlayGen)
|
||||
ios.NewSubCommandFunction("xcode:gen", "Generate Xcode project in output directory", commands.IOSXcodeGen)
|
||||
|
||||
app.NewSubCommandFunction("version", "Print the version", commands.Version)
|
||||
app.NewSubCommand("sponsor", "Sponsor the project").Action(openSponsor)
|
||||
|
||||
defer printFooter()
|
||||
|
||||
err := app.Run()
|
||||
if err != nil {
|
||||
pterm.Error.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func printFooter() {
|
||||
if !commands.DisableFooter {
|
||||
docsLink := term.Hyperlink("https://v3.wails.io/getting-started/your-first-app/", "wails3 docs")
|
||||
|
||||
pterm.Println(pterm.LightGreen("\nNeed documentation? Run: ") + pterm.LightBlue(docsLink))
|
||||
// Check if we're in a teminal
|
||||
printer := pterm.PrefixPrinter{
|
||||
MessageStyle: pterm.NewStyle(pterm.FgLightGreen),
|
||||
Prefix: pterm.Prefix{
|
||||
Style: pterm.NewStyle(pterm.FgRed, pterm.BgLightWhite),
|
||||
Text: "♥ ",
|
||||
},
|
||||
}
|
||||
|
||||
linkText := term.Hyperlink("https://github.com/sponsors/leaanthony", "wails3 sponsor")
|
||||
printer.Println("If Wails is useful to you or your company, please consider sponsoring the project: " + pterm.LightBlue(linkText))
|
||||
}
|
||||
}
|
||||
|
||||
func openDocs() error {
|
||||
commands.DisableFooter = true
|
||||
return browser.OpenURL("https://v3.wails.io/getting-started/your-first-app/")
|
||||
}
|
||||
|
||||
func openSponsor() error {
|
||||
commands.DisableFooter = true
|
||||
return browser.OpenURL("https://github.com/sponsors/leaanthony")
|
||||
}
|
||||
17
v3/examples/README.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# v3
|
||||
|
||||
*NOTE*: The examples in this directory may or may not compile / run at any given time during alpha development.
|
||||
|
||||
|
||||
## Running the examples
|
||||
|
||||
cd v3/examples/<example>
|
||||
go mod tidy
|
||||
go run .
|
||||
|
||||
## Compiling the examples
|
||||
|
||||
cd v3/examples/<example>
|
||||
go mod tidy
|
||||
go build
|
||||
./<example>
|
||||
24
v3/examples/android/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Build outputs
|
||||
bin/
|
||||
*.apk
|
||||
*.aab
|
||||
|
||||
# Android build artifacts
|
||||
build/android/.gradle/
|
||||
build/android/app/build/
|
||||
build/android/local.properties
|
||||
|
||||
# JNI libraries (generated during build)
|
||||
build/android/app/src/main/jniLibs/*/libwails.so
|
||||
|
||||
# IDE
|
||||
.idea/
|
||||
*.iml
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Frontend build
|
||||
frontend/dist/
|
||||
frontend/node_modules/
|
||||
|
|
@ -0,0 +1 @@
|
|||
a40fe27d90a25e84deeed985e4075cfa
|
||||
|
|
@ -0,0 +1 @@
|
|||
82dedd4f821c351be61d8e1dbb6eefa
|
||||
|
|
@ -0,0 +1 @@
|
|||
7bfce68482b8f82eb3495774fb52ddca
|
||||
|
|
@ -0,0 +1 @@
|
|||
aef25acb8df5f0f69361a3df9b49b2e
|
||||
|
|
@ -0,0 +1 @@
|
|||
3eaf69fc9c4a0eeef54a9ebcc9b25cf7
|
||||
34
v3/examples/android/Taskfile.yml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
version: '3'
|
||||
|
||||
includes:
|
||||
common: ./build/Taskfile.yml
|
||||
windows: ./build/windows/Taskfile.yml
|
||||
darwin: ./build/darwin/Taskfile.yml
|
||||
linux: ./build/linux/Taskfile.yml
|
||||
android: ./build/android/Taskfile.yml
|
||||
|
||||
vars:
|
||||
APP_NAME: "android"
|
||||
BIN_DIR: "bin"
|
||||
VITE_PORT: '{{.WAILS_VITE_PORT | default 9245}}'
|
||||
|
||||
tasks:
|
||||
build:
|
||||
summary: Builds the application
|
||||
cmds:
|
||||
- task: "{{OS}}:build"
|
||||
|
||||
package:
|
||||
summary: Packages a production build of the application
|
||||
cmds:
|
||||
- task: "{{OS}}:package"
|
||||
|
||||
run:
|
||||
summary: Runs the application
|
||||
cmds:
|
||||
- task: "{{OS}}:run"
|
||||
|
||||
dev:
|
||||
summary: Runs the application in development mode
|
||||
cmds:
|
||||
- wails3 dev -config ./build/config.yml -port {{.VITE_PORT}}
|
||||
174
v3/examples/android/build/Taskfile.yml
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
version: '3'
|
||||
|
||||
tasks:
|
||||
go:mod:tidy:
|
||||
summary: Runs `go mod tidy`
|
||||
internal: true
|
||||
cmds:
|
||||
- go mod tidy
|
||||
|
||||
install:frontend:deps:
|
||||
summary: Install frontend dependencies
|
||||
dir: frontend
|
||||
sources:
|
||||
- package.json
|
||||
- package-lock.json
|
||||
generates:
|
||||
- node_modules/*
|
||||
preconditions:
|
||||
- sh: npm version
|
||||
msg: "Looks like npm isn't installed. Npm is part of the Node installer: https://nodejs.org/en/download/"
|
||||
cmds:
|
||||
- npm install
|
||||
|
||||
build:frontend:
|
||||
label: build:frontend (PRODUCTION={{.PRODUCTION}})
|
||||
summary: Build the frontend project
|
||||
dir: frontend
|
||||
sources:
|
||||
- "**/*"
|
||||
generates:
|
||||
- dist/**/*
|
||||
deps:
|
||||
- task: install:frontend:deps
|
||||
- task: generate:bindings
|
||||
vars:
|
||||
BUILD_FLAGS:
|
||||
ref: .BUILD_FLAGS
|
||||
cmds:
|
||||
- npm run {{.BUILD_COMMAND}} -q
|
||||
env:
|
||||
PRODUCTION: '{{.PRODUCTION | default "false"}}'
|
||||
vars:
|
||||
BUILD_COMMAND: '{{if eq .PRODUCTION "true"}}build{{else}}build:dev{{end}}'
|
||||
|
||||
|
||||
frontend:vendor:puppertino:
|
||||
summary: Fetches Puppertino CSS into frontend/public for consistent mobile styling
|
||||
sources:
|
||||
- frontend/public/puppertino/puppertino.css
|
||||
generates:
|
||||
- frontend/public/puppertino/puppertino.css
|
||||
cmds:
|
||||
- |
|
||||
set -euo pipefail
|
||||
mkdir -p frontend/public/puppertino
|
||||
# Fetch Puppertino full.css and LICENSE from GitHub main branch
|
||||
curl -fsSL https://raw.githubusercontent.com/codedgar/Puppertino/main/dist/css/full.css -o frontend/public/puppertino/puppertino.css
|
||||
curl -fsSL https://raw.githubusercontent.com/codedgar/Puppertino/main/LICENSE -o frontend/public/puppertino/LICENSE
|
||||
echo "Puppertino CSS updated at frontend/public/puppertino/puppertino.css"
|
||||
# Ensure index.html includes Puppertino CSS and button classes
|
||||
INDEX_HTML=frontend/index.html
|
||||
if [ -f "$INDEX_HTML" ]; then
|
||||
if ! grep -q 'href="/puppertino/puppertino.css"' "$INDEX_HTML"; then
|
||||
# Insert Puppertino link tag after style.css link
|
||||
awk '
|
||||
/href="\/style.css"\/?/ && !x { print; print " <link rel=\"stylesheet\" href=\"/puppertino/puppertino.css\"/>"; x=1; next }1
|
||||
' "$INDEX_HTML" > "$INDEX_HTML.tmp" && mv "$INDEX_HTML.tmp" "$INDEX_HTML"
|
||||
fi
|
||||
# Replace default .btn with Puppertino primary button classes if present
|
||||
sed -E -i'' 's/class=\"btn\"/class=\"p-btn p-prim-col\"/g' "$INDEX_HTML" || true
|
||||
fi
|
||||
|
||||
generate:bindings:
|
||||
label: generate:bindings (BUILD_FLAGS={{.BUILD_FLAGS}})
|
||||
summary: Generates bindings for the frontend
|
||||
deps:
|
||||
- task: go:mod:tidy
|
||||
sources:
|
||||
- "**/*.[jt]s"
|
||||
- exclude: frontend/**/*
|
||||
- frontend/bindings/**/* # Rerun when switching between dev/production mode causes changes in output
|
||||
- "**/*.go"
|
||||
- go.mod
|
||||
- go.sum
|
||||
generates:
|
||||
- frontend/bindings/**/*
|
||||
cmds:
|
||||
- wails3 generate bindings -f '{{.BUILD_FLAGS}}' -clean=true
|
||||
|
||||
generate:icons:
|
||||
summary: Generates Windows `.ico` and Mac `.icns` files from an image
|
||||
dir: build
|
||||
sources:
|
||||
- "appicon.png"
|
||||
generates:
|
||||
- "darwin/icons.icns"
|
||||
- "windows/icon.ico"
|
||||
cmds:
|
||||
- wails3 generate icons -input appicon.png -macfilename darwin/icons.icns -windowsfilename windows/icon.ico
|
||||
|
||||
dev:frontend:
|
||||
summary: Runs the frontend in development mode
|
||||
dir: frontend
|
||||
deps:
|
||||
- task: install:frontend:deps
|
||||
cmds:
|
||||
- npm run dev -- --port {{.VITE_PORT}} --strictPort
|
||||
|
||||
update:build-assets:
|
||||
summary: Updates the build assets
|
||||
dir: build
|
||||
cmds:
|
||||
- wails3 update build-assets -name "{{.APP_NAME}}" -binaryname "{{.APP_NAME}}" -config config.yml -dir .
|
||||
|
||||
|
||||
ios:device:list:
|
||||
summary: Lists connected iOS devices (UDIDs)
|
||||
cmds:
|
||||
- xcrun xcdevice list
|
||||
|
||||
ios:run:device:
|
||||
summary: Build, install, and launch on a physical iPhone using Apple tools (xcodebuild/devicectl)
|
||||
vars:
|
||||
PROJECT: '{{.PROJECT}}' # e.g., build/ios/xcode/<YourProject>.xcodeproj
|
||||
SCHEME: '{{.SCHEME}}' # e.g., ios.dev
|
||||
CONFIG: '{{.CONFIG | default "Debug"}}'
|
||||
DERIVED: '{{.DERIVED | default "build/ios/DerivedData"}}'
|
||||
UDID: '{{.UDID}}' # from `task ios:device:list`
|
||||
BUNDLE_ID: '{{.BUNDLE_ID}}' # e.g., com.yourco.wails.ios.dev
|
||||
TEAM_ID: '{{.TEAM_ID}}' # optional, if your project is not already set up for signing
|
||||
preconditions:
|
||||
- sh: xcrun -f xcodebuild
|
||||
msg: "xcodebuild not found. Please install Xcode."
|
||||
- sh: xcrun -f devicectl
|
||||
msg: "devicectl not found. Please update to Xcode 15+ (which includes devicectl)."
|
||||
- sh: test -n "{{.PROJECT}}"
|
||||
msg: "Set PROJECT to your .xcodeproj path (e.g., PROJECT=build/ios/xcode/App.xcodeproj)."
|
||||
- sh: test -n "{{.SCHEME}}"
|
||||
msg: "Set SCHEME to your app scheme (e.g., SCHEME=ios.dev)."
|
||||
- sh: test -n "{{.UDID}}"
|
||||
msg: "Set UDID to your device UDID (see: task ios:device:list)."
|
||||
- sh: test -n "{{.BUNDLE_ID}}"
|
||||
msg: "Set BUNDLE_ID to your app's bundle identifier (e.g., com.yourco.wails.ios.dev)."
|
||||
cmds:
|
||||
- |
|
||||
set -euo pipefail
|
||||
echo "Building for device: UDID={{.UDID}} SCHEME={{.SCHEME}} PROJECT={{.PROJECT}}"
|
||||
XCB_ARGS=(
|
||||
-project "{{.PROJECT}}"
|
||||
-scheme "{{.SCHEME}}"
|
||||
-configuration "{{.CONFIG}}"
|
||||
-destination "id={{.UDID}}"
|
||||
-derivedDataPath "{{.DERIVED}}"
|
||||
-allowProvisioningUpdates
|
||||
-allowProvisioningDeviceRegistration
|
||||
)
|
||||
# Optionally inject signing identifiers if provided
|
||||
if [ -n "{{.TEAM_ID}}" ]; then XCB_ARGS+=(DEVELOPMENT_TEAM={{.TEAM_ID}}); fi
|
||||
if [ -n "{{.BUNDLE_ID}}" ]; then XCB_ARGS+=(PRODUCT_BUNDLE_IDENTIFIER={{.BUNDLE_ID}}); fi
|
||||
xcodebuild "${XCB_ARGS[@]}" build | xcpretty || true
|
||||
# If xcpretty isn't installed, run without it
|
||||
if [ "${PIPESTATUS[0]}" -ne 0 ]; then
|
||||
xcodebuild "${XCB_ARGS[@]}" build
|
||||
fi
|
||||
# Find built .app
|
||||
APP_PATH=$(find "{{.DERIVED}}/Build/Products" -type d -name "*.app" -maxdepth 3 | head -n 1)
|
||||
if [ -z "$APP_PATH" ]; then
|
||||
echo "Could not locate built .app under {{.DERIVED}}/Build/Products" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Installing: $APP_PATH"
|
||||
xcrun devicectl device install app --device "{{.UDID}}" "$APP_PATH"
|
||||
echo "Launching: {{.BUNDLE_ID}}"
|
||||
xcrun devicectl device process launch --device "{{.UDID}}" --stderr console --stdout console "{{.BUNDLE_ID}}"
|
||||
237
v3/examples/android/build/android/Taskfile.yml
Normal file
|
|
@ -0,0 +1,237 @@
|
|||
version: '3'
|
||||
|
||||
includes:
|
||||
common: ../Taskfile.yml
|
||||
|
||||
vars:
|
||||
APP_ID: '{{.APP_ID | default "com.wails.app"}}'
|
||||
MIN_SDK: '21'
|
||||
TARGET_SDK: '34'
|
||||
NDK_VERSION: 'r26d'
|
||||
|
||||
tasks:
|
||||
install:deps:
|
||||
summary: Check and install Android development dependencies
|
||||
cmds:
|
||||
- go run build/android/scripts/deps/install_deps.go
|
||||
env:
|
||||
TASK_FORCE_YES: '{{if .YES}}true{{else}}false{{end}}'
|
||||
prompt: This will check and install Android development dependencies. Continue?
|
||||
|
||||
build:
|
||||
summary: Creates a build of the application for Android
|
||||
deps:
|
||||
- task: common:go:mod:tidy
|
||||
- task: generate:android:bindings
|
||||
vars:
|
||||
BUILD_FLAGS:
|
||||
ref: .BUILD_FLAGS
|
||||
- task: common:build:frontend
|
||||
vars:
|
||||
BUILD_FLAGS:
|
||||
ref: .BUILD_FLAGS
|
||||
PRODUCTION:
|
||||
ref: .PRODUCTION
|
||||
- task: common:generate:icons
|
||||
cmds:
|
||||
- echo "Building Android app {{.APP_NAME}}..."
|
||||
- task: compile:go:shared
|
||||
vars:
|
||||
ARCH: '{{.ARCH | default "arm64"}}'
|
||||
vars:
|
||||
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production,android -trimpath -buildvcs=false -ldflags="-w -s"{{else}}-tags android,debug -buildvcs=false -gcflags=all="-l"{{end}}'
|
||||
env:
|
||||
PRODUCTION: '{{.PRODUCTION | default "false"}}'
|
||||
|
||||
compile:go:shared:
|
||||
summary: Compile Go code to shared library (.so)
|
||||
cmds:
|
||||
- |
|
||||
NDK_ROOT="${ANDROID_NDK_HOME:-$ANDROID_HOME/ndk/{{.NDK_VERSION}}}"
|
||||
if [ ! -d "$NDK_ROOT" ]; then
|
||||
echo "Error: Android NDK not found at $NDK_ROOT"
|
||||
echo "Please set ANDROID_NDK_HOME or install NDK {{.NDK_VERSION}} via Android Studio"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Determine toolchain based on host OS
|
||||
case "$(uname -s)" in
|
||||
Darwin) HOST_TAG="darwin-x86_64" ;;
|
||||
Linux) HOST_TAG="linux-x86_64" ;;
|
||||
*) echo "Unsupported host OS"; exit 1 ;;
|
||||
esac
|
||||
|
||||
TOOLCHAIN="$NDK_ROOT/toolchains/llvm/prebuilt/$HOST_TAG"
|
||||
|
||||
# Set compiler based on architecture
|
||||
case "{{.ARCH}}" in
|
||||
arm64)
|
||||
export CC="$TOOLCHAIN/bin/aarch64-linux-android{{.MIN_SDK}}-clang"
|
||||
export CXX="$TOOLCHAIN/bin/aarch64-linux-android{{.MIN_SDK}}-clang++"
|
||||
export GOARCH=arm64
|
||||
JNI_DIR="arm64-v8a"
|
||||
;;
|
||||
amd64|x86_64)
|
||||
export CC="$TOOLCHAIN/bin/x86_64-linux-android{{.MIN_SDK}}-clang"
|
||||
export CXX="$TOOLCHAIN/bin/x86_64-linux-android{{.MIN_SDK}}-clang++"
|
||||
export GOARCH=amd64
|
||||
JNI_DIR="x86_64"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported architecture: {{.ARCH}}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
export CGO_ENABLED=1
|
||||
export GOOS=android
|
||||
|
||||
mkdir -p {{.BIN_DIR}}
|
||||
mkdir -p build/android/app/src/main/jniLibs/$JNI_DIR
|
||||
|
||||
go build -buildmode=c-shared {{.BUILD_FLAGS}} \
|
||||
-o build/android/app/src/main/jniLibs/$JNI_DIR/libwails.so
|
||||
vars:
|
||||
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production,android -trimpath -buildvcs=false -ldflags="-w -s"{{else}}-tags android,debug -buildvcs=false -gcflags=all="-l"{{end}}'
|
||||
|
||||
compile:go:all-archs:
|
||||
summary: Compile Go code for all Android architectures (fat APK)
|
||||
cmds:
|
||||
- task: compile:go:shared
|
||||
vars:
|
||||
ARCH: arm64
|
||||
- task: compile:go:shared
|
||||
vars:
|
||||
ARCH: amd64
|
||||
|
||||
package:
|
||||
summary: Packages a production build of the application into an APK
|
||||
deps:
|
||||
- task: build
|
||||
vars:
|
||||
PRODUCTION: "true"
|
||||
cmds:
|
||||
- task: assemble:apk
|
||||
|
||||
package:fat:
|
||||
summary: Packages a production build for all architectures (fat APK)
|
||||
cmds:
|
||||
- task: compile:go:all-archs
|
||||
- task: assemble:apk
|
||||
|
||||
assemble:apk:
|
||||
summary: Assembles the APK using Gradle
|
||||
cmds:
|
||||
- |
|
||||
cd build/android
|
||||
./gradlew assembleDebug
|
||||
cp app/build/outputs/apk/debug/app-debug.apk ../../{{.BIN_DIR}}/{{.APP_NAME}}.apk
|
||||
echo "APK created: {{.BIN_DIR}}/{{.APP_NAME}}.apk"
|
||||
|
||||
assemble:apk:release:
|
||||
summary: Assembles a release APK using Gradle
|
||||
cmds:
|
||||
- |
|
||||
cd build/android
|
||||
./gradlew assembleRelease
|
||||
cp app/build/outputs/apk/release/app-release-unsigned.apk ../../{{.BIN_DIR}}/{{.APP_NAME}}-release.apk
|
||||
echo "Release APK created: {{.BIN_DIR}}/{{.APP_NAME}}-release.apk"
|
||||
|
||||
generate:android:bindings:
|
||||
internal: true
|
||||
summary: Generates bindings for Android
|
||||
sources:
|
||||
- "**/*.go"
|
||||
- go.mod
|
||||
- go.sum
|
||||
generates:
|
||||
- frontend/bindings/**/*
|
||||
cmds:
|
||||
- wails3 generate bindings -f '{{.BUILD_FLAGS}}' -clean=true
|
||||
env:
|
||||
GOOS: android
|
||||
CGO_ENABLED: 1
|
||||
GOARCH: '{{.ARCH | default "arm64"}}'
|
||||
|
||||
ensure-emulator:
|
||||
internal: true
|
||||
summary: Ensure Android Emulator is running
|
||||
silent: true
|
||||
cmds:
|
||||
- |
|
||||
# Check if an emulator is already running
|
||||
if adb devices | grep -q "emulator"; then
|
||||
echo "Emulator already running"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Get first available AVD
|
||||
AVD_NAME=$(emulator -list-avds | head -1)
|
||||
if [ -z "$AVD_NAME" ]; then
|
||||
echo "No Android Virtual Devices found."
|
||||
echo "Create one using: Android Studio > Tools > Device Manager"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Starting emulator: $AVD_NAME"
|
||||
emulator -avd "$AVD_NAME" -no-snapshot-load &
|
||||
|
||||
# Wait for emulator to boot (max 60 seconds)
|
||||
echo "Waiting for emulator to boot..."
|
||||
adb wait-for-device
|
||||
|
||||
for i in {1..60}; do
|
||||
BOOT_COMPLETED=$(adb shell getprop sys.boot_completed 2>/dev/null | tr -d '\r')
|
||||
if [ "$BOOT_COMPLETED" = "1" ]; then
|
||||
echo "Emulator booted successfully"
|
||||
exit 0
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "Emulator boot timeout"
|
||||
exit 1
|
||||
preconditions:
|
||||
- sh: command -v adb
|
||||
msg: "adb not found. Please install Android SDK and add platform-tools to PATH"
|
||||
- sh: command -v emulator
|
||||
msg: "emulator not found. Please install Android SDK and add emulator to PATH"
|
||||
|
||||
deploy-emulator:
|
||||
summary: Deploy to Android Emulator
|
||||
deps: [package]
|
||||
cmds:
|
||||
- adb uninstall {{.APP_ID}} 2>/dev/null || true
|
||||
- adb install {{.BIN_DIR}}/{{.APP_NAME}}.apk
|
||||
- adb shell am start -n {{.APP_ID}}/.MainActivity
|
||||
|
||||
run:
|
||||
summary: Run the application in Android Emulator
|
||||
deps:
|
||||
- task: ensure-emulator
|
||||
- task: build
|
||||
vars:
|
||||
ARCH: x86_64
|
||||
cmds:
|
||||
- task: assemble:apk
|
||||
- adb uninstall {{.APP_ID}} 2>/dev/null || true
|
||||
- adb install {{.BIN_DIR}}/{{.APP_NAME}}.apk
|
||||
- adb shell am start -n {{.APP_ID}}/.MainActivity
|
||||
|
||||
logs:
|
||||
summary: Stream Android logcat filtered to this app
|
||||
cmds:
|
||||
- adb logcat -v time | grep -E "(Wails|{{.APP_NAME}})"
|
||||
|
||||
logs:all:
|
||||
summary: Stream all Android logcat (verbose)
|
||||
cmds:
|
||||
- adb logcat -v time
|
||||
|
||||
clean:
|
||||
summary: Clean build artifacts
|
||||
cmds:
|
||||
- rm -rf {{.BIN_DIR}}
|
||||
- rm -rf build/android/app/build
|
||||
- rm -rf build/android/app/src/main/jniLibs/*/libwails.so
|
||||
- rm -rf build/android/.gradle
|
||||
63
v3/examples/android/build/android/app/build.gradle
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.wails.app'
|
||||
compileSdk 34
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.wails.app"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
// Configure supported ABIs
|
||||
ndk {
|
||||
abiFilters 'arm64-v8a', 'x86_64'
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
debug {
|
||||
debuggable true
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
// Source sets configuration
|
||||
sourceSets {
|
||||
main {
|
||||
// JNI libraries are in jniLibs folder
|
||||
jniLibs.srcDirs = ['src/main/jniLibs']
|
||||
// Assets for the WebView
|
||||
assets.srcDirs = ['src/main/assets']
|
||||
}
|
||||
}
|
||||
|
||||
// Packaging options
|
||||
packagingOptions {
|
||||
// Don't strip Go symbols in debug builds
|
||||
doNotStrip '*/arm64-v8a/libwails.so'
|
||||
doNotStrip '*/x86_64/libwails.so'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'androidx.webkit:webkit:1.9.0'
|
||||
implementation 'com.google.android.material:material:1.11.0'
|
||||
}
|
||||
12
v3/examples/android/build/android/app/proguard-rules.pro
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
|
||||
# Keep native methods
|
||||
-keepclasseswithmembernames class * {
|
||||
native <methods>;
|
||||
}
|
||||
|
||||
# Keep Wails bridge classes
|
||||
-keep class com.wails.app.WailsBridge { *; }
|
||||
-keep class com.wails.app.WailsJSBridge { *; }
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<!-- Internet permission for WebView -->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.WailsApp"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:targetApi="31">
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
|
@ -0,0 +1,198 @@
|
|||
package com.wails.app;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebResourceResponse;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.webkit.WebViewAssetLoader;
|
||||
import com.wails.app.BuildConfig;
|
||||
|
||||
/**
|
||||
* MainActivity hosts the WebView and manages the Wails application lifecycle.
|
||||
* It uses WebViewAssetLoader to serve assets from the Go library without
|
||||
* requiring a network server.
|
||||
*/
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
private static final String TAG = "WailsActivity";
|
||||
private static final String WAILS_SCHEME = "https";
|
||||
private static final String WAILS_HOST = "wails.localhost";
|
||||
|
||||
private WebView webView;
|
||||
private WailsBridge bridge;
|
||||
private WebViewAssetLoader assetLoader;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
// Initialize the native Go library
|
||||
bridge = new WailsBridge(this);
|
||||
bridge.initialize();
|
||||
|
||||
// Set up WebView
|
||||
setupWebView();
|
||||
|
||||
// Load the application
|
||||
loadApplication();
|
||||
}
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
private void setupWebView() {
|
||||
webView = findViewById(R.id.webview);
|
||||
|
||||
// Configure WebView settings
|
||||
WebSettings settings = webView.getSettings();
|
||||
settings.setJavaScriptEnabled(true);
|
||||
settings.setDomStorageEnabled(true);
|
||||
settings.setDatabaseEnabled(true);
|
||||
settings.setAllowFileAccess(false);
|
||||
settings.setAllowContentAccess(false);
|
||||
settings.setMediaPlaybackRequiresUserGesture(false);
|
||||
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_NEVER_ALLOW);
|
||||
|
||||
// Enable debugging in debug builds
|
||||
if (BuildConfig.DEBUG) {
|
||||
WebView.setWebContentsDebuggingEnabled(true);
|
||||
}
|
||||
|
||||
// Set up asset loader for serving local assets
|
||||
assetLoader = new WebViewAssetLoader.Builder()
|
||||
.setDomain(WAILS_HOST)
|
||||
.addPathHandler("/", new WailsPathHandler(bridge))
|
||||
.build();
|
||||
|
||||
// Set up WebView client to intercept requests
|
||||
webView.setWebViewClient(new WebViewClient() {
|
||||
@Nullable
|
||||
@Override
|
||||
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
|
||||
String url = request.getUrl().toString();
|
||||
Log.d(TAG, "Intercepting request: " + url);
|
||||
|
||||
// Handle wails.localhost requests
|
||||
if (request.getUrl().getHost() != null &&
|
||||
request.getUrl().getHost().equals(WAILS_HOST)) {
|
||||
|
||||
// For wails API calls (runtime, capabilities, etc.), we need to pass the full URL
|
||||
// including query string because WebViewAssetLoader.PathHandler strips query params
|
||||
String path = request.getUrl().getPath();
|
||||
if (path != null && path.startsWith("/wails/")) {
|
||||
// Get full path with query string for runtime calls
|
||||
String fullPath = path;
|
||||
String query = request.getUrl().getQuery();
|
||||
if (query != null && !query.isEmpty()) {
|
||||
fullPath = path + "?" + query;
|
||||
}
|
||||
Log.d(TAG, "Wails API call detected, full path: " + fullPath);
|
||||
|
||||
// Call bridge directly with full path
|
||||
byte[] data = bridge.serveAsset(fullPath, request.getMethod(), "{}");
|
||||
if (data != null && data.length > 0) {
|
||||
java.io.InputStream inputStream = new java.io.ByteArrayInputStream(data);
|
||||
java.util.Map<String, String> headers = new java.util.HashMap<>();
|
||||
headers.put("Access-Control-Allow-Origin", "*");
|
||||
headers.put("Cache-Control", "no-cache");
|
||||
headers.put("Content-Type", "application/json");
|
||||
|
||||
return new WebResourceResponse(
|
||||
"application/json",
|
||||
"UTF-8",
|
||||
200,
|
||||
"OK",
|
||||
headers,
|
||||
inputStream
|
||||
);
|
||||
}
|
||||
// Return error response if data is null
|
||||
return new WebResourceResponse(
|
||||
"application/json",
|
||||
"UTF-8",
|
||||
500,
|
||||
"Internal Error",
|
||||
new java.util.HashMap<>(),
|
||||
new java.io.ByteArrayInputStream("{}".getBytes())
|
||||
);
|
||||
}
|
||||
|
||||
// For regular assets, use the asset loader
|
||||
return assetLoader.shouldInterceptRequest(request.getUrl());
|
||||
}
|
||||
|
||||
return super.shouldInterceptRequest(view, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
Log.d(TAG, "Page loaded: " + url);
|
||||
// Inject Wails runtime
|
||||
bridge.injectRuntime(webView, url);
|
||||
}
|
||||
});
|
||||
|
||||
// Add JavaScript interface for Go communication
|
||||
webView.addJavascriptInterface(new WailsJSBridge(bridge, webView), "wails");
|
||||
}
|
||||
|
||||
private void loadApplication() {
|
||||
// Load the main page from the asset server
|
||||
String url = WAILS_SCHEME + "://" + WAILS_HOST + "/";
|
||||
Log.d(TAG, "Loading URL: " + url);
|
||||
webView.loadUrl(url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute JavaScript in the WebView from the Go side
|
||||
*/
|
||||
public void executeJavaScript(final String js) {
|
||||
runOnUiThread(() -> {
|
||||
if (webView != null) {
|
||||
webView.evaluateJavascript(js, null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (bridge != null) {
|
||||
bridge.onResume();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
if (bridge != null) {
|
||||
bridge.onPause();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (bridge != null) {
|
||||
bridge.shutdown();
|
||||
}
|
||||
if (webView != null) {
|
||||
webView.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (webView != null && webView.canGoBack()) {
|
||||
webView.goBack();
|
||||
} else {
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,214 @@
|
|||
package com.wails.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* WailsBridge manages the connection between the Java/Android side and the Go native library.
|
||||
* It handles:
|
||||
* - Loading and initializing the native Go library
|
||||
* - Serving asset requests from Go
|
||||
* - Passing messages between JavaScript and Go
|
||||
* - Managing callbacks for async operations
|
||||
*/
|
||||
public class WailsBridge {
|
||||
private static final String TAG = "WailsBridge";
|
||||
|
||||
static {
|
||||
// Load the native Go library
|
||||
System.loadLibrary("wails");
|
||||
}
|
||||
|
||||
private final Context context;
|
||||
private final AtomicInteger callbackIdGenerator = new AtomicInteger(0);
|
||||
private final ConcurrentHashMap<Integer, AssetCallback> pendingAssetCallbacks = new ConcurrentHashMap<>();
|
||||
private final ConcurrentHashMap<Integer, MessageCallback> pendingMessageCallbacks = new ConcurrentHashMap<>();
|
||||
private WebView webView;
|
||||
private volatile boolean initialized = false;
|
||||
|
||||
// Native methods - implemented in Go
|
||||
private static native void nativeInit(WailsBridge bridge);
|
||||
private static native void nativeShutdown();
|
||||
private static native void nativeOnResume();
|
||||
private static native void nativeOnPause();
|
||||
private static native void nativeOnPageFinished(String url);
|
||||
private static native byte[] nativeServeAsset(String path, String method, String headers);
|
||||
private static native String nativeHandleMessage(String message);
|
||||
private static native String nativeGetAssetMimeType(String path);
|
||||
|
||||
public WailsBridge(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the native Go library
|
||||
*/
|
||||
public void initialize() {
|
||||
if (initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
Log.i(TAG, "Initializing Wails bridge...");
|
||||
try {
|
||||
nativeInit(this);
|
||||
initialized = true;
|
||||
Log.i(TAG, "Wails bridge initialized successfully");
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Failed to initialize Wails bridge", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shutdown the native Go library
|
||||
*/
|
||||
public void shutdown() {
|
||||
if (!initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
Log.i(TAG, "Shutting down Wails bridge...");
|
||||
try {
|
||||
nativeShutdown();
|
||||
initialized = false;
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error during shutdown", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the activity resumes
|
||||
*/
|
||||
public void onResume() {
|
||||
if (initialized) {
|
||||
nativeOnResume();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the activity pauses
|
||||
*/
|
||||
public void onPause() {
|
||||
if (initialized) {
|
||||
nativeOnPause();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Serve an asset from the Go asset server
|
||||
* @param path The URL path requested
|
||||
* @param method The HTTP method
|
||||
* @param headers The request headers as JSON
|
||||
* @return The asset data, or null if not found
|
||||
*/
|
||||
public byte[] serveAsset(String path, String method, String headers) {
|
||||
if (!initialized) {
|
||||
Log.w(TAG, "Bridge not initialized, cannot serve asset: " + path);
|
||||
return null;
|
||||
}
|
||||
|
||||
Log.d(TAG, "Serving asset: " + path);
|
||||
try {
|
||||
return nativeServeAsset(path, method, headers);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error serving asset: " + path, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the MIME type for an asset
|
||||
* @param path The asset path
|
||||
* @return The MIME type string
|
||||
*/
|
||||
public String getAssetMimeType(String path) {
|
||||
if (!initialized) {
|
||||
return "application/octet-stream";
|
||||
}
|
||||
|
||||
try {
|
||||
String mimeType = nativeGetAssetMimeType(path);
|
||||
return mimeType != null ? mimeType : "application/octet-stream";
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error getting MIME type for: " + path, e);
|
||||
return "application/octet-stream";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a message from JavaScript
|
||||
* @param message The message from JavaScript (JSON)
|
||||
* @return The response to send back to JavaScript (JSON)
|
||||
*/
|
||||
public String handleMessage(String message) {
|
||||
if (!initialized) {
|
||||
Log.w(TAG, "Bridge not initialized, cannot handle message");
|
||||
return "{\"error\":\"Bridge not initialized\"}";
|
||||
}
|
||||
|
||||
Log.d(TAG, "Handling message from JS: " + message);
|
||||
try {
|
||||
return nativeHandleMessage(message);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error handling message", e);
|
||||
return "{\"error\":\"" + e.getMessage() + "\"}";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Inject the Wails runtime JavaScript into the WebView.
|
||||
* Called when the page finishes loading.
|
||||
* @param webView The WebView to inject into
|
||||
* @param url The URL that finished loading
|
||||
*/
|
||||
public void injectRuntime(WebView webView, String url) {
|
||||
this.webView = webView;
|
||||
// Notify Go side that page has finished loading so it can inject the runtime
|
||||
Log.d(TAG, "Page finished loading: " + url + ", notifying Go side");
|
||||
if (initialized) {
|
||||
nativeOnPageFinished(url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute JavaScript in the WebView (called from Go side)
|
||||
* @param js The JavaScript code to execute
|
||||
*/
|
||||
public void executeJavaScript(String js) {
|
||||
if (webView != null) {
|
||||
webView.post(() -> webView.evaluateJavascript(js, null));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called from Go when an event needs to be emitted to JavaScript
|
||||
* @param eventName The event name
|
||||
* @param eventData The event data (JSON)
|
||||
*/
|
||||
public void emitEvent(String eventName, String eventData) {
|
||||
String js = String.format("window.wails && window.wails._emit('%s', %s);",
|
||||
escapeJsString(eventName), eventData);
|
||||
executeJavaScript(js);
|
||||
}
|
||||
|
||||
private String escapeJsString(String str) {
|
||||
return str.replace("\\", "\\\\")
|
||||
.replace("'", "\\'")
|
||||
.replace("\n", "\\n")
|
||||
.replace("\r", "\\r");
|
||||
}
|
||||
|
||||
// Callback interfaces
|
||||
public interface AssetCallback {
|
||||
void onAssetReady(byte[] data, String mimeType);
|
||||
void onAssetError(String error);
|
||||
}
|
||||
|
||||
public interface MessageCallback {
|
||||
void onResponse(String response);
|
||||
void onError(String error);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
package com.wails.app;
|
||||
|
||||
import android.util.Log;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.webkit.WebView;
|
||||
import com.wails.app.BuildConfig;
|
||||
|
||||
/**
|
||||
* WailsJSBridge provides the JavaScript interface that allows the web frontend
|
||||
* to communicate with the Go backend. This is exposed to JavaScript as the
|
||||
* `window.wails` object.
|
||||
*
|
||||
* Similar to iOS's WKScriptMessageHandler but using Android's addJavascriptInterface.
|
||||
*/
|
||||
public class WailsJSBridge {
|
||||
private static final String TAG = "WailsJSBridge";
|
||||
|
||||
private final WailsBridge bridge;
|
||||
private final WebView webView;
|
||||
|
||||
public WailsJSBridge(WailsBridge bridge, WebView webView) {
|
||||
this.bridge = bridge;
|
||||
this.webView = webView;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a message to Go and return the response synchronously.
|
||||
* Called from JavaScript: wails.invoke(message)
|
||||
*
|
||||
* @param message The message to send (JSON string)
|
||||
* @return The response from Go (JSON string)
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public String invoke(String message) {
|
||||
Log.d(TAG, "Invoke called: " + message);
|
||||
return bridge.handleMessage(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a message to Go asynchronously.
|
||||
* The response will be sent back via a callback.
|
||||
* Called from JavaScript: wails.invokeAsync(callbackId, message)
|
||||
*
|
||||
* @param callbackId The callback ID to use for the response
|
||||
* @param message The message to send (JSON string)
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public void invokeAsync(final String callbackId, final String message) {
|
||||
Log.d(TAG, "InvokeAsync called: " + message);
|
||||
|
||||
// Handle in background thread to not block JavaScript
|
||||
new Thread(() -> {
|
||||
try {
|
||||
String response = bridge.handleMessage(message);
|
||||
sendCallback(callbackId, response, null);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error in async invoke", e);
|
||||
sendCallback(callbackId, null, e.getMessage());
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Log a message from JavaScript to Android's logcat
|
||||
* Called from JavaScript: wails.log(level, message)
|
||||
*
|
||||
* @param level The log level (debug, info, warn, error)
|
||||
* @param message The message to log
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public void log(String level, String message) {
|
||||
switch (level.toLowerCase()) {
|
||||
case "debug":
|
||||
Log.d(TAG + "/JS", message);
|
||||
break;
|
||||
case "info":
|
||||
Log.i(TAG + "/JS", message);
|
||||
break;
|
||||
case "warn":
|
||||
Log.w(TAG + "/JS", message);
|
||||
break;
|
||||
case "error":
|
||||
Log.e(TAG + "/JS", message);
|
||||
break;
|
||||
default:
|
||||
Log.v(TAG + "/JS", message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the platform name
|
||||
* Called from JavaScript: wails.platform()
|
||||
*
|
||||
* @return "android"
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public String platform() {
|
||||
return "android";
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if we're running in debug mode
|
||||
* Called from JavaScript: wails.isDebug()
|
||||
*
|
||||
* @return true if debug build, false otherwise
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public boolean isDebug() {
|
||||
return BuildConfig.DEBUG;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a callback response to JavaScript
|
||||
*/
|
||||
private void sendCallback(String callbackId, String result, String error) {
|
||||
final String js;
|
||||
if (error != null) {
|
||||
js = String.format(
|
||||
"window.wails && window.wails._callback('%s', null, '%s');",
|
||||
escapeJsString(callbackId),
|
||||
escapeJsString(error)
|
||||
);
|
||||
} else {
|
||||
js = String.format(
|
||||
"window.wails && window.wails._callback('%s', %s, null);",
|
||||
escapeJsString(callbackId),
|
||||
result != null ? result : "null"
|
||||
);
|
||||
}
|
||||
|
||||
webView.post(() -> webView.evaluateJavascript(js, null));
|
||||
}
|
||||
|
||||
private String escapeJsString(String str) {
|
||||
if (str == null) return "";
|
||||
return str.replace("\\", "\\\\")
|
||||
.replace("'", "\\'")
|
||||
.replace("\n", "\\n")
|
||||
.replace("\r", "\\r");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
package com.wails.app;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
import android.webkit.WebResourceResponse;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.webkit.WebViewAssetLoader;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* WailsPathHandler implements WebViewAssetLoader.PathHandler to serve assets
|
||||
* from the Go asset server. This allows the WebView to load assets without
|
||||
* using a network server, similar to iOS's WKURLSchemeHandler.
|
||||
*/
|
||||
public class WailsPathHandler implements WebViewAssetLoader.PathHandler {
|
||||
private static final String TAG = "WailsPathHandler";
|
||||
|
||||
private final WailsBridge bridge;
|
||||
|
||||
public WailsPathHandler(WailsBridge bridge) {
|
||||
this.bridge = bridge;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public WebResourceResponse handle(@NonNull String path) {
|
||||
Log.d(TAG, "Handling path: " + path);
|
||||
|
||||
// Normalize path
|
||||
if (path.isEmpty() || path.equals("/")) {
|
||||
path = "/index.html";
|
||||
}
|
||||
|
||||
// Get asset from Go
|
||||
byte[] data = bridge.serveAsset(path, "GET", "{}");
|
||||
|
||||
if (data == null || data.length == 0) {
|
||||
Log.w(TAG, "Asset not found: " + path);
|
||||
return null; // Return null to let WebView handle 404
|
||||
}
|
||||
|
||||
// Determine MIME type
|
||||
String mimeType = bridge.getAssetMimeType(path);
|
||||
Log.d(TAG, "Serving " + path + " with type " + mimeType + " (" + data.length + " bytes)");
|
||||
|
||||
// Create response
|
||||
InputStream inputStream = new ByteArrayInputStream(data);
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Access-Control-Allow-Origin", "*");
|
||||
headers.put("Cache-Control", "no-cache");
|
||||
|
||||
return new WebResourceResponse(
|
||||
mimeType,
|
||||
"UTF-8",
|
||||
200,
|
||||
"OK",
|
||||
headers,
|
||||
inputStream
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine MIME type from file extension
|
||||
*/
|
||||
private String getMimeType(String path) {
|
||||
String lowerPath = path.toLowerCase();
|
||||
|
||||
if (lowerPath.endsWith(".html") || lowerPath.endsWith(".htm")) {
|
||||
return "text/html";
|
||||
} else if (lowerPath.endsWith(".js") || lowerPath.endsWith(".mjs")) {
|
||||
return "application/javascript";
|
||||
} else if (lowerPath.endsWith(".css")) {
|
||||
return "text/css";
|
||||
} else if (lowerPath.endsWith(".json")) {
|
||||
return "application/json";
|
||||
} else if (lowerPath.endsWith(".png")) {
|
||||
return "image/png";
|
||||
} else if (lowerPath.endsWith(".jpg") || lowerPath.endsWith(".jpeg")) {
|
||||
return "image/jpeg";
|
||||
} else if (lowerPath.endsWith(".gif")) {
|
||||
return "image/gif";
|
||||
} else if (lowerPath.endsWith(".svg")) {
|
||||
return "image/svg+xml";
|
||||
} else if (lowerPath.endsWith(".ico")) {
|
||||
return "image/x-icon";
|
||||
} else if (lowerPath.endsWith(".woff")) {
|
||||
return "font/woff";
|
||||
} else if (lowerPath.endsWith(".woff2")) {
|
||||
return "font/woff2";
|
||||
} else if (lowerPath.endsWith(".ttf")) {
|
||||
return "font/ttf";
|
||||
} else if (lowerPath.endsWith(".eot")) {
|
||||
return "application/vnd.ms-fontobject";
|
||||
} else if (lowerPath.endsWith(".xml")) {
|
||||
return "application/xml";
|
||||
} else if (lowerPath.endsWith(".txt")) {
|
||||
return "text/plain";
|
||||
} else if (lowerPath.endsWith(".wasm")) {
|
||||
return "application/wasm";
|
||||
} else if (lowerPath.endsWith(".mp3")) {
|
||||
return "audio/mpeg";
|
||||
} else if (lowerPath.endsWith(".mp4")) {
|
||||
return "video/mp4";
|
||||
} else if (lowerPath.endsWith(".webm")) {
|
||||
return "video/webm";
|
||||
} else if (lowerPath.endsWith(".webp")) {
|
||||
return "image/webp";
|
||||
}
|
||||
|
||||
return "application/octet-stream";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/main_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 7 KiB |
|
After Width: | Height: | Size: 7 KiB |
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="wails_blue">#3574D4</color>
|
||||
<color name="wails_blue_dark">#2C5FB8</color>
|
||||
<color name="wails_background">#1B2636</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="black">#FF000000</color>
|
||||
</resources>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Wails App</string>
|
||||
</resources>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Theme.WailsApp" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/wails_blue</item>
|
||||
<item name="colorPrimaryVariant">@color/wails_blue_dark</item>
|
||||
<item name="colorOnPrimary">@android:color/white</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">@color/wails_background</item>
|
||||
<item name="android:navigationBarColor">@color/wails_background</item>
|
||||
<!-- Window background -->
|
||||
<item name="android:windowBackground">@color/wails_background</item>
|
||||
</style>
|
||||
</resources>
|
||||
4
v3/examples/android/build/android/build.gradle
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id 'com.android.application' version '8.7.3' apply false
|
||||
}
|
||||
26
v3/examples/android/build/android/gradle.properties
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# Project-wide Gradle settings.
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. For more details, visit
|
||||
# https://developer.android.com/build/optimize-your-build#parallel
|
||||
# org.gradle.parallel=true
|
||||
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
|
||||
# Enables namespacing of each library's R class so that its R class includes only the
|
||||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
||||
BIN
v3/examples/android/build/android/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
7
v3/examples/android/build/android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
248
v3/examples/android/build/android/gradlew
vendored
Executable file
|
|
@ -0,0 +1,248 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
93
v3/examples/android/build/android/gradlew.bat
vendored
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
151
v3/examples/android/build/android/scripts/deps/install_deps.go
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println("Checking Android development dependencies...")
|
||||
fmt.Println()
|
||||
|
||||
errors := []string{}
|
||||
|
||||
// Check Go
|
||||
if !checkCommand("go", "version") {
|
||||
errors = append(errors, "Go is not installed. Install from https://go.dev/dl/")
|
||||
} else {
|
||||
fmt.Println("✓ Go is installed")
|
||||
}
|
||||
|
||||
// Check ANDROID_HOME
|
||||
androidHome := os.Getenv("ANDROID_HOME")
|
||||
if androidHome == "" {
|
||||
androidHome = os.Getenv("ANDROID_SDK_ROOT")
|
||||
}
|
||||
if androidHome == "" {
|
||||
// Try common default locations
|
||||
home, _ := os.UserHomeDir()
|
||||
possiblePaths := []string{
|
||||
filepath.Join(home, "Android", "Sdk"),
|
||||
filepath.Join(home, "Library", "Android", "sdk"),
|
||||
"/usr/local/share/android-sdk",
|
||||
}
|
||||
for _, p := range possiblePaths {
|
||||
if _, err := os.Stat(p); err == nil {
|
||||
androidHome = p
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if androidHome == "" {
|
||||
errors = append(errors, "ANDROID_HOME not set. Install Android Studio and set ANDROID_HOME environment variable")
|
||||
} else {
|
||||
fmt.Printf("✓ ANDROID_HOME: %s\n", androidHome)
|
||||
}
|
||||
|
||||
// Check adb
|
||||
if !checkCommand("adb", "version") {
|
||||
if androidHome != "" {
|
||||
platformTools := filepath.Join(androidHome, "platform-tools")
|
||||
errors = append(errors, fmt.Sprintf("adb not found. Add %s to PATH", platformTools))
|
||||
} else {
|
||||
errors = append(errors, "adb not found. Install Android SDK Platform-Tools")
|
||||
}
|
||||
} else {
|
||||
fmt.Println("✓ adb is installed")
|
||||
}
|
||||
|
||||
// Check emulator
|
||||
if !checkCommand("emulator", "-list-avds") {
|
||||
if androidHome != "" {
|
||||
emulatorPath := filepath.Join(androidHome, "emulator")
|
||||
errors = append(errors, fmt.Sprintf("emulator not found. Add %s to PATH", emulatorPath))
|
||||
} else {
|
||||
errors = append(errors, "emulator not found. Install Android Emulator via SDK Manager")
|
||||
}
|
||||
} else {
|
||||
fmt.Println("✓ Android Emulator is installed")
|
||||
}
|
||||
|
||||
// Check NDK
|
||||
ndkHome := os.Getenv("ANDROID_NDK_HOME")
|
||||
if ndkHome == "" && androidHome != "" {
|
||||
// Look for NDK in default location
|
||||
ndkDir := filepath.Join(androidHome, "ndk")
|
||||
if entries, err := os.ReadDir(ndkDir); err == nil {
|
||||
for _, entry := range entries {
|
||||
if entry.IsDir() {
|
||||
ndkHome = filepath.Join(ndkDir, entry.Name())
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ndkHome == "" {
|
||||
errors = append(errors, "Android NDK not found. Install NDK via Android Studio > SDK Manager > SDK Tools > NDK (Side by side)")
|
||||
} else {
|
||||
fmt.Printf("✓ Android NDK: %s\n", ndkHome)
|
||||
}
|
||||
|
||||
// Check Java
|
||||
if !checkCommand("java", "-version") {
|
||||
errors = append(errors, "Java not found. Install JDK 11+ (OpenJDK recommended)")
|
||||
} else {
|
||||
fmt.Println("✓ Java is installed")
|
||||
}
|
||||
|
||||
// Check for AVD (Android Virtual Device)
|
||||
if checkCommand("emulator", "-list-avds") {
|
||||
cmd := exec.Command("emulator", "-list-avds")
|
||||
output, err := cmd.Output()
|
||||
if err == nil && len(strings.TrimSpace(string(output))) > 0 {
|
||||
avds := strings.Split(strings.TrimSpace(string(output)), "\n")
|
||||
fmt.Printf("✓ Found %d Android Virtual Device(s)\n", len(avds))
|
||||
} else {
|
||||
fmt.Println("⚠ No Android Virtual Devices found. Create one via Android Studio > Tools > Device Manager")
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println()
|
||||
|
||||
if len(errors) > 0 {
|
||||
fmt.Println("❌ Missing dependencies:")
|
||||
for _, err := range errors {
|
||||
fmt.Printf(" - %s\n", err)
|
||||
}
|
||||
fmt.Println()
|
||||
fmt.Println("Setup instructions:")
|
||||
fmt.Println("1. Install Android Studio: https://developer.android.com/studio")
|
||||
fmt.Println("2. Open SDK Manager and install:")
|
||||
fmt.Println(" - Android SDK Platform (API 34)")
|
||||
fmt.Println(" - Android SDK Build-Tools")
|
||||
fmt.Println(" - Android SDK Platform-Tools")
|
||||
fmt.Println(" - Android Emulator")
|
||||
fmt.Println(" - NDK (Side by side)")
|
||||
fmt.Println("3. Set environment variables:")
|
||||
if runtime.GOOS == "darwin" {
|
||||
fmt.Println(" export ANDROID_HOME=$HOME/Library/Android/sdk")
|
||||
} else {
|
||||
fmt.Println(" export ANDROID_HOME=$HOME/Android/Sdk")
|
||||
}
|
||||
fmt.Println(" export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator")
|
||||
fmt.Println("4. Create an AVD via Android Studio > Tools > Device Manager")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
fmt.Println("✓ All Android development dependencies are installed!")
|
||||
}
|
||||
|
||||
func checkCommand(name string, args ...string) bool {
|
||||
cmd := exec.Command(name, args...)
|
||||
cmd.Stdout = nil
|
||||
cmd.Stderr = nil
|
||||
return cmd.Run() == nil
|
||||
}
|
||||
18
v3/examples/android/build/android/settings.gradle
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
pluginManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "WailsApp"
|
||||
include ':app'
|
||||
BIN
v3/examples/android/build/appicon.png
Normal file
|
After Width: | Height: | Size: 130 KiB |
75
v3/examples/android/build/config.yml
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
# This file contains the configuration for this project.
|
||||
# When you update `info` or `fileAssociations`, run `wails3 task common:update:build-assets` to update the assets.
|
||||
# Note that this will overwrite any changes you have made to the assets.
|
||||
version: '3'
|
||||
|
||||
# This information is used to generate the build assets.
|
||||
info:
|
||||
companyName: "My Company" # The name of the company
|
||||
productName: "My Product" # The name of the application
|
||||
productIdentifier: "com.mycompany.myproduct" # The unique product identifier
|
||||
description: "A program that does X" # The application description
|
||||
copyright: "(c) 2025, My Company" # Copyright text
|
||||
comments: "Some Product Comments" # Comments
|
||||
version: "0.0.1" # The application version
|
||||
|
||||
# Android build configuration (uncomment to customise Android project generation)
|
||||
# Note: Keys under `android` OVERRIDE values under `info` when set.
|
||||
# android:
|
||||
# # The Android application ID used in the generated project (applicationId)
|
||||
# applicationId: "com.mycompany.myproduct"
|
||||
# # The display name shown under the app icon
|
||||
# displayName: "My Product"
|
||||
# # The app version code (integer, must increment for each release)
|
||||
# versionCode: 1
|
||||
# # The app version name (displayed to users)
|
||||
# versionName: "0.0.1"
|
||||
# # Minimum SDK version (API level)
|
||||
# minSdkVersion: 21
|
||||
# # Target SDK version (API level)
|
||||
# targetSdkVersion: 34
|
||||
# # The company/organisation name for templates and project settings
|
||||
# company: "My Company"
|
||||
|
||||
# Dev mode configuration
|
||||
dev_mode:
|
||||
root_path: .
|
||||
log_level: warn
|
||||
debounce: 1000
|
||||
ignore:
|
||||
dir:
|
||||
- .git
|
||||
- node_modules
|
||||
- frontend
|
||||
- bin
|
||||
file:
|
||||
- .DS_Store
|
||||
- .gitignore
|
||||
- .gitkeep
|
||||
watched_extension:
|
||||
- "*.go"
|
||||
git_ignore: true
|
||||
executes:
|
||||
- cmd: wails3 task common:install:frontend:deps
|
||||
type: once
|
||||
- cmd: wails3 task common:dev:frontend
|
||||
type: background
|
||||
- cmd: go mod tidy
|
||||
type: blocking
|
||||
- cmd: wails3 task build
|
||||
type: blocking
|
||||
- cmd: wails3 task run
|
||||
type: primary
|
||||
|
||||
# File Associations
|
||||
# More information at: https://v3.wails.io/noit/done/yet
|
||||
fileAssociations:
|
||||
# - ext: wails
|
||||
# name: Wails
|
||||
# description: Wails Application File
|
||||
# iconName: wailsFileIcon
|
||||
# role: Editor
|
||||
|
||||
# Other data
|
||||
other:
|
||||
- name: My Other Data
|
||||
32
v3/examples/android/build/darwin/Info.dev.plist
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>My Product</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>ios</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.wails.ios</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.1.0</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>This is a comment</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.1.0</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>icons</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.15.0</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<string>true</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>© now, My Company</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsLocalNetworking</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
27
v3/examples/android/build/darwin/Info.plist
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>My Product</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>ios</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.wails.ios</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.1.0</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>This is a comment</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.1.0</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>icons</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.15.0</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<string>true</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>© now, My Company</string>
|
||||
</dict>
|
||||
</plist>
|
||||
81
v3/examples/android/build/darwin/Taskfile.yml
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
version: '3'
|
||||
|
||||
includes:
|
||||
common: ../Taskfile.yml
|
||||
|
||||
tasks:
|
||||
build:
|
||||
summary: Creates a production build of the application
|
||||
deps:
|
||||
- task: common:go:mod:tidy
|
||||
- task: common:build:frontend
|
||||
vars:
|
||||
BUILD_FLAGS:
|
||||
ref: .BUILD_FLAGS
|
||||
PRODUCTION:
|
||||
ref: .PRODUCTION
|
||||
- task: common:generate:icons
|
||||
cmds:
|
||||
- go build {{.BUILD_FLAGS}} -o {{.OUTPUT}}
|
||||
vars:
|
||||
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production -trimpath -buildvcs=false -ldflags="-w -s"{{else}}-buildvcs=false -gcflags=all="-l"{{end}}'
|
||||
DEFAULT_OUTPUT: '{{.BIN_DIR}}/{{.APP_NAME}}'
|
||||
OUTPUT: '{{ .OUTPUT | default .DEFAULT_OUTPUT }}'
|
||||
env:
|
||||
GOOS: darwin
|
||||
CGO_ENABLED: 1
|
||||
GOARCH: '{{.ARCH | default ARCH}}'
|
||||
CGO_CFLAGS: "-mmacosx-version-min=10.15"
|
||||
CGO_LDFLAGS: "-mmacosx-version-min=10.15"
|
||||
MACOSX_DEPLOYMENT_TARGET: "10.15"
|
||||
PRODUCTION: '{{.PRODUCTION | default "false"}}'
|
||||
|
||||
build:universal:
|
||||
summary: Builds darwin universal binary (arm64 + amd64)
|
||||
deps:
|
||||
- task: build
|
||||
vars:
|
||||
ARCH: amd64
|
||||
OUTPUT: "{{.BIN_DIR}}/{{.APP_NAME}}-amd64"
|
||||
- task: build
|
||||
vars:
|
||||
ARCH: arm64
|
||||
OUTPUT: "{{.BIN_DIR}}/{{.APP_NAME}}-arm64"
|
||||
cmds:
|
||||
- lipo -create -output "{{.BIN_DIR}}/{{.APP_NAME}}" "{{.BIN_DIR}}/{{.APP_NAME}}-amd64" "{{.BIN_DIR}}/{{.APP_NAME}}-arm64"
|
||||
- rm "{{.BIN_DIR}}/{{.APP_NAME}}-amd64" "{{.BIN_DIR}}/{{.APP_NAME}}-arm64"
|
||||
|
||||
package:
|
||||
summary: Packages a production build of the application into a `.app` bundle
|
||||
deps:
|
||||
- task: build
|
||||
vars:
|
||||
PRODUCTION: "true"
|
||||
cmds:
|
||||
- task: create:app:bundle
|
||||
|
||||
package:universal:
|
||||
summary: Packages darwin universal binary (arm64 + amd64)
|
||||
deps:
|
||||
- task: build:universal
|
||||
cmds:
|
||||
- task: create:app:bundle
|
||||
|
||||
|
||||
create:app:bundle:
|
||||
summary: Creates an `.app` bundle
|
||||
cmds:
|
||||
- mkdir -p {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/{MacOS,Resources}
|
||||
- cp build/darwin/icons.icns {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/Resources
|
||||
- cp {{.BIN_DIR}}/{{.APP_NAME}} {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/MacOS
|
||||
- cp build/darwin/Info.plist {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents
|
||||
- codesign --force --deep --sign - {{.BIN_DIR}}/{{.APP_NAME}}.app
|
||||
|
||||
run:
|
||||
cmds:
|
||||
- mkdir -p {{.BIN_DIR}}/{{.APP_NAME}}.dev.app/Contents/{MacOS,Resources}
|
||||
- cp build/darwin/icons.icns {{.BIN_DIR}}/{{.APP_NAME}}.dev.app/Contents/Resources
|
||||
- cp {{.BIN_DIR}}/{{.APP_NAME}} {{.BIN_DIR}}/{{.APP_NAME}}.dev.app/Contents/MacOS
|
||||
- cp build/darwin/Info.dev.plist {{.BIN_DIR}}/{{.APP_NAME}}.dev.app/Contents/Info.plist
|
||||
- codesign --force --deep --sign - {{.BIN_DIR}}/{{.APP_NAME}}.dev.app
|
||||
- '{{.BIN_DIR}}/{{.APP_NAME}}.dev.app/Contents/MacOS/{{.APP_NAME}}'
|
||||
BIN
v3/examples/android/build/darwin/icons.icns
Normal file
119
v3/examples/android/build/linux/Taskfile.yml
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
version: '3'
|
||||
|
||||
includes:
|
||||
common: ../Taskfile.yml
|
||||
|
||||
tasks:
|
||||
build:
|
||||
summary: Builds the application for Linux
|
||||
deps:
|
||||
- task: common:go:mod:tidy
|
||||
- task: common:build:frontend
|
||||
vars:
|
||||
BUILD_FLAGS:
|
||||
ref: .BUILD_FLAGS
|
||||
PRODUCTION:
|
||||
ref: .PRODUCTION
|
||||
- task: common:generate:icons
|
||||
cmds:
|
||||
- go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/{{.APP_NAME}}
|
||||
vars:
|
||||
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production -trimpath -buildvcs=false -ldflags="-w -s"{{else}}-buildvcs=false -gcflags=all="-l"{{end}}'
|
||||
env:
|
||||
GOOS: linux
|
||||
CGO_ENABLED: 1
|
||||
GOARCH: '{{.ARCH | default ARCH}}'
|
||||
PRODUCTION: '{{.PRODUCTION | default "false"}}'
|
||||
|
||||
package:
|
||||
summary: Packages a production build of the application for Linux
|
||||
deps:
|
||||
- task: build
|
||||
vars:
|
||||
PRODUCTION: "true"
|
||||
cmds:
|
||||
- task: create:appimage
|
||||
- task: create:deb
|
||||
- task: create:rpm
|
||||
- task: create:aur
|
||||
|
||||
create:appimage:
|
||||
summary: Creates an AppImage
|
||||
dir: build/linux/appimage
|
||||
deps:
|
||||
- task: build
|
||||
vars:
|
||||
PRODUCTION: "true"
|
||||
- task: generate:dotdesktop
|
||||
cmds:
|
||||
- cp {{.APP_BINARY}} {{.APP_NAME}}
|
||||
- cp ../../appicon.png appicon.png
|
||||
- wails3 generate appimage -binary {{.APP_NAME}} -icon {{.ICON}} -desktopfile {{.DESKTOP_FILE}} -outputdir {{.OUTPUT_DIR}} -builddir {{.ROOT_DIR}}/build/linux/appimage/build
|
||||
vars:
|
||||
APP_NAME: '{{.APP_NAME}}'
|
||||
APP_BINARY: '../../../bin/{{.APP_NAME}}'
|
||||
ICON: '../../appicon.png'
|
||||
DESKTOP_FILE: '../{{.APP_NAME}}.desktop'
|
||||
OUTPUT_DIR: '../../../bin'
|
||||
|
||||
create:deb:
|
||||
summary: Creates a deb package
|
||||
deps:
|
||||
- task: build
|
||||
vars:
|
||||
PRODUCTION: "true"
|
||||
cmds:
|
||||
- task: generate:dotdesktop
|
||||
- task: generate:deb
|
||||
|
||||
create:rpm:
|
||||
summary: Creates a rpm package
|
||||
deps:
|
||||
- task: build
|
||||
vars:
|
||||
PRODUCTION: "true"
|
||||
cmds:
|
||||
- task: generate:dotdesktop
|
||||
- task: generate:rpm
|
||||
|
||||
create:aur:
|
||||
summary: Creates a arch linux packager package
|
||||
deps:
|
||||
- task: build
|
||||
vars:
|
||||
PRODUCTION: "true"
|
||||
cmds:
|
||||
- task: generate:dotdesktop
|
||||
- task: generate:aur
|
||||
|
||||
generate:deb:
|
||||
summary: Creates a deb package
|
||||
cmds:
|
||||
- wails3 tool package -name {{.APP_NAME}} -format deb -config ./build/linux/nfpm/nfpm.yaml -out {{.ROOT_DIR}}/bin
|
||||
|
||||
generate:rpm:
|
||||
summary: Creates a rpm package
|
||||
cmds:
|
||||
- wails3 tool package -name {{.APP_NAME}} -format rpm -config ./build/linux/nfpm/nfpm.yaml -out {{.ROOT_DIR}}/bin
|
||||
|
||||
generate:aur:
|
||||
summary: Creates a arch linux packager package
|
||||
cmds:
|
||||
- wails3 tool package -name {{.APP_NAME}} -format archlinux -config ./build/linux/nfpm/nfpm.yaml -out {{.ROOT_DIR}}/bin
|
||||
|
||||
generate:dotdesktop:
|
||||
summary: Generates a `.desktop` file
|
||||
dir: build
|
||||
cmds:
|
||||
- mkdir -p {{.ROOT_DIR}}/build/linux/appimage
|
||||
- wails3 generate .desktop -name "{{.APP_NAME}}" -exec "{{.EXEC}}" -icon "{{.ICON}}" -outputfile {{.ROOT_DIR}}/build/linux/{{.APP_NAME}}.desktop -categories "{{.CATEGORIES}}"
|
||||
vars:
|
||||
APP_NAME: '{{.APP_NAME}}'
|
||||
EXEC: '{{.APP_NAME}}'
|
||||
ICON: '{{.APP_NAME}}'
|
||||
CATEGORIES: 'Development;'
|
||||
OUTPUTFILE: '{{.ROOT_DIR}}/build/linux/{{.APP_NAME}}.desktop'
|
||||
|
||||
run:
|
||||
cmds:
|
||||
- '{{.BIN_DIR}}/{{.APP_NAME}}'
|
||||
34
v3/examples/android/build/linux/appimage/build.sh
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2018-Present Lea Anthony
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# Fail script on any error
|
||||
set -euxo pipefail
|
||||
|
||||
# Define variables
|
||||
APP_DIR="${APP_NAME}.AppDir"
|
||||
|
||||
# Create AppDir structure
|
||||
mkdir -p "${APP_DIR}/usr/bin"
|
||||
cp -r "${APP_BINARY}" "${APP_DIR}/usr/bin/"
|
||||
cp "${ICON_PATH}" "${APP_DIR}/"
|
||||
cp "${DESKTOP_FILE}" "${APP_DIR}/"
|
||||
|
||||
if [[ $(uname -m) == *x86_64* ]]; then
|
||||
# Download linuxdeploy and make it executable
|
||||
wget -q -4 -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||
chmod +x linuxdeploy-x86_64.AppImage
|
||||
|
||||
# Run linuxdeploy to bundle the application
|
||||
./linuxdeploy-x86_64.AppImage --appdir "${APP_DIR}" --output appimage
|
||||
else
|
||||
# Download linuxdeploy and make it executable (arm64)
|
||||
wget -q -4 -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-aarch64.AppImage
|
||||
chmod +x linuxdeploy-aarch64.AppImage
|
||||
|
||||
# Run linuxdeploy to bundle the application (arm64)
|
||||
./linuxdeploy-aarch64.AppImage --appdir "${APP_DIR}" --output appimage
|
||||
fi
|
||||
|
||||
# Rename the generated AppImage
|
||||
mv "${APP_NAME}*.AppImage" "${APP_NAME}.AppImage"
|
||||
11
v3/examples/android/build/linux/desktop
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Name=My Product
|
||||
Comment=My Product Description
|
||||
# The Exec line includes %u to pass the URL to the application
|
||||
Exec=/usr/local/bin/ios %u
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=ios
|
||||
Categories=Utility;
|
||||
StartupWMClass=ios
|
||||
67
v3/examples/android/build/linux/nfpm/nfpm.yaml
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
# Feel free to remove those if you don't want/need to use them.
|
||||
# Make sure to check the documentation at https://nfpm.goreleaser.com
|
||||
#
|
||||
# The lines below are called `modelines`. See `:help modeline`
|
||||
|
||||
name: "ios"
|
||||
arch: ${GOARCH}
|
||||
platform: "linux"
|
||||
version: "0.1.0"
|
||||
section: "default"
|
||||
priority: "extra"
|
||||
maintainer: ${GIT_COMMITTER_NAME} <${GIT_COMMITTER_EMAIL}>
|
||||
description: "My Product Description"
|
||||
vendor: "My Company"
|
||||
homepage: "https://wails.io"
|
||||
license: "MIT"
|
||||
release: "1"
|
||||
|
||||
contents:
|
||||
- src: "./bin/ios"
|
||||
dst: "/usr/local/bin/ios"
|
||||
- src: "./build/appicon.png"
|
||||
dst: "/usr/share/icons/hicolor/128x128/apps/ios.png"
|
||||
- src: "./build/linux/ios.desktop"
|
||||
dst: "/usr/share/applications/ios.desktop"
|
||||
|
||||
# Default dependencies for Debian 12/Ubuntu 22.04+ with WebKit 4.1
|
||||
depends:
|
||||
- libgtk-3-0
|
||||
- libwebkit2gtk-4.1-0
|
||||
|
||||
# Distribution-specific overrides for different package formats and WebKit versions
|
||||
overrides:
|
||||
# RPM packages for RHEL/CentOS/AlmaLinux/Rocky Linux (WebKit 4.0)
|
||||
rpm:
|
||||
depends:
|
||||
- gtk3
|
||||
- webkit2gtk4.1
|
||||
|
||||
# Arch Linux packages (WebKit 4.1)
|
||||
archlinux:
|
||||
depends:
|
||||
- gtk3
|
||||
- webkit2gtk-4.1
|
||||
|
||||
# scripts section to ensure desktop database is updated after install
|
||||
scripts:
|
||||
postinstall: "./build/linux/nfpm/scripts/postinstall.sh"
|
||||
# You can also add preremove, postremove if needed
|
||||
# preremove: "./build/linux/nfpm/scripts/preremove.sh"
|
||||
# postremove: "./build/linux/nfpm/scripts/postremove.sh"
|
||||
|
||||
# replaces:
|
||||
# - foobar
|
||||
# provides:
|
||||
# - bar
|
||||
# depends:
|
||||
# - gtk3
|
||||
# - libwebkit2gtk
|
||||
# recommends:
|
||||
# - whatever
|
||||
# suggests:
|
||||
# - something-else
|
||||
# conflicts:
|
||||
# - not-foo
|
||||
# - not-bar
|
||||
# changelog: "changelog.yaml"
|
||||
21
v3/examples/android/build/linux/nfpm/scripts/postinstall.sh
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Update desktop database for .desktop file changes
|
||||
# This makes the application appear in application menus and registers its capabilities.
|
||||
if command -v update-desktop-database >/dev/null 2>&1; then
|
||||
echo "Updating desktop database..."
|
||||
update-desktop-database -q /usr/share/applications
|
||||
else
|
||||
echo "Warning: update-desktop-database command not found. Desktop file may not be immediately recognized." >&2
|
||||
fi
|
||||
|
||||
# Update MIME database for custom URL schemes (x-scheme-handler)
|
||||
# This ensures the system knows how to handle your custom protocols.
|
||||
if command -v update-mime-database >/dev/null 2>&1; then
|
||||
echo "Updating MIME database..."
|
||||
update-mime-database -n /usr/share/mime
|
||||
else
|
||||
echo "Warning: update-mime-database command not found. Custom URL schemes may not be immediately recognized." >&2
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
@ -0,0 +1 @@
|
|||
#!/bin/bash
|
||||
|
|
@ -0,0 +1 @@
|
|||
#!/bin/bash
|
||||
|
|
@ -0,0 +1 @@
|
|||
#!/bin/bash
|
||||
98
v3/examples/android/build/windows/Taskfile.yml
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
version: '3'
|
||||
|
||||
includes:
|
||||
common: ../Taskfile.yml
|
||||
|
||||
tasks:
|
||||
build:
|
||||
summary: Builds the application for Windows
|
||||
deps:
|
||||
- task: common:go:mod:tidy
|
||||
- task: common:build:frontend
|
||||
vars:
|
||||
BUILD_FLAGS:
|
||||
ref: .BUILD_FLAGS
|
||||
PRODUCTION:
|
||||
ref: .PRODUCTION
|
||||
- task: common:generate:icons
|
||||
cmds:
|
||||
- task: generate:syso
|
||||
- go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/{{.APP_NAME}}.exe
|
||||
- cmd: powershell Remove-item *.syso
|
||||
platforms: [windows]
|
||||
- cmd: rm -f *.syso
|
||||
platforms: [linux, darwin]
|
||||
vars:
|
||||
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production -trimpath -buildvcs=false -ldflags="-w -s -H windowsgui"{{else}}-buildvcs=false -gcflags=all="-l"{{end}}'
|
||||
env:
|
||||
GOOS: windows
|
||||
CGO_ENABLED: 0
|
||||
GOARCH: '{{.ARCH | default ARCH}}'
|
||||
PRODUCTION: '{{.PRODUCTION | default "false"}}'
|
||||
|
||||
package:
|
||||
summary: Packages a production build of the application
|
||||
cmds:
|
||||
- |-
|
||||
if [ "{{.FORMAT | default "nsis"}}" = "msix" ]; then
|
||||
task: create:msix:package
|
||||
else
|
||||
task: create:nsis:installer
|
||||
fi
|
||||
vars:
|
||||
FORMAT: '{{.FORMAT | default "nsis"}}'
|
||||
|
||||
generate:syso:
|
||||
summary: Generates Windows `.syso` file
|
||||
dir: build
|
||||
cmds:
|
||||
- wails3 generate syso -arch {{.ARCH}} -icon windows/icon.ico -manifest windows/wails.exe.manifest -info windows/info.json -out ../wails_windows_{{.ARCH}}.syso
|
||||
vars:
|
||||
ARCH: '{{.ARCH | default ARCH}}'
|
||||
|
||||
create:nsis:installer:
|
||||
summary: Creates an NSIS installer
|
||||
dir: build/windows/nsis
|
||||
deps:
|
||||
- task: build
|
||||
vars:
|
||||
PRODUCTION: "true"
|
||||
cmds:
|
||||
# Create the Microsoft WebView2 bootstrapper if it doesn't exist
|
||||
- wails3 generate webview2bootstrapper -dir "{{.ROOT_DIR}}/build/windows/nsis"
|
||||
- makensis -DARG_WAILS_{{.ARG_FLAG}}_BINARY="{{.ROOT_DIR}}/{{.BIN_DIR}}/{{.APP_NAME}}.exe" project.nsi
|
||||
vars:
|
||||
ARCH: '{{.ARCH | default ARCH}}'
|
||||
ARG_FLAG: '{{if eq .ARCH "amd64"}}AMD64{{else}}ARM64{{end}}'
|
||||
|
||||
create:msix:package:
|
||||
summary: Creates an MSIX package
|
||||
deps:
|
||||
- task: build
|
||||
vars:
|
||||
PRODUCTION: "true"
|
||||
cmds:
|
||||
- |-
|
||||
wails3 tool msix \
|
||||
--config "{{.ROOT_DIR}}/wails.json" \
|
||||
--name "{{.APP_NAME}}" \
|
||||
--executable "{{.ROOT_DIR}}/{{.BIN_DIR}}/{{.APP_NAME}}.exe" \
|
||||
--arch "{{.ARCH}}" \
|
||||
--out "{{.ROOT_DIR}}/{{.BIN_DIR}}/{{.APP_NAME}}-{{.ARCH}}.msix" \
|
||||
{{if .CERT_PATH}}--cert "{{.CERT_PATH}}"{{end}} \
|
||||
{{if .PUBLISHER}}--publisher "{{.PUBLISHER}}"{{end}} \
|
||||
{{if .USE_MSIX_TOOL}}--use-msix-tool{{else}}--use-makeappx{{end}}
|
||||
vars:
|
||||
ARCH: '{{.ARCH | default ARCH}}'
|
||||
CERT_PATH: '{{.CERT_PATH | default ""}}'
|
||||
PUBLISHER: '{{.PUBLISHER | default ""}}'
|
||||
USE_MSIX_TOOL: '{{.USE_MSIX_TOOL | default "false"}}'
|
||||
|
||||
install:msix:tools:
|
||||
summary: Installs tools required for MSIX packaging
|
||||
cmds:
|
||||
- wails3 tool msix-install-tools
|
||||
|
||||
run:
|
||||
cmds:
|
||||
- '{{.BIN_DIR}}/{{.APP_NAME}}.exe'
|
||||
BIN
v3/examples/android/build/windows/icon.ico
Normal file
|
After Width: | Height: | Size: 21 KiB |
15
v3/examples/android/build/windows/info.json
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"fixed": {
|
||||
"file_version": "0.1.0"
|
||||
},
|
||||
"info": {
|
||||
"0000": {
|
||||
"ProductVersion": "0.1.0",
|
||||
"CompanyName": "My Company",
|
||||
"FileDescription": "My Product Description",
|
||||
"LegalCopyright": "© now, My Company",
|
||||
"ProductName": "My Product",
|
||||
"Comments": "This is a comment"
|
||||
}
|
||||
}
|
||||
}
|
||||
52
v3/examples/android/build/windows/msix/app_manifest.xml
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10">
|
||||
|
||||
<Identity
|
||||
Name="com.wails.ios"
|
||||
Publisher="CN=My Company"
|
||||
Version="0.1.0.0"
|
||||
ProcessorArchitecture="x64" />
|
||||
|
||||
<Properties>
|
||||
<DisplayName>My Product</DisplayName>
|
||||
<PublisherDisplayName>My Company</PublisherDisplayName>
|
||||
<Description>My Product Description</Description>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="en-us" />
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
<Application Id="com.wails.ios" Executable="ios" EntryPoint="Windows.FullTrustApplication">
|
||||
<uap:VisualElements
|
||||
DisplayName="My Product"
|
||||
Description="My Product Description"
|
||||
BackgroundColor="transparent"
|
||||
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||
Square44x44Logo="Assets\Square44x44Logo.png">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" />
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</uap:VisualElements>
|
||||
|
||||
<Extensions>
|
||||
<desktop:Extension Category="windows.fullTrustProcess" Executable="ios" />
|
||||
|
||||
</Extensions>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
<Capabilities>
|
||||
<rescap:Capability Name="runFullTrust" />
|
||||
|
||||
</Capabilities>
|
||||
</Package>
|
||||
54
v3/examples/android/build/windows/msix/template.xml
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MsixPackagingToolTemplate
|
||||
xmlns="http://schemas.microsoft.com/msix/packaging/msixpackagingtool/template/2022">
|
||||
<Settings
|
||||
AllowTelemetry="false"
|
||||
ApplyACLsToPackageFiles="true"
|
||||
GenerateCommandLineFile="true"
|
||||
AllowPromptForPassword="false">
|
||||
</Settings>
|
||||
<Installer
|
||||
Path="ios"
|
||||
Arguments=""
|
||||
InstallLocation="C:\Program Files\My Company\My Product">
|
||||
</Installer>
|
||||
<PackageInformation
|
||||
PackageName="My Product"
|
||||
PackageDisplayName="My Product"
|
||||
PublisherName="CN=My Company"
|
||||
PublisherDisplayName="My Company"
|
||||
Version="0.1.0.0"
|
||||
PackageDescription="My Product Description">
|
||||
<Capabilities>
|
||||
<Capability Name="runFullTrust" />
|
||||
|
||||
</Capabilities>
|
||||
<Applications>
|
||||
<Application
|
||||
Id="com.wails.ios"
|
||||
Description="My Product Description"
|
||||
DisplayName="My Product"
|
||||
ExecutableName="ios"
|
||||
EntryPoint="Windows.FullTrustApplication">
|
||||
|
||||
</Application>
|
||||
</Applications>
|
||||
<Resources>
|
||||
<Resource Language="en-us" />
|
||||
</Resources>
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
|
||||
</Dependencies>
|
||||
<Properties>
|
||||
<Framework>false</Framework>
|
||||
<DisplayName>My Product</DisplayName>
|
||||
<PublisherDisplayName>My Company</PublisherDisplayName>
|
||||
<Description>My Product Description</Description>
|
||||
<Logo>Assets\AppIcon.png</Logo>
|
||||
</Properties>
|
||||
</PackageInformation>
|
||||
<SaveLocation PackagePath="ios.msix" />
|
||||
<PackageIntegrity>
|
||||
<CertificatePath></CertificatePath>
|
||||
</PackageIntegrity>
|
||||
</MsixPackagingToolTemplate>
|
||||
112
v3/examples/android/build/windows/nsis/project.nsi
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
Unicode true
|
||||
|
||||
####
|
||||
## Please note: Template replacements don't work in this file. They are provided with default defines like
|
||||
## mentioned underneath.
|
||||
## If the keyword is not defined, "wails_tools.nsh" will populate them.
|
||||
## If they are defined here, "wails_tools.nsh" will not touch them. This allows you to use this project.nsi manually
|
||||
## from outside of Wails for debugging and development of the installer.
|
||||
##
|
||||
## For development first make a wails nsis build to populate the "wails_tools.nsh":
|
||||
## > wails build --target windows/amd64 --nsis
|
||||
## Then you can call makensis on this file with specifying the path to your binary:
|
||||
## For a AMD64 only installer:
|
||||
## > makensis -DARG_WAILS_AMD64_BINARY=..\..\bin\app.exe
|
||||
## For a ARM64 only installer:
|
||||
## > makensis -DARG_WAILS_ARM64_BINARY=..\..\bin\app.exe
|
||||
## For a installer with both architectures:
|
||||
## > makensis -DARG_WAILS_AMD64_BINARY=..\..\bin\app-amd64.exe -DARG_WAILS_ARM64_BINARY=..\..\bin\app-arm64.exe
|
||||
####
|
||||
## The following information is taken from the wails_tools.nsh file, but they can be overwritten here.
|
||||
####
|
||||
## !define INFO_PROJECTNAME "my-project" # Default "ios"
|
||||
## !define INFO_COMPANYNAME "My Company" # Default "My Company"
|
||||
## !define INFO_PRODUCTNAME "My Product Name" # Default "My Product"
|
||||
## !define INFO_PRODUCTVERSION "1.0.0" # Default "0.1.0"
|
||||
## !define INFO_COPYRIGHT "(c) Now, My Company" # Default "© now, My Company"
|
||||
###
|
||||
## !define PRODUCT_EXECUTABLE "Application.exe" # Default "${INFO_PROJECTNAME}.exe"
|
||||
## !define UNINST_KEY_NAME "UninstKeyInRegistry" # Default "${INFO_COMPANYNAME}${INFO_PRODUCTNAME}"
|
||||
####
|
||||
## !define REQUEST_EXECUTION_LEVEL "admin" # Default "admin" see also https://nsis.sourceforge.io/Docs/Chapter4.html
|
||||
####
|
||||
## Include the wails tools
|
||||
####
|
||||
!include "wails_tools.nsh"
|
||||
|
||||
# The version information for this two must consist of 4 parts
|
||||
VIProductVersion "${INFO_PRODUCTVERSION}.0"
|
||||
VIFileVersion "${INFO_PRODUCTVERSION}.0"
|
||||
|
||||
VIAddVersionKey "CompanyName" "${INFO_COMPANYNAME}"
|
||||
VIAddVersionKey "FileDescription" "${INFO_PRODUCTNAME} Installer"
|
||||
VIAddVersionKey "ProductVersion" "${INFO_PRODUCTVERSION}"
|
||||
VIAddVersionKey "FileVersion" "${INFO_PRODUCTVERSION}"
|
||||
VIAddVersionKey "LegalCopyright" "${INFO_COPYRIGHT}"
|
||||
VIAddVersionKey "ProductName" "${INFO_PRODUCTNAME}"
|
||||
|
||||
# Enable HiDPI support. https://nsis.sourceforge.io/Reference/ManifestDPIAware
|
||||
ManifestDPIAware true
|
||||
|
||||
!include "MUI.nsh"
|
||||
|
||||
!define MUI_ICON "..\icon.ico"
|
||||
!define MUI_UNICON "..\icon.ico"
|
||||
# !define MUI_WELCOMEFINISHPAGE_BITMAP "resources\leftimage.bmp" #Include this to add a bitmap on the left side of the Welcome Page. Must be a size of 164x314
|
||||
!define MUI_FINISHPAGE_NOAUTOCLOSE # Wait on the INSTFILES page so the user can take a look into the details of the installation steps
|
||||
!define MUI_ABORTWARNING # This will warn the user if they exit from the installer.
|
||||
|
||||
!insertmacro MUI_PAGE_WELCOME # Welcome to the installer page.
|
||||
# !insertmacro MUI_PAGE_LICENSE "resources\eula.txt" # Adds a EULA page to the installer
|
||||
!insertmacro MUI_PAGE_DIRECTORY # In which folder install page.
|
||||
!insertmacro MUI_PAGE_INSTFILES # Installing page.
|
||||
!insertmacro MUI_PAGE_FINISH # Finished installation page.
|
||||
|
||||
!insertmacro MUI_UNPAGE_INSTFILES # Uninstalling page
|
||||
|
||||
!insertmacro MUI_LANGUAGE "English" # Set the Language of the installer
|
||||
|
||||
## The following two statements can be used to sign the installer and the uninstaller. The path to the binaries are provided in %1
|
||||
#!uninstfinalize 'signtool --file "%1"'
|
||||
#!finalize 'signtool --file "%1"'
|
||||
|
||||
Name "${INFO_PRODUCTNAME}"
|
||||
OutFile "..\..\..\bin\${INFO_PROJECTNAME}-${ARCH}-installer.exe" # Name of the installer's file.
|
||||
InstallDir "$PROGRAMFILES64\${INFO_COMPANYNAME}\${INFO_PRODUCTNAME}" # Default installing folder ($PROGRAMFILES is Program Files folder).
|
||||
ShowInstDetails show # This will always show the installation details.
|
||||
|
||||
Function .onInit
|
||||
!insertmacro wails.checkArchitecture
|
||||
FunctionEnd
|
||||
|
||||
Section
|
||||
!insertmacro wails.setShellContext
|
||||
|
||||
!insertmacro wails.webview2runtime
|
||||
|
||||
SetOutPath $INSTDIR
|
||||
|
||||
!insertmacro wails.files
|
||||
|
||||
CreateShortcut "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
|
||||
CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
|
||||
|
||||
!insertmacro wails.associateFiles
|
||||
|
||||
!insertmacro wails.writeUninstaller
|
||||
SectionEnd
|
||||
|
||||
Section "uninstall"
|
||||
!insertmacro wails.setShellContext
|
||||
|
||||
RMDir /r "$AppData\${PRODUCT_EXECUTABLE}" # Remove the WebView2 DataPath
|
||||
|
||||
RMDir /r $INSTDIR
|
||||
|
||||
Delete "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk"
|
||||
Delete "$DESKTOP\${INFO_PRODUCTNAME}.lnk"
|
||||
|
||||
!insertmacro wails.unassociateFiles
|
||||
|
||||
!insertmacro wails.deleteUninstaller
|
||||
SectionEnd
|
||||
212
v3/examples/android/build/windows/nsis/wails_tools.nsh
Normal file
|
|
@ -0,0 +1,212 @@
|
|||
# DO NOT EDIT - Generated automatically by `wails build`
|
||||
|
||||
!include "x64.nsh"
|
||||
!include "WinVer.nsh"
|
||||
!include "FileFunc.nsh"
|
||||
|
||||
!ifndef INFO_PROJECTNAME
|
||||
!define INFO_PROJECTNAME "ios"
|
||||
!endif
|
||||
!ifndef INFO_COMPANYNAME
|
||||
!define INFO_COMPANYNAME "My Company"
|
||||
!endif
|
||||
!ifndef INFO_PRODUCTNAME
|
||||
!define INFO_PRODUCTNAME "My Product"
|
||||
!endif
|
||||
!ifndef INFO_PRODUCTVERSION
|
||||
!define INFO_PRODUCTVERSION "0.1.0"
|
||||
!endif
|
||||
!ifndef INFO_COPYRIGHT
|
||||
!define INFO_COPYRIGHT "© now, My Company"
|
||||
!endif
|
||||
!ifndef PRODUCT_EXECUTABLE
|
||||
!define PRODUCT_EXECUTABLE "${INFO_PROJECTNAME}.exe"
|
||||
!endif
|
||||
!ifndef UNINST_KEY_NAME
|
||||
!define UNINST_KEY_NAME "${INFO_COMPANYNAME}${INFO_PRODUCTNAME}"
|
||||
!endif
|
||||
!define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${UNINST_KEY_NAME}"
|
||||
|
||||
!ifndef REQUEST_EXECUTION_LEVEL
|
||||
!define REQUEST_EXECUTION_LEVEL "admin"
|
||||
!endif
|
||||
|
||||
RequestExecutionLevel "${REQUEST_EXECUTION_LEVEL}"
|
||||
|
||||
!ifdef ARG_WAILS_AMD64_BINARY
|
||||
!define SUPPORTS_AMD64
|
||||
!endif
|
||||
|
||||
!ifdef ARG_WAILS_ARM64_BINARY
|
||||
!define SUPPORTS_ARM64
|
||||
!endif
|
||||
|
||||
!ifdef SUPPORTS_AMD64
|
||||
!ifdef SUPPORTS_ARM64
|
||||
!define ARCH "amd64_arm64"
|
||||
!else
|
||||
!define ARCH "amd64"
|
||||
!endif
|
||||
!else
|
||||
!ifdef SUPPORTS_ARM64
|
||||
!define ARCH "arm64"
|
||||
!else
|
||||
!error "Wails: Undefined ARCH, please provide at least one of ARG_WAILS_AMD64_BINARY or ARG_WAILS_ARM64_BINARY"
|
||||
!endif
|
||||
!endif
|
||||
|
||||
!macro wails.checkArchitecture
|
||||
!ifndef WAILS_WIN10_REQUIRED
|
||||
!define WAILS_WIN10_REQUIRED "This product is only supported on Windows 10 (Server 2016) and later."
|
||||
!endif
|
||||
|
||||
!ifndef WAILS_ARCHITECTURE_NOT_SUPPORTED
|
||||
!define WAILS_ARCHITECTURE_NOT_SUPPORTED "This product can't be installed on the current Windows architecture. Supports: ${ARCH}"
|
||||
!endif
|
||||
|
||||
${If} ${AtLeastWin10}
|
||||
!ifdef SUPPORTS_AMD64
|
||||
${if} ${IsNativeAMD64}
|
||||
Goto ok
|
||||
${EndIf}
|
||||
!endif
|
||||
|
||||
!ifdef SUPPORTS_ARM64
|
||||
${if} ${IsNativeARM64}
|
||||
Goto ok
|
||||
${EndIf}
|
||||
!endif
|
||||
|
||||
IfSilent silentArch notSilentArch
|
||||
silentArch:
|
||||
SetErrorLevel 65
|
||||
Abort
|
||||
notSilentArch:
|
||||
MessageBox MB_OK "${WAILS_ARCHITECTURE_NOT_SUPPORTED}"
|
||||
Quit
|
||||
${else}
|
||||
IfSilent silentWin notSilentWin
|
||||
silentWin:
|
||||
SetErrorLevel 64
|
||||
Abort
|
||||
notSilentWin:
|
||||
MessageBox MB_OK "${WAILS_WIN10_REQUIRED}"
|
||||
Quit
|
||||
${EndIf}
|
||||
|
||||
ok:
|
||||
!macroend
|
||||
|
||||
!macro wails.files
|
||||
!ifdef SUPPORTS_AMD64
|
||||
${if} ${IsNativeAMD64}
|
||||
File "/oname=${PRODUCT_EXECUTABLE}" "${ARG_WAILS_AMD64_BINARY}"
|
||||
${EndIf}
|
||||
!endif
|
||||
|
||||
!ifdef SUPPORTS_ARM64
|
||||
${if} ${IsNativeARM64}
|
||||
File "/oname=${PRODUCT_EXECUTABLE}" "${ARG_WAILS_ARM64_BINARY}"
|
||||
${EndIf}
|
||||
!endif
|
||||
!macroend
|
||||
|
||||
!macro wails.writeUninstaller
|
||||
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||
|
||||
SetRegView 64
|
||||
WriteRegStr HKLM "${UNINST_KEY}" "Publisher" "${INFO_COMPANYNAME}"
|
||||
WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "${INFO_PRODUCTNAME}"
|
||||
WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${INFO_PRODUCTVERSION}"
|
||||
WriteRegStr HKLM "${UNINST_KEY}" "DisplayIcon" "$INSTDIR\${PRODUCT_EXECUTABLE}"
|
||||
WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
||||
WriteRegStr HKLM "${UNINST_KEY}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
|
||||
|
||||
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
|
||||
IntFmt $0 "0x%08X" $0
|
||||
WriteRegDWORD HKLM "${UNINST_KEY}" "EstimatedSize" "$0"
|
||||
!macroend
|
||||
|
||||
!macro wails.deleteUninstaller
|
||||
Delete "$INSTDIR\uninstall.exe"
|
||||
|
||||
SetRegView 64
|
||||
DeleteRegKey HKLM "${UNINST_KEY}"
|
||||
!macroend
|
||||
|
||||
!macro wails.setShellContext
|
||||
${If} ${REQUEST_EXECUTION_LEVEL} == "admin"
|
||||
SetShellVarContext all
|
||||
${else}
|
||||
SetShellVarContext current
|
||||
${EndIf}
|
||||
!macroend
|
||||
|
||||
# Install webview2 by launching the bootstrapper
|
||||
# See https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#online-only-deployment
|
||||
!macro wails.webview2runtime
|
||||
!ifndef WAILS_INSTALL_WEBVIEW_DETAILPRINT
|
||||
!define WAILS_INSTALL_WEBVIEW_DETAILPRINT "Installing: WebView2 Runtime"
|
||||
!endif
|
||||
|
||||
SetRegView 64
|
||||
# If the admin key exists and is not empty then webview2 is already installed
|
||||
ReadRegStr $0 HKLM "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv"
|
||||
${If} $0 != ""
|
||||
Goto ok
|
||||
${EndIf}
|
||||
|
||||
${If} ${REQUEST_EXECUTION_LEVEL} == "user"
|
||||
# If the installer is run in user level, check the user specific key exists and is not empty then webview2 is already installed
|
||||
ReadRegStr $0 HKCU "Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv"
|
||||
${If} $0 != ""
|
||||
Goto ok
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
|
||||
SetDetailsPrint both
|
||||
DetailPrint "${WAILS_INSTALL_WEBVIEW_DETAILPRINT}"
|
||||
SetDetailsPrint listonly
|
||||
|
||||
InitPluginsDir
|
||||
CreateDirectory "$pluginsdir\webview2bootstrapper"
|
||||
SetOutPath "$pluginsdir\webview2bootstrapper"
|
||||
File "MicrosoftEdgeWebview2Setup.exe"
|
||||
ExecWait '"$pluginsdir\webview2bootstrapper\MicrosoftEdgeWebview2Setup.exe" /silent /install'
|
||||
|
||||
SetDetailsPrint both
|
||||
ok:
|
||||
!macroend
|
||||
|
||||
# Copy of APP_ASSOCIATE and APP_UNASSOCIATE macros from here https://gist.github.com/nikku/281d0ef126dbc215dd58bfd5b3a5cd5b
|
||||
!macro APP_ASSOCIATE EXT FILECLASS DESCRIPTION ICON COMMANDTEXT COMMAND
|
||||
; Backup the previously associated file class
|
||||
ReadRegStr $R0 SHELL_CONTEXT "Software\Classes\.${EXT}" ""
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "${FILECLASS}_backup" "$R0"
|
||||
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "" "${FILECLASS}"
|
||||
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}" "" `${DESCRIPTION}`
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\DefaultIcon" "" `${ICON}`
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell" "" "open"
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\open" "" `${COMMANDTEXT}`
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\open\command" "" `${COMMAND}`
|
||||
!macroend
|
||||
|
||||
!macro APP_UNASSOCIATE EXT FILECLASS
|
||||
; Backup the previously associated file class
|
||||
ReadRegStr $R0 SHELL_CONTEXT "Software\Classes\.${EXT}" `${FILECLASS}_backup`
|
||||
WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "" "$R0"
|
||||
|
||||
DeleteRegKey SHELL_CONTEXT `Software\Classes\${FILECLASS}`
|
||||
!macroend
|
||||
|
||||
!macro wails.associateFiles
|
||||
; Create file associations
|
||||
|
||||
!macroend
|
||||
|
||||
!macro wails.unassociateFiles
|
||||
; Delete app associations
|
||||
|
||||
!macroend
|
||||
22
v3/examples/android/build/windows/wails.exe.manifest
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||
<assemblyIdentity type="win32" name="com.wails.ios" version="0.1.0" processorArchitecture="*"/>
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
<asmv3:application>
|
||||
<asmv3:windowsSettings>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware> <!-- fallback for Windows 7 and 8 -->
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2,permonitor</dpiAwareness> <!-- falls back to per-monitor if per-monitor v2 is not supported -->
|
||||
</asmv3:windowsSettings>
|
||||
</asmv3:application>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</assembly>
|
||||
93
v3/examples/android/frontend/Inter Font License.txt
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {$CancellablePromise<string>}
|
||||
*/
|
||||
export function Greet(name) {
|
||||
return $Call.ByID(1411160069, name);
|
||||
}
|
||||
8
v3/examples/android/frontend/bindings/changeme/index.js
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
import * as GreetService from "./greetservice.js";
|
||||
export {
|
||||
GreetService
|
||||
};
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
//@ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
Object.freeze($Create.Events);
|
||||
2
v3/examples/android/frontend/bindings/github.com/wailsapp/wails/v3/internal/eventdata.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
110
v3/examples/android/frontend/index.html
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<link rel="icon" type="image/svg+xml" href="/wails.png"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<link rel="stylesheet" href="/style.css"/>
|
||||
|
||||
<title>Wails App</title>
|
||||
<!-- Android WebView setup - must run before module scripts to enable window._wails.invoke -->
|
||||
<script>
|
||||
// Android WebView exposes window.wails via addJavascriptInterface
|
||||
// We need to set up window._wails.invoke before the module scripts run
|
||||
if (window.wails && window.wails.invoke) {
|
||||
console.log('[Wails Android Bootstrap] window.wails.invoke detected, setting up _wails');
|
||||
window._wails = window._wails || {};
|
||||
window._wails.invoke = function(m) {
|
||||
return window.wails.invoke(typeof m === 'string' ? m : JSON.stringify(m));
|
||||
};
|
||||
} else {
|
||||
console.log('[Wails Android Bootstrap] window.wails not available yet');
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div>
|
||||
<a data-wml-openURL="https://wails.io">
|
||||
<img src="/wails.png" class="logo" alt="Wails logo"/>
|
||||
</a>
|
||||
<a data-wml-openURL="https://developer.mozilla.org/en-US/docs/Web/JavaScript">
|
||||
<img src="/javascript.svg" class="logo vanilla" alt="JavaScript logo"/>
|
||||
</a>
|
||||
</div>
|
||||
<h1>Wails + Javascript</h1>
|
||||
<div class="card mobile-pane">
|
||||
<div class="result">Demo Screens</div>
|
||||
<div class="p-mobile-tabs-content">
|
||||
<!-- Screen 1: Bindings -->
|
||||
<div class="p-mobile-tabs--content active" id="screen-bindings">
|
||||
<div class="result" id="result">Please enter your name below 👇</div>
|
||||
<div class="input-box" id="input">
|
||||
<input class="input" id="name" type="text" autocomplete="off"/>
|
||||
<button class="p-btn p-prim-col" onclick="doGreet()">Greet</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Screen 2: Go Runtime -->
|
||||
<div class="p-mobile-tabs--content" id="screen-go">
|
||||
<div class="input-box">
|
||||
<label><input type="checkbox" id="goScrollEnabled" checked onchange="setGoToggle('ios:setScrollEnabled', this.checked)"> Scroll Enabled (Go)</label>
|
||||
</div>
|
||||
<div class="input-box">
|
||||
<label><input type="checkbox" id="goBounceEnabled" checked onchange="setGoToggle('ios:setBounceEnabled', this.checked)"> Bounce Enabled (Go)</label>
|
||||
</div>
|
||||
<div class="input-box">
|
||||
<label><input type="checkbox" id="goIndicatorsEnabled" checked onchange="setGoToggle('ios:setScrollIndicatorsEnabled', this.checked)"> Scroll Indicators (Go)</label>
|
||||
</div>
|
||||
<div class="input-box">
|
||||
<label><input type="checkbox" id="goNavGesturesEnabled" onchange="setGoToggle('ios:setBackForwardGesturesEnabled', this.checked)"> Back/Forward Gestures (Go)</label>
|
||||
</div>
|
||||
<div class="input-box">
|
||||
<label><input type="checkbox" id="goLinkPreviewEnabled" checked onchange="setGoToggle('ios:setLinkPreviewEnabled', this.checked)"> Link Preview (Go)</label>
|
||||
</div>
|
||||
<div class="input-box">
|
||||
<input class="input" id="uaInputGo" type="text" placeholder="Custom User Agent"/>
|
||||
<button class="p-btn" onclick="emitGo('ios:setCustomUserAgent', {ua: document.getElementById('uaInputGo').value})">Set UA (Go)</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Screen 3: JS Runtime -->
|
||||
<div class="p-mobile-tabs--content" id="screen-js">
|
||||
<div class="input-box">
|
||||
<button class="p-btn" onclick="doHaptic('light')">Haptic: Light</button>
|
||||
<button class="p-btn" onclick="doHaptic('medium')">Haptic: Medium</button>
|
||||
<button class="p-btn" onclick="doHaptic('heavy')">Haptic: Heavy</button>
|
||||
<button class="p-btn p-prim-col" onclick="getDeviceInfo();">Get Device Info</button>
|
||||
</div>
|
||||
<div class="input-box">
|
||||
<label><input type="checkbox" id="jsScrollEnabled" checked onchange="setJsToggle('Scroll.SetEnabled', this.checked)"> Scroll Enabled (JS)</label>
|
||||
</div>
|
||||
<div class="input-box">
|
||||
<label><input type="checkbox" id="jsBounceEnabled" checked onchange="setJsToggle('Scroll.SetBounceEnabled', this.checked)"> Bounce Enabled (JS)</label>
|
||||
</div>
|
||||
<div class="input-box">
|
||||
<label><input type="checkbox" id="jsIndicatorsEnabled" checked onchange="setJsToggle('Scroll.SetIndicatorsEnabled', this.checked)"> Scroll Indicators (JS)</label>
|
||||
</div>
|
||||
<div class="input-box">
|
||||
<label><input type="checkbox" id="jsNavGesturesEnabled" onchange="setJsToggle('Navigation.SetBackForwardGesturesEnabled', this.checked)"> Back/Forward Gestures (JS)</label>
|
||||
</div>
|
||||
<div class="input-box">
|
||||
<label><input type="checkbox" id="jsLinkPreviewEnabled" checked onchange="setJsToggle('Links.SetPreviewEnabled', this.checked)"> Link Preview (JS)</label>
|
||||
</div>
|
||||
<div class="input-box">
|
||||
<input class="input" id="uaInputJs" type="text" placeholder="Custom User Agent"/>
|
||||
<button class="p-btn" onclick="iosJsSet('UserAgent.Set', {ua: document.getElementById('uaInputJs').value})">Set UA</button>
|
||||
</div>
|
||||
<pre id="deviceInfo" style="white-space: pre-wrap; word-break: break-word;"></pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div><p>Click on the Wails logo to learn more</p></div>
|
||||
<div><p id="time">Listening for Time event...</p></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
113
v3/examples/android/frontend/main.js
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
import {GreetService} from "./bindings/changeme";
|
||||
import * as Runtime from "@wailsio/runtime";
|
||||
|
||||
const resultElement = document.getElementById('result');
|
||||
const timeElement = document.getElementById('time');
|
||||
const deviceInfoElement = document.getElementById('deviceInfo');
|
||||
const Events = Runtime.Events;
|
||||
const IOS = Runtime.IOS; // May be undefined in published package; we guard usages below.
|
||||
|
||||
window.doGreet = () => {
|
||||
let name = document.getElementById('name').value;
|
||||
if (!name) {
|
||||
name = 'anonymous';
|
||||
}
|
||||
GreetService.Greet(name).then((result) => {
|
||||
resultElement.innerText = result;
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
window.doHaptic = (style) => {
|
||||
if (!IOS || !IOS.Haptics?.Impact) {
|
||||
console.warn('IOS runtime not available in @wailsio/runtime. Skipping haptic call.');
|
||||
return;
|
||||
}
|
||||
IOS.Haptics.Impact(style).catch((err) => {
|
||||
console.error('Haptics error:', err);
|
||||
});
|
||||
}
|
||||
|
||||
window.getDeviceInfo = async () => {
|
||||
if (!IOS || !IOS.Device?.Info) {
|
||||
deviceInfoElement.innerText = 'iOS runtime not available; cannot fetch device info.';
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const info = await IOS.Device.Info();
|
||||
deviceInfoElement.innerText = JSON.stringify(info, null, 2);
|
||||
} catch (e) {
|
||||
deviceInfoElement.innerText = `Error: ${e?.message || e}`;
|
||||
}
|
||||
}
|
||||
|
||||
// Generic caller for IOS.<Group>.<Method>(args)
|
||||
window.iosJsSet = async (methodPath, args) => {
|
||||
if (!IOS) {
|
||||
console.warn('IOS runtime not available in @wailsio/runtime.');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const [group, method] = methodPath.split('.');
|
||||
const target = IOS?.[group];
|
||||
const fn = target?.[method];
|
||||
if (typeof fn !== 'function') {
|
||||
console.warn('IOS method not found:', methodPath);
|
||||
return;
|
||||
}
|
||||
await fn(args);
|
||||
} catch (e) {
|
||||
console.error('iosJsSet error for', methodPath, e);
|
||||
}
|
||||
}
|
||||
|
||||
// Emit events for Go handlers
|
||||
window.emitGo = (eventName, data) => {
|
||||
try {
|
||||
Events.Emit(eventName, data);
|
||||
} catch (e) {
|
||||
console.error('emitGo error:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// Toggle helpers for UI switches
|
||||
window.setGoToggle = (eventName, enabled) => {
|
||||
emitGo(eventName, { enabled: !!enabled });
|
||||
}
|
||||
|
||||
window.setJsToggle = (methodPath, enabled) => {
|
||||
iosJsSet(methodPath, { enabled: !!enabled });
|
||||
}
|
||||
|
||||
Events.On('time', (payload) => {
|
||||
// payload may be a plain value or an object with a `data` field depending on emitter/runtime
|
||||
const value = (payload && typeof payload === 'object' && 'data' in payload) ? payload.data : payload;
|
||||
console.log('[frontend] time event:', payload, '->', value);
|
||||
timeElement.innerText = value;
|
||||
});
|
||||
|
||||
// Simple pane switcher responding to native UITabBar
|
||||
function showPaneByIndex(index) {
|
||||
const panes = [
|
||||
document.getElementById('screen-bindings'),
|
||||
document.getElementById('screen-go'),
|
||||
document.getElementById('screen-js'),
|
||||
];
|
||||
panes.forEach((el, i) => {
|
||||
if (!el) return;
|
||||
if (i === index) el.classList.add('active');
|
||||
else el.classList.remove('active');
|
||||
});
|
||||
}
|
||||
|
||||
// Listen for native tab selection events posted by the iOS layer
|
||||
window.addEventListener('nativeTabSelected', (e) => {
|
||||
const idx = (e && e.detail && typeof e.detail.index === 'number') ? e.detail.index : 0;
|
||||
showPaneByIndex(idx);
|
||||
});
|
||||
|
||||
// Ensure default pane is visible on load (index 0)
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
showPaneByIndex(0);
|
||||
});
|
||||
936
v3/examples/android/frontend/package-lock.json
generated
Normal file
|
|
@ -0,0 +1,936 @@
|
|||
{
|
||||
"name": "frontend",
|
||||
"version": "0.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "frontend",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"@wailsio/runtime": "latest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vite": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz",
|
||||
"integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"aix"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz",
|
||||
"integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz",
|
||||
"integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz",
|
||||
"integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz",
|
||||
"integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz",
|
||||
"integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz",
|
||||
"integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz",
|
||||
"integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz",
|
||||
"integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz",
|
||||
"integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz",
|
||||
"integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz",
|
||||
"integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz",
|
||||
"integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz",
|
||||
"integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz",
|
||||
"integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz",
|
||||
"integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz",
|
||||
"integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz",
|
||||
"integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz",
|
||||
"integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz",
|
||||
"integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"sunos"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz",
|
||||
"integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz",
|
||||
"integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz",
|
||||
"integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.50.0.tgz",
|
||||
"integrity": "sha512-lVgpeQyy4fWN5QYebtW4buT/4kn4p4IJ+kDNB4uYNT5b8c8DLJDg6titg20NIg7E8RWwdWZORW6vUFfrLyG3KQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm64": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.50.0.tgz",
|
||||
"integrity": "sha512-2O73dR4Dc9bp+wSYhviP6sDziurB5/HCym7xILKifWdE9UsOe2FtNcM+I4xZjKrfLJnq5UR8k9riB87gauiQtw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-darwin-arm64": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.50.0.tgz",
|
||||
"integrity": "sha512-vwSXQN8T4sKf1RHr1F0s98Pf8UPz7pS6P3LG9NSmuw0TVh7EmaE+5Ny7hJOZ0M2yuTctEsHHRTMi2wuHkdS6Hg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-darwin-x64": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.50.0.tgz",
|
||||
"integrity": "sha512-cQp/WG8HE7BCGyFVuzUg0FNmupxC+EPZEwWu2FCGGw5WDT1o2/YlENbm5e9SMvfDFR6FRhVCBePLqj0o8MN7Vw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-freebsd-arm64": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.50.0.tgz",
|
||||
"integrity": "sha512-UR1uTJFU/p801DvvBbtDD7z9mQL8J80xB0bR7DqW7UGQHRm/OaKzp4is7sQSdbt2pjjSS72eAtRh43hNduTnnQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-freebsd-x64": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.50.0.tgz",
|
||||
"integrity": "sha512-G/DKyS6PK0dD0+VEzH/6n/hWDNPDZSMBmqsElWnCRGrYOb2jC0VSupp7UAHHQ4+QILwkxSMaYIbQ72dktp8pKA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.50.0.tgz",
|
||||
"integrity": "sha512-u72Mzc6jyJwKjJbZZcIYmd9bumJu7KNmHYdue43vT1rXPm2rITwmPWF0mmPzLm9/vJWxIRbao/jrQmxTO0Sm9w==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.50.0.tgz",
|
||||
"integrity": "sha512-S4UefYdV0tnynDJV1mdkNawp0E5Qm2MtSs330IyHgaccOFrwqsvgigUD29uT+B/70PDY1eQ3t40+xf6wIvXJyg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm64-gnu": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.50.0.tgz",
|
||||
"integrity": "sha512-1EhkSvUQXJsIhk4msxP5nNAUWoB4MFDHhtc4gAYvnqoHlaL9V3F37pNHabndawsfy/Tp7BPiy/aSa6XBYbaD1g==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm64-musl": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.50.0.tgz",
|
||||
"integrity": "sha512-EtBDIZuDtVg75xIPIK1l5vCXNNCIRM0OBPUG+tbApDuJAy9mKago6QxX+tfMzbCI6tXEhMuZuN1+CU8iDW+0UQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-loongarch64-gnu": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.50.0.tgz",
|
||||
"integrity": "sha512-BGYSwJdMP0hT5CCmljuSNx7+k+0upweM2M4YGfFBjnFSZMHOLYR0gEEj/dxyYJ6Zc6AiSeaBY8dWOa11GF/ppQ==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-ppc64-gnu": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.50.0.tgz",
|
||||
"integrity": "sha512-I1gSMzkVe1KzAxKAroCJL30hA4DqSi+wGc5gviD0y3IL/VkvcnAqwBf4RHXHyvH66YVHxpKO8ojrgc4SrWAnLg==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.50.0.tgz",
|
||||
"integrity": "sha512-bSbWlY3jZo7molh4tc5dKfeSxkqnf48UsLqYbUhnkdnfgZjgufLS/NTA8PcP/dnvct5CCdNkABJ56CbclMRYCA==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-riscv64-musl": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.50.0.tgz",
|
||||
"integrity": "sha512-LSXSGumSURzEQLT2e4sFqFOv3LWZsEF8FK7AAv9zHZNDdMnUPYH3t8ZlaeYYZyTXnsob3htwTKeWtBIkPV27iQ==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-s390x-gnu": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.50.0.tgz",
|
||||
"integrity": "sha512-CxRKyakfDrsLXiCyucVfVWVoaPA4oFSpPpDwlMcDFQvrv3XY6KEzMtMZrA+e/goC8xxp2WSOxHQubP8fPmmjOQ==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-x64-gnu": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.50.0.tgz",
|
||||
"integrity": "sha512-8PrJJA7/VU8ToHVEPu14FzuSAqVKyo5gg/J8xUerMbyNkWkO9j2ExBho/68RnJsMGNJq4zH114iAttgm7BZVkA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-x64-musl": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.50.0.tgz",
|
||||
"integrity": "sha512-SkE6YQp+CzpyOrbw7Oc4MgXFvTw2UIBElvAvLCo230pyxOLmYwRPwZ/L5lBe/VW/qT1ZgND9wJfOsdy0XptRvw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-openharmony-arm64": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.50.0.tgz",
|
||||
"integrity": "sha512-PZkNLPfvXeIOgJWA804zjSFH7fARBBCpCXxgkGDRjjAhRLOR8o0IGS01ykh5GYfod4c2yiiREuDM8iZ+pVsT+Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openharmony"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-arm64-msvc": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.50.0.tgz",
|
||||
"integrity": "sha512-q7cIIdFvWQoaCbLDUyUc8YfR3Jh2xx3unO8Dn6/TTogKjfwrax9SyfmGGK6cQhKtjePI7jRfd7iRYcxYs93esg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-ia32-msvc": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.50.0.tgz",
|
||||
"integrity": "sha512-XzNOVg/YnDOmFdDKcxxK410PrcbcqZkBmz+0FicpW5jtjKQxcW1BZJEQOF0NJa6JO7CZhett8GEtRN/wYLYJuw==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-x64-msvc": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.50.0.tgz",
|
||||
"integrity": "sha512-xMmiWRR8sp72Zqwjgtf3QbZfF1wdh8X2ABu3EaozvZcyHJeU0r+XAnXdKgs4cCAp6ORoYoCygipYP1mjmbjrsg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@types/estree": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
|
||||
"integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@wailsio/runtime": {
|
||||
"version": "3.0.0-alpha.66",
|
||||
"resolved": "https://registry.npmjs.org/@wailsio/runtime/-/runtime-3.0.0-alpha.66.tgz",
|
||||
"integrity": "sha512-ENLu8rn1griL1gFHJqkq1i+BVxrrA0JPJHYneUJYuf/s54kjuQViW0RKDEe/WTDo56ABpfykrd/T8OYpPUyXUw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz",
|
||||
"integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"esbuild": "bin/esbuild"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/aix-ppc64": "0.21.5",
|
||||
"@esbuild/android-arm": "0.21.5",
|
||||
"@esbuild/android-arm64": "0.21.5",
|
||||
"@esbuild/android-x64": "0.21.5",
|
||||
"@esbuild/darwin-arm64": "0.21.5",
|
||||
"@esbuild/darwin-x64": "0.21.5",
|
||||
"@esbuild/freebsd-arm64": "0.21.5",
|
||||
"@esbuild/freebsd-x64": "0.21.5",
|
||||
"@esbuild/linux-arm": "0.21.5",
|
||||
"@esbuild/linux-arm64": "0.21.5",
|
||||
"@esbuild/linux-ia32": "0.21.5",
|
||||
"@esbuild/linux-loong64": "0.21.5",
|
||||
"@esbuild/linux-mips64el": "0.21.5",
|
||||
"@esbuild/linux-ppc64": "0.21.5",
|
||||
"@esbuild/linux-riscv64": "0.21.5",
|
||||
"@esbuild/linux-s390x": "0.21.5",
|
||||
"@esbuild/linux-x64": "0.21.5",
|
||||
"@esbuild/netbsd-x64": "0.21.5",
|
||||
"@esbuild/openbsd-x64": "0.21.5",
|
||||
"@esbuild/sunos-x64": "0.21.5",
|
||||
"@esbuild/win32-arm64": "0.21.5",
|
||||
"@esbuild/win32-ia32": "0.21.5",
|
||||
"@esbuild/win32-x64": "0.21.5"
|
||||
}
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"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,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.11",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
|
||||
"integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
|
||||
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.5.6",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz",
|
||||
"integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/postcss/"
|
||||
},
|
||||
{
|
||||
"type": "tidelift",
|
||||
"url": "https://tidelift.com/funding/github/npm/postcss"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.11",
|
||||
"picocolors": "^1.1.1",
|
||||
"source-map-js": "^1.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup": {
|
||||
"version": "4.50.0",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.50.0.tgz",
|
||||
"integrity": "sha512-/Zl4D8zPifNmyGzJS+3kVoyXeDeT/GrsJM94sACNg9RtUE0hrHa1bNPtRSrfHTMH5HjRzce6K7rlTh3Khiw+pw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/estree": "1.0.8"
|
||||
},
|
||||
"bin": {
|
||||
"rollup": "dist/bin/rollup"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0",
|
||||
"npm": ">=8.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rollup/rollup-android-arm-eabi": "4.50.0",
|
||||
"@rollup/rollup-android-arm64": "4.50.0",
|
||||
"@rollup/rollup-darwin-arm64": "4.50.0",
|
||||
"@rollup/rollup-darwin-x64": "4.50.0",
|
||||
"@rollup/rollup-freebsd-arm64": "4.50.0",
|
||||
"@rollup/rollup-freebsd-x64": "4.50.0",
|
||||
"@rollup/rollup-linux-arm-gnueabihf": "4.50.0",
|
||||
"@rollup/rollup-linux-arm-musleabihf": "4.50.0",
|
||||
"@rollup/rollup-linux-arm64-gnu": "4.50.0",
|
||||
"@rollup/rollup-linux-arm64-musl": "4.50.0",
|
||||
"@rollup/rollup-linux-loongarch64-gnu": "4.50.0",
|
||||
"@rollup/rollup-linux-ppc64-gnu": "4.50.0",
|
||||
"@rollup/rollup-linux-riscv64-gnu": "4.50.0",
|
||||
"@rollup/rollup-linux-riscv64-musl": "4.50.0",
|
||||
"@rollup/rollup-linux-s390x-gnu": "4.50.0",
|
||||
"@rollup/rollup-linux-x64-gnu": "4.50.0",
|
||||
"@rollup/rollup-linux-x64-musl": "4.50.0",
|
||||
"@rollup/rollup-openharmony-arm64": "4.50.0",
|
||||
"@rollup/rollup-win32-arm64-msvc": "4.50.0",
|
||||
"@rollup/rollup-win32-ia32-msvc": "4.50.0",
|
||||
"@rollup/rollup-win32-x64-msvc": "4.50.0",
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
|
||||
"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "5.4.19",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.19.tgz",
|
||||
"integrity": "sha512-qO3aKv3HoQC8QKiNSTuUM1l9o/XX3+c+VTgLHbJWHZGeTPVAg2XwazI9UWzoxjIJCGCV2zU60uqMzjeLZuULqA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.21.3",
|
||||
"postcss": "^8.4.43",
|
||||
"rollup": "^4.20.0"
|
||||
},
|
||||
"bin": {
|
||||
"vite": "bin/vite.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.0.0 || >=20.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/vitejs/vite?sponsor=1"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.3.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/node": "^18.0.0 || >=20.0.0",
|
||||
"less": "*",
|
||||
"lightningcss": "^1.21.0",
|
||||
"sass": "*",
|
||||
"sass-embedded": "*",
|
||||
"stylus": "*",
|
||||
"sugarss": "*",
|
||||
"terser": "^5.4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/node": {
|
||||
"optional": true
|
||||
},
|
||||
"less": {
|
||||
"optional": true
|
||||
},
|
||||
"lightningcss": {
|
||||
"optional": true
|
||||
},
|
||||
"sass": {
|
||||
"optional": true
|
||||
},
|
||||
"sass-embedded": {
|
||||
"optional": true
|
||||
},
|
||||
"stylus": {
|
||||
"optional": true
|
||||
},
|
||||
"sugarss": {
|
||||
"optional": true
|
||||
},
|
||||
"terser": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
v3/examples/android/frontend/package.json
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "frontend",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build:dev": "vite build --minify false --mode development",
|
||||
"build": "vite build --mode production",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@wailsio/runtime": "latest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vite": "^5.0.0"
|
||||
}
|
||||
}
|
||||
BIN
v3/examples/android/frontend/public/Inter-Medium.ttf
Normal file
1
v3/examples/android/frontend/public/javascript.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="32" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path fill="#F7DF1E" d="M0 0h256v256H0V0Z"></path><path d="m67.312 213.932l19.59-11.856c3.78 6.701 7.218 12.371 15.465 12.371c7.905 0 12.89-3.092 12.89-15.12v-81.798h24.057v82.138c0 24.917-14.606 36.259-35.916 36.259c-19.245 0-30.416-9.967-36.087-21.996m85.07-2.576l19.588-11.341c5.157 8.421 11.859 14.607 23.715 14.607c9.969 0 16.325-4.984 16.325-11.858c0-8.248-6.53-11.17-17.528-15.98l-6.013-2.58c-17.357-7.387-28.87-16.667-28.87-36.257c0-18.044 13.747-31.792 35.228-31.792c15.294 0 26.292 5.328 34.196 19.247l-18.732 12.03c-4.125-7.389-8.591-10.31-15.465-10.31c-7.046 0-11.514 4.468-11.514 10.31c0 7.217 4.468 10.14 14.778 14.608l6.014 2.577c20.45 8.765 31.963 17.7 31.963 37.804c0 21.654-17.012 33.51-39.867 33.51c-22.339 0-36.774-10.654-43.819-24.574"></path></svg>
|
||||
|
After Width: | Height: | Size: 995 B |
21
v3/examples/android/frontend/public/puppertino/LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2019 Edgar Pérez
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
149
v3/examples/android/frontend/public/puppertino/css/actions.css
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
:root {
|
||||
--font: -apple-system, "Inter", sans-serif;
|
||||
--primary-col-ac: #0f75f5;
|
||||
--p-modal-bg: rgba(255, 255, 255, 0.8);
|
||||
--p-modal-bd-color: rgba(0,0,0,.1);
|
||||
--p-modal-fallback-color: rgba(255,255,255,.95);
|
||||
--p-actions-static-color: #555761;
|
||||
}
|
||||
|
||||
.p-modal-opened {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.p-action-background{
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
height: 100vh;
|
||||
left: 0;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
transition: 0.3s;
|
||||
width: 100vw;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.p-action-background.nowactive {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
|
||||
.p-action-big-container{
|
||||
position:fixed;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 1rem 5vw;
|
||||
bottom:0;
|
||||
}
|
||||
|
||||
.p-action-container{
|
||||
background: var(--p-modal-bg);
|
||||
display:block;
|
||||
margin:auto;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 10px;
|
||||
max-width: 700px;
|
||||
}
|
||||
|
||||
.p-action-big-container .p-action-container:first-child{
|
||||
margin-bottom:10px;
|
||||
}
|
||||
|
||||
.p-action--intern{
|
||||
width: 100%;
|
||||
display:block;
|
||||
margin:auto;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
text-align:center;
|
||||
padding: 15px 0;
|
||||
border: 0;
|
||||
border-bottom: 1px solid #bfbfbf;
|
||||
color: #0f75f5;
|
||||
text-decoration:none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.p-action-destructive{
|
||||
color: #c6262e;
|
||||
}
|
||||
|
||||
.p-action-neutral{
|
||||
color: var(--p-actions-static-color);
|
||||
}
|
||||
|
||||
.p-action-cancel, .p-action-container a:last-child{
|
||||
border-bottom:none;
|
||||
}
|
||||
|
||||
.p-action-cancel{
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.p-action-icon{
|
||||
position:relative;
|
||||
}
|
||||
.p-action-icon svg, .p-action-icon img{
|
||||
position:absolute;
|
||||
left:5%;
|
||||
top:50%;
|
||||
transform:translateY(-50%);
|
||||
}
|
||||
|
||||
.p-action-icon-inline{
|
||||
text-align: left;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.p-action-icon-inline svg, .p-action-icon-inline img{
|
||||
margin-left: 5%;
|
||||
margin-right: 3%;
|
||||
}
|
||||
|
||||
.p-action-title{
|
||||
padding: 30px 15px;
|
||||
border-bottom: 1px solid #bfbfbf;
|
||||
}
|
||||
|
||||
.p-action-title--intern,.p-action-text{
|
||||
margin:0;
|
||||
color:var(--p-actions-static-color);
|
||||
}
|
||||
|
||||
.p-action-title--intern{
|
||||
margin-bottom: .3rem;
|
||||
}
|
||||
|
||||
@supports not (backdrop-filter: blur(10px)) {
|
||||
.p-action-container {
|
||||
background: var(--p-modal-fallback-color);
|
||||
}
|
||||
}
|
||||
|
||||
.p-action-big-container{
|
||||
-webkit-transform: translateY(30%);
|
||||
transform: translateY(30%);
|
||||
opacity: 0;
|
||||
transition: opacity 0.4s, transform 0.4s;
|
||||
transition-timing-function: ease;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.p-action-big-container.active {
|
||||
-webkit-transform: translateY(0);
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
pointer-events: all;
|
||||
}
|
||||
|
||||
|
||||
.p-action-big-container.active .p-action-container {
|
||||
backdrop-filter: saturate(180%) blur(10px);
|
||||
}
|
||||
|
||||
.p-action-big-container[aria-hidden="true"] .p-action--intern {
|
||||
display: none;
|
||||
}
|
||||
158
v3/examples/android/frontend/public/puppertino/css/buttons.css
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
@charset "UTF-8";
|
||||
:root{
|
||||
--p-btn-border: #cacaca;
|
||||
--p-btn-def-bg: #FFFFFF;
|
||||
--p-btn-def-col: #000000;
|
||||
--p-btn-dir-col: #242424;
|
||||
--p-prim-text-col: #f5f5f5;
|
||||
--p-btn-scope-unactive: #212136;
|
||||
--p-btn-scope-action: #212136;
|
||||
}
|
||||
|
||||
.p-btn {
|
||||
background: var(--p-btn-def-bg);
|
||||
border: 1px solid var(--p-btn-border);
|
||||
border-radius: 10px;
|
||||
color: var(--p-btn-def-col);
|
||||
display: inline-block;
|
||||
font-family: -apple-system, "Inter", sans-serif;
|
||||
font-size: 1.1rem;
|
||||
margin: .7rem;
|
||||
padding: .4rem 1.2rem;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
box-shadow: 0 1px 0.375px rgba(0, 0, 0, 0.05), 0 0.25px 0.375px rgba(0, 0, 0, 0.15);
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.p-btn:focus{
|
||||
outline: 2px solid #64baff;
|
||||
}
|
||||
.p-btn.p-btn-block{
|
||||
display: block;
|
||||
}
|
||||
.p-btn.p-btn-sm {
|
||||
padding: .3rem 1.1rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
.p-btn.p-btn-md {
|
||||
padding: .8rem 2.4rem;
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
.p-btn.p-btn-lg {
|
||||
padding: 1.2rem 2.8rem;
|
||||
font-size: 1.8rem;
|
||||
}
|
||||
.p-btn-destructive{
|
||||
color: #FF3B30;
|
||||
}
|
||||
.p-btn-mob{
|
||||
padding: 10px 40px;
|
||||
background: #227bec;
|
||||
color: #fff;
|
||||
border: 0;
|
||||
box-shadow: inset 0 1px 1px rgb(255 255 255 / 41%), 0px 2px 3px -2px rgba(0,0,0,.3);
|
||||
}
|
||||
.p-btn[disabled],
|
||||
.p-btn:disabled,
|
||||
.p-btn-disabled{
|
||||
filter:contrast(0.5) grayscale(.5) opacity(.8);
|
||||
cursor: not-allowed;
|
||||
box-shadow: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.p-prim-col {
|
||||
position: relative;
|
||||
background: #007AFF;
|
||||
border: none;
|
||||
box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.41), 0px 2px 3px -2px rgba(0, 0, 0, 0.3);
|
||||
color: var(--p-prim-text-col);
|
||||
overflow: hidden; /* Ensure the ::before element doesn't overflow */
|
||||
}
|
||||
|
||||
.p-prim-col:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
opacity: 0.17;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.p-btn.p-prim-col:active {
|
||||
background: #0f75f5;
|
||||
}
|
||||
|
||||
.p-btn-more::after {
|
||||
content: "...";
|
||||
}
|
||||
|
||||
.p-btn-round {
|
||||
border: 0;
|
||||
border-radius: 50px;
|
||||
box-shadow: inset 0 1px 1px rgb(255 255 255 / 41%);
|
||||
padding: 10px 30px;
|
||||
}
|
||||
|
||||
.p-btn-icon {
|
||||
align-items: center;
|
||||
background: var(--p-btn-def-bg);
|
||||
border: 2px solid currentColor;
|
||||
border-radius: 50%;
|
||||
color: #0f75f5;
|
||||
display: inline-flex;
|
||||
font-weight: 900;
|
||||
height: 40px;
|
||||
width: 40px;
|
||||
justify-content: center;
|
||||
margin: 5px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
box-sizing: border-box;
|
||||
user-select: none;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.p-btn-icon.p-btn-icon-no-border{
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.p-btn-scope {
|
||||
background: #8e8e8e;
|
||||
color: #fff;
|
||||
margin: 5px;
|
||||
padding: 2px 20px;
|
||||
box-shadow: none;
|
||||
}
|
||||
.p-btn-scope-unactive {
|
||||
background: transparent;
|
||||
border-color: transparent;
|
||||
color: var(--p-btn-scope-unactive);
|
||||
transition: border-color 0.2s;
|
||||
}
|
||||
.p-btn-scope-unactive:hover {
|
||||
border-color: var(--p-btn-border);
|
||||
}
|
||||
|
||||
.p-btn-scope-outline {
|
||||
background: transparent;
|
||||
color: var(--p-btn-scope-action);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.p-btn-outline {
|
||||
background: none;
|
||||
border-color: currentColor;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.p-btn-outline-dash {
|
||||
background: none;
|
||||
border-color: currentColor;
|
||||
border-style: dashed;
|
||||
box-shadow: none;
|
||||
}
|
||||
55
v3/examples/android/frontend/public/puppertino/css/cards.css
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
:root{
|
||||
--p-color-card: #1a1a1a;
|
||||
--p-bg-card: #fff;
|
||||
--p-bd-card: #c5c5c55e;
|
||||
}
|
||||
.p-card {
|
||||
background: var(--p-bg-card);
|
||||
border: 1px solid var(--p-bd-card);
|
||||
color: var(--p-color-card);
|
||||
display: block;
|
||||
margin: 15px;
|
||||
margin-left:7.5px;
|
||||
margin-right:7.5px;
|
||||
text-decoration: none;
|
||||
border-radius: 25px;
|
||||
padding: 20px 0px;
|
||||
transition: .3s ease;
|
||||
box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.p-card-image > img {
|
||||
border-bottom: 3px solid var(--accent-article);
|
||||
display: block;
|
||||
margin: auto;
|
||||
width: 100%;
|
||||
}
|
||||
.p-card-tags {
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
.p-card-tags::before {
|
||||
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 75%, white 100%);
|
||||
content: "";
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.p-card-title {
|
||||
font-size: 2rem;
|
||||
margin-bottom: 15px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
.p-card-content {
|
||||
padding: 15px;
|
||||
padding-top: 15px;
|
||||
}
|
||||
.p-card-text {
|
||||
font-size: 17px;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 10px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,917 @@
|
|||
:root{
|
||||
--p-strawberry: #c6262e;
|
||||
--p-strawberry-100: #ff8c82;
|
||||
--p-strawberry-300: #ed5353;
|
||||
--p-strawberry-500: #c6262e;
|
||||
--p-strawberry-700: #a10705;
|
||||
--p-strawberry-900: #7a0000;
|
||||
|
||||
--p-orange: #f37329;
|
||||
--p-orange-100: #ffc27d;
|
||||
--p-orange-300: #ffa154;
|
||||
--p-orange-500: #f37329;
|
||||
--p-orange-700: #cc3b02;
|
||||
--p-orange-900: #a62100;
|
||||
|
||||
|
||||
--p-banana: #f9c440;
|
||||
--p-banana-100: #fff394;
|
||||
--p-banana-300: #ffe16b;
|
||||
--p-banana-500: #f9c440;
|
||||
--p-banana-700: #d48e15;
|
||||
--p-banana-900: #ad5f00;
|
||||
|
||||
--p-lime: #68b723;
|
||||
--p-lime-100: #d1ff82;
|
||||
--p-lime-300: #9bdb4d;
|
||||
--p-lime-500: #68b723;
|
||||
--p-lime-700: #3a9104;
|
||||
--p-lime-900: #206b00;
|
||||
|
||||
--p-mint: #28bca3;
|
||||
--p-mint-100: #89ffdd;
|
||||
--p-mint-300: #43d6b5;
|
||||
--p-mint-500: #28bca3;
|
||||
--p-mint-700: #0e9a83;
|
||||
--p-mint-900: #007367;
|
||||
|
||||
|
||||
--p-blueberry: #3689e6;
|
||||
--p-blueberry-100: #8cd5ff;
|
||||
--p-blueberry-300: #64baff;
|
||||
--p-blueberry-500: #3689e6;
|
||||
--p-blueberry-700: #0d52bf;
|
||||
--p-blueberry-900: #002e99;
|
||||
|
||||
--p-grape: #a56de2;
|
||||
--p-grape-100: #e4c6fa;
|
||||
--p-grape-300: #cd9ef7;
|
||||
--p-grape-500: #a56de2;
|
||||
--p-grape-700: #7239b3;
|
||||
--p-grape-900: #452981;
|
||||
|
||||
--p-bubblegum: #de3e80;
|
||||
--p-bubblegum-100: #fe9ab8;
|
||||
--p-bubblegum-300: #f4679d;
|
||||
--p-bubblegum-500: #de3e80;
|
||||
--p-bubblegum-700: #bc245d;
|
||||
--p-bubblegum-900: #910e38;
|
||||
|
||||
|
||||
--p-cocoa: #715344;
|
||||
--p-cocoa-100: #a3907c;
|
||||
--p-cocoa-300: #8a715e;
|
||||
--p-cocoa-500: #715344;
|
||||
--p-cocoa-700: #57392d;
|
||||
--p-cocoa-900: #3d211b;
|
||||
|
||||
--p-silver: #abacae;
|
||||
--p-silver-100: #fafafa;
|
||||
--p-silver-300: #d4d4d4;
|
||||
--p-silver-500: #abacae;
|
||||
--p-silver-700: #7e8087;
|
||||
--p-silver-900: #555761;
|
||||
|
||||
--p-slate: #485a6c;
|
||||
--p-slate-100: #95a3ab;
|
||||
--p-slate-300: #667885;
|
||||
--p-slate-500: #485a6c;
|
||||
--p-slate-700: #273445;
|
||||
--p-slate-900: #0e141f;
|
||||
|
||||
|
||||
--p-dark: #333;
|
||||
--p-dark-100: #666;
|
||||
--p-dark-300: #4d4d4d;
|
||||
--p-dark-500: #333;
|
||||
--p-dark-700: #1a1a1a;
|
||||
--p-dark-900: #000;
|
||||
|
||||
|
||||
--p-apple-red: rgb(255, 59 , 48);
|
||||
--p-apple-red-dark: rgb(255, 69 , 58);
|
||||
--p-apple-orange: rgb(255,149,0);
|
||||
--p-apple-orange-dark: rgb(255,159,10);
|
||||
--p-apple-yellow: rgb(255,204,0);
|
||||
--p-apple-yellow-dark: rgb(255,214,10);
|
||||
--p-apple-green: rgb(40,205,65);
|
||||
--p-apple-green-dark: rgb(40,215,75);
|
||||
--p-apple-mint: rgb(0,199,190);
|
||||
--p-apple-mint-dark: rgb(102,212,207);
|
||||
--p-apple-teal: rgb(89, 173, 196);
|
||||
--p-apple-teal-dark: rgb(106, 196, 220);
|
||||
--p-apple-cyan: rgb(85,190,240);
|
||||
--p-apple-cyan-dark: rgb(90,200,245);
|
||||
--p-apple-blue: rgb(0, 122, 255);
|
||||
--p-apple-blue-dark: rgb(10, 132, 255);
|
||||
--p-apple-indigo: rgb(88, 86, 214);
|
||||
--p-apple-indigo-dark: rgb(94, 92, 230);
|
||||
--p-apple-purple: rgb(175, 82, 222);
|
||||
--p-apple-purple-dark: rgb(191, 90, 242);
|
||||
--p-apple-pink: rgb(255, 45, 85);
|
||||
--p-apple-pink-dark: rgb(255, 55, 95);
|
||||
--p-apple-brown: rgb(162, 132, 94);
|
||||
--p-apple-brown-dark: rgb(172, 142, 104);
|
||||
--p-apple-gray: rgb(142, 142, 147);
|
||||
--p-apple-gray-dark: rgb(152, 152, 157);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
APPLE OFFICIAL COLORS
|
||||
*/
|
||||
|
||||
.p-apple-red{
|
||||
background: rgb(255, 59 , 48);
|
||||
}
|
||||
|
||||
.p-apple-red-dark{
|
||||
background: rgb(255, 69 , 58);
|
||||
}
|
||||
|
||||
.p-apple-orange{
|
||||
background: rgb(255,149,0);
|
||||
}
|
||||
|
||||
.p-apple-orange-dark{
|
||||
background: rgb(255,159,10);
|
||||
}
|
||||
|
||||
.p-apple-yellow{
|
||||
background: rgb(255,204,0);
|
||||
}
|
||||
|
||||
.p-apple-yellow-dark{
|
||||
background: rgb(255,214,10);
|
||||
}
|
||||
|
||||
.p-apple-green{
|
||||
background: rgb(40,205,65);
|
||||
}
|
||||
|
||||
.p-apple-green-dark{
|
||||
background: rgb(40,215,75);
|
||||
}
|
||||
|
||||
.p-apple-mint{
|
||||
background: rgb(0,199,190);
|
||||
}
|
||||
|
||||
.p-apple-mint-dark{
|
||||
background: rgb(102,212,207);
|
||||
}
|
||||
|
||||
.p-apple-teal{
|
||||
background: rgb(89, 173, 196);
|
||||
}
|
||||
|
||||
.p-apple-teal-dark{
|
||||
background: rgb(106, 196, 220);
|
||||
}
|
||||
|
||||
.p-apple-cyan{
|
||||
background: rgb(85,190,240);
|
||||
}
|
||||
|
||||
.p-apple-cyan-dark{
|
||||
background: rgb(90,200,245);
|
||||
}
|
||||
|
||||
.p-apple-blue{
|
||||
background: rgb(0, 122, 255);
|
||||
}
|
||||
|
||||
.p-apple-blue-dark{
|
||||
background: rgb(10, 132, 255);
|
||||
}
|
||||
|
||||
.p-apple-indigo{
|
||||
background: rgb(88, 86, 214);
|
||||
}
|
||||
|
||||
.p-apple-indigo-dark{
|
||||
background: rgb(94, 92, 230);
|
||||
}
|
||||
|
||||
.p-apple-purple{
|
||||
background: rgb(175, 82, 222);
|
||||
}
|
||||
|
||||
.p-apple-purple-dark{
|
||||
background: rgb(191, 90, 242);
|
||||
}
|
||||
|
||||
.p-apple-pink{
|
||||
background: rgb(255, 45, 85);
|
||||
}
|
||||
|
||||
.p-apple-pink-dark{
|
||||
background: rgb(255, 55, 95);
|
||||
}
|
||||
|
||||
.p-apple-brown{
|
||||
background: rgb(162, 132, 94);
|
||||
}
|
||||
|
||||
.p-apple-brown-dark{
|
||||
background: rgb(172, 142, 104);
|
||||
}
|
||||
|
||||
.p-apple-gray{
|
||||
background: rgb(142, 142, 147);
|
||||
}
|
||||
|
||||
.p-apple-gray-dark{
|
||||
background: rgb(152, 152, 157);
|
||||
}
|
||||
|
||||
.p-apple-red-color{
|
||||
color: rgb(255, 59 , 48);
|
||||
}
|
||||
|
||||
.p-apple-red-dark-color{
|
||||
color: rgb(255, 69 , 58);
|
||||
}
|
||||
|
||||
.p-apple-orange-color{
|
||||
color: rgb(255,149,0);
|
||||
}
|
||||
|
||||
.p-apple-orange-dark-color{
|
||||
color: rgb(255,159,10);
|
||||
}
|
||||
|
||||
.p-apple-yellow-color{
|
||||
color: rgb(255,204,0);
|
||||
}
|
||||
|
||||
.p-apple-yellow-dark-color{
|
||||
color: rgb(255,214,10);
|
||||
}
|
||||
|
||||
.p-apple-green-color{
|
||||
color: rgb(40,205,65);
|
||||
}
|
||||
|
||||
.p-apple-green-dark-color{
|
||||
color: rgb(40,215,75);
|
||||
}
|
||||
|
||||
.p-apple-mint-color{
|
||||
color: rgb(0,199,190);
|
||||
}
|
||||
|
||||
.p-apple-mint-dark-color{
|
||||
color: rgb(102,212,207);
|
||||
}
|
||||
|
||||
.p-apple-teal-color{
|
||||
color: rgb(89, 173, 196);
|
||||
}
|
||||
|
||||
.p-apple-teal-dark-color{
|
||||
color: rgb(106, 196, 220);
|
||||
}
|
||||
|
||||
.p-apple-cyan-color{
|
||||
color: rgb(85,190,240);
|
||||
}
|
||||
|
||||
.p-apple-cyan-dark-color{
|
||||
color: rgb(90,200,245);
|
||||
}
|
||||
|
||||
.p-apple-blue-color{
|
||||
color: rgb(0, 122, 255);
|
||||
}
|
||||
|
||||
.p-apple-blue-dark-color{
|
||||
color: rgb(10, 132, 255);
|
||||
}
|
||||
|
||||
.p-apple-indigo-color{
|
||||
color: rgb(88, 86, 214);
|
||||
}
|
||||
|
||||
.p-apple-indigo-dark-color{
|
||||
color: rgb(94, 92, 230);
|
||||
}
|
||||
|
||||
.p-apple-purple-color{
|
||||
color: rgb(175, 82, 222);
|
||||
}
|
||||
|
||||
.p-apple-purple-dark-color{
|
||||
color: rgb(191, 90, 242);
|
||||
}
|
||||
|
||||
.p-apple-pink-color{
|
||||
color: rgb(255, 45, 85);
|
||||
}
|
||||
|
||||
.p-apple-pink-dark-color{
|
||||
color: rgb(255, 55, 95);
|
||||
}
|
||||
|
||||
.p-apple-brown-color{
|
||||
color: rgb(162, 132, 94);
|
||||
}
|
||||
|
||||
.p-apple-brown-dark-color{
|
||||
color: rgb(172, 142, 104);
|
||||
}
|
||||
|
||||
.p-apple-gray-color{
|
||||
color: rgb(142, 142, 147);
|
||||
}
|
||||
|
||||
.p-apple-gray-dark-color{
|
||||
color: rgb(152, 152, 157);
|
||||
}
|
||||
|
||||
.p-strawberry {
|
||||
background: #c6262e;
|
||||
}
|
||||
|
||||
.p-strawberry-100 {
|
||||
background: #ff8c82;
|
||||
}
|
||||
|
||||
.p-strawberry-300 {
|
||||
background: #ed5353;
|
||||
}
|
||||
|
||||
.p-strawberry-500 {
|
||||
background: #c6262e;
|
||||
}
|
||||
|
||||
.p-strawberry-700 {
|
||||
background: #a10705;
|
||||
}
|
||||
|
||||
.p-strawberry-900 {
|
||||
background: #7a0000;
|
||||
}
|
||||
|
||||
.p-orange {
|
||||
background: #f37329;
|
||||
}
|
||||
|
||||
.p-orange-100 {
|
||||
background: #ffc27d;
|
||||
}
|
||||
|
||||
.p-orange-300 {
|
||||
background: #ffa154;
|
||||
}
|
||||
|
||||
.p-orange-500 {
|
||||
background: #f37329;
|
||||
}
|
||||
|
||||
.p-orange-700 {
|
||||
background: #cc3b02;
|
||||
}
|
||||
|
||||
.p-orange-900 {
|
||||
background: #a62100;
|
||||
}
|
||||
|
||||
.p-banana {
|
||||
background: #f9c440;
|
||||
}
|
||||
|
||||
.p-banana-100 {
|
||||
background: #fff394;
|
||||
}
|
||||
|
||||
.p-banana-300 {
|
||||
background: #ffe16b;
|
||||
}
|
||||
|
||||
.p-banana-500 {
|
||||
background: #f9c440;
|
||||
}
|
||||
|
||||
.p-banana-700 {
|
||||
background: #d48e15;
|
||||
}
|
||||
|
||||
.p-banana-900 {
|
||||
background: #ad5f00;
|
||||
}
|
||||
|
||||
.p-lime {
|
||||
background: #68b723;
|
||||
}
|
||||
|
||||
.p-lime-100 {
|
||||
background: #d1ff82;
|
||||
}
|
||||
|
||||
.p-lime-300 {
|
||||
background: #9bdb4d;
|
||||
}
|
||||
|
||||
.p-lime-500 {
|
||||
background: #68b723;
|
||||
}
|
||||
|
||||
.p-lime-700 {
|
||||
background: #3a9104;
|
||||
}
|
||||
|
||||
.p-lime-900 {
|
||||
background: #206b00;
|
||||
}
|
||||
|
||||
.p-mint {
|
||||
background: #28bca3;
|
||||
}
|
||||
|
||||
.p-mint-100 {
|
||||
background: #89ffdd;
|
||||
}
|
||||
|
||||
.p-mint-300 {
|
||||
background: #43d6b5;
|
||||
}
|
||||
|
||||
.p-mint-500 {
|
||||
background: #28bca3;
|
||||
}
|
||||
|
||||
.p-mint-700 {
|
||||
background: #0e9a83;
|
||||
}
|
||||
|
||||
.p-mint-900 {
|
||||
background: #007367;
|
||||
}
|
||||
|
||||
.p-blueberry {
|
||||
background: #3689e6;
|
||||
}
|
||||
|
||||
.p-blueberry-100 {
|
||||
background: #8cd5ff;
|
||||
}
|
||||
|
||||
.p-blueberry-300 {
|
||||
background: #64baff;
|
||||
}
|
||||
|
||||
.p-blueberry-500 {
|
||||
background: #3689e6;
|
||||
}
|
||||
|
||||
.p-blueberry-700 {
|
||||
background: #0d52bf;
|
||||
}
|
||||
|
||||
.p-blueberry-900 {
|
||||
background: #002e99;
|
||||
}
|
||||
|
||||
.p-grape {
|
||||
background: #a56de2;
|
||||
}
|
||||
|
||||
.p-grape-100 {
|
||||
background: #e4c6fa;
|
||||
}
|
||||
|
||||
.p-grape-300 {
|
||||
background: #cd9ef7;
|
||||
}
|
||||
|
||||
.p-grape-500 {
|
||||
background: #a56de2;
|
||||
}
|
||||
|
||||
.p-grape-700 {
|
||||
background: #7239b3;
|
||||
}
|
||||
|
||||
.p-grape-900 {
|
||||
background: #452981;
|
||||
}
|
||||
|
||||
.p-bubblegum {
|
||||
background: #de3e80;
|
||||
}
|
||||
|
||||
.p-bubblegum-100 {
|
||||
background: #fe9ab8;
|
||||
}
|
||||
|
||||
.p-bubblegum-300 {
|
||||
background: #f4679d;
|
||||
}
|
||||
|
||||
.p-bubblegum-500 {
|
||||
background: #de3e80;
|
||||
}
|
||||
|
||||
.p-bubblegum-700 {
|
||||
background: #bc245d;
|
||||
}
|
||||
|
||||
.p-bubblegum-900 {
|
||||
background: #910e38;
|
||||
}
|
||||
|
||||
.p-cocoa {
|
||||
background: #715344;
|
||||
}
|
||||
|
||||
.p-cocoa-100 {
|
||||
background: #a3907c;
|
||||
}
|
||||
|
||||
.p-cocoa-300 {
|
||||
background: #8a715e;
|
||||
}
|
||||
|
||||
.p-cocoa-500 {
|
||||
background: #715344;
|
||||
}
|
||||
|
||||
.p-cocoa-700 {
|
||||
background: #57392d;
|
||||
}
|
||||
|
||||
.p-cocoa-900 {
|
||||
background: #3d211b;
|
||||
}
|
||||
|
||||
.p-silver {
|
||||
background: #abacae;
|
||||
}
|
||||
|
||||
.p-silver-100 {
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.p-silver-300 {
|
||||
background: #d4d4d4;
|
||||
}
|
||||
|
||||
.p-silver-500 {
|
||||
background: #abacae;
|
||||
}
|
||||
|
||||
.p-silver-700 {
|
||||
background: #7e8087;
|
||||
}
|
||||
|
||||
.p-silver-900 {
|
||||
background: #555761;
|
||||
}
|
||||
|
||||
.p-slate {
|
||||
background: #485a6c;
|
||||
}
|
||||
|
||||
.p-slate-100 {
|
||||
background: #95a3ab;
|
||||
}
|
||||
|
||||
.p-slate-300 {
|
||||
background: #667885;
|
||||
}
|
||||
|
||||
.p-slate-500 {
|
||||
background: #485a6c;
|
||||
}
|
||||
|
||||
.p-slate-700 {
|
||||
background: #273445;
|
||||
}
|
||||
|
||||
.p-slate-900 {
|
||||
background: #0e141f;
|
||||
}
|
||||
|
||||
.p-dark {
|
||||
background: #333;
|
||||
}
|
||||
|
||||
.p-dark-100 {
|
||||
background: #666;
|
||||
/* hehe */
|
||||
}
|
||||
|
||||
.p-dark-300 {
|
||||
background: #4d4d4d;
|
||||
}
|
||||
|
||||
.p-dark-500 {
|
||||
background: #333;
|
||||
}
|
||||
|
||||
.p-dark-700 {
|
||||
background: #1a1a1a;
|
||||
}
|
||||
|
||||
.p-dark-900 {
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.p-white{
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.p-strawberry-color {
|
||||
color: #c6262e;
|
||||
}
|
||||
|
||||
.p-strawberry-100-color {
|
||||
color: #ff8c82;
|
||||
}
|
||||
|
||||
.p-strawberry-300-color {
|
||||
color: #ed5353;
|
||||
}
|
||||
|
||||
.p-strawberry-500-color {
|
||||
color: #c6262e;
|
||||
}
|
||||
|
||||
.p-strawberry-700-color {
|
||||
color: #a10705;
|
||||
}
|
||||
|
||||
.p-strawberry-900-color {
|
||||
color: #7a0000;
|
||||
}
|
||||
|
||||
.p-orange-color {
|
||||
color: #f37329;
|
||||
}
|
||||
|
||||
.p-orange-100-color {
|
||||
color: #ffc27d;
|
||||
}
|
||||
|
||||
.p-orange-300-color {
|
||||
color: #ffa154;
|
||||
}
|
||||
|
||||
.p-orange-500-color {
|
||||
color: #f37329;
|
||||
}
|
||||
|
||||
.p-orange-700-color {
|
||||
color: #cc3b02;
|
||||
}
|
||||
|
||||
.p-orange-900-color {
|
||||
color: #a62100;
|
||||
}
|
||||
|
||||
.p-banana-color {
|
||||
color: #f9c440;
|
||||
}
|
||||
|
||||
.p-banana-100-color {
|
||||
color: #fff394;
|
||||
}
|
||||
|
||||
.p-banana-300-color {
|
||||
color: #ffe16b;
|
||||
}
|
||||
|
||||
.p-banana-500-color {
|
||||
color: #f9c440;
|
||||
}
|
||||
|
||||
.p-banana-700-color {
|
||||
color: #d48e15;
|
||||
}
|
||||
|
||||
.p-banana-900-color {
|
||||
color: #ad5f00;
|
||||
}
|
||||
|
||||
.p-lime-color {
|
||||
color: #68b723;
|
||||
}
|
||||
|
||||
.p-lime-100-color {
|
||||
color: #d1ff82;
|
||||
}
|
||||
|
||||
.p-lime-300-color {
|
||||
color: #9bdb4d;
|
||||
}
|
||||
|
||||
.p-lime-500-color {
|
||||
color: #68b723;
|
||||
}
|
||||
|
||||
.p-lime-700-color {
|
||||
color: #3a9104;
|
||||
}
|
||||
|
||||
.p-lime-900-color {
|
||||
color: #206b00;
|
||||
}
|
||||
|
||||
.p-mint-color {
|
||||
color: #28bca3;
|
||||
}
|
||||
|
||||
.p-mint-100-color {
|
||||
color: #89ffdd;
|
||||
}
|
||||
|
||||
.p-mint-300-color {
|
||||
color: #43d6b5;
|
||||
}
|
||||
|
||||
.p-mint-500-color {
|
||||
color: #28bca3;
|
||||
}
|
||||
|
||||
.p-mint-700-color {
|
||||
color: #0e9a83;
|
||||
}
|
||||
|
||||
.p-mint-900-color {
|
||||
color: #007367;
|
||||
}
|
||||
|
||||
.p-blueberry-color {
|
||||
color: #3689e6;
|
||||
}
|
||||
|
||||
.p-blueberry-100-color {
|
||||
color: #8cd5ff;
|
||||
}
|
||||
|
||||
.p-blueberry-300-color {
|
||||
color: #64baff;
|
||||
}
|
||||
|
||||
.p-blueberry-500-color {
|
||||
color: #3689e6;
|
||||
}
|
||||
|
||||
.p-blueberry-700-color {
|
||||
color: #0d52bf;
|
||||
}
|
||||
|
||||
.p-blueberry-900-color {
|
||||
color: #002e99;
|
||||
}
|
||||
|
||||
.p-grape-color {
|
||||
color: #a56de2;
|
||||
}
|
||||
|
||||
.p-grape-100-color {
|
||||
color: #e4c6fa;
|
||||
}
|
||||
|
||||
.p-grape-300-color {
|
||||
color: #cd9ef7;
|
||||
}
|
||||
|
||||
.p-grape-500-color {
|
||||
color: #a56de2;
|
||||
}
|
||||
|
||||
.p-grape-700-color {
|
||||
color: #7239b3;
|
||||
}
|
||||
|
||||
.p-grape-900-color {
|
||||
color: #452981;
|
||||
}
|
||||
|
||||
.p-bubblegum-color {
|
||||
color: #de3e80;
|
||||
}
|
||||
|
||||
.p-bubblegum-100-color {
|
||||
color: #fe9ab8;
|
||||
}
|
||||
|
||||
.p-bubblegum-300-color {
|
||||
color: #f4679d;
|
||||
}
|
||||
|
||||
.p-bubblegum-500-color {
|
||||
color: #de3e80;
|
||||
}
|
||||
|
||||
.p-bubblegum-700-color {
|
||||
color: #bc245d;
|
||||
}
|
||||
|
||||
.p-bubblegum-900-color {
|
||||
color: #910e38;
|
||||
}
|
||||
|
||||
.p-cocoa-color {
|
||||
color: #715344;
|
||||
}
|
||||
|
||||
.p-cocoa-100-color {
|
||||
color: #a3907c;
|
||||
}
|
||||
|
||||
.p-cocoa-300-color {
|
||||
color: #8a715e;
|
||||
}
|
||||
|
||||
.p-cocoa-500-color {
|
||||
color: #715344;
|
||||
}
|
||||
|
||||
.p-cocoa-700-color {
|
||||
color: #57392d;
|
||||
}
|
||||
|
||||
.p-cocoa-900-color {
|
||||
color: #3d211b;
|
||||
}
|
||||
|
||||
.p-silver-color {
|
||||
color: #abacae;
|
||||
}
|
||||
|
||||
.p-silver-100-color {
|
||||
color: #fafafa;
|
||||
}
|
||||
|
||||
.p-silver-300-color {
|
||||
color: #d4d4d4;
|
||||
}
|
||||
|
||||
.p-silver-500-color {
|
||||
color: #abacae;
|
||||
}
|
||||
|
||||
.p-silver-700-color {
|
||||
color: #7e8087;
|
||||
}
|
||||
|
||||
.p-silver-900-color {
|
||||
color: #555761;
|
||||
}
|
||||
|
||||
.p-slate-color {
|
||||
color: #485a6c;
|
||||
}
|
||||
|
||||
.p-slate-100-color {
|
||||
color: #95a3ab;
|
||||
}
|
||||
|
||||
.p-slate-300-color {
|
||||
color: #667885;
|
||||
}
|
||||
|
||||
.p-slate-500-color {
|
||||
color: #485a6c;
|
||||
}
|
||||
|
||||
.p-slate-700-color {
|
||||
color: #273445;
|
||||
}
|
||||
|
||||
.p-slate-900-color {
|
||||
color: #0e141f;
|
||||
}
|
||||
|
||||
.p-dark-color {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.p-dark-100-color {
|
||||
color: #666;
|
||||
/* hehe */
|
||||
}
|
||||
|
||||
.p-dark-300-color {
|
||||
color: #4d4d4d;
|
||||
}
|
||||
|
||||
.p-dark-500-color {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.p-dark-700-color {
|
||||
color: #1a1a1a;
|
||||
}
|
||||
|
||||
.p-dark-900-color {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.p-white-color{
|
||||
color: #fff;
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
/* Puppertino dark_mode placeholder - local vendored */
|
||||
509
v3/examples/android/frontend/public/puppertino/css/forms.css
Normal file
|
|
@ -0,0 +1,509 @@
|
|||
:root {
|
||||
--primary-col:linear-gradient(to bottom, #4fc5fa 0%,#0f75f5 100%);
|
||||
--primary-col-ac:#0f75f5;
|
||||
--bg-color-input:#fff;
|
||||
|
||||
--p-checkbox-gradient: linear-gradient(180deg, #4B91F7 0%, #367AF6 100%);
|
||||
--p-checkbox-border: rgba(0, 0, 0, 0.2);
|
||||
--p-checkbox-border-active: rgba(0, 0, 0, 0.12);
|
||||
--p-checkbox-bg: transparent;
|
||||
--p-checkbox-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.15), inset 0px 0px 2px rgba(0, 0, 0, 0.10);
|
||||
|
||||
--p-input-bg:#fff;
|
||||
--p-input-color: rgba(0,0,0,.85);
|
||||
--p-input-color-plac:rgba(0,0,0,0.25);
|
||||
|
||||
--p-input-color:#808080;
|
||||
--p-input-bd:rgba(0,0,0,0.15);
|
||||
--bg-hover-color:#f9f9f9;
|
||||
--bg-front-col:#000;
|
||||
--invalid-color:#d6513c;
|
||||
--valid-color:#94d63c;
|
||||
}
|
||||
|
||||
.p-dark-mode{
|
||||
--p-checkbox-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.13) 100%);
|
||||
--p-checkbox-shadow: 0px 0px 1px rgba(0, 0, 0, 0.25), inset 0px 0.5px 0px rgba(255, 255, 255, 0.15);
|
||||
--p-checkbox-border: rgba(0, 0, 0, 0);
|
||||
|
||||
--p-checkbox-gradient: linear-gradient(180deg, #3168DD 0%, #2C5FC8 100%);
|
||||
--p-checkbox-border-active: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.p-form-select {
|
||||
border-radius: 5px;
|
||||
display: inline-block;
|
||||
font-family: -apple-system, "Inter", sans-serif;
|
||||
margin: 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.p-form-select > select:focus{
|
||||
outline: 2px solid #64baff;
|
||||
}
|
||||
|
||||
.p-form-select::after {
|
||||
background: url("data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M.288 4.117 3.16 1.18c.168-.168.336-.246.54-.246a.731.731 0 0 1 .538.246L7.108 4.12c.125.121.184.27.184.45 0 .359-.293.656-.648.656a.655.655 0 0 1-.48-.211L3.701 2.465l-2.469 2.55a.664.664 0 0 1-.48.212.656.656 0 0 1-.465-1.11Zm3.41 7.324a.73.73 0 0 0 .54-.246l2.87-2.941a.601.601 0 0 0 .184-.45.656.656 0 0 0-.648-.656.677.677 0 0 0-.48.211L3.701 9.91 1.233 7.36a.68.68 0 0 0-.48-.212.656.656 0 0 0-.465 1.11l2.871 2.937c.172.168.336.246.54.246Z' fill='white' style='mix-blend-mode:luminosity'/%3E%3C/svg%3E"), #017AFF;
|
||||
background-size: 100% 75%;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
border-radius: 5px;
|
||||
bottom: 0;
|
||||
content: "";
|
||||
display: block;
|
||||
height: 80%;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
right: 3%;
|
||||
top: 10%;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.p-form-select > select {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
background: var(--p-input-bg);
|
||||
border: 1px solid var(--p-input-bd);
|
||||
border-radius: 5px;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
outline: none;
|
||||
padding: 5px 35px 5px 10px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
color: var(--p-input-color);
|
||||
}
|
||||
|
||||
.p-form-text:invalid,
|
||||
.p-form-text-alt:invalid{
|
||||
border-color: var(--invalid-color);
|
||||
}
|
||||
|
||||
.p-form-text:valid,
|
||||
.p-form-text-alt:valid{
|
||||
border-color: var(--valid-color);
|
||||
}
|
||||
|
||||
.p-form-text:placeholder-shown,
|
||||
.p-form-text-alt:placeholder-shown{
|
||||
border-color: var(--p-input-bd);
|
||||
}
|
||||
|
||||
.p-form-text {
|
||||
color: var(--p-input-color);
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
background: var(--p-input-bg);
|
||||
border: 1px solid var(--p-input-bd);
|
||||
border-radius: 5px;
|
||||
font-family: -apple-system, "Inter", sans-serif;
|
||||
font-size: 13px;
|
||||
margin: 10px;
|
||||
outline: 0;
|
||||
padding: 3px 7px;
|
||||
resize: none;
|
||||
transition: border-color 200ms;
|
||||
box-shadow: 0px 0.5px 2.5px rgba(0,0,0,.3), 0px 0px 0px rgba(0,0,0,.1);
|
||||
}
|
||||
|
||||
.p-form-text-alt {
|
||||
color: var(--p-input-color);
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
box-shadow: none;
|
||||
background: var(--p-input-bg);
|
||||
border: 0px;
|
||||
border-bottom: 2px solid var(--p-input-bd);
|
||||
padding: 10px;
|
||||
border-top-left-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.p-form-text-alt::placeholder,
|
||||
.p-form-text::placeholder
|
||||
{
|
||||
color: var(--p-input-color-plac);
|
||||
}
|
||||
|
||||
.p-form-text:active,
|
||||
.p-form-text:focus
|
||||
{
|
||||
outline: 3px solid rgb(0 122 255 / 50%);
|
||||
}
|
||||
|
||||
.p-form-text-alt:focus {
|
||||
outline: 0;
|
||||
outline: 3px solid rgb(0 122 255 / 50%);
|
||||
border-color: #3689e6;
|
||||
}
|
||||
|
||||
.p-form-no-validate:valid,
|
||||
.p-form-no-validate:invalid{
|
||||
border-color: var(--p-input-bd);
|
||||
color: var(--p-input-color)!important;
|
||||
}
|
||||
|
||||
.p-form-text:focus {
|
||||
border-color: rgb(0 122 255);
|
||||
}
|
||||
|
||||
textarea.p-form-text {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.p-form-truncated {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.p-form-text[type=password] {
|
||||
font-family: caption;
|
||||
}
|
||||
|
||||
.p-form-label,
|
||||
.p-form-radio-cont,
|
||||
.p-form-checkbox-cont,
|
||||
.p-form-label-inline {
|
||||
font-family: -apple-system, "Inter", sans-serif;
|
||||
}
|
||||
|
||||
.p-form-label, .p-form-label-inline {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.p-form-label{
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.p-form-label-inline {
|
||||
background: var(--p-input-bg);
|
||||
padding: 5px;
|
||||
border-bottom: 2px solid var(--p-input-bd);
|
||||
color: #656565;
|
||||
font-weight: 500;
|
||||
transition: .3s;
|
||||
}
|
||||
|
||||
.p-form-label-inline:focus-within {
|
||||
color: #3689e6;
|
||||
border-color: #3689e6;
|
||||
}
|
||||
|
||||
.p-form-label-inline > .p-form-text-alt {
|
||||
border-bottom: 0px;
|
||||
padding: 0;
|
||||
outline: 0;
|
||||
background: var(--p-input-bg);
|
||||
|
||||
}
|
||||
|
||||
.p-form-label-inline > .p-form-text-alt:-webkit-autofill{
|
||||
background: var(--p-input-bg);
|
||||
-webkit-box-shadow: 0 0 0 30px rgba(0,0,0,0) inset !important;
|
||||
}
|
||||
|
||||
.p-form-label-inline > .p-form-text-alt:invalid {
|
||||
color: var(--invalid-color);
|
||||
}
|
||||
|
||||
.p-form-label-inline > .p-form-text-alt:valid {
|
||||
color: #3689e6;
|
||||
}
|
||||
|
||||
.p-form-label-inline > .p-form-text-alt:focus{
|
||||
color: var(--p-input-color);
|
||||
}
|
||||
|
||||
.p-form-radio-cont,
|
||||
.p-form-checkbox-cont {
|
||||
align-items: center;
|
||||
display: inline-flex;
|
||||
cursor: pointer;
|
||||
margin: 0 10px;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.p-form-radio-cont > input + span,
|
||||
.p-form-checkbox-cont > input + span {
|
||||
background: var(--p-input-bg);
|
||||
border: 1px solid var(--p-input-bd);
|
||||
border-radius: 50%;
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
margin-right: 5px;
|
||||
position: relative;
|
||||
transition: 0.2s;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.p-form-radio-cont > input + span{
|
||||
box-shadow: inset 0px 1px 2px rgba(0,0,0,0.10), inset 0px 0px 2px rgba(0,0,0,0.10);
|
||||
}
|
||||
|
||||
.p-form-radio-cont > input:focus + span,
|
||||
.p-form-checkbox-cont > input:focus + span{
|
||||
outline: 3px solid rgb(0 122 255 / 50%);
|
||||
}
|
||||
|
||||
.p-form-radio-cont:hover > input + span{
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
.p-form-radio-cont > input,
|
||||
.p-form-checkbox-cont > input {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.p-form-radio-cont > input + span::after {
|
||||
background: #fff;
|
||||
border-radius: 50%;
|
||||
content: "";
|
||||
display: block;
|
||||
height: 30%;
|
||||
left: calc(50% - 15%);
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
top: calc(50% - 15%);
|
||||
transform: scale(2);
|
||||
transition: opacity 0.2s, transform 0.3s;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.p-form-radio-cont > input:checked + span {
|
||||
background: #0f75f5;
|
||||
box-shadow: 0px 1px 2.5px 1px rgba(0, 122, 255, 0.24), inset 0px 0px 0px 0.5px rgba(0, 122, 255, 0.12);
|
||||
}
|
||||
|
||||
.p-form-radio-cont > input:checked + span::after {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
.p-form-checkbox-cont > input + span {
|
||||
border-radius: 5px;
|
||||
box-shadow: var(--p-checkbox-shadow);
|
||||
border: 0.5px solid var(--p-checkbox-border);
|
||||
background: var(--p-checkbox-bg)
|
||||
}
|
||||
|
||||
.p-form-checkbox-cont > input:checked + span {
|
||||
background: var(--p-checkbox-gradient);
|
||||
border: 0.5px solid var(--p-checkbox-border-active);
|
||||
box-shadow: 0px 1px 2.5px rgba(0, 122, 255, 0.24), 0px 0px 0px 0.5px rgba(0, 122, 255, 0.12);
|
||||
}
|
||||
|
||||
.p-form-checkbox-cont > input + span::before{
|
||||
content: "";
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
left: 0%;
|
||||
top: 0%;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s;
|
||||
background-image: url("data:image/svg+xml,%3Csvg width='10' height='8' viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.10791 7.81299C3.83545 7.81299 3.6084 7.70459 3.42676 7.48779L1.15918 4.74121C1.08008 4.65039 1.02441 4.5625 0.992188 4.47754C0.959961 4.39258 0.943848 4.30469 0.943848 4.21387C0.943848 4.00586 1.0127 3.83447 1.15039 3.69971C1.29102 3.56201 1.4668 3.49316 1.67773 3.49316C1.91211 3.49316 2.10693 3.58838 2.26221 3.77881L4.10791 6.04297L7.68066 0.368652C7.77148 0.230957 7.86523 0.134277 7.96191 0.0786133C8.06152 0.0200195 8.18311 -0.00927734 8.32666 -0.00927734C8.5376 -0.00927734 8.71191 0.0581055 8.84961 0.192871C8.9873 0.327637 9.05615 0.497559 9.05615 0.702637C9.05615 0.778809 9.04297 0.85791 9.0166 0.939941C8.99023 1.02197 8.94922 1.10693 8.89355 1.19482L4.80225 7.45703C4.64111 7.69434 4.40967 7.81299 4.10791 7.81299Z' fill='white'/%3E%3C/svg%3E%0A");
|
||||
background-size: 70%;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.p-form-checkbox-cont > input + span::after{
|
||||
content: '';
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.p-form-checkbox-cont > input + span:active::after{
|
||||
border-radius: 5px;
|
||||
backdrop-filter: brightness(1.2);
|
||||
}
|
||||
|
||||
.p-form-checkbox-cont > input:checked + span::before{
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
.p-form-checkbox-cont > input[disabled] + span,
|
||||
.p-form-radio-cont > input[disabled] ~ span
|
||||
{
|
||||
opacity: .7;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.p-form-button {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
background: #fff;
|
||||
border: 1px solid var(--p-input-bd);
|
||||
border-radius: 5px;
|
||||
color: #333230;
|
||||
display: inline-block;
|
||||
font-size: 17px;
|
||||
margin: 10px;
|
||||
padding: 5px 20px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.p-form-send {
|
||||
background: linear-gradient(to bottom, #4fc5fa 0%, #0f75f5 100%);
|
||||
border: 0;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.p-form-send:active {
|
||||
background: #0f75f5;
|
||||
}
|
||||
|
||||
.p-form-invalid,
|
||||
.p-form-invalid:placeholder-shown,
|
||||
.p-form-invalid:valid,
|
||||
.p-form-invalid:invalid {
|
||||
border-color: var(--invalid-color);
|
||||
}
|
||||
|
||||
.p-form-valid,
|
||||
.p-form-valid:placeholder-shown,
|
||||
.p-form-valid:valid,
|
||||
.p-form-valid:invalid {
|
||||
border-color: var(--valid-color);
|
||||
}
|
||||
|
||||
.p-form-switch {
|
||||
--width: 80px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.p-form-switch > input:checked + span::after {
|
||||
left: calc(100% - calc(var(--width) / 1.8));
|
||||
}
|
||||
|
||||
.p-form-switch > input:checked + span {
|
||||
background: #60c35b;
|
||||
}
|
||||
|
||||
.p-form-switch > span {
|
||||
background: #e0e0e0;
|
||||
border: 1px solid #d3d3d3;
|
||||
border-radius: 500px;
|
||||
display: block;
|
||||
height: calc(var(--width) / 1.6);
|
||||
position: relative;
|
||||
transition: all 0.2s;
|
||||
width: var(--width);
|
||||
}
|
||||
|
||||
.p-form-switch > span::after {
|
||||
background: #f9f9f9;
|
||||
border-radius: 50%;
|
||||
border: 0.5px solid rgba(0, 0, 0, 0.101987);
|
||||
box-shadow: 0px 3px 1px rgba(0, 0, 0, 0.1), 0px 1px 1px rgba(0, 0, 0, 0.16), 0px 3px 8px rgba(0, 0, 0, 0.15);
|
||||
box-sizing: border-box;
|
||||
content: "";
|
||||
height: 84%;
|
||||
left: 3%;
|
||||
position: absolute;
|
||||
top: 6.5%;
|
||||
transition: all 0.2s;
|
||||
width: 52.5%;
|
||||
}
|
||||
|
||||
.p-form-switch > input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.p-chip input{
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.p-chip span{
|
||||
padding: .8rem 1rem;
|
||||
border-radius: 1.6rem;
|
||||
display:inline-block;
|
||||
margin:10px;
|
||||
background: #e4e4e4ca;
|
||||
color: #3689e6;
|
||||
transition: .3s;
|
||||
user-select: none;
|
||||
cursor:pointer;
|
||||
font-family: -apple-system, "Inter", sans-serif;
|
||||
font-size: 1rem;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
-moz-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.p-chip:focus-within span{
|
||||
outline: 2px solid #64baff;
|
||||
}
|
||||
|
||||
.p-chip svg{
|
||||
display:block;
|
||||
margin:auto;
|
||||
}
|
||||
|
||||
|
||||
.p-chip input:checked + span{
|
||||
background: #3689e6;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
.p-chip-outline span, .p-chip-outline-to-bg span{
|
||||
background: transparent;
|
||||
color: #3e3e3e;
|
||||
border: 1px solid currentColor;
|
||||
}
|
||||
|
||||
.p-chip-outline input:checked + span{
|
||||
background: transparent;
|
||||
color: #3689e6;
|
||||
}
|
||||
|
||||
.p-chip-radius-b span{
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.p-chip-dark span{
|
||||
color: #3e3e3e;
|
||||
}
|
||||
|
||||
.p-chip-dark input:checked + span{
|
||||
background: #3e3e3e;
|
||||
}
|
||||
|
||||
.p-chip input:disabled + span,
|
||||
.p-chip input[disabled] + span{
|
||||
opacity: .5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.p-chip-big span{
|
||||
font-size: 1.3rem;
|
||||
padding: 1.5rem;
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
.p-form-checkbox-cont[disabled],
|
||||
.p-form-label[disabled],
|
||||
.p-form-text[disabled],
|
||||
.p-form-text-alt[disabled],
|
||||
.p-form-select[disabled],
|
||||
.p-form-radio-cont[disabled]{
|
||||
filter: grayscale(1) opacity(.3);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
.p-large-title{
|
||||
font-size: 2.75rem;
|
||||
}
|
||||
|
||||
.p-layout h1 {
|
||||
font-size: 2.25rem;
|
||||
}
|
||||
|
||||
.p-layout h2 {
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
|
||||
.p-layout h3 {
|
||||
font-size: 1.58rem;
|
||||
}
|
||||
|
||||
.p-headline {
|
||||
font-size: 1.34rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.p-layout p {
|
||||
font-size: 1.15rem;
|
||||
}
|
||||
|
||||
.p-layout .link,
|
||||
.p-layout input {
|
||||
font-size: 0.813rem;
|
||||
}
|
||||
|
||||
.p-callout {
|
||||
font-size: 1.14rem;
|
||||
}
|
||||
|
||||
.p-subhead {
|
||||
font-size: 1.167rem;
|
||||
}
|
||||
|
||||
.p-footnote {
|
||||
font-size: 1.07rem;
|
||||
}
|
||||
|
||||
.p-caption {
|
||||
font-size: 0.91rem;
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
/* Puppertino modals placeholder - local vendored */
|
||||