import { computed, NAME, pattern, UI, wish } from "commonfabric"; export default pattern( () => { const profileWish = wish({ query: "#profile" }); const profileNameWish = wish({ query: "#profileName" }); const displayName = computed(() => (profileWish.result as { initialNameApplied?: string } | undefined) ?.initialNameApplied ?? profileNameWish.result ?? "No profile" ); const status = computed(() => profileNameWish.result ? `Profile: ${profileNameWish.result}` : "No profile" ); return { [NAME]: "Shared Profile Demo", [UI]: (

Shared Profile Demo

{displayName}
{status}
{profileWish}
), }; }, false as const, { type: "object", properties: { [NAME]: { type: "string" }, [UI]: true, }, required: [NAME, UI], }, );