fc-model 0.1.0

Shared text buffer primitives for future-css components
Documentation
# fc-model -- the shared text model behind rich text, documents and grid cells.
#
# This crate exists because three components need the same thing: a text buffer
# that can report byte and character offsets, split into lines, and survive
# editing. Duplicating that per component would mean three subtly different
# implementations of UTF-8 boundary handling -- the classic source of
# corruption bugs in editors.
#
# It is deliberately *not* a document model. No tree, no nodes, no formatting.
# That belongs to fc-rich-text, which owns it. Keeping fc-model ignorant of
# structure is what keeps it small enough for all three consumers to link.

[package]
name = "fc-model"
description = "Shared text buffer primitives for future-css components"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
authors.workspace = true

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
fc-core = { path = "../fc-core", version = "0.1.0", default-features = false }
wasm-bindgen = { workspace = true, features = ["std"], optional = true }
serde = { workspace = true }

[features]
# `bindgen` exports the JavaScript boundary and is on by default, so the WASM
# build is unchanged. A pure Rust consumer (the Dioxus library) turns defaults
# off and gets the same model with no wasm-bindgen in its dependency tree.
# Siblings are pulled with defaults off and `bindgen` forwarded by name, so
# turning it off here turns it off all the way down rather than re-enabling it
# through a sibling's default.
default = ["bindgen"]
bindgen = ["dep:wasm-bindgen", "fc-core/bindgen"]