@burdenoff/microfe-timecampus 2026.1107.4 → 2026.1107.6

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.
Files changed (62) hide show
  1. package/dist/generated/wspace-operations.d.ts +1463 -0
  2. package/dist/generated/wspace-operations.d.ts.map +1 -1
  3. package/dist/generated/wspace-operations.js +1849 -1414
  4. package/dist/generated/wspace-operations.js.map +1 -1
  5. package/dist/generated/wspace-types.d.ts +223 -0
  6. package/dist/generated/wspace-types.d.ts.map +1 -1
  7. package/dist/generated/wspace-types.js +21 -17
  8. package/dist/generated/wspace-types.js.map +1 -1
  9. package/dist/index.js +7 -7
  10. package/dist/timecampus/TimeCampusRoutes.d.ts.map +1 -1
  11. package/dist/timecampus/TimeCampusRoutes.js +132 -124
  12. package/dist/timecampus/TimeCampusRoutes.js.map +1 -1
  13. package/dist/timecampus/analytics/timecampusAnalytics.d.ts +7 -1
  14. package/dist/timecampus/analytics/timecampusAnalytics.d.ts.map +1 -1
  15. package/dist/timecampus/analytics/timecampusAnalytics.js +12 -0
  16. package/dist/timecampus/analytics/timecampusAnalytics.js.map +1 -1
  17. package/dist/timecampus/analytics/useTimeCampusAnalytics.d.ts.map +1 -1
  18. package/dist/timecampus/analytics/useTimeCampusAnalytics.js +1 -0
  19. package/dist/timecampus/analytics/useTimeCampusAnalytics.js.map +1 -1
  20. package/dist/timecampus/index.js +7 -7
  21. package/dist/timecampus/pages/extend/AppletDeveloperPage.d.ts +2 -0
  22. package/dist/timecampus/pages/extend/AppletDeveloperPage.d.ts.map +1 -0
  23. package/dist/timecampus/pages/extend/AppletDeveloperPage.js +366 -0
  24. package/dist/timecampus/pages/extend/AppletDeveloperPage.js.map +1 -0
  25. package/dist/timecampus/pages/extend/AppletReviewPage.d.ts +2 -0
  26. package/dist/timecampus/pages/extend/AppletReviewPage.d.ts.map +1 -0
  27. package/dist/timecampus/pages/extend/AppletReviewPage.js +308 -0
  28. package/dist/timecampus/pages/extend/AppletReviewPage.js.map +1 -0
  29. package/dist/timecampus/pages/extend/AppletStorePage.d.ts.map +1 -1
  30. package/dist/timecampus/pages/extend/AppletStorePage.js +88 -83
  31. package/dist/timecampus/pages/extend/AppletStorePage.js.map +1 -1
  32. package/dist/timecampus/pages/extend/SandboxedAppletWidget.d.ts +14 -0
  33. package/dist/timecampus/pages/extend/SandboxedAppletWidget.d.ts.map +1 -0
  34. package/dist/timecampus/pages/extend/SandboxedAppletWidget.js +86 -0
  35. package/dist/timecampus/pages/extend/SandboxedAppletWidget.js.map +1 -0
  36. package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.d.ts +11 -0
  37. package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.d.ts.map +1 -0
  38. package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js +267 -0
  39. package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js.map +1 -0
  40. package/dist/timecampus/pages/extend/WidgetDashboardPage.d.ts.map +1 -1
  41. package/dist/timecampus/pages/extend/WidgetDashboardPage.js +147 -141
  42. package/dist/timecampus/pages/extend/WidgetDashboardPage.js.map +1 -1
  43. package/dist/timecampus/pages/extend/appletBridge.d.ts +70 -0
  44. package/dist/timecampus/pages/extend/appletBridge.d.ts.map +1 -0
  45. package/dist/timecampus/pages/extend/appletBridge.js +67 -0
  46. package/dist/timecampus/pages/extend/appletBridge.js.map +1 -0
  47. package/dist/timecampus/pages/extend/appletPublishingHelpers.d.ts +36 -0
  48. package/dist/timecampus/pages/extend/appletPublishingHelpers.d.ts.map +1 -0
  49. package/dist/timecampus/pages/extend/appletPublishingHelpers.js +120 -0
  50. package/dist/timecampus/pages/extend/appletPublishingHelpers.js.map +1 -0
  51. package/dist/timecampus/pages/time-approval/SubmitTimesheetModal.d.ts +14 -0
  52. package/dist/timecampus/pages/time-approval/SubmitTimesheetModal.d.ts.map +1 -0
  53. package/dist/timecampus/pages/time-approval/SubmitTimesheetModal.js +238 -0
  54. package/dist/timecampus/pages/time-approval/SubmitTimesheetModal.js.map +1 -0
  55. package/dist/timecampus/pages/time-approval/TimeApprovalPage.d.ts.map +1 -1
  56. package/dist/timecampus/pages/time-approval/TimeApprovalPage.js +122 -87
  57. package/dist/timecampus/pages/time-approval/TimeApprovalPage.js.map +1 -1
  58. package/dist/timecampus/pages/time-approval/timesheetPeriod.d.ts +80 -0
  59. package/dist/timecampus/pages/time-approval/timesheetPeriod.d.ts.map +1 -0
  60. package/dist/timecampus/pages/time-approval/timesheetPeriod.js +103 -0
  61. package/dist/timecampus/pages/time-approval/timesheetPeriod.js.map +1 -0
  62. package/package.json +1 -1
