@burdenoff/microfe-calendar 2026.1124.3 → 2026.1124.4
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 +342 -69
- package/dist/generated/wspace-operations.js +73 -31
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +405 -6
- package/dist/translations/en.d.ts +22 -4
- package/dist/v2/CalendarPageV2.js +45 -41
- package/dist/v2/CalendarPageV2.js.map +1 -1
- package/dist/v2/CalendarRoutesV2.js +64 -64
- package/dist/v2/CalendarRoutesV2.js.map +1 -1
- package/dist/v2/data/errors.d.ts +5 -0
- package/dist/v2/data/errors.js +6 -2
- package/dist/v2/data/errors.js.map +1 -1
- package/dist/v2/data/normalize.d.ts +31 -3
- package/dist/v2/data/normalize.js +57 -13
- package/dist/v2/data/normalize.js.map +1 -1
- package/dist/v2/data/seriesDateLookup.d.ts +9 -0
- package/dist/v2/data/seriesDateLookup.js +12 -0
- package/dist/v2/data/seriesDateLookup.js.map +1 -0
- package/dist/v2/data/useEventActions.d.ts +9 -3
- package/dist/v2/data/useEventActions.js +239 -186
- package/dist/v2/data/useEventActions.js.map +1 -1
- package/dist/v2/data/useEventForPeek.js +63 -21
- package/dist/v2/data/useEventForPeek.js.map +1 -1
- package/dist/v2/data/useEventsInRangeV2.d.ts +40 -2
- package/dist/v2/data/useEventsInRangeV2.js +76 -47
- package/dist/v2/data/useEventsInRangeV2.js.map +1 -1
- package/dist/v2/day/DayPanel.js +1 -1
- package/dist/v2/day/DayPanel.js.map +1 -1
- package/dist/v2/event/EventDialog.d.ts +13 -3
- package/dist/v2/event/EventDialog.js +189 -166
- package/dist/v2/event/EventDialog.js.map +1 -1
- package/dist/v2/event/EventDialogs.js +57 -50
- package/dist/v2/event/EventDialogs.js.map +1 -1
- package/dist/v2/event/EventMoreTab.js +8 -7
- package/dist/v2/event/EventMoreTab.js.map +1 -1
- package/dist/v2/event/EventPlaceTab.js +2 -2
- package/dist/v2/event/EventPlaceTab.js.map +1 -1
- package/dist/v2/event/FindTimeDialog.js +1 -1
- package/dist/v2/event/FindTimeDialog.js.map +1 -1
- package/dist/v2/event/RepeatField.js +10 -7
- package/dist/v2/event/RepeatField.js.map +1 -1
- package/dist/v2/event/dialogLogic.d.ts +10 -0
- package/dist/v2/event/dialogLogic.js +25 -22
- package/dist/v2/event/dialogLogic.js.map +1 -1
- package/dist/v2/event/dialogModel.d.ts +3 -0
- package/dist/v2/event/dialogModel.js.map +1 -1
- package/dist/v2/event/eventForm.d.ts +26 -0
- package/dist/v2/event/eventForm.js +145 -92
- package/dist/v2/event/eventForm.js.map +1 -1
- package/dist/v2/event/findTimeSource.js +44 -44
- package/dist/v2/event/findTimeSource.js.map +1 -1
- package/dist/v2/event/rrule.js.map +1 -1
- package/dist/v2/event/savePlan.d.ts +125 -15
- package/dist/v2/event/savePlan.js +162 -68
- package/dist/v2/event/savePlan.js.map +1 -1
- package/dist/v2/event/useEventData.d.ts +7 -2
- package/dist/v2/event/useEventData.js +107 -80
- package/dist/v2/event/useEventData.js.map +1 -1
- package/dist/v2/event/useEventDialogModel.d.ts +16 -3
- package/dist/v2/event/useEventDialogModel.js +82 -67
- package/dist/v2/event/useEventDialogModel.js.map +1 -1
- package/dist/v2/event/useEventSave.d.ts +20 -4
- package/dist/v2/event/useEventSave.js +181 -90
- package/dist/v2/event/useEventSave.js.map +1 -1
- package/dist/v2/events/eventLook.js +16 -16
- package/dist/v2/events/eventLook.js.map +1 -1
- package/dist/v2/events/eventModel.d.ts +17 -4
- package/dist/v2/events/eventModel.js +46 -34
- package/dist/v2/events/eventModel.js.map +1 -1
- package/dist/v2/events/localChanges.d.ts +4 -1
- package/dist/v2/events/localChanges.js +4 -2
- package/dist/v2/events/localChanges.js.map +1 -1
- package/dist/v2/page/CalendarPageContext.d.ts +2 -2
- package/dist/v2/page/CalendarPageContext.js.map +1 -1
- package/dist/v2/page/useCalendarPageModel.js +141 -139
- package/dist/v2/page/useCalendarPageModel.js.map +1 -1
- package/dist/v2/page/viewState.d.ts +9 -1
- package/dist/v2/page/viewState.js +5 -3
- package/dist/v2/page/viewState.js.map +1 -1
- package/dist/v2/peek/PeekEvent.js +210 -204
- package/dist/v2/peek/PeekEvent.js.map +1 -1
- package/dist/v2/rail/useMonthEventDates.js +1 -1
- package/dist/v2/rail/useMonthEventDates.js.map +1 -1
- package/dist/v2/states/CalendarStates.d.ts +15 -0
- package/dist/v2/states/CalendarStates.js +42 -11
- package/dist/v2/states/CalendarStates.js.map +1 -1
- package/dist/v2/types.d.ts +30 -2
- package/package.json +1 -1
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { myPart as
|
|
3
|
-
import { formatDay as
|
|
4
|
-
import { instantToZoned as
|
|
5
|
-
import { REMINDER_IN_APP as
|
|
6
|
-
import { graphQLErrorCode as
|
|
1
|
+
import { CalendarV2CancelOccurrenceDocument as e, CalendarV2CreateEventDocument as t, CalendarV2CreateReminderDocument as n, CalendarV2DeleteEventDocument as r, CalendarV2DuplicateEventDocument as i, CalendarV2EventIcsDocument as a, CalendarV2RespondToEventDocument as o, CalendarV2RestoreEventDocument as s, CalendarV2RestoreOccurrenceDocument as c, CalendarV2TriggerSyncDocument as l, CalendarV2UpdateEventTimesDocument as u } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { isSeriesDate as d, myPart as f } from "../events/eventModel.js";
|
|
3
|
+
import { formatDay as p, formatDuration as ee, formatInstantRange as m, formatInstantTime as te } from "../format.js";
|
|
4
|
+
import { instantToZoned as h } from "../time/calendarTime.js";
|
|
5
|
+
import { REMINDER_IN_APP as ne, RSVP_STATUS as re, SCOPE_ALL_EVENTS as ie } from "./enums.js";
|
|
6
|
+
import { graphQLErrorCode as ae } from "./errors.js";
|
|
7
7
|
import { invalidateCalendarEvents as g } from "./invalidation.js";
|
|
8
8
|
import { SerialWrites as _ } from "./serialWrites.js";
|
|
9
|
-
import { useCallback as v, useEffect as
|
|
10
|
-
import { useConfirm as S, useNotify as
|
|
11
|
-
import { useApolloClient as
|
|
12
|
-
function
|
|
9
|
+
import { useCallback as v, useEffect as y, useMemo as oe, useRef as b, useState as x } from "react";
|
|
10
|
+
import { useConfirm as S, useNotify as se } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { useApolloClient as ce } from "@apollo/client/react";
|
|
12
|
+
function C(e, t) {
|
|
13
13
|
return e.guests.filter((e) => !e.organizer && e.userId !== t).length;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
let n =
|
|
17
|
-
return
|
|
15
|
+
function w(e, t) {
|
|
16
|
+
let n = h(e, t.timeZone).date;
|
|
17
|
+
return p(n, t.format, "mid");
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function le(e, t) {
|
|
20
20
|
if (typeof document > "u" || typeof URL.createObjectURL != "function") return !1;
|
|
21
21
|
let n = URL.createObjectURL(new Blob([e], { type: "text/calendar;charset=utf-8" })), r = document.createElement("a");
|
|
22
22
|
return r.href = n, r.download = t, r.rel = "noopener", document.body.appendChild(r), r.click(), r.remove(), setTimeout(() => URL.revokeObjectURL(n), 1e3), !0;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function T(e) {
|
|
25
25
|
return `${e.normalize("NFKD").replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").slice(0, 60).toLowerCase() || "event"}.ics`;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
let
|
|
27
|
+
function E(f) {
|
|
28
|
+
let E = ce(), D = se(), O = S(), [k, A] = x(/* @__PURE__ */ new Map()), [j, ue] = x(/* @__PURE__ */ new Set()), [M, N] = x(/* @__PURE__ */ new Map()), [P] = x(() => new _()), F = b({
|
|
29
29
|
times: /* @__PURE__ */ new Set(),
|
|
30
30
|
answers: /* @__PURE__ */ new Set()
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
}), I = b(f);
|
|
32
|
+
y(() => {
|
|
33
|
+
I.current = f;
|
|
34
34
|
});
|
|
35
|
-
let
|
|
36
|
-
|
|
35
|
+
let L = v((e, t) => {
|
|
36
|
+
A((n) => {
|
|
37
37
|
let r = new Map(n);
|
|
38
38
|
return t ? r.set(e, t) : r.delete(e), r;
|
|
39
39
|
});
|
|
40
|
-
}, []),
|
|
41
|
-
|
|
40
|
+
}, []), R = v((e, t) => {
|
|
41
|
+
ue((n) => {
|
|
42
42
|
let r = new Set(n);
|
|
43
43
|
return t ? r.add(e) : r.delete(e), r;
|
|
44
44
|
});
|
|
45
|
-
}, []),
|
|
46
|
-
|
|
45
|
+
}, []), z = v((e, t) => {
|
|
46
|
+
N((n) => {
|
|
47
47
|
let r = new Map(n);
|
|
48
48
|
return t ? r.set(e, t) : r.delete(e), r;
|
|
49
49
|
});
|
|
50
|
-
}, []),
|
|
51
|
-
await
|
|
52
|
-
mutation:
|
|
50
|
+
}, []), B = v(async (e, t) => {
|
|
51
|
+
await E.mutate({
|
|
52
|
+
mutation: u,
|
|
53
53
|
variables: {
|
|
54
54
|
id: e,
|
|
55
55
|
input: {
|
|
@@ -58,100 +58,150 @@ function O(l) {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
}, [
|
|
62
|
-
await
|
|
63
|
-
mutation:
|
|
61
|
+
}, [E]), V = v(async (e, t, n) => {
|
|
62
|
+
await E.mutate({
|
|
63
|
+
mutation: r,
|
|
64
64
|
variables: {
|
|
65
65
|
id: e,
|
|
66
66
|
holdSeconds: t,
|
|
67
|
-
scope:
|
|
67
|
+
scope: n ?? null
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
|
-
}, [
|
|
71
|
-
let { tr: n } =
|
|
72
|
-
|
|
70
|
+
}, [E]), H = v((e, t) => {
|
|
71
|
+
let { tr: n } = I.current, r = ae(t), i = r === "FORBIDDEN" || r === "UNAUTHORIZED" ? n("calendar.v2.actionForbidden", "You don’t have permission to change this event.") : r === "NOT_FOUND" ? n("calendar.v2.actionGone", "It may have been deleted or moved by someone else.") : n("calendar.v2.actionRetry", "Nothing was changed. Try again in a moment.");
|
|
72
|
+
D({
|
|
73
73
|
title: e,
|
|
74
74
|
description: i,
|
|
75
75
|
tone: "error"
|
|
76
76
|
});
|
|
77
|
-
}, [
|
|
78
|
-
let r =
|
|
77
|
+
}, [D]), U = v(async (e, t, n) => {
|
|
78
|
+
let r = I.current, i = {
|
|
79
79
|
start: e.start,
|
|
80
80
|
end: e.end
|
|
81
|
-
}, a = `times:${e.id}`, o =
|
|
82
|
-
s.delete(e.id),
|
|
81
|
+
}, a = `times:${e.id}`, o = P.claim(a), s = F.current.times;
|
|
82
|
+
s.delete(e.id), L(e.id, t);
|
|
83
83
|
try {
|
|
84
|
-
await
|
|
84
|
+
await P.run(a, () => B(e.eventId, t));
|
|
85
85
|
} catch (t) {
|
|
86
|
-
if (!
|
|
87
|
-
|
|
86
|
+
if (!P.isNewest(a, o)) return;
|
|
87
|
+
L(e.id, null), H(n === "move" ? r.tr("calendar.v2.moveFailed", "Couldn’t move “{{title}}”", { title: e.title }) : r.tr("calendar.v2.resizeFailed", "Couldn’t change “{{title}}”", { title: e.title }), t);
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
|
-
if (
|
|
90
|
+
if (P.isNewest(a, o) && s.add(e.id), g(), !P.isNewest(a, o)) return;
|
|
91
91
|
let c = Math.round((t.end.getTime() - t.start.getTime()) / 6e4), l = n === "move" ? r.tr("calendar.v2.moved", "Moved “{{title}}” to {{day}}, {{time}}.", {
|
|
92
92
|
title: e.title,
|
|
93
|
-
day:
|
|
94
|
-
time:
|
|
93
|
+
day: w(t.start, r),
|
|
94
|
+
time: m(t.start, t.end, r.timeZone, r.format)
|
|
95
95
|
}) : r.tr("calendar.v2.resized", "“{{title}}” now ends at {{time}} ({{length}}).", {
|
|
96
96
|
title: e.title,
|
|
97
|
-
time:
|
|
98
|
-
length:
|
|
97
|
+
time: te(t.end, r.timeZone, r.format),
|
|
98
|
+
length: ee(c, r.durationWords)
|
|
99
99
|
});
|
|
100
|
-
|
|
100
|
+
D({
|
|
101
101
|
title: l,
|
|
102
102
|
tone: "success",
|
|
103
103
|
undoneTitle: r.tr("calendar.v2.movedBack", "Put back."),
|
|
104
104
|
undoFailedTitle: r.tr("calendar.v2.moveBackFailed", "Couldn’t put it back."),
|
|
105
105
|
undo: async () => {
|
|
106
|
-
let t =
|
|
107
|
-
s.delete(e.id),
|
|
106
|
+
let t = P.claim(a);
|
|
107
|
+
s.delete(e.id), L(e.id, i);
|
|
108
108
|
try {
|
|
109
|
-
await
|
|
109
|
+
await P.run(a, () => B(e.eventId, i));
|
|
110
110
|
} catch (n) {
|
|
111
|
-
throw
|
|
111
|
+
throw P.isNewest(a, t) && L(e.id, null), n;
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
P.isNewest(a, t) && s.add(e.id), g();
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
}, [
|
|
117
|
-
W,
|
|
118
|
-
k,
|
|
119
|
-
z,
|
|
120
117
|
H,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
118
|
+
D,
|
|
119
|
+
L,
|
|
120
|
+
B,
|
|
121
|
+
P
|
|
122
|
+
]), W = v(async (e) => {
|
|
123
|
+
let t = I.current, n = e.seriesId ?? e.eventId;
|
|
124
|
+
if (await O({
|
|
125
|
+
title: t.tr("calendar.v2.deleteSeriesTitle", "Delete every event in “{{title}}”?", { title: e.title }),
|
|
126
|
+
description: t.tr("calendar.v2.deleteSeriesBody", "This is a repeating event. Every event in the series is deleted, and its guests are told. This can’t be undone."),
|
|
127
|
+
tone: "danger",
|
|
128
|
+
confirmLabel: t.tr("calendar.v2.deleteSeries", "Delete the series"),
|
|
129
|
+
cancelLabel: t.tr("calendar.v2.keep", "Keep it")
|
|
130
|
+
})) {
|
|
131
|
+
R(n, !0);
|
|
133
132
|
try {
|
|
134
|
-
await
|
|
135
|
-
} catch (
|
|
136
|
-
|
|
133
|
+
await V(n, 0, ie);
|
|
134
|
+
} catch (r) {
|
|
135
|
+
R(n, !1), H(t.tr("calendar.v2.deleteFailed", "Couldn’t delete “{{title}}”", { title: e.title }), r);
|
|
137
136
|
return;
|
|
138
137
|
}
|
|
139
|
-
g(),
|
|
138
|
+
g(), D({
|
|
140
139
|
title: t.tr("calendar.v2.deletedSeries", "Deleted every event in “{{title}}”.", { title: e.title }),
|
|
141
140
|
tone: "success"
|
|
142
141
|
});
|
|
142
|
+
}
|
|
143
|
+
}, [
|
|
144
|
+
O,
|
|
145
|
+
V,
|
|
146
|
+
H,
|
|
147
|
+
D,
|
|
148
|
+
R
|
|
149
|
+
]), G = v(async (t, n, r) => {
|
|
150
|
+
let i = I.current, a = {
|
|
151
|
+
seriesId: n,
|
|
152
|
+
instanceDate: r.toISOString()
|
|
153
|
+
};
|
|
154
|
+
R(t.id, !0);
|
|
155
|
+
try {
|
|
156
|
+
await E.mutate({
|
|
157
|
+
mutation: e,
|
|
158
|
+
variables: a
|
|
159
|
+
});
|
|
160
|
+
} catch (e) {
|
|
161
|
+
R(t.id, !1), H(i.tr("calendar.v2.deleteFailed", "Couldn’t delete “{{title}}”", { title: t.title }), e);
|
|
143
162
|
return;
|
|
144
163
|
}
|
|
145
|
-
|
|
164
|
+
g(), D({
|
|
165
|
+
title: i.tr("calendar.v2.deletedDate", "Deleted “{{title}}” on {{day}}.", {
|
|
166
|
+
title: t.title,
|
|
167
|
+
day: w(t.start, i)
|
|
168
|
+
}),
|
|
169
|
+
description: C(t, i.me) === 0 ? i.tr("calendar.v2.deletedDateRest", "The series’ other dates stay.") : i.tr("calendar.v2.deletedDateGuests", "The series’ other dates stay. Its guests aren’t told about this one."),
|
|
170
|
+
tone: "success",
|
|
171
|
+
undoneTitle: i.tr("calendar.v2.restoredDate", "Put back."),
|
|
172
|
+
undoFailedTitle: i.tr("calendar.v2.restoreDateFailed", "Couldn’t put it back."),
|
|
173
|
+
undo: async () => {
|
|
174
|
+
await E.mutate({
|
|
175
|
+
mutation: c,
|
|
176
|
+
variables: a
|
|
177
|
+
}), R(t.id, !1), g();
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}, [
|
|
181
|
+
E,
|
|
182
|
+
H,
|
|
183
|
+
D,
|
|
184
|
+
R
|
|
185
|
+
]), K = v(async (e) => {
|
|
186
|
+
let t = I.current;
|
|
187
|
+
if (d(e) && e.seriesId && e.instanceDate) {
|
|
188
|
+
await G(e, e.seriesId, e.instanceDate);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (e.isRecurring) {
|
|
192
|
+
await W(e);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
R(e.id, !0);
|
|
146
196
|
try {
|
|
147
|
-
await
|
|
197
|
+
await V(e.eventId, 8);
|
|
148
198
|
} catch (n) {
|
|
149
|
-
|
|
199
|
+
R(e.id, !1), H(t.tr("calendar.v2.deleteFailed", "Couldn’t delete “{{title}}”", { title: e.title }), n);
|
|
150
200
|
return;
|
|
151
201
|
}
|
|
152
202
|
g();
|
|
153
|
-
let n =
|
|
154
|
-
|
|
203
|
+
let n = C(e, t.me);
|
|
204
|
+
D({
|
|
155
205
|
title: t.tr("calendar.v2.deleted", "Deleted “{{title}}”.", { title: e.title }),
|
|
156
206
|
description: n === 0 ? void 0 : n === 1 ? t.tr("calendar.v2.deletedTellOne", "Its guest hears it’s cancelled when this closes.") : t.tr("calendar.v2.deletedTellMany", "{{count}} guests hear it’s cancelled when this closes.", { count: n }),
|
|
157
207
|
tone: "success",
|
|
@@ -159,216 +209,218 @@ function O(l) {
|
|
|
159
209
|
undoneTitle: t.tr("calendar.v2.restored", "Restored. Nobody was told."),
|
|
160
210
|
undoFailedTitle: t.tr("calendar.v2.restoreFailed", "Too late to undo: it’s deleted."),
|
|
161
211
|
undo: async () => {
|
|
162
|
-
await
|
|
163
|
-
mutation:
|
|
164
|
-
variables: { id: e.
|
|
165
|
-
}),
|
|
212
|
+
await E.mutate({
|
|
213
|
+
mutation: s,
|
|
214
|
+
variables: { id: e.eventId }
|
|
215
|
+
}), R(e.id, !1), g();
|
|
166
216
|
}
|
|
167
217
|
});
|
|
168
218
|
}, [
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
219
|
+
E,
|
|
220
|
+
V,
|
|
221
|
+
H,
|
|
222
|
+
D,
|
|
172
223
|
W,
|
|
173
|
-
|
|
174
|
-
|
|
224
|
+
G,
|
|
225
|
+
R
|
|
175
226
|
]), q = v(async (e, t) => {
|
|
176
|
-
let n =
|
|
227
|
+
let n = I.current, r = M.get(e.eventId) ?? e.myResponse ?? "NO_RESPONSE";
|
|
177
228
|
if (r === t) return;
|
|
178
|
-
let i = `answer:${e.
|
|
179
|
-
await
|
|
180
|
-
mutation:
|
|
229
|
+
let i = `answer:${e.eventId}`, a = (t) => P.run(i, async () => {
|
|
230
|
+
await E.mutate({
|
|
231
|
+
mutation: o,
|
|
181
232
|
variables: {
|
|
182
|
-
eventId: e.
|
|
183
|
-
status:
|
|
233
|
+
eventId: e.eventId,
|
|
234
|
+
status: re[t]
|
|
184
235
|
}
|
|
185
236
|
});
|
|
186
|
-
}), s =
|
|
187
|
-
c.delete(e.
|
|
237
|
+
}), s = P.claim(i), c = F.current.answers;
|
|
238
|
+
c.delete(e.eventId), z(e.eventId, t);
|
|
188
239
|
try {
|
|
189
|
-
await
|
|
240
|
+
await a(t);
|
|
190
241
|
} catch (t) {
|
|
191
|
-
if (!
|
|
192
|
-
|
|
242
|
+
if (!P.isNewest(i, s)) return;
|
|
243
|
+
z(e.eventId, null), H(n.tr("calendar.v2.answerFailed", "Couldn’t send your answer to “{{title}}”", { title: e.title }), t);
|
|
193
244
|
return;
|
|
194
245
|
}
|
|
195
|
-
if (
|
|
246
|
+
if (P.isNewest(i, s) && c.add(e.eventId), g(), !P.isNewest(i, s)) return;
|
|
196
247
|
let l = t === "ACCEPTED" ? n.tr("calendar.v2.answeredYes", "You’re going to “{{title}}”. The organiser is told.", { title: e.title }) : t === "TENTATIVE" ? n.tr("calendar.v2.answeredMaybe", "You’re a maybe for “{{title}}”.", { title: e.title }) : n.tr("calendar.v2.answeredNo", "You declined “{{title}}”.", { title: e.title });
|
|
197
|
-
|
|
248
|
+
D({
|
|
198
249
|
title: l,
|
|
199
250
|
description: t === "DECLINED" && !n.showDeclined ? n.tr("calendar.v2.declinedHidden", "It’s hidden now. “Show events I declined” is in Calendar settings.") : void 0,
|
|
200
251
|
tone: "success",
|
|
201
252
|
undoneTitle: n.tr("calendar.v2.answerUndone", "Your answer is back as it was."),
|
|
202
253
|
undo: async () => {
|
|
203
|
-
let t =
|
|
204
|
-
c.delete(e.
|
|
254
|
+
let t = P.claim(i);
|
|
255
|
+
c.delete(e.eventId), z(e.eventId, r);
|
|
205
256
|
try {
|
|
206
|
-
await
|
|
257
|
+
await a(r);
|
|
207
258
|
} catch (n) {
|
|
208
|
-
throw
|
|
259
|
+
throw P.isNewest(i, t) && z(e.eventId, null), n;
|
|
209
260
|
}
|
|
210
|
-
|
|
261
|
+
P.isNewest(i, t) && c.add(e.eventId), g();
|
|
211
262
|
}
|
|
212
263
|
});
|
|
213
264
|
}, [
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
265
|
+
M,
|
|
266
|
+
E,
|
|
267
|
+
H,
|
|
268
|
+
D,
|
|
269
|
+
z,
|
|
270
|
+
P
|
|
220
271
|
]), J = v(async (e) => {
|
|
221
|
-
let t =
|
|
272
|
+
let t = I.current, n = null;
|
|
222
273
|
try {
|
|
223
|
-
n = (await
|
|
224
|
-
mutation:
|
|
274
|
+
n = (await E.mutate({
|
|
275
|
+
mutation: i,
|
|
225
276
|
variables: {
|
|
226
|
-
eventId: e.
|
|
277
|
+
eventId: e.eventId,
|
|
227
278
|
newStartTime: e.start.toISOString()
|
|
228
279
|
}
|
|
229
280
|
})).data?.duplicateEvent.id ?? null;
|
|
230
281
|
} catch (n) {
|
|
231
|
-
|
|
282
|
+
H(t.tr("calendar.v2.duplicateFailed", "Couldn’t copy “{{title}}”", { title: e.title }), n);
|
|
232
283
|
return;
|
|
233
284
|
}
|
|
234
|
-
g(),
|
|
285
|
+
g(), D({
|
|
235
286
|
title: t.tr("calendar.v2.duplicated", "Made a copy of “{{title}}” at the same time.", { title: e.title }),
|
|
236
287
|
description: t.tr("calendar.v2.duplicatedHint", "Drag it where you want it, or open it to change it."),
|
|
237
288
|
tone: "success",
|
|
238
289
|
undoneTitle: t.tr("calendar.v2.copyRemoved", "The copy is gone."),
|
|
239
290
|
undo: n ? async () => {
|
|
240
|
-
n && (await
|
|
291
|
+
n && (await V(n, 0), g());
|
|
241
292
|
} : void 0
|
|
242
293
|
});
|
|
243
294
|
}, [
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
]), Y = v(async (
|
|
249
|
-
let r =
|
|
295
|
+
E,
|
|
296
|
+
V,
|
|
297
|
+
H,
|
|
298
|
+
D
|
|
299
|
+
]), Y = v(async (e) => {
|
|
300
|
+
let r = I.current, i = null;
|
|
250
301
|
try {
|
|
251
|
-
i = (await
|
|
252
|
-
mutation:
|
|
302
|
+
i = (await E.mutate({
|
|
303
|
+
mutation: t,
|
|
253
304
|
variables: { input: {
|
|
254
|
-
calendarId:
|
|
255
|
-
title:
|
|
256
|
-
startTime:
|
|
257
|
-
endTime:
|
|
258
|
-
allDay:
|
|
305
|
+
calendarId: e.calendarId,
|
|
306
|
+
title: e.title,
|
|
307
|
+
startTime: e.start.toISOString(),
|
|
308
|
+
endTime: e.end.toISOString(),
|
|
309
|
+
allDay: e.allDay,
|
|
259
310
|
eventType: "MEETING",
|
|
260
311
|
timezone: r.timeZone
|
|
261
312
|
} }
|
|
262
313
|
})).data?.createEvent.id ?? null;
|
|
263
|
-
} catch (
|
|
264
|
-
return
|
|
314
|
+
} catch (t) {
|
|
315
|
+
return H(r.tr("calendar.v2.createFailed", "Couldn’t add “{{title}}”", { title: e.title }), t), !1;
|
|
265
316
|
}
|
|
266
317
|
let a = !1;
|
|
267
318
|
if (i && r.defaultReminder !== null) try {
|
|
268
|
-
await
|
|
269
|
-
mutation:
|
|
319
|
+
await E.mutate({
|
|
320
|
+
mutation: n,
|
|
270
321
|
variables: { input: {
|
|
271
322
|
eventId: i,
|
|
272
323
|
minutesBefore: r.defaultReminder,
|
|
273
|
-
channel:
|
|
324
|
+
channel: ne
|
|
274
325
|
} }
|
|
275
326
|
});
|
|
276
327
|
} catch {
|
|
277
328
|
a = !0;
|
|
278
329
|
}
|
|
279
330
|
g();
|
|
280
|
-
let o =
|
|
281
|
-
return
|
|
331
|
+
let o = h(e.start, r.timeZone).date;
|
|
332
|
+
return D({
|
|
282
333
|
title: r.tr("calendar.v2.created", "Added “{{title}}”, {{day}} {{time}}.", {
|
|
283
|
-
title:
|
|
284
|
-
day:
|
|
285
|
-
time:
|
|
334
|
+
title: e.title,
|
|
335
|
+
day: p(o, r.format, "short"),
|
|
336
|
+
time: e.allDay ? r.tr("calendar.v2.allDayLower", "all day") : m(e.start, e.end, r.timeZone, r.format)
|
|
286
337
|
}),
|
|
287
338
|
description: a ? r.tr("calendar.v2.reminderMissed", "Its reminder wasn’t added. Open the event to add one.") : void 0,
|
|
288
339
|
tone: a ? "warning" : "success",
|
|
289
340
|
undoneTitle: r.tr("calendar.v2.createUndone", "Removed."),
|
|
290
341
|
undo: i ? async () => {
|
|
291
|
-
i && (await
|
|
342
|
+
i && (await V(i, 0), g());
|
|
292
343
|
} : void 0
|
|
293
344
|
}), !0;
|
|
294
345
|
}, [
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
346
|
+
E,
|
|
347
|
+
V,
|
|
348
|
+
H,
|
|
349
|
+
D
|
|
299
350
|
]), X = v(async (e) => {
|
|
300
|
-
let t =
|
|
351
|
+
let t = I.current;
|
|
301
352
|
try {
|
|
302
|
-
let t = (await
|
|
303
|
-
query:
|
|
304
|
-
variables: { eventId: e.
|
|
353
|
+
let t = (await E.query({
|
|
354
|
+
query: a,
|
|
355
|
+
variables: { eventId: e.eventId },
|
|
305
356
|
fetchPolicy: "network-only"
|
|
306
357
|
})).data?.exportEventToIcs;
|
|
307
|
-
if (!t || !
|
|
358
|
+
if (!t || !le(t, T(e.title))) throw Error("No file");
|
|
308
359
|
} catch {
|
|
309
|
-
|
|
360
|
+
D({
|
|
310
361
|
title: t.tr("calendar.v2.icsFailed", "Couldn’t download “{{title}}”", { title: e.title }),
|
|
311
362
|
description: t.tr("calendar.v2.actionRetry", "Nothing was changed. Try again in a moment."),
|
|
312
363
|
tone: "error"
|
|
313
364
|
});
|
|
314
365
|
}
|
|
315
|
-
}, [
|
|
316
|
-
let n =
|
|
366
|
+
}, [E, D]), Z = v(async (e, t) => {
|
|
367
|
+
let n = I.current;
|
|
317
368
|
try {
|
|
318
|
-
await navigator.clipboard.writeText(e),
|
|
369
|
+
await navigator.clipboard.writeText(e), D({
|
|
319
370
|
title: t,
|
|
320
371
|
tone: "success"
|
|
321
372
|
});
|
|
322
373
|
} catch {
|
|
323
|
-
|
|
374
|
+
D({
|
|
324
375
|
title: n.tr("calendar.v2.copyFailed", "Couldn’t copy. Select the text and copy it instead."),
|
|
325
376
|
tone: "error"
|
|
326
377
|
});
|
|
327
378
|
}
|
|
328
|
-
}, [
|
|
329
|
-
let t =
|
|
379
|
+
}, [D]), Q = v(async (e) => {
|
|
380
|
+
let t = I.current;
|
|
330
381
|
if (e.sync) {
|
|
331
382
|
try {
|
|
332
|
-
await
|
|
333
|
-
mutation:
|
|
383
|
+
await E.mutate({
|
|
384
|
+
mutation: l,
|
|
334
385
|
variables: { syncId: e.sync.id }
|
|
335
386
|
});
|
|
336
387
|
} catch (n) {
|
|
337
|
-
|
|
388
|
+
H(t.tr("calendar.v2.checkFailed", "Couldn’t check “{{name}}” now", { name: e.name }), n);
|
|
338
389
|
return;
|
|
339
390
|
}
|
|
340
|
-
t.reloadCalendars(), g(),
|
|
391
|
+
t.reloadCalendars(), g(), D({
|
|
341
392
|
title: t.tr("calendar.v2.checked", "Checked “{{name}}” for changes.", { name: e.name }),
|
|
342
393
|
tone: "success"
|
|
343
394
|
});
|
|
344
395
|
}
|
|
345
396
|
}, [
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
397
|
+
E,
|
|
398
|
+
H,
|
|
399
|
+
D
|
|
349
400
|
]), $ = v((e) => {
|
|
350
|
-
let t = new Map(e.map((e) => [e.id, e])), n = new Set(
|
|
351
|
-
|
|
401
|
+
let t = new Map(e.map((e) => [e.id, e])), n = new Map(e.map((e) => [e.eventId, e])), r = new Set(F.current.times), i = new Set(F.current.answers);
|
|
402
|
+
F.current.times.clear(), F.current.answers.clear(), A((e) => {
|
|
352
403
|
if (e.size === 0) return e;
|
|
353
|
-
let
|
|
404
|
+
let n = !1, i = new Map(e);
|
|
354
405
|
for (let [a, o] of e) {
|
|
355
406
|
let e = t.get(a);
|
|
356
|
-
(
|
|
407
|
+
(r.has(a) || e && e.start.getTime() === o.start.getTime() && e.end.getTime() === o.end.getTime()) && (i.delete(a), n = !0);
|
|
357
408
|
}
|
|
358
|
-
return r ? i : e;
|
|
359
|
-
}), F((e) => {
|
|
360
|
-
if (e.size === 0) return e;
|
|
361
|
-
let n = !1, i = new Map(e);
|
|
362
|
-
for (let [a, o] of e) (r.has(a) || t.get(a)?.myResponse === o) && (i.delete(a), n = !0);
|
|
363
409
|
return n ? i : e;
|
|
410
|
+
}), N((e) => {
|
|
411
|
+
if (e.size === 0) return e;
|
|
412
|
+
let t = !1, r = new Map(e);
|
|
413
|
+
for (let [a, o] of e) (i.has(a) || n.get(a)?.myResponse === o) && (r.delete(a), t = !0);
|
|
414
|
+
return t ? r : e;
|
|
364
415
|
});
|
|
365
416
|
}, []);
|
|
366
|
-
return
|
|
367
|
-
overrides:
|
|
368
|
-
removedIds:
|
|
369
|
-
answers:
|
|
370
|
-
changeTimes:
|
|
417
|
+
return oe(() => ({
|
|
418
|
+
overrides: k,
|
|
419
|
+
removedIds: j,
|
|
420
|
+
answers: M,
|
|
421
|
+
changeTimes: U,
|
|
371
422
|
remove: K,
|
|
423
|
+
removeSeries: W,
|
|
372
424
|
respond: q,
|
|
373
425
|
duplicate: J,
|
|
374
426
|
quickCreate: Y,
|
|
@@ -377,23 +429,24 @@ function O(l) {
|
|
|
377
429
|
checkSyncNow: Q,
|
|
378
430
|
settle: $
|
|
379
431
|
}), [
|
|
380
|
-
|
|
381
|
-
|
|
432
|
+
M,
|
|
433
|
+
U,
|
|
382
434
|
Q,
|
|
383
435
|
Z,
|
|
384
436
|
X,
|
|
385
437
|
J,
|
|
386
|
-
|
|
438
|
+
k,
|
|
387
439
|
Y,
|
|
388
440
|
K,
|
|
389
|
-
|
|
441
|
+
W,
|
|
442
|
+
j,
|
|
390
443
|
q,
|
|
391
444
|
$
|
|
392
445
|
]);
|
|
393
446
|
}
|
|
394
|
-
function
|
|
395
|
-
return
|
|
447
|
+
function D(e, t, n) {
|
|
448
|
+
return f(e, n) === "organizer" ? null : t.get(e.eventId) ?? e.myResponse;
|
|
396
449
|
}
|
|
397
|
-
export {
|
|
450
|
+
export { D as answerFor, T as icsFileName, E as useEventActions };
|
|
398
451
|
|
|
399
452
|
//# sourceMappingURL=useEventActions.js.map
|