{thread.title}
{/* [TRANSFORM] .map() stays plain: visibleComments is destructured from captured computed input */}
{visibleComments.map((comment, innerIndex) => (
{/* [TRANSFORM] .map() stays plain: comment.reactions is compute-owned nested array data */}
{comment.reactions.map((reaction, reactionIndex) => (
{reactionIndex === innerIndex
? `${state.lane}:${reaction}`
: reaction}
))}
))}
{/* [TRANSFORM] .map() → mapWithPattern: reboundComments is output of nested computed() — reactive even inside outer computed */}
{/* [TRANSFORM] closure captures: outerIndex (via params opaque), state.lane (via params reactive .key()) */}
{reboundComments.mapWithPattern(__cfPattern_1, {
outerIndex: outerIndex,
state: {
lane: state.lane
}
})}
{/* [TRANSFORM] .map() → mapWithPattern: liftedSeparators is output of lift() — reactive even inside outer computed */}
{/* [TRANSFORM] closure captures: outerIndex (via params opaque), state.lane (via params reactive .key()) */}
{liftedSeparators.mapWithPattern(__cfPattern_2, {
outerIndex: outerIndex,
state: {
lane: state.lane
}
})}
{/* [TRANSFORM] .map() stays plain: plainSeparators is a local literal array */}
{plainSeparators.map((edge) => {edge})}
);
}), {
type: "object",
properties: {
visibleThreads: {
type: "array",
items: {
type: "object",
properties: {
thread: {
type: "object",
properties: {
title: {
type: "string"
},
id: {
type: "string"
},
muted: {
type: "boolean"
}
},
required: ["title", "id", "muted"]
},
visibleComments: {
type: "array",
items: {
type: "object",
properties: {
id: {
type: "string"
},
flagged: {
type: "boolean"
},
text: {
type: "string"
},
reactions: {
type: "array",
items: {
type: "string"
}
}
},
required: ["id", "flagged", "text", "reactions"]
}
},
outerIndex: {
type: "number"
}
},
required: ["thread", "visibleComments", "outerIndex"]
}
},
selectedCommentId: {
anyOf: [{
type: "string"
}, {
type: "undefined"
}],
asCell: ["readonly"]
},
state: {
type: "object",
properties: {
lane: {
type: "string"
}
},
required: ["lane"]
}
},
required: ["visibleThreads", "selectedCommentId", "state"]
} as const satisfies __cfHelpers.JSONSchema, {
type: "array",
items: {
$ref: "#/$defs/JSXElement"
},
$defs: {
JSXElement: {
anyOf: [{
$ref: "https://commonfabric.org/schemas/vnode.json"
}, {
$ref: "#/$defs/UIRenderable"
}, {
type: "object",
properties: {}
}]
},
UIRenderable: {
type: "object",
properties: {
$UI: {
$ref: "https://commonfabric.org/schemas/vnode.json"
}
},
required: ["$UI"]
}
}
} as const satisfies __cfHelpers.JSONSchema);
const __cfLift_8 = __cfHelpers.lift<{
labelIndex: number;
}, boolean>(({ labelIndex }) => labelIndex === 0, {
type: "object",
properties: {
labelIndex: {
type: "number"
}
},
required: ["labelIndex"]
} as const satisfies __cfHelpers.JSONSchema, {
type: "boolean"
} as const satisfies __cfHelpers.JSONSchema);
const __cfLift_9 = __cfHelpers.lift<{
state: {
lane: string;
};
label: string;
}, string>(({ state, label }) => `${state.lane}:${label}`, {
type: "object",
properties: {
state: {
type: "object",
properties: {
lane: {
type: "string"
}
},
required: ["lane"]
},
label: {
type: "string"
}
},
required: ["state", "label"]
} as const satisfies __cfHelpers.JSONSchema, {
type: "string"
} as const satisfies __cfHelpers.JSONSchema);
const __cfPattern_3 = __cfHelpers.pattern(__cf_pattern_input => {
const label = __cf_pattern_input.key("element");
const labelIndex = __cf_pattern_input.key("index");
const state = __cf_pattern_input.key("params", "state");
return ((undefined, {
type: ["string", "undefined"]
} as const satisfies __cfHelpers.JSONSchema).for("selectedCommentId", true);
const laneLabels = passthroughLabels(["lane", "detail", "summary"]).for("laneLabels", true);
// [TRANSFORM] computed() → lift(): captures state.threads, state.showFlagged
const visibleThreads = __cfLift_1({ state: {
threads: state.key("threads"),
showFlagged: state.key("showFlagged")
} }).for("visibleThreads", true);
// [TRANSFORM] computed() → lift(): captures visibleThreads (asOpaque), selectedCommentId (asCell — Writable), state.lane
const threadRows = __cfLift_7({
visibleThreads: visibleThreads,
selectedCommentId: selectedCommentId,
state: {
lane: state.key("lane")
}
}).for("threadRows", true);
return {
[UI]: (
{/* [TRANSFORM] .map() → mapWithPattern: laneLabels is output of lift() in pattern context — reactive */}
{/* [TRANSFORM] ternary lowered: labelIndex===0 ? `${state.lane}:${label}` : label → ifElse(lift(cond), lift(true-branch), label) */}
{laneLabels.mapWithPattern(__cfPattern_3, {
state: {
lane: state.key("lane")
}
})}
{/* [TRANSFORM] .map() → mapWithPattern: threadRows is output of computed() — reactive, back in pattern-owned UI */}
{threadRows.mapWithPattern(__cfPattern_4, {})}
),
};
}, {
type: "object",
properties: {
threads: {
type: "array",
items: {
$ref: "#/$defs/Thread"
}
},
lane: {
type: "string"
},
showFlagged: {
type: "boolean"
}
},
required: ["threads", "lane", "showFlagged"],
$defs: {
Thread: {
type: "object",
properties: {
id: {
type: "string"
},
title: {
type: "string"
},
muted: {
type: "boolean"
},
comments: {
type: "array",
items: {
$ref: "#/$defs/Comment"
}
}
},
required: ["id", "title", "muted", "comments"]
},
Comment: {
type: "object",
properties: {
id: {
type: "string"
},
text: {
type: "string"
},
flagged: {
type: "boolean"
},
reactions: {
type: "array",
items: {
type: "string"
}
}
},
required: ["id", "text", "flagged", "reactions"]
}
}
} as const satisfies __cfHelpers.JSONSchema, {
type: "object",
properties: {
$UI: {
$ref: "#/$defs/JSXElement"
}
},
required: ["$UI"],
$defs: {
JSXElement: {
anyOf: [{
$ref: "https://commonfabric.org/schemas/vnode.json"
}, {
$ref: "#/$defs/UIRenderable"
}, {
type: "object",
properties: {}
}]
},
UIRenderable: {
type: "object",
properties: {
$UI: {
$ref: "https://commonfabric.org/schemas/vnode.json"
}
},
required: ["$UI"]
}
}
} as const satisfies __cfHelpers.JSONSchema);
// @ts-ignore: Internals
function h(...args: any[]) { return __cfHelpers.h.apply(null, args); }
__cfHardenFn(h);
__cfReg({
jumpToComment,
passthroughLabels,
__cfLift_1,
__cfLift_2,
__cfLift_3,
__cfLift_4,
__cfPattern_1,
__cfLift_5,
__cfLift_6,
__cfPattern_2,
__cfLift_7,
__cfLift_8,
__cfLift_9,
__cfPattern_3,
__cfPattern_4
});