wails/v3/examples
Atterpac 10447e6fcd
[V3] Drag-n-Drop Zones and improvements (#4318)
* new events

* macOS dnd improvements

* wailsio adds for dropzone

* update example

* sorta working

the top 300px of the window are not dropabble for some reason i suspect it has to do with the drag enter/drag leave xy as the performOperation needed to use the ContentView for appropriate X/Y

* implement attribute detection for data-wails-dropzone

* docs

* pass x/y dnd linux

* cleanup exmample

* changelog

* pass all attributes to golang on dragdrop

* filetree example

* fix dnd build windows

* Fix windows dnd

* update docs

* remove debug log

* appease the security bot

* Fix changelog

* Fix changelog

* Revert "Fix event generation issues."

This reverts commit ae4ed4fe

* Fix events

* Fix merge conflicts. Fix events generation formatting

* Update docs

* Fix duplicate bundledassets import causing build failures

Remove duplicate import of bundledassets package that was causing
compilation errors in PR #4318. The import was declared twice in
the same import block, causing "bundledassets redeclared" errors.

Fixes build issues in GitHub Actions for drag-and-drop zones feature.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Replace fmt.Printf debug statements with globalApplication.debug

Replace all fmt.Printf debug logging statements in drag-and-drop
functionality with proper globalApplication.debug calls. This provides:

- Consistent logging with the rest of the application
- Proper key-value structured logging
- Better integration with the application's logging system
- Cleaner debug output format

Changes:
- application_darwin.go: Replace 2 fmt.Printf calls
- webview_window.go: Replace 6 fmt.Printf calls
- webview_window_windows.go: Replace 13 fmt.Printf calls
- Remove unused fmt import from application_darwin.go

All debug messages maintain the same information but now use
structured logging with key-value pairs instead of printf formatting.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Add nil checks to WindowEventContext methods

Ensure all WindowEventContext methods properly handle nil c.data
by initializing the map when it's nil. This prevents panics when
methods are called on contexts that haven't been properly initialized.

Changes:
- DroppedFiles(): Add nil check and map initialization
- setCoordinates(): Add nil check and map initialization
- setDropZoneDetails(): Add nil check and map initialization
- DropZoneDetails(): Add nil check and map initialization

All methods now follow the same pattern as setDroppedFiles()
where a nil data map is automatically initialized to prevent
runtime panics during drag-and-drop operations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update v3/pkg/application/webview_window_darwin.m

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* reinstate events docs.

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-08-04 20:40:19 +10:00
..
badge [v3] improve service names for js/ts bindings (#4405) 2025-07-25 09:23:22 +10:00
badge-custom [v3] improve service names for js/ts bindings (#4405) 2025-07-25 09:23:22 +10:00
binding Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
build Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
cancel-async Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
cancel-chaining Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
clipboard Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
contextmenus Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
custom-protocol-example fix custom protocol example to new api 2025-07-12 19:13:13 -06:00
dev Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
dialogs Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
dialogs-basic Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
drag-n-drop [V3] Drag-n-Drop Zones and improvements (#4318) 2025-08-04 20:40:19 +10:00
environment Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
events Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
events-bug Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
file-association Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
frameless window.ToggleFrameless() api (#4317) 2025-07-15 22:53:21 +10:00
gin-example Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
gin-routing Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
gin-service Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
hide-window Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
html-dnd-api Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
ignore-mouse Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
keybindings Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
menu Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
notifications [v3] improve service names for js/ts bindings (#4405) 2025-07-25 09:23:22 +10:00
panic-handling Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
plain Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
raw-message Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
screen Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
services Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
show-macos-toolbar Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
single-instance Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
systray-basic Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
systray-custom Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
systray-menu Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
video Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
window feature: V3 alpha feature/snapassist support (#4463) 2025-08-02 16:59:49 +10:00
window-api Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
window-call Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
window-menu Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
wml Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
linux_status.org add linux status for examples 2023-11-06 10:49:14 -06:00
README.md Improve documentation 2023-12-13 22:40:35 +11:00

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>