@remit/web-client 0.0.310 → 0.0.311

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/web-client",
3
- "version": "0.0.310",
3
+ "version": "0.0.311",
4
4
  "type": "module",
5
5
  "description": "Remit web client, published as composable primitives — the app shell, auth shells, and runtime config. A distributor imports what it composes and bundles it.",
6
6
  "exports": {
@@ -105,6 +105,10 @@ export interface CalendarSuggestionAnswers {
105
105
  suggestionId: string,
106
106
  calendarId: string,
107
107
  ) => Promise<SuggestionAnswer>;
108
+ tentative: (
109
+ suggestionId: string,
110
+ calendarId: string,
111
+ ) => Promise<SuggestionAnswer>;
108
112
  decline: (suggestionId: string) => Promise<SuggestionAnswer>;
109
113
  dismiss: (
110
114
  suggestionId: string,
@@ -144,6 +148,17 @@ export function useCalendarSuggestionAnswers(): CalendarSuggestionAnswers {
144
148
  .catch(refused),
145
149
  [accept],
146
150
  );
151
+ const tentativeSuggestion = useCallback(
152
+ (suggestionId: string, calendarId: string) =>
153
+ accept
154
+ .mutateAsync({
155
+ path: { suggestionId },
156
+ body: { calendarId, answer: "Tentative" },
157
+ })
158
+ .then(() => ANSWERED)
159
+ .catch(refused),
160
+ [accept],
161
+ );
147
162
  const declineSuggestion = useCallback(
148
163
  (suggestionId: string) =>
149
164
  decline
@@ -164,12 +179,14 @@ export function useCalendarSuggestionAnswers(): CalendarSuggestionAnswers {
164
179
  return useMemo(
165
180
  () => ({
166
181
  accept: acceptSuggestion,
182
+ tentative: tentativeSuggestion,
167
183
  decline: declineSuggestion,
168
184
  dismiss: dismissSuggestion,
169
185
  isAnswering: accept.isPending || decline.isPending || dismiss.isPending,
170
186
  }),
171
187
  [
172
188
  acceptSuggestion,
189
+ tentativeSuggestion,
173
190
  declineSuggestion,
174
191
  dismissSuggestion,
175
192
  accept.isPending,
@@ -245,6 +245,12 @@ export function useIntelligenceCalendar(
245
245
  answer(invitationId, "add this to your calendar", () =>
246
246
  answers.accept(invitationId, defaultCalendarId),
247
247
  ),
248
+ onTentativeInvite: cancellation
249
+ ? undefined
250
+ : () =>
251
+ answer(invitationId, "add this as a maybe", () =>
252
+ answers.tentative(invitationId, defaultCalendarId),
253
+ ),
248
254
  onDeclineInvite: () =>
249
255
  answer(invitationId, "decline this", () => answers.decline(invitationId)),
250
256
  onMuteInvite: () =>