@burdenoff/microfe-timecampus 2026.1107.3 → 2026.1107.5
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/generated/wspace-operations.d.ts +1604 -72
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +1883 -1449
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +242 -0
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +21 -17
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/timecampus/TimeCampusRoutes.d.ts.map +1 -1
- package/dist/timecampus/TimeCampusRoutes.js +132 -124
- package/dist/timecampus/TimeCampusRoutes.js.map +1 -1
- package/dist/timecampus/index.js +7 -7
- package/dist/timecampus/pages/extend/AppletDeveloperPage.d.ts +2 -0
- package/dist/timecampus/pages/extend/AppletDeveloperPage.d.ts.map +1 -0
- package/dist/timecampus/pages/extend/AppletDeveloperPage.js +366 -0
- package/dist/timecampus/pages/extend/AppletDeveloperPage.js.map +1 -0
- package/dist/timecampus/pages/extend/AppletReviewPage.d.ts +2 -0
- package/dist/timecampus/pages/extend/AppletReviewPage.d.ts.map +1 -0
- package/dist/timecampus/pages/extend/AppletReviewPage.js +308 -0
- package/dist/timecampus/pages/extend/AppletReviewPage.js.map +1 -0
- package/dist/timecampus/pages/extend/AppletStorePage.d.ts.map +1 -1
- package/dist/timecampus/pages/extend/AppletStorePage.js +88 -83
- package/dist/timecampus/pages/extend/AppletStorePage.js.map +1 -1
- package/dist/timecampus/pages/extend/SandboxedAppletWidget.d.ts +14 -0
- package/dist/timecampus/pages/extend/SandboxedAppletWidget.d.ts.map +1 -0
- package/dist/timecampus/pages/extend/SandboxedAppletWidget.js +86 -0
- package/dist/timecampus/pages/extend/SandboxedAppletWidget.js.map +1 -0
- package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.d.ts +11 -0
- package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.d.ts.map +1 -0
- package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js +267 -0
- package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js.map +1 -0
- package/dist/timecampus/pages/extend/WidgetDashboardPage.d.ts.map +1 -1
- package/dist/timecampus/pages/extend/WidgetDashboardPage.js +147 -141
- package/dist/timecampus/pages/extend/WidgetDashboardPage.js.map +1 -1
- package/dist/timecampus/pages/extend/appletBridge.d.ts +70 -0
- package/dist/timecampus/pages/extend/appletBridge.d.ts.map +1 -0
- package/dist/timecampus/pages/extend/appletBridge.js +67 -0
- package/dist/timecampus/pages/extend/appletBridge.js.map +1 -0
- package/dist/timecampus/pages/extend/appletPublishingHelpers.d.ts +36 -0
- package/dist/timecampus/pages/extend/appletPublishingHelpers.d.ts.map +1 -0
- package/dist/timecampus/pages/extend/appletPublishingHelpers.js +120 -0
- package/dist/timecampus/pages/extend/appletPublishingHelpers.js.map +1 -0
- package/dist/timecampus/pages/timeline/TimelinePage.d.ts.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.js +473 -239
- package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
- package/dist/timecampus/pages/timeline/timelineEditing.d.ts +76 -0
- package/dist/timecampus/pages/timeline/timelineEditing.d.ts.map +1 -0
- package/dist/timecampus/pages/timeline/timelineEditing.js +100 -0
- package/dist/timecampus/pages/timeline/timelineEditing.js.map +1 -0
- 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
|
|
8
|
-
import { addWidget as
|
|
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 {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
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
|
|
16
|
-
function
|
|
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
|
|
20
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
24
|
+
}), /* @__PURE__ */ I("p", {
|
|
24
25
|
className: "text-2xl font-semibold text-text-primary",
|
|
25
26
|
children: t
|
|
26
27
|
})] });
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
return /* @__PURE__ */
|
|
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
|
|
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__ */
|
|
37
|
-
if (a) return /* @__PURE__ */
|
|
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__ */
|
|
40
|
+
return /* @__PURE__ */ L("div", {
|
|
40
41
|
className: "grid grid-cols-3 gap-3",
|
|
41
42
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ I(U, {
|
|
43
44
|
label: t,
|
|
44
45
|
value: r(o?.totalHours ?? 0)
|
|
45
46
|
}),
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ I(U, {
|
|
47
48
|
label: "Billable",
|
|
48
49
|
value: r(o?.billableHours ?? 0)
|
|
49
50
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ I(U, {
|
|
51
52
|
label: "Entries",
|
|
52
53
|
value: o?.totalEntries ?? 0
|
|
53
54
|
})
|
|
54
55
|
]
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
+
function K() {
|
|
58
59
|
let e = t(), { data: r, loading: i, error: a } = p();
|
|
59
|
-
if (i && !r) return /* @__PURE__ */
|
|
60
|
-
if (a) return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
69
|
+
})] }) : /* @__PURE__ */ L("div", {
|
|
69
70
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
70
|
-
children: [/* @__PURE__ */
|
|
71
|
+
children: [/* @__PURE__ */ I(W, { children: "No timer running." }), /* @__PURE__ */ I("button", {
|
|
71
72
|
type: "button",
|
|
72
|
-
className:
|
|
73
|
+
className: B,
|
|
73
74
|
onClick: () => e("/time/timer"),
|
|
74
75
|
children: "Start a timer"
|
|
75
76
|
})]
|
|
76
77
|
});
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
+
function q() {
|
|
79
80
|
let { data: e, loading: t, error: r } = m({ variables: { pagination: { limit: 5 } } });
|
|
80
|
-
if (t && !e) return /* @__PURE__ */
|
|
81
|
-
if (r) return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
86
|
+
children: a.map((e) => /* @__PURE__ */ L("li", {
|
|
86
87
|
className: "flex items-center justify-between gap-3 py-1.5",
|
|
87
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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
|
|
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__ */
|
|
108
|
-
if (n) return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
113
|
+
children: i.map((e) => /* @__PURE__ */ L("li", {
|
|
113
114
|
className: "flex items-center justify-between gap-3 py-1.5",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ L("span", {
|
|
115
116
|
className: "flex min-w-0 items-center gap-2 text-sm text-text-primary",
|
|
116
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
121
|
+
}), /* @__PURE__ */ I("span", {
|
|
121
122
|
className: "truncate",
|
|
122
123
|
children: e.name
|
|
123
124
|
})]
|
|
124
|
-
}), /* @__PURE__ */
|
|
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
|
|
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__ */
|
|
134
|
-
if (a) return /* @__PURE__ */
|
|
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__ */
|
|
137
|
+
return o.length === 0 ? /* @__PURE__ */ L("div", {
|
|
137
138
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
138
|
-
children: [/* @__PURE__ */
|
|
139
|
+
children: [/* @__PURE__ */ I(W, { children: "No applets installed yet." }), /* @__PURE__ */ L("button", {
|
|
139
140
|
type: "button",
|
|
140
|
-
className:
|
|
141
|
+
className: B,
|
|
141
142
|
onClick: () => n("/applets"),
|
|
142
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
152
|
+
return /* @__PURE__ */ L("button", {
|
|
152
153
|
type: "button",
|
|
153
|
-
className:
|
|
154
|
+
className: B,
|
|
154
155
|
onClick: () => e(t.route),
|
|
155
|
-
children: [/* @__PURE__ */
|
|
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
|
|
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__ */
|
|
169
|
-
if (a) return /* @__PURE__ */
|
|
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__ */
|
|
172
|
+
return /* @__PURE__ */ L("div", {
|
|
172
173
|
className: "grid grid-cols-3 gap-3",
|
|
173
174
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ I(U, {
|
|
175
176
|
label: "Sessions",
|
|
176
177
|
value: o?.totalSessions ?? 0
|
|
177
178
|
}),
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ I(U, {
|
|
179
180
|
label: "Protected",
|
|
180
181
|
value: n(o?.totalProtectedSeconds ?? 0)
|
|
181
182
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ I(U, {
|
|
183
184
|
label: "Interruptions",
|
|
184
185
|
value: o?.totalInterruptionCount ?? 0
|
|
185
186
|
})
|
|
186
187
|
]
|
|
187
188
|
});
|
|
188
189
|
}
|
|
189
|
-
function
|
|
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__ */
|
|
199
|
-
if (o) return /* @__PURE__ */
|
|
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__ */
|
|
202
|
+
return /* @__PURE__ */ L("div", {
|
|
202
203
|
className: "grid grid-cols-3 gap-3",
|
|
203
204
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ I(U, {
|
|
205
206
|
label: "Completed",
|
|
206
207
|
value: s?.completedSessions ?? 0
|
|
207
208
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ I(U, {
|
|
209
210
|
label: "Focus minutes",
|
|
210
211
|
value: s?.totalFocusMinutes ?? 0
|
|
211
212
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
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
|
|
220
|
-
let { today:
|
|
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__ */
|
|
223
|
-
since:
|
|
227
|
+
case "hours-today": return /* @__PURE__ */ I(G, {
|
|
228
|
+
since: r,
|
|
224
229
|
label: "Today"
|
|
225
230
|
});
|
|
226
|
-
case "hours-week": return /* @__PURE__ */
|
|
227
|
-
since:
|
|
231
|
+
case "hours-week": return /* @__PURE__ */ I(G, {
|
|
232
|
+
since: i,
|
|
228
233
|
label: "This week"
|
|
229
234
|
});
|
|
230
|
-
case "running-timer": return /* @__PURE__ */
|
|
231
|
-
case "recent-entries": return /* @__PURE__ */
|
|
232
|
-
case "active-projects": return /* @__PURE__ */
|
|
233
|
-
case "installed-applets": return /* @__PURE__ */
|
|
234
|
-
case "focus-week": return /* @__PURE__ */
|
|
235
|
-
from:
|
|
236
|
-
to:
|
|
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__ */
|
|
239
|
-
from:
|
|
240
|
-
to:
|
|
243
|
+
case "pomodoro-week": return /* @__PURE__ */ I(Z, {
|
|
244
|
+
from: i,
|
|
245
|
+
to: n
|
|
241
246
|
});
|
|
242
|
-
default: return /* @__PURE__ */
|
|
247
|
+
default: return /* @__PURE__ */ I(W, { children: "This widget is not available here." });
|
|
243
248
|
}
|
|
244
249
|
}
|
|
245
|
-
function
|
|
246
|
-
let { workspaceId: n = "" } = e(), r = t(), { toasts: i, addToast: s, dismissToast: c } =
|
|
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__ */
|
|
254
|
+
/* @__PURE__ */ I("button", {
|
|
250
255
|
type: "button",
|
|
251
|
-
className:
|
|
256
|
+
className: B,
|
|
252
257
|
onClick: () => d(!1),
|
|
253
258
|
children: "Cancel"
|
|
254
259
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ L("button", {
|
|
256
261
|
type: "button",
|
|
257
|
-
className:
|
|
262
|
+
className: B,
|
|
258
263
|
onClick: async () => {
|
|
259
264
|
try {
|
|
260
|
-
await
|
|
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:
|
|
271
|
+
title: H(e),
|
|
267
272
|
variant: "error"
|
|
268
273
|
});
|
|
269
274
|
}
|
|
270
275
|
},
|
|
271
|
-
disabled:
|
|
272
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
282
|
+
/* @__PURE__ */ I("button", {
|
|
278
283
|
type: "button",
|
|
279
|
-
className:
|
|
284
|
+
className: z,
|
|
280
285
|
onClick: async () => {
|
|
281
286
|
try {
|
|
282
|
-
await
|
|
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:
|
|
293
|
+
title: H(e),
|
|
289
294
|
variant: "error"
|
|
290
295
|
});
|
|
291
296
|
}
|
|
292
297
|
},
|
|
293
|
-
disabled: U || C(f,
|
|
298
|
+
disabled: U || C(f, X),
|
|
294
299
|
children: U ? "Saving…" : "Save layout"
|
|
295
300
|
})
|
|
296
301
|
]
|
|
297
|
-
}) : /* @__PURE__ */
|
|
302
|
+
}) : /* @__PURE__ */ L("button", {
|
|
298
303
|
type: "button",
|
|
299
|
-
className:
|
|
304
|
+
className: B,
|
|
300
305
|
onClick: () => {
|
|
301
|
-
p([...
|
|
306
|
+
p([...X]), d(!0);
|
|
302
307
|
},
|
|
303
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
318
|
+
children: [/* @__PURE__ */ I(v, {
|
|
314
319
|
toasts: i,
|
|
315
320
|
onDismiss: c
|
|
316
|
-
}), S && !b ? /* @__PURE__ */
|
|
321
|
+
}), S && !b ? /* @__PURE__ */ I(a, {
|
|
317
322
|
variant: "card",
|
|
318
323
|
count: 4
|
|
319
|
-
}) : w ? /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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 =
|
|
331
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
340
|
+
children: [/* @__PURE__ */ L("div", {
|
|
336
341
|
className: "flex items-start justify-between gap-2",
|
|
337
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ L("div", {
|
|
338
343
|
className: "min-w-0",
|
|
339
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
347
|
+
}), l && n && /* @__PURE__ */ I("p", {
|
|
343
348
|
className: "text-xs text-text-tertiary",
|
|
344
349
|
children: n.description
|
|
345
350
|
})]
|
|
346
|
-
}), l && /* @__PURE__ */
|
|
351
|
+
}), l && /* @__PURE__ */ L("div", {
|
|
347
352
|
className: "flex shrink-0 gap-1",
|
|
348
353
|
children: [
|
|
349
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ I("button", {
|
|
350
355
|
type: "button",
|
|
351
|
-
className:
|
|
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__ */
|
|
360
|
+
children: /* @__PURE__ */ I(k, {
|
|
356
361
|
className: "h-4 w-4",
|
|
357
362
|
"aria-hidden": "true"
|
|
358
363
|
})
|
|
359
364
|
}),
|
|
360
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ I("button", {
|
|
361
366
|
type: "button",
|
|
362
|
-
className:
|
|
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__ */
|
|
371
|
+
children: /* @__PURE__ */ I(O, {
|
|
367
372
|
className: "h-4 w-4",
|
|
368
373
|
"aria-hidden": "true"
|
|
369
374
|
})
|
|
370
375
|
}),
|
|
371
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ I("button", {
|
|
372
377
|
type: "button",
|
|
373
|
-
className:
|
|
378
|
+
className: V,
|
|
374
379
|
onClick: () => p(te(f, e)),
|
|
375
380
|
"aria-label": `Remove ${n?.name ?? e}`,
|
|
376
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
395
|
+
}), l && /* @__PURE__ */ L("section", {
|
|
390
396
|
className: "mt-6",
|
|
391
397
|
"aria-labelledby": "add-widgets-heading",
|
|
392
398
|
children: [
|
|
393
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
406
|
+
children: Q.map((e) => /* @__PURE__ */ L("button", {
|
|
401
407
|
type: "button",
|
|
402
|
-
className:
|
|
403
|
-
onClick: () => p(
|
|
408
|
+
className: B,
|
|
409
|
+
onClick: () => p(y(f, e.key)),
|
|
404
410
|
title: e.description,
|
|
405
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
419
|
+
children: [/* @__PURE__ */ L("span", { children: [
|
|
414
420
|
"Install an applet to unlock:",
|
|
415
421
|
" ",
|
|
416
422
|
$.map((e) => e.name).join(", ")
|
|
417
|
-
] }), /* @__PURE__ */
|
|
423
|
+
] }), /* @__PURE__ */ L("button", {
|
|
418
424
|
type: "button",
|
|
419
|
-
className:
|
|
425
|
+
className: B,
|
|
420
426
|
onClick: () => r("/applets"),
|
|
421
|
-
children: [/* @__PURE__ */
|
|
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 {
|
|
438
|
+
export { Q as WidgetDashboardPage };
|
|
433
439
|
|
|
434
440
|
//# sourceMappingURL=WidgetDashboardPage.js.map
|