import { Cell, pattern, toSchema, UI } from "commonfabric"; interface State { value: Cell; } const model = toSchema({ "default": { value: 0 }, }); // FIXTURE: with-reactive // Verifies: Cell<> fields generate asCell in schema and a reactive builder gets input/output schemas injected // Cell → { type: "number", asCell: true } // toSchema({default: ...}) → schema with "default" key preserved // bare `cell.value.get() * 2` → auto-wraps, capturing cell.key("value") into lift(inputSchema, outputSchema, fn) export default pattern((cell) => { const doubled = cell.value.get() * 2; return { [UI]: (

Value: {cell.value}

Doubled: {doubled}

), value: cell.value, }; }, model, model);