@burdenoff/microfe-healthybowl 2026.1011.1 → 2026.1013.2

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.
@@ -4,41 +4,41 @@ import { useToast as n } from "../hooks/useToast.js";
4
4
  import { CreateTaskCore as r } from "../../node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js";
5
5
  import { useDefaultTaskProject as i } from "../pages/tasks/useDefaultTaskProject.js";
6
6
  import { useCanManageTasks as a } from "../pages/tasks/useCanManageTasks.js";
7
- import { useCallback as o, useState as s } from "react";
8
- import { ClipboardList as c } from "lucide-react";
9
- import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
10
- import { Button as f } from "@burdenoff/fe-libs/ui";
11
- import { gql as p } from "@apollo/client";
12
- import { ApolloProvider as m, useMutation as h } from "@apollo/client/react";
13
- import { useSafeGatewayClient as g } from "@burdenoff/fe-libs/shared/graphql";
7
+ import { useCallback as o, useEffect as s, useState as c } from "react";
8
+ import { ClipboardList as l } from "lucide-react";
9
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
10
+ import { Button as p } from "@burdenoff/fe-libs/ui";
11
+ import { gql as m } from "@apollo/client";
12
+ import { ApolloProvider as h, useMutation as g } from "@apollo/client/react";
13
+ import { useSafeGatewayClient as _ } from "@burdenoff/fe-libs/shared/graphql";
14
14
  //#region src/healthybowl/components/CreateFarmTaskButton.tsx
15
- var _ = p`
15
+ var v = m`
16
16
  mutation HealthyBowlLinkWorkItem($input: PlanmagnetCreateWorkItemLinkInput!) {
17
17
  planmagnetLinkWorkItem(input: $input) {
18
18
  id
19
19
  }
20
20
  }
