;
}, (__cfHelpers.VNode | __cfHelpers.UIRenderable)[]>(({ visibleProjects, state, fallbackMembers }) =>
// [TRANSFORM] .map() stays plain: visibleProjects is a captured computed input, plain inside this compute
visibleProjects.map((project, projectIndex) => {
// [TRANSFORM] .map() stays plain: ["alpha","beta"] is a literal array
const plainPreview = ["alpha", "beta"].map((label, labelIndex) => `${project.name}-${labelIndex}-${label}`);
// [TRANSFORM] ifElse: schema args injected on authored ifElse
return ifElse({
type: "boolean"
} as const satisfies __cfHelpers.JSONSchema, {
anyOf: [{}, {
type: "object",
properties: {}
}]
} as const satisfies __cfHelpers.JSONSchema, {
anyOf: [{}, {
type: "object",
properties: {}
}]
} as const satisfies __cfHelpers.JSONSchema, {} as const satisfies __cfHelpers.JSONSchema, project.badges.length > 0,
{project.name}
{/* [TRANSFORM] .map() stays plain: project.badges is compute-owned data inside computed */}
{project.badges.map((badge, badgeIndex) => (
{badge.active
? `${state.prefix}${badge.text}-${projectIndex}`
: badgeIndex === 0
? `${project.name}:${badge.text}`
: ""}
))}
{/* [TRANSFORM] .map() → mapWithPattern: fallbackMembers is a Writable (reactive Cell), lowered even inside computed */}
{fallbackMembers.mapWithPattern(__cfPattern_1, {
project: {
name: project.name
}
})}
{/* [TRANSFORM] .map() stays plain: plainPreview is a local literal array */}
{plainPreview.map((label) => {label})}
,
{/* [TRANSFORM] .map() stays plain: project.members is compute-owned data inside computed */}
{project.members.map((member, memberIndex) => (
{memberIndex === projectIndex
? `${state.prefix}${member}`
: member}
))}
);
}), {
type: "object",
properties: {
visibleProjects: {
type: "array",
items: {
type: "object",
properties: {
name: {
type: "string"
},
badges: {
type: "array",
items: {
type: "object",
properties: {
active: {
type: "boolean"
},
text: {
type: "string"
}
},
required: ["active", "text"]
}
},
members: {
type: "array",
items: {
type: "string"
}
}
},
required: ["name", "badges", "members"]
}
},
state: {
type: "object",
properties: {
prefix: {
type: "string"
}
},
required: ["prefix"]
},
fallbackMembers: {
type: "array",
items: {
type: "string"
},
asCell: ["readonly"]
}
},
required: ["visibleProjects", "state", "fallbackMembers"]
} as const satisfies __cfHelpers.JSONSchema, {
type: "array",
items: {
anyOf: [{
$ref: "https://commonfabric.org/schemas/vnode.json"
}, {
$ref: "#/$defs/UIRenderable"
}]
},
$defs: {
UIRenderable: {
type: "object",
properties: {
$UI: {
$ref: "https://commonfabric.org/schemas/vnode.json"
}
},
required: ["$UI"]
}
}
} as const satisfies __cfHelpers.JSONSchema);
// [TRANSFORM] pattern: type param stripped; input+output schemas appended after callback
export default pattern((state) => {
// [TRANSFORM] new Writable: schema arg injected
const fallbackMembers = new Writable(["ops", "sales"], {
type: "array",
items: {
type: "string"
}
} as const satisfies __cfHelpers.JSONSchema).for("fallbackMembers", true);
// [TRANSFORM] computed() -> lift(): captures state.showArchived, state.projects
const visibleProjects = __cfLift_1({ state: {
showArchived: state.key("showArchived"),
projects: state.key("projects")
} }).for("visibleProjects", true);
// [TRANSFORM] computed() -> lift(): captures visibleProjects (asOpaque), state.prefix, fallbackMembers (asCell — Writable)
const rows = __cfLift_4({
visibleProjects: visibleProjects,
state: {
prefix: state.key("prefix")
},
fallbackMembers: fallbackMembers
}).for("rows", true);
return {
[UI]: {rows}
,
};
}, {
type: "object",
properties: {
projects: {
type: "array",
items: {
$ref: "#/$defs/Project"
}
},
prefix: {
type: "string"
},
showArchived: {
type: "boolean"
}
},
required: ["projects", "prefix", "showArchived"],
$defs: {
Project: {
type: "object",
properties: {
id: {
type: "string"
},
name: {
type: "string"
},
archived: {
type: "boolean"
},
members: {
type: "array",
items: {
type: "string"
}
},
badges: {
type: "array",
items: {
$ref: "#/$defs/Badge"
}
}
},
required: ["id", "name", "archived", "members", "badges"]
},
Badge: {
type: "object",
properties: {
text: {
type: "string"
},
active: {
type: "boolean"
}
},
required: ["text", "active"]
}
}
} 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({
__cfLift_1,
__cfLift_2,
__cfLift_3,
__cfPattern_1,
__cfLift_4
});