Skip to content

Commit b3e81f5

Browse files
committed
BREAKING CHANGE: wml attributes are now prefixed with data-
1 parent 939e2da commit b3e81f5

File tree

32 files changed

+80
-81
lines changed

32 files changed

+80
-81
lines changed

v3/examples/file-association/frontend/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<body>
1111
<div class="container">
1212
<div>
13-
<a wml-openURL="https://wails.io">
13+
<a data-wml-openURL="https://wails.io">
1414
<img src="/wails.png" class="logo" alt="Wails logo"/>
1515
</a>
16-
<a wml-openURL="https://developer.mozilla.org/en-US/docs/Web/JavaScript">
16+
<a data-wml-openURL="https://developer.mozilla.org/en-US/docs/Web/JavaScript">
1717
<img src="/javascript.svg" class="logo vanilla" alt="JavaScript logo"/>
1818
</a>
1919
</div>

v3/examples/plain/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func main() {
1919
Assets: application.AssetOptions{
2020
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
2121
w.WriteHeader(http.StatusOK)
22-
w.Write([]byte(`<html><head><title>Plain Bundle</title><script type="module" src="/wails/runtime.js"></script></head><body><div class="main"><h1>Plain Bundle</h1><p>This is a plain bundle. It has no frontend code but this was Served by the AssetServer's Handler.</p><br/><br/><p wml-event="clicked">Clicking this paragraph emits an event...<p></div></body></html>`))
22+
w.Write([]byte(`<html><head><title>Plain Bundle</title><script type="module" src="/wails/runtime.js"></script></head><body><div class="main"><h1>Plain Bundle</h1><p>This is a plain bundle. It has no frontend code but this was Served by the AssetServer's Handler.</p><br/><br/><p data-wml-event="clicked">Clicking this paragraph emits an event...<p></div></body></html>`))
2323
}),
2424
},
2525
})

v3/examples/window-api/assets/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

v3/examples/wml/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# WML Example
22

3-
This is an example of how to use the experimental WML, which provides HTMX style calling of the runtime API.
3+
This is an example of how to use the experimental WML, which provides HTMX style calling of the Wails JS API.
44

55
## Running the example
66

v3/examples/wml/assets/index.html

Lines changed: 14 additions & 14 deletions
Large diffs are not rendered by default.

v3/internal/assetserver/bundledassets/runtime.debug.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

v3/internal/assetserver/bundledassets/runtime.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

