[package]
description = "UI components for building fantastic desktop application by using GPUI."
keywords = ["desktop", "gpui", "shadcn", "ui", "uikit"]
license = "Apache-2.0"
name = "gpui-component"
documentation = "https://docs.rs/gpui-component"
homepage = "https://longbridge.github.io/gpui-component"
repository = "https://github.com/longbridge/gpui-component"
readme = "../../README.md"
version = "0.5.1"
publish = true
edition.workspace = true

[lib]
doctest = false

[features]
decimal = ["dep:rust_decimal"]
inspector = ["gpui_macros/inspector", "gpui/inspector"]

# For syntax highlighting in Markdown and CodeEditor.
tree-sitter-languages = [
    "dep:tree-sitter-astro-next",
    "dep:tree-sitter-bash",
    "dep:tree-sitter-c",
    "dep:tree-sitter-c-sharp",
    "dep:tree-sitter-cmake",
    "dep:tree-sitter-cpp",
    "dep:tree-sitter-css",
    "dep:tree-sitter-diff",
    "dep:tree-sitter-elixir",
    "dep:tree-sitter-embedded-template",
    "dep:tree-sitter-go",
    "dep:tree-sitter-graphql",
    "dep:tree-sitter-html",
    "dep:tree-sitter-java",
    "dep:tree-sitter-javascript",
    "dep:tree-sitter-jsdoc",
    "dep:tree-sitter-kotlin-sg",
    "dep:tree-sitter-lua",
    "dep:tree-sitter-make",
    "dep:tree-sitter-md",
    "dep:tree-sitter-php",
    "dep:tree-sitter-proto",
    "dep:tree-sitter-python",
    "dep:tree-sitter-ruby",
    "dep:tree-sitter-rust",
    "dep:tree-sitter-scala",
    "dep:tree-sitter-sequel",
    "dep:tree-sitter-swift",
    "dep:tree-sitter-toml-ng",
    "dep:tree-sitter-typescript",
    "dep:tree-sitter-svelte-next",
    "dep:tree-sitter-yaml",
    "dep:tree-sitter-zig",
]

[dependencies]
anyhow.workspace = true
gpui = { workspace = true }
gpui_macros.workspace = true
gpui-component-macros = { workspace = true }
notify.workspace = true
ropey.workspace = true
rust-i18n.workspace = true
schemars.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_repr.workspace = true
smallvec.workspace = true
sum-tree.workspace = true
tracing.workspace = true
log.workspace = true

enum-iterator = "2.1.0"
itertools = "0.13.0"
once_cell = "1.19.0"
paste = "1"
regex = "1"
unicode-segmentation = "1.12.0"
uuid = "1.10"

# Async primitives (cross-platform, including WASM)
async-channel = "2.3.1"
futures = "0.3"

# Chart
num-traits = "0.2"
rust_decimal = { version = "1.37.0", optional = true }

# Markdown Parser
markdown = { version = "1.0.0", features = ["serde"] }

# HTML Parser
html5ever = "0.27"
markup5ever_rcdom = "0.3.0"

# Calendar
chrono = "0.4.38"

# Code Editor
aho-corasick = "1.1.3"
lsp-types.workspace = true

# Cross-platform time APIs (zero-cost on native, uses web APIs on WASM)
instant = { version = "0.1", features = ["wasm-bindgen"] }

# Native-only dependencies (not available on WASM)
[target.'cfg(not(target_family = "wasm"))'.dependencies]
smol.workspace = true
tree-sitter = "0.25.4"
tree-sitter-astro-next = { version="0.1.1", optional = true }
tree-sitter-bash = { version = "0.23.3", optional = true }
tree-sitter-c = { version = "0.24.1", optional = true }
tree-sitter-c-sharp = { version = "0.23.1", optional = true }
tree-sitter-cmake = { version = "0.7.1", optional = true }
tree-sitter-cpp = { version = "0.23.4", optional = true }
tree-sitter-css = { version = "0.23.2", optional = true }
tree-sitter-diff = { version = "0.1.0", optional = true }
tree-sitter-elixir = { version = "0.3", optional = true }
tree-sitter-embedded-template = { version = "0.23.0", optional = true }
tree-sitter-go = { version = "0.23.4", optional = true }
tree-sitter-graphql = { version = "0.1.0", optional = true }
tree-sitter-html = { version = "0.23.2", optional = true }
tree-sitter-java = { version = "0.23.5", optional = true }
tree-sitter-javascript = { version = "0.23.1", optional = true }
tree-sitter-jsdoc = { version = "0.23.2", optional = true }
tree-sitter-json = "0.24.8"
tree-sitter-kotlin-sg = { version = "0.4.0", optional = true }
tree-sitter-lua = { version = "0.4.1", optional = true }
tree-sitter-make = { version = "1.1.1", optional = true }
tree-sitter-md = { version = "0.5.1", optional = true }
tree-sitter-php = { version = "0.24.2", optional = true }
tree-sitter-proto = { version = "0.2.0", optional = true }
tree-sitter-python = { version = "0.23.6", optional = true }
tree-sitter-ruby = { version = "0.23.1", optional = true }
tree-sitter-rust = { version = "0.24.0", optional = true }
tree-sitter-scala = { version = "0.23.4", optional = true }
tree-sitter-sequel = { version = "0.3.8", optional = true }
tree-sitter-svelte-next = { version = "0.1.1", optional = true }
tree-sitter-swift = { version = "0.7.0", optional = true }
tree-sitter-toml-ng = { version = "0.7.0", optional = true }
tree-sitter-typescript = { version = "0.23.2", optional = true }
tree-sitter-yaml = { version = "0.7.1", optional = true }
tree-sitter-zig = { version = "1.1.2", optional = true }

[target.'cfg(target_os = "macos")'.dependencies]
core-text = "=21.0.0"

[dev-dependencies]
gpui = { workspace = true, features = ["test-support"] }
indoc = "2"

[lints]
workspace = true
