@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.
Files changed (88) hide show
  1. package/dist/generated/wspace-operations.d.ts +342 -69
  2. package/dist/generated/wspace-operations.js +73 -31
  3. package/dist/generated/wspace-operations.js.map +1 -1
  4. package/dist/generated/wspace-types.d.ts +405 -6
  5. package/dist/translations/en.d.ts +22 -4
  6. package/dist/v2/CalendarPageV2.js +45 -41
  7. package/dist/v2/CalendarPageV2.js.map +1 -1
  8. package/dist/v2/CalendarRoutesV2.js +64 -64
  9. package/dist/v2/CalendarRoutesV2.js.map +1 -1
  10. package/dist/v2/data/errors.d.ts +5 -0
  11. package/dist/v2/data/errors.js +6 -2
  12. package/dist/v2/data/errors.js.map +1 -1
  13. package/dist/v2/data/normalize.d.ts +31 -3
  14. package/dist/v2/data/normalize.js +57 -13
  15. package/dist/v2/data/normalize.js.map +1 -1
  16. package/dist/v2/data/seriesDateLookup.d.ts +9 -0
  17. package/dist/v2/data/seriesDateLookup.js +12 -0
  18. package/dist/v2/data/seriesDateLookup.js.map +1 -0
  19. package/dist/v2/data/useEventActions.d.ts +9 -3
  20. package/dist/v2/data/useEventActions.js +239 -186
  21. package/dist/v2/data/useEventActions.js.map +1 -1
  22. package/dist/v2/data/useEventForPeek.js +63 -21
  23. package/dist/v2/data/useEventForPeek.js.map +1 -1
  24. package/dist/v2/data/useEventsInRangeV2.d.ts +40 -2
  25. package/dist/v2/data/useEventsInRangeV2.js +76 -47
  26. package/dist/v2/data/useEventsInRangeV2.js.map +1 -1
  27. package/dist/v2/day/DayPanel.js +1 -1
  28. package/dist/v2/day/DayPanel.js.map +1 -1
  29. package/dist/v2/event/EventDialog.d.ts +13 -3
  30. package/dist/v2/event/EventDialog.js +189 -166
  31. package/dist/v2/event/EventDialog.js.map +1 -1
  32. package/dist/v2/event/EventDialogs.js +57 -50
  33. package/dist/v2/event/EventDialogs.js.map +1 -1
  34. package/dist/v2/event/EventMoreTab.js +8 -7
  35. package/dist/v2/event/EventMoreTab.js.map +1 -1
  36. package/dist/v2/event/EventPlaceTab.js +2 -2
  37. package/dist/v2/event/EventPlaceTab.js.map +1 -1
  38. package/dist/v2/event/FindTimeDialog.js +1 -1
  39. package/dist/v2/event/FindTimeDialog.js.map +1 -1
  40. package/dist/v2/event/RepeatField.js +10 -7
  41. package/dist/v2/event/RepeatField.js.map +1 -1
  42. package/dist/v2/event/dialogLogic.d.ts +10 -0
  43. package/dist/v2/event/dialogLogic.js +25 -22
  44. package/dist/v2/event/dialogLogic.js.map +1 -1
  45. package/dist/v2/event/dialogModel.d.ts +3 -0
  46. package/dist/v2/event/dialogModel.js.map +1 -1
  47. package/dist/v2/event/eventForm.d.ts +26 -0
  48. package/dist/v2/event/eventForm.js +145 -92
  49. package/dist/v2/event/eventForm.js.map +1 -1
  50. package/dist/v2/event/findTimeSource.js +44 -44
  51. package/dist/v2/event/findTimeSource.js.map +1 -1
  52. package/dist/v2/event/rrule.js.map +1 -1
  53. package/dist/v2/event/savePlan.d.ts +125 -15
  54. package/dist/v2/event/savePlan.js +162 -68
  55. package/dist/v2/event/savePlan.js.map +1 -1
  56. package/dist/v2/event/useEventData.d.ts +7 -2
  57. package/dist/v2/event/useEventData.js +107 -80
  58. package/dist/v2/event/useEventData.js.map +1 -1
  59. package/dist/v2/event/useEventDialogModel.d.ts +16 -3
  60. package/dist/v2/event/useEventDialogModel.js +82 -67
  61. package/dist/v2/event/useEventDialogModel.js.map +1 -1
  62. package/dist/v2/event/useEventSave.d.ts +20 -4
  63. package/dist/v2/event/useEventSave.js +181 -90
  64. package/dist/v2/event/useEventSave.js.map +1 -1
  65. package/dist/v2/events/eventLook.js +16 -16
  66. package/dist/v2/events/eventLook.js.map +1 -1
  67. package/dist/v2/events/eventModel.d.ts +17 -4
  68. package/dist/v2/events/eventModel.js +46 -34
  69. package/dist/v2/events/eventModel.js.map +1 -1
  70. package/dist/v2/events/localChanges.d.ts +4 -1
  71. package/dist/v2/events/localChanges.js +4 -2
  72. package/dist/v2/events/localChanges.js.map +1 -1
  73. package/dist/v2/page/CalendarPageContext.d.ts +2 -2
  74. package/dist/v2/page/CalendarPageContext.js.map +1 -1
  75. package/dist/v2/page/useCalendarPageModel.js +141 -139
  76. package/dist/v2/page/useCalendarPageModel.js.map +1 -1
  77. package/dist/v2/page/viewState.d.ts +9 -1
  78. package/dist/v2/page/viewState.js +5 -3
  79. package/dist/v2/page/viewState.js.map +1 -1
  80. package/dist/v2/peek/PeekEvent.js +210 -204
  81. package/dist/v2/peek/PeekEvent.js.map +1 -1
  82. package/dist/v2/rail/useMonthEventDates.js +1 -1
  83. package/dist/v2/rail/useMonthEventDates.js.map +1 -1
  84. package/dist/v2/states/CalendarStates.d.ts +15 -0
  85. package/dist/v2/states/CalendarStates.js +42 -11
  86. package/dist/v2/states/CalendarStates.js.map +1 -1
  87. package/dist/v2/types.d.ts +30 -2
  88. package/package.json +1 -1