21
- `, v = ({ entityType: n, entityId: r, entityLabel: i, label: o = "Create Task", variant: p = "outline", size: h, iconOnly: _, title: v, className: b, icon: x }) => {
22
- let S = g("workspace"), { workspaceId: C } = e(), { canManage: w } = a(C), [T, E] = s(!1);
23
- return !S || !w ? null : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d(f, {
24
- variant: p,
25
- size: h,
21
+ `, y = ({ entityType: n, entityId: r, entityLabel: i, label: o = "Create Task", variant: s = "outline", size: m, iconOnly: g, title: v, className: y, icon: x }) => {
22
+ let S = _("workspace"), { workspaceId: C } = e(), { canManage: w } = a(C), [T, E] = c(!1);
23
+ return !S || !w ? null : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f(p, {
24
+ variant: s,
25
+ size: m,
26
26
  onClick: () => E(!0),
27
- className: b,
28
- title: v ?? (_ ? o : void 0),
29
- "aria-label": _ ? v ?? o : void 0,
30
- children: [x ?? /* @__PURE__ */ u(c, {
27
+ className: y,
28
+ title: v ?? (g ? o : void 0),
29
+ "aria-label": g ? v ?? o : void 0,
30
+ children: [x ?? /* @__PURE__ */ d(l, {
31
31
  className: "size-4",
32
32
  "aria-hidden": "true"
33
- }), !_ && o]
34
- }), /* @__PURE__ */ u(t, {
33
+ }), !g && o]
34
+ }), /* @__PURE__ */ d(t, {
35
35
  open: T,
36
36
  onClose: () => E(!1),
37
37
  title: "Create Farm Task",
38
38
  description: `Create a task linked to ${i}.`,
39
- children: /* @__PURE__ */ u(m, {
39
+ children: /* @__PURE__ */ d(h, {
40
40
  client: S,
41
- children: /* @__PURE__ */ u(y, {
41
+ children: /* @__PURE__ */ d(b, {
42
42
  client: S,
43
43
  entityType: n,
44
44
  entityId: r,
@@ -47,57 +47,61 @@ var _ = p`
47
47
  })
48
48
  })
49
49
  })] });
50
- }, y = ({ client: t, entityType: a, entityId: s, entityLabel: c, onDone: l }) => {
51
- let { workspaceId: f, currentUser: p } = e(), { projectId: m, loading: g, error: v } = i(t, f, p?.id), [y] = h(_), { toast: b } = n(), x = o(async (e) => {
50
+ }, b = ({ client: t, entityType: a, entityId: c, entityLabel: l, onDone: u }) => {
51
+ let { workspaceId: p, currentUser: m } = e(), { projectId: h, loading: _, error: y, ensureProject: b } = i(t, p, m?.id);
52
+ s(() => {
53
+ b();
54
+ }, [b]);
55
+ let [x] = g(v), { toast: S } = n(), C = o(async (e) => {
52
56
  try {
53
- await y({ variables: { input: {
57
+ await x({ variables: { input: {
54
58
  workItemId: e.id,
55
59
  sourceProduct: "healthybowl",
56
60
  entityType: a,
57
- entityId: s,
58
- displayNameSnapshot: c,
61
+ entityId: c,
62
+ displayNameSnapshot: l,
59
63
  deepLinkSnapshot: window.location.pathname + window.location.search
60
- } } }), b({
64
+ } } }), S({
61
65
  title: "Task created",
62
- description: `Linked to ${c}.`,
66
+ description: `Linked to ${l}.`,
63
67
  variant: "success"
64
68
  });
65
69
  } catch {
66
- b({
70
+ S({
67
71
  title: "Task created",
68
72
  description: "Saved, but it could not be linked to this record.",
69
73
  variant: "warning"
70
74
  });
71
75
  }
72
- l();
76
+ u();
73
77
  }, [
74
- y,
78
+ x,
75
79
  a,
76
- s,
77
80
  c,
78
- b,
79
- l
81
+ l,
82
+ S,
83
+ u
80
84
  ]);
81
- return v ? /* @__PURE__ */ d("p", {
85
+ return y ? /* @__PURE__ */ f("p", {
82
86
  className: "text-sm text-destructive",
83
- children: ["Couldn't prepare the task project: ", v.message]
84
- }) : g || !m ? /* @__PURE__ */ u("p", {
87
+ children: ["Couldn't prepare the task project: ", y.message]
88
+ }) : _ || !h ? /* @__PURE__ */ d("p", {
85
89
  className: "text-sm text-muted-foreground",
86
90
  children: "Preparing…"
87
- }) : /* @__PURE__ */ u(r, {
88
- workspaceId: f,
89
- projectId: m,
91
+ }) : /* @__PURE__ */ d(r, {
92
+ workspaceId: p,
93
+ projectId: h,
90
94
  hideHeader: !0,
91
- defaultValues: { title: `${c}: ` },
95
+ defaultValues: { title: `${l}: ` },
92
96
  hiddenFields: [
93
97
  "type",
94
98
  "storyPoints",
95
99
  "labels"
96
100
  ],
97
101
  submitLabel: "Create & link",
98
- onCreated: x,
99
- onCancel: l
102
+ onCreated: C,
103
+ onCancel: u
100
104
  });
101
105
  };
102
106
  //#endregion
103
- export { v as CreateFarmTaskButton };
107
+ export { y as CreateFarmTaskButton };
@@ -1,21 +1,21 @@
1
1
  import { useHealthyBowl as e } from "../../context/HealthyBowlContext.js";
2
2
  import { PageLayout as t } from "../../components/PageLayout.js";
3
3
  import { useBasePath as n } from "../../hooks/useBasePath.js";
4
- import { EmptyState as r } from "../../components/EmptyState.js";
5
- import { ErrorState as i } from "../../components/ErrorState.js";
6
- import { PageLoader as a } from "../../components/PageLoader.js";
7
- import { useDefaultTaskProject as o } from "./useDefaultTaskProject.js";
4
+ import { EmptyState as ee } from "../../components/EmptyState.js";
5
+ import { ErrorState as r } from "../../components/ErrorState.js";
6
+ import { PageLoader as i } from "../../components/PageLoader.js";
7
+ import { useDefaultTaskProject as a } from "./useDefaultTaskProject.js";
8
8
  import "../../components/index.js";
9
- import { todayDateParam as s, useJobCardTasks as c } from "./useJobCardTasks.js";
10
- import { useCallback as l, useMemo as u } from "react";
11
- import { ClipboardList as d, Printer as f } from "lucide-react";
12
- import { useNavigate as p, useSearchParams as m } from "react-router";
13
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
14
- import { Button as v } from "@burdenoff/fe-libs/ui";
15
- import { useSafeGatewayClient as y } from "@burdenoff/fe-libs/shared/graphql";
16
- import { useWorkspaceDirectory as b } from "@burdenoff/fe-libs/sharing";
9
+ import { todayDateParam as o, useJobCardTasks as s } from "./useJobCardTasks.js";
10
+ import { useCallback as c, useMemo as l } from "react";
11
+ import { ClipboardList as u, Printer as d } from "lucide-react";
12
+ import { useNavigate as f, useSearchParams as p } from "react-router";
13
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
14
+ import { Button as _ } from "@burdenoff/fe-libs/ui";
15
+ import { useSafeGatewayClient as v } from "@burdenoff/fe-libs/shared/graphql";
16
+ import { useWorkspaceDirectory as y } from "@burdenoff/fe-libs/sharing";
17
17
  //#region src/healthybowl/pages/tasks/JobCardPage.tsx
18
- var x = [
18
+ var b = [
19
19
  "@media print {",
20
20
  " body * { visibility: hidden; }",
21
21
  " .hb-job-card-sheet, .hb-job-card-sheet * { visibility: visible; }",
@@ -32,7 +32,7 @@ var x = [
32
32
  " }",
33
33
  " .hb-job-card-task { break-inside: avoid; }",
34
34
  "}"
35
- ].join("\n"), S = "h-9 rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", C = (e) => {
35
+ ].join("\n"), x = "h-9 rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", S = (e) => {
36
36
  if (!e) return "No due date";
37
37
  let t = new Date(e);
38
38
  return Number.isNaN(t.getTime()) ? e : t.toLocaleDateString(void 0, {
@@ -40,70 +40,70 @@ var x = [
40
40
  month: "short",
41
41
  year: "numeric"
42
42
  });
43
- }, w = (e) => {
43
+ }, C = (e) => {
44
44
  if (!e || e <= 0) return null;
45
45
  if (e < 60) return `${e} min`;
46
46
  let t = e / 60;
47
47
  return `${Number.isInteger(t) ? t : t.toFixed(1)} h`;
48
- }, T = (e) => e.toLowerCase().split("_").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" "), E = ({ task: e, assigneeName: t }) => {
49
- let n = w(e.estimateMinutes);
50
- return /* @__PURE__ */ g("li", {
48
+ }, w = (e) => e.toLowerCase().split("_").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" "), T = ({ task: e, assigneeName: t }) => {
49
+ let n = C(e.estimateMinutes);
50
+ return /* @__PURE__ */ h("li", {
51
51
  className: "hb-job-card-task rounded-lg border border-border-subtle p-4",
52
- children: /* @__PURE__ */ _("div", {
52
+ children: /* @__PURE__ */ g("div", {
53
53
  className: "flex items-start gap-3",
54
- children: [/* @__PURE__ */ g("span", {
54
+ children: [/* @__PURE__ */ h("span", {
55
55
  "aria-hidden": "true",
56
56
  className: "mt-1 inline-block h-5 w-5 shrink-0 rounded-sm border-2 border-text-primary"
57
- }), /* @__PURE__ */ _("div", {
57
+ }), /* @__PURE__ */ g("div", {
58
58
  className: "min-w-0 flex-1",
59
59
  children: [
60
- /* @__PURE__ */ _("div", {
60
+ /* @__PURE__ */ g("div", {
61
61
  className: "flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",
62
- children: [/* @__PURE__ */ g("h3", {
62
+ children: [/* @__PURE__ */ h("h3", {
63
63
  className: "text-base font-semibold text-text-primary",
64
64
  children: e.title
65
- }), /* @__PURE__ */ g("span", {
65
+ }), /* @__PURE__ */ h("span", {
66
66
  className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
67
67
  children: e.key
68
68
  })]
69
69
  }),
70
- /* @__PURE__ */ _("div", {
70
+ /* @__PURE__ */ g("div", {
71
71
  className: "mt-1 flex flex-wrap gap-x-4 gap-y-1 text-xs text-text-secondary",
72
72
  children: [
73
- /* @__PURE__ */ _("span", { children: [
74
- /* @__PURE__ */ g("span", {
73
+ /* @__PURE__ */ g("span", { children: [
74
+ /* @__PURE__ */ h("span", {
75
75
  className: "font-medium text-text-primary",
76
76
  children: "Due:"
77
77
  }),
78
78
  " ",
79
- C(e.dueDate)
79
+ S(e.dueDate)
80
80
  ] }),
81
- /* @__PURE__ */ _("span", { children: [
82
- /* @__PURE__ */ g("span", {
81
+ /* @__PURE__ */ g("span", { children: [
82
+ /* @__PURE__ */ h("span", {
83
83
  className: "font-medium text-text-primary",
84
84
  children: "Priority:"
85
85
  }),
86
86
  " ",
87
- T(e.priority)
87
+ w(e.priority)
88
88
  ] }),
89
- /* @__PURE__ */ _("span", { children: [
90
- /* @__PURE__ */ g("span", {
89
+ /* @__PURE__ */ g("span", { children: [
90
+ /* @__PURE__ */ h("span", {
91
91
  className: "font-medium text-text-primary",
92
92
  children: "Assignee:"
93
93
  }),
94
94
  " ",
95
95
  t
96
96
  ] }),
97
- n ? /* @__PURE__ */ _("span", { children: [
98
- /* @__PURE__ */ g("span", {
97
+ n ? /* @__PURE__ */ g("span", { children: [
98
+ /* @__PURE__ */ h("span", {
99
99
  className: "font-medium text-text-primary",
100
100
  children: "Estimate:"
101
101
  }),
102
102
  " ",
103
103
  n
104
104
  ] }) : null,
105
- e.labels.length > 0 ? /* @__PURE__ */ _("span", { children: [
106
- /* @__PURE__ */ g("span", {
105
+ e.labels.length > 0 ? /* @__PURE__ */ g("span", { children: [
106
+ /* @__PURE__ */ h("span", {
107
107
  className: "font-medium text-text-primary",
108
108
  children: "Labels:"
109
109
  }),
@@ -112,28 +112,28 @@ var x = [
112
112
  ] }) : null
113
113
  ]
114
114
  }),
115
- e.description ? /* @__PURE__ */ _("div", {
115
+ e.description ? /* @__PURE__ */ g("div", {
116
116
  className: "mt-3",
117
- children: [/* @__PURE__ */ g("div", {
117
+ children: [/* @__PURE__ */ h("div", {
118
118
  className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
119
119
  children: "Instructions"
120
- }), /* @__PURE__ */ g("p", {
120
+ }), /* @__PURE__ */ h("p", {
121
121
  className: "mt-1 whitespace-pre-line text-sm text-text-primary",
122
122
  children: e.description
123
123
  })]
124
124
  }) : null,
125
- /* @__PURE__ */ _("div", {
125
+ /* @__PURE__ */ g("div", {
126
126
  className: "mt-4 flex flex-wrap items-end gap-x-8 gap-y-2 border-t border-border-subtle pt-3 text-xs text-text-secondary",
127
127
  children: [
128
- /* @__PURE__ */ _("span", { children: ["Completed by: ", /* @__PURE__ */ g("span", {
128
+ /* @__PURE__ */ g("span", { children: ["Completed by: ", /* @__PURE__ */ h("span", {
129
129
  className: "inline-block w-48 border-b border-text-primary",
130
130
  "aria-hidden": "true"
131
131
  })] }),
132
- /* @__PURE__ */ _("span", { children: ["Signature: ", /* @__PURE__ */ g("span", {
132
+ /* @__PURE__ */ g("span", { children: ["Signature: ", /* @__PURE__ */ h("span", {
133
133
  className: "inline-block w-48 border-b border-text-primary",
134
134
  "aria-hidden": "true"
135
135
  })] }),
136
- /* @__PURE__ */ _("span", { children: ["Date: ", /* @__PURE__ */ g("span", {
136
+ /* @__PURE__ */ g("span", { children: ["Date: ", /* @__PURE__ */ h("span", {
137
137
  className: "inline-block w-28 border-b border-text-primary",
138
138
  "aria-hidden": "true"
139
139
  })] })
@@ -143,139 +143,139 @@ var x = [
143
143
  })]
144
144
  })
145
145
  });
146
- }, D = () => {
147
- let { workspaceId: w, currentUser: T, authToken: D, apiGatewayUrl: O } = e(), k = y("workspace"), A = T?.id, j = p(), { buildPath: M } = n(), [N] = m(), P = N.get("item"), F = N.get("date") ?? s(), I = N.get("assignee") ?? void 0, { projectId: L, loading: R, error: z, retry: B } = o(k, w, A), V = u(() => P ? {
146
+ }, E = () => {
147
+ let { workspaceId: C, currentUser: w, authToken: E, apiGatewayUrl: D } = e(), O = v("workspace"), k = w?.id, A = f(), { buildPath: j } = n(), [M] = p(), N = M.get("item"), P = M.get("date") ?? o(), F = M.get("assignee") ?? void 0, { projectId: I, loading: L, resolved: R, error: z, retry: B } = a(O, C, k), V = l(() => N ? {
148
148
  kind: "item",
149
- itemId: P
149
+ itemId: N
150
150
  } : {
151
151
  kind: "day",
152
- date: F,
153
- assigneeId: I
152
+ date: P,
153
+ assigneeId: F
154
154
  }, [
155
+ N,
155
156
  P,
156
- F,
157
- I
158
- ]), { groups: H, tasks: U, loading: W, error: G, retry: K } = c(k, w, L, V), { members: q } = b({
159
- workspaceId: w,
160
- authToken: D,
161
- apiGatewayUrl: O
162
- }), J = u(() => new Map(q.map((e) => [e.id, e.name])), [q]), Y = l((e) => e ? J.get(e) ?? e : "Unassigned", [J]), X = l(() => window.print(), []), Z = l((e, t) => {
157
+ F
158
+ ]), { groups: H, tasks: U, loading: W, error: G, retry: K } = s(O, C, I, V), { members: q } = y({
159
+ workspaceId: C,
160
+ authToken: E,
161
+ apiGatewayUrl: D
162
+ }), J = l(() => new Map(q.map((e) => [e.id, e.name])), [q]), Y = c((e) => e ? J.get(e) ?? e : "Unassigned", [J]), X = c(() => window.print(), []), Z = c((e, t) => {
163
163
  let n = new URLSearchParams({ date: e });
164
- t && n.set("assignee", t), j(`${M("tasks/job-card")}?${n.toString()}`);
165
- }, [j, M]), Q = V.kind === "day", $ = Q && V.assigneeId ? Y(V.assigneeId) : "All members", ee = u(() => (/* @__PURE__ */ new Date()).toLocaleDateString(void 0, {
164
+ t && n.set("assignee", t), A(`${j("tasks/job-card")}?${n.toString()}`);
165
+ }, [A, j]), Q = V.kind === "day", $ = Q && V.assigneeId ? Y(V.assigneeId) : "All members", te = l(() => (/* @__PURE__ */ new Date()).toLocaleDateString(void 0, {
166
166
  day: "numeric",
167
167
  month: "short",
168
168
  year: "numeric"
169
- }), []), te = /* @__PURE__ */ _("div", {
169
+ }), []), ne = /* @__PURE__ */ g("div", {
170
170
  className: "flex flex-wrap items-end gap-2 print:hidden",
171
- children: [Q ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("label", {
171
+ children: [Q ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("label", {
172
172
  className: "text-xs text-text-secondary",
173
- children: [/* @__PURE__ */ g("span", {
173
+ children: [/* @__PURE__ */ h("span", {
174
174
  className: "mb-1 block",
175
175
  children: "Date"
176
- }), /* @__PURE__ */ g("input", {
176
+ }), /* @__PURE__ */ h("input", {
177
177
  type: "date",
178
- value: F,
178
+ value: P,
179
179
  onChange: (e) => {
180
- e.target.value && Z(e.target.value, I);
180
+ e.target.value && Z(e.target.value, F);
181
181
  },
182
- className: S
182
+ className: x
183
183
  })]
184
- }), /* @__PURE__ */ _("label", {
184
+ }), /* @__PURE__ */ g("label", {
185
185
  className: "text-xs text-text-secondary",
186
- children: [/* @__PURE__ */ g("span", {
186
+ children: [/* @__PURE__ */ h("span", {
187
187
  className: "mb-1 block",
188
188
  children: "Crew member"
189
- }), /* @__PURE__ */ _("select", {
190
- value: I ?? "",
191
- onChange: (e) => Z(F, e.target.value || void 0),
192
- className: S,
193
- children: [/* @__PURE__ */ g("option", {
189
+ }), /* @__PURE__ */ g("select", {
190
+ value: F ?? "",
191
+ onChange: (e) => Z(P, e.target.value || void 0),
192
+ className: x,
193
+ children: [/* @__PURE__ */ h("option", {
194
194
  value: "",
195
195
  children: "All members"
196
- }), q.map((e) => /* @__PURE__ */ g("option", {
196
+ }), q.map((e) => /* @__PURE__ */ h("option", {
197
197
  value: e.id,
198
198
  children: e.name
199
199
  }, e.id))]
200
200
  })]
201
- })] }) : null, /* @__PURE__ */ _(v, {
201
+ })] }) : null, /* @__PURE__ */ g(_, {
202
202
  variant: "outline",
203
203
  onClick: X,
204
- children: [/* @__PURE__ */ g(f, {
204
+ children: [/* @__PURE__ */ h(d, {
205
205
  className: "me-1.5 h-4 w-4",
206
206
  "aria-hidden": "true"
207
207
  }), " Print / Save as PDF"]
208
208
  })]
209
209
  });
210
- return /* @__PURE__ */ _(t, {
210
+ return /* @__PURE__ */ g(t, {
211
211
  title: Q ? "Job Card Run-Sheet" : "Job Card",
212
212
  description: "A printable field work order built from your existing Farm Tasks — nothing here is new data.",
213
- actions: te,
213
+ actions: ne,
214
214
  helpPrompt: "How do I print a job card or run-sheet for my farm crew?",
215
215
  purpose: "Print a field work order for a crew: pick a day (and optionally a crew member) to get every task due that day, grouped by field, with instructions and a sign-off line — or open a single task's card.",
216
- purposeIcon: /* @__PURE__ */ g(d, {
216
+ purposeIcon: /* @__PURE__ */ h(u, {
217
217
  className: "size-5",
218
218
  "aria-hidden": "true"
219
219
  }),
220
- children: [/* @__PURE__ */ g("style", { children: x }), k ? Q && z ? /* @__PURE__ */ g(i, {
220
+ children: [/* @__PURE__ */ h("style", { children: b }), O ? Q && z ? /* @__PURE__ */ h(r, {
221
221
  title: "Couldn't open Farm Tasks",
222
222
  description: z.message,
223
223
  onRetry: B
224
- }) : Q && (R || !L) || W ? /* @__PURE__ */ g(a, {}) : G ? /* @__PURE__ */ g(i, {
224
+ }) : Q && (L || !R) || W ? /* @__PURE__ */ h(i, {}) : G ? /* @__PURE__ */ h(r, {
225
225
  title: "Couldn't build the job card",
226
226
  description: G.message,
227
227
  onRetry: K
228
- }) : U.length === 0 ? /* @__PURE__ */ g(r, {
228
+ }) : U.length === 0 ? /* @__PURE__ */ h(ee, {
229
229
  title: Q ? "No tasks due that day" : "Task not found",
230
- description: Q ? `No to-do or in-progress Farm Tasks are due on ${C(F)}${V.kind === "day" && V.assigneeId ? ` for ${$}` : ""}. Pick another date or crew member.` : "That task could not be found in this workspace."
231
- }) : /* @__PURE__ */ _("div", {
230
+ description: Q ? `No to-do or in-progress Farm Tasks are due on ${S(P)}${V.kind === "day" && V.assigneeId ? ` for ${$}` : ""}. Pick another date or crew member.` : "That task could not be found in this workspace."
231
+ }) : /* @__PURE__ */ g("div", {
232
232
  className: "hb-job-card-sheet mx-auto max-w-3xl rounded-xl border border-border-subtle bg-bg-surface p-8 shadow-sm",
233
233
  children: [
234
- /* @__PURE__ */ g("div", {
234
+ /* @__PURE__ */ h("div", {
235
235
  className: "mb-1 flex items-center gap-2",
236
- children: /* @__PURE__ */ g("span", {
236
+ children: /* @__PURE__ */ h("span", {
237
237
  className: "text-lg font-bold text-accent-teal",
238
238
  children: "HealthyBowl"
239
239
  })
240
240
  }),
241
- /* @__PURE__ */ g("h2", {
241
+ /* @__PURE__ */ h("h2", {
242
242
  className: "text-2xl font-bold text-text-primary",
243
243
  children: Q ? "Field Work Order — Crew Run-Sheet" : "Field Work Order"
244
244
  }),
245
- /* @__PURE__ */ _("div", {
245
+ /* @__PURE__ */ g("div", {
246
246
  className: "mt-2 grid grid-cols-1 gap-1 text-sm text-text-secondary sm:grid-cols-2",
247
247
  children: [
248
- Q ? /* @__PURE__ */ _("div", { children: [
249
- /* @__PURE__ */ g("span", {
248
+ Q ? /* @__PURE__ */ g("div", { children: [
249
+ /* @__PURE__ */ h("span", {
250
250
  className: "font-medium text-text-primary",
251
251
  children: "Work date:"
252
252
  }),
253
253
  " ",
254
- C(F)
254
+ S(P)
255
255
  ] }) : null,
256
- /* @__PURE__ */ _("div", {
256
+ /* @__PURE__ */ g("div", {
257
257
  className: "sm:text-end",
258
258
  children: [
259
- /* @__PURE__ */ g("span", {
259
+ /* @__PURE__ */ h("span", {
260
260
  className: "font-medium text-text-primary",
261
261
  children: "Generated:"
262
262
  }),
263
263
  " ",
264
- ee
264
+ te
265
265
  ]
266
266
  }),
267
- /* @__PURE__ */ _("div", { children: [
268
- /* @__PURE__ */ g("span", {
267
+ /* @__PURE__ */ g("div", { children: [
268
+ /* @__PURE__ */ h("span", {
269
269
  className: "font-medium text-text-primary",
270
270
  children: "Crew:"
271
271
  }),
272
272
  " ",
273
273
  $
274
274
  ] }),
275
- /* @__PURE__ */ _("div", {
275
+ /* @__PURE__ */ g("div", {
276
276
  className: "sm:text-end",
277
277
  children: [
278
- /* @__PURE__ */ g("span", {
278
+ /* @__PURE__ */ h("span", {
279
279
  className: "font-medium text-text-primary",
280
280
  children: "Tasks:"
281
281
  }),
@@ -285,31 +285,31 @@ var x = [
285
285
  })
286
286
  ]
287
287
  }),
288
- /* @__PURE__ */ g("hr", { className: "my-5 border-border-subtle" }),
289
- H.map((e) => /* @__PURE__ */ _("section", {
288
+ /* @__PURE__ */ h("hr", { className: "my-5 border-border-subtle" }),
289
+ H.map((e) => /* @__PURE__ */ g("section", {
290
290
  className: "mb-6",
291
- children: [/* @__PURE__ */ g("h3", {
291
+ children: [/* @__PURE__ */ h("h3", {
292
292
  className: "mb-2 text-sm font-bold uppercase tracking-wide text-text-secondary",
293
293
  children: e.entityLabel ?? "General tasks"
294
- }), /* @__PURE__ */ g("ul", {
294
+ }), /* @__PURE__ */ h("ul", {
295
295
  className: "space-y-3",
296
- children: e.tasks.map((e) => /* @__PURE__ */ g(E, {
296
+ children: e.tasks.map((e) => /* @__PURE__ */ h(T, {
297
297
  task: e,
298
298
  assigneeName: Y(e.assigneeId)
299
299
  }, e.id))
300
300
  })]
301
301
  }, e.entityLabel ?? "__general__")),
302
- /* @__PURE__ */ g("hr", { className: "my-5 border-border-subtle" }),
303
- /* @__PURE__ */ g("p", {
302
+ /* @__PURE__ */ h("hr", { className: "my-5 border-border-subtle" }),
303
+ /* @__PURE__ */ h("p", {
304
304
  className: "text-xs text-text-secondary",
305
305
  children: "Printed from HealthyBowl Farm Tasks — a print view of existing task data, not a generated document."
306
306
  })
307
307
  ]
308
- }) : /* @__PURE__ */ g(i, {
308
+ }) : /* @__PURE__ */ h(r, {
309
309
  title: "Job card unavailable",
310
310
  description: "The workspace connection isn't ready. Reload the page or reselect your workspace."
311
311
  })]
312
312
  });
313
313
  };
314
314
  //#endregion
315
- export { D as JobCardPage };
315
+ export { E as JobCardPage };
@@ -1,29 +1,31 @@
1
1
  import { useHealthyBowl as e } from "../../context/HealthyBowlContext.js";
2
2
  import { useTr as t } from "../../../shared/hooks/useTr.js";
3
- import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { useBasePath as r } from "../../hooks/useBasePath.js";
5
- import { ErrorState as i } from "../../components/ErrorState.js";
6
- import { PageLoader as a } from "../../components/PageLoader.js";
7
- import { TasksPageCore as o } from "../../../node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js";
3
+ import { PageLayout as ee } from "../../components/PageLayout.js";
4
+ import { useBasePath as te } from "../../hooks/useBasePath.js";
5
+ import { EmptyState as ne } from "../../components/EmptyState.js";
6
+ import { ErrorState as n } from "../../components/ErrorState.js";
7
+ import { PageLoader as r } from "../../components/PageLoader.js";
8
+ import { Modal as i } from "../../components/Modal.js";
9
+ import { CreateTaskCore as a, TasksPageCore as o } from "../../../node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js";
8
10
  import { useDefaultTaskProject as s } from "./useDefaultTaskProject.js";
9
11
  import { useCanManageTasks as c } from "./useCanManageTasks.js";
10
12
  import "../../components/index.js";
11
13
  import { todayDateParam as l } from "./useJobCardTasks.js";
12
- import { useFarmTaskLabels as u } from "./useFarmTaskLabels.js";
13
- import { useCallback as d, useMemo as f } from "react";
14
- import { useI18n as p } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
- import { Bug as m, ListChecks as h, MapPin as g, PawPrint as _, Printer as v, Sprout as y } from "lucide-react";
14
+ import { useFarmTaskLabels as re } from "./useFarmTaskLabels.js";
15
+ import { useCallback as u, useMemo as d, useState as f } from "react";
16
+ import { useI18n as ie } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
17
+ import { Bug as p, ListChecks as m, MapPin as h, PawPrint as g, Plus as _, Printer as v, Sprout as y } from "lucide-react";
16
18
  import { useNavigate as b, useSearchParams as x } from "react-router";
17
19
  import { jsx as S, jsxs as C } from "react/jsx-runtime";
18
20
  import { Button as w } from "@burdenoff/fe-libs/ui";
19
21
  import { gql as T } from "@apollo/client";
20
22
  import { ApolloProvider as E } from "@apollo/client/react";
21
- import { useSafeGatewayClient as D } from "@burdenoff/fe-libs/shared/graphql";
22
- import { useWorkspaceDirectory as O } from "@burdenoff/fe-libs/sharing";
23
+ import { useSafeGatewayClient as ae } from "@burdenoff/fe-libs/shared/graphql";
24
+ import { useWorkspaceDirectory as oe } from "@burdenoff/fe-libs/sharing";
23
25
  //#region src/healthybowl/pages/tasks/TasksPage.tsx
24
- var k = (e) => {
26
+ var se = (e) => {
25
27
  switch (e) {
26
- case "FIELD": return /* @__PURE__ */ S(g, {
28
+ case "FIELD": return /* @__PURE__ */ S(h, {
27
29
  className: "h-3 w-3",
28
30
  "aria-hidden": "true"
29
31
  });
@@ -31,133 +33,180 @@ var k = (e) => {
31
33
  className: "h-3 w-3",
32
34
  "aria-hidden": "true"
33
35
  });
34
- case "ANIMAL": return /* @__PURE__ */ S(_, {
36
+ case "ANIMAL": return /* @__PURE__ */ S(g, {
35
37
  className: "h-3 w-3",
36
38
  "aria-hidden": "true"
37
39
  });
38
40
  case "PEST_ISSUE":
39
- case "PEST": return /* @__PURE__ */ S(m, {
41
+ case "PEST": return /* @__PURE__ */ S(p, {
40
42
  className: "h-3 w-3",
41
43
  "aria-hidden": "true"
42
44
  });
43
45
  default: return null;
44
46
  }
45
- }, A = T`
47
+ }, D = [
48
+ {
49
+ status: "BACKLOG",
50
+ label: "Backlog"
51
+ },
52
+ {
53
+ status: "TODO",
54
+ label: "To Do"
55
+ },
56
+ {
57
+ status: "IN_PROGRESS",
58
+ label: "In Progress"
59
+ },
60
+ {
61
+ status: "IN_REVIEW",
62
+ label: "In Review"
63
+ },
64
+ {
65
+ status: "DONE",
66
+ label: "Done"
67
+ }
68
+ ], O = D.map((e) => e.status), k = T`
46
69
  mutation HealthyBowlNotifyMention($input: HealthyBowlNotifyMentionInput!) {
47
70
  healthybowlNotifyMention(input: $input)
48
71
  }
49
- `, j = () => {
50
- let { workspaceId: m, currentUser: g, authToken: _, apiGatewayUrl: y } = e(), T = D("workspace"), j = g?.id, [M] = x(), N = M.get("item") ?? void 0, P = b(), { buildPath: F } = r(), I = d(() => {
72
+ `, A = () => {
73
+ let { workspaceId: p, currentUser: h, authToken: g, apiGatewayUrl: y } = e(), T = ae("workspace"), A = h?.id, [j] = x(), M = j.get("item") ?? void 0, N = b(), { buildPath: P } = te(), F = u(() => {
51
74
  let e = new URLSearchParams({ date: l() });
52
- j && e.set("assignee", j), P(`${F("tasks/job-card")}?${e.toString()}`);
75
+ A && e.set("assignee", A), N(`${P("tasks/job-card")}?${e.toString()}`);
53
76
  }, [
77
+ N,
54
78
  P,
55
- F,
56
- j
57
- ]), { projectId: L, loading: R, error: z, retry: B } = s(T, m, j), { members: V } = O({
58
- workspaceId: m,
59
- authToken: _,
79
+ A
80
+ ]), { projectId: I, loading: L, resolved: R, error: z, retry: B, ensureProject: V } = s(T, p, A), { members: H } = oe({
81
+ workspaceId: p,
82
+ authToken: g,
60
83
  apiGatewayUrl: y
61
- }), H = f(() => V.map((e) => ({
84
+ }), U = d(() => H.map((e) => ({
62
85
  id: e.id,
63
86
  name: e.name
64
- })), [V]), U = f(() => new Map(V.map((e) => [e.id, e.name])), [V]), W = d((e) => {
65
- let t = U.get(e);
87
+ })), [H]), W = d(() => new Map(H.map((e) => [e.id, e.name])), [H]), G = u((e) => {
88
+ let t = W.get(e);
66
89
  return t ? { name: t } : null;
67
- }, [U]), G = u(), K = t(), { locale: q } = p(), { canManage: J } = c(m), Y = d((e) => {
90
+ }, [W]), K = re(), q = t(), { locale: J } = ie(), { canManage: Y } = c(p), X = u((e) => {
68
91
  !T || e.mentionedIds.length === 0 || T.mutate({
69
- mutation: A,
92
+ mutation: k,
70
93
  variables: { input: {
71
94
  taskId: e.entityId,
72
95
  mentionedUserIds: e.mentionedIds
73
96
  } }
74
97
  }).catch(() => {});
75
- }, [T]), X = [
76
- {
77
- status: "BACKLOG",
78
- label: "Backlog"
79
- },
80
- {
81
- status: "TODO",
82
- label: "To Do"
83
- },
84
- {
85
- status: "IN_PROGRESS",
86
- label: "In Progress"
87
- },
88
- {
89
- status: "IN_REVIEW",
90
- label: "In Review"
91
- },
92
- {
93
- status: "DONE",
94
- label: "Done"
98
+ }, [T]), [ce, Z] = f(!1), [le, Q] = f(!1), ue = u(async () => {
99
+ Z(!0);
100
+ try {
101
+ await V() && Q(!0);
102
+ } finally {
103
+ Z(!1);
95
104
  }
96
- ], Z = f(() => T ? /* @__PURE__ */ S(E, {
105
+ }, [V]), $ = u(() => Q(!1), []), de = d(() => T ? /* @__PURE__ */ S(E, {
97
106
  client: T,
98
107
  children: /* @__PURE__ */ S(o, {
99
- columns: X,
100
- workspaceId: m,
101
- projectId: L ?? void 0,
102
- readonly: !J,
103
- currentActorId: j,
108
+ columns: D,
109
+ workspaceId: p,
110
+ projectId: I ?? void 0,
111
+ readonly: !Y,
112
+ currentActorId: A,
104
113
  commentsEntityType: "planmagnet_workitem",
105
- onMention: Y,
106
- openItemId: N,
107
- labels: G,
108
- locale: q,
109
- assigneeOptions: H,
110
- resolveAssignee: W,
114
+ onMention: X,
115
+ openItemId: M,
116
+ labels: K,
117
+ locale: J,
118
+ assigneeOptions: U,
119
+ resolveAssignee: G,
111
120
  linkSourceProduct: "healthybowl",
112
- renderLinkIcon: k,
121
+ renderLinkIcon: se,
113
122
  enableSavedViews: !0,
114
123
  enableShortcuts: !0,
115
124
  onTaskSaved: () => {}
116
125
  })
117
126
  }) : null, [
118
127
  T,
119
- m,
120
- L,
128
+ p,
129
+ I,
130
+ Y,
131
+ A,
132
+ M,
133
+ K,
121
134
  J,
122
- j,
123
- N,
135
+ U,
124
136
  G,
125
- q,
126
- H,
127
- W,
128
- Y
137
+ X
129
138
  ]);
130
- return /* @__PURE__ */ S(n, {
131
- title: K("healthybowl.tasks.pageTitle", "Farm Tasks"),
139
+ return /* @__PURE__ */ C(ee, {
140
+ title: q("healthybowl.tasks.pageTitle", "Farm Tasks"),
132
141
  titleAccent: "Tasks",
133
- description: K("healthybowl.tasks.pageDescription", "Plan and track farm work — planting, harvesting, maintenance, and more — on a shared board."),
134
- helpPrompt: K("healthybowl.tasks.helpPrompt", "How do I use Farm Tasks to plan and track work on my farm?"),
135
- purpose: K("healthybowl.tasks.purpose", "Farm Tasks is your team's shared to-do board. Create tasks, set priority and due dates, drag them across columns as work progresses, and open any task for details."),
136
- purposeIcon: /* @__PURE__ */ S(h, {
142
+ description: q("healthybowl.tasks.pageDescription", "Plan and track farm work — planting, harvesting, maintenance, and more — on a shared board."),
143
+ helpPrompt: q("healthybowl.tasks.helpPrompt", "How do I use Farm Tasks to plan and track work on my farm?"),
144
+ purpose: q("healthybowl.tasks.purpose", "Farm Tasks is your team's shared to-do board. Create tasks, set priority and due dates, drag them across columns as work progresses, and open any task for details."),
145
+ purposeIcon: /* @__PURE__ */ S(m, {
137
146
  className: "size-5",
138
147
  "aria-hidden": "true"
139
148
  }),
140
149
  actions: /* @__PURE__ */ C(w, {
141
150
  variant: "outline",
142
- onClick: I,
151
+ onClick: F,
143
152
  children: [
144
153
  /* @__PURE__ */ S(v, {
145
154
  className: "me-1.5 h-4 w-4",
146
155
  "aria-hidden": "true"
147
156
  }),
148
157
  " ",
149
- K("healthybowl.tasks.printJobCard", "Print job card")
158
+ q("healthybowl.tasks.printJobCard", "Print job card")
150
159
  ]
151
160
  }),
152
- children: T ? z ? /* @__PURE__ */ S(i, {
161
+ children: [T ? z ? /* @__PURE__ */ S(n, {
153
162
  title: "Couldn't open Farm Tasks",
154
163
  description: z.message,
155
164
  onRetry: B
156
- }) : R || !L ? /* @__PURE__ */ S(a, {}) : Z : /* @__PURE__ */ S(i, {
165
+ }) : L || !R ? /* @__PURE__ */ S(r, {}) : I ? de : /* @__PURE__ */ S(ne, {
166
+ icon: /* @__PURE__ */ S(m, {
167
+ className: "size-8",
168
+ "aria-hidden": "true"
169
+ }),
170
+ title: q("healthybowl.tasks.emptyTitle", "No farm tasks yet"),
171
+ description: Y ? q("healthybowl.tasks.emptyDescription", "Add your first task to start planning farm work on a shared board.") : q("healthybowl.tasks.emptyDescriptionReadOnly", "Tasks your team adds will appear here."),
172
+ action: Y ? /* @__PURE__ */ C(w, {
173
+ onClick: () => void ue(),
174
+ disabled: ce,
175
+ children: [
176
+ /* @__PURE__ */ S(_, {
177
+ className: "me-1.5 h-4 w-4",
178
+ "aria-hidden": "true"
179
+ }),
180
+ " ",
181
+ q("healthybowl.tasks.emptyAction", "New task")
182
+ ]
183
+ }) : void 0
184
+ }) : /* @__PURE__ */ S(n, {
157
185
  title: "Tasks unavailable",
158
186
  description: "The workspace connection isn't ready. Reload the page or reselect your workspace."
159
- })
187
+ }), T && I ? /* @__PURE__ */ S(i, {
188
+ open: le,
189
+ onClose: $,
190
+ title: q("healthybowl.tasks.newTaskTitle", "New task"),
191
+ children: /* @__PURE__ */ S(E, {
192
+ client: T,
193
+ children: /* @__PURE__ */ S(a, {
194
+ workspaceId: p,
195
+ projectId: I,
196
+ hideHeader: !0,
197
+ statuses: O,
198
+ assigneeOptions: U,
199
+ hiddenFields: [
200
+ "type",
201
+ "storyPoints",
202
+ "labels"
203
+ ],
204
+ onCreated: $,
205
+ onCancel: $
206
+ })
207
+ })
208
+ }) : null]
160
209
  });
161
210
  };
162
211
  //#endregion
163
- export { j as TasksPage };
212
+ export { A as TasksPage };
@@ -0,0 +1,37 @@
1
+ import { decideAfterCreate as e } from "./defaultTaskProjectDecision.js";
2
+ //#region src/healthybowl/pages/tasks/defaultTaskProjectResolver.ts
3
+ var t = "FARM", n = "Farm Tasks";
4
+ function r(e) {
5
+ return e.find((e) => e.key === "FARM") ?? e[0];
6
+ }
7
+ function i(i, a, o) {
8
+ let s = null, c = async () => r(await i.listProjects(a))?.id ?? null, l = async () => {
9
+ let r = await c();
10
+ if (r) return r;
11
+ if (!o) throw Error("Cannot create the Farm Tasks project without a current user.");
12
+ let s = await i.createProject({
13
+ name: n,
14
+ key: t,
15
+ ownerId: o,
16
+ methodology: "KANBAN"
17
+ }), l = s.data?.planmagnetCreateProject?.id;
18
+ if (l) return l;
19
+ let u = e(s, await i.listProjects(a), t);
20
+ if (u.ok) return u.id;
21
+ throw Error(u.message);
22
+ };
23
+ return {
24
+ find: c,
25
+ ensure: () => {
26
+ if (!s) {
27
+ let e = l();
28
+ s = e, e.catch(() => {
29
+ s === e && (s = null);
30
+ });
31
+ }
32
+ return s;
33
+ }
34
+ };
35
+ }
36
+ //#endregion
37
+ export { t as FARM_TASKS_PROJECT_KEY, i as createTaskProjectResolver };
@@ -1,8 +1,8 @@
1
- import { decideAfterCreate as e } from "./defaultTaskProjectDecision.js";
2
- import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
1
+ import { createTaskProjectResolver as e } from "./defaultTaskProjectResolver.js";
2
+ import { useCallback as t, useEffect as n, useMemo as r, useState as i } from "react";
3
3
  import { gql as a } from "@apollo/client";
4
4
  //#region src/healthybowl/pages/tasks/useDefaultTaskProject.ts
5
- var o = "FARM", s = "Farm Tasks", c = a`
5
+ var o = a`
6
6
  query HealthyBowlListTaskProjects($workspaceId: ID!) {
7
7
  planmagnetProjects(workspaceId: $workspaceId) {
8
8
  items {
@@ -12,7 +12,7 @@ var o = "FARM", s = "Farm Tasks", c = a`
12
12
  }
13
13
  }
14
14
  }
15
- `, l = a`
15
+ `, s = a`
16
16
  mutation HealthyBowlCreateTaskProject($input: PlanmagnetCreateProjectInput!) {
17
17
  planmagnetCreateProject(input: $input) {
18
18
  id
@@ -21,64 +21,58 @@ var o = "FARM", s = "Farm Tasks", c = a`
21
21
  }
22
22
  }
23
23
  `;
24
- function u(a, u, d) {
25
- let [f, p] = i(null), [m, h] = i(!1), [g, _] = i(null), [v, y] = i(0), b = r(null), x = t(() => {
26
- _(null), p(null), y((e) => e + 1);
24
+ function c(e) {
25
+ return {
26
+ listProjects: async (t) => (await e.query({
27
+ query: o,
28
+ variables: { workspaceId: t },
29
+ fetchPolicy: "network-only"
30
+ })).data?.planmagnetProjects?.items ?? [],
31
+ createProject: (t) => e.mutate({
32
+ mutation: s,
33
+ variables: { input: t }
34
+ })
35
+ };
36
+ }
37
+ function l(a, o, s) {
38
+ let [l, u] = i(null), [d, f] = i(!1), [p, m] = i(!1), [h, g] = i(null), [_, v] = i(0), y = r(() => a && o ? e(c(a), o, s) : null, [
39
+ a,
40
+ o,
41
+ s
42
+ ]), b = t(() => {
43
+ g(null), u(null), f(!1), v((e) => e + 1);
27
44
  }, []);
28
45
  return n(() => {
29
- if (!a || !u) {
30
- h(!1);
46
+ if (u(null), f(!1), !y) {
47
+ m(!1);
31
48
  return;
32
49
  }
33
- let t = !1;
34
- h(!0), _(null);
35
- let n = async () => {
36
- let t = (await a.query({
37
- query: c,
38
- variables: { workspaceId: u },
39
- fetchPolicy: "network-only"
40
- })).data?.planmagnetProjects?.items ?? [], n = t.find((e) => e.key === "FARM") ?? t[0];
41
- if (n) return n.id;
42
- if (!d) throw Error("Cannot create the Farm Tasks project without a current user.");
43
- let r = e(await a.mutate({
44
- mutation: l,
45
- variables: { input: {
46
- name: s,
47
- key: o,
48
- ownerId: d,
49
- methodology: "KANBAN"
50
- } }
51
- }), (await a.query({
52
- query: c,
53
- variables: { workspaceId: u },
54
- fetchPolicy: "network-only"
55
- })).data?.planmagnetProjects?.items ?? [], o);
56
- if (r.ok) return r.id;
57
- throw Error(r.message);
58
- }, r = `${u}::${d ?? ""}::${v}`;
59
- return (!b.current || b.current.key !== r) && (b.current = {
60
- key: r,
61
- promise: n()
62
- }), b.current.promise.then((e) => {
63
- t || p(e);
64
- }).catch((e) => {
65
- b.current?.key === r && (b.current = null), t || _(e instanceof Error ? e : Error(String(e)));
50
+ let e = !1;
51
+ return m(!0), g(null), y.find().then((t) => {
52
+ e || (u((e) => e ?? t), f(!0));
53
+ }).catch((t) => {
54
+ e || g(t instanceof Error ? t : Error(String(t)));
66
55
  }).finally(() => {
67
- t || h(!1);
56
+ e || m(!1);
68
57
  }), () => {
69
- t = !0;
58
+ e = !0;
70
59
  };
71
- }, [
72
- a,
73
- u,
74
- d,
75
- v
76
- ]), {
77
- projectId: f,
78
- loading: m,
79
- error: g,
80
- retry: x
60
+ }, [y, _]), {
61
+ projectId: l,
62
+ loading: p,
63
+ resolved: d,
64
+ error: h,
65
+ retry: b,
66
+ ensureProject: t(async () => {
67
+ if (!y) return null;
68
+ try {
69
+ let e = await y.ensure();
70
+ return g(null), u(e), f(!0), e;
71
+ } catch (e) {
72
+ return g(e instanceof Error ? e : Error(String(e))), null;
73
+ }
74
+ }, [y])
81
75
  };
82
76
  }
83
77
  //#endregion
84
- export { u as useDefaultTaskProject };
78
+ export { l as useDefaultTaskProject };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-healthybowl",
3
- "version": "2026.1011.1",
3
+ "version": "2026.1013.2",
4
4
  "description": "Burdenoff HealthyBowl Microfrontend - Comprehensive organic farming and agro-foods management platform",
5
5
  "type": "module",
6
6
  "files": [