@burdenoff/microfe-healthybowl 2026.714.8 → 2026.716.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/healthybowl/events/rybbit.js +44 -0
- package/dist/healthybowl/events/rybbit.js.map +1 -0
- package/dist/healthybowl/hooks/useHealthyBowlData.js +672 -658
- package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
- package/dist/healthybowl/hooks/usePlanExecution.js +60 -55
- package/dist/healthybowl/hooks/usePlanExecution.js.map +1 -1
- package/dist/healthybowl/index.js +1 -0
- package/dist/index.js +6 -5
- package/package.json +13 -2
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//#region src/healthybowl/events/rybbit.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"healthybowl.farm.created",
|
|
4
|
+
"healthybowl.crop.created",
|
|
5
|
+
"healthybowl.crop.updated",
|
|
6
|
+
"healthybowl.harvest.recorded"
|
|
7
|
+
];
|
|
8
|
+
function t(e) {
|
|
9
|
+
if (e && typeof e == "object" && "id" in e) {
|
|
10
|
+
let t = e.id;
|
|
11
|
+
return typeof t == "string" ? t : void 0;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function n(e) {
|
|
15
|
+
return e ?? void 0;
|
|
16
|
+
}
|
|
17
|
+
function r(e, r, i) {
|
|
18
|
+
e.emitCustom("healthybowl.farm.created", {
|
|
19
|
+
workspaceId: n(i),
|
|
20
|
+
farmId: t(r)
|
|
21
|
+
}, { component: "healthybowl-farm" });
|
|
22
|
+
}
|
|
23
|
+
function i(e, r, i) {
|
|
24
|
+
e.emitCustom("healthybowl.crop.created", {
|
|
25
|
+
workspaceId: n(i),
|
|
26
|
+
cropId: t(r)
|
|
27
|
+
}, { component: "healthybowl-crop" });
|
|
28
|
+
}
|
|
29
|
+
function a(e, r, i) {
|
|
30
|
+
e.emitCustom("healthybowl.crop.updated", {
|
|
31
|
+
workspaceId: n(i),
|
|
32
|
+
cropId: t(r)
|
|
33
|
+
}, { component: "healthybowl-crop" });
|
|
34
|
+
}
|
|
35
|
+
function o(e, r, i) {
|
|
36
|
+
e.emitCustom("healthybowl.harvest.recorded", {
|
|
37
|
+
workspaceId: n(i),
|
|
38
|
+
harvestId: t(r)
|
|
39
|
+
}, { component: "healthybowl-harvest" });
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { e as HEALTHYBOWL_RYBBIT_EVENT_ALLOWLIST, i as emitCropCreated, a as emitCropUpdated, r as emitFarmCreated, o as emitHarvestRecorded };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=rybbit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rybbit.js","names":[],"sources":["../../../src/healthybowl/events/rybbit.ts"],"sourcesContent":["/**\n * HealthyBowl Rybbit product-analytics emitters (BOFF-2795).\n *\n * Each helper emits a `healthybowl.<area>.<fact>` event onto the shared fe-libs\n * event bus after a mutation succeeds. The host app-shell's\n * {@link https://app.rybbit.io | RybbitSink} forwards allowlisted names to\n * Rybbit Cloud (site `b60bbf411440` on prod). Ids are carried on the bus for\n * the OTel/audit/devtools sinks but are stripped before Rybbit for privacy, so\n * funnels count by event name + session.\n *\n * Uses `emitCustom` (a plain-string name) rather than the typed `emit` so this\n * MFE stays decoupled from the fe-libs version that first registers the\n * `healthybowl.*` names — the same approach as VibeControls. The names are\n * registered + allowlisted in fe-libs so the app-shell forwards them.\n * Event → ANALYTICS_PLAN funnel mapping:\n * • healthybowl.farm.created → activation (first farm)\n * • healthybowl.harvest.recorded → core habit (first harvest)\n * • healthybowl.crop.created/updated → feature adoption\n * @module healthybowl\n */\nimport type { EventBus } from '@burdenoff/fe-libs/shared/events';\n\n/** Event names this module forwards to Rybbit. Kept in sync with the host\n * allowlist (`DEFAULT_RYBBIT_EVENT_ALLOWLIST` in fe-libs AppShellProvider). */\nexport const HEALTHYBOWL_RYBBIT_EVENT_ALLOWLIST = [\n 'healthybowl.farm.created',\n 'healthybowl.crop.created',\n 'healthybowl.crop.updated',\n 'healthybowl.harvest.recorded',\n] as const;\n\n/** Best-effort id extraction from an unknown mutation result — the plan-linked\n * harvest path is hand-typed, so we never assume a concrete shape. */\nfunction idOf(entity: unknown): string | undefined {\n if (entity && typeof entity === 'object' && 'id' in entity) {\n const value = (entity as { id?: unknown }).id;\n return typeof value === 'string' ? value : undefined;\n }\n return undefined;\n}\n\nfunction ws(workspaceId?: string | null): string | undefined {\n return workspaceId ?? undefined;\n}\n\nexport function emitFarmCreated(bus: EventBus, farm: unknown, workspaceId?: string | null): void {\n bus.emitCustom(\n 'healthybowl.farm.created',\n { workspaceId: ws(workspaceId), farmId: idOf(farm) },\n { component: 'healthybowl-farm' }\n );\n}\n\nexport function emitCropCreated(bus: EventBus, crop: unknown, workspaceId?: string | null): void {\n bus.emitCustom(\n 'healthybowl.crop.created',\n { workspaceId: ws(workspaceId), cropId: idOf(crop) },\n { component: 'healthybowl-crop' }\n );\n}\n\nexport function emitCropUpdated(bus: EventBus, crop: unknown, workspaceId?: string | null): void {\n bus.emitCustom(\n 'healthybowl.crop.updated',\n { workspaceId: ws(workspaceId), cropId: idOf(crop) },\n { component: 'healthybowl-crop' }\n );\n}\n\nexport function emitHarvestRecorded(bus: EventBus, harvest: unknown, workspaceId?: string | null): void {\n bus.emitCustom(\n 'healthybowl.harvest.recorded',\n { workspaceId: ws(workspaceId), harvestId: idOf(harvest) },\n { component: 'healthybowl-harvest' }\n );\n}\n"],"mappings":";AAwBA,IAAa,IAAqC;CAChD;CACA;CACA;CACA;CACD;AAID,SAAS,EAAK,GAAqC;AACjD,KAAI,KAAU,OAAO,KAAW,YAAY,QAAQ,GAAQ;EAC1D,IAAM,IAAS,EAA4B;AAC3C,SAAO,OAAO,KAAU,WAAW,IAAQ,KAAA;;;AAK/C,SAAS,EAAG,GAAiD;AAC3D,QAAO,KAAe,KAAA;;AAGxB,SAAgB,EAAgB,GAAe,GAAe,GAAmC;AAC/F,GAAI,WACF,4BACA;EAAE,aAAa,EAAG,EAAY;EAAE,QAAQ,EAAK,EAAK;EAAE,EACpD,EAAE,WAAW,oBAAoB,CAClC;;AAGH,SAAgB,EAAgB,GAAe,GAAe,GAAmC;AAC/F,GAAI,WACF,4BACA;EAAE,aAAa,EAAG,EAAY;EAAE,QAAQ,EAAK,EAAK;EAAE,EACpD,EAAE,WAAW,oBAAoB,CAClC;;AAGH,SAAgB,EAAgB,GAAe,GAAe,GAAmC;AAC/F,GAAI,WACF,4BACA;EAAE,aAAa,EAAG,EAAY;EAAE,QAAQ,EAAK,EAAK;EAAE,EACpD,EAAE,WAAW,oBAAoB,CAClC;;AAGH,SAAgB,EAAoB,GAAe,GAAkB,GAAmC;AACtG,GAAI,WACF,gCACA;EAAE,aAAa,EAAG,EAAY;EAAE,WAAW,EAAK,EAAQ;EAAE,EAC1D,EAAE,WAAW,uBAAuB,CACrC"}
|