@@ -4,90 +4,91 @@ import { LoadingSkeleton as a } from "../../components/LoadingSkeleton.js";
4
4
  import { EmptyState as o } from "../../components/EmptyState.js";
5
5
  import { useGetFocusProtectionSummaryQuery as s, useGetPomodoroStatsQuery as c, useGetTimeEntryStatsQuery as l, useGetWidgetDashboardQuery as u, useListAppletsQuery as d, useListProjectsQuery as f, useListRunningTimersQuery as p, useListTimeEntriesQuery as m, useResetMyWidgetLayoutMutation as h, useUpdateMyWidgetLayoutMutation as g } from "../../../generated/wspace-operations.js";
6
6
  import { PageLayout as _ } from "../../components/PageLayout.js";
7
- import { ToastContainer as v, useToast as y } from "../../components/Toast.js";
8
- import { addWidget as ee, catalogueIcon as b, moveWidget as x, periodStarts as S, removeWidget as te, sameLayout as C } from "./extendHelpers.js";
7
+ import { ToastContainer as v, useToast as ee } from "../../components/Toast.js";
8
+ import { addWidget as y, catalogueIcon as b, moveWidget as x, periodStarts as S, removeWidget as te, sameLayout as C } from "./extendHelpers.js";
9
9
  import { useOpenRoute as w } from "./useOpenRoute.js";
10
- import { useMemo as T, useState as E } from "react";
11
- import { ArrowDown as D, ArrowUp as O, Plus as k, RotateCcw as A, Settings2 as j, Store as M, X as N } from "lucide-react";
12
- import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
13
- import { GlassCard as ne } from "@burdenoff/fe-libs/ui";
10
+ import { SandboxedAppletWidget as T } from "./SandboxedAppletWidget.js";
11
+ import { useMemo as E, useState as D } from "react";
12
+ import { ArrowDown as O, ArrowUp as k, Plus as A, RotateCcw as j, Settings2 as M, Store as N, X as P } from "lucide-react";
13
+ import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
14
+ import { GlassCard as R } from "@burdenoff/fe-libs/ui";
14
15
  //#region src/timecampus/pages/extend/WidgetDashboardPage.tsx
15
- var L = "inline-flex items-center justify-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50", R = "inline-flex items-center justify-center gap-1.5 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-surface-hover disabled:opacity-50", z = "inline-flex h-7 w-7 items-center justify-center rounded-md border border-border-subtle bg-bg-surface text-text-secondary hover:text-text-primary disabled:opacity-40";
16
- function B(e) {
16
+ var z = "inline-flex items-center justify-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50", B = "inline-flex items-center justify-center gap-1.5 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-surface-hover disabled:opacity-50", V = "inline-flex h-7 w-7 items-center justify-center rounded-md border border-border-subtle bg-bg-surface text-text-secondary hover:text-text-primary disabled:opacity-40";
17
+ function H(e) {
17
18
  return e instanceof Error ? e.message : "Something went wrong";
18
19
  }
19
- function V({ label: e, value: t }) {
20
- return /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
20
+ function U({ label: e, value: t }) {
21
+ return /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
21
22
  className: "text-xs text-text-tertiary",
22
23
  children: e
23
- }), /* @__PURE__ */ F("p", {
24
+ }), /* @__PURE__ */ I("p", {
24
25
  className: "text-2xl font-semibold text-text-primary",
25
26
  children: t
26
27
  })] });
27
28
  }