@@ -1,18 +1,18 @@
1
1
  import { formatDay as e, formatInstantRange as t } from "../format.js";
2
- import { endInstant as n, firstDayOf as r, startInstant as i } from "./eventForm.js";
3
- import { busyDuring as a, personBusySpans as o } from "./findTime.js";
2
+ import { endInstant as n, firstDayOf as r, formFromEvent as i, startInstant as a } from "./eventForm.js";
3
+ import { busyDuring as o, personBusySpans as s } from "./findTime.js";
4
4
  // src/v2/event/dialogLogic.ts
5
- var s = "calendar-event-title", c = "calendar-event-video";
6
- function l(e) {
5
+ var c = "calendar-event-title", l = "calendar-event-video";
6
+ function u(e) {
7
7
  return e.title || e.when || e.repeat ? {
8
8
  tab: "details",
9
- field: e.title ? s : null
9
+ field: e.title ? c : null
10
10
  } : e.video ? {
11
11
  tab: "place",
12
- field: c
12
+ field: l
13
13
  } : null;
14
14
  }
15
- function u(e, t, n, r) {
15
+ function d(e, t, n, r) {
16
16
  if (e.kind === "loading") return {
17
17
  kind: "loading",
18
18
  span: null,
@@ -28,10 +28,10 @@ function u(e, t, n, r) {
28
28
  span: null,
29
29
  truncated: !1
30
30
  };
31
- let i = o(e.person, n, r).filter((e) => !t.allDay || e.kind === "away"), s = a(i, t.start, t.end), c = e.person.truncated;
32
- return s ? {
33
- kind: s.kind === "away" ? "away" : s.kind === "tentative" ? "tentative" : "busy",
34
- span: s,
31
+ let i = s(e.person, n, r).filter((e) => !t.allDay || e.kind === "away"), a = o(i, t.start, t.end), c = e.person.truncated;
32
+ return a ? {
33
+ kind: a.kind === "away" ? "away" : a.kind === "tentative" ? "tentative" : "busy",
34
+ span: a,
35
35
  truncated: c
36
36
  } : {
37
37
  kind: "free",
@@ -39,23 +39,23 @@ function u(e, t, n, r) {
39
39
  truncated: c
40
40
  };
41
41
  }
42
- function d(a, o, s) {
43
- let c = e(r(a), s, "mid"), l = t(i(a), n(a), a.timeZone, s);
44
- return a.allDay && (l = a.lastDay > a.firstDay ? o("calendar.v2.evUntilDay", "until {{day}}", { day: e(a.lastDay, s, "short") }) : o("calendar.v2.allDayLower", "all day")), [
42
+ function f(i, o, s) {
43
+ let c = e(r(i), s, "mid"), l = t(a(i), n(i), i.timeZone, s);
44
+ return i.allDay && (l = i.lastDay > i.firstDay ? o("calendar.v2.evUntilDay", "until {{day}}", { day: e(i.lastDay, s, "short") }) : o("calendar.v2.allDayLower", "all day")), [
45
45
  c,
46
46
  l,
47
- a.title.trim()
47
+ i.title.trim()
48
48
  ].filter(Boolean).join(" · ");
49
49
  }
50
- function f(e, t, n) {
50
+ function p(e, t, n) {
51
51
  return t ? n("calendar.v2.evViewTitle", "Event") : e ? n("calendar.v2.evEditTitle", "Edit event") : n("calendar.v2.newEvent", "New event");
52
52
  }
53
- function p(e, t, n, r) {
53
+ function m(e, t, n, r) {
54
54
  if (t?.isReadOnly) return r("calendar.v2.lockedFollowed", "It comes from {{calendar}}, a calendar you follow. Change it where it lives.", { calendar: t.name });
55
55
  let i = n ?? e.guests.find((e) => e.organizer)?.name ?? null;
56
56
  return i ? r("calendar.v2.lockedOrganiser", "Only {{name}}, the organiser, can change this event.", { name: i }) : r("calendar.v2.lockedOrganiserOnly", "Only the organiser can change this event.");
57
57
  }
58
- function m(e, t) {
58
+ function h(e, t) {
59
59
  let n = e.room;
60
60
  if (e.blocked) return {
61
61
  tone: "bad",
@@ -87,7 +87,7 @@ function m(e, t) {
87
87
  text: n ? `${r} · ${n.name}` : r
88
88
  };
89
89
  }
90
- function h(e) {
90
+ function g(e) {
91
91
  switch (e.status) {
92
92
  case "none": return null;
93
93
  case "loading": return "loading";
@@ -96,7 +96,10 @@ function h(e) {
96
96
  case "ready": return e.refresh === "current" ? null : e.refresh;
97
97
  }
98
98
  }
99
- function g(e, t) {
99
+ function _(e, t, n) {
100
+ return !e.partlySaved || t.status !== "ready" || t.refresh !== "current" ? e.initial : i(t.event, n);
101
+ }
102
+ function v(e, t) {
100
103
  return e === "loading" ? {
101
104
  tone: "info",
102
105
  text: t("calendar.v2.evReloading", "Reading the saved event…")
@@ -108,10 +111,10 @@ function g(e, t) {
108
111
  text: t("calendar.v2.evReloadFailed", "Couldn’t read the saved event.")
109
112
  };
110
113
  }
111
- function _(e, n, r, i) {
114
+ function y(e, n, r, i) {
112
115
  let a = new Date(Math.max(e.start, n.start.getTime())), o = new Date(Math.min(e.end, n.end.getTime()));
113
116
  return t(a, o, r, i);
114
117
  }
115
- export { s as TITLE_INPUT_ID, c as VIDEO_INPUT_ID, f as dialogHeading, m as footerNote, d as headerDescription, l as issueTarget, p as lockReason, _ as overlapWords, h as readBackOf, g as reloadNote, u as statusFrom };
118
+ export { c as TITLE_INPUT_ID, l as VIDEO_INPUT_ID, _ as baselineOf, p as dialogHeading, h as footerNote, f as headerDescription, u as issueTarget, m as lockReason, y as overlapWords, g as readBackOf, v as reloadNote, d as statusFrom };
116
119
 
117
120
  //# sourceMappingURL=dialogLogic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialogLogic.js","names":["TITLE_INPUT_ID","VIDEO_INPUT_ID","issueTarget","issues","statusFrom","answer","spans","personBusySpans","timeZone","exclude","event","span","busyDuring","truncated","headerDescription","day","formatDay","firstDayOf","form","format","when","formatInstantRange","startInstant","endInstant","tr","dialogHeading","readOnly","eventId","lockReason","calendar","name","organizerName","guest","footerNote","room","facts","guests","readBackOf","edited","reloadNote","readBack","overlapWords","from","to"],"sources":["../../../src/v2/event/dialogLogic.ts"],"sourcesContent":["/**\n * The event dialog's decisions that don't need React (BOFF-15698 A2): each person's time while\n * the event happens, where a problem is named, and the words of the header, the lock and the\n * footer. Pure.\n */\nimport type { Tr } from '../data/useEventActions';\nimport { formatDay, formatInstantRange, type CalendarFormat } from '../format';\nimport type { CalendarEventV2, CalendarV2, PersonFreeBusyV2 } from '../types';\nimport type { EventTab, PersonStatus } from './dialogModel';\nimport { endInstant, firstDayOf, startInstant, type EventForm, type FormIssues } from './eventForm';\nimport { busyDuring, personBusySpans } from './findTime';\nimport type { RoomState } from './place';\nimport type { EditedEvent } from './useEventData';\n\nexport const TITLE_INPUT_ID = 'calendar-event-title';\nexport const VIDEO_INPUT_ID = 'calendar-event-video';\n\n/** The tab where a problem is named, and the field to focus. */\nexport function issueTarget(issues: FormIssues): { tab: EventTab; field: string | null } | null {\n if (issues.title || issues.when || issues.repeat) {\n return { tab: 'details', field: issues.title ? TITLE_INPUT_ID : null };\n }\n if (issues.video) return { tab: 'place', field: VIDEO_INPUT_ID };\n return null;\n}\n\n/** What free/busy has said about one person so far. */\nexport type FreeBusyAnswer =\n { kind: 'loading' } | { kind: 'error' } | { kind: 'ready'; person: PersonFreeBusyV2 | undefined };\n\n/**\n * A person's time while the event happens. `exclude`: the event's own time, which keeps its\n * organiser and its guests busy and mustn't count against it. On an all-day event only time off\n * counts.\n */\nexport function statusFrom(\n answer: FreeBusyAnswer,\n event: { start: Date; end: Date; allDay: boolean },\n timeZone: string,\n exclude: { start: Date; end: Date } | null\n): PersonStatus {\n if (answer.kind === 'loading') return { kind: 'loading', span: null, truncated: false };\n if (answer.kind === 'error') return { kind: 'error', span: null, truncated: false };\n if (!answer.person) return { kind: 'free', span: null, truncated: false };\n const spans = personBusySpans(answer.person, timeZone, exclude).filter(\n (span) => !event.allDay || span.kind === 'away'\n );\n const span = busyDuring(spans, event.start, event.end);\n const truncated = answer.person.truncated;\n if (!span) return { kind: 'free', span: null, truncated };\n const kind = span.kind === 'away' ? 'away' : span.kind === 'tentative' ? 'tentative' : 'busy';\n return { kind, span, truncated };\n}\n\n/** \"Friday 20 Nov · 13:00 – 14:00 · Acme rollout check-in\". */\nexport function headerDescription(form: EventForm, tr: Tr, format: CalendarFormat): string {\n const day = formatDay(firstDayOf(form), format, 'mid');\n let when = formatInstantRange(startInstant(form), endInstant(form), form.timeZone, format);\n if (form.allDay) {\n when =\n form.lastDay > form.firstDay\n ? tr('calendar.v2.evUntilDay', 'until {{day}}', {\n day: formatDay(form.lastDay, format, 'short'),\n })\n : tr('calendar.v2.allDayLower', 'all day');\n }\n return [day, when, form.title.trim()].filter(Boolean).join(' · ');\n}\n\n/** The dialog's title: a new event, an edit (a new event that saved in part too), or a locked one. */\nexport function dialogHeading(eventId: string | null, readOnly: boolean, tr: Tr): string {\n if (readOnly) return tr('calendar.v2.evViewTitle', 'Event');\n return eventId\n ? tr('calendar.v2.evEditTitle', 'Edit event')\n : tr('calendar.v2.newEvent', 'New event');\n}\n\n/** Why the person can't change an event: a followed calendar, or someone else organises it. */\nexport function lockReason(\n event: Pick<CalendarEventV2, 'guests'>,\n calendar: Pick<CalendarV2, 'isReadOnly' | 'name'> | undefined,\n organizerName: string | null,\n tr: Tr\n): string {\n if (calendar?.isReadOnly) {\n return tr(\n 'calendar.v2.lockedFollowed',\n 'It comes from {{calendar}}, a calendar you follow. Change it where it lives.',\n { calendar: calendar.name }\n );\n }\n const name = organizerName ?? event.guests.find((guest) => guest.organizer)?.name ?? null;\n return name\n ? tr('calendar.v2.lockedOrganiser', 'Only {{name}}, the organiser, can change this event.', {\n name,\n })\n : tr('calendar.v2.lockedOrganiserOnly', 'Only the organiser can change this event.');\n}\n\nexport interface FooterNote {\n tone: 'info' | 'warn' | 'bad';\n text: string;\n}\n\nexport interface FooterFacts {\n /** A save was tried and something stops it. */\n blocked: boolean;\n /** No calendar to put a new event on. */\n noCalendar: boolean;\n title: string;\n room: { name: string; state: RoomState | null; needsApproval: boolean } | null;\n /** The person is busy or away then. */\n busy: boolean;\n guestCount: number;\n}\n\n/** The footer's note: what stops a save, else a warning, else the guests and the room. */\nexport function footerNote(facts: FooterFacts, tr: Tr): FooterNote {\n const room = facts.room;\n if (facts.blocked) {\n return {\n tone: 'bad',\n text: facts.noCalendar\n ? tr('calendar.v2.noWritableCalendar', 'You don’t have a calendar you can add events to.')\n : tr('calendar.v2.evFixToSave', 'Fix what’s marked to save.'),\n };\n }\n if (!facts.title) {\n return { tone: 'info', text: tr('calendar.v2.evAddTitleToSave', 'Add a title to save') };\n }\n if (room?.state?.kind === 'booked') {\n return {\n tone: 'warn',\n text: tr('calendar.v2.evRoomBookedThen', '{{room}} is booked then', { room: room.name }),\n };\n }\n if (room?.state?.kind === 'closed') {\n return {\n tone: 'warn',\n text: tr('calendar.v2.evRoomClosedThen', '{{room}} is closed', { room: room.name }),\n };\n }\n if (facts.busy)\n return { tone: 'warn', text: tr('calendar.v2.evYouBusyThen', 'You’re busy then') };\n if (room?.needsApproval) {\n return {\n tone: 'info',\n text: tr('calendar.v2.evRoomNeedsApproval', '{{room}} needs approval', { room: room.name }),\n };\n }\n const guests =\n facts.guestCount === 1\n ? tr('calendar.v2.evOneGuest', '1 guest')\n : tr('calendar.v2.evGuestCount', '{{count}} guests', { count: facts.guestCount });\n return { tone: 'info', text: room ? `${guests} · ${room.name}` : guests };\n}\n\n/**\n * Where reading the edited event back stands: null once the dialog holds it as the service has\n * it now; else reading it (first, or again after a save), it couldn't be read, or it is gone.\n * Nothing saves until it is null: a save planned on an older copy would send again what saved.\n */\nexport type ReadBack = 'loading' | 'failed' | 'missing';\n\nexport function readBackOf(\n edited:\n | { status: Exclude<EditedEvent['status'], 'ready'> }\n | { status: 'ready'; refresh: Extract<EditedEvent, { status: 'ready' }>['refresh'] }\n): ReadBack | null {\n switch (edited.status) {\n case 'none':\n return null;\n case 'loading':\n return 'loading';\n case 'missing':\n return 'missing';\n case 'error':\n return 'failed';\n case 'ready':\n return edited.refresh === 'current' ? null : edited.refresh;\n }\n}\n\n/** The footer while the edited event is read back: reading, or it can't be. */\nexport function reloadNote(readBack: ReadBack, tr: Tr): FooterNote {\n if (readBack === 'loading') {\n return { tone: 'info', text: tr('calendar.v2.evReloading', 'Reading the saved event…') };\n }\n return readBack === 'missing'\n ? { tone: 'bad', text: tr('calendar.v2.evSavedGoneShort', 'The event isn’t available.') }\n : { tone: 'bad', text: tr('calendar.v2.evReloadFailed', 'Couldn’t read the saved event.') };\n}\n\n/** The part of a busy span inside the event, on the calendar's clock: \"13:00 – 13:30\". */\nexport function overlapWords(\n span: { start: number; end: number },\n event: { start: Date; end: Date },\n timeZone: string,\n format: CalendarFormat\n): string {\n const from = new Date(Math.max(span.start, event.start.getTime()));\n const to = new Date(Math.min(span.end, event.end.getTime()));\n return formatInstantRange(from, to, timeZone, format);\n}\n"],"mappings":";;;;AAcA,IAAaA,IAAiB,wBACjBC,IAAiB;AAG9B,SAAgBC,EAAY,GAAoE;CAK9F,OAJIC,EAAO,SAASA,EAAO,QAAQA,EAAO,SACjC;EAAE,KAAK;EAAW,OAAOA,EAAO,QAAQH,IAAiB;CAAK,IAEnEG,EAAO,QAAc;EAAE,KAAK;EAAS,OAAOF;CAAe,IACxD;AACT;AAWA,SAAgBG,EACd,GACA,GACA,GACA,GACc;CACd,IAAIC,EAAO,SAAS,WAAW,OAAO;EAAE,MAAM;EAAW,MAAM;EAAM,WAAW;CAAM;CACtF,IAAIA,EAAO,SAAS,SAAS,OAAO;EAAE,MAAM;EAAS,MAAM;EAAM,WAAW;CAAM;CAClF,IAAI,CAACA,EAAO,QAAQ,OAAO;EAAE,MAAM;EAAQ,MAAM;EAAM,WAAW;CAAM;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EAAE,MAAM;EAAQ,MAAMhB,EAAG,2BAA2B,0BAA0B;CAAE,IAElFgB,MAAa,YAChB;EAAE,MAAM;EAAO,MAAMhB,EAAG,gCAAgC,4BAA4B;CAAE,IACtF;EAAE,MAAM;EAAO,MAAMA,EAAG,8BAA8B,gCAAgC;CAAE;AAC9F;AAGA,SAAgBiB,EACd,GACA,GACA,GACA,GACQ;CACR,IAAMC,IAAO,IAAI,KAAK,KAAK,IAAI/B,EAAK,OAAOD,EAAM,MAAM,QAAQ,CAAC,CAAC,GAC3DiC,IAAK,IAAI,KAAK,KAAK,IAAIhC,EAAK,KAAKD,EAAM,IAAI,QAAQ,CAAC,CAAC;CAC3D,OAAOW,EAAmBqB,GAAMC,GAAInC,GAAUW,CAAM;AACtD"}
1
+ {"version":3,"file":"dialogLogic.js","names":["TITLE_INPUT_ID","VIDEO_INPUT_ID","issueTarget","issues","statusFrom","answer","spans","personBusySpans","timeZone","exclude","event","span","busyDuring","truncated","headerDescription","day","formatDay","firstDayOf","form","format","when","formatInstantRange","startInstant","endInstant","tr","dialogHeading","readOnly","eventId","lockReason","calendar","name","organizerName","guest","footerNote","room","facts","guests","readBackOf","edited","baselineOf","session","formFromEvent","reloadNote","readBack","overlapWords","from","to"],"sources":["../../../src/v2/event/dialogLogic.ts"],"sourcesContent":["/**\n * The event dialog's decisions that don't need React (BOFF-15698 A2): each person's time while\n * the event happens, where a problem is named, and the words of the header, the lock and the\n * footer. Pure.\n */\nimport type { Tr } from '../data/useEventActions';\nimport { formatDay, formatInstantRange, type CalendarFormat } from '../format';\nimport type { CalendarEventV2, CalendarV2, PersonFreeBusyV2 } from '../types';\nimport type { EventTab, PersonStatus } from './dialogModel';\nimport {\n endInstant,\n firstDayOf,\n formFromEvent,\n startInstant,\n type EventForm,\n type FormIssues,\n} from './eventForm';\nimport { busyDuring, personBusySpans } from './findTime';\nimport type { RoomState } from './place';\nimport type { EditedEvent } from './useEventData';\n\nexport const TITLE_INPUT_ID = 'calendar-event-title';\nexport const VIDEO_INPUT_ID = 'calendar-event-video';\n\n/** The tab where a problem is named, and the field to focus. */\nexport function issueTarget(issues: FormIssues): { tab: EventTab; field: string | null } | null {\n if (issues.title || issues.when || issues.repeat) {\n return { tab: 'details', field: issues.title ? TITLE_INPUT_ID : null };\n }\n if (issues.video) return { tab: 'place', field: VIDEO_INPUT_ID };\n return null;\n}\n\n/** What free/busy has said about one person so far. */\nexport type FreeBusyAnswer =\n { kind: 'loading' } | { kind: 'error' } | { kind: 'ready'; person: PersonFreeBusyV2 | undefined };\n\n/**\n * A person's time while the event happens. `exclude`: the event's own time, which keeps its\n * organiser and its guests busy and mustn't count against it. On an all-day event only time off\n * counts.\n */\nexport function statusFrom(\n answer: FreeBusyAnswer,\n event: { start: Date; end: Date; allDay: boolean },\n timeZone: string,\n exclude: { start: Date; end: Date } | null\n): PersonStatus {\n if (answer.kind === 'loading') return { kind: 'loading', span: null, truncated: false };\n if (answer.kind === 'error') return { kind: 'error', span: null, truncated: false };\n if (!answer.person) return { kind: 'free', span: null, truncated: false };\n const spans = personBusySpans(answer.person, timeZone, exclude).filter(\n (span) => !event.allDay || span.kind === 'away'\n );\n const span = busyDuring(spans, event.start, event.end);\n const truncated = answer.person.truncated;\n if (!span) return { kind: 'free', span: null, truncated };\n const kind = span.kind === 'away' ? 'away' : span.kind === 'tentative' ? 'tentative' : 'busy';\n return { kind, span, truncated };\n}\n\n/** \"Friday 20 Nov · 13:00 – 14:00 · Acme rollout check-in\". */\nexport function headerDescription(form: EventForm, tr: Tr, format: CalendarFormat): string {\n const day = formatDay(firstDayOf(form), format, 'mid');\n let when = formatInstantRange(startInstant(form), endInstant(form), form.timeZone, format);\n if (form.allDay) {\n when =\n form.lastDay > form.firstDay\n ? tr('calendar.v2.evUntilDay', 'until {{day}}', {\n day: formatDay(form.lastDay, format, 'short'),\n })\n : tr('calendar.v2.allDayLower', 'all day');\n }\n return [day, when, form.title.trim()].filter(Boolean).join(' · ');\n}\n\n/** The dialog's title: a new event, an edit (a new event that saved in part too), or a locked one. */\nexport function dialogHeading(eventId: string | null, readOnly: boolean, tr: Tr): string {\n if (readOnly) return tr('calendar.v2.evViewTitle', 'Event');\n return eventId\n ? tr('calendar.v2.evEditTitle', 'Edit event')\n : tr('calendar.v2.newEvent', 'New event');\n}\n\n/** Why the person can't change an event: a followed calendar, or someone else organises it. */\nexport function lockReason(\n event: Pick<CalendarEventV2, 'guests'>,\n calendar: Pick<CalendarV2, 'isReadOnly' | 'name'> | undefined,\n organizerName: string | null,\n tr: Tr\n): string {\n if (calendar?.isReadOnly) {\n return tr(\n 'calendar.v2.lockedFollowed',\n 'It comes from {{calendar}}, a calendar you follow. Change it where it lives.',\n { calendar: calendar.name }\n );\n }\n const name = organizerName ?? event.guests.find((guest) => guest.organizer)?.name ?? null;\n return name\n ? tr('calendar.v2.lockedOrganiser', 'Only {{name}}, the organiser, can change this event.', {\n name,\n })\n : tr('calendar.v2.lockedOrganiserOnly', 'Only the organiser can change this event.');\n}\n\nexport interface FooterNote {\n tone: 'info' | 'warn' | 'bad';\n text: string;\n}\n\nexport interface FooterFacts {\n /** A save was tried and something stops it. */\n blocked: boolean;\n /** No calendar to put a new event on. */\n noCalendar: boolean;\n title: string;\n room: { name: string; state: RoomState | null; needsApproval: boolean } | null;\n /** The person is busy or away then. */\n busy: boolean;\n guestCount: number;\n}\n\n/** The footer's note: what stops a save, else a warning, else the guests and the room. */\nexport function footerNote(facts: FooterFacts, tr: Tr): FooterNote {\n const room = facts.room;\n if (facts.blocked) {\n return {\n tone: 'bad',\n text: facts.noCalendar\n ? tr('calendar.v2.noWritableCalendar', 'You don’t have a calendar you can add events to.')\n : tr('calendar.v2.evFixToSave', 'Fix what’s marked to save.'),\n };\n }\n if (!facts.title) {\n return { tone: 'info', text: tr('calendar.v2.evAddTitleToSave', 'Add a title to save') };\n }\n if (room?.state?.kind === 'booked') {\n return {\n tone: 'warn',\n text: tr('calendar.v2.evRoomBookedThen', '{{room}} is booked then', { room: room.name }),\n };\n }\n if (room?.state?.kind === 'closed') {\n return {\n tone: 'warn',\n text: tr('calendar.v2.evRoomClosedThen', '{{room}} is closed', { room: room.name }),\n };\n }\n if (facts.busy)\n return { tone: 'warn', text: tr('calendar.v2.evYouBusyThen', 'You’re busy then') };\n if (room?.needsApproval) {\n return {\n tone: 'info',\n text: tr('calendar.v2.evRoomNeedsApproval', '{{room}} needs approval', { room: room.name }),\n };\n }\n const guests =\n facts.guestCount === 1\n ? tr('calendar.v2.evOneGuest', '1 guest')\n : tr('calendar.v2.evGuestCount', '{{count}} guests', { count: facts.guestCount });\n return { tone: 'info', text: room ? `${guests} · ${room.name}` : guests };\n}\n\n/**\n * Where reading the edited event back stands: null once the dialog holds it as the service has\n * it now; else reading it (first, or again after a save), it couldn't be read, or it is gone.\n * Nothing saves until it is null: a save planned on an older copy would send again what saved.\n */\nexport type ReadBack = 'loading' | 'failed' | 'missing';\n\nexport function readBackOf(\n edited:\n | { status: Exclude<EditedEvent['status'], 'ready'> }\n | { status: 'ready'; refresh: Extract<EditedEvent, { status: 'ready' }>['refresh'] }\n): ReadBack | null {\n switch (edited.status) {\n case 'none':\n return null;\n case 'loading':\n return 'loading';\n case 'missing':\n return 'missing';\n case 'error':\n return 'failed';\n case 'ready':\n return edited.refresh === 'current' ? null : edited.refresh;\n }\n}\n\n/**\n * What the person's changes are told from (A4): the form as the dialog opened, or once a save\n * stopped part way (`partlySaved`), the event as read back, which holds what saved. Told from\n * the form as it opened, Save again would move a series (or the later part of one) a second\n * time, and take a repeat or room that didn't save for one that did.\n */\nexport function baselineOf(\n session: { initial: EventForm; partlySaved: boolean },\n edited: EditedEvent,\n timeZone: string\n): EventForm {\n if (!session.partlySaved || edited.status !== 'ready' || edited.refresh !== 'current') {\n return session.initial;\n }\n return formFromEvent(edited.event, timeZone);\n}\n\n/** The footer while the edited event is read back: reading, or it can't be. */\nexport function reloadNote(readBack: ReadBack, tr: Tr): FooterNote {\n if (readBack === 'loading') {\n return { tone: 'info', text: tr('calendar.v2.evReloading', 'Reading the saved event…') };\n }\n return readBack === 'missing'\n ? { tone: 'bad', text: tr('calendar.v2.evSavedGoneShort', 'The event isn’t available.') }\n : { tone: 'bad', text: tr('calendar.v2.evReloadFailed', 'Couldn’t read the saved event.') };\n}\n\n/** The part of a busy span inside the event, on the calendar's clock: \"13:00 – 13:30\". */\nexport function overlapWords(\n span: { start: number; end: number },\n event: { start: Date; end: Date },\n timeZone: string,\n format: CalendarFormat\n): string {\n const from = new Date(Math.max(span.start, event.start.getTime()));\n const to = new Date(Math.min(span.end, event.end.getTime()));\n return formatInstantRange(from, to, timeZone, format);\n}\n"],"mappings":";;;;AAqBA,IAAaA,IAAiB,wBACjBC,IAAiB;AAG9B,SAAgBC,EAAY,GAAoE;CAK9F,OAJIC,EAAO,SAASA,EAAO,QAAQA,EAAO,SACjC;EAAE,KAAK;EAAW,OAAOA,EAAO,QAAQH,IAAiB;CAAK,IAEnEG,EAAO,QAAc;EAAE,KAAK;EAAS,OAAOF;CAAe,IACxD;AACT;AAWA,SAAgBG,EACd,GACA,GACA,GACA,GACc;CACd,IAAIC,EAAO,SAAS,WAAW,OAAO;EAAE,MAAM;EAAW,MAAM;EAAM,WAAW;CAAM;CACtF,IAAIA,EAAO,SAAS,SAAS,OAAO;EAAE,MAAM;EAAS,MAAM;EAAM,WAAW;CAAM;CAClF,IAAI,CAACA,EAAO,QAAQ,OAAO;EAAE,MAAM;EAAQ,MAAM;EAAM,WAAW;CAAM;CACxE,IAAMC,IAAQC,EAAgBF,EAAO,QAAQG,GAAUC,CAAO,CAAC,CAAC,QAC7D,MAAS,CAACC,EAAM,UAAUC,EAAK,SAAS,MAC3C,GACMA,IAAOC,EAAWN,GAAOI,EAAM,OAAOA,EAAM,GAAG,GAC/CG,IAAYR,EAAO,OAAO;CAGhC,OAFKM,IAEE;EAAE,MADIA,EAAK,SAAS,SAAS,SAASA,EAAK,SAAS,cAAc,cAAc;EACxE;EAAM;CAAU,IAFb;EAAE,MAAM;EAAQ,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G,8BAA8B,gCAAgC;CAAE;AAC9F;AAGA,SAAgBoB,EACd,GACA,GACA,GACA,GACQ;CACR,IAAMC,IAAO,IAAI,KAAK,KAAK,IAAIlC,EAAK,OAAOD,EAAM,MAAM,QAAQ,CAAC,CAAC,GAC3DoC,IAAK,IAAI,KAAK,KAAK,IAAInC,EAAK,KAAKD,EAAM,IAAI,QAAQ,CAAC,CAAC;CAC3D,OAAOW,EAAmBwB,GAAMC,GAAItC,GAAUW,CAAM;AACtD"}
@@ -1,6 +1,7 @@
1
1
  import { CalendarEventV2 } from '../types';
2
2
  import { EventForm, FormIssues, GuestDraft } from './eventForm';
3
3
  import { BusySpan } from './findTime';
4
+ import { ScopeChoice } from './savePlan';
4
5
  import { Identities, RoomsForEvent } from './useEventData';
5
6
  export type EventTab = 'details' | 'people' | 'place' | 'more';
6
7
  export declare const EVENT_TABS: readonly EventTab[];
@@ -45,4 +46,6 @@ export interface EventDialogModel {
45
46
  * else they would be left out of what is saved.
46
47
  */
47
48
  guestsPending: (pending: boolean) => void;
49
+ /** A date of a repeating event (A4): which events the save changes; null otherwise. */
50
+ scope: ScopeChoice | null;
48
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dialogModel.js","names":["EVENT_TABS","isEventTab","tab","value"],"sources":["../../../src/v2/event/dialogModel.ts"],"sourcesContent":["/**\n * What the event dialog's tabs share (BOFF-15698 A2): the form and how to change it, the event\n * being edited, what stops a save, and what the dialog has read about people and rooms.\n */\nimport type { CalendarEventV2 } from '../types';\nimport type { EventForm, FormIssues, GuestDraft } from './eventForm';\nimport type { BusySpan } from './findTime';\nimport type { Identities, RoomsForEvent } from './useEventData';\n\nexport type EventTab = 'details' | 'people' | 'place' | 'more';\n\nexport const EVENT_TABS: readonly EventTab[] = ['details', 'people', 'place', 'more'];\n\nexport function isEventTab(value: unknown): value is EventTab {\n return EVENT_TABS.some((tab) => tab === value);\n}\n\n/** Someone's time while the event happens. */\nexport interface PersonStatus {\n /**\n * From free/busy: free, busy, a maybe (`tentative`) or time off (`away`). `noFreeBusy`:\n * someone outside the workspace (an email address, a former member), who can't be asked.\n */\n kind: 'free' | 'busy' | 'tentative' | 'away' | 'noFreeBusy' | 'loading' | 'error';\n /** The busy time that overlaps the event. */\n span: BusySpan | null;\n /** Some of their busy time may be missing (the service stopped at one of its limits). */\n truncated: boolean;\n}\n\nexport interface EventDialogModel {\n form: EventForm;\n update: (change: (form: EventForm) => EventForm) => void;\n /** Someone else's event, or one on a calendar followed by link: shown, never changed. */\n readOnly: boolean;\n /** The event being edited, as the service last returned it; null for a new event. */\n event: CalendarEventV2 | null;\n issues: FormIssues;\n /** Problems are named once a save has been tried. */\n showIssues: boolean;\n /** The event's instants, from the form. */\n start: Date;\n end: Date;\n /** The person's own time then. */\n me: PersonStatus;\n guestStatus: (guest: GuestDraft) => PersonStatus;\n retryFreeBusy: () => void;\n identities: Identities;\n /** A guest's name: theirs from the workspace, else the one on the event, else the address. */\n guestName: (guest: GuestDraft) => string;\n rooms: RoomsForEvent;\n /** Find a time, with what the dialog holds. */\n openFindTime: () => void;\n /**\n * A team's members are being looked up to be added (or that ended): saving waits meanwhile,\n * else they would be left out of what is saved.\n */\n guestsPending: (pending: boolean) => void;\n}\n"],"mappings":";AAWA,IAAaA,IAAkC;CAAC;CAAW;CAAU;CAAS;AAAM;AAEpF,SAAgBC,EAAW,GAAmC;CAC5D,OAAOD,EAAW,MAAM,MAAQE,MAAQC,CAAK;AAC/C"}
1
+ {"version":3,"file":"dialogModel.js","names":["EVENT_TABS","isEventTab","tab","value"],"sources":["../../../src/v2/event/dialogModel.ts"],"sourcesContent":["/**\n * What the event dialog's tabs share (BOFF-15698 A2): the form and how to change it, the event\n * being edited, what stops a save, and what the dialog has read about people and rooms.\n */\nimport type { CalendarEventV2 } from '../types';\nimport type { EventForm, FormIssues, GuestDraft } from './eventForm';\nimport type { BusySpan } from './findTime';\nimport type { ScopeChoice } from './savePlan';\nimport type { Identities, RoomsForEvent } from './useEventData';\n\nexport type EventTab = 'details' | 'people' | 'place' | 'more';\n\nexport const EVENT_TABS: readonly EventTab[] = ['details', 'people', 'place', 'more'];\n\nexport function isEventTab(value: unknown): value is EventTab {\n return EVENT_TABS.some((tab) => tab === value);\n}\n\n/** Someone's time while the event happens. */\nexport interface PersonStatus {\n /**\n * From free/busy: free, busy, a maybe (`tentative`) or time off (`away`). `noFreeBusy`:\n * someone outside the workspace (an email address, a former member), who can't be asked.\n */\n kind: 'free' | 'busy' | 'tentative' | 'away' | 'noFreeBusy' | 'loading' | 'error';\n /** The busy time that overlaps the event. */\n span: BusySpan | null;\n /** Some of their busy time may be missing (the service stopped at one of its limits). */\n truncated: boolean;\n}\n\nexport interface EventDialogModel {\n form: EventForm;\n update: (change: (form: EventForm) => EventForm) => void;\n /** Someone else's event, or one on a calendar followed by link: shown, never changed. */\n readOnly: boolean;\n /** The event being edited, as the service last returned it; null for a new event. */\n event: CalendarEventV2 | null;\n issues: FormIssues;\n /** Problems are named once a save has been tried. */\n showIssues: boolean;\n /** The event's instants, from the form. */\n start: Date;\n end: Date;\n /** The person's own time then. */\n me: PersonStatus;\n guestStatus: (guest: GuestDraft) => PersonStatus;\n retryFreeBusy: () => void;\n identities: Identities;\n /** A guest's name: theirs from the workspace, else the one on the event, else the address. */\n guestName: (guest: GuestDraft) => string;\n rooms: RoomsForEvent;\n /** Find a time, with what the dialog holds. */\n openFindTime: () => void;\n /**\n * A team's members are being looked up to be added (or that ended): saving waits meanwhile,\n * else they would be left out of what is saved.\n */\n guestsPending: (pending: boolean) => void;\n /** A date of a repeating event (A4): which events the save changes; null otherwise. */\n scope: ScopeChoice | null;\n}\n"],"mappings":";AAYA,IAAaA,IAAkC;CAAC;CAAW;CAAU;CAAS;AAAM;AAEpF,SAAgBC,EAAW,GAAmC;CAC5D,OAAOD,EAAW,MAAM,MAAQE,MAAQC,CAAK;AAC/C"}
@@ -57,6 +57,8 @@ export interface EventForm {
57
57
  address: string;
58
58
  calendarId: string | null;
59
59
  visibility: EventVisibilityV2;
60
+ /** "Show me as": busy (true), or free (the time stays open in free/busy and Find a time). */
61
+ busy: boolean;
60
62
  reminders: ReminderDraft[];
61
63
  }
62
64
  /** What a new event starts with besides its draft. */
@@ -196,6 +198,30 @@ export declare function newEventForm(draft: CalendarV2EventDraft | null, default
196
198
  * calendar's clock (Find a time's "Use this time" on a repeating event).
197
199
  */
198
200
  export declare function formFromEvent(event: CalendarEventV2, calendarTimeZone: string, draft?: CalendarV2EventDraft | null): EventForm;
201
+ /** The two forms hold the same times: days, instants, zone and all day. */
202
+ export declare function sameTimes(a: EventForm, b: EventForm): boolean;
203
+ /**
204
+ * The form for an event of its own made from it (a date of a series changed on its own, or the
205
+ * later part of a split series): its guests and reminders are new to that event, so saving adds
206
+ * each of them there rather than reading them as already its own.
207
+ */
208
+ export declare function detachedForm(form: EventForm): EventForm;
209
+ /**
210
+ * The form for a change to every event of a series, made on one of its dates (`initial` is the
211
+ * form as that date opened): on the series' own first date (`series`, the series as stored).
212
+ * What the person changed at the date (its time of day, length, zone, all day, a move of some
213
+ * days, the repeat) moves the series the same way; what they didn't change keeps the series'
214
+ * own, to the instant. Everything else (title, people, place …) is the form's.
215
+ */
216
+ export declare function seriesFormOf(form: EventForm, initial: EventForm, series: CalendarEventV2, calendarTimeZone: string): EventForm;
217
+ /**
218
+ * Where a series' cancelled dates land once its times change (A4), as `before` → `after` (the
219
+ * series' form before and after the change). The service keeps a cancelled date as the instant
220
+ * it was cancelled at, and a series whose start moved would bring it back: each keeps its day
221
+ * (moved by the days the series moved), at the series' new time of day, or as a whole day for
222
+ * an all-day series. `from`: only the dates at or after this instant (a split's date).
223
+ */
224
+ export declare function movedCancellations(cancelled: readonly Date[], before: EventForm, after: EventForm, from?: Date | null): Date[];
199
225
  export interface FormIssues {
200
226
  title?: 'missing';
201
227
  when?: 'endBeforeStart';