[package]
name = "kode-leptos"
description = "Fast Leptos code editor + WYSIWYG markdown component — syntax highlighting, diagnostics, completions, theming"
keywords = ["leptos", "editor", "code", "wysiwyg", "markdown"]
categories = ["gui", "text-editors", "web-programming"]
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
readme.workspace = true
rust-version.workspace = true

[dependencies]
kode-core = { path = "../kode-core", version = "0.4.4" }
kode-doc = { path = "../kode-doc", version = "0.4.4" }
kode-markdown = { path = "../kode-markdown", version = "0.4.4" }
arborium-tree-sitter = "2.16"
leptos = { version = "0.8", features = ["csr"] }
# Consumers must enable the languages they need via their own `arborium` dep,
# e.g. `arborium = { version = "2.16", default-features = false, features = ["lang-sql"] }`.
# Cargo unifies features across the dep tree, so `arborium::Highlighter` here
# will see whatever grammars the consumer enabled. Kode-leptos itself makes
# no claim about which languages should highlight — it just forwards string
# tags to the shared highlighter.
arborium = { version = "2.16", default-features = false }
arborium-theme = "2.16"
web-sys = { version = "0.3", features = [
    "Blob",
    "Clipboard",
    "HtmlTextAreaElement",
    "HtmlElement",
    "HtmlDivElement",
    "KeyboardEvent",
    "InputEvent",
    "MouseEvent",
    "DomRect",
    "DomRectList",
    "Navigator",
    "Window",
    "Document",
    "Element",
    "Node",
    "NodeList",
    "PointerEvent",
    "Range",
    "Selection",
    "TreeWalker",
    "WheelEvent",
    "FocusEvent",
    "CompositionEvent",
    "ClipboardEvent",
    "DataTransfer",
    "DataTransferItem",
    "DataTransferItemList",
    "DragEvent",
    "File",
    "FileList",
    "HtmlPreElement",
    "HtmlSpanElement",
    "CssStyleDeclaration",
    "StaticRange",
    "MutationObserver",
    "MutationObserverInit",
    "MutationRecord",
] }
send_wrapper = "0.6"
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
js-sys = "0.3"
gloo-timers = { version = "0.3", features = ["futures"] }
log = "0.4"
boon = { version = "0.6", optional = true }
serde_json = { version = "1", optional = true }
serde-saphyr = { version = "0.0", optional = true }
saphyr-parser = { version = "0.0", optional = true }

[features]
schema = ["dep:boon", "dep:serde_json", "dep:serde-saphyr", "dep:saphyr-parser"]

# The test suite exercises highlight_line / highlight_block against real SQL
# input. Dev-dependencies activate feature flags only for the test build, so
# downstream release builds still pay for zero grammars unless the consumer
# opts in.
[dev-dependencies]
arborium = { version = "2.16", default-features = false, features = ["lang-sql"] }

[lints]
workspace = true