28
- function H({ children: e }) {
29
- return /* @__PURE__ */ F("p", {
29
+ function W({ children: e }) {
30
+ return /* @__PURE__ */ I("p", {
30
31
  className: "text-sm text-text-secondary",
31
32
  children: e
32
33
  });
33
34
  }
34
- function U({ since: e, label: t }) {
35
+ function G({ since: e, label: t }) {
35
36
  let { data: n, loading: i, error: a } = l({ variables: { startDate: e.toISOString() } });
36
- if (i && !n) return /* @__PURE__ */ F(H, { children: "Loading…" });
37
- if (a) return /* @__PURE__ */ F(H, { children: "Couldn't load hours." });
37
+ if (i && !n) return /* @__PURE__ */ I(W, { children: "Loading…" });
38
+ if (a) return /* @__PURE__ */ I(W, { children: "Couldn't load hours." });
38
39
  let o = n?.timeEntryStats;
39
- return /* @__PURE__ */ I("div", {
40
+ return /* @__PURE__ */ L("div", {
40
41
  className: "grid grid-cols-3 gap-3",
41
42
  children: [
42
- /* @__PURE__ */ F(V, {
43
+ /* @__PURE__ */ I(U, {
43
44
  label: t,
44
45
  value: r(o?.totalHours ?? 0)
45
46
  }),
46
- /* @__PURE__ */ F(V, {
47
+ /* @__PURE__ */ I(U, {
47
48
  label: "Billable",
48
49
  value: r(o?.billableHours ?? 0)
49
50
  }),
50
- /* @__PURE__ */ F(V, {
51
+ /* @__PURE__ */ I(U, {
51
52
  label: "Entries",
52
53
  value: o?.totalEntries ?? 0
53
54
  })
54
55
  ]
55
56
  });
56
57
  }
57
- function W() {
58
+ function K() {
58
59
  let e = t(), { data: r, loading: i, error: a } = p();
59
- if (i && !r) return /* @__PURE__ */ F(H, { children: "Loading…" });
60
- if (a) return /* @__PURE__ */ F(H, { children: "Couldn't load timers." });
60
+ if (i && !r) return /* @__PURE__ */ I(W, { children: "Loading…" });
61
+ if (a) return /* @__PURE__ */ I(W, { children: "Couldn't load timers." });
61
62
  let o = r?.runningTimers?.[0];
62
- return o ? /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
63
+ return o ? /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
63
64
  className: "text-2xl font-semibold text-text-primary",
64
65
  children: n(o.elapsedSeconds)
65
- }), /* @__PURE__ */ I("p", {
66
+ }), /* @__PURE__ */ L("p", {
66
67
  className: "text-sm text-text-secondary",
67
68
  children: [o.timeEntry.description || "Untitled entry", o.timeEntry.project ? ` · ${o.timeEntry.project.name}` : ""]
68
- })] }) : /* @__PURE__ */ I("div", {
69
+ })] }) : /* @__PURE__ */ L("div", {
69
70
  className: "flex flex-wrap items-center justify-between gap-2",
70
- children: [/* @__PURE__ */ F(H, { children: "No timer running." }), /* @__PURE__ */ F("button", {
71
+ children: [/* @__PURE__ */ I(W, { children: "No timer running." }), /* @__PURE__ */ I("button", {
71
72
  type: "button",
72
- className: R,
73
+ className: B,
73
74
  onClick: () => e("/time/timer"),
74
75
  children: "Start a timer"
75
76
  })]
76
77
  });
77
78
  }
78
- function G() {
79
+ function q() {
79
80
  let { data: e, loading: t, error: r } = m({ variables: { pagination: { limit: 5 } } });
80
- if (t && !e) return /* @__PURE__ */ F(H, { children: "Loading…" });
81
- if (r) return /* @__PURE__ */ F(H, { children: "Couldn't load entries." });
81
+ if (t && !e) return /* @__PURE__ */ I(W, { children: "Loading…" });
82
+ if (r) return /* @__PURE__ */ I(W, { children: "Couldn't load entries." });
82
83
  let a = e?.timeEntries?.items ?? [];
83
- return a.length === 0 ? /* @__PURE__ */ F(H, { children: "No time entries yet." }) : /* @__PURE__ */ F("ul", {
84
+ return a.length === 0 ? /* @__PURE__ */ I(W, { children: "No time entries yet." }) : /* @__PURE__ */ I("ul", {
84
85
  className: "divide-y divide-border-subtle",
85
- children: a.map((e) => /* @__PURE__ */ I("li", {
86
+ children: a.map((e) => /* @__PURE__ */ L("li", {
86
87
  className: "flex items-center justify-between gap-3 py-1.5",
87
- children: [/* @__PURE__ */ F("span", {
88
+ children: [/* @__PURE__ */ I("span", {
88
89
  className: "min-w-0 truncate text-sm text-text-primary",
89
90
  children: e.description || e.project?.name || "Untitled entry"
90
- }), /* @__PURE__ */ I("span", {
91
+ }), /* @__PURE__ */ L("span", {
91
92
  className: "shrink-0 text-xs text-text-tertiary",
92
93
  children: [
93
94
  n(e.duration ?? 0),
@@ -99,60 +100,60 @@ function G() {
99
100
  }, e.id))
100
101
  });
101
102
  }
102
- function K() {
103
+ function J() {
103
104
  let { data: e, loading: t, error: n } = f({ variables: {
104
105
  filter: { status: "ACTIVE" },
105
106
  pagination: { limit: 5 }
106
107
  } });
107
- if (t && !e) return /* @__PURE__ */ F(H, { children: "Loading…" });
108
- if (n) return /* @__PURE__ */ F(H, { children: "Couldn't load projects." });
108
+ if (t && !e) return /* @__PURE__ */ I(W, { children: "Loading…" });
109
+ if (n) return /* @__PURE__ */ I(W, { children: "Couldn't load projects." });
109
110
  let i = e?.projects?.items ?? [];
110
- return i.length === 0 ? /* @__PURE__ */ F(H, { children: "No active projects." }) : /* @__PURE__ */ F("ul", {
111
+ return i.length === 0 ? /* @__PURE__ */ I(W, { children: "No active projects." }) : /* @__PURE__ */ I("ul", {
111
112
  className: "divide-y divide-border-subtle",
112
- children: i.map((e) => /* @__PURE__ */ I("li", {
113
+ children: i.map((e) => /* @__PURE__ */ L("li", {
113
114
  className: "flex items-center justify-between gap-3 py-1.5",
114
- children: [/* @__PURE__ */ I("span", {
115
+ children: [/* @__PURE__ */ L("span", {
115
116
  className: "flex min-w-0 items-center gap-2 text-sm text-text-primary",
116
- children: [/* @__PURE__ */ F("span", {
117
+ children: [/* @__PURE__ */ I("span", {
117
118
  className: "h-2.5 w-2.5 shrink-0 rounded-full",
118
119
  style: { backgroundColor: e.color ?? "var(--color-accent-blue)" },
119
120
  "aria-hidden": "true"
120
- }), /* @__PURE__ */ F("span", {
121
+ }), /* @__PURE__ */ I("span", {
121
122
  className: "truncate",
122
123
  children: e.name
123
124
  })]
124
- }), /* @__PURE__ */ F("span", {
125
+ }), /* @__PURE__ */ I("span", {
125
126
  className: "shrink-0 text-xs text-text-tertiary",
126
127
  children: r(e.trackedHours ?? 0)
127
128
  })]
128
129
  }, e.id))
129
130
  });
130
131
  }
131
- function q() {
132
+ function Y() {
132
133
  let e = w(), n = t(), { data: r, loading: i, error: a } = d({ variables: { filter: { installedOnly: !0 } } });
133
- if (i && !r) return /* @__PURE__ */ F(H, { children: "Loading…" });
134
- if (a) return /* @__PURE__ */ F(H, { children: "Couldn't load applets." });
134
+ if (i && !r) return /* @__PURE__ */ I(W, { children: "Loading…" });
135
+ if (a) return /* @__PURE__ */ I(W, { children: "Couldn't load applets." });
135
136
  let o = r?.timeCampusApplets ?? [];
136
- return o.length === 0 ? /* @__PURE__ */ I("div", {
137
+ return o.length === 0 ? /* @__PURE__ */ L("div", {
137
138
  className: "flex flex-wrap items-center justify-between gap-2",
138
- children: [/* @__PURE__ */ F(H, { children: "No applets installed yet." }), /* @__PURE__ */ I("button", {
139
+ children: [/* @__PURE__ */ I(W, { children: "No applets installed yet." }), /* @__PURE__ */ L("button", {
139
140
  type: "button",
140
- className: R,
141
+ className: B,
141
142
  onClick: () => n("/applets"),
142
- children: [/* @__PURE__ */ F(M, {
143
+ children: [/* @__PURE__ */ I(N, {
143
144
  className: "h-4 w-4",
144
145
  "aria-hidden": "true"
145
146
  }), "Applet store"]
146
147
  })]
147
- }) : /* @__PURE__ */ F("div", {
148
+ }) : /* @__PURE__ */ I("div", {
148
149
  className: "flex flex-wrap gap-2",
149
150
  children: o.map((t) => {
150
151
  let n = b(t.icon);
151
- return /* @__PURE__ */ I("button", {
152
+ return /* @__PURE__ */ L("button", {
152
153
  type: "button",
153
- className: R,
154
+ className: B,
154
155
  onClick: () => e(t.route),
155
- children: [/* @__PURE__ */ F(n, {
156
+ children: [/* @__PURE__ */ I(n, {
156
157
  className: "h-4 w-4",
157
158
  "aria-hidden": "true"
158
159
  }), t.name]
@@ -160,33 +161,33 @@ function q() {
160
161
  })
161
162
  });
162
163
  }
163
- function J({ from: e, to: t }) {
164
+ function X({ from: e, to: t }) {
164
165
  let { data: r, loading: i, error: a } = s({ variables: {
165
166
  from: e.toISOString(),
166
167
  to: t.toISOString()
167
168
  } });
168
- if (i && !r) return /* @__PURE__ */ F(H, { children: "Loading…" });
169
- if (a) return /* @__PURE__ */ F(H, { children: "Couldn't load focus data." });
169
+ if (i && !r) return /* @__PURE__ */ I(W, { children: "Loading…" });
170
+ if (a) return /* @__PURE__ */ I(W, { children: "Couldn't load focus data." });
170
171
  let o = r?.timeCampusFocusSummary;
171
- return /* @__PURE__ */ I("div", {
172
+ return /* @__PURE__ */ L("div", {
172
173
  className: "grid grid-cols-3 gap-3",
173
174
  children: [
174
- /* @__PURE__ */ F(V, {
175
+ /* @__PURE__ */ I(U, {
175
176
  label: "Sessions",
176
177
  value: o?.totalSessions ?? 0
177
178
  }),
178
- /* @__PURE__ */ F(V, {
179
+ /* @__PURE__ */ I(U, {
179
180
  label: "Protected",
180
181
  value: n(o?.totalProtectedSeconds ?? 0)
181
182
  }),
182
- /* @__PURE__ */ F(V, {
183
+ /* @__PURE__ */ I(U, {
183
184
  label: "Interruptions",
184
185
  value: o?.totalInterruptionCount ?? 0
185
186
  })
186
187
  ]
187
188
  });
188
189
  }
189
- function Y({ from: t, to: n }) {
190
+ function Z({ from: t, to: n }) {
190
191
  let { workspaceId: r = "" } = e(), { data: i, loading: a, error: o } = c({
191
192
  variables: {
192
193
  workspaceId: r,
@@ -195,230 +196,235 @@ function Y({ from: t, to: n }) {
195
196
  },
196
197
  skip: !r
197
198
  });
198
- if (a && !i) return /* @__PURE__ */ F(H, { children: "Loading…" });
199
- if (o) return /* @__PURE__ */ F(H, { children: "Couldn't load pomodoros." });
199
+ if (a && !i) return /* @__PURE__ */ I(W, { children: "Loading…" });
200
+ if (o) return /* @__PURE__ */ I(W, { children: "Couldn't load pomodoros." });
200
201
  let s = i?.pomodoroStats;
201
- return /* @__PURE__ */ I("div", {
202
+ return /* @__PURE__ */ L("div", {
202
203
  className: "grid grid-cols-3 gap-3",
203
204
  children: [
204
- /* @__PURE__ */ F(V, {
205
+ /* @__PURE__ */ I(U, {
205
206
  label: "Completed",
206
207
  value: s?.completedSessions ?? 0
207
208
  }),
208
- /* @__PURE__ */ F(V, {
209
+ /* @__PURE__ */ I(U, {
209
210
  label: "Focus minutes",
210
211
  value: s?.totalFocusMinutes ?? 0
211
212
  }),
212
- /* @__PURE__ */ F(V, {
213
+ /* @__PURE__ */ I(U, {
213
214
  label: "Streak (days)",
214
215
  value: s?.streakDays ?? 0
215
216
  })
216
217
  ]
217
218
  });
218
219
  }
219
- function X({ widgetKey: e, now: t }) {
220
- let { today: n, week: r } = S(t);
220
+ function ne({ widgetKey: e, widget: t, now: n }) {
221
+ let { today: r, week: i } = S(n);
222
+ if (t?.frame) return /* @__PURE__ */ I(T, {
223
+ frame: t.frame,
224
+ title: t.name
225
+ });
221
226
  switch (e) {
222
- case "hours-today": return /* @__PURE__ */ F(U, {
223
- since: n,
227
+ case "hours-today": return /* @__PURE__ */ I(G, {
228
+ since: r,
224
229
  label: "Today"
225
230
  });
226
- case "hours-week": return /* @__PURE__ */ F(U, {
227
- since: r,
231
+ case "hours-week": return /* @__PURE__ */ I(G, {
232
+ since: i,
228
233
  label: "This week"
229
234
  });
230
- case "running-timer": return /* @__PURE__ */ F(W, {});
231
- case "recent-entries": return /* @__PURE__ */ F(G, {});
232
- case "active-projects": return /* @__PURE__ */ F(K, {});
233
- case "installed-applets": return /* @__PURE__ */ F(q, {});
234
- case "focus-week": return /* @__PURE__ */ F(J, {
235
- from: r,
236
- to: t
235
+ case "running-timer": return /* @__PURE__ */ I(K, {});
236
+ case "recent-entries": return /* @__PURE__ */ I(q, {});
237
+ case "active-projects": return /* @__PURE__ */ I(J, {});
238
+ case "installed-applets": return /* @__PURE__ */ I(Y, {});
239
+ case "focus-week": return /* @__PURE__ */ I(X, {
240
+ from: i,
241
+ to: n
237
242
  });
238
- case "pomodoro-week": return /* @__PURE__ */ F(Y, {
239
- from: r,
240
- to: t
243
+ case "pomodoro-week": return /* @__PURE__ */ I(Z, {
244
+ from: i,
245
+ to: n
241
246
  });
242
- default: return /* @__PURE__ */ F(H, { children: "This widget is not available here." });
247
+ default: return /* @__PURE__ */ I(W, { children: "This widget is not available here." });
243
248
  }
244
249
  }
245
- function Z() {
246
- let { workspaceId: n = "" } = e(), r = t(), { toasts: i, addToast: s, dismissToast: c } = y(), [l, d] = E(!1), [f, p] = E([]), [m] = E(() => /* @__PURE__ */ new Date()), { data: b, loading: S, error: w } = u({ skip: !n }), [V, { loading: U }] = g({ refetchQueries: ["GetWidgetDashboard"] }), [W, { loading: G }] = h({ refetchQueries: ["GetWidgetDashboard"] }), K = T(() => b?.timeCampusWidgets ?? [], [b]), q = T(() => new Map(K.map((e) => [e.key, e])), [K]), J = b?.timeCampusMyWidgetLayout, Y = T(() => J?.widgetKeys ?? [], [J]), Z = l ? f : Y, Q = K.filter((e) => e.available && !f.includes(e.key)), $ = K.filter((e) => !e.available), re = l ? /* @__PURE__ */ I("div", {
250
+ function Q() {
251
+ let { workspaceId: n = "" } = e(), r = t(), { toasts: i, addToast: s, dismissToast: c } = ee(), [l, d] = D(!1), [f, p] = D([]), [m] = D(() => /* @__PURE__ */ new Date()), { data: b, loading: S, error: w } = u({ skip: !n }), [T, { loading: U }] = g({ refetchQueries: ["GetWidgetDashboard"] }), [G, { loading: K }] = h({ refetchQueries: ["GetWidgetDashboard"] }), q = E(() => b?.timeCampusWidgets ?? [], [b]), J = E(() => new Map(q.map((e) => [e.key, e])), [q]), Y = b?.timeCampusMyWidgetLayout, X = E(() => Y?.widgetKeys ?? [], [Y]), Z = l ? f : X, Q = q.filter((e) => e.available && !f.includes(e.key)), $ = q.filter((e) => !e.available), re = l ? /* @__PURE__ */ L("div", {
247
252
  className: "flex flex-wrap gap-2",
248
253
  children: [
249
- /* @__PURE__ */ F("button", {
254
+ /* @__PURE__ */ I("button", {
250
255
  type: "button",
251
- className: R,
256
+ className: B,
252
257
  onClick: () => d(!1),
253
258
  children: "Cancel"
254
259
  }),
255
- /* @__PURE__ */ I("button", {
260
+ /* @__PURE__ */ L("button", {
256
261
  type: "button",
257
- className: R,
262
+ className: B,
258
263
  onClick: async () => {
259
264
  try {
260
- await W(), d(!1), s({
265
+ await G(), d(!1), s({
261
266
  title: "Dashboard reset to default",
262
267
  variant: "success"
263
268
  });
264
269
  } catch (e) {
265
270
  s({
266
- title: B(e),
271
+ title: H(e),
267
272
  variant: "error"
268
273
  });
269
274
  }
270
275
  },
271
- disabled: G || J?.isDefault,
272
- children: [/* @__PURE__ */ F(A, {
276
+ disabled: K || Y?.isDefault,
277
+ children: [/* @__PURE__ */ I(j, {
273
278
  className: "h-4 w-4",
274
279
  "aria-hidden": "true"
275
280
  }), "Reset to default"]
276
281
  }),
277
- /* @__PURE__ */ F("button", {
282
+ /* @__PURE__ */ I("button", {
278
283
  type: "button",
279
- className: L,
284
+ className: z,
280
285
  onClick: async () => {
281
286
  try {
282
- await V({ variables: { widgetKeys: f } }), d(!1), s({
287
+ await T({ variables: { widgetKeys: f } }), d(!1), s({
283
288
  title: "Dashboard saved",
284
289
  variant: "success"
285
290
  });
286
291
  } catch (e) {
287
292
  s({
288
- title: B(e),
293
+ title: H(e),
289
294
  variant: "error"
290
295
  });
291
296
  }
292
297
  },
293
- disabled: U || C(f, Y),
298
+ disabled: U || C(f, X),
294
299
  children: U ? "Saving…" : "Save layout"
295
300
  })
296
301
  ]
297
- }) : /* @__PURE__ */ I("button", {
302
+ }) : /* @__PURE__ */ L("button", {
298
303
  type: "button",
299
- className: R,
304
+ className: B,
300
305
  onClick: () => {
301
- p([...Y]), d(!0);
306
+ p([...X]), d(!0);
302
307
  },
303
- children: [/* @__PURE__ */ F(j, {
308
+ children: [/* @__PURE__ */ I(M, {
304
309
  className: "h-4 w-4",
305
310
  "aria-hidden": "true"
306
311
  }), "Customize"]
307
312
  });
308
- return /* @__PURE__ */ I(_, {
313
+ return /* @__PURE__ */ L(_, {
309
314
  title: "My Widgets",
310
315
  description: "Your own dashboard of live TimeCampus widgets",
311
316
  purpose: "Pick the widgets you want to see first — hours, running timer, recent entries, projects and your applets. Applets you install add their own widgets. Your layout is personal; it does not change anyone else's dashboard.",
312
317
  actions: !S && !w ? re : void 0,
313
- children: [/* @__PURE__ */ F(v, {
318
+ children: [/* @__PURE__ */ I(v, {
314
319
  toasts: i,
315
320
  onDismiss: c
316
- }), S && !b ? /* @__PURE__ */ F(a, {
321
+ }), S && !b ? /* @__PURE__ */ I(a, {
317
322
  variant: "card",
318
323
  count: 4
319
- }) : w ? /* @__PURE__ */ F(o, {
324
+ }) : w ? /* @__PURE__ */ I(o, {
320
325
  title: "Couldn't load your widgets",
321
326
  description: w.message,
322
327
  illustration: "error-state"
323
- }) : /* @__PURE__ */ I(P, { children: [Z.length === 0 ? /* @__PURE__ */ F(o, {
328
+ }) : /* @__PURE__ */ L(F, { children: [Z.length === 0 ? /* @__PURE__ */ I(o, {
324
329
  title: "No widgets on your dashboard",
325
330
  description: l ? "Add widgets from the list below." : "Choose Customize to add widgets.",
326
331
  illustration: "empty-generic"
327
- }) : /* @__PURE__ */ F("div", {
332
+ }) : /* @__PURE__ */ I("div", {
328
333
  className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
329
334
  children: Z.map((e, t) => {
330
- let n = q.get(e);
331
- return /* @__PURE__ */ I(ne, {
335
+ let n = J.get(e);
336
+ return /* @__PURE__ */ L(R, {
332
337
  treatment: "glass",
333
338
  className: "flex flex-col gap-3 p-5",
334
339
  "data-testid": `widget-${e}`,
335
- children: [/* @__PURE__ */ I("div", {
340
+ children: [/* @__PURE__ */ L("div", {
336
341
  className: "flex items-start justify-between gap-2",
337
- children: [/* @__PURE__ */ I("div", {
342
+ children: [/* @__PURE__ */ L("div", {
338
343
  className: "min-w-0",
339
- children: [/* @__PURE__ */ F("h2", {
344
+ children: [/* @__PURE__ */ I("h2", {
340
345
  className: "text-sm font-semibold text-text-primary",
341
346
  children: n?.name ?? e
342
- }), l && n && /* @__PURE__ */ F("p", {
347
+ }), l && n && /* @__PURE__ */ I("p", {
343
348
  className: "text-xs text-text-tertiary",
344
349
  children: n.description
345
350
  })]
346
- }), l && /* @__PURE__ */ I("div", {
351
+ }), l && /* @__PURE__ */ L("div", {
347
352
  className: "flex shrink-0 gap-1",
348
353
  children: [
349
- /* @__PURE__ */ F("button", {
354
+ /* @__PURE__ */ I("button", {
350
355
  type: "button",
351
- className: z,
356
+ className: V,
352
357
  onClick: () => p(x(f, e, -1)),
353
358
  disabled: t === 0,
354
359
  "aria-label": `Move ${n?.name ?? e} up`,
355
- children: /* @__PURE__ */ F(O, {
360
+ children: /* @__PURE__ */ I(k, {
356
361
  className: "h-4 w-4",
357
362
  "aria-hidden": "true"
358
363
  })
359
364
  }),
360
- /* @__PURE__ */ F("button", {
365
+ /* @__PURE__ */ I("button", {
361
366
  type: "button",
362
- className: z,
367
+ className: V,
363
368
  onClick: () => p(x(f, e, 1)),
364
369
  disabled: t === Z.length - 1,
365
370
  "aria-label": `Move ${n?.name ?? e} down`,
366
- children: /* @__PURE__ */ F(D, {
371
+ children: /* @__PURE__ */ I(O, {
367
372
  className: "h-4 w-4",
368
373
  "aria-hidden": "true"
369
374
  })
370
375
  }),
371
- /* @__PURE__ */ F("button", {
376
+ /* @__PURE__ */ I("button", {
372
377
  type: "button",
373
- className: z,
378
+ className: V,
374
379
  onClick: () => p(te(f, e)),
375
380
  "aria-label": `Remove ${n?.name ?? e}`,
376
- children: /* @__PURE__ */ F(N, {
381
+ children: /* @__PURE__ */ I(P, {
377
382
  className: "h-4 w-4",
378
383
  "aria-hidden": "true"
379
384
  })
380
385
  })
381
386
  ]
382
387
  })]
383
- }), /* @__PURE__ */ F(X, {
388
+ }), /* @__PURE__ */ I(ne, {
384
389
  widgetKey: e,
390
+ widget: n,
385
391
  now: m
386
392
  })]
387
393
  }, e);
388
394
  })
389
- }), l && /* @__PURE__ */ I("section", {
395
+ }), l && /* @__PURE__ */ L("section", {
390
396
  className: "mt-6",
391
397
  "aria-labelledby": "add-widgets-heading",
392
398
  children: [
393
- /* @__PURE__ */ F("h2", {
399
+ /* @__PURE__ */ I("h2", {
394
400
  id: "add-widgets-heading",
395
401
  className: "mb-3 text-sm font-semibold text-text-primary",
396
402
  children: "Add widgets"
397
403
  }),
398
- Q.length === 0 ? /* @__PURE__ */ F(H, { children: "Every available widget is on your dashboard." }) : /* @__PURE__ */ F("div", {
404
+ Q.length === 0 ? /* @__PURE__ */ I(W, { children: "Every available widget is on your dashboard." }) : /* @__PURE__ */ I("div", {
399
405
  className: "flex flex-wrap gap-2",
400
- children: Q.map((e) => /* @__PURE__ */ I("button", {
406
+ children: Q.map((e) => /* @__PURE__ */ L("button", {
401
407
  type: "button",
402
- className: R,
403
- onClick: () => p(ee(f, e.key)),
408
+ className: B,
409
+ onClick: () => p(y(f, e.key)),
404
410
  title: e.description,
405
- children: [/* @__PURE__ */ F(k, {
411
+ children: [/* @__PURE__ */ I(A, {
406
412
  className: "h-4 w-4",
407
413
  "aria-hidden": "true"
408
414
  }), e.name]
409
415
  }, e.key))
410
416
  }),
411
- $.length > 0 && /* @__PURE__ */ I("div", {
417
+ $.length > 0 && /* @__PURE__ */ L("div", {
412
418
  className: "mt-4 flex flex-wrap items-center gap-2 text-xs text-text-tertiary",
413
- children: [/* @__PURE__ */ I("span", { children: [
419
+ children: [/* @__PURE__ */ L("span", { children: [
414
420
  "Install an applet to unlock:",
415
421
  " ",
416
422
  $.map((e) => e.name).join(", ")
417
- ] }), /* @__PURE__ */ I("button", {
423
+ ] }), /* @__PURE__ */ L("button", {
418
424
  type: "button",
419
- className: R,
425
+ className: B,
420
426
  onClick: () => r("/applets"),
421
- children: [/* @__PURE__ */ F(M, {
427
+ children: [/* @__PURE__ */ I(N, {
422
428
  className: "h-4 w-4",
423
429
  "aria-hidden": "true"
424
430
  }), "Applet store"]
@@ -429,6 +435,6 @@ function Z() {
429
435
  });
430
436
  }
431
437
  //#endregion
432
- export { Z as WidgetDashboardPage };
438
+ export { Q as WidgetDashboardPage };
433
439
 
434
440
  //# sourceMappingURL=WidgetDashboardPage.js.map