[package]
name    = "capslockx-browser"
version = "2.0.0"
edition = "2021"

# Produces a .wasm shared library consumed by wasm-bindgen / wasm-pack.
# Build: wasm-pack build --target web rs/adapters/browser
#   or:  cargo build -p capslockx-browser --target wasm32-unknown-unknown
[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
capslockx-core = { path = "../../core" }
once_cell      = "1.19"

# WASM-only dependencies (not needed when compiling for native targets)
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2"
js-sys       = "0.3"

[target.'cfg(target_arch = "wasm32")'.dependencies.web-sys]
version  = "0.3"
features = [
    "Window",
    "EventTarget",
    "Event",
    "KeyboardEvent",
    "KeyboardEventInit",
    "CustomEvent",
    "CustomEventInit",
    "Document",
    "Element",
    "console",
]