v3/internal/runtime/desktop/@wailsio/runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@wailsio/runtime",
33
"type": "module",
4-
"version": "3.0.0-alpha.39",
4+
"version": "3.0.0-alpha.40",
55
"description": "Wails Runtime",
66
"types": "types/index.d.ts",
77
"exports": {

v3/internal/runtime/desktop/@wailsio/runtime/src/wml.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ function onWMLTriggered(ev) {
6060
if (choice !== "Yes")
6161
return;
6262

63-
const eventType = element.getAttribute('wml-event');
64-
const targetWindow = element.getAttribute('wml-target-window') || "";
65-
const windowMethod = element.getAttribute('wml-window');
66-
const url = element.getAttribute('wml-openurl');
63+
const eventType = element.getAttribute('data-wml-event');
64+
const targetWindow = element.getAttribute('data-wml-target-window') || "";
65+
const windowMethod = element.getAttribute('data-wml-window');
66+
const url = element.getAttribute('data-wml-openURL');
6767

6868
if (eventType !== null)
6969
sendEvent(eventType);
@@ -73,7 +73,7 @@ function onWMLTriggered(ev) {
7373
void OpenURL(url);
7474
}
7575

76-
const confirm = element.getAttribute('wml-confirm');
76+
const confirm = element.getAttribute('data-wml-confirm');
7777

7878
if (confirm) {
7979
Question({
@@ -218,7 +218,7 @@ const triggerRegistry = canAbortListeners() ? new AbortControllerRegistry() : ne
218218
*/
219219
function addWMLListeners(element) {
220220
const triggerRegExp = /\S+/g;
221-
const triggerAttr = (element.getAttribute('wml-trigger') || "click");
221+
const triggerAttr = (element.getAttribute('data-wml-trigger') || "click");
222222
const triggers = [];
223223

224224
let match;
@@ -246,5 +246,5 @@ export function Enable() {
246246
*/
247247
export function Reload() {
248248
triggerRegistry.reset();
249-
document.body.querySelectorAll('[wml-event], [wml-window], [wml-openurl]').forEach(addWMLListeners);
249+
document.body.querySelectorAll('[data-wml-event], [data-wml-window], [data-wml-openURL]').forEach(addWMLListeners);
250250
}

v3/internal/templates/base/frontend/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<body>
1111
<div class="container">
1212
<div>
13-
<a wml-openURL="https://wails.io">
13+
<a data-wml-openURL="https://wails.io">
1414
<img src="/wails.png" class="logo" alt="Wails logo"/>
1515
</a>
16-
<a wml-openURL="https://developer.mozilla.org/en-US/docs/Web/JavaScript">
16+
<a data-wml-openURL="https://developer.mozilla.org/en-US/docs/Web/JavaScript">
1717
<img src="/javascript.svg" class="logo vanilla" alt="JavaScript logo"/>
1818
</a>
1919
</div>

v3/internal/templates/lit-ts/frontend/src/my-element.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ export class MyElement extends LitElement {
4545
return html`
4646
<div class="container">
4747
<div>
48-
<a wml-openURL="https://wails.io">
48+
<a data-wml-openURL="https://wails.io">
4949
<img src="/wails.png" class="logo" alt="Wails logo"/>
5050
</a>
51-
<a wml-openURL="https://lit.dev">
51+
<a data-wml-openURL="https://lit.dev">
5252
<img src="/lit.svg" class="logo lit" alt="Lit logo"/>
5353
</a>
5454
</div>

v3/internal/templates/lit/frontend/src/my-element.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ export class MyElement extends LitElement {
3535
return html`
3636
<div class="container">
3737
<div>
38-
<a wml-openURL="https://wails.io">
38+
<a data-wml-openURL="https://wails.io">
3939
<img src="/wails.png" class="logo" alt="Wails logo"/>
4040
</a>
41-
<a wml-openURL="https://lit.dev">
41+
<a data-wml-openURL="https://lit.dev">
4242
<img src="/lit.svg" class="logo lit" alt="Lit logo"/>
4343
</a>
4444
</div>

v3/internal/templates/preact-ts/frontend/src/app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ export function App() {
2929
<>
3030
<div className="container">
3131
<div>
32-
<a wml-openURL="https://wails.io">
32+
<a data-wml-openURL="https://wails.io">
3333
<img src="/wails.png" className="logo" alt="Wails logo"/>
3434
</a>
35-
<a wml-openURL="https://preactjs.com">
35+
<a data-wml-openURL="https://preactjs.com">
3636
<img src="/preact.svg" className="logo preact" alt="Preact logo"/>
3737
</a>
3838
</div>

v3/internal/templates/preact/frontend/src/app.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ export function App() {
2828
return (
2929
<div className="container">
3030
<div>
31-
<a wml-openURL="https://wails.io">
31+
<a data-wml-openURL="https://wails.io">
3232
<img src="/wails.png" className="logo" alt="Wails logo"/>
3333
</a>
34-
<a wml-openURL="https://preactjs.com">
34+
<a data-wml-openURL="https://preactjs.com">
3535
<img src="/preact.svg" className="logo preact" alt="Preact logo"/>
3636
</a>
3737
</div>

v3/internal/templates/qwik-ts/frontend/src/app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export const App = component$(() => {
3030
return (
3131
<div class="container">
3232
<div>
33-
<a wml-openURL="https://wails.io">
33+
<a data-wml-openURL="https://wails.io">
3434
<img src="/wails.png" class="logo" alt="Wails logo"/>
3535
</a>
36-
<a wml-openURL="https://qwik.builder.io">
36+
<a data-wml-openURL="https://qwik.builder.io">
3737
<img src="/qwik.svg" class="logo qwik" alt="Qwik logo"/>
3838
</a>
3939
</div>

v3/internal/templates/qwik/frontend/src/app.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export const App = component$(() => {
3030
return (
3131
<div class="container">
3232
<div>
33-
<a wml-openURL="https://wails.io">
33+
<a data-wml-openURL="https://wails.io">
3434
<img src="/wails.png" class="logo" alt="Wails logo"/>
3535
</a>
36-
<a wml-openURL="https://qwik.builder.io">
36+
<a data-wml-openURL="https://qwik.builder.io">
3737
<img src="/qwik.svg" class="logo qwik" alt="Qwik logo"/>
3838
</a>
3939
</div>

v3/internal/templates/react-swc-ts/frontend/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ function App() {
3030
return (
3131
<div className="container">
3232
<div>
33-
<a wml-openURL="https://wails.io">
33+
<a data-wml-openURL="https://wails.io">
3434
<img src="/wails.png" className="logo" alt="Wails logo"/>
3535
</a>
36-
<a wml-openURL="https://reactjs.org">
36+
<a data-wml-openURL="https://reactjs.org">
3737
<img src="/react.svg" className="logo react" alt="React logo"/>
3838
</a>
3939
</div>

v3/internal/templates/react-swc/frontend/src/App.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ function App() {
3030
return (
3131
<div className="container">
3232
<div>
33-
<a wml-openURL="https://wails.io">
33+
<a data-wml-openURL="https://wails.io">
3434
<img src="/wails.png" className="logo" alt="Wails logo"/>
3535
</a>
36-
<a wml-openURL="https://reactjs.org">
36+
<a data-wml-openURL="https://reactjs.org">
3737
<img src='/react.svg' className="logo react" alt="React logo"/>
3838
</a>
3939
</div>

v3/internal/templates/react-ts/frontend/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ function App() {
3030
return (
3131
<div className="container">
3232
<div>
33-
<a wml-openURL="https://wails.io">
33+
<a data-wml-openURL="https://wails.io">
3434
<img src="/wails.png" className="logo" alt="Wails logo"/>
3535
</a>
36-
<a wml-openURL="https://reactjs.org">
36+
<a data-wml-openURL="https://reactjs.org">
3737
<img src="/react.svg" className="logo react" alt="React logo"/>
3838
</a>
3939
</div>

v3/internal/templates/react/frontend/src/App.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ function App() {
3030
return (
3131
<div className="container">
3232
<div>
33-
<a wml-openURL="https://wails.io">
33+
<a data-wml-openURL="https://wails.io">
3434
<img src="/wails.png" className="logo" alt="Wails logo"/>
3535
</a>
36-
<a wml-openURL="https://reactjs.org">
36+
<a data-wml-openURL="https://reactjs.org">
3737
<img src='/react.svg' className="logo react" alt="React logo"/>
3838
</a>
3939
</div>

v3/internal/templates/solid-ts/frontend/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ function App() {
2828
return (
2929
<div class="container">
3030
<div>
31-
<a wml-openURL="https://wails.io">
31+
<a data-wml-openURL="https://wails.io">
3232
<img src="/wails.png" class="logo" alt="Wails logo"/>
3333
</a>
34-
<a wml-openURL="https://solidjs.com">
34+
<a data-wml-openURL="https://solidjs.com">
3535
<img src="/solid.svg" class="logo solid" alt="Solid logo"/>
3636
</a>
3737
</div>

v3/internal/templates/solid/frontend/src/App.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ function App() {
2828
return (
2929
<div className="container">
3030
<div>
31-
<a wml-openURL="https://wails.io">
31+
<a data-wml-openURL="https://wails.io">
3232
<img src="/wails.png" className="logo" alt="Wails logo"/>
3333
</a>
34-
<a wml-openURL="https://solidjs.com">
34+
<a data-wml-openURL="https://solidjs.com">
3535
<img src="/solid.svg" className="logo solid" alt="Solid logo"/>
3636
</a>
3737
</div>

v3/internal/templates/svelte-ts/frontend/src/App.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525

2626
<div class="container">
2727
<div>
28-
<span wml-openURL="https://wails.io">
28+
<span data-wml-openURL="https://wails.io">
2929
<img src="/wails.png" class="logo" alt="Wails logo"/>
3030
</span>
31-
<span wml-openURL="https://svelte.dev">
31+
<span data-wml-openURL="https://svelte.dev">
3232
<img src="/svelte.svg" class="logo svelte" alt="Svelte logo"/>
3333
</span>
3434
</div>

v3/internal/templates/svelte/frontend/src/App.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ Events.On('time', (timeValue) => {
2525

2626
<div class="container">
2727
<div>
28-
<span wml-openURL="https://wails.io">
28+
<span data-wml-openURL="https://wails.io">
2929
<img src="/wails.png" class="logo" alt="Wails logo"/>
3030
</span>
31-
<span wml-openURL="https://svelte.dev">
31+
<span data-wml-openURL="https://svelte.dev">
3232
<img src="/svelte.svg" class="logo svelte" alt="Svelte logo"/>
3333
</span>
3434
</div>

v3/internal/templates/sveltekit-ts/frontend/src/routes/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ Events.On('time', (timeValue) => {
2525

2626
<div class="container">
2727
<div>
28-
<span wml-openURL="https://wails.io">
28+
<span data-wml-openURL="https://wails.io">
2929
<img src="/wails.png" class="logo" alt="Wails logo"/>
3030
</span>
31-
<span wml-openURL="https://svelte.dev">
31+
<span data-wml-openURL="https://svelte.dev">
3232
<img src="/svelte.svg" class="logo svelte" alt="Svelte logo"/>
3333
</span>
3434
</div>

v3/internal/templates/sveltekit/frontend/src/routes/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ Events.On('time', (timeValue) => {
2525

2626
<div class="container">
2727
<div>
28-
<span wml-openURL="https://wails.io">
28+
<span data-wml-openURL="https://wails.io">
2929
<img src="/wails.png" class="logo" alt="Wails logo"/>
3030
</span>
31-
<span wml-openURL="https://svelte.dev">
31+
<span data-wml-openURL="https://svelte.dev">
3232
<img src="/svelte.svg" class="logo svelte" alt="Svelte logo"/>
3333
</span>
3434
</div>

v3/internal/templates/vanilla-ts/frontend/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<body>
1111
<div class="container">
1212
<div>
13-
<a wml-openURL="https://wails.io">
13+
<a data-wml-openURL="https://wails.io">
1414
<img src="/wails.png" class="logo" alt="Wails logo"/>
1515
</a>
16-
<a wml-openURL="https://www.typescriptlang.org/">
16+
<a data-wml-openURL="https://www.typescriptlang.org/">
1717
<img src="/typescript.svg" class="logo vanilla" alt="Typescript logo"/>
1818
</a>
1919
</div>

v3/internal/templates/vanilla/frontend/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<body>
1111
<div class="container">
1212
<div>
13-
<a wml-openURL="https://wails.io">
13+
<a data-wml-openURL="https://wails.io">
1414
<img src="/wails.png" class="logo" alt="Wails logo"/>
1515
</a>
16-
<a wml-openURL="https://developer.mozilla.org/en-US/docs/Web/JavaScript">
16+
<a data-wml-openURL="https://developer.mozilla.org/en-US/docs/Web/JavaScript">
1717
<img src="/javascript.svg" class="logo vanilla" alt="JavaScript logo"/>
1818
</a>
1919
</div>

v3/internal/templates/vue-ts/frontend/src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import HelloWorld from './components/HelloWorld.vue'
55
<template>
66
<div class="container">
77
<div>
8-
<a wml-openURL="https://wails.io">
8+
<a data-wml-openURL="https://wails.io">
99
<img src="/wails.png" class="logo" alt="Wails logo"/>
1010
</a>
11-
<a wml-openURL="https://vuejs.org/">
11+
<a data-wml-openURL="https://vuejs.org/">
1212
<img src="/vue.svg" class="logo vue" alt="Vue logo"/>
1313
</a>
1414
</div>

v3/internal/templates/vue/frontend/src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import HelloWorld from './components/HelloWorld.vue'
55
<template>
66
<div class="container">
77
<div>
8-
<a wml-openURL="https://wails.io">
8+
<a data-wml-openURL="https://wails.io">
99
<img src="/wails.png" class="logo" alt="Wails logo"/>
1010
</a>
11-
<a wml-openURL="https://vuejs.org/">
11+
<a data-wml-openURL="https://vuejs.org/">
1212
<img src="/vue.svg" class="logo vue" alt="Vue logo"/>
1313
</a>
1414
</div>

v3/pkg/application/assets/alpha/index.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

v3/pkg/application/webview_window_windows.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,6 @@ func (w *windowsWebviewWindow) WndProc(msg uint32, wparam, lparam uintptr) uintp
11971197
case w32.WM_SYSKEYUP:
11981198
w.parent.emit(events.Windows.WindowKeyUp)
11991199
case w32.WM_KEYDOWN:
1200-
globalApplication.info("w32.WM_KEYDOWN: %v", uint(wparam))
12011200
w.parent.emit(events.Windows.WindowKeyDown)
12021201
w.processKeyBinding(uint(wparam))
12031202
case w32.WM_KEYUP:

0 commit comments

Comments
 (0)