@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeekEvent.js","names":["_Fragment","Fragment$1","PEOPLE_SHOWN","usePeekModel","page","useCalendarPage","useCalendar","calendar","event","userIds","useMemo","guest","id","profiles","useActorProfiles","nameOf","carried","profile","userId","organizerGuest","span","eventDays","timeZone","when","formatDayTimeSpan","format","tr","formatDay","instantToZoned","formatInstantRange","isOrganizer","me","PeekTitle","jsx","compact","BottomSheetTitle","PeekTools","notify","useNotify","model","lockReason","more","Download","Link2","calendarV2Href","basePath","SEARCH_PARAMS","look","Trash2","ICON_BUTTON","Pencil","Lock","Copy","ActionMenu","CloseButton","PeekWhen","ownZone","Repeat","PeekNotices","room","eventRoom","roomName","Notice","AlertTriangle","Clock3","PeekJoin","url","joinUrl","Button","Video","PeekPlace","Row","Building2","MapPin","PeekPeople","answerOf","answer","response","counts","people","b","a","tally","part","hidden","Users","GuestRow","cn","FOCUS_RING","PeekReminders","channelWords","channel","Bell","reminder","formatDuration","durationWords","PeekCalendarLine","parts","CalendarDays","PeekNotes","FileText","PeekFooter","value","Segmented","next","CircleHelp","Crown","BusyPeek","calendarHueStyle","EyeOff","PeekEvent","BottomSheetDescription"],"sources":["../../../src/v2/peek/PeekEvent.tsx"],"sourcesContent":["/**\n * An event's peek (BOFF-15698 A1), built from one small part per section: the header and its\n * tools (Edit or Edit locked with the organiser's name, Duplicate, Delete, ⋯), when, notices,\n * Join, the place, the people and their answers, reminders, the calendar line, the notes, and\n * the footer (Yes · Maybe · No for a guest, Find a better time for the organiser). Someone\n * else's private time shows only \"Busy\".\n */\nimport { useMemo } from 'react';\nimport {\n AlertTriangle,\n Bell,\n Building2,\n CalendarDays,\n CircleHelp,\n Clock3,\n Copy,\n Crown,\n Download,\n EyeOff,\n FileText,\n Link2,\n Lock,\n MapPin,\n Pencil,\n Repeat,\n Trash2,\n Users,\n Video,\n} from 'lucide-react';\nimport { useActorProfiles } from '@burdenoff/fe-libs/shared';\nimport {\n ActionMenu,\n BottomSheetDescription,\n BottomSheetTitle,\n Button,\n Notice,\n Segmented,\n useNotify,\n type ActionMenuItem,\n} from '@burdenoff/fe-libs/ui';\nimport { cn } from '@burdenoff/fe-libs/utils';\nimport { useCalendar } from '../../providers/CalendarProvider';\nimport { calendarHueStyle } from '../colors';\nimport type { Answer } from '../data/useEventActions';\nimport type { EventLook } from '../events/eventLook';\nimport { eventRoom, isOrganizer, joinUrl } from '../events/eventModel';\nimport { formatDay, formatDayTimeSpan, formatDuration, formatInstantRange } from '../format';\nimport { useCalendarPage } from '../page/CalendarPageContext';\nimport { calendarV2Href, SEARCH_PARAMS } from '../routes';\nimport { FOCUS_RING, ICON_BUTTON } from '../styles';\nimport { eventDays, instantToZoned } from '../time/calendarTime';\nimport type { CalendarEventV2, CalendarV2, EventResponseV2 } from '../types';\nimport { CloseButton, GuestRow, Row } from './PeekParts';\n\n/** Guests listed before \"See all\". */\nconst PEOPLE_SHOWN = 6;\n\n/** What every part of an event's peek reads. */\ninterface PeekModel {\n event: CalendarEventV2;\n look: EventLook;\n calendar: CalendarV2 | undefined;\n calendarName: string;\n /** The person's answer (one given here first); null when they organise it or aren't asked. */\n answer: EventResponseV2 | null;\n iOrganise: boolean;\n organizerName: string;\n /** A person's name: the one the event carries, else their workspace profile's. */\n nameOf: (userId: string | null, carried: string | null) => string | null;\n /**\n * \"Friday 20 Nov · 14:30 – 15:30\", \"Fri 20 Nov, 23:00 – Sat 21 Nov, 01:00\",\n * \"Mon 16 Nov – Fri 20 Nov · all day\".\n */\n when: string;\n}\n\nfunction usePeekModel(event: CalendarEventV2): PeekModel {\n const page = useCalendarPage();\n const { tr, format, timeZone, me } = page;\n const { apiGatewayUrl, authToken, workspaceId } = useCalendar();\n const calendar = page.calendarsById.get(event.calendarId);\n const userIds = useMemo(\n () =>\n [...new Set([event.organizerId, ...event.guests.map((guest) => guest.userId)])]\n .filter((id): id is string => Boolean(id))\n .map((actorId) => ({ actorId, actorType: 'user' })),\n [event.guests, event.organizerId]\n );\n const profiles = useActorProfiles(userIds, { apiGatewayUrl, authToken, workspaceId });\n const nameOf = (userId: string | null, carried: string | null): string | null => {\n if (carried) return carried;\n const profile = userId ? profiles[userId] : undefined;\n return profile?.resolved ? profile.displayName : null;\n };\n const organizerGuest = event.guests.find((guest) => guest.organizer) ?? null;\n const span = eventDays(event, timeZone);\n let when: string;\n if (!event.allDay && span.start !== span.end) {\n // Over midnight, or a day or more: both ends with their days.\n when = formatDayTimeSpan(event.start, event.end, timeZone, format);\n } else if (!event.allDay) {\n when = `${formatDay(instantToZoned(event.start, timeZone).date, format, 'mid')} · ${formatInstantRange(event.start, event.end, timeZone, format)}`;\n } else if (span.start === span.end) {\n when = tr('calendar.v2.whenAllDay', '{{day}} · all day', {\n day: formatDay(span.start, format, 'mid'),\n });\n } else {\n when = tr('calendar.v2.whenAllDays', '{{from}} – {{to}} · all day', {\n from: formatDay(span.start, format, 'short'),\n to: formatDay(span.end, format, 'short'),\n });\n }\n return {\n event,\n look: page.lookOf(event),\n calendar,\n calendarName: calendar?.name ?? tr('calendar.v2.aCalendar', 'a calendar'),\n answer: page.answerOf(event),\n iOrganise: isOrganizer(event, me),\n organizerName:\n nameOf(event.organizerId, organizerGuest?.name ?? null) ??\n tr('calendar.v2.theOrganiser', 'the organiser'),\n nameOf,\n when,\n };\n}\n\n/** The peek's heading: the sheet's title on phones (it names the dialog), else an h3. */\nfunction PeekTitle({ children, className }: { children: string; className: string }) {\n const { compact } = useCalendarPage();\n return compact ? (\n <BottomSheetTitle className={className}>{children}</BottomSheetTitle>\n ) : (\n <h3 className={className}>{children}</h3>\n );\n}\n\n/** Edit (or Edit locked, saying who can), Duplicate, Delete, ⋯ and close. */\nfunction PeekTools({ model }: { model: PeekModel }) {\n const page = useCalendarPage();\n const { tr } = page;\n const { basePath } = useCalendar();\n const notify = useNotify();\n const { event, look, calendar } = model;\n const lockReason = calendar?.isReadOnly\n ? tr(\n 'calendar.v2.lockedFollowed',\n 'It comes from {{calendar}}, a calendar you follow. Change it where it lives.',\n { calendar: model.calendarName }\n )\n : tr('calendar.v2.lockedOrganiser', 'Only {{name}}, the organiser, can change this event.', {\n name: model.organizerName,\n });\n const more: ActionMenuItem[] = [\n {\n id: 'ics',\n label: tr('calendar.v2.downloadEvent', 'Download (.ics)'),\n icon: Download,\n onSelect: () => void page.actions.downloadIcs(event),\n },\n {\n id: 'link',\n label: tr('calendar.v2.copyEventLink', 'Copy a link to it'),\n icon: Link2,\n onSelect: () =>\n void page.actions.copyText(\n `${window.location.origin}${calendarV2Href(basePath, 'week', {\n [SEARCH_PARAMS.event]: event.id,\n [SEARCH_PARAMS.date]: eventDays(event, page.timeZone).start,\n })}`,\n tr('calendar.v2.linkCopied', 'Link copied.')\n ),\n },\n ];\n if (event.isRecurring && look.editable) {\n more.push({\n id: 'series',\n label: tr('calendar.v2.deleteSeriesMenu', 'Delete the whole series…'),\n icon: Trash2,\n danger: true,\n separatorBefore: true,\n onSelect: () => {\n page.closePeek();\n void page.actions.remove(event);\n },\n });\n }\n return (\n <div className=\"flex shrink-0 items-center\">\n {look.editable ? (\n <button\n type=\"button\"\n className={ICON_BUTTON}\n aria-label={tr('calendar.v2.edit', 'Edit')}\n title={tr('calendar.v2.edit', 'Edit')}\n onClick={() => page.openEventDialog({ eventId: event.id })}\n >\n <Pencil aria-hidden=\"true\" />\n </button>\n ) : (\n <button\n type=\"button\"\n className={ICON_BUTTON}\n aria-label={tr('calendar.v2.editLocked', 'Edit (locked): {{reason}}', {\n reason: lockReason,\n })}\n title={lockReason}\n onClick={() => notify({ title: lockReason, tone: 'info' })}\n >\n <Lock aria-hidden=\"true\" />\n </button>\n )}\n {calendar && !calendar.isReadOnly ? (\n <button\n type=\"button\"\n className={ICON_BUTTON}\n aria-label={tr('calendar.v2.duplicate', 'Duplicate')}\n title={tr('calendar.v2.duplicate', 'Duplicate')}\n onClick={() => {\n page.closePeek();\n void page.actions.duplicate(event);\n }}\n >\n <Copy aria-hidden=\"true\" />\n </button>\n ) : null}\n {look.editable ? (\n <button\n type=\"button\"\n className={ICON_BUTTON}\n aria-label={tr('calendar.v2.delete', 'Delete')}\n title={tr('calendar.v2.delete', 'Delete')}\n onClick={() => {\n page.closePeek();\n void page.actions.remove(event);\n }}\n >\n <Trash2 aria-hidden=\"true\" />\n </button>\n ) : null}\n <ActionMenu\n items={more}\n placement=\"row\"\n label={tr('calendar.v2.moreForEvent', 'More for this event')}\n />\n <CloseButton />\n </div>\n );\n}\n\n/** When, \"Repeats\", and the time in the event's own zone when it isn't the calendar's. */\nfunction PeekWhen({ model }: { model: PeekModel }) {\n const { tr, format, timeZone } = useCalendarPage();\n const { event } = model;\n const ownZone =\n event.timeZone && event.timeZone !== timeZone && !event.allDay ? event.timeZone : null;\n return (\n <p className=\"mb-3 ps-[26px] text-sm text-text-secondary\">\n {model.when}\n {event.isRecurring ? (\n <span className=\"ms-1 inline-flex items-center gap-1\">\n · <Repeat className=\"size-3\" aria-hidden=\"true\" />\n {tr('calendar.v2.repeats', 'Repeats')}\n </span>\n ) : null}\n {ownZone ? (\n <span className=\"mt-0.5 block text-xs text-text-muted\">\n {tr('calendar.v2.inItsZone', '{{time}} in {{zone}}', {\n time: formatInstantRange(event.start, event.end, ownZone, format),\n zone: ownZone,\n })}\n </span>\n ) : null}\n </p>\n );\n}\n\n/** A room turned down or waiting, and a calendar followed by link (read-only). */\nfunction PeekNotices({ model }: { model: PeekModel }) {\n const { tr } = useCalendarPage();\n const room = eventRoom(model.event);\n const roomName = room?.name ?? tr('calendar.v2.theRoom', 'The room');\n return (\n <>\n {model.look.roomRefused && room ? (\n <Notice tone=\"warn\" icon={AlertTriangle}>\n <b>{tr('calendar.v2.roomRefusedTitle', 'Room not available.')}</b>{' '}\n {tr(\n 'calendar.v2.roomRefusedBody',\n '{{room}} turned down the booking. Pick another room in the event.',\n { room: roomName }\n )}\n </Notice>\n ) : null}\n {model.look.roomPending && room ? (\n <Notice tone=\"info\" icon={Clock3}>\n {tr('calendar.v2.roomPendingBody', '{{room}} is waiting for approval.', {\n room: roomName,\n })}\n </Notice>\n ) : null}\n {model.calendar?.isReadOnly ? (\n <Notice tone=\"lock\" icon={Lock}>\n {tr(\n 'calendar.v2.readOnlyNote',\n 'From {{calendar}}, a calendar you follow. You can’t change it here.',\n { calendar: model.calendarName }\n )}\n </Notice>\n ) : null}\n </>\n );\n}\n\n/** Join the call, its link, and Copy. */\nfunction PeekJoin({ event }: { event: CalendarEventV2 }) {\n const page = useCalendarPage();\n const { tr } = page;\n const url = joinUrl(event);\n if (!url) return null;\n return (\n <div className=\"flex items-center gap-2\">\n <Button asChild>\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n <Video aria-hidden=\"true\" />\n {tr('calendar.v2.joinCall', 'Join the call')}\n </a>\n </Button>\n <span className=\"min-w-0 flex-1 truncate font-mono text-xs text-text-secondary\">\n {url.replace(/^https?:\\/\\//, '')}\n </span>\n <button\n type=\"button\"\n className={ICON_BUTTON}\n aria-label={tr('calendar.v2.copyMeetingLink', 'Copy the meeting link')}\n onClick={() =>\n void page.actions.copyText(\n url,\n tr('calendar.v2.meetingLinkCopied', 'Meeting link copied.')\n )\n }\n >\n <Copy aria-hidden=\"true\" />\n </button>\n </div>\n );\n}\n\n/** The room, else the address. */\nfunction PeekPlace({ event }: { event: CalendarEventV2 }) {\n const { tr } = useCalendarPage();\n const room = eventRoom(event);\n if (room) {\n return (\n <Row icon={<Building2 aria-hidden=\"true\" />}>\n <b className=\"font-semibold\">{room.name ?? tr('calendar.v2.theRoom', 'The room')}</b>\n {room.location ? ` · ${room.location}` : ''}\n {room.capacity\n ? ` · ${tr('calendar.v2.seats', '{{count}} seats', { count: room.capacity })}`\n : ''}\n </Row>\n );\n }\n const physical = event.locationAddress || (event.location && event.locationType !== 'ONLINE');\n if (!physical) return null;\n return (\n <Row icon={<MapPin aria-hidden=\"true\" />}>\n {[event.location, event.locationAddress].filter(Boolean).join(', ')}\n </Row>\n );\n}\n\n/** How many people, how they answered, and the first few with their answers. */\nfunction PeekPeople({ model }: { model: PeekModel }) {\n const page = useCalendarPage();\n const { tr, me } = page;\n const { event, answer } = model;\n if (event.guests.length === 0) return null;\n const answerOf = (userId: string | null, response: EventResponseV2) =>\n userId === me && answer ? answer : response;\n const counts: Record<EventResponseV2, number> = {\n ACCEPTED: 0,\n TENTATIVE: 0,\n DECLINED: 0,\n NO_RESPONSE: 0,\n };\n for (const guest of event.guests) {\n counts[guest.organizer ? 'ACCEPTED' : answerOf(guest.userId, guest.response)] += 1;\n }\n const people = [...event.guests].sort((a, b) => Number(b.organizer) - Number(a.organizer));\n const tally = [\n counts.ACCEPTED\n ? tr('calendar.v2.countGoing', '{{count}} going', { count: counts.ACCEPTED })\n : '',\n counts.TENTATIVE\n ? tr('calendar.v2.countMaybe', '{{count}} maybe', { count: counts.TENTATIVE })\n : '',\n counts.NO_RESPONSE\n ? tr('calendar.v2.countWaiting', '{{count}} waiting', { count: counts.NO_RESPONSE })\n : '',\n counts.DECLINED\n ? tr('calendar.v2.countNotGoing', '{{count}} not going', { count: counts.DECLINED })\n : '',\n ]\n .filter(Boolean)\n .map((part) => ` · ${part}`)\n .join('');\n const hidden = people.length - PEOPLE_SHOWN;\n return (\n <Row icon={<Users aria-hidden=\"true\" />}>\n <div className=\"mb-1.5\">\n <b className=\"font-semibold\">\n {people.length === 1\n ? tr('calendar.v2.peopleOne', '1 person')\n : tr('calendar.v2.peopleMany', '{{count}} people', { count: people.length })}\n </b>\n <span className=\"text-text-secondary\">{tally}</span>\n </div>\n <ul className=\"flex flex-col gap-1.5\">\n {people.slice(0, PEOPLE_SHOWN).map((guest) => (\n <GuestRow\n key={guest.id}\n guest={guest}\n name={\n model.nameOf(guest.userId, guest.name) ??\n guest.email ??\n tr('calendar.v2.guest', 'Guest')\n }\n you={guest.userId === me}\n answer={answerOf(guest.userId, guest.response)}\n />\n ))}\n </ul>\n {hidden > 0 && model.look.editable ? (\n <button\n type=\"button\"\n className={cn('mt-1 text-xs font-semibold text-text-link hover:underline', FOCUS_RING)}\n onClick={() => page.openEventDialog({ eventId: event.id, tab: 'people' })}\n >\n {tr('calendar.v2.seeAll', 'See all {{count}}', { count: people.length })}\n </button>\n ) : null}\n {hidden > 0 && !model.look.editable ? (\n <p className=\"mt-1 text-xs text-text-secondary\">\n {tr('calendar.v2.andMore', 'and {{count}} more', { count: hidden })}\n </p>\n ) : null}\n </Row>\n );\n}\n\nfunction PeekReminders({ event }: { event: CalendarEventV2 }) {\n const { tr, durationWords } = useCalendarPage();\n if (event.reminders.length === 0) return null;\n const channelWords = (channel: string) => {\n if (channel === 'EMAIL') return tr('calendar.v2.channelEmail', 'Email');\n if (channel === 'SMS') return tr('calendar.v2.channelSms', 'Text message');\n return tr('calendar.v2.channelInApp', 'In app');\n };\n return (\n <Row icon={<Bell aria-hidden=\"true\" />}>\n {event.reminders.map((reminder) => (\n <div key={reminder.id}>\n {reminder.minutesBefore === 0\n ? tr('calendar.v2.reminderAtStart', 'When it starts')\n : tr('calendar.v2.reminderBefore', '{{time}} before', {\n time: formatDuration(reminder.minutesBefore, durationWords),\n })}\n {' · '}\n {channelWords(reminder.channel)}\n </div>\n ))}\n </Row>\n );\n}\n\n/** The calendar, who organises it, who sees its details, and \"Draft\". */\nfunction PeekCalendarLine({ model }: { model: PeekModel }) {\n const { tr } = useCalendarPage();\n const { event } = model;\n const parts = [\n model.calendarName,\n model.iOrganise\n ? tr('calendar.v2.youOrganise', 'you organise it')\n : tr('calendar.v2.organisedBy', 'organised by {{name}}', { name: model.organizerName }),\n ];\n if (event.visibility === 'PRIVATE') parts.push(tr('calendar.v2.private', 'Private'));\n if (event.visibility === 'CONFIDENTIAL') parts.push(tr('calendar.v2.busyOnlyLabel', 'Busy only'));\n if (event.status === 'DRAFT') parts.push(tr('calendar.v2.draft', 'Draft'));\n return <Row icon={<CalendarDays aria-hidden=\"true\" />}>{parts.join(' · ')}</Row>;\n}\n\n/** The notes (as plain text), and a word on repeating events until B7 expands them. */\nfunction PeekNotes({ event }: { event: CalendarEventV2 }) {\n const { tr } = useCalendarPage();\n return (\n <>\n {event.description ? (\n <Row icon={<FileText aria-hidden=\"true\" />}>\n <p className=\"break-words whitespace-pre-wrap\">{event.description}</p>\n </Row>\n ) : null}\n {event.isRecurring ? (\n <p className=\"text-xs text-text-muted\">\n {tr(\n 'calendar.v2.firstOccurrenceNote',\n 'Repeating events show their first date for now. Edit opens the whole series.'\n )}\n </p>\n ) : null}\n </>\n );\n}\n\n/** A guest answers Yes · Maybe · No; the organiser can look for a better time. */\nfunction PeekFooter({ model }: { model: PeekModel }) {\n const page = useCalendarPage();\n const { tr } = page;\n const { event, answer } = model;\n if (!model.iOrganise && answer !== null) {\n const value: Answer | 'none' = answer !== 'NO_RESPONSE' ? answer : 'none';\n return (\n <div className=\"flex flex-wrap items-center gap-2 border-t border-border-subtle p-3 ps-4\">\n <span className=\"text-sm font-semibold text-text-primary\">\n {tr('calendar.v2.goingQuestion', 'Going?')}\n </span>\n <Segmented<Answer | 'none'>\n aria-label={tr('calendar.v2.yourAnswer', 'Your answer')}\n fillOnPhone={false}\n value={value}\n onValueChange={(next) => {\n if (next !== 'none') void page.actions.respond(event, next);\n }}\n options={[\n { value: 'ACCEPTED', label: tr('calendar.v2.yes', 'Yes') },\n { value: 'TENTATIVE', label: tr('calendar.v2.maybe', 'Maybe') },\n { value: 'DECLINED', label: tr('calendar.v2.no', 'No') },\n ]}\n />\n {answer === 'NO_RESPONSE' ? (\n <span className=\"inline-flex items-center gap-1 text-xs text-text-secondary\">\n <CircleHelp className=\"size-3\" aria-hidden=\"true\" />\n {tr('calendar.v2.notAnswered', 'Not answered')}\n </span>\n ) : null}\n </div>\n );\n }\n if (!model.iOrganise || !model.look.editable) return null;\n return (\n <div className=\"flex flex-wrap items-center gap-2 border-t border-border-subtle p-3 ps-4\">\n <span className=\"inline-flex items-center gap-1.5 text-sm font-semibold text-text-primary\">\n <Crown className=\"size-3.5 text-action-primary-bg\" aria-hidden=\"true\" />\n {tr('calendar.v2.youOrganiseThis', 'You organise this')}\n </span>\n <span className=\"flex-1\" />\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={() => page.openFindTime(event.id)}>\n <Users aria-hidden=\"true\" />\n {tr('calendar.v2.findBetterTime', 'Find a better time')}\n </Button>\n </div>\n );\n}\n\n/** Someone else's private time: when, and that its details are private. */\nfunction BusyPeek({ model }: { model: PeekModel }) {\n const page = useCalendarPage();\n const { tr } = page;\n return (\n <>\n <div\n className=\"flex items-center gap-3 p-3 ps-4\"\n style={calendarHueStyle(page.hueOf(model.event.calendarId))}\n >\n <span aria-hidden=\"true\" className=\"size-3.5 shrink-0 rounded-[4px] bg-[var(--cal-hue)]\" />\n <PeekTitle className=\"min-w-0 flex-1 text-base font-bold text-text-primary\">\n {model.look.title}\n </PeekTitle>\n <CloseButton />\n </div>\n <div className=\"flex flex-col gap-3 px-4 pb-4\">\n <p className=\"ps-[26px] text-sm text-text-secondary\">{model.when}</p>\n <Row icon={<EyeOff aria-hidden=\"true\" />}>\n {tr(\n 'calendar.v2.privateDetails',\n 'Details are private. {{calendar}} shares only that this time is taken.',\n { calendar: model.calendarName }\n )}\n </Row>\n </div>\n </>\n );\n}\n\nexport function PeekEvent({ event }: { event: CalendarEventV2 }) {\n const page = useCalendarPage();\n const model = usePeekModel(event);\n if (model.look.busyOnly) return <BusyPeek model={model} />;\n return (\n <>\n <div\n className=\"flex items-start gap-3 p-3 ps-4\"\n style={calendarHueStyle(page.hueOf(event.calendarId))}\n >\n <span\n aria-hidden=\"true\"\n className=\"mt-1 size-3.5 shrink-0 rounded-[4px] bg-[var(--cal-hue)]\"\n />\n <PeekTitle className=\"min-w-0 flex-1 text-base leading-snug font-bold break-words text-text-primary\">\n {model.look.title}\n </PeekTitle>\n <PeekTools model={model} />\n </div>\n <div className=\"min-h-0 flex-1 overflow-y-auto px-4 pb-4\">\n <PeekWhen model={model} />\n <div className=\"flex flex-col gap-3\">\n <PeekNotices model={model} />\n <PeekJoin event={event} />\n <PeekPlace event={event} />\n <PeekPeople model={model} />\n <PeekReminders event={event} />\n <PeekCalendarLine model={model} />\n <PeekNotes event={event} />\n </div>\n </div>\n <PeekFooter model={model} />\n {page.compact ? (\n <BottomSheetDescription className=\"sr-only\">{model.when}</BottomSheetDescription>\n ) : null}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuDA,IAAME,IAAe;AAqBrB,SAASC,EAAa,GAAmC;CACvD,IAAMC,IAAOC,EAAgB,GACvB,EAAE,OAAI,WAAQ,aAAU,UAAOD,GAC/B,EAAE,kBAAe,cAAW,mBAAgBE,EAAY,GACxDC,IAAWH,EAAK,cAAc,IAAII,EAAM,UAAU,GAClDC,IAAUC,QAEZ,CAAC,mBAAG,IAAI,IAAI,CAACF,EAAM,aAAa,GAAGA,EAAM,OAAO,KAAK,MAAUG,EAAM,MAAM,CAAC,CAAC,CAAC,CAAC,CAC5E,QAAQ,MAAqB,EAAQC,CAAG,CAAC,CACzC,KAAK,OAAa;EAAE;EAAS,WAAW;CAAO,EAAE,GACtD,CAACJ,EAAM,QAAQA,EAAM,WAAW,CAClC,GACMK,IAAWC,EAAiBL,GAAS;EAAE;EAAe;EAAW;CAAY,CAAC,GAC9EM,KAAU,GAAuB,MAA0C;EAC/E,IAAIC,GAAS,OAAOA;EACpB,IAAMC,IAAUC,IAASL,EAASK,KAAU,KAAA;EAC5C,OAA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AA;KACzB,kBAACK,IAAD,EAAkB,SAAQ,CAAA;KAC1B,kBAACI,IAAD,EAAmB,SAAQ,CAAA;KAC3B,kBAACe,IAAD,EAAsB,SAAQ,CAAA;KAC9B,kBAACO,GAAD,EAAyB,SAAQ,CAAA;KACjC,kBAACG,IAAD,EAAkB,SAAQ,CAAA;IACvB;GACF,CAAA,CAAA;;EACL,kBAACE,IAAD,EAAmB,SAAQ,CAAA;EAC1BjG,EAAK,UACJ,kBAAC2G,GAAD;GAAwB,WAAU;GAAW,UAAAxE,EAAM;EAA6B,CAAA,IAC9E;CACJ,EAAA,CAAA;AAEN"}
|
|
1
|
+
{"version":3,"file":"PeekEvent.js","names":["_Fragment","Fragment$1","PEOPLE_SHOWN","usePeekModel","page","useCalendarPage","useCalendar","calendar","event","userIds","useMemo","guest","id","profiles","useActorProfiles","nameOf","carried","profile","userId","organizerGuest","span","eventDays","timeZone","when","isDatelessSeries","rule","repeatLabel","formFromEvent","tr","format","formatInstantRange","formatDayTimeSpan","formatDay","instantToZoned","isOrganizer","me","PeekTitle","jsx","compact","BottomSheetTitle","PeekTools","notify","useNotify","model","locked","lockReason","more","Download","Link2","calendarV2Href","basePath","SEARCH_PARAMS","inSeries","look","Trash2","ICON_BUTTON","editDraftFor","Pencil","Lock","Copy","ActionMenu","CloseButton","PeekWhen","ownZone","Repeat","PeekNotices","room","eventRoom","roomName","Notice","AlertTriangle","Clock3","PeekJoin","url","joinUrl","Button","Video","PeekPlace","Row","Building2","MapPin","PeekPeople","answerOf","answer","response","counts","people","b","a","tally","part","hidden","Users","GuestRow","cn","FOCUS_RING","PeekReminders","channelWords","channel","Bell","reminder","formatDuration","durationWords","PeekCalendarLine","parts","CalendarDays","PeekNotes","FileText","PeekFooter","value","Segmented","next","CircleHelp","Crown","BusyPeek","calendarHueStyle","EyeOff","PeekEvent","BottomSheetDescription"],"sources":["../../../src/v2/peek/PeekEvent.tsx"],"sourcesContent":["/**\n * An event's peek (BOFF-15698 A1), built from one small part per section: the header and its\n * tools (Edit or Edit locked with the organiser's name, Duplicate, Delete, ⋯), when, notices,\n * Join, the place, the people and their answers, reminders, the calendar line, the notes, and\n * the footer (Yes · Maybe · No for a guest, Find a better time for the organiser). Someone\n * else's private time shows only \"Busy\". On a date of a repeating event (A4), Edit and Delete\n * are for that date (the dialog asks which events change), and ⋯ deletes the whole series.\n */\nimport { useMemo } from 'react';\nimport {\n AlertTriangle,\n Bell,\n Building2,\n CalendarDays,\n CircleHelp,\n Clock3,\n Copy,\n Crown,\n Download,\n EyeOff,\n FileText,\n Link2,\n Lock,\n MapPin,\n Pencil,\n Repeat,\n Trash2,\n Users,\n Video,\n} from 'lucide-react';\nimport { useActorProfiles } from '@burdenoff/fe-libs/shared';\nimport {\n ActionMenu,\n BottomSheetDescription,\n BottomSheetTitle,\n Button,\n Notice,\n Segmented,\n useNotify,\n type ActionMenuItem,\n} from '@burdenoff/fe-libs/ui';\nimport { cn } from '@burdenoff/fe-libs/utils';\nimport { useCalendar } from '../../providers/CalendarProvider';\nimport { calendarHueStyle } from '../colors';\nimport type { Answer } from '../data/useEventActions';\nimport type { EventLook } from '../events/eventLook';\nimport { editDraftFor, eventRoom, inSeries, isOrganizer, joinUrl } from '../events/eventModel';\nimport { formatDay, formatDayTimeSpan, formatDuration, formatInstantRange } from '../format';\nimport { useCalendarPage } from '../page/CalendarPageContext';\nimport { calendarV2Href, SEARCH_PARAMS } from '../routes';\nimport { FOCUS_RING, ICON_BUTTON } from '../styles';\nimport { eventDays, instantToZoned } from '../time/calendarTime';\nimport { lockReason } from '../event/dialogLogic';\nimport { formFromEvent } from '../event/eventForm';\nimport { repeatLabel } from '../event/repeatWords';\nimport type { CalendarEventV2, CalendarV2, EventResponseV2 } from '../types';\nimport { CloseButton, GuestRow, Row } from './PeekParts';\n\n/** Guests listed before \"See all\". */\nconst PEOPLE_SHOWN = 6;\n\n/** What every part of an event's peek reads. */\ninterface PeekModel {\n event: CalendarEventV2;\n look: EventLook;\n calendar: CalendarV2 | undefined;\n calendarName: string;\n /** The person's answer (one given here first); null when they organise it or aren't asked. */\n answer: EventResponseV2 | null;\n iOrganise: boolean;\n /** The organiser's name; null when it isn't known (then the words don't name them). */\n organizerName: string | null;\n /** A person's name: the one the event carries, else their workspace profile's. */\n nameOf: (userId: string | null, carried: string | null) => string | null;\n /**\n * \"Friday 20 Nov · 14:30 – 15:30\", \"Fri 20 Nov, 23:00 – Sat 21 Nov, 01:00\",\n * \"Mon 16 Nov – Fri 20 Nov · all day\".\n */\n when: string;\n}\n\nfunction usePeekModel(event: CalendarEventV2): PeekModel {\n const page = useCalendarPage();\n const { tr, format, timeZone, me } = page;\n const { apiGatewayUrl, authToken, workspaceId } = useCalendar();\n const calendar = page.calendarsById.get(event.calendarId);\n const userIds = useMemo(\n () =>\n [...new Set([event.organizerId, ...event.guests.map((guest) => guest.userId)])]\n .filter((id): id is string => Boolean(id))\n .map((actorId) => ({ actorId, actorType: 'user' })),\n [event.guests, event.organizerId]\n );\n const profiles = useActorProfiles(userIds, { apiGatewayUrl, authToken, workspaceId });\n const nameOf = (userId: string | null, carried: string | null): string | null => {\n if (carried) return carried;\n const profile = userId ? profiles[userId] : undefined;\n return profile?.resolved ? profile.displayName : null;\n };\n const organizerGuest = event.guests.find((guest) => guest.organizer) ?? null;\n const span = eventDays(event, timeZone);\n let when: string;\n if (isDatelessSeries(event)) {\n // A series with no date to name (its first date was cancelled): how it repeats, not a date\n // that isn't on the calendar.\n const rule = repeatLabel(formFromEvent(event, timeZone), tr, format);\n when = event.allDay\n ? `${rule} · ${tr('calendar.v2.allDayLower', 'all day')}`\n : `${rule} · ${formatInstantRange(event.start, event.end, timeZone, format)}`;\n } else if (!event.allDay && span.start !== span.end) {\n // Over midnight, or a day or more: both ends with their days.\n when = formatDayTimeSpan(event.start, event.end, timeZone, format);\n } else if (!event.allDay) {\n when = `${formatDay(instantToZoned(event.start, timeZone).date, format, 'mid')} · ${formatInstantRange(event.start, event.end, timeZone, format)}`;\n } else if (span.start === span.end) {\n when = tr('calendar.v2.whenAllDay', '{{day}} · all day', {\n day: formatDay(span.start, format, 'mid'),\n });\n } else {\n when = tr('calendar.v2.whenAllDays', '{{from}} – {{to}} · all day', {\n from: formatDay(span.start, format, 'short'),\n to: formatDay(span.end, format, 'short'),\n });\n }\n return {\n event,\n look: page.lookOf(event),\n calendar,\n calendarName: calendar?.name ?? tr('calendar.v2.aCalendar', 'a calendar'),\n answer: page.answerOf(event),\n iOrganise: isOrganizer(event, me),\n organizerName: nameOf(event.organizerId, organizerGuest?.name ?? null),\n nameOf,\n when,\n };\n}\n\n/** A series read on its own with no date to name: its first date was cancelled (A4). */\nfunction isDatelessSeries(event: CalendarEventV2): boolean {\n return event.isRecurring && event.instanceDate === null;\n}\n\n/** The peek's heading: the sheet's title on phones (it names the dialog), else an h3. */\nfunction PeekTitle({ children, className }: { children: string; className: string }) {\n const { compact } = useCalendarPage();\n return compact ? (\n <BottomSheetTitle className={className}>{children}</BottomSheetTitle>\n ) : (\n <h3 className={className}>{children}</h3>\n );\n}\n\n/** Edit (or Edit locked, saying who can), Duplicate, Delete, ⋯ and close. */\nfunction PeekTools({ model }: { model: PeekModel }) {\n const page = useCalendarPage();\n const { tr } = page;\n const { basePath } = useCalendar();\n const notify = useNotify();\n const { event, look, calendar } = model;\n // The dialog's words: \"Only Priya Raman, the organiser, can…\", or without a name \"Only the\n // organiser can…\".\n const locked = lockReason(event, calendar, model.organizerName, tr);\n const more: ActionMenuItem[] = [\n {\n id: 'ics',\n label: tr('calendar.v2.downloadEvent', 'Download (.ics)'),\n icon: Download,\n onSelect: () => void page.actions.downloadIcs(event),\n },\n {\n id: 'link',\n label: tr('calendar.v2.copyEventLink', 'Copy a link to it'),\n icon: Link2,\n onSelect: () =>\n void page.actions.copyText(\n `${window.location.origin}${calendarV2Href(basePath, 'week', {\n [SEARCH_PARAMS.event]: event.id,\n [SEARCH_PARAMS.date]: eventDays(event, page.timeZone).start,\n })}`,\n tr('calendar.v2.linkCopied', 'Link copied.')\n ),\n },\n ];\n if (inSeries(event) && look.editable) {\n more.push({\n id: 'series',\n label: tr('calendar.v2.deleteSeriesMenu', 'Delete the whole series…'),\n icon: Trash2,\n danger: true,\n separatorBefore: true,\n onSelect: () => {\n page.closePeek();\n void page.actions.removeSeries(event);\n },\n });\n }\n return (\n <div className=\"flex shrink-0 items-center\">\n {look.editable ? (\n <button\n type=\"button\"\n className={ICON_BUTTON}\n aria-label={tr('calendar.v2.edit', 'Edit')}\n title={tr('calendar.v2.edit', 'Edit')}\n onClick={() => page.openEventDialog(editDraftFor(event))}\n >\n <Pencil aria-hidden=\"true\" />\n </button>\n ) : (\n <button\n type=\"button\"\n className={ICON_BUTTON}\n aria-label={tr('calendar.v2.editLocked', 'Edit (locked): {{reason}}', {\n reason: locked,\n })}\n title={locked}\n onClick={() => notify({ title: locked, tone: 'info' })}\n >\n <Lock aria-hidden=\"true\" />\n </button>\n )}\n {calendar && !calendar.isReadOnly ? (\n <button\n type=\"button\"\n className={ICON_BUTTON}\n aria-label={tr('calendar.v2.duplicate', 'Duplicate')}\n title={tr('calendar.v2.duplicate', 'Duplicate')}\n onClick={() => {\n page.closePeek();\n void page.actions.duplicate(event);\n }}\n >\n <Copy aria-hidden=\"true\" />\n </button>\n ) : null}\n {look.editable ? (\n <button\n type=\"button\"\n className={ICON_BUTTON}\n aria-label={tr('calendar.v2.delete', 'Delete')}\n title={tr('calendar.v2.delete', 'Delete')}\n onClick={() => {\n page.closePeek();\n void page.actions.remove(event);\n }}\n >\n <Trash2 aria-hidden=\"true\" />\n </button>\n ) : null}\n <ActionMenu\n items={more}\n placement=\"row\"\n label={tr('calendar.v2.moreForEvent', 'More for this event')}\n />\n <CloseButton />\n </div>\n );\n}\n\n/** When, \"Repeats\", and the time in the event's own zone when it isn't the calendar's. */\nfunction PeekWhen({ model }: { model: PeekModel }) {\n const { tr, format, timeZone } = useCalendarPage();\n const { event } = model;\n const ownZone =\n event.timeZone && event.timeZone !== timeZone && !event.allDay ? event.timeZone : null;\n return (\n <p className=\"mb-3 ps-[26px] text-sm text-text-secondary\">\n {model.when}\n {inSeries(event) && !isDatelessSeries(event) ? (\n <span className=\"ms-1 inline-flex items-center gap-1\">\n · <Repeat className=\"size-3\" aria-hidden=\"true\" />\n {tr('calendar.v2.repeats', 'Repeats')}\n </span>\n ) : null}\n {ownZone ? (\n <span className=\"mt-0.5 block text-xs text-text-muted\">\n {tr('calendar.v2.inItsZone', '{{time}} in {{zone}}', {\n time: formatInstantRange(event.start, event.end, ownZone, format),\n zone: ownZone,\n })}\n </span>\n ) : null}\n </p>\n );\n}\n\n/** A room turned down or waiting, and a calendar followed by link (read-only). */\nfunction PeekNotices({ model }: { model: PeekModel }) {\n const { tr } = useCalendarPage();\n const room = eventRoom(model.event);\n const roomName = room?.name ?? tr('calendar.v2.theRoom', 'The room');\n return (\n <>\n {model.look.roomRefused && room ? (\n <Notice tone=\"warn\" icon={AlertTriangle}>\n <b>{tr('calendar.v2.roomRefusedTitle', 'Room not available.')}</b>{' '}\n {tr(\n 'calendar.v2.roomRefusedBody',\n '{{room}} turned down the booking. Pick another room in the event.',\n { room: roomName }\n )}\n </Notice>\n ) : null}\n {model.look.roomPending && room ? (\n <Notice tone=\"info\" icon={Clock3}>\n {tr('calendar.v2.roomPendingBody', '{{room}} is waiting for approval.', {\n room: roomName,\n })}\n </Notice>\n ) : null}\n {model.calendar?.isReadOnly ? (\n <Notice tone=\"lock\" icon={Lock}>\n {tr(\n 'calendar.v2.readOnlyNote',\n 'From {{calendar}}, a calendar you follow. You can’t change it here.',\n { calendar: model.calendarName }\n )}\n </Notice>\n ) : null}\n </>\n );\n}\n\n/** Join the call, its link, and Copy. */\nfunction PeekJoin({ event }: { event: CalendarEventV2 }) {\n const page = useCalendarPage();\n const { tr } = page;\n const url = joinUrl(event);\n if (!url) return null;\n return (\n <div className=\"flex items-center gap-2\">\n <Button asChild>\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n <Video aria-hidden=\"true\" />\n {tr('calendar.v2.joinCall', 'Join the call')}\n </a>\n </Button>\n <span className=\"min-w-0 flex-1 truncate font-mono text-xs text-text-secondary\">\n {url.replace(/^https?:\\/\\//, '')}\n </span>\n <button\n type=\"button\"\n className={ICON_BUTTON}\n aria-label={tr('calendar.v2.copyMeetingLink', 'Copy the meeting link')}\n onClick={() =>\n void page.actions.copyText(\n url,\n tr('calendar.v2.meetingLinkCopied', 'Meeting link copied.')\n )\n }\n >\n <Copy aria-hidden=\"true\" />\n </button>\n </div>\n );\n}\n\n/** The room, else the address. */\nfunction PeekPlace({ event }: { event: CalendarEventV2 }) {\n const { tr } = useCalendarPage();\n const room = eventRoom(event);\n if (room) {\n return (\n <Row icon={<Building2 aria-hidden=\"true\" />}>\n <b className=\"font-semibold\">{room.name ?? tr('calendar.v2.theRoom', 'The room')}</b>\n {room.location ? ` · ${room.location}` : ''}\n {room.capacity\n ? ` · ${tr('calendar.v2.seats', '{{count}} seats', { count: room.capacity })}`\n : ''}\n </Row>\n );\n }\n const physical = event.locationAddress || (event.location && event.locationType !== 'ONLINE');\n if (!physical) return null;\n return (\n <Row icon={<MapPin aria-hidden=\"true\" />}>\n {[event.location, event.locationAddress].filter(Boolean).join(', ')}\n </Row>\n );\n}\n\n/** How many people, how they answered, and the first few with their answers. */\nfunction PeekPeople({ model }: { model: PeekModel }) {\n const page = useCalendarPage();\n const { tr, me } = page;\n const { event, answer } = model;\n if (event.guests.length === 0) return null;\n const answerOf = (userId: string | null, response: EventResponseV2) =>\n userId === me && answer ? answer : response;\n const counts: Record<EventResponseV2, number> = {\n ACCEPTED: 0,\n TENTATIVE: 0,\n DECLINED: 0,\n NO_RESPONSE: 0,\n };\n for (const guest of event.guests) {\n counts[guest.organizer ? 'ACCEPTED' : answerOf(guest.userId, guest.response)] += 1;\n }\n const people = [...event.guests].sort((a, b) => Number(b.organizer) - Number(a.organizer));\n const tally = [\n counts.ACCEPTED\n ? tr('calendar.v2.countGoing', '{{count}} going', { count: counts.ACCEPTED })\n : '',\n counts.TENTATIVE\n ? tr('calendar.v2.countMaybe', '{{count}} maybe', { count: counts.TENTATIVE })\n : '',\n counts.NO_RESPONSE\n ? tr('calendar.v2.countWaiting', '{{count}} waiting', { count: counts.NO_RESPONSE })\n : '',\n counts.DECLINED\n ? tr('calendar.v2.countNotGoing', '{{count}} not going', { count: counts.DECLINED })\n : '',\n ]\n .filter(Boolean)\n .map((part) => ` · ${part}`)\n .join('');\n const hidden = people.length - PEOPLE_SHOWN;\n return (\n <Row icon={<Users aria-hidden=\"true\" />}>\n <div className=\"mb-1.5\">\n <b className=\"font-semibold\">\n {people.length === 1\n ? tr('calendar.v2.peopleOne', '1 person')\n : tr('calendar.v2.peopleMany', '{{count}} people', { count: people.length })}\n </b>\n <span className=\"text-text-secondary\">{tally}</span>\n </div>\n <ul className=\"flex flex-col gap-1.5\">\n {people.slice(0, PEOPLE_SHOWN).map((guest) => (\n <GuestRow\n key={guest.id}\n guest={guest}\n name={\n model.nameOf(guest.userId, guest.name) ??\n guest.email ??\n tr('calendar.v2.guest', 'Guest')\n }\n you={guest.userId === me}\n answer={answerOf(guest.userId, guest.response)}\n />\n ))}\n </ul>\n {hidden > 0 && model.look.editable ? (\n <button\n type=\"button\"\n className={cn('mt-1 text-xs font-semibold text-text-link hover:underline', FOCUS_RING)}\n onClick={() => page.openEventDialog({ ...editDraftFor(event), tab: 'people' })}\n >\n {tr('calendar.v2.seeAll', 'See all {{count}}', { count: people.length })}\n </button>\n ) : null}\n {hidden > 0 && !model.look.editable ? (\n <p className=\"mt-1 text-xs text-text-secondary\">\n {tr('calendar.v2.andMore', 'and {{count}} more', { count: hidden })}\n </p>\n ) : null}\n </Row>\n );\n}\n\nfunction PeekReminders({ event }: { event: CalendarEventV2 }) {\n const { tr, durationWords } = useCalendarPage();\n if (event.reminders.length === 0) return null;\n const channelWords = (channel: string) => {\n if (channel === 'EMAIL') return tr('calendar.v2.channelEmail', 'Email');\n if (channel === 'SMS') return tr('calendar.v2.channelSms', 'Text message');\n return tr('calendar.v2.channelInApp', 'In app');\n };\n return (\n <Row icon={<Bell aria-hidden=\"true\" />}>\n {event.reminders.map((reminder) => (\n <div key={reminder.id}>\n {reminder.minutesBefore === 0\n ? tr('calendar.v2.reminderAtStart', 'When it starts')\n : tr('calendar.v2.reminderBefore', '{{time}} before', {\n time: formatDuration(reminder.minutesBefore, durationWords),\n })}\n {' · '}\n {channelWords(reminder.channel)}\n </div>\n ))}\n </Row>\n );\n}\n\n/**\n * The calendar, who organises it (when their name is known), who sees its details, \"shows as\n * free\", and \"Draft\".\n */\nfunction PeekCalendarLine({ model }: { model: PeekModel }) {\n const { tr } = useCalendarPage();\n const { event } = model;\n const parts = [model.calendarName];\n if (model.iOrganise) parts.push(tr('calendar.v2.youOrganise', 'you organise it'));\n else if (model.organizerName) {\n parts.push(\n tr('calendar.v2.organisedBy', 'organised by {{name}}', { name: model.organizerName })\n );\n }\n if (event.visibility === 'PRIVATE') parts.push(tr('calendar.v2.private', 'Private'));\n if (event.visibility === 'CONFIDENTIAL') parts.push(tr('calendar.v2.busyOnlyLabel', 'Busy only'));\n if (!event.isBusy) parts.push(tr('calendar.v2.showsAsFree', 'shows as free'));\n if (event.status === 'DRAFT') parts.push(tr('calendar.v2.draft', 'Draft'));\n return <Row icon={<CalendarDays aria-hidden=\"true\" />}>{parts.join(' · ')}</Row>;\n}\n\n/** The notes, as plain text. */\nfunction PeekNotes({ event }: { event: CalendarEventV2 }) {\n if (!event.description) return null;\n return (\n <Row icon={<FileText aria-hidden=\"true\" />}>\n <p className=\"break-words whitespace-pre-wrap\">{event.description}</p>\n </Row>\n );\n}\n\n/** A guest answers Yes · Maybe · No; the organiser can look for a better time. */\nfunction PeekFooter({ model }: { model: PeekModel }) {\n const page = useCalendarPage();\n const { tr } = page;\n const { event, answer } = model;\n if (!model.iOrganise && answer !== null) {\n const value: Answer | 'none' = answer !== 'NO_RESPONSE' ? answer : 'none';\n return (\n <div className=\"flex flex-wrap items-center gap-2 border-t border-border-subtle p-3 ps-4\">\n <span className=\"text-sm font-semibold text-text-primary\">\n {tr('calendar.v2.goingQuestion', 'Going?')}\n </span>\n <Segmented<Answer | 'none'>\n aria-label={tr('calendar.v2.yourAnswer', 'Your answer')}\n fillOnPhone={false}\n value={value}\n onValueChange={(next) => {\n if (next !== 'none') void page.actions.respond(event, next);\n }}\n options={[\n { value: 'ACCEPTED', label: tr('calendar.v2.yes', 'Yes') },\n { value: 'TENTATIVE', label: tr('calendar.v2.maybe', 'Maybe') },\n { value: 'DECLINED', label: tr('calendar.v2.no', 'No') },\n ]}\n />\n {answer === 'NO_RESPONSE' ? (\n <span className=\"inline-flex items-center gap-1 text-xs text-text-secondary\">\n <CircleHelp className=\"size-3\" aria-hidden=\"true\" />\n {tr('calendar.v2.notAnswered', 'Not answered')}\n </span>\n ) : null}\n </div>\n );\n }\n if (!model.iOrganise || !model.look.editable) return null;\n return (\n <div className=\"flex flex-wrap items-center gap-2 border-t border-border-subtle p-3 ps-4\">\n <span className=\"inline-flex items-center gap-1.5 text-sm font-semibold text-text-primary\">\n <Crown className=\"size-3.5 text-action-primary-bg\" aria-hidden=\"true\" />\n {tr('calendar.v2.youOrganiseThis', 'You organise this')}\n </span>\n <span className=\"flex-1\" />\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={() => page.openFindTime(event)}>\n <Users aria-hidden=\"true\" />\n {tr('calendar.v2.findBetterTime', 'Find a better time')}\n </Button>\n </div>\n );\n}\n\n/** Someone else's private time: when, and that its details are private. */\nfunction BusyPeek({ model }: { model: PeekModel }) {\n const page = useCalendarPage();\n const { tr } = page;\n return (\n <>\n <div\n className=\"flex items-center gap-3 p-3 ps-4\"\n style={calendarHueStyle(page.hueOf(model.event.calendarId))}\n >\n <span aria-hidden=\"true\" className=\"size-3.5 shrink-0 rounded-[4px] bg-[var(--cal-hue)]\" />\n <PeekTitle className=\"min-w-0 flex-1 text-base font-bold text-text-primary\">\n {model.look.title}\n </PeekTitle>\n <CloseButton />\n </div>\n <div className=\"flex flex-col gap-3 px-4 pb-4\">\n <p className=\"ps-[26px] text-sm text-text-secondary\">{model.when}</p>\n <Row icon={<EyeOff aria-hidden=\"true\" />}>\n {tr(\n 'calendar.v2.privateDetails',\n 'Details are private. {{calendar}} shares only that this time is taken.',\n { calendar: model.calendarName }\n )}\n </Row>\n </div>\n </>\n );\n}\n\nexport function PeekEvent({ event }: { event: CalendarEventV2 }) {\n const page = useCalendarPage();\n const model = usePeekModel(event);\n if (model.look.busyOnly) return <BusyPeek model={model} />;\n return (\n <>\n <div\n className=\"flex items-start gap-3 p-3 ps-4\"\n style={calendarHueStyle(page.hueOf(event.calendarId))}\n >\n <span\n aria-hidden=\"true\"\n className=\"mt-1 size-3.5 shrink-0 rounded-[4px] bg-[var(--cal-hue)]\"\n />\n <PeekTitle className=\"min-w-0 flex-1 text-base leading-snug font-bold break-words text-text-primary\">\n {model.look.title}\n </PeekTitle>\n <PeekTools model={model} />\n </div>\n <div className=\"min-h-0 flex-1 overflow-y-auto px-4 pb-4\">\n <PeekWhen model={model} />\n <div className=\"flex flex-col gap-3\">\n <PeekNotices model={model} />\n <PeekJoin event={event} />\n <PeekPlace event={event} />\n <PeekPeople model={model} />\n <PeekReminders event={event} />\n <PeekCalendarLine model={model} />\n <PeekNotes event={event} />\n </div>\n </div>\n <PeekFooter model={model} />\n {page.compact ? (\n <BottomSheetDescription className=\"sr-only\">{model.when}</BottomSheetDescription>\n ) : null}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2DA,IAAME,IAAe;AAsBrB,SAASC,GAAa,GAAmC;CACvD,IAAMC,IAAOC,EAAgB,GACvB,EAAE,OAAI,WAAQ,aAAU,UAAOD,GAC/B,EAAE,kBAAe,cAAW,mBAAgBE,EAAY,GACxDC,IAAWH,EAAK,cAAc,IAAII,EAAM,UAAU,GAClDC,IAAUC,QAEZ,CAAC,mBAAG,IAAI,IAAI,CAACF,EAAM,aAAa,GAAGA,EAAM,OAAO,KAAK,MAAUG,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hC,OADImC,EAAM,KAAK,WAAiB,kBAACuE,IAAD,EAAiB,SAAQ,CAAA,IAEvD,kBAAAlH,GAAA,EAAA,UAAA;EACE,kBAAC,OAAD;GACE,WAAU;GACV,OAAOmH,EAAiB/G,EAAK,MAAMI,EAAM,UAAU,CAAC;GAFtD,UAAA;IAIE,kBAAC,QAAD;KACE,eAAY;KACZ,WAAU;IACX,CAAA;IACD,kBAAC4B,GAAD;KAAW,WAAU;KAClB,UAAAO,EAAM,KAAK;IACH,CAAA;IACX,kBAACH,IAAD,EAAkB,SAAQ,CAAA;GACvB;;EACL,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAACsB,IAAD,EAAiB,SAAQ,CAAA,GACzB,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAACG,IAAD,EAAoB,SAAQ,CAAA;KAC5B,kBAACO,IAAD,EAAiB,SAAQ,CAAA;KACzB,kBAACK,IAAD,EAAkB,SAAQ,CAAA;KAC1B,kBAACI,IAAD,EAAmB,SAAQ,CAAA;KAC3B,kBAACe,IAAD,EAAsB,SAAQ,CAAA;KAC9B,kBAACO,GAAD,EAAyB,SAAQ,CAAA;KACjC,kBAACG,IAAD,EAAkB,SAAQ,CAAA;IACvB;GACF,CAAA,CAAA;;EACL,kBAACE,IAAD,EAAmB,SAAQ,CAAA;EAC1BxG,EAAK,UACJ,kBAACkH,GAAD;GAAwB,WAAU;GAAW,UAAA3E,EAAM;EAA6B,CAAA,IAC9E;CACJ,EAAA,CAAA;AAEN"}
|
|
@@ -17,7 +17,7 @@ function l(l, u) {
|
|
|
17
17
|
m,
|
|
18
18
|
C.events,
|
|
19
19
|
g
|
|
20
|
-
]), T = l.state.kind === "ready" && l.state.failedCalendarIds.length === 0, E = _ ? T : C.status === "ready", D = _ ? l.events : w;
|
|
20
|
+
]), T = l.state.kind === "ready" && l.state.failedCalendarIds.length === 0 && !l.state.truncated, E = _ ? T : C.status === "ready" && !C.truncated, D = _ ? l.events : w;
|
|
21
21
|
return o(() => E ? i(D, u, p) : null, [
|
|
22
22
|
E,
|
|
23
23
|
D,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMonthEventDates.js","names":["useMonthEventDates","page","showDeclined","fromView","monthOf","month","monthBounds","daysToInstants","addDays","first","last","timeZone","shownIds","useMemo","calendars","hiddenCalendarIds","calendar","c","own","useEventsInRangeV2","from","to","ownShown","shownEvents","withLocalChanges","actions","me","viewComplete","complete","events","eventDatesInMonth"],"sources":["../../../src/v2/rail/useMonthEventDates.ts"],"sourcesContent":["/**\n * The days of the rail's mini month that have events, for its dots (BOFF-15698 A1). The views\n * load only their own days, so the mini month loads the month it shows (the Month view's own\n * answer serves when it shows the same month). Until the whole month is known (still loading,\n *
|
|
1
|
+
{"version":3,"file":"useMonthEventDates.js","names":["useMonthEventDates","page","showDeclined","fromView","monthOf","month","monthBounds","daysToInstants","addDays","first","last","timeZone","shownIds","useMemo","calendars","hiddenCalendarIds","calendar","c","own","useEventsInRangeV2","from","to","ownShown","shownEvents","withLocalChanges","actions","me","viewComplete","complete","events","eventDatesInMonth"],"sources":["../../../src/v2/rail/useMonthEventDates.ts"],"sourcesContent":["/**\n * The days of the rail's mini month that have events, for its dots (BOFF-15698 A1). The views\n * load only their own days, so the mini month loads the month it shows (the Month view's own\n * answer serves when it shows the same month). Until the whole month is known (still loading,\n * a calendar didn't answer, or the answer was cut off) there are no dots: a day without a dot\n * must mean nothing is on. A calendar the service won't read doesn't count: it never will.\n */\nimport { useMemo } from 'react';\nimport { addDays, monthOf, type DateValue, type MonthValue } from '@burdenoff/fe-libs/ui';\nimport { useEventsInRangeV2 } from '../data/useEventsInRangeV2';\nimport { shownEvents } from '../events/eventModel';\nimport { withLocalChanges } from '../events/localChanges';\nimport type { CalendarPageModel } from '../page/CalendarPageContext';\nimport { daysToInstants } from '../time/calendarTime';\nimport { eventDatesInMonth, monthBounds } from './railStatus';\n\n/** The days of `month` with events on the shown calendars; null while that isn't fully known. */\nexport function useMonthEventDates(\n page: CalendarPageModel,\n month: MonthValue\n): ReadonlySet<DateValue> | null {\n const { calendars, hiddenCalendarIds, timeZone, me, actions } = page;\n const showDeclined = page.prefs.showDeclined;\n const fromView = page.nav.view === 'month' && monthOf(page.nav.date) === month;\n const { first, last } = monthBounds(month);\n // A day either side, as the views ask, for events that reach the month from another zone.\n const { from, to } = daysToInstants(addDays(first, -1), addDays(last, 1), timeZone);\n const shownIds = useMemo(\n () => calendars.filter((calendar) => !hiddenCalendarIds.has(calendar.id)).map((c) => c.id),\n [calendars, hiddenCalendarIds]\n );\n const own = useEventsInRangeV2(shownIds, from, to, {\n skip: fromView || page.calendarsStatus !== 'ready',\n });\n const ownShown = useMemo(\n () =>\n shownEvents(withLocalChanges(own.events, actions, me), {\n hiddenCalendarIds,\n showDeclined,\n me,\n }),\n [actions, hiddenCalendarIds, me, own.events, showDeclined]\n );\n\n const viewComplete =\n page.state.kind === 'ready' &&\n page.state.failedCalendarIds.length === 0 &&\n !page.state.truncated;\n const complete = fromView ? viewComplete : own.status === 'ready' && !own.truncated;\n const events = fromView ? page.events : ownShown;\n return useMemo(\n () => (complete ? eventDatesInMonth(events, month, timeZone) : null),\n [complete, events, month, timeZone]\n );\n}\n"],"mappings":";;;;;;;;AAiBA,SAAgBA,EACd,GACA,GAC+B;CAC/B,IAAM,EAAE,cAAW,sBAAmB,aAAU,OAAI,eAAYC,GAC1DC,IAAeD,EAAK,MAAM,cAC1BE,IAAWF,EAAK,IAAI,SAAS,WAAWG,EAAQH,EAAK,IAAI,IAAI,MAAMI,GACnE,EAAE,UAAO,YAASC,EAAYD,CAAK,GAEnC,EAAE,SAAM,UAAOE,EAAeC,EAAQC,GAAO,EAAE,GAAGD,EAAQE,GAAM,CAAC,GAAGC,CAAQ,GAC5EC,IAAWC,QACTC,EAAU,QAAQ,MAAa,CAACC,EAAkB,IAAIC,EAAS,EAAE,CAAC,CAAC,CAAC,KAAK,MAAMC,EAAE,EAAE,GACzF,CAACH,GAAWC,CAAiB,CAC/B,GACMG,IAAMC,EAAmBP,GAAUQ,GAAMC,GAAI,EACjD,MAAMlB,KAAYF,EAAK,oBAAoB,QAC7C,CAAC,GACKqB,IAAWT,QAEbU,EAAYC,EAAiBN,EAAI,QAAQO,GAASC,CAAE,GAAG;EACrD;EACA;EACA;CACF,CAAC,GACH;EAACD;EAASV;EAAmBW;EAAIR,EAAI;EAAQhB;CAAY,CAC3D,GAEMyB,IACJ1B,EAAK,MAAM,SAAS,WACpBA,EAAK,MAAM,kBAAkB,WAAW,KACxC,CAACA,EAAK,MAAM,WACR2B,IAAWzB,IAAWwB,IAAeT,EAAI,WAAW,WAAW,CAACA,EAAI,WACpEW,IAAS1B,IAAWF,EAAK,SAASqB;CACxC,OAAOT,QACEe,IAAWE,EAAkBD,GAAQxB,GAAOM,CAAQ,IAAI,MAC/D;EAACiB;EAAUC;EAAQxB;EAAOM;CAAQ,CACpC;AACF"}
|
|
@@ -14,5 +14,20 @@ export declare function PartialFailureNotice({ calendarIds, onRetry, }: {
|
|
|
14
14
|
/** Loads again what failed: the view's events, or the search. */
|
|
15
15
|
onRetry: () => void;
|
|
16
16
|
}): import('react').JSX.Element | null;
|
|
17
|
+
/**
|
|
18
|
+
* Calendars the service won't read for this person (not in this workspace, not shared with
|
|
19
|
+
* them, or no right to its events): named above the view, which shows the rest. Try again
|
|
20
|
+
* wouldn't change it, so the notice can be hidden for the visit instead.
|
|
21
|
+
*/
|
|
22
|
+
export declare function UnreadableCalendarsNotice({ calendarIds }: {
|
|
23
|
+
calendarIds: readonly string[];
|
|
24
|
+
}): import('react').JSX.Element | null;
|
|
25
|
+
/**
|
|
26
|
+
* The service stopped part way (too many events at once, or a repeat it can't follow, which
|
|
27
|
+
* then shows only its first date): some events may be missing here, and the view says so.
|
|
28
|
+
*/
|
|
29
|
+
export declare function CutOffNotice({ truncated }: {
|
|
30
|
+
truncated: boolean;
|
|
31
|
+
}): import('react').JSX.Element | null;
|
|
17
32
|
/** A followed calendar whose sync stopped: red, the reason, and Check now. Dismissed for the visit. */
|
|
18
33
|
export declare function SyncStoppedNotices(): import('react').JSX.Element | null;
|
|
@@ -88,9 +88,46 @@ function S({ calendarIds: e, onRetry: n }) {
|
|
|
88
88
|
]
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
function C() {
|
|
92
|
-
let
|
|
93
|
-
return
|
|
91
|
+
function C({ onHide: e }) {
|
|
92
|
+
let { tr: n } = t();
|
|
93
|
+
return /* @__PURE__ */ f("button", {
|
|
94
|
+
type: "button",
|
|
95
|
+
className: a,
|
|
96
|
+
"aria-label": n("calendar.v2.hideMessage", "Hide this message"),
|
|
97
|
+
onClick: e,
|
|
98
|
+
children: /* @__PURE__ */ f(u, { "aria-hidden": "true" })
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function w({ calendarIds: e }) {
|
|
102
|
+
let n = t(), { tr: r } = n, [i, a] = s(null), o = [...e].sort().join("\n");
|
|
103
|
+
if (e.length === 0 || i === o) return null;
|
|
104
|
+
let c = e.map((e) => n.calendarsById.get(e)?.name).filter((e) => !!e);
|
|
105
|
+
return /* @__PURE__ */ p(g, {
|
|
106
|
+
tone: "warn",
|
|
107
|
+
action: /* @__PURE__ */ f(C, { onHide: () => a(o) }),
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ f("b", { children: e.length === 1 ? r("calendar.v2.unreadableOne", "You can’t see the events of one calendar.") : r("calendar.v2.unreadableMany", "You can’t see the events of {{count}} calendars.", { count: e.length }) }),
|
|
110
|
+
" ",
|
|
111
|
+
c.length === 1 ? r("calendar.v2.unreadableNameOne", "{{name}}: it may no longer be shared with you. Ask whoever shares it, or untick it.", { name: c[0] ?? "" }) : null,
|
|
112
|
+
c.length > 1 ? r("calendar.v2.unreadableNamesMany", "{{names}}: they may no longer be shared with you. Ask whoever shares them, or untick them.", { names: c.join(", ") }) : null
|
|
113
|
+
]
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function T({ truncated: e }) {
|
|
117
|
+
let { tr: n } = t(), [r, i] = s(!1);
|
|
118
|
+
return !e || r ? null : /* @__PURE__ */ p(g, {
|
|
119
|
+
tone: "warn",
|
|
120
|
+
action: /* @__PURE__ */ f(C, { onHide: () => i(!0) }),
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ f("b", { children: n("calendar.v2.cutOffTitle", "Some events may be missing here.") }),
|
|
123
|
+
" ",
|
|
124
|
+
n("calendar.v2.cutOffBody", "There were too many to show at once, or a repeat the calendar can’t follow. Untick some calendars, or look at fewer days.")
|
|
125
|
+
]
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function E() {
|
|
129
|
+
let e = t(), { tr: i } = e, [a, o] = s(/* @__PURE__ */ new Set()), c = e.calendars.filter((t) => !e.hiddenCalendarIds.has(t.id) && !a.has(t.id) && r(t)?.kind === "stopped");
|
|
130
|
+
return c.length === 0 ? null : /* @__PURE__ */ f(d, { children: c.map((t) => /* @__PURE__ */ p(g, {
|
|
94
131
|
tone: "bad",
|
|
95
132
|
action: /* @__PURE__ */ p("span", {
|
|
96
133
|
className: "flex items-center gap-1",
|
|
@@ -99,13 +136,7 @@ function C() {
|
|
|
99
136
|
size: "sm",
|
|
100
137
|
onClick: () => void e.actions.checkSyncNow(t),
|
|
101
138
|
children: i("calendar.v2.checkNowShort", "Check now")
|
|
102
|
-
}) : null, /* @__PURE__ */ f(
|
|
103
|
-
type: "button",
|
|
104
|
-
className: a,
|
|
105
|
-
"aria-label": i("calendar.v2.hideMessage", "Hide this message"),
|
|
106
|
-
onClick: () => c((e) => /* @__PURE__ */ new Set([...e, t.id])),
|
|
107
|
-
children: /* @__PURE__ */ f(u, { "aria-hidden": "true" })
|
|
108
|
-
})]
|
|
139
|
+
}) : null, /* @__PURE__ */ f(C, { onHide: () => o((e) => /* @__PURE__ */ new Set([...e, t.id])) })]
|
|
109
140
|
}),
|
|
110
141
|
children: [
|
|
111
142
|
/* @__PURE__ */ f("b", { children: i("calendar.v2.syncStoppedTitle", "Sync stopped · {{name}}.", { name: t.name }) }),
|
|
@@ -117,6 +148,6 @@ function C() {
|
|
|
117
148
|
]
|
|
118
149
|
}, t.id)) });
|
|
119
150
|
}
|
|
120
|
-
export { b as AllHiddenState, y as LoadErrorState, x as NoResultsState, S as PartialFailureNotice,
|
|
151
|
+
export { b as AllHiddenState, T as CutOffNotice, y as LoadErrorState, x as NoResultsState, S as PartialFailureNotice, E as SyncStoppedNotices, w as UnreadableCalendarsNotice };
|
|
121
152
|
|
|
122
153
|
//# sourceMappingURL=CalendarStates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarStates.js","names":["_Fragment","Fragment$1","StatePanel","VIEW_PANEL","LoadErrorState","useCalendarPage","title","failed","tr","EmptyState","Button","onRetry","RefreshCw","error","ShowTechnicalDetails","technicalDetails","AllHiddenState","showAll","useCalendarV2Store","state","Eye","NoResultsState","page","setSearch","hidden","PartialFailureNotice","calendarIds","names","id","name","Notice","SyncStoppedNotices","dismissed","setDismissed","useState","stopped","calendar","syncLine","ICON_BUTTON","current","X","reasonWords"],"sources":["../../../src/v2/states/CalendarStates.tsx"],"sourcesContent":["/**\n * The calendar's states (BOFF-15698 A1), in the glass style: a load that failed (never shown as\n * an empty calendar, always with Try again and the technical details), every calendar hidden,\n * and a search without matches. Plus the notices over a view: calendars that didn't answer, and\n * a followed calendar whose sync stopped.\n */\nimport { useState, type ReactNode } from 'react';\nimport { Eye, RefreshCw, X } from 'lucide-react';\nimport { Button, EmptyState, Notice, ShowTechnicalDetails } from '@burdenoff/fe-libs/ui';\nimport { technicalDetails } from '../data/errors';\nimport { useCalendarPage } from '../page/CalendarPageContext';\nimport { reasonWords } from '../rail/syncWords';\nimport { syncLine } from '../rail/railStatus';\nimport { useCalendarV2Store } from '../state/calendarV2Store';\nimport { ICON_BUTTON, VIEW_PANEL } from '../styles';\n\nfunction StatePanel({ children }: { children: ReactNode }) {\n return <section className={`${VIEW_PANEL} grid place-items-center p-6`}>{children}</section>;\n}\n\n/** A load failed: what failed, Try again, and the details for support. */\nexport function LoadErrorState({\n failed,\n error,\n onRetry,\n}: {\n failed: 'calendars' | 'events' | 'search';\n error: unknown;\n onRetry: () => void;\n}) {\n const { tr } = useCalendarPage();\n const title =\n failed === 'calendars'\n ? tr('calendar.v2.calendarsFailed', 'Couldn’t load your calendars')\n : failed === 'search'\n ? tr('calendar.v2.searchFailed', 'Couldn’t search your calendars')\n : tr('calendar.v2.eventsFailed', 'Couldn’t load your events');\n return (\n <StatePanel>\n <EmptyState\n size=\"panel\"\n kind=\"error\"\n title={title}\n description={tr(\n 'calendar.v2.failedBody',\n 'The calendar service didn’t answer. Nothing was lost; try again in a moment.'\n )}\n action={\n <Button type=\"button\" onClick={onRetry}>\n <RefreshCw aria-hidden=\"true\" />\n {tr('calendar.v2.tryAgain', 'Try again')}\n </Button>\n }\n secondaryAction={\n error ? (\n <ShowTechnicalDetails copyable>{technicalDetails(error)}</ShowTechnicalDetails>\n ) : undefined\n }\n />\n </StatePanel>\n );\n}\n\nexport function AllHiddenState() {\n const { tr } = useCalendarPage();\n const showAll = useCalendarV2Store((state) => state.showAllCalendars);\n return (\n <StatePanel>\n <EmptyState\n size=\"panel\"\n kind=\"filtered\"\n title={tr('calendar.v2.allHidden', 'Every calendar is hidden')}\n description={tr(\n 'calendar.v2.allHiddenBody',\n 'Turn a calendar back on in the list, or show them all.'\n )}\n action={\n <Button type=\"button\" onClick={showAll}>\n <Eye aria-hidden=\"true\" />\n {tr('calendar.v2.showAll', 'Show every calendar')}\n </Button>\n }\n />\n </StatePanel>\n );\n}\n\nexport function NoResultsState({ query }: { query: string }) {\n const page = useCalendarPage();\n const { tr } = page;\n const setSearch = useCalendarV2Store((state) => state.setSearch);\n const showAll = useCalendarV2Store((state) => state.showAllCalendars);\n const hidden = page.hiddenCalendarIds.size;\n return (\n <StatePanel>\n <EmptyState\n size=\"panel\"\n kind=\"no-results\"\n title={tr('calendar.v2.noResults', 'No events match “{{query}}”', { query })}\n description={\n hidden > 0\n ? tr(\n 'calendar.v2.noResultsHidden',\n 'Hidden calendars aren’t searched. Check the spelling, or show every calendar.'\n )\n : tr(\n 'calendar.v2.noResultsBody',\n 'Check the spelling, or try a word from the title or the notes.'\n )\n }\n action={\n <Button type=\"button\" variant=\"outline\" onClick={() => setSearch('')}>\n {tr('calendar.v2.clearSearch', 'Clear search')}\n </Button>\n }\n secondaryAction={\n hidden > 0 ? (\n <Button type=\"button\" variant=\"outline\" onClick={showAll}>\n {tr('calendar.v2.showAll', 'Show every calendar')}\n </Button>\n ) : undefined\n }\n />\n </StatePanel>\n );\n}\n\n/** Calendars whose events didn't load: named above the view, which shows the rest. */\nexport function PartialFailureNotice({\n calendarIds,\n onRetry,\n}: {\n calendarIds: readonly string[];\n /** Loads again what failed: the view's events, or the search. */\n onRetry: () => void;\n}) {\n const page = useCalendarPage();\n const { tr } = page;\n if (calendarIds.length === 0) return null;\n const names = calendarIds\n .map((id) => page.calendarsById.get(id)?.name)\n .filter((name): name is string => Boolean(name));\n return (\n <Notice\n tone=\"warn\"\n action={\n <Button type=\"button\" size=\"sm\" variant=\"outline\" onClick={onRetry}>\n {tr('calendar.v2.tryAgain', 'Try again')}\n </Button>\n }\n >\n <b>\n {calendarIds.length === 1\n ? tr('calendar.v2.partialOne', 'One calendar didn’t load.')\n : tr('calendar.v2.partialMany', '{{count}} calendars didn’t load.', {\n count: calendarIds.length,\n })}\n </b>{' '}\n {names.length > 0\n ? tr('calendar.v2.partialNames', '{{names}}: its events may be missing here.', {\n names: names.join(', '),\n })\n : null}\n </Notice>\n );\n}\n\n/** A followed calendar whose sync stopped: red, the reason, and Check now. Dismissed for the visit. */\nexport function SyncStoppedNotices() {\n const page = useCalendarPage();\n const { tr } = page;\n const [dismissed, setDismissed] = useState<ReadonlySet<string>>(new Set());\n const stopped = page.calendars.filter(\n (calendar) =>\n !page.hiddenCalendarIds.has(calendar.id) &&\n !dismissed.has(calendar.id) &&\n syncLine(calendar)?.kind === 'stopped'\n );\n if (stopped.length === 0) return null;\n return (\n <>\n {stopped.map((calendar) => (\n <Notice\n key={calendar.id}\n tone=\"bad\"\n action={\n <span className=\"flex items-center gap-1\">\n {calendar.sync?.provider === 'ICS_URL' ? (\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={() => void page.actions.checkSyncNow(calendar)}\n >\n {tr('calendar.v2.checkNowShort', 'Check now')}\n </Button>\n ) : null}\n <button\n type=\"button\"\n className={ICON_BUTTON}\n aria-label={tr('calendar.v2.hideMessage', 'Hide this message')}\n onClick={() => setDismissed((current) => new Set([...current, calendar.id]))}\n >\n <X aria-hidden=\"true\" />\n </button>\n </span>\n }\n >\n <b>\n {tr('calendar.v2.syncStoppedTitle', 'Sync stopped · {{name}}.', {\n name: calendar.name,\n })}\n </b>{' '}\n {reasonWords(tr, syncLine(calendar)?.reason ?? null)}.{' '}\n {tr('calendar.v2.syncStoppedBody', 'Changes made there since then may be missing here.')}\n </Notice>\n ))}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;AAgBA,SAASE,EAAW,EAAE,eAAqC;CACzD,OAAO,kBAAC,WAAD;EAAS,WAAW,GAAGC,EAAW;EAAgC;CAAkB,CAAA;AAC7F;AAGA,SAAgBC,EAAe,EAC7B,WACA,UACA,cAKC;CACD,IAAM,EAAE,UAAOC,EAAgB,GACzBC,IACJC,MAAW,cACPC,EAAG,+BAA+B,8BAA8B,IAChED,MAAW,WACTC,EAAG,4BAA4B,gCAAgC,IAC/DA,EAAG,4BAA4B,2BAA2B;CAClE,OACE,kBAACN,GAAD,EAAA,UACE,kBAACO,GAAD;EACE,MAAK;EACL,MAAK;EACE;EACP,aAAaD,EACX,0BACA,8EACF;EACA,QACE,kBAACE,GAAD;GAAQ,MAAK;GAAS,SAASC;GAA/B,UAAA,CACE,kBAACC,GAAD,EAAW,eAAY,OAAQ,CAAA,GAC9BJ,EAAG,wBAAwB,WAAW,CACjC;;EAEV,iBACEK,IACE,kBAACC,GAAD;GAA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AA,IACN,MACJ,kBAAC,UAAD;IACE,MAAK;IACL,WAAW8B;IACX,cAAY9B,EAAG,2BAA2B,mBAAmB;IAC7D,eAAeyB,GAAc,sBAAY,IAAI,IAAI,CAAC,GAAGM,GAASH,EAAS,EAAE,CAAC,CAAC;IAE3E,UAAA,kBAACI,GAAD,EAAG,eAAY,OAAQ,CAAA;GACjB,CAAA,CACJ;;EAtBV,UAAA;GAyBE,kBAAC,KAAD,EAAA,UACGhC,EAAG,gCAAgC,4BAA4B,EAC9D,MAAM4B,EAAS,KACjB,CAAC,EACA,CAAA;GAAE;GACJK,EAAYjC,GAAI6B,EAASD,CAAQ,CAAC,EAAE,UAAU,IAAI;GAAE;GAAE;GACtD5B,EAAG,+BAA+B,oDAAoD;EACjF;CA/BD,GAAA4B,EAAS,EA+BR,CACT,EACD,CAAA;AAEN"}
|
|
1
|
+
{"version":3,"file":"CalendarStates.js","names":["_Fragment","Fragment$1","StatePanel","VIEW_PANEL","LoadErrorState","useCalendarPage","title","failed","tr","EmptyState","Button","onRetry","RefreshCw","error","ShowTechnicalDetails","technicalDetails","AllHiddenState","showAll","useCalendarV2Store","state","Eye","NoResultsState","page","setSearch","hidden","PartialFailureNotice","calendarIds","names","id","name","Notice","HideMessageButton","ICON_BUTTON","onHide","X","UnreadableCalendarsNotice","hiddenFor","setHiddenFor","useState","key","CutOffNotice","setHidden","truncated","SyncStoppedNotices","dismissed","setDismissed","stopped","calendar","syncLine","current","reasonWords"],"sources":["../../../src/v2/states/CalendarStates.tsx"],"sourcesContent":["/**\n * The calendar's states (BOFF-15698 A1), in the glass style: a load that failed (never shown as\n * an empty calendar, always with Try again and the technical details), every calendar hidden,\n * and a search without matches. Plus the notices over a view: calendars that didn't answer,\n * calendars the service won't read, an answer cut off at the service's limits (A4), and a\n * followed calendar whose sync stopped.\n */\nimport { useState, type ReactNode } from 'react';\nimport { Eye, RefreshCw, X } from 'lucide-react';\nimport { Button, EmptyState, Notice, ShowTechnicalDetails } from '@burdenoff/fe-libs/ui';\nimport { technicalDetails } from '../data/errors';\nimport { useCalendarPage } from '../page/CalendarPageContext';\nimport { reasonWords } from '../rail/syncWords';\nimport { syncLine } from '../rail/railStatus';\nimport { useCalendarV2Store } from '../state/calendarV2Store';\nimport { ICON_BUTTON, VIEW_PANEL } from '../styles';\n\nfunction StatePanel({ children }: { children: ReactNode }) {\n return <section className={`${VIEW_PANEL} grid place-items-center p-6`}>{children}</section>;\n}\n\n/** A load failed: what failed, Try again, and the details for support. */\nexport function LoadErrorState({\n failed,\n error,\n onRetry,\n}: {\n failed: 'calendars' | 'events' | 'search';\n error: unknown;\n onRetry: () => void;\n}) {\n const { tr } = useCalendarPage();\n const title =\n failed === 'calendars'\n ? tr('calendar.v2.calendarsFailed', 'Couldn’t load your calendars')\n : failed === 'search'\n ? tr('calendar.v2.searchFailed', 'Couldn’t search your calendars')\n : tr('calendar.v2.eventsFailed', 'Couldn’t load your events');\n return (\n <StatePanel>\n <EmptyState\n size=\"panel\"\n kind=\"error\"\n title={title}\n description={tr(\n 'calendar.v2.failedBody',\n 'The calendar service didn’t answer. Nothing was lost; try again in a moment.'\n )}\n action={\n <Button type=\"button\" onClick={onRetry}>\n <RefreshCw aria-hidden=\"true\" />\n {tr('calendar.v2.tryAgain', 'Try again')}\n </Button>\n }\n secondaryAction={\n error ? (\n <ShowTechnicalDetails copyable>{technicalDetails(error)}</ShowTechnicalDetails>\n ) : undefined\n }\n />\n </StatePanel>\n );\n}\n\nexport function AllHiddenState() {\n const { tr } = useCalendarPage();\n const showAll = useCalendarV2Store((state) => state.showAllCalendars);\n return (\n <StatePanel>\n <EmptyState\n size=\"panel\"\n kind=\"filtered\"\n title={tr('calendar.v2.allHidden', 'Every calendar is hidden')}\n description={tr(\n 'calendar.v2.allHiddenBody',\n 'Turn a calendar back on in the list, or show them all.'\n )}\n action={\n <Button type=\"button\" onClick={showAll}>\n <Eye aria-hidden=\"true\" />\n {tr('calendar.v2.showAll', 'Show every calendar')}\n </Button>\n }\n />\n </StatePanel>\n );\n}\n\nexport function NoResultsState({ query }: { query: string }) {\n const page = useCalendarPage();\n const { tr } = page;\n const setSearch = useCalendarV2Store((state) => state.setSearch);\n const showAll = useCalendarV2Store((state) => state.showAllCalendars);\n const hidden = page.hiddenCalendarIds.size;\n return (\n <StatePanel>\n <EmptyState\n size=\"panel\"\n kind=\"no-results\"\n title={tr('calendar.v2.noResults', 'No events match “{{query}}”', { query })}\n description={\n hidden > 0\n ? tr(\n 'calendar.v2.noResultsHidden',\n 'Hidden calendars aren’t searched. Check the spelling, or show every calendar.'\n )\n : tr(\n 'calendar.v2.noResultsBody',\n 'Check the spelling, or try a word from the title or the notes.'\n )\n }\n action={\n <Button type=\"button\" variant=\"outline\" onClick={() => setSearch('')}>\n {tr('calendar.v2.clearSearch', 'Clear search')}\n </Button>\n }\n secondaryAction={\n hidden > 0 ? (\n <Button type=\"button\" variant=\"outline\" onClick={showAll}>\n {tr('calendar.v2.showAll', 'Show every calendar')}\n </Button>\n ) : undefined\n }\n />\n </StatePanel>\n );\n}\n\n/** Calendars whose events didn't load: named above the view, which shows the rest. */\nexport function PartialFailureNotice({\n calendarIds,\n onRetry,\n}: {\n calendarIds: readonly string[];\n /** Loads again what failed: the view's events, or the search. */\n onRetry: () => void;\n}) {\n const page = useCalendarPage();\n const { tr } = page;\n if (calendarIds.length === 0) return null;\n const names = calendarIds\n .map((id) => page.calendarsById.get(id)?.name)\n .filter((name): name is string => Boolean(name));\n return (\n <Notice\n tone=\"warn\"\n action={\n <Button type=\"button\" size=\"sm\" variant=\"outline\" onClick={onRetry}>\n {tr('calendar.v2.tryAgain', 'Try again')}\n </Button>\n }\n >\n <b>\n {calendarIds.length === 1\n ? tr('calendar.v2.partialOne', 'One calendar didn’t load.')\n : tr('calendar.v2.partialMany', '{{count}} calendars didn’t load.', {\n count: calendarIds.length,\n })}\n </b>{' '}\n {names.length > 0\n ? tr('calendar.v2.partialNames', '{{names}}: its events may be missing here.', {\n names: names.join(', '),\n })\n : null}\n </Notice>\n );\n}\n\n/** A button that hides a notice for the visit. */\nfunction HideMessageButton({ onHide }: { onHide: () => void }) {\n const { tr } = useCalendarPage();\n return (\n <button\n type=\"button\"\n className={ICON_BUTTON}\n aria-label={tr('calendar.v2.hideMessage', 'Hide this message')}\n onClick={onHide}\n >\n <X aria-hidden=\"true\" />\n </button>\n );\n}\n\n/**\n * Calendars the service won't read for this person (not in this workspace, not shared with\n * them, or no right to its events): named above the view, which shows the rest. Try again\n * wouldn't change it, so the notice can be hidden for the visit instead.\n */\nexport function UnreadableCalendarsNotice({ calendarIds }: { calendarIds: readonly string[] }) {\n const page = useCalendarPage();\n const { tr } = page;\n const [hiddenFor, setHiddenFor] = useState<string | null>(null);\n const key = [...calendarIds].sort().join('\\n');\n if (calendarIds.length === 0 || hiddenFor === key) return null;\n const names = calendarIds\n .map((id) => page.calendarsById.get(id)?.name)\n .filter((name): name is string => Boolean(name));\n return (\n <Notice tone=\"warn\" action={<HideMessageButton onHide={() => setHiddenFor(key)} />}>\n <b>\n {calendarIds.length === 1\n ? tr('calendar.v2.unreadableOne', 'You can’t see the events of one calendar.')\n : tr('calendar.v2.unreadableMany', 'You can’t see the events of {{count}} calendars.', {\n count: calendarIds.length,\n })}\n </b>{' '}\n {names.length === 1\n ? tr(\n 'calendar.v2.unreadableNameOne',\n '{{name}}: it may no longer be shared with you. Ask whoever shares it, or untick it.',\n { name: names[0] ?? '' }\n )\n : null}\n {names.length > 1\n ? tr(\n 'calendar.v2.unreadableNamesMany',\n '{{names}}: they may no longer be shared with you. Ask whoever shares them, or untick them.',\n { names: names.join(', ') }\n )\n : null}\n </Notice>\n );\n}\n\n/**\n * The service stopped part way (too many events at once, or a repeat it can't follow, which\n * then shows only its first date): some events may be missing here, and the view says so.\n */\nexport function CutOffNotice({ truncated }: { truncated: boolean }) {\n const { tr } = useCalendarPage();\n const [hidden, setHidden] = useState(false);\n if (!truncated || hidden) return null;\n return (\n <Notice tone=\"warn\" action={<HideMessageButton onHide={() => setHidden(true)} />}>\n <b>{tr('calendar.v2.cutOffTitle', 'Some events may be missing here.')}</b>{' '}\n {tr(\n 'calendar.v2.cutOffBody',\n 'There were too many to show at once, or a repeat the calendar can’t follow. Untick some calendars, or look at fewer days.'\n )}\n </Notice>\n );\n}\n\n/** A followed calendar whose sync stopped: red, the reason, and Check now. Dismissed for the visit. */\nexport function SyncStoppedNotices() {\n const page = useCalendarPage();\n const { tr } = page;\n const [dismissed, setDismissed] = useState<ReadonlySet<string>>(new Set());\n const stopped = page.calendars.filter(\n (calendar) =>\n !page.hiddenCalendarIds.has(calendar.id) &&\n !dismissed.has(calendar.id) &&\n syncLine(calendar)?.kind === 'stopped'\n );\n if (stopped.length === 0) return null;\n return (\n <>\n {stopped.map((calendar) => (\n <Notice\n key={calendar.id}\n tone=\"bad\"\n action={\n <span className=\"flex items-center gap-1\">\n {calendar.sync?.provider === 'ICS_URL' ? (\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={() => void page.actions.checkSyncNow(calendar)}\n >\n {tr('calendar.v2.checkNowShort', 'Check now')}\n </Button>\n ) : null}\n <HideMessageButton\n onHide={() => setDismissed((current) => new Set([...current, calendar.id]))}\n />\n </span>\n }\n >\n <b>\n {tr('calendar.v2.syncStoppedTitle', 'Sync stopped · {{name}}.', {\n name: calendar.name,\n })}\n </b>{' '}\n {reasonWords(tr, syncLine(calendar)?.reason ?? null)}.{' '}\n {tr('calendar.v2.syncStoppedBody', 'Changes made there since then may be missing here.')}\n </Notice>\n ))}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;AAiBA,SAASE,EAAW,EAAE,eAAqC;CACzD,OAAO,kBAAC,WAAD;EAAS,WAAW,GAAGC,EAAW;EAAgC;CAAkB,CAAA;AAC7F;AAGA,SAAgBC,EAAe,EAC7B,WACA,UACA,cAKC;CACD,IAAM,EAAE,UAAOC,EAAgB,GACzBC,IACJC,MAAW,cACPC,EAAG,+BAA+B,8BAA8B,IAChED,MAAW,WACTC,EAAG,4BAA4B,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OiB,GACT,CAACsB,GAAWC,KAAgBP,kBAA8B,IAAI,IAAI,CAAC,GACnEQ,IAAUxB,EAAK,UAAU,QAC5B,MACC,CAACA,EAAK,kBAAkB,IAAIyB,EAAS,EAAE,KACvC,CAACH,EAAU,IAAIG,EAAS,EAAE,KAC1BC,EAASD,CAAQ,CAAC,EAAE,SAAS,SACjC;CAEA,OADID,EAAQ,WAAW,IAAU,OAE/B,kBAAA9C,GAAA,EAAA,UACG8C,EAAQ,KAAK,MACZ,kBAAChB,GAAD;EAEE,MAAK;EACL,QACE,kBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CACGiB,EAAS,MAAM,aAAa,YAC3B,kBAACrC,GAAD;IACE,MAAK;IACL,MAAK;IACL,eAAe,KAAKY,EAAK,QAAQ,aAAayB,CAAQ;IAErD,UAAAvC,EAAG,6BAA6B,WAAW;GACtC,CAAA,IACN,MACJ,kBAACuB,GAAD,EACE,cAAcc,GAAc,sBAAY,IAAI,IAAI,CAAC,GAAGI,GAASF,EAAS,EAAE,CAAC,CAAC,EAC3E,CAAA,CACG;;EAjBV,UAAA;GAoBE,kBAAC,KAAD,EAAA,UACGvC,EAAG,gCAAgC,4BAA4B,EAC9D,MAAMuC,EAAS,KACjB,CAAC,EACA,CAAA;GAAE;GACJG,EAAY1C,GAAIwC,EAASD,CAAQ,CAAC,EAAE,UAAU,IAAI;GAAE;GAAE;GACtDvC,EAAG,+BAA+B,oDAAoD;EACjF;CA1BD,GAAAuC,EAAS,EA0BR,CACT,EACD,CAAA;AAEN"}
|
package/dist/v2/types.d.ts
CHANGED
|
@@ -11,8 +11,10 @@ export type CalendarV2Dialog = 'rooms' | 'share' | 'settings' | 'event' | 'findt
|
|
|
11
11
|
* new event's day, times, calendar and title (a quick create's "More options").
|
|
12
12
|
*/
|
|
13
13
|
export interface CalendarV2EventDraft {
|
|
14
|
-
/** The event to edit; absent for a new
|
|
14
|
+
/** The event to edit (the stored event: a series for one of its dates); absent for a new one. */
|
|
15
15
|
eventId?: string;
|
|
16
|
+
/** A series' date to edit (A4): its original start (`CalendarEventV2.instanceDate`). */
|
|
17
|
+
instanceDate?: Date;
|
|
16
18
|
/** The tab to open on: 'details', 'people', 'place' or 'more'. */
|
|
17
19
|
tab?: string;
|
|
18
20
|
/** A new event's day, and its times in minutes on the calendar's clock (end up to 1440). */
|
|
@@ -109,9 +111,30 @@ export interface EventBookingV2 {
|
|
|
109
111
|
start: Date;
|
|
110
112
|
end: Date;
|
|
111
113
|
}
|
|
112
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* An event as the redesigned views show it: one occurrence of it (A4). A repeating event comes
|
|
116
|
+
* once for each of its dates in the range; any other event is one occurrence of itself.
|
|
117
|
+
*/
|
|
113
118
|
export interface CalendarEventV2 {
|
|
119
|
+
/**
|
|
120
|
+
* Unique among the views' events and the same on every read: the event's id for an event that
|
|
121
|
+
* doesn't repeat and for a date of a series moved on its own, else `<seriesId>@<instanceDate>`.
|
|
122
|
+
*/
|
|
114
123
|
id: string;
|
|
124
|
+
/**
|
|
125
|
+
* The stored event (its row): what every write and every read by id takes. For a regular date
|
|
126
|
+
* of a series it is the series.
|
|
127
|
+
*/
|
|
128
|
+
eventId: string;
|
|
129
|
+
/** The series this is a date of; null for an event that doesn't repeat. */
|
|
130
|
+
seriesId: string | null;
|
|
131
|
+
/**
|
|
132
|
+
* This date's original start in its series ("This event" names the date by it); null for an
|
|
133
|
+
* event that doesn't repeat. For a date moved on its own, the start it was moved from.
|
|
134
|
+
*/
|
|
135
|
+
instanceDate: Date | null;
|
|
136
|
+
/** A date of a series moved or changed on its own: `eventId` is its own row. */
|
|
137
|
+
isModified: boolean;
|
|
115
138
|
calendarId: string;
|
|
116
139
|
title: string;
|
|
117
140
|
description: string | null;
|
|
@@ -124,8 +147,13 @@ export interface CalendarEventV2 {
|
|
|
124
147
|
status: EventStatusV2;
|
|
125
148
|
visibility: EventVisibilityV2;
|
|
126
149
|
type: EventTypeV2;
|
|
150
|
+
/** The stored event is a series (this is one of its regular dates). */
|
|
127
151
|
isRecurring: boolean;
|
|
128
152
|
rrule: string | null;
|
|
153
|
+
/** A series' cancelled dates, by their original starts (none for any other event). */
|
|
154
|
+
cancelledDates: Date[];
|
|
155
|
+
/** "Show me as": busy, or free (a free event takes no time in free/busy or Find a time). */
|
|
156
|
+
isBusy: boolean;
|
|
129
157
|
/** Who made the event (the organiser). */
|
|
130
158
|
organizerId: string;
|
|
131
159
|
guests: EventGuestV2[];
|