@thi.ng/wasm-api-dom
Advanced tools
Comparing version 0.10.0 to 0.10.1
# Change Log | ||
- **Last updated**: 2022-11-23T22:46:54Z | ||
- **Last updated**: 2022-11-24T12:23:48Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -12,2 +12,8 @@ | ||
### [0.10.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/wasm-api-dom@0.10.1) (2022-11-24) | ||
#### ♻️ Refactoring | ||
- regenerate types ([6c839e2](https://github.com/thi-ng/umbrella/commit/6c839e2)) | ||
## [0.10.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/wasm-api-dom@0.10.0) (2022-11-23) | ||
@@ -14,0 +20,0 @@ |
/** | ||
* Generated by @thi.ng/wasm-api-bindgen at 2022-11-23T12:10:08.507Z | ||
* Generated by @thi.ng/wasm-api-bindgen at 2022-11-24T11:00:00.761Z | ||
* DO NOT EDIT! | ||
@@ -45,7 +45,7 @@ */ | ||
/** | ||
* WASM type: u16 | ||
* Zig type: `u16` | ||
*/ | ||
innerWidth: number; | ||
/** | ||
* WASM type: u16 | ||
* Zig type: `u16` | ||
*/ | ||
@@ -56,3 +56,4 @@ innerHeight: number; | ||
* | ||
* WASM type: f32 | ||
* @remarks | ||
* Zig type: `f32` | ||
*/ | ||
@@ -63,3 +64,4 @@ scrollX: number; | ||
* | ||
* WASM type: f32 | ||
* @remarks | ||
* Zig type: `f32` | ||
*/ | ||
@@ -70,3 +72,4 @@ scrollY: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -79,3 +82,4 @@ dpr: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -89,3 +93,4 @@ fullscreen: number; | ||
* | ||
* WASM type: i16 | ||
* @remarks | ||
* Zig type: `i16` | ||
*/ | ||
@@ -96,3 +101,4 @@ clientX: number; | ||
* | ||
* WASM type: i16 | ||
* @remarks | ||
* Zig type: `i16` | ||
*/ | ||
@@ -105,3 +111,4 @@ clientY: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -112,3 +119,4 @@ isDataTransfer: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -120,3 +128,4 @@ modifiers: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -141,3 +150,4 @@ buttons: number; | ||
* | ||
* WASM type: u32 | ||
* @remarks | ||
* Zig type: `u32` | ||
*/ | ||
@@ -148,3 +158,4 @@ len: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -159,3 +170,4 @@ modifiers: number; | ||
* | ||
* WASM type: [15:0]u8 | ||
* @remarks | ||
* Zig type: `[15:0]u8` | ||
*/ | ||
@@ -166,3 +178,4 @@ key: Uint8Array; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -173,3 +186,4 @@ len: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -181,3 +195,4 @@ modifiers: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -192,3 +207,4 @@ repeat: number; | ||
* | ||
* WASM type: i16 | ||
* @remarks | ||
* Zig type: `i16` | ||
*/ | ||
@@ -199,3 +215,4 @@ clientX: number; | ||
* | ||
* WASM type: i16 | ||
* @remarks | ||
* Zig type: `i16` | ||
*/ | ||
@@ -206,3 +223,4 @@ clientY: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -214,3 +232,4 @@ modifiers: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -229,3 +248,4 @@ buttons: number; | ||
* | ||
* WASM type: i16 | ||
* @remarks | ||
* Zig type: `i16` | ||
*/ | ||
@@ -236,3 +256,4 @@ clientX: number; | ||
* | ||
* WASM type: i16 | ||
* @remarks | ||
* Zig type: `i16` | ||
*/ | ||
@@ -243,3 +264,4 @@ clientY: number; | ||
* | ||
* WASM type: u32 | ||
* @remarks | ||
* Zig type: `u32` | ||
*/ | ||
@@ -250,3 +272,4 @@ id: number; | ||
* | ||
* WASM type: f32 | ||
* @remarks | ||
* Zig type: `f32` | ||
*/ | ||
@@ -259,3 +282,4 @@ pressure: number; | ||
* | ||
* WASM type: i8 | ||
* @remarks | ||
* Zig type: `i8` | ||
*/ | ||
@@ -268,3 +292,4 @@ tiltX: number; | ||
* | ||
* WASM type: i8 | ||
* @remarks | ||
* Zig type: `i8` | ||
*/ | ||
@@ -276,3 +301,4 @@ tiltY: number; | ||
* | ||
* WASM type: u16 | ||
* @remarks | ||
* Zig type: `u16` | ||
*/ | ||
@@ -284,3 +310,4 @@ twist: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -291,3 +318,4 @@ isPrimary: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -299,3 +327,4 @@ modifiers: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -314,3 +343,4 @@ buttons: number; | ||
* | ||
* WASM type: f32 | ||
* @remarks | ||
* Zig type: `f32` | ||
*/ | ||
@@ -321,3 +351,4 @@ scrollX: number; | ||
* | ||
* WASM type: f32 | ||
* @remarks | ||
* Zig type: `f32` | ||
*/ | ||
@@ -332,3 +363,4 @@ scrollY: number; | ||
* | ||
* WASM type: i16 | ||
* @remarks | ||
* Zig type: `i16` | ||
*/ | ||
@@ -339,3 +371,4 @@ clientX: number; | ||
* | ||
* WASM type: i16 | ||
* @remarks | ||
* Zig type: `i16` | ||
*/ | ||
@@ -346,3 +379,4 @@ clientY: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -357,3 +391,4 @@ modifiers: number; | ||
* | ||
* WASM type: i16 | ||
* @remarks | ||
* Zig type: `i16` | ||
*/ | ||
@@ -364,3 +399,4 @@ deltaX: number; | ||
* | ||
* WASM type: i16 | ||
* @remarks | ||
* Zig type: `i16` | ||
*/ | ||
@@ -371,3 +407,4 @@ deltaY: number; | ||
* | ||
* WASM type: i16 | ||
* @remarks | ||
* Zig type: `i16` | ||
*/ | ||
@@ -382,3 +419,4 @@ deltaZ: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -389,3 +427,4 @@ modifiers: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -417,3 +456,4 @@ buttons: number; | ||
* | ||
* WASM type: i32 | ||
* @remarks | ||
* Zig type: `i32` | ||
*/ | ||
@@ -446,3 +486,4 @@ target: number; | ||
* | ||
* WASM type: u32 | ||
* @remarks | ||
* Zig type: `u32` | ||
*/ | ||
@@ -456,3 +497,4 @@ callback: number; | ||
* | ||
* WASM type: ?u32 | ||
* @remarks | ||
* Zig type: `?u32` | ||
*/ | ||
@@ -496,3 +538,4 @@ ctx: number; | ||
* | ||
* WASM type: i32 | ||
* @remarks | ||
* Zig type: `i32` | ||
*/ | ||
@@ -503,3 +546,4 @@ parent: number; | ||
* | ||
* WASM type: i32 | ||
* @remarks | ||
* Zig type: `i32` | ||
*/ | ||
@@ -527,3 +571,4 @@ index: number; | ||
* | ||
* WASM type: u16 | ||
* @remarks | ||
* Zig type: `u16` | ||
*/ | ||
@@ -534,3 +579,4 @@ width: number; | ||
* | ||
* WASM type: u16 | ||
* @remarks | ||
* Zig type: `u16` | ||
*/ | ||
@@ -549,3 +595,4 @@ height: number; | ||
* | ||
* WASM type: i32 | ||
* @remarks | ||
* Zig type: `i32` | ||
*/ | ||
@@ -556,3 +603,4 @@ parent: number; | ||
* | ||
* WASM type: i32 | ||
* @remarks | ||
* Zig type: `i32` | ||
*/ | ||
@@ -564,3 +612,4 @@ index: number; | ||
* | ||
* WASM type: u8 | ||
* @remarks | ||
* Zig type: `u8` | ||
*/ | ||
@@ -587,7 +636,7 @@ dpr: number; | ||
/** | ||
* WASM type: u8 | ||
* Zig type: `u8` | ||
*/ | ||
flag: number; | ||
/** | ||
* WASM type: f64 | ||
* Zig type: `f64` | ||
*/ | ||
@@ -594,0 +643,0 @@ num: number; |
/** | ||
* Generated by @thi.ng/wasm-api-bindgen at 2022-11-23T12:10:08.507Z | ||
* Generated by @thi.ng/wasm-api-bindgen at 2022-11-24T11:00:00.761Z | ||
* DO NOT EDIT! | ||
@@ -4,0 +4,0 @@ */ |
{ | ||
"name": "@thi.ng/wasm-api-dom", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "Browser DOM bridge API for hybrid TypeScript & WASM (Zig) applications", | ||
@@ -42,4 +42,4 @@ "type": "module", | ||
"@thi.ng/prefixes": "^2.1.13", | ||
"@thi.ng/wasm-api": "^1.0.0", | ||
"@thi.ng/wasm-api-bindgen": "^0.1.0" | ||
"@thi.ng/wasm-api": "^1.0.1", | ||
"@thi.ng/wasm-api-bindgen": "^0.2.0" | ||
}, | ||
@@ -100,3 +100,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "044ee6a3895720fc78e115032d4d831b63510929\n" | ||
"gitHead": "8d59e559a576ecb3d2c2d13edf5c3146df95d6ac\n" | ||
} |
@@ -116,40 +116,45 @@ <!-- This file is generated - DO NOT EDIT! --> | ||
Single DOM elements and entire element trees (incl. event handler setup and | ||
custom attributes) can be created via the `createElement()` function: | ||
custom attributes) can be created via the `createElement()` function. | ||
Attribute definitions need to be wrapped using `dom.attribs()` and child | ||
elements via `dom.children()`, as shown here: | ||
```zig | ||
const dom = @import("dom"); | ||
const Attrib = dom.Attrib; | ||
// snippet taken from the zig-todo-list example project | ||
const handle = dom.createElement(&.{ | ||
// element name | ||
.tag = "div", | ||
// CSS classes | ||
.class = "flex flex-column mb3", | ||
// nested child elements | ||
.children = &.{ | ||
.{ .tag = "h3", .text = "Add new task" }, | ||
.{ | ||
.tag = "input", | ||
// element's ID attribute | ||
.id = "newtask", | ||
// attribute & event listener definitions | ||
.attribs = &.{ | ||
dom.Attrib.string("placeholder", "What needs to be done?"), | ||
dom.Attrib.flag("autofocus", true), | ||
// event listener setup: | ||
// .ctx is an optional opaque pointer to arbitrary user state/context | ||
dom.Attrib.event("keydown", .{ .callback = onKeydown, .ctx = &STATE }), | ||
dom.Attrib.event("input", .{ .callback = onInput }), | ||
}, | ||
}, | ||
.{ | ||
.tag = "button", | ||
// Element .innerText content | ||
.text = "Add Task", | ||
.attribs = &.{ | ||
dom.Attrib.event("click", .{ .callback = onAddTask }), | ||
}, | ||
}, | ||
}, | ||
// element name | ||
.tag = "div", | ||
// CSS classes | ||
.class = "flex flex-column mb3", | ||
// nested child elements | ||
.children = dom.children(&.{ | ||
.{ .tag = "h3", .text = "Add new task" }, | ||
.{ | ||
.tag = "input", | ||
// element's ID attribute | ||
.id = "newtask", | ||
// attribute & event listener definitions | ||
.attribs = dom.attribs(&.{ | ||
Attrib.string("placeholder", "What needs to be done?"), | ||
Attrib.flag("autofocus", true), | ||
// event listener setup: | ||
// last arg is optional opaque pointer to arbitrary user state/context | ||
Attrib.event("keydown", onKeydown, &STATE), | ||
Attrib.event("input", onInput, null), | ||
}), | ||
}, | ||
.{ | ||
.tag = "button", | ||
// Element .innerText content | ||
.text = "Add Task", | ||
.attribs = dom.attribs(&.{ | ||
Attrib.event("click", onAddTask, null), | ||
}), | ||
}, | ||
}), | ||
}); | ||
@@ -164,3 +169,4 @@ ``` | ||
As already shown above, attributes can be provided as part of the `CreateElementOpts` and/or accessed imperatively: | ||
As already shown above, attributes can be provided as part of the | ||
`CreateElementOpts` and/or accessed imperatively: | ||
@@ -175,3 +181,3 @@ Zig example: | ||
// optional attrib declarations | ||
.attribs = &.{ | ||
.attribs = dom.attribs(&.{ | ||
// string attrib | ||
@@ -186,3 +192,3 @@ dom.Attrib.string("type", "range"), | ||
dom.Attrib.flag("disabled", true), | ||
}, | ||
}), | ||
}); | ||
@@ -234,6 +240,6 @@ ``` | ||
.parent = parent, | ||
.attribs = &.{ | ||
.attribs = dom.attribs(&.{ | ||
// define & add click event listener w/ user context arg | ||
dom.Attrib.event("click", .{ .callback = onClick, .ctx = self }), | ||
}, | ||
dom.Attrib.event("click", onClick, self), | ||
}), | ||
}); | ||
@@ -324,5 +330,4 @@ } | ||
[Zig](https://github.com/thi-ng/umbrella/tree/develop/packages/wasm-api-dom/zig/)) | ||
and the various comments in the [zig-canvas example | ||
project](https://github.com/thi-ng/umbrella/tree/develop/examples/zig-canvas) | ||
for further reference and usage patterns! Thank you! | ||
and the various comments in the above linked example projects for further | ||
reference and usage patterns! Thank you! | ||
@@ -329,0 +334,0 @@ ## Authors |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119039
2059
352
+ Added@thi.ng/file-io@0.4.0(transitive)
+ Added@thi.ng/wasm-api-bindgen@0.2.10(transitive)
- Removed@thi.ng/file-io@0.3.25(transitive)
- Removed@thi.ng/wasm-api-bindgen@0.1.0(transitive)
Updated@thi.ng/wasm-api@^1.0.1