@burdenoff/microfe-timecampus 2026.1028.1 → 2026.1030.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/wspace-operations.d.ts +102 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +477 -425
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +67 -3
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/timecampus/index.js +7 -7
- package/dist/timecampus/pages/focus/FocusProtectionPage.d.ts.map +1 -1
- package/dist/timecampus/pages/focus/FocusProtectionPage.js +341 -280
- package/dist/timecampus/pages/focus/FocusProtectionPage.js.map +1 -1
- package/dist/timecampus/pages/focus/focusHelpers.d.ts +19 -0
- package/dist/timecampus/pages/focus/focusHelpers.d.ts.map +1 -1
- package/dist/timecampus/pages/focus/focusHelpers.js +61 -1
- package/dist/timecampus/pages/focus/focusHelpers.js.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.d.ts.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.js +245 -120
- package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
- package/dist/timecampus/pages/timeline/timelineFocus.d.ts +33 -0
- package/dist/timecampus/pages/timeline/timelineFocus.d.ts.map +1 -0
- package/dist/timecampus/pages/timeline/timelineFocus.js +26 -0
- package/dist/timecampus/pages/timeline/timelineFocus.js.map +1 -0
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +12 -6
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { useTimeCampus as e } from "../../providers/TimeCampusProvider.js";
|
|
2
2
|
import { StatCard as t } from "../../components/StatCard.js";
|
|
3
3
|
import { LoadingSkeleton as ee } from "../../components/LoadingSkeleton.js";
|
|
4
|
-
import { useCancelFocusBlockMutation as te, useEndFocusSessionMutation as ne, useGetActiveFocusSessionQuery as re, useGetFocusBlockSuggestionsQuery as ie,
|
|
4
|
+
import { useCancelFocusBlockMutation as te, useEndFocusSessionMutation as ne, useGetActiveFocusSessionQuery as re, useGetFocusBlockSuggestionsQuery as ie, useGetFocusCalendarConnectionQuery as ae, useGetFocusPreferencesQuery as oe, useGetFocusProtectionSummaryQuery as se, useListFocusBlocksQuery as ce, useLogFocusInterruptionMutation as le, useRespondToFocusBlockSuggestionMutation as ue, useStartFocusSessionMutation as de, useUpdateFocusPreferencesMutation as fe } from "../../../generated/wspace-operations.js";
|
|
5
5
|
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
6
6
|
import { StatusBadge as r } from "../../components/StatusBadge.js";
|
|
7
|
-
import { ToastContainer as
|
|
7
|
+
import { ToastContainer as pe, useToast as me } from "../../components/Toast.js";
|
|
8
8
|
import { TimeCampusFocusBlockResponse as i, TimeCampusFocusProtectionLevel as a, TimeCampusFocusSessionStatus as o } from "../../../generated/wspace-types.js";
|
|
9
|
-
import { useDesktopFocusStatus as
|
|
10
|
-
import { DAY_MS as s, announceFocusChange as
|
|
11
|
-
import { useEffect as
|
|
12
|
-
import { AlarmClock as
|
|
13
|
-
import { Fragment as
|
|
14
|
-
import { GlassCard as
|
|
9
|
+
import { useDesktopFocusStatus as he } from "./useDesktopFocusStatus.js";
|
|
10
|
+
import { DAY_MS as s, announceFocusChange as ge, calendarHoldLabel as _e, calendarProviderLabel as ve, canStartBlock as ye, formatDuration as c, formatRange as be, localDayStart as xe, minutesLeft as Se, minutesToTime as l, parseAppList as Ce, parseSiteList as we, readStartBlockParam as Te, reasonLabel as Ee, startNudgeOptions as De, timeToMinutes as Oe, withoutStartBlockParam as ke } from "./focusHelpers.js";
|
|
11
|
+
import { useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
12
|
+
import { AlarmClock as Ae, Ban as je, CalendarClock as Me, Check as Ne, Play as Pe, Shield as Fe, ShieldCheck as Ie, Square as Le, Target as Re, X as ze } from "lucide-react";
|
|
13
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
14
|
+
import { GlassCard as Be } from "@burdenoff/fe-libs/ui";
|
|
15
15
|
//#region src/timecampus/pages/focus/FocusProtectionPage.tsx
|
|
16
|
-
var
|
|
16
|
+
var _ = "Focus Protection", v = "Adaptive focus blocks and distraction blocking during focus sessions", Ve = [
|
|
17
17
|
"GetActiveFocusSession",
|
|
18
18
|
"GetFocusBlockSuggestions",
|
|
19
19
|
"ListFocusBlocks",
|
|
20
20
|
"GetFocusProtectionSummary"
|
|
21
|
-
],
|
|
21
|
+
], y = "rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary", b = "inline-flex items-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", x = "inline-flex items-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", S = {
|
|
22
22
|
on: "on",
|
|
23
23
|
off: "off",
|
|
24
24
|
running: "on",
|
|
@@ -27,312 +27,335 @@ var y = "Focus Protection", b = "Adaptive focus blocks and distraction blocking
|
|
|
27
27
|
"needs-setup": "needs a one-time setup",
|
|
28
28
|
error: "not working"
|
|
29
29
|
};
|
|
30
|
-
function
|
|
31
|
-
return
|
|
30
|
+
function He(e) {
|
|
31
|
+
return S[e] ?? e;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function C(e) {
|
|
34
34
|
return e instanceof Error ? e.message : "Something went wrong";
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
let { workspaceId:
|
|
38
|
-
|
|
39
|
-
let e = window.setInterval(() =>
|
|
36
|
+
function Ue() {
|
|
37
|
+
let { workspaceId: S = "" } = e(), { toasts: Ue, addToast: w, dismissToast: We } = me(), [T, Ge] = p(0), [E, Ke] = p(() => Date.now());
|
|
38
|
+
u(() => {
|
|
39
|
+
let e = window.setInterval(() => Ke(Date.now()), 6e4);
|
|
40
40
|
return () => window.clearInterval(e);
|
|
41
41
|
}, []);
|
|
42
|
-
let
|
|
42
|
+
let D = d(() => xe(/* @__PURE__ */ new Date(), T), [T]), qe = d(() => new Date(D.getTime() + s), [D]), Je = d(() => {
|
|
43
43
|
let e = /* @__PURE__ */ new Date();
|
|
44
44
|
return {
|
|
45
45
|
from: (/* @__PURE__ */ new Date(e.getTime() - 7 * s)).toISOString(),
|
|
46
46
|
to: e.toISOString()
|
|
47
47
|
};
|
|
48
|
-
}, []),
|
|
49
|
-
variables: { dayStart:
|
|
50
|
-
skip: !
|
|
51
|
-
}),
|
|
48
|
+
}, []), O = re({ skip: !S }), k = ie({
|
|
49
|
+
variables: { dayStart: D.toISOString() },
|
|
50
|
+
skip: !S
|
|
51
|
+
}), Ye = ce({
|
|
52
52
|
variables: {
|
|
53
|
-
from:
|
|
54
|
-
to:
|
|
53
|
+
from: D.toISOString(),
|
|
54
|
+
to: qe.toISOString()
|
|
55
55
|
},
|
|
56
|
-
skip: !
|
|
57
|
-
}),
|
|
58
|
-
variables:
|
|
59
|
-
skip: !
|
|
60
|
-
}),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
skip: !S
|
|
57
|
+
}), A = oe({ skip: !S }), Xe = ae({ skip: !S }), Ze = se({
|
|
58
|
+
variables: Je,
|
|
59
|
+
skip: !S
|
|
60
|
+
}), j = { refetchQueries: Ve }, [M, { loading: N }] = de(j), [Qe, { loading: P }] = ne(j), [$e] = le(j), [et, { loading: F }] = ue(j), [tt] = te(j), [nt, { loading: I }] = fe({ refetchQueries: [
|
|
61
|
+
"GetFocusPreferences",
|
|
62
|
+
"GetFocusBlockSuggestions",
|
|
63
|
+
"GetFocusCalendarConnection"
|
|
64
|
+
] }), [L, rt] = p(50), [R, it] = p(!1), z = A.data?.timeCampusFocusPreferences, [B, V] = p("09:00"), [H, U] = p("18:00"), [W, G] = p(90), [at, ot] = p(2), [st, ct] = p(10), [lt, ut] = p(!0), [dt, ft] = p(""), [pt, mt] = p(""), [ht, gt] = p(!0), [_t, vt] = p(!0), [K, yt] = p(5), q = he();
|
|
65
|
+
u(() => {
|
|
66
|
+
z && (V(l(z.workdayStartMinute)), U(l(z.workdayEndMinute)), G(z.preferredBlockMinutes), ot(z.maxBlocksPerDay), ct(z.meetingBufferMinutes), ut(z.blockingEnabled), ft(z.blockedDomains.join("\n")), mt(z.blockedApps.join("\n")), gt(z.doNotDisturb), vt(z.calendarHoldEnabled), yt(z.startNudgeMinutes));
|
|
67
|
+
}, [z]);
|
|
68
|
+
let J = O.data?.timeCampusActiveFocusSession ?? null, bt = k.data?.timeCampusFocusBlockSuggestions ?? [], xt = Ye.data?.timeCampusFocusBlocks ?? [], Y = Ze.data?.timeCampusFocusSummary, X = Xe.data?.timeCampusFocusCalendarConnection, St = ve(X?.provider), Ct = !O.data && O.loading || !A.data && A.loading, wt = O.error ?? A.error;
|
|
65
69
|
async function Z(e, t) {
|
|
66
70
|
try {
|
|
67
|
-
await e(),
|
|
71
|
+
await e(), ge(), w({
|
|
68
72
|
title: t,
|
|
69
73
|
variant: "success"
|
|
70
74
|
});
|
|
71
75
|
} catch (e) {
|
|
72
|
-
|
|
73
|
-
title:
|
|
76
|
+
w({
|
|
77
|
+
title: C(e),
|
|
74
78
|
variant: "error"
|
|
75
79
|
});
|
|
76
80
|
}
|
|
77
81
|
}
|
|
78
|
-
let
|
|
79
|
-
plannedDurationSeconds: e ? void 0 :
|
|
80
|
-
protectionLevel:
|
|
82
|
+
let Tt = (e) => Z(() => M({ variables: {
|
|
83
|
+
plannedDurationSeconds: e ? void 0 : L * 60,
|
|
84
|
+
protectionLevel: R ? a.Strict : a.Standard,
|
|
81
85
|
focusBlockId: e
|
|
82
|
-
} }), "Focus session started"),
|
|
83
|
-
|
|
86
|
+
} }), "Focus session started"), Et = f(!1), Dt = f(() => void 0);
|
|
87
|
+
u(() => {
|
|
88
|
+
Dt.current = (e, t) => {
|
|
89
|
+
if (t) {
|
|
90
|
+
w({
|
|
91
|
+
title: "A focus session is already running",
|
|
92
|
+
variant: "info"
|
|
93
|
+
});
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
Z(() => M({ variables: { focusBlockId: e } }), "Focus block started");
|
|
97
|
+
};
|
|
98
|
+
}), u(() => {
|
|
99
|
+
if (Et.current || !S || !O.data) return;
|
|
100
|
+
let e = Te(window.location.search);
|
|
101
|
+
e && (Et.current = !0, window.history.replaceState(window.history.state, "", ke(window.location.href)), Dt.current(e, !!O.data.timeCampusActiveFocusSession));
|
|
102
|
+
}, [S, O.data]);
|
|
103
|
+
let Ot = (e) => J ? Z(() => Qe({ variables: {
|
|
104
|
+
id: J.id,
|
|
84
105
|
status: e
|
|
85
|
-
} }), e === o.Completed ? "Focus session completed" : "Focus session abandoned") : void 0, Q = (e, t) => Z(() =>
|
|
106
|
+
} }), e === o.Completed ? "Focus session completed" : "Focus session abandoned") : void 0, Q = (e, t) => Z(() => et({ variables: { input: {
|
|
86
107
|
startTime: e.startTime,
|
|
87
108
|
endTime: e.endTime,
|
|
88
109
|
response: t,
|
|
89
|
-
dayStart:
|
|
110
|
+
dayStart: D.toISOString(),
|
|
90
111
|
snoozeMinutes: t === i.Snooze ? 30 : null
|
|
91
|
-
} } }), t === i.Accept ? "Focus block scheduled" : t === i.Snooze ? "Snoozed for 30 minutes" : "Suggestion dismissed"),
|
|
92
|
-
let e =
|
|
112
|
+
} } }), t === i.Accept ? "Focus block scheduled" : t === i.Snooze ? "Snoozed for 30 minutes" : "Suggestion dismissed"), kt = () => {
|
|
113
|
+
let e = Oe(B), t = Oe(H);
|
|
93
114
|
if (e === null || t === null) {
|
|
94
|
-
|
|
115
|
+
w({
|
|
95
116
|
title: "Use HH:MM for the workday",
|
|
96
117
|
variant: "error"
|
|
97
118
|
});
|
|
98
119
|
return;
|
|
99
120
|
}
|
|
100
|
-
Z(() =>
|
|
121
|
+
Z(() => nt({ variables: { input: {
|
|
101
122
|
workdayStartMinute: e,
|
|
102
123
|
workdayEndMinute: t,
|
|
103
|
-
preferredBlockMinutes:
|
|
104
|
-
minBlockMinutes: Math.min(45,
|
|
105
|
-
maxBlocksPerDay:
|
|
106
|
-
meetingBufferMinutes:
|
|
107
|
-
blockingEnabled:
|
|
108
|
-
blockedDomains:
|
|
109
|
-
blockedApps:
|
|
110
|
-
doNotDisturb:
|
|
124
|
+
preferredBlockMinutes: W,
|
|
125
|
+
minBlockMinutes: Math.min(45, W),
|
|
126
|
+
maxBlocksPerDay: at,
|
|
127
|
+
meetingBufferMinutes: st,
|
|
128
|
+
blockingEnabled: lt,
|
|
129
|
+
blockedDomains: we(dt),
|
|
130
|
+
blockedApps: Ce(pt),
|
|
131
|
+
doNotDisturb: ht,
|
|
132
|
+
calendarHoldEnabled: _t,
|
|
133
|
+
startNudgeMinutes: K
|
|
111
134
|
} } }), "Focus settings saved");
|
|
112
135
|
};
|
|
113
|
-
if (
|
|
114
|
-
title:
|
|
115
|
-
description:
|
|
116
|
-
children: /* @__PURE__ */
|
|
136
|
+
if (Ct) return /* @__PURE__ */ h(n, {
|
|
137
|
+
title: _,
|
|
138
|
+
description: v,
|
|
139
|
+
children: /* @__PURE__ */ h(ee, {
|
|
117
140
|
variant: "card",
|
|
118
141
|
count: 4
|
|
119
142
|
})
|
|
120
143
|
});
|
|
121
|
-
if (
|
|
122
|
-
title:
|
|
123
|
-
description:
|
|
124
|
-
children: /* @__PURE__ */
|
|
144
|
+
if (wt && !O.data) return /* @__PURE__ */ h(n, {
|
|
145
|
+
title: _,
|
|
146
|
+
description: v,
|
|
147
|
+
children: /* @__PURE__ */ h("div", {
|
|
125
148
|
className: "rounded-xl border border-status-error-border/50 bg-status-error-bg/10 p-4 text-sm text-status-error-text",
|
|
126
149
|
children: "Failed to load focus protection. Please try again later."
|
|
127
150
|
})
|
|
128
151
|
});
|
|
129
|
-
let $ =
|
|
130
|
-
return /* @__PURE__ */
|
|
131
|
-
title:
|
|
132
|
-
description:
|
|
152
|
+
let $ = J ? Se(J.startTime, J.plannedDurationSeconds, E) : null, At = Y ? Math.round(Y.averageProtectionRatio * 100) : null;
|
|
153
|
+
return /* @__PURE__ */ g(n, {
|
|
154
|
+
title: _,
|
|
155
|
+
description: v,
|
|
133
156
|
purpose: "Protect the hours that matter: TimeCampus suggests focus blocks around your meetings and the times you focus best, and blocks distracting sites in your browser, and in the desktop app turns on Do Not Disturb and hides distracting apps while a session runs.",
|
|
134
157
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
toasts:
|
|
137
|
-
onDismiss:
|
|
158
|
+
/* @__PURE__ */ h(pe, {
|
|
159
|
+
toasts: Ue,
|
|
160
|
+
onDismiss: We
|
|
138
161
|
}),
|
|
139
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ g("div", {
|
|
140
163
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
141
164
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ h(t, {
|
|
143
166
|
featured: !0,
|
|
144
167
|
title: "Protected Time",
|
|
145
|
-
value:
|
|
146
|
-
icon: /* @__PURE__ */
|
|
168
|
+
value: Y ? c(Y.totalProtectedSeconds) : "--",
|
|
169
|
+
icon: /* @__PURE__ */ h(Ie, { className: "h-5 w-5" }),
|
|
147
170
|
description: "Last 7 days"
|
|
148
171
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ h(t, {
|
|
150
173
|
title: "Protection Ratio",
|
|
151
|
-
value:
|
|
152
|
-
icon: /* @__PURE__ */
|
|
174
|
+
value: At === null ? "--" : `${At}%`,
|
|
175
|
+
icon: /* @__PURE__ */ h(Fe, { className: "h-5 w-5" }),
|
|
153
176
|
description: "Protected vs interrupted"
|
|
154
177
|
}),
|
|
155
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ h(t, {
|
|
156
179
|
title: "Sessions",
|
|
157
|
-
value:
|
|
158
|
-
icon: /* @__PURE__ */
|
|
159
|
-
description:
|
|
180
|
+
value: Y ? String(Y.totalSessions) : "--",
|
|
181
|
+
icon: /* @__PURE__ */ h(Re, { className: "h-5 w-5" }),
|
|
182
|
+
description: Y ? `${Y.completedSessions} completed` : "Last 7 days"
|
|
160
183
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ h(t, {
|
|
162
185
|
title: "Interruptions",
|
|
163
|
-
value:
|
|
164
|
-
icon: /* @__PURE__ */
|
|
186
|
+
value: Y ? String(Y.totalInterruptionCount) : "--",
|
|
187
|
+
icon: /* @__PURE__ */ h(je, { className: "h-5 w-5" }),
|
|
165
188
|
description: "Logged, detected or bypassed"
|
|
166
189
|
})
|
|
167
190
|
]
|
|
168
191
|
}),
|
|
169
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ h("div", {
|
|
170
193
|
className: "mt-6",
|
|
171
194
|
"data-testid": "focus-session-card",
|
|
172
|
-
children: /* @__PURE__ */
|
|
195
|
+
children: /* @__PURE__ */ g(Be, {
|
|
173
196
|
treatment: "glass",
|
|
174
197
|
glow: !0,
|
|
175
198
|
className: "p-6",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
199
|
+
children: [/* @__PURE__ */ g("div", {
|
|
177
200
|
className: "flex flex-wrap items-start justify-between gap-4",
|
|
178
|
-
children: [/* @__PURE__ */
|
|
201
|
+
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("h3", {
|
|
179
202
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
180
|
-
children: [/* @__PURE__ */
|
|
181
|
-
}),
|
|
203
|
+
children: [/* @__PURE__ */ h(Fe, { className: "h-4 w-4" }), "Focus session"]
|
|
204
|
+
}), J ? /* @__PURE__ */ g("p", {
|
|
182
205
|
className: "mt-1 text-sm text-text-secondary",
|
|
183
206
|
"data-testid": "focus-session-status",
|
|
184
207
|
children: [
|
|
185
208
|
$ === null ? "Open-ended session in progress." : $ === 0 ? "Planned time is up — finish when you're ready." : `${$} minute${$ === 1 ? "" : "s"} left.`,
|
|
186
209
|
" ",
|
|
187
|
-
|
|
210
|
+
J.interruptionCount,
|
|
188
211
|
" interruption",
|
|
189
|
-
|
|
212
|
+
J.interruptionCount === 1 ? "" : "s",
|
|
190
213
|
",",
|
|
191
214
|
" ",
|
|
192
|
-
|
|
215
|
+
J.blockedAttemptCount,
|
|
193
216
|
" distraction",
|
|
194
|
-
|
|
217
|
+
J.blockedAttemptCount === 1 ? "" : "s",
|
|
195
218
|
" blocked."
|
|
196
219
|
]
|
|
197
|
-
}) : /* @__PURE__ */
|
|
220
|
+
}) : /* @__PURE__ */ h("p", {
|
|
198
221
|
className: "mt-1 text-sm text-text-secondary",
|
|
199
222
|
children: "No session running. While one is active, the TimeCampus browser extension blocks the sites listed below and the TimeCampus desktop app hides or flags the apps listed below."
|
|
200
|
-
})] }),
|
|
201
|
-
variant:
|
|
202
|
-
label:
|
|
223
|
+
})] }), J && /* @__PURE__ */ h(r, {
|
|
224
|
+
variant: J.protectionLevel === a.Strict ? "warning" : "success",
|
|
225
|
+
label: J.protectionLevel === a.Strict ? "Strict" : "Standard"
|
|
203
226
|
})]
|
|
204
|
-
}), /* @__PURE__ */
|
|
227
|
+
}), /* @__PURE__ */ h("div", {
|
|
205
228
|
className: "mt-4 flex flex-wrap items-center gap-3",
|
|
206
|
-
children:
|
|
207
|
-
/* @__PURE__ */
|
|
229
|
+
children: J ? /* @__PURE__ */ g(m, { children: [
|
|
230
|
+
/* @__PURE__ */ g("button", {
|
|
208
231
|
type: "button",
|
|
209
|
-
className:
|
|
210
|
-
disabled:
|
|
211
|
-
onClick: () =>
|
|
232
|
+
className: b,
|
|
233
|
+
disabled: P,
|
|
234
|
+
onClick: () => Ot(o.Completed),
|
|
212
235
|
"data-testid": "focus-end",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
236
|
+
children: [/* @__PURE__ */ h(Le, { className: "h-4 w-4" }), " End session"]
|
|
214
237
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ h("button", {
|
|
216
239
|
type: "button",
|
|
217
|
-
className:
|
|
218
|
-
disabled:
|
|
219
|
-
onClick: () =>
|
|
240
|
+
className: x,
|
|
241
|
+
disabled: P,
|
|
242
|
+
onClick: () => Ot(o.Abandoned),
|
|
220
243
|
children: "Abandon"
|
|
221
244
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ h("button", {
|
|
223
246
|
type: "button",
|
|
224
|
-
className:
|
|
225
|
-
onClick: () => Z(() =>
|
|
247
|
+
className: x,
|
|
248
|
+
onClick: () => Z(() => $e({ variables: { focusSessionId: J.id } }), "Interruption logged"),
|
|
226
249
|
"data-testid": "focus-log-interruption",
|
|
227
250
|
children: "Log an interruption"
|
|
228
251
|
})
|
|
229
|
-
] }) : /* @__PURE__ */
|
|
230
|
-
/* @__PURE__ */
|
|
252
|
+
] }) : /* @__PURE__ */ g(m, { children: [
|
|
253
|
+
/* @__PURE__ */ g("label", {
|
|
231
254
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
232
|
-
children: ["Length", /* @__PURE__ */
|
|
233
|
-
className:
|
|
234
|
-
value:
|
|
235
|
-
onChange: (e) =>
|
|
255
|
+
children: ["Length", /* @__PURE__ */ g("select", {
|
|
256
|
+
className: y,
|
|
257
|
+
value: L,
|
|
258
|
+
onChange: (e) => rt(Number(e.target.value)),
|
|
236
259
|
"data-testid": "focus-length",
|
|
237
260
|
children: [
|
|
238
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ h("option", {
|
|
239
262
|
value: 25,
|
|
240
263
|
children: "25 min"
|
|
241
264
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ h("option", {
|
|
243
266
|
value: 50,
|
|
244
267
|
children: "50 min"
|
|
245
268
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ h("option", {
|
|
247
270
|
value: 90,
|
|
248
271
|
children: "90 min"
|
|
249
272
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ h("option", {
|
|
251
274
|
value: 120,
|
|
252
275
|
children: "2 hours"
|
|
253
276
|
})
|
|
254
277
|
]
|
|
255
278
|
})]
|
|
256
279
|
}),
|
|
257
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ g("label", {
|
|
258
281
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
259
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ h("input", {
|
|
260
283
|
type: "checkbox",
|
|
261
|
-
checked:
|
|
262
|
-
onChange: (e) =>
|
|
284
|
+
checked: R,
|
|
285
|
+
onChange: (e) => it(e.target.checked),
|
|
263
286
|
className: "h-4 w-4 rounded border-border-subtle"
|
|
264
287
|
}), "Strict (no “continue anyway”)"]
|
|
265
288
|
}),
|
|
266
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ g("button", {
|
|
267
290
|
type: "button",
|
|
268
|
-
className:
|
|
269
|
-
disabled:
|
|
270
|
-
onClick: () =>
|
|
291
|
+
className: b,
|
|
292
|
+
disabled: N,
|
|
293
|
+
onClick: () => Tt(),
|
|
271
294
|
"data-testid": "focus-start",
|
|
272
|
-
children: [/* @__PURE__ */
|
|
295
|
+
children: [/* @__PURE__ */ h(Pe, { className: "h-4 w-4" }), " Start focus session"]
|
|
273
296
|
})
|
|
274
297
|
] })
|
|
275
298
|
})]
|
|
276
299
|
})
|
|
277
300
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ g("div", {
|
|
279
302
|
className: "mt-6 grid grid-cols-1 gap-6 lg:grid-cols-2",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
303
|
+
children: [/* @__PURE__ */ g("div", {
|
|
281
304
|
className: "rounded-xl border border-border-seam bg-bg-surface p-6 shadow-elevation-1",
|
|
282
305
|
"data-testid": "focus-suggestions",
|
|
283
306
|
children: [
|
|
284
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ g("div", {
|
|
285
308
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
309
|
+
children: [/* @__PURE__ */ g("h3", {
|
|
287
310
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
288
|
-
children: [/* @__PURE__ */
|
|
289
|
-
}), /* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ h(Me, { className: "h-4 w-4" }), "Suggested focus blocks"]
|
|
312
|
+
}), /* @__PURE__ */ h("div", {
|
|
290
313
|
className: "flex gap-1",
|
|
291
314
|
role: "group",
|
|
292
315
|
"aria-label": "Day to plan",
|
|
293
|
-
children: ["Today", "Tomorrow"].map((e, t) => /* @__PURE__ */
|
|
316
|
+
children: ["Today", "Tomorrow"].map((e, t) => /* @__PURE__ */ h("button", {
|
|
294
317
|
type: "button",
|
|
295
|
-
"aria-pressed":
|
|
296
|
-
className:
|
|
297
|
-
onClick: () =>
|
|
318
|
+
"aria-pressed": T === t,
|
|
319
|
+
className: T === t ? b : x,
|
|
320
|
+
onClick: () => Ge(t),
|
|
298
321
|
children: e
|
|
299
322
|
}, e))
|
|
300
323
|
})]
|
|
301
324
|
}),
|
|
302
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ h("p", {
|
|
303
326
|
className: "mt-1 text-xs text-text-secondary",
|
|
304
327
|
children: "Ranked from your peak hours, meetings and how well past sessions held up. Snoozed and dismissed slots are planned around."
|
|
305
328
|
}),
|
|
306
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ g("div", {
|
|
307
330
|
className: "mt-4 space-y-3",
|
|
308
331
|
children: [
|
|
309
|
-
|
|
332
|
+
k.error && /* @__PURE__ */ h("p", {
|
|
310
333
|
className: "text-sm text-status-error-text",
|
|
311
|
-
children:
|
|
334
|
+
children: C(k.error)
|
|
312
335
|
}),
|
|
313
|
-
!
|
|
336
|
+
!k.error && k.data && bt.length === 0 && /* @__PURE__ */ g("p", {
|
|
314
337
|
className: "text-sm text-text-secondary",
|
|
315
338
|
"data-testid": "focus-suggestions-empty",
|
|
316
339
|
children: [
|
|
317
340
|
"No free window left for",
|
|
318
341
|
" ",
|
|
319
|
-
|
|
342
|
+
T === 0 ? "today" : "tomorrow",
|
|
320
343
|
" — your day is full or you have scheduled your maximum blocks."
|
|
321
344
|
]
|
|
322
345
|
}),
|
|
323
|
-
|
|
346
|
+
bt.map((e) => /* @__PURE__ */ g("div", {
|
|
324
347
|
className: "rounded-lg border border-border-subtle p-3",
|
|
325
348
|
"data-testid": "focus-suggestion",
|
|
326
349
|
children: [
|
|
327
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ g("div", {
|
|
328
351
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
329
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ g("span", {
|
|
330
353
|
className: "text-sm font-medium text-text-primary",
|
|
331
|
-
children: [
|
|
354
|
+
children: [be(e.startTime, e.endTime), /* @__PURE__ */ h("span", {
|
|
332
355
|
className: "ml-2 text-xs text-text-secondary",
|
|
333
356
|
children: c(e.durationMinutes * 60)
|
|
334
357
|
})]
|
|
335
|
-
}), /* @__PURE__ */
|
|
358
|
+
}), /* @__PURE__ */ g("span", {
|
|
336
359
|
className: "text-xs text-text-secondary",
|
|
337
360
|
children: [
|
|
338
361
|
"Fit ",
|
|
@@ -341,39 +364,39 @@ function D() {
|
|
|
341
364
|
]
|
|
342
365
|
})]
|
|
343
366
|
}),
|
|
344
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ h("div", {
|
|
345
368
|
className: "mt-2 flex flex-wrap gap-1.5",
|
|
346
|
-
children: e.reasons.map((e) => /* @__PURE__ */
|
|
369
|
+
children: e.reasons.map((e) => /* @__PURE__ */ h(r, {
|
|
347
370
|
variant: "info",
|
|
348
|
-
label:
|
|
371
|
+
label: Ee(e)
|
|
349
372
|
}, e))
|
|
350
373
|
}),
|
|
351
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ g("div", {
|
|
352
375
|
className: "mt-3 flex flex-wrap gap-2",
|
|
353
376
|
children: [
|
|
354
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ g("button", {
|
|
355
378
|
type: "button",
|
|
356
|
-
className:
|
|
357
|
-
disabled:
|
|
379
|
+
className: b,
|
|
380
|
+
disabled: F,
|
|
358
381
|
onClick: () => Q(e, i.Accept),
|
|
359
382
|
"data-testid": "focus-suggestion-accept",
|
|
360
|
-
children: [/* @__PURE__ */
|
|
383
|
+
children: [/* @__PURE__ */ h(Ne, { className: "h-4 w-4" }), " Accept"]
|
|
361
384
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ g("button", {
|
|
363
386
|
type: "button",
|
|
364
|
-
className:
|
|
365
|
-
disabled:
|
|
387
|
+
className: x,
|
|
388
|
+
disabled: F,
|
|
366
389
|
onClick: () => Q(e, i.Snooze),
|
|
367
390
|
"data-testid": "focus-suggestion-snooze",
|
|
368
|
-
children: [/* @__PURE__ */
|
|
391
|
+
children: [/* @__PURE__ */ h(Ae, { className: "h-4 w-4" }), " Snooze 30 min"]
|
|
369
392
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ g("button", {
|
|
371
394
|
type: "button",
|
|
372
|
-
className:
|
|
373
|
-
disabled:
|
|
395
|
+
className: x,
|
|
396
|
+
disabled: F,
|
|
374
397
|
onClick: () => Q(e, i.Dismiss),
|
|
375
398
|
"data-testid": "focus-suggestion-dismiss",
|
|
376
|
-
children: [/* @__PURE__ */
|
|
399
|
+
children: [/* @__PURE__ */ h(ze, { className: "h-4 w-4" }), " Dismiss"]
|
|
377
400
|
})
|
|
378
401
|
]
|
|
379
402
|
})
|
|
@@ -382,218 +405,256 @@ function D() {
|
|
|
382
405
|
]
|
|
383
406
|
})
|
|
384
407
|
]
|
|
385
|
-
}), /* @__PURE__ */
|
|
408
|
+
}), /* @__PURE__ */ g("div", {
|
|
386
409
|
className: "rounded-xl border border-border-seam bg-bg-surface p-6 shadow-elevation-1",
|
|
387
410
|
"data-testid": "focus-scheduled",
|
|
388
|
-
children: [
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
className: "text-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
"
|
|
412
|
-
" ",
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
411
|
+
children: [
|
|
412
|
+
/* @__PURE__ */ g("h3", {
|
|
413
|
+
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ h(Re, { className: "h-4 w-4" }),
|
|
416
|
+
"Scheduled (",
|
|
417
|
+
T === 0 ? "today" : "tomorrow",
|
|
418
|
+
")"
|
|
419
|
+
]
|
|
420
|
+
}),
|
|
421
|
+
X && /* @__PURE__ */ h("p", {
|
|
422
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
423
|
+
"data-testid": "focus-calendar-connection",
|
|
424
|
+
children: X.holdsEnabled ? X.connected ? `Accepted blocks are held as busy "Focus" time on ${X.calendarName ?? "your calendar"}${St ? ` and sync to ${St}` : ""}.` : X.reachable ? "No personal calendar yet. Create one in Calendar to hold accepted blocks there and plan around its events." : "Your calendar could not be reached just now; blocks are still scheduled here." : "Calendar holds are off — accepted blocks stay in TimeCampus only."
|
|
425
|
+
}),
|
|
426
|
+
/* @__PURE__ */ g("div", {
|
|
427
|
+
className: "mt-4 space-y-3",
|
|
428
|
+
children: [Ye.data && xt.length === 0 && /* @__PURE__ */ h("p", {
|
|
429
|
+
className: "text-sm text-text-secondary",
|
|
430
|
+
children: "Accept a suggestion to put a focus block on your schedule."
|
|
431
|
+
}), xt.map((e) => {
|
|
432
|
+
let t = _e(e.calendarHoldStatus, e.calendarId && e.calendarId === X?.calendarId ? X?.calendarName : null);
|
|
433
|
+
return /* @__PURE__ */ g("div", {
|
|
434
|
+
className: "flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border-subtle p-3",
|
|
435
|
+
"data-testid": "focus-scheduled-block",
|
|
436
|
+
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
|
|
437
|
+
className: "text-sm font-medium text-text-primary",
|
|
438
|
+
children: be(e.startTime, e.endTime)
|
|
439
|
+
}), /* @__PURE__ */ g("p", {
|
|
440
|
+
className: "text-xs text-text-secondary",
|
|
441
|
+
children: [
|
|
442
|
+
e.source === "ADAPTIVE" ? "Suggested" : "Manual",
|
|
443
|
+
" ·",
|
|
444
|
+
" ",
|
|
445
|
+
c(e.durationMinutes * 60),
|
|
446
|
+
t && /* @__PURE__ */ g("span", {
|
|
447
|
+
"data-testid": "focus-block-calendar-hold",
|
|
448
|
+
children: [" · ", t]
|
|
449
|
+
})
|
|
450
|
+
]
|
|
451
|
+
})] }), e.status === "STARTED" ? /* @__PURE__ */ h(r, {
|
|
452
|
+
variant: "success",
|
|
453
|
+
label: "Started"
|
|
454
|
+
}) : /* @__PURE__ */ g("div", {
|
|
455
|
+
className: "flex gap-2",
|
|
456
|
+
children: [!J && ye(e.endTime, E) && /* @__PURE__ */ g("button", {
|
|
457
|
+
type: "button",
|
|
458
|
+
className: b,
|
|
459
|
+
disabled: N,
|
|
460
|
+
onClick: () => Tt(e.id),
|
|
461
|
+
children: [/* @__PURE__ */ h(Pe, { className: "h-4 w-4" }), " Start"]
|
|
462
|
+
}), /* @__PURE__ */ h("button", {
|
|
463
|
+
type: "button",
|
|
464
|
+
className: x,
|
|
465
|
+
onClick: () => Z(() => tt({ variables: { id: e.id } }), "Focus block canceled"),
|
|
466
|
+
"data-testid": "focus-block-cancel",
|
|
467
|
+
children: "Cancel"
|
|
468
|
+
})]
|
|
469
|
+
})]
|
|
470
|
+
}, e.id);
|
|
433
471
|
})]
|
|
434
|
-
}
|
|
435
|
-
|
|
472
|
+
})
|
|
473
|
+
]
|
|
436
474
|
})]
|
|
437
475
|
}),
|
|
438
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ g("div", {
|
|
439
477
|
className: "mt-6 rounded-xl border border-border-seam bg-bg-surface p-6 shadow-elevation-1",
|
|
440
478
|
"data-testid": "focus-settings",
|
|
441
479
|
children: [
|
|
442
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ g("h3", {
|
|
443
481
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
444
|
-
children: [/* @__PURE__ */
|
|
482
|
+
children: [/* @__PURE__ */ h(je, { className: "h-4 w-4" }), "Distraction blocking and planning"]
|
|
445
483
|
}),
|
|
446
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ g("div", {
|
|
447
485
|
className: "mt-4 grid grid-cols-1 gap-6 lg:grid-cols-2",
|
|
448
|
-
children: [/* @__PURE__ */
|
|
486
|
+
children: [/* @__PURE__ */ g("div", {
|
|
449
487
|
className: "space-y-3",
|
|
450
488
|
children: [
|
|
451
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ g("label", {
|
|
452
490
|
className: "flex items-center justify-between gap-4 text-sm text-text-primary",
|
|
453
|
-
children: ["Block sites and apps during focus sessions", /* @__PURE__ */
|
|
491
|
+
children: ["Block sites and apps during focus sessions", /* @__PURE__ */ h("input", {
|
|
454
492
|
type: "checkbox",
|
|
455
|
-
checked:
|
|
456
|
-
onChange: (e) =>
|
|
493
|
+
checked: lt,
|
|
494
|
+
onChange: (e) => ut(e.target.checked),
|
|
457
495
|
className: "h-4 w-4 rounded border-border-subtle",
|
|
458
496
|
"data-testid": "focus-blocking-enabled"
|
|
459
497
|
})]
|
|
460
498
|
}),
|
|
461
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ g("label", {
|
|
462
500
|
className: "block text-sm text-text-primary",
|
|
463
|
-
children: ["Blocked sites", /* @__PURE__ */
|
|
501
|
+
children: ["Blocked sites", /* @__PURE__ */ h("textarea", {
|
|
464
502
|
rows: 6,
|
|
465
|
-
value:
|
|
466
|
-
onChange: (e) =>
|
|
467
|
-
className: `${
|
|
503
|
+
value: dt,
|
|
504
|
+
onChange: (e) => ft(e.target.value),
|
|
505
|
+
className: `${y} mt-1 w-full font-mono`,
|
|
468
506
|
"aria-describedby": "focus-sites-help",
|
|
469
507
|
"data-testid": "focus-blocked-sites"
|
|
470
508
|
})]
|
|
471
509
|
}),
|
|
472
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ h("p", {
|
|
473
511
|
id: "focus-sites-help",
|
|
474
512
|
className: "text-xs text-text-secondary",
|
|
475
513
|
children: "One site per line (subdomains are included). Blocking is enforced by the TimeCampus browser extension while a session is active; allow-listed apps on a session are never blocked."
|
|
476
514
|
}),
|
|
477
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ g("label", {
|
|
478
516
|
className: "block text-sm text-text-primary",
|
|
479
|
-
children: ["Blocked desktop apps", /* @__PURE__ */
|
|
517
|
+
children: ["Blocked desktop apps", /* @__PURE__ */ h("textarea", {
|
|
480
518
|
rows: 5,
|
|
481
|
-
value:
|
|
482
|
-
onChange: (e) =>
|
|
483
|
-
className: `${
|
|
519
|
+
value: pt,
|
|
520
|
+
onChange: (e) => mt(e.target.value),
|
|
521
|
+
className: `${y} mt-1 w-full font-mono`,
|
|
484
522
|
"aria-describedby": "focus-apps-help",
|
|
485
523
|
"data-testid": "focus-blocked-apps"
|
|
486
524
|
})]
|
|
487
525
|
}),
|
|
488
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ h("p", {
|
|
489
527
|
id: "focus-apps-help",
|
|
490
528
|
className: "text-xs text-text-secondary",
|
|
491
529
|
children: "One app per line, as your computer names it (for example Discord or Steam). In the TimeCampus desktop app, strict sessions hide these apps and standard sessions warn you and count the time as an interruption."
|
|
492
530
|
}),
|
|
493
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ g("label", {
|
|
494
532
|
className: "flex items-center justify-between gap-4 text-sm text-text-primary",
|
|
495
|
-
children: ["Turn on Do Not Disturb during focus sessions", /* @__PURE__ */
|
|
533
|
+
children: ["Turn on Do Not Disturb during focus sessions", /* @__PURE__ */ h("input", {
|
|
496
534
|
type: "checkbox",
|
|
497
|
-
checked:
|
|
498
|
-
onChange: (e) =>
|
|
535
|
+
checked: ht,
|
|
536
|
+
onChange: (e) => gt(e.target.checked),
|
|
499
537
|
className: "h-4 w-4 rounded border-border-subtle",
|
|
500
538
|
"data-testid": "focus-do-not-disturb"
|
|
501
539
|
})]
|
|
502
540
|
}),
|
|
503
|
-
|
|
541
|
+
q && /* @__PURE__ */ g("p", {
|
|
504
542
|
className: "text-xs text-text-secondary",
|
|
505
543
|
"data-testid": "focus-desktop-status",
|
|
506
544
|
children: [
|
|
507
545
|
"This computer: Do Not Disturb",
|
|
508
546
|
" ",
|
|
509
|
-
|
|
547
|
+
He(q.doNotDisturb),
|
|
510
548
|
", app blocking",
|
|
511
549
|
" ",
|
|
512
|
-
|
|
550
|
+
He(q.appWatcher),
|
|
513
551
|
".",
|
|
514
|
-
|
|
552
|
+
q.detail ? ` ${q.detail}` : ""
|
|
515
553
|
]
|
|
516
554
|
})
|
|
517
555
|
]
|
|
518
|
-
}), /* @__PURE__ */
|
|
556
|
+
}), /* @__PURE__ */ g("div", {
|
|
519
557
|
className: "space-y-3",
|
|
520
558
|
children: [
|
|
521
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ g("div", {
|
|
522
560
|
className: "flex items-center justify-between gap-4",
|
|
523
|
-
children: [/* @__PURE__ */
|
|
561
|
+
children: [/* @__PURE__ */ h("span", {
|
|
524
562
|
className: "text-sm text-text-primary",
|
|
525
563
|
children: "Workday"
|
|
526
|
-
}), /* @__PURE__ */
|
|
564
|
+
}), /* @__PURE__ */ g("span", {
|
|
527
565
|
className: "flex items-center gap-2",
|
|
528
566
|
children: [
|
|
529
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ h("input", {
|
|
530
568
|
type: "time",
|
|
531
|
-
value:
|
|
532
|
-
onChange: (e) =>
|
|
533
|
-
className:
|
|
569
|
+
value: B,
|
|
570
|
+
onChange: (e) => V(e.target.value),
|
|
571
|
+
className: y,
|
|
534
572
|
"aria-label": "Workday start"
|
|
535
573
|
}),
|
|
536
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ h("span", {
|
|
537
575
|
className: "text-text-secondary",
|
|
538
576
|
children: "to"
|
|
539
577
|
}),
|
|
540
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ h("input", {
|
|
541
579
|
type: "time",
|
|
542
|
-
value:
|
|
543
|
-
onChange: (e) =>
|
|
544
|
-
className:
|
|
580
|
+
value: H === "24:00" ? "23:59" : H,
|
|
581
|
+
onChange: (e) => U(e.target.value),
|
|
582
|
+
className: y,
|
|
545
583
|
"aria-label": "Workday end"
|
|
546
584
|
})
|
|
547
585
|
]
|
|
548
586
|
})]
|
|
549
587
|
}),
|
|
550
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ g("label", {
|
|
551
589
|
className: "flex items-center justify-between gap-4 text-sm text-text-primary",
|
|
552
|
-
children: ["Preferred block length (minutes)", /* @__PURE__ */
|
|
590
|
+
children: ["Preferred block length (minutes)", /* @__PURE__ */ h("input", {
|
|
553
591
|
type: "number",
|
|
554
592
|
min: 15,
|
|
555
593
|
max: 240,
|
|
556
594
|
step: 15,
|
|
557
|
-
value:
|
|
558
|
-
onChange: (e) =>
|
|
559
|
-
className: `${
|
|
595
|
+
value: W,
|
|
596
|
+
onChange: (e) => G(Number(e.target.value)),
|
|
597
|
+
className: `${y} w-24 text-right`
|
|
560
598
|
})]
|
|
561
599
|
}),
|
|
562
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ g("label", {
|
|
563
601
|
className: "flex items-center justify-between gap-4 text-sm text-text-primary",
|
|
564
|
-
children: ["Focus blocks per day", /* @__PURE__ */
|
|
602
|
+
children: ["Focus blocks per day", /* @__PURE__ */ h("input", {
|
|
565
603
|
type: "number",
|
|
566
604
|
min: 1,
|
|
567
605
|
max: 6,
|
|
568
|
-
value:
|
|
569
|
-
onChange: (e) =>
|
|
570
|
-
className: `${
|
|
606
|
+
value: at,
|
|
607
|
+
onChange: (e) => ot(Number(e.target.value)),
|
|
608
|
+
className: `${y} w-24 text-right`
|
|
609
|
+
})]
|
|
610
|
+
}),
|
|
611
|
+
/* @__PURE__ */ g("label", {
|
|
612
|
+
className: "flex items-center justify-between gap-4 text-sm text-text-primary",
|
|
613
|
+
children: ["Hold accepted blocks on my calendar", /* @__PURE__ */ h("input", {
|
|
614
|
+
type: "checkbox",
|
|
615
|
+
checked: _t,
|
|
616
|
+
onChange: (e) => vt(e.target.checked),
|
|
617
|
+
className: "h-4 w-4 rounded border-border-subtle",
|
|
618
|
+
"data-testid": "focus-calendar-hold"
|
|
619
|
+
})]
|
|
620
|
+
}),
|
|
621
|
+
/* @__PURE__ */ g("label", {
|
|
622
|
+
className: "flex items-center justify-between gap-4 text-sm text-text-primary",
|
|
623
|
+
children: ["Remind me before a block starts", /* @__PURE__ */ h("select", {
|
|
624
|
+
value: K,
|
|
625
|
+
onChange: (e) => yt(Number(e.target.value)),
|
|
626
|
+
className: y,
|
|
627
|
+
"data-testid": "focus-start-nudge",
|
|
628
|
+
children: De(K).map((e) => /* @__PURE__ */ h("option", {
|
|
629
|
+
value: e.value,
|
|
630
|
+
children: e.label
|
|
631
|
+
}, e.value))
|
|
571
632
|
})]
|
|
572
633
|
}),
|
|
573
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ g("label", {
|
|
574
635
|
className: "flex items-center justify-between gap-4 text-sm text-text-primary",
|
|
575
|
-
children: ["Buffer around meetings (minutes)", /* @__PURE__ */
|
|
636
|
+
children: ["Buffer around meetings (minutes)", /* @__PURE__ */ h("input", {
|
|
576
637
|
type: "number",
|
|
577
638
|
min: 0,
|
|
578
639
|
max: 60,
|
|
579
640
|
step: 5,
|
|
580
|
-
value:
|
|
581
|
-
onChange: (e) =>
|
|
582
|
-
className: `${
|
|
641
|
+
value: st,
|
|
642
|
+
onChange: (e) => ct(Number(e.target.value)),
|
|
643
|
+
className: `${y} w-24 text-right`
|
|
583
644
|
})]
|
|
584
645
|
})
|
|
585
646
|
]
|
|
586
647
|
})]
|
|
587
648
|
}),
|
|
588
|
-
/* @__PURE__ */
|
|
649
|
+
/* @__PURE__ */ h("div", {
|
|
589
650
|
className: "mt-4 flex justify-end",
|
|
590
|
-
children: /* @__PURE__ */
|
|
651
|
+
children: /* @__PURE__ */ h("button", {
|
|
591
652
|
type: "button",
|
|
592
|
-
className:
|
|
593
|
-
disabled:
|
|
594
|
-
onClick:
|
|
653
|
+
className: b,
|
|
654
|
+
disabled: I,
|
|
655
|
+
onClick: kt,
|
|
595
656
|
"data-testid": "focus-save-settings",
|
|
596
|
-
children:
|
|
657
|
+
children: I ? "Saving..." : "Save focus settings"
|
|
597
658
|
})
|
|
598
659
|
})
|
|
599
660
|
]
|
|
@@ -602,6 +663,6 @@ function D() {
|
|
|
602
663
|
});
|
|
603
664
|
}
|
|
604
665
|
//#endregion
|
|
605
|
-
export {
|
|
666
|
+
export { Ue as FocusProtectionPage };
|
|
606
667
|
|
|
607
668
|
//# sourceMappingURL=FocusProtectionPage.js.map
|