@burdenoff/microfe-calendar 2026.1123.3 → 2026.1124.2

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 (251) hide show
  1. package/dist/components/AgendaView.js.map +1 -1
  2. package/dist/generated/wspace-operations.d.ts +785 -0
  3. package/dist/generated/wspace-operations.js +250 -84
  4. package/dist/generated/wspace-operations.js.map +1 -1
  5. package/dist/generated/wspace-types.d.ts +1243 -10
  6. package/dist/hooks/useSafePermissions.js.map +1 -1
  7. package/dist/index.d.ts +1 -0
  8. package/dist/providers/CalendarProvider.d.ts +3 -1
  9. package/dist/providers/CalendarProvider.js +12 -10
  10. package/dist/providers/CalendarProvider.js.map +1 -1
  11. package/dist/translations/en.d.ts +351 -0
  12. package/dist/types/index.d.ts +9 -0
  13. package/dist/v2/CalendarPageV2.js +92 -14
  14. package/dist/v2/CalendarPageV2.js.map +1 -1
  15. package/dist/v2/colors.d.ts +23 -0
  16. package/dist/v2/colors.js +92 -0
  17. package/dist/v2/colors.js.map +1 -0
  18. package/dist/v2/data/enums.d.ts +6 -0
  19. package/dist/v2/data/enums.js +10 -0
  20. package/dist/v2/data/enums.js.map +1 -0
  21. package/dist/v2/data/errors.d.ts +4 -0
  22. package/dist/v2/data/errors.js +17 -0
  23. package/dist/v2/data/errors.js.map +1 -0
  24. package/dist/v2/data/invalidation.js +19 -0
  25. package/dist/v2/data/invalidation.js.map +1 -0
  26. package/dist/v2/data/normalize.js +181 -16
  27. package/dist/v2/data/normalize.js.map +1 -1
  28. package/dist/v2/data/serialWrites.d.ts +17 -0
  29. package/dist/v2/data/serialWrites.js +21 -0
  30. package/dist/v2/data/serialWrites.js.map +1 -0
  31. package/dist/v2/data/useCalendarsV2.d.ts +10 -1
  32. package/dist/v2/data/useCalendarsV2.js +68 -16
  33. package/dist/v2/data/useCalendarsV2.js.map +1 -1
  34. package/dist/v2/data/useEventActions.d.ts +49 -0
  35. package/dist/v2/data/useEventActions.js +399 -0
  36. package/dist/v2/data/useEventActions.js.map +1 -0
  37. package/dist/v2/data/useEventForPeek.d.ts +17 -0
  38. package/dist/v2/data/useEventForPeek.js +29 -0
  39. package/dist/v2/data/useEventForPeek.js.map +1 -0
  40. package/dist/v2/data/useEventSearchV2.d.ts +15 -0
  41. package/dist/v2/data/useEventSearchV2.js +80 -0
  42. package/dist/v2/data/useEventSearchV2.js.map +1 -0
  43. package/dist/v2/data/useEventsInRangeV2.js +78 -0
  44. package/dist/v2/data/useEventsInRangeV2.js.map +1 -0
  45. package/dist/v2/data/useFreeBusy.d.ts +5 -0
  46. package/dist/v2/data/useFreeBusy.js +83 -0
  47. package/dist/v2/data/useFreeBusy.js.map +1 -0
  48. package/dist/v2/data/useKeyedLoad.js +47 -0
  49. package/dist/v2/data/useKeyedLoad.js.map +1 -0
  50. package/dist/v2/data/useRoomsV2.d.ts +28 -0
  51. package/dist/v2/data/useRoomsV2.js +45 -0
  52. package/dist/v2/data/useRoomsV2.js.map +1 -0
  53. package/dist/v2/day/DayPanel.d.ts +6 -0
  54. package/dist/v2/day/DayPanel.js +215 -0
  55. package/dist/v2/day/DayPanel.js.map +1 -0
  56. package/dist/v2/day/daySummary.d.ts +37 -0
  57. package/dist/v2/day/daySummary.js +37 -0
  58. package/dist/v2/day/daySummary.js.map +1 -0
  59. package/dist/v2/dialogs/CalendarDialogsV2.d.ts +1 -0
  60. package/dist/v2/dialogs/CalendarDialogsV2.js +17 -0
  61. package/dist/v2/dialogs/CalendarDialogsV2.js.map +1 -0
  62. package/dist/v2/dialogs/ShortcutsDialog.d.ts +4 -0
  63. package/dist/v2/dialogs/ShortcutsDialog.js +42 -0
  64. package/dist/v2/dialogs/ShortcutsDialog.js.map +1 -0
  65. package/dist/v2/events/eventLook.d.ts +46 -0
  66. package/dist/v2/events/eventLook.js +35 -0
  67. package/dist/v2/events/eventLook.js.map +1 -0
  68. package/dist/v2/events/eventModel.d.ts +92 -0
  69. package/dist/v2/events/eventModel.js +116 -0
  70. package/dist/v2/events/eventModel.js.map +1 -0
  71. package/dist/v2/events/localChanges.d.ts +4 -0
  72. package/dist/v2/events/localChanges.js +23 -0
  73. package/dist/v2/events/localChanges.js.map +1 -0
  74. package/dist/v2/format.d.ts +67 -0
  75. package/dist/v2/format.js +112 -0
  76. package/dist/v2/format.js.map +1 -0
  77. package/dist/v2/grid/AllDayRow.d.ts +20 -0
  78. package/dist/v2/grid/AllDayRow.js +94 -0
  79. package/dist/v2/grid/AllDayRow.js.map +1 -0
  80. package/dist/v2/grid/EventBlock.d.ts +21 -0
  81. package/dist/v2/grid/EventBlock.js +112 -0
  82. package/dist/v2/grid/EventBlock.js.map +1 -0
  83. package/dist/v2/grid/GridParts.d.ts +40 -0
  84. package/dist/v2/grid/GridParts.js +210 -0
  85. package/dist/v2/grid/GridParts.js.map +1 -0
  86. package/dist/v2/grid/QuickCreate.d.ts +1 -0
  87. package/dist/v2/grid/QuickCreate.js +175 -0
  88. package/dist/v2/grid/QuickCreate.js.map +1 -0
  89. package/dist/v2/grid/TimeGrid.d.ts +1 -0
  90. package/dist/v2/grid/TimeGrid.js +188 -0
  91. package/dist/v2/grid/TimeGrid.js.map +1 -0
  92. package/dist/v2/grid/geometry.d.ts +72 -0
  93. package/dist/v2/grid/geometry.js +85 -0
  94. package/dist/v2/grid/geometry.js.map +1 -0
  95. package/dist/v2/grid/layout.d.ts +24 -0
  96. package/dist/v2/grid/layout.js +77 -0
  97. package/dist/v2/grid/layout.js.map +1 -0
  98. package/dist/v2/grid/useGridDrag.d.ts +42 -0
  99. package/dist/v2/grid/useGridDrag.js +181 -0
  100. package/dist/v2/grid/useGridDrag.js.map +1 -0
  101. package/dist/v2/grid/useSlotCursor.d.ts +32 -0
  102. package/dist/v2/grid/useSlotCursor.js +57 -0
  103. package/dist/v2/grid/useSlotCursor.js.map +1 -0
  104. package/dist/v2/grid/workingHours.d.ts +21 -0
  105. package/dist/v2/grid/workingHours.js +101 -0
  106. package/dist/v2/grid/workingHours.js.map +1 -0
  107. package/dist/v2/hooks/useAvailableHeight.d.ts +2 -0
  108. package/dist/v2/hooks/useAvailableHeight.js +25 -0
  109. package/dist/v2/hooks/useAvailableHeight.js.map +1 -0
  110. package/dist/v2/hooks/useCalendarShortcuts.d.ts +9 -0
  111. package/dist/v2/hooks/useCalendarShortcuts.js +60 -0
  112. package/dist/v2/hooks/useCalendarShortcuts.js.map +1 -0
  113. package/dist/v2/hooks/useDebouncedValue.d.ts +1 -0
  114. package/dist/v2/hooks/useDebouncedValue.js +12 -0
  115. package/dist/v2/hooks/useDebouncedValue.js.map +1 -0
  116. package/dist/v2/hooks/useMediaQuery.d.ts +5 -0
  117. package/dist/v2/hooks/useMediaQuery.js +17 -0
  118. package/dist/v2/hooks/useMediaQuery.js.map +1 -0
  119. package/dist/v2/hooks/useNow.d.ts +2 -0
  120. package/dist/v2/hooks/useNow.js +31 -0
  121. package/dist/v2/hooks/useNow.js.map +1 -0
  122. package/dist/v2/limits.d.ts +6 -0
  123. package/dist/v2/limits.js +5 -0
  124. package/dist/v2/limits.js.map +1 -0
  125. package/dist/v2/list/EventListRow.d.ts +10 -0
  126. package/dist/v2/list/EventListRow.js +109 -0
  127. package/dist/v2/list/EventListRow.js.map +1 -0
  128. package/dist/v2/list/ListViewV2.d.ts +16 -0
  129. package/dist/v2/list/ListViewV2.js +96 -0
  130. package/dist/v2/list/ListViewV2.js.map +1 -0
  131. package/dist/v2/month/MonthView.d.ts +1 -0
  132. package/dist/v2/month/MonthView.js +328 -0
  133. package/dist/v2/month/MonthView.js.map +1 -0
  134. package/dist/v2/month/monthLayout.d.ts +39 -0
  135. package/dist/v2/month/monthLayout.js +29 -0
  136. package/dist/v2/month/monthLayout.js.map +1 -0
  137. package/dist/v2/page/CalendarChrome.d.ts +2 -0
  138. package/dist/v2/page/CalendarChrome.js +295 -0
  139. package/dist/v2/page/CalendarChrome.js.map +1 -0
  140. package/dist/v2/page/CalendarPageContext.d.ts +92 -0
  141. package/dist/v2/page/CalendarPageContext.js +11 -0
  142. package/dist/v2/page/CalendarPageContext.js.map +1 -0
  143. package/dist/v2/page/pageHelpers.d.ts +19 -0
  144. package/dist/v2/page/pageHelpers.js +39 -0
  145. package/dist/v2/page/pageHelpers.js.map +1 -0
  146. package/dist/v2/page/useCalendarPageModel.d.ts +2 -0
  147. package/dist/v2/page/useCalendarPageModel.js +198 -0
  148. package/dist/v2/page/useCalendarPageModel.js.map +1 -0
  149. package/dist/v2/page/viewState.d.ts +70 -0
  150. package/dist/v2/page/viewState.js +47 -0
  151. package/dist/v2/page/viewState.js.map +1 -0
  152. package/dist/v2/peek/EventPeek.d.ts +2 -0
  153. package/dist/v2/peek/EventPeek.js +92 -0
  154. package/dist/v2/peek/EventPeek.js.map +1 -0
  155. package/dist/v2/peek/PeekEvent.d.ts +4 -0
  156. package/dist/v2/peek/PeekEvent.js +443 -0
  157. package/dist/v2/peek/PeekEvent.js.map +1 -0
  158. package/dist/v2/peek/PeekParts.d.ts +14 -0
  159. package/dist/v2/peek/PeekParts.js +75 -0
  160. package/dist/v2/peek/PeekParts.js.map +1 -0
  161. package/dist/v2/prefs/calendarPrefs.d.ts +2 -2
  162. package/dist/v2/prefs/calendarPrefs.js +35 -34
  163. package/dist/v2/prefs/calendarPrefs.js.map +1 -1
  164. package/dist/v2/rail/CalendarRail.d.ts +3 -0
  165. package/dist/v2/rail/CalendarRail.js +258 -0
  166. package/dist/v2/rail/CalendarRail.js.map +1 -0
  167. package/dist/v2/rail/railStatus.d.ts +54 -0
  168. package/dist/v2/rail/railStatus.js +84 -0
  169. package/dist/v2/rail/railStatus.js.map +1 -0
  170. package/dist/v2/rail/syncWords.d.ts +10 -0
  171. package/dist/v2/rail/syncWords.js +75 -0
  172. package/dist/v2/rail/syncWords.js.map +1 -0
  173. package/dist/v2/rail/useMonthEventDates.d.ts +4 -0
  174. package/dist/v2/rail/useMonthEventDates.js +30 -0
  175. package/dist/v2/rail/useMonthEventDates.js.map +1 -0
  176. package/dist/v2/routes.js +4 -1
  177. package/dist/v2/routes.js.map +1 -1
  178. package/dist/v2/runs/RunPeek.d.ts +2 -0
  179. package/dist/v2/runs/RunPeek.js +382 -0
  180. package/dist/v2/runs/RunPeek.js.map +1 -0
  181. package/dist/v2/runs/RunPills.d.ts +28 -0
  182. package/dist/v2/runs/RunPills.js +179 -0
  183. package/dist/v2/runs/RunPills.js.map +1 -0
  184. package/dist/v2/runs/RunRows.d.ts +21 -0
  185. package/dist/v2/runs/RunRows.js +140 -0
  186. package/dist/v2/runs/RunRows.js.map +1 -0
  187. package/dist/v2/runs/RunsNotices.d.ts +1 -0
  188. package/dist/v2/runs/RunsNotices.js +37 -0
  189. package/dist/v2/runs/RunsNotices.js.map +1 -0
  190. package/dist/v2/runs/RunsSwitch.d.ts +1 -0
  191. package/dist/v2/runs/RunsSwitch.js +54 -0
  192. package/dist/v2/runs/RunsSwitch.js.map +1 -0
  193. package/dist/v2/runs/WorkflowRunsLayer.d.ts +4 -0
  194. package/dist/v2/runs/WorkflowRunsLayer.js +82 -0
  195. package/dist/v2/runs/WorkflowRunsLayer.js.map +1 -0
  196. package/dist/v2/runs/runAccess.d.ts +37 -0
  197. package/dist/v2/runs/runAccess.js +14 -0
  198. package/dist/v2/runs/runAccess.js.map +1 -0
  199. package/dist/v2/runs/runLayout.d.ts +76 -0
  200. package/dist/v2/runs/runLayout.js +129 -0
  201. package/dist/v2/runs/runLayout.js.map +1 -0
  202. package/dist/v2/runs/runLinks.d.ts +32 -0
  203. package/dist/v2/runs/runLinks.js +50 -0
  204. package/dist/v2/runs/runLinks.js.map +1 -0
  205. package/dist/v2/runs/runModel.d.ts +97 -0
  206. package/dist/v2/runs/runModel.js +132 -0
  207. package/dist/v2/runs/runModel.js.map +1 -0
  208. package/dist/v2/runs/runPeekState.d.ts +53 -0
  209. package/dist/v2/runs/runPeekState.js +62 -0
  210. package/dist/v2/runs/runPeekState.js.map +1 -0
  211. package/dist/v2/runs/runTypes.d.ts +60 -0
  212. package/dist/v2/runs/runWords.d.ts +23 -0
  213. package/dist/v2/runs/runWords.js +83 -0
  214. package/dist/v2/runs/runWords.js.map +1 -0
  215. package/dist/v2/runs/runsLayerContext.d.ts +26 -0
  216. package/dist/v2/runs/runsLayerContext.js +33 -0
  217. package/dist/v2/runs/runsLayerContext.js.map +1 -0
  218. package/dist/v2/runs/useRunHrefs.d.ts +10 -0
  219. package/dist/v2/runs/useRunHrefs.js +60 -0
  220. package/dist/v2/runs/useRunHrefs.js.map +1 -0
  221. package/dist/v2/runs/useRunLabels.d.ts +6 -0
  222. package/dist/v2/runs/useRunLabels.js +27 -0
  223. package/dist/v2/runs/useRunLabels.js.map +1 -0
  224. package/dist/v2/runs/useRunsAccess.d.ts +2 -0
  225. package/dist/v2/runs/useRunsAccess.js +14 -0
  226. package/dist/v2/runs/useRunsAccess.js.map +1 -0
  227. package/dist/v2/runs/useWorkflowRuns.d.ts +61 -0
  228. package/dist/v2/runs/useWorkflowRuns.js +119 -0
  229. package/dist/v2/runs/useWorkflowRuns.js.map +1 -0
  230. package/dist/v2/search/SearchResults.d.ts +1 -0
  231. package/dist/v2/search/SearchResults.js +88 -0
  232. package/dist/v2/search/SearchResults.js.map +1 -0
  233. package/dist/v2/search/searchModel.d.ts +20 -0
  234. package/dist/v2/search/searchModel.js +22 -0
  235. package/dist/v2/search/searchModel.js.map +1 -0
  236. package/dist/v2/state/calendarV2Store.d.ts +4 -1
  237. package/dist/v2/state/calendarV2Store.js +3 -1
  238. package/dist/v2/state/calendarV2Store.js.map +1 -1
  239. package/dist/v2/state/useCalendarV2Navigation.d.ts +1 -0
  240. package/dist/v2/state/useCalendarV2Navigation.js +4 -1
  241. package/dist/v2/state/useCalendarV2Navigation.js.map +1 -1
  242. package/dist/v2/states/CalendarStates.d.ts +18 -0
  243. package/dist/v2/states/CalendarStates.js +122 -0
  244. package/dist/v2/states/CalendarStates.js.map +1 -0
  245. package/dist/v2/styles.d.ts +32 -0
  246. package/dist/v2/styles.js +10 -0
  247. package/dist/v2/styles.js.map +1 -0
  248. package/dist/v2/time/calendarTime.js +121 -35
  249. package/dist/v2/time/calendarTime.js.map +1 -1
  250. package/dist/v2/types.d.ts +22 -2
  251. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRoomsV2.js","names":["toRoomV2","place","raw","part","start","parseInstant","booking","end","useRoomsV2","useQuery","CalendarV2RoomsDocument","options","useMemo","data","room","a","b","error"],"sources":["../../../src/v2/data/useRoomsV2.ts"],"sourcesContent":["/**\n * The workspace's rooms (BOFF-15698 A1), for the rail and the Day panel: each with its coming\n * bookings, to say \"Busy until 11:00\" or \"Free until 14:00\". The service returns a room's next\n * five bookings that are approved or waiting for approval.\n */\nimport { useMemo } from 'react';\nimport { useQuery } from '@apollo/client/react';\nimport {\n CalendarV2RoomsDocument,\n type CalendarV2RoomsQuery,\n type CalendarV2RoomsQueryVariables,\n} from '../../generated/wspace-operations';\nimport { parseInstant } from './normalize';\n\nexport interface RoomV2 {\n id: string;\n name: string;\n /** \"Floor 2 · North wing\": where it is, from the parts the room has. */\n place: string | null;\n capacity: number | null;\n /** Open for bookings (a paused room is closed). */\n bookable: boolean;\n needsApproval: boolean;\n bookings: { id: string; start: Date; end: Date; pending: boolean }[];\n}\n\nexport interface RoomsV2 {\n rooms: RoomV2[];\n status: 'loading' | 'ready' | 'error';\n refetch: () => void;\n}\n\ntype RawRoom = CalendarV2RoomsQuery['getCalendarResources'][number];\n\nexport function toRoomV2(raw: RawRoom): RoomV2 {\n const place = [raw.location, raw.building, raw.floor]\n .map((part) => part?.trim())\n .filter((part): part is string => Boolean(part));\n return {\n id: raw.id,\n name: raw.name,\n place: place.length > 0 ? [...new Set(place)].join(' · ') : null,\n capacity: raw.capacity ?? null,\n bookable: raw.isBookable,\n needsApproval: raw.requireApproval,\n bookings: raw.bookings.flatMap((booking) => {\n const start = parseInstant(booking.startTime);\n const end = parseInstant(booking.endTime);\n if (!start || !end || booking.status === 'CANCELLED' || booking.status === 'REJECTED')\n return [];\n return [{ id: booking.id, start, end, pending: booking.status === 'PENDING' }];\n }),\n };\n}\n\nexport function useRoomsV2(options: { skip?: boolean } = {}): RoomsV2 {\n const { data, error, refetch } = useQuery<CalendarV2RoomsQuery, CalendarV2RoomsQueryVariables>(\n CalendarV2RoomsDocument,\n { fetchPolicy: 'cache-and-network', skip: options.skip }\n );\n const rooms = useMemo(\n () =>\n (data?.getCalendarResources ?? [])\n .filter((room) => room.isActive)\n .map(toRoomV2)\n .sort((a, b) => a.name.localeCompare(b.name)),\n [data]\n );\n return {\n rooms,\n status: data ? 'ready' : error ? 'error' : 'loading',\n refetch: () => {\n refetch().catch(() => undefined);\n },\n };\n}\n"],"mappings":";;;;;AAkCA,SAAgBA,EAAS,GAAsB;CAC7C,IAAMC,IAAQ;EAACC,EAAI;EAAUA,EAAI;EAAUA,EAAI;CAAK,CAAC,CAClD,KAAK,MAASC,GAAM,KAAK,CAAC,CAAC,CAC3B,QAAQ,MAAyB,EAAQA,CAAK;CACjD,OAAO;EACL,IAAID,EAAI;EACR,MAAMA,EAAI;EACV,OAAOD,EAAM,SAAS,IAAI,CAAC,GAAG,IAAI,IAAIA,CAAK,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI;EAC5D,UAAUC,EAAI,YAAY;EAC1B,UAAUA,EAAI;EACd,eAAeA,EAAI;EACnB,UAAUA,EAAI,SAAS,SAAS,MAAY;GAC1C,IAAME,IAAQC,EAAaC,EAAQ,SAAS,GACtCC,IAAMF,EAAaC,EAAQ,OAAO;GAGxC,OAFI,CAACF,KAAS,CAACG,KAAOD,EAAQ,WAAW,eAAeA,EAAQ,WAAW,aAClE,CAAC,IACH,CAAC;IAAE,IAAIA,EAAQ;IAAI;IAAO;IAAK,SAASA,EAAQ,WAAW;GAAU,CAAC;EAC/E,CAAC;CACH;AACF;AAEA,SAAgBE,EAAW,IAA8B,CAAC,GAAY;CACpE,IAAM,EAAE,SAAM,UAAO,eAAYC,EAC/BC,GACA;EAAE,aAAa;EAAqB,MAAMC,EAAQ;CAAK,CACzD;CASA,OAAO;EACL,OATYC,SAETC,GAAM,wBAAwB,CAAC,EAAA,CAC7B,QAAQ,MAASC,EAAK,QAAQ,CAAC,CAC/B,IAAId,CAAQ,CAAC,CACb,MAAM,GAAG,MAAMe,EAAE,KAAK,cAAcC,EAAE,IAAI,CAAC,GAChD,CAACH,CAAI,CAGL;EACA,QAAQA,IAAO,UAAUI,IAAQ,UAAU;EAC3C,eAAe;GACb,EAAQ,CAAC,CAAC,YAAY,KAAA,CAAS;EACjC;CACF;AACF"}
@@ -0,0 +1,6 @@
1
+ import { roomNow } from '../rail/railStatus';
2
+ export declare function DayPanel(): import('react').JSX.Element;
3
+ /** A room's state now, as a chip: an icon and a word. */
4
+ export declare function RoomChip({ state }: {
5
+ state: ReturnType<typeof roomNow>;
6
+ }): import('react').JSX.Element;
@@ -0,0 +1,215 @@
1
+ import { calendarHueStyle as e } from "../colors.js";
2
+ import { isAllDayRow as t, joinUrl as n, timedSegmentsByDay as r } from "../events/eventModel.js";
3
+ import { formatDay as i, formatDuration as a, formatInstantRange as o, formatInstantTime as s, formatMinuteRange as c } from "../format.js";
4
+ import { useCalendarPage as l } from "../page/CalendarPageContext.js";
5
+ import { roomNow as u } from "../rail/railStatus.js";
6
+ import { EVENT_EDGE as d, EVENT_FILL as f, FOCUS_RING as p, OVERLINE as m } from "../styles.js";
7
+ import { startOfDayInZone as h } from "../time/calendarTime.js";
8
+ import { summarizeDay as g } from "./daySummary.js";
9
+ import { Plus as _, Video as v } from "lucide-react";
10
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
11
+ import { Button as x, StatusChip as S, addDays as C } from "@burdenoff/fe-libs/ui";
12
+ import { cn as w } from "@burdenoff/fe-libs/utils";
13
+ // src/v2/day/DayPanel.tsx
14
+ function T(e) {
15
+ return `${Math.floor(e / 60)}:${String(e % 60).padStart(2, "0")}`;
16
+ }
17
+ function E({ summary: e, hoursKnown: t }) {
18
+ let { tr: n } = l(), r = [
19
+ [String(e.meetings), n("calendar.v2.statMeetings", "meetings")],
20
+ [T(e.bookedMinutes), n("calendar.v2.statBooked", "hours booked")],
21
+ [t ? String(e.freeGaps.length) : "–", n("calendar.v2.statFree", "free gaps")]
22
+ ];
23
+ return /* @__PURE__ */ y("div", {
24
+ className: "grid grid-cols-3 gap-2",
25
+ children: r.map(([e, t]) => /* @__PURE__ */ b("div", {
26
+ className: "rounded-card border border-border-default bg-bg-surface p-2.5",
27
+ children: [/* @__PURE__ */ y("div", {
28
+ className: "text-lg font-bold tabular-nums text-text-primary",
29
+ children: e
30
+ }), /* @__PURE__ */ y("div", {
31
+ className: "text-xs text-text-secondary",
32
+ children: t
33
+ })]
34
+ }, t))
35
+ });
36
+ }
37
+ function D({ meeting: t, label: r }) {
38
+ let i = l(), { tr: a, format: s, timeZone: c } = i, u = i.lookOf(t.event), h = u.busyOnly ? null : n(t.event);
39
+ return /* @__PURE__ */ b("div", {
40
+ className: w("flex items-center gap-2 rounded-card p-3", d, f),
41
+ style: e(i.hueOf(t.event.calendarId)),
42
+ children: [/* @__PURE__ */ b("button", {
43
+ type: "button",
44
+ onClick: (e) => i.openPeek(t.event, e.currentTarget),
45
+ className: w("flex min-w-0 flex-1 flex-col items-start gap-0.5 text-start", p),
46
+ children: [
47
+ /* @__PURE__ */ y("span", {
48
+ className: m,
49
+ children: r
50
+ }),
51
+ /* @__PURE__ */ y("span", {
52
+ className: "w-full truncate text-sm font-semibold text-text-primary",
53
+ children: u.title
54
+ }),
55
+ /* @__PURE__ */ b("span", {
56
+ className: "w-full truncate text-xs text-text-secondary",
57
+ children: [o(t.event.start, t.event.end, c, s), u.place ? ` · ${u.place}` : ""]
58
+ })
59
+ ]
60
+ }), h ? /* @__PURE__ */ y(x, {
61
+ size: "sm",
62
+ asChild: !0,
63
+ children: /* @__PURE__ */ b("a", {
64
+ href: h,
65
+ target: "_blank",
66
+ rel: "noopener noreferrer",
67
+ children: [/* @__PURE__ */ y(v, { "aria-hidden": "true" }), a("calendar.v2.join", "Join")]
68
+ })
69
+ }) : null]
70
+ });
71
+ }
72
+ function O({ day: e, gap: t }) {
73
+ let n = l(), { tr: r, format: i } = n;
74
+ return /* @__PURE__ */ b("button", {
75
+ type: "button",
76
+ onClick: (r) => n.openQuickCreate({
77
+ date: e,
78
+ start: t.start,
79
+ end: Math.min(t.end, t.start + n.prefs.defaultDuration),
80
+ allDay: !1,
81
+ anchor: r.currentTarget
82
+ }),
83
+ "aria-label": r("calendar.v2.addInGap", "Add an event at {{time}}", { time: c(t.start, t.end, i) }),
84
+ className: w("flex items-center gap-2 rounded-card border border-dashed border-border-default px-3 py-2 text-start hover:border-action-primary-bg hover:bg-accent-soft/40", p),
85
+ children: [
86
+ /* @__PURE__ */ y("span", {
87
+ className: "text-sm font-semibold tabular-nums text-text-primary",
88
+ children: c(t.start, t.end, i)
89
+ }),
90
+ /* @__PURE__ */ y("span", {
91
+ className: "text-xs text-text-secondary",
92
+ children: a(t.end - t.start, n.durationWords)
93
+ }),
94
+ /* @__PURE__ */ y(_, {
95
+ className: "ms-auto size-3.5 text-action-primary-bg",
96
+ "aria-hidden": "true"
97
+ })
98
+ ]
99
+ });
100
+ }
101
+ function k({ day: e, isToday: t, gaps: n }) {
102
+ let r = l(), { tr: i } = r, a;
103
+ return a = r.workingHoursStatus === "error" ? /* @__PURE__ */ b("div", {
104
+ className: "flex flex-col items-start gap-1.5",
105
+ children: [/* @__PURE__ */ y("p", {
106
+ className: "text-sm text-text-secondary",
107
+ children: i("calendar.v2.hoursFailed", "Couldn’t load your working hours, so no free time is offered.")
108
+ }), /* @__PURE__ */ y(x, {
109
+ type: "button",
110
+ variant: "link",
111
+ size: "sm",
112
+ className: "h-auto p-0",
113
+ onClick: r.refetchWorkingHours,
114
+ children: i("calendar.v2.tryAgain", "Try again")
115
+ })]
116
+ }) : r.workingHoursStatus === "loading" ? /* @__PURE__ */ y("p", {
117
+ className: "text-sm text-text-secondary",
118
+ children: i("calendar.v2.hoursLoading", "Loading your working hours…")
119
+ }) : n.length > 0 ? n.map((t) => /* @__PURE__ */ y(O, {
120
+ day: e,
121
+ gap: t
122
+ }, t.start)) : /* @__PURE__ */ y("p", {
123
+ className: "text-sm text-text-secondary",
124
+ children: i("calendar.v2.noFreeTime", "No free time in your working hours.")
125
+ }), /* @__PURE__ */ b("section", {
126
+ className: "flex flex-col gap-1.5",
127
+ children: [/* @__PURE__ */ y("h3", {
128
+ className: m,
129
+ children: t ? i("calendar.v2.freeLeftToday", "Free time left today") : i("calendar.v2.freeTime", "Free time")
130
+ }), a]
131
+ });
132
+ }
133
+ function A() {
134
+ let e = l(), { tr: t, today: n, timeZone: r } = e, i = h(C(n, 1), r), a = e.rooms.rooms, o;
135
+ return o = e.rooms.status === "error" ? /* @__PURE__ */ y("p", {
136
+ className: "text-sm text-text-secondary",
137
+ children: t("calendar.v2.roomsFailed", "Couldn’t load the rooms.")
138
+ }) : a.length === 0 ? /* @__PURE__ */ y("p", {
139
+ className: "text-sm text-text-secondary",
140
+ children: t("calendar.v2.noRooms", "No rooms yet.")
141
+ }) : a.map((t) => /* @__PURE__ */ b("div", {
142
+ className: "flex items-center gap-2 text-sm",
143
+ children: [/* @__PURE__ */ y("span", {
144
+ className: "min-w-0 flex-1 truncate text-text-primary",
145
+ children: t.name
146
+ }), /* @__PURE__ */ y(M, { state: u(t, e.now, i) })]
147
+ }, t.id)), /* @__PURE__ */ b("section", {
148
+ className: "flex flex-col gap-1.5",
149
+ children: [/* @__PURE__ */ y("h3", {
150
+ className: m,
151
+ children: t("calendar.v2.roomsNow", "Rooms right now")
152
+ }), o]
153
+ });
154
+ }
155
+ function j() {
156
+ let e = l(), { tr: n, format: o, timeZone: c, nav: u, today: d, nowMinute: f } = e, p = u.date, m = p === d, h = (r(e.events, [p], c, { includeLong: !0 }).get(p) ?? []).filter((t) => !e.lookOf(t.event).declined).map((e) => ({
157
+ event: e.event,
158
+ start: e.startMinute,
159
+ end: e.endMinute,
160
+ background: t(e.event)
161
+ })), _ = e.workingHoursOn(p), v = g(h, _ ?? null, m ? f : null), x = m ? n("calendar.v2.today", "Today") : i(p, o, "weekdayLong");
162
+ return /* @__PURE__ */ b("aside", {
163
+ "aria-label": n("calendar.v2.yourDay", "Your day"),
164
+ className: "flex w-[280px] shrink-0 flex-col gap-3 overflow-y-auto pe-1",
165
+ children: [
166
+ /* @__PURE__ */ b("div", {
167
+ className: "flex items-baseline gap-2",
168
+ children: [/* @__PURE__ */ y("h2", {
169
+ className: "text-lg font-bold text-text-primary",
170
+ children: x
171
+ }), /* @__PURE__ */ y("span", {
172
+ className: "text-sm text-text-secondary",
173
+ children: i(p, o, "date")
174
+ })]
175
+ }),
176
+ /* @__PURE__ */ y(E, {
177
+ summary: v,
178
+ hoursKnown: _ !== void 0
179
+ }),
180
+ v.now ? /* @__PURE__ */ y(D, {
181
+ meeting: v.now,
182
+ label: n("calendar.v2.nowEnds", "Now · ends {{time}}", { time: s(v.now.event.end, c, o) })
183
+ }) : null,
184
+ v.next ? /* @__PURE__ */ y(D, {
185
+ meeting: v.next,
186
+ label: n("calendar.v2.upNext", "Up next · {{when}}", { when: ((t) => t <= 0 ? n("calendar.v2.startsNow", "now") : n("calendar.v2.inTime", "in {{time}}", { time: a(t, e.durationWords) }))(v.next.start - f) })
187
+ }) : null,
188
+ /* @__PURE__ */ y(k, {
189
+ day: p,
190
+ isToday: m,
191
+ gaps: v.freeGaps
192
+ }),
193
+ /* @__PURE__ */ y(A, {})
194
+ ]
195
+ });
196
+ }
197
+ function M({ state: e }) {
198
+ let { tr: t, format: n, timeZone: r } = l();
199
+ return e.kind === "paused" ? /* @__PURE__ */ y(S, {
200
+ status: "paused",
201
+ quiet: !0,
202
+ children: t("calendar.v2.roomPaused", "Closed")
203
+ }) : e.kind === "busy" ? /* @__PURE__ */ y(S, {
204
+ status: "waiting",
205
+ quiet: !0,
206
+ children: t("calendar.v2.roomBusyUntil", "Busy until {{time}}", { time: s(e.until, r, n) })
207
+ }) : /* @__PURE__ */ y(S, {
208
+ status: "ok",
209
+ quiet: !0,
210
+ children: e.until ? t("calendar.v2.roomFreeUntil", "Free until {{time}}", { time: s(e.until, r, n) }) : t("calendar.v2.roomFreeAllDay", "Free for the rest of the day")
211
+ });
212
+ }
213
+ export { j as DayPanel, M as RoomChip };
214
+
215
+ //# sourceMappingURL=DayPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DayPanel.js","names":["hoursAndMinutes","minutes","DayStats","useCalendarPage","stats","summary","tr","hoursKnown","value","label","MeetingCard","page","look","meeting","url","joinUrl","cn","EVENT_EDGE","EVENT_FILL","calendarHueStyle","event","FOCUS_RING","OVERLINE","formatInstantRange","timeZone","format","Button","Video","GapButton","day","gap","formatMinuteRange","formatDuration","Plus","FreeTime","body","gaps","isToday","RoomsNow","tomorrow","startOfDayInZone","addDays","today","rooms","room","RoomChip","roomNow","DayPanel","nav","meetings","timedSegmentsByDay","piece","isAllDayRow","hours","summarizeDay","nowMinute","heading","formatDay","formatInstantTime","state","StatusChip"],"sources":["../../../src/v2/day/DayPanel.tsx"],"sourcesContent":["/**\n * Beside the Day view on wide screens (BOFF-15698 A1): the day at a glance. Meetings, hours\n * booked and free gaps; what's on now and what's next (with Join for a call); the free time\n * left in the working hours, each gap a button that starts an event there; and the rooms'\n * state right now. Until the working hours are known no free time is offered, and when they\n * couldn't be loaded the panel says so.\n */\nimport type { ReactNode } from 'react';\nimport { Plus, Video } from 'lucide-react';\nimport { addDays, Button, StatusChip, type DateValue } from '@burdenoff/fe-libs/ui';\nimport { cn } from '@burdenoff/fe-libs/utils';\nimport { calendarHueStyle } from '../colors';\nimport { isAllDayRow, joinUrl, timedSegmentsByDay } from '../events/eventModel';\nimport {\n formatDay,\n formatDuration,\n formatInstantRange,\n formatInstantTime,\n formatMinuteRange,\n} from '../format';\nimport type { HoursSpan } from '../grid/workingHours';\nimport { useCalendarPage } from '../page/CalendarPageContext';\nimport { roomNow } from '../rail/railStatus';\nimport { EVENT_EDGE, EVENT_FILL, FOCUS_RING, OVERLINE } from '../styles';\nimport { startOfDayInZone } from '../time/calendarTime';\nimport type { CalendarEventV2 } from '../types';\nimport { summarizeDay, type DayMeeting, type DaySummary } from './daySummary';\n\n/** \"3:30\": hours and minutes. */\nfunction hoursAndMinutes(minutes: number): string {\n return `${Math.floor(minutes / 60)}:${String(minutes % 60).padStart(2, '0')}`;\n}\n\nfunction DayStats({\n summary,\n hoursKnown,\n}: {\n summary: DaySummary<CalendarEventV2>;\n hoursKnown: boolean;\n}) {\n const { tr } = useCalendarPage();\n const stats = [\n [String(summary.meetings), tr('calendar.v2.statMeetings', 'meetings')],\n [hoursAndMinutes(summary.bookedMinutes), tr('calendar.v2.statBooked', 'hours booked')],\n [hoursKnown ? String(summary.freeGaps.length) : '–', tr('calendar.v2.statFree', 'free gaps')],\n ];\n return (\n <div className=\"grid grid-cols-3 gap-2\">\n {stats.map(([value, label]) => (\n <div key={label} className=\"rounded-card border border-border-default bg-bg-surface p-2.5\">\n <div className=\"text-lg font-bold tabular-nums text-text-primary\">{value}</div>\n <div className=\"text-xs text-text-secondary\">{label}</div>\n </div>\n ))}\n </div>\n );\n}\n\n/** What's on now or next: a card that opens the peek, with Join for a call. */\nfunction MeetingCard({ meeting, label }: { meeting: DayMeeting<CalendarEventV2>; label: string }) {\n const page = useCalendarPage();\n const { tr, format, timeZone } = page;\n const look = page.lookOf(meeting.event);\n const url = look.busyOnly ? null : joinUrl(meeting.event);\n return (\n <div\n className={cn('flex items-center gap-2 rounded-card p-3', EVENT_EDGE, EVENT_FILL)}\n style={calendarHueStyle(page.hueOf(meeting.event.calendarId))}\n >\n <button\n type=\"button\"\n onClick={(event) => page.openPeek(meeting.event, event.currentTarget)}\n className={cn('flex min-w-0 flex-1 flex-col items-start gap-0.5 text-start', FOCUS_RING)}\n >\n <span className={OVERLINE}>{label}</span>\n <span className=\"w-full truncate text-sm font-semibold text-text-primary\">\n {look.title}\n </span>\n <span className=\"w-full truncate text-xs text-text-secondary\">\n {formatInstantRange(meeting.event.start, meeting.event.end, timeZone, format)}\n {look.place ? ` · ${look.place}` : ''}\n </span>\n </button>\n {url ? (\n <Button size=\"sm\" asChild>\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n <Video aria-hidden=\"true\" />\n {tr('calendar.v2.join', 'Join')}\n </a>\n </Button>\n ) : null}\n </div>\n );\n}\n\nfunction GapButton({ day, gap }: { day: DateValue; gap: HoursSpan }) {\n const page = useCalendarPage();\n const { tr, format } = page;\n return (\n <button\n type=\"button\"\n onClick={(event) =>\n page.openQuickCreate({\n date: day,\n start: gap.start,\n end: Math.min(gap.end, gap.start + page.prefs.defaultDuration),\n allDay: false,\n anchor: event.currentTarget,\n })\n }\n aria-label={tr('calendar.v2.addInGap', 'Add an event at {{time}}', {\n time: formatMinuteRange(gap.start, gap.end, format),\n })}\n className={cn(\n 'flex items-center gap-2 rounded-card border border-dashed border-border-default px-3 py-2 text-start hover:border-action-primary-bg hover:bg-accent-soft/40',\n FOCUS_RING\n )}\n >\n <span className=\"text-sm font-semibold tabular-nums text-text-primary\">\n {formatMinuteRange(gap.start, gap.end, format)}\n </span>\n <span className=\"text-xs text-text-secondary\">\n {formatDuration(gap.end - gap.start, page.durationWords)}\n </span>\n <Plus className=\"ms-auto size-3.5 text-action-primary-bg\" aria-hidden=\"true\" />\n </button>\n );\n}\n\n/** The free gaps in the working hours, or why none are offered. */\nfunction FreeTime({\n day,\n isToday,\n gaps,\n}: {\n day: DateValue;\n isToday: boolean;\n gaps: readonly HoursSpan[];\n}) {\n const page = useCalendarPage();\n const { tr } = page;\n let body: ReactNode;\n if (page.workingHoursStatus === 'error') {\n body = (\n <div className=\"flex flex-col items-start gap-1.5\">\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'calendar.v2.hoursFailed',\n 'Couldn’t load your working hours, so no free time is offered.'\n )}\n </p>\n <Button\n type=\"button\"\n variant=\"link\"\n size=\"sm\"\n className=\"h-auto p-0\"\n onClick={page.refetchWorkingHours}\n >\n {tr('calendar.v2.tryAgain', 'Try again')}\n </Button>\n </div>\n );\n } else if (page.workingHoursStatus === 'loading') {\n body = (\n <p className=\"text-sm text-text-secondary\">\n {tr('calendar.v2.hoursLoading', 'Loading your working hours…')}\n </p>\n );\n } else if (gaps.length > 0) {\n body = gaps.map((gap) => <GapButton key={gap.start} day={day} gap={gap} />);\n } else {\n body = (\n <p className=\"text-sm text-text-secondary\">\n {tr('calendar.v2.noFreeTime', 'No free time in your working hours.')}\n </p>\n );\n }\n return (\n <section className=\"flex flex-col gap-1.5\">\n <h3 className={OVERLINE}>\n {isToday\n ? tr('calendar.v2.freeLeftToday', 'Free time left today')\n : tr('calendar.v2.freeTime', 'Free time')}\n </h3>\n {body}\n </section>\n );\n}\n\nfunction RoomsNow() {\n const page = useCalendarPage();\n const { tr, today, timeZone } = page;\n const tomorrow = startOfDayInZone(addDays(today, 1), timeZone);\n const rooms = page.rooms.rooms;\n let body: ReactNode;\n if (page.rooms.status === 'error') {\n body = (\n <p className=\"text-sm text-text-secondary\">\n {tr('calendar.v2.roomsFailed', 'Couldn’t load the rooms.')}\n </p>\n );\n } else if (rooms.length === 0) {\n body = (\n <p className=\"text-sm text-text-secondary\">{tr('calendar.v2.noRooms', 'No rooms yet.')}</p>\n );\n } else {\n body = rooms.map((room) => (\n <div key={room.id} className=\"flex items-center gap-2 text-sm\">\n <span className=\"min-w-0 flex-1 truncate text-text-primary\">{room.name}</span>\n <RoomChip state={roomNow(room, page.now, tomorrow)} />\n </div>\n ));\n }\n return (\n <section className=\"flex flex-col gap-1.5\">\n <h3 className={OVERLINE}>{tr('calendar.v2.roomsNow', 'Rooms right now')}</h3>\n {body}\n </section>\n );\n}\n\nexport function DayPanel() {\n const page = useCalendarPage();\n const { tr, format, timeZone, nav, today, nowMinute } = page;\n const day = nav.date;\n const isToday = day === today;\n const pieces =\n timedSegmentsByDay(page.events, [day], timeZone, { includeLong: true }).get(day) ?? [];\n // Declined events don't take time; someone else's private time does, as \"Busy\" (the grid\n // shows it, so the free gaps must not offer it); so does a timed event of a day or more,\n // which the all-day row shows.\n const meetings: DayMeeting<CalendarEventV2>[] = pieces\n .filter((piece) => !page.lookOf(piece.event).declined)\n .map((piece) => ({\n event: piece.event,\n start: piece.startMinute,\n end: piece.endMinute,\n background: isAllDayRow(piece.event),\n }));\n const hours = page.workingHoursOn(day);\n const summary = summarizeDay(meetings, hours ?? null, isToday ? nowMinute : null);\n const heading = isToday\n ? tr('calendar.v2.today', 'Today')\n : formatDay(day, format, 'weekdayLong');\n const startsIn = (minutes: number) =>\n minutes <= 0\n ? tr('calendar.v2.startsNow', 'now')\n : tr('calendar.v2.inTime', 'in {{time}}', {\n time: formatDuration(minutes, page.durationWords),\n });\n\n return (\n <aside\n aria-label={tr('calendar.v2.yourDay', 'Your day')}\n className=\"flex w-[280px] shrink-0 flex-col gap-3 overflow-y-auto pe-1\"\n >\n <div className=\"flex items-baseline gap-2\">\n <h2 className=\"text-lg font-bold text-text-primary\">{heading}</h2>\n <span className=\"text-sm text-text-secondary\">{formatDay(day, format, 'date')}</span>\n </div>\n <DayStats summary={summary} hoursKnown={hours !== undefined} />\n {summary.now ? (\n <MeetingCard\n meeting={summary.now}\n label={tr('calendar.v2.nowEnds', 'Now · ends {{time}}', {\n time: formatInstantTime(summary.now.event.end, timeZone, format),\n })}\n />\n ) : null}\n {summary.next ? (\n <MeetingCard\n meeting={summary.next}\n label={tr('calendar.v2.upNext', 'Up next · {{when}}', {\n when: startsIn(summary.next.start - nowMinute),\n })}\n />\n ) : null}\n <FreeTime day={day} isToday={isToday} gaps={summary.freeGaps} />\n <RoomsNow />\n </aside>\n );\n}\n\n/** A room's state now, as a chip: an icon and a word. */\nexport function RoomChip({ state }: { state: ReturnType<typeof roomNow> }) {\n const { tr, format, timeZone } = useCalendarPage();\n if (state.kind === 'paused') {\n return (\n <StatusChip status=\"paused\" quiet>\n {tr('calendar.v2.roomPaused', 'Closed')}\n </StatusChip>\n );\n }\n if (state.kind === 'busy') {\n return (\n <StatusChip status=\"waiting\" quiet>\n {tr('calendar.v2.roomBusyUntil', 'Busy until {{time}}', {\n time: formatInstantTime(state.until, timeZone, format),\n })}\n </StatusChip>\n );\n }\n return (\n <StatusChip status=\"ok\" quiet>\n {state.until\n ? tr('calendar.v2.roomFreeUntil', 'Free until {{time}}', {\n time: formatInstantTime(state.until, timeZone, format),\n })\n : tr('calendar.v2.roomFreeAllDay', 'Free for the rest of the day')}\n </StatusChip>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA6BA,SAASA,EAAgB,GAAyB;CAChD,OAAO,GAAG,KAAK,MAAMC,IAAU,EAAE,EAAE,GAAG,OAAOA,IAAU,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;AAC5E;AAEA,SAASC,EAAS,EAChB,YACA,iBAIC;CACD,IAAM,EAAE,UAAOC,EAAgB,GACzBC,IAAQ;EACZ,CAAC,OAAOC,EAAQ,QAAQ,GAAGC,EAAG,4BAA4B,UAAU,CAAC;EACrE,CAACN,EAAgBK,EAAQ,aAAa,GAAGC,EAAG,0BAA0B,cAAc,CAAC;EACrF,CAACC,IAAa,OAAOF,EAAQ,SAAS,MAAM,IAAI,KAAKC,EAAG,wBAAwB,WAAW,CAAC;CAC9F;CACA,OACE,kBAAC,OAAD;EAAK,WAAU;EACZ,UAAAF,EAAM,KAAK,CAACI,GAAOC,OAClB,kBAAC,OAAD;GAAiB,WAAU;GAA3B,UAAA,CACE,kBAAC,OAAD;IAAK,WAAU;IAAoD,UAAAD;GAAW,CAAA,GAC9E,kBAAC,OAAD;IAAK,WAAU;IAA+B,UAAAC;GAAW,CAAA,CACtD;EAHK,GAAAA,CAGL,CACN;CACE,CAAA;AAET;AAGA,SAASC,EAAY,EAAE,YAAS,YAAkE;CAChG,IAAMC,IAAOR,EAAgB,GACvB,EAAE,OAAI,WAAQ,gBAAaQ,GAC3BC,IAAOD,EAAK,OAAOE,EAAQ,KAAK,GAChCC,IAAMF,EAAK,WAAW,OAAOG,EAAQF,EAAQ,KAAK;CACxD,OACE,kBAAC,OAAD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AAG,0BAA0B,QAAQ;CAC5B,CAAA,IAGZqD,EAAM,SAAS,SAEf,kBAACC,GAAD;EAAY,QAAO;EAAU,OAAA;EAC1B,UAAAtD,EAAG,6BAA6B,uBAAuB,EACtD,MAAMoD,EAAkBC,EAAM,OAAOnC,GAAUC,CAAM,EACvD,CAAC;CACS,CAAA,IAId,kBAACmC,GAAD;EAAY,QAAO;EAAK,OAAA;EACrB,UAAAD,EAAM,QACHrD,EAAG,6BAA6B,uBAAuB,EACrD,MAAMoD,EAAkBC,EAAM,OAAOnC,GAAUC,CAAM,EACvD,CAAC,IACDnB,EAAG,8BAA8B,8BAA8B;CACzD,CAAA;AAEhB"}
@@ -0,0 +1,37 @@
1
+ import { HoursSpan } from '../grid/workingHours';
2
+ /** A meeting on the day, as minutes on the day's clock. */
3
+ export interface DayMeeting<T> {
4
+ event: T;
5
+ start: number;
6
+ end: number;
7
+ /**
8
+ * Busy time from an event the all-day row shows (a timed event of a day or more): it books
9
+ * time and closes free gaps, but isn't named as on now or up next.
10
+ */
11
+ background?: boolean;
12
+ }
13
+ export interface DaySummary<T> {
14
+ /** Meetings on the day (busy time; all-day events don't count). */
15
+ meetings: number;
16
+ /** Minutes of the day taken by meetings, overlaps counted once. */
17
+ bookedMinutes: number;
18
+ /** Free gaps in the working hours of at least `minGap` minutes, from now on today. */
19
+ freeGaps: {
20
+ start: number;
21
+ end: number;
22
+ }[];
23
+ /** The meeting on now (today only). */
24
+ now: DayMeeting<T> | null;
25
+ /** The next meeting to start (today only). */
26
+ next: DayMeeting<T> | null;
27
+ }
28
+ /** The shortest gap worth offering. */
29
+ export declare const MIN_FREE_GAP = 30;
30
+ /**
31
+ * Summarises a day. `nowMinute` is the clock's minute when the day is today, else null.
32
+ * `workingHours` is the day's working time on its clock, in one or more stretches; null when
33
+ * the person doesn't work that day (no free gaps are offered).
34
+ */
35
+ export declare function summarizeDay<T>(meetings: readonly DayMeeting<T>[], workingHours: {
36
+ spans: readonly HoursSpan[];
37
+ } | null, nowMinute: number | null, minGap?: number): DaySummary<T>;
@@ -0,0 +1,37 @@
1
+ import { MINUTES_PER_DAY as e } from "../time/calendarTime.js";
2
+ function t(e, t, n, r) {
3
+ let i = [];
4
+ if (e.end <= e.start) return i;
5
+ let a = n === null ? e.start : Math.max(e.start, Math.ceil(n / 15) * 15);
6
+ for (let n of t) {
7
+ if (n.end <= a) continue;
8
+ if (n.start >= e.end) break;
9
+ let t = Math.min(n.start, e.end);
10
+ t - a >= r && i.push({
11
+ start: a,
12
+ end: t
13
+ }), a = Math.max(a, n.end);
14
+ }
15
+ return e.end - a >= r && i.push({
16
+ start: a,
17
+ end: e.end
18
+ }), i;
19
+ }
20
+ function n(n, r, i, a = 30) {
21
+ let o = [...n].sort((e, t) => e.start - t.start || e.end - t.end), s = 0, c = -1;
22
+ for (let e of o) {
23
+ let t = Math.max(e.start, c);
24
+ e.end > t && (s += e.end - t), c = Math.max(c, e.end);
25
+ }
26
+ let l = (r?.spans ?? []).flatMap((e) => t(e, o, i, a)), u = o.filter((e) => !e.background), d = i === null ? null : u.find((e) => e.start <= i && e.end > i) ?? null, f = i === null ? null : u.find((e) => e.start > i) ?? null;
27
+ return {
28
+ meetings: o.length,
29
+ bookedMinutes: Math.min(s, e),
30
+ freeGaps: l,
31
+ now: d,
32
+ next: f
33
+ };
34
+ }
35
+ export { n as summarizeDay };
36
+
37
+ //# sourceMappingURL=daySummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daySummary.js","names":["freeGapsIn","gaps","span","cursor","nowMinute","meeting","sorted","gapEnd","minGap","summarizeDay","meetings","a","b","bookedMinutes","coveredUntil","from","freeGaps","workingHours","named","now","next","MINUTES_PER_DAY"],"sources":["../../../src/v2/day/daySummary.ts"],"sourcesContent":["/**\n * The Day view's side panel (BOFF-15698 A1): what's on now, what's next, how much of the day is\n * booked, and the free gaps in the working hours, which a click turns into a new event. Pure.\n */\nimport type { HoursSpan } from '../grid/workingHours';\nimport { MINUTES_PER_DAY } from '../time/calendarTime';\n\n/** A meeting on the day, as minutes on the day's clock. */\nexport interface DayMeeting<T> {\n event: T;\n start: number;\n end: number;\n /**\n * Busy time from an event the all-day row shows (a timed event of a day or more): it books\n * time and closes free gaps, but isn't named as on now or up next.\n */\n background?: boolean;\n}\n\nexport interface DaySummary<T> {\n /** Meetings on the day (busy time; all-day events don't count). */\n meetings: number;\n /** Minutes of the day taken by meetings, overlaps counted once. */\n bookedMinutes: number;\n /** Free gaps in the working hours of at least `minGap` minutes, from now on today. */\n freeGaps: { start: number; end: number }[];\n /** The meeting on now (today only). */\n now: DayMeeting<T> | null;\n /** The next meeting to start (today only). */\n next: DayMeeting<T> | null;\n}\n\n/** The shortest gap worth offering. */\nexport const MIN_FREE_GAP = 30;\n\n/** Free gaps of at least `minGap` minutes in one stretch of working time (from now on, today). */\nfunction freeGapsIn<T>(\n span: HoursSpan,\n sorted: readonly DayMeeting<T>[],\n nowMinute: number | null,\n minGap: number\n): HoursSpan[] {\n const gaps: HoursSpan[] = [];\n if (span.end <= span.start) return gaps;\n // Today, gaps start no earlier than the next quarter hour.\n let cursor =\n nowMinute === null ? span.start : Math.max(span.start, Math.ceil(nowMinute / 15) * 15);\n for (const meeting of sorted) {\n if (meeting.end <= cursor) continue;\n if (meeting.start >= span.end) break;\n const gapEnd = Math.min(meeting.start, span.end);\n if (gapEnd - cursor >= minGap) gaps.push({ start: cursor, end: gapEnd });\n cursor = Math.max(cursor, meeting.end);\n }\n if (span.end - cursor >= minGap) gaps.push({ start: cursor, end: span.end });\n return gaps;\n}\n\n/**\n * Summarises a day. `nowMinute` is the clock's minute when the day is today, else null.\n * `workingHours` is the day's working time on its clock, in one or more stretches; null when\n * the person doesn't work that day (no free gaps are offered).\n */\nexport function summarizeDay<T>(\n meetings: readonly DayMeeting<T>[],\n workingHours: { spans: readonly HoursSpan[] } | null,\n nowMinute: number | null,\n minGap: number = MIN_FREE_GAP\n): DaySummary<T> {\n const sorted = [...meetings].sort((a, b) => a.start - b.start || a.end - b.end);\n\n let bookedMinutes = 0;\n let coveredUntil = -1;\n for (const meeting of sorted) {\n const from = Math.max(meeting.start, coveredUntil);\n if (meeting.end > from) bookedMinutes += meeting.end - from;\n coveredUntil = Math.max(coveredUntil, meeting.end);\n }\n\n const freeGaps = (workingHours?.spans ?? []).flatMap((span) =>\n freeGapsIn(span, sorted, nowMinute, minGap)\n );\n\n const named = sorted.filter((meeting) => !meeting.background);\n const now =\n nowMinute === null\n ? null\n : (named.find((meeting) => meeting.start <= nowMinute && meeting.end > nowMinute) ?? null);\n const next =\n nowMinute === null ? null : (named.find((meeting) => meeting.start > nowMinute) ?? null);\n\n return {\n meetings: sorted.length,\n bookedMinutes: Math.min(bookedMinutes, MINUTES_PER_DAY),\n freeGaps,\n now,\n next,\n };\n}\n"],"mappings":";AAoCA,SAASA,EACP,GACA,GACA,GACA,GACa;CACb,IAAMC,IAAoB,CAAC;CAC3B,IAAIC,EAAK,OAAOA,EAAK,OAAO,OAAOD;CAEnC,IAAIE,IACFC,MAAc,OAAOF,EAAK,QAAQ,KAAK,IAAIA,EAAK,OAAO,KAAK,KAAKE,IAAY,EAAE,IAAI,EAAE;CACvF,KAAK,IAAMC,KAAWC,GAAQ;EAC5B,IAAID,EAAQ,OAAOF,GAAQ;EAC3B,IAAIE,EAAQ,SAASH,EAAK,KAAK;EAC/B,IAAMK,IAAS,KAAK,IAAIF,EAAQ,OAAOH,EAAK,GAAG;EAE/C,AADIK,IAASJ,KAAUK,KAAQP,EAAK,KAAK;GAAE,OAAOE;GAAQ,KAAKI;EAAO,CAAC,GACvE,IAAS,KAAK,IAAIJ,GAAQE,EAAQ,GAAG;CACvC;CAEA,OADIH,EAAK,MAAMC,KAAUK,KAAQP,EAAK,KAAK;EAAE,OAAOE;EAAQ,KAAKD,EAAK;CAAI,CAAC,GACpED;AACT;AAOA,SAAgBQ,EACd,GACA,GACA,GACA,IAAA,IACe;CACf,IAAMH,IAAS,CAAC,GAAGI,CAAQ,CAAC,CAAC,MAAM,GAAG,MAAMC,EAAE,QAAQC,EAAE,SAASD,EAAE,MAAMC,EAAE,GAAG,GAE1EC,IAAgB,GAChBC,IAAe;CACnB,KAAK,IAAMT,KAAWC,GAAQ;EAC5B,IAAMS,IAAO,KAAK,IAAIV,EAAQ,OAAOS,CAAY;EAEjD,AADIT,EAAQ,MAAMU,MAAM,KAAiBV,EAAQ,MAAMU,IACvD,IAAe,KAAK,IAAID,GAAcT,EAAQ,GAAG;CACnD;CAEA,IAAMW,KAAYC,GAAc,SAAS,CAAC,EAAA,CAAG,SAAS,MACpDjB,EAAWE,GAAMI,GAAQF,GAAWI,CAAM,CAC5C,GAEMU,IAAQZ,EAAO,QAAQ,MAAY,CAACD,EAAQ,UAAU,GACtDc,IACJf,MAAc,OACV,OACCc,EAAM,MAAM,MAAYb,EAAQ,SAASD,KAAaC,EAAQ,MAAMD,CAAS,KAAK,MACnFgB,IACJhB,MAAc,OAAO,OAAQc,EAAM,MAAM,MAAYb,EAAQ,QAAQD,CAAS,KAAK;CAErF,OAAO;EACL,UAAUE,EAAO;EACjB,eAAe,KAAK,IAAIO,GAAeQ,CAAe;EACtD;EACA;EACA;CACF;AACF"}
@@ -0,0 +1 @@
1
+ export declare function CalendarDialogsV2(): import('react').JSX.Element | null;
@@ -0,0 +1,17 @@
1
+ import { useCalendarPage as e } from "../page/CalendarPageContext.js";
2
+ import { ShortcutsDialog as t } from "./ShortcutsDialog.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ // src/v2/dialogs/CalendarDialogsV2.tsx
5
+ function r() {
6
+ let { nav: r } = e();
7
+ switch (r.dialog) {
8
+ case "shortcuts": return /* @__PURE__ */ n(t, {
9
+ open: !0,
10
+ onClose: r.closeDialog
11
+ });
12
+ default: return null;
13
+ }
14
+ }
15
+ export { r as CalendarDialogsV2 };
16
+
17
+ //# sourceMappingURL=CalendarDialogsV2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalendarDialogsV2.js","names":["CalendarDialogsV2","useCalendarPage","nav","ShortcutsDialog"],"sources":["../../../src/v2/dialogs/CalendarDialogsV2.tsx"],"sourcesContent":["/**\n * The calendar's dialogs, opened from the address (`?dialog=`, BOFF-15698). A1 builds the\n * keyboard shortcuts; the event dialog and Find a time come with A2, and Subscribe & share,\n * Calendar settings and Rooms & resources with A3. Until a dialog is built, its address opens\n * nothing and the calendar stays as it is.\n */\nimport { useCalendarPage } from '../page/CalendarPageContext';\nimport { ShortcutsDialog } from './ShortcutsDialog';\n\nexport function CalendarDialogsV2() {\n const { nav } = useCalendarPage();\n switch (nav.dialog) {\n case 'shortcuts':\n return <ShortcutsDialog open onClose={nav.closeDialog} />;\n default:\n return null;\n }\n}\n"],"mappings":";;;;AASA,SAAgBA,IAAoB;CAClC,IAAM,EAAE,WAAQC,EAAgB;CAChC,QAAQC,EAAI,QAAZ;EACE,KAAK,aACH,OAAO,kBAACC,GAAD;GAAiB,MAAA;GAAK,SAASD,EAAI;EAAc,CAAA;EAC1D,SACE,OAAO;CACX;AACF"}
@@ -0,0 +1,4 @@
1
+ export declare function ShortcutsDialog({ open, onClose }: {
2
+ open: boolean;
3
+ onClose: () => void;
4
+ }): import('react').JSX.Element;
@@ -0,0 +1,42 @@
1
+ import { useCalendarPage as e } from "../page/CalendarPageContext.js";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { ResponsiveDialog as r, ResponsiveDialogBody as i, ResponsiveDialogContent as a, ResponsiveDialogDescription as o, ResponsiveDialogHeader as s, ResponsiveDialogTitle as c } from "@burdenoff/fe-libs/ui";
4
+ // src/v2/dialogs/ShortcutsDialog.tsx
5
+ function l({ open: l, onClose: u }) {
6
+ let { tr: d } = e(), f = [
7
+ ["T", d("calendar.v2.keyToday", "Go to today")],
8
+ ["D · W · M · L", d("calendar.v2.keyViews", "Day, Week, Month, List")],
9
+ ["J / K", d("calendar.v2.keyPeriods", "Next / previous period")],
10
+ ["N", d("calendar.v2.keyNew", "New event")],
11
+ ["/", d("calendar.v2.keySearch", "Search events")],
12
+ ["?", d("calendar.v2.keyHelp", "Show these shortcuts")],
13
+ [d("calendar.v2.keyArrowsGrid", "Arrows (in the grid)"), d("calendar.v2.keyArrowsGridDo", "Pick a half hour; Enter adds an event there")],
14
+ [d("calendar.v2.keyTabEvents", "Tab, arrows (on an event)"), d("calendar.v2.keyTabEventsDo", "Move between events; Enter opens one")],
15
+ [d("calendar.v2.keyShiftArrows", "Shift + arrows"), d("calendar.v2.keyShiftArrowsDo", "Move the event 15 minutes or a day (Undo in the toast)")],
16
+ [d("calendar.v2.keyDelete", "Delete"), d("calendar.v2.keyDeleteDo", "Delete an event you organise (Undo in the toast)")],
17
+ [d("calendar.v2.keyEscape", "Esc"), d("calendar.v2.keyEscapeDo", "Close the peek, a menu or a dialog")]
18
+ ];
19
+ return /* @__PURE__ */ t(r, {
20
+ open: l,
21
+ onOpenChange: (e) => e ? void 0 : u(),
22
+ children: /* @__PURE__ */ n(a, {
23
+ className: "sm:max-w-[520px]",
24
+ children: [/* @__PURE__ */ n(s, { children: [/* @__PURE__ */ t(c, { children: d("calendar.v2.shortcuts", "Keyboard shortcuts") }), /* @__PURE__ */ t(o, { children: d("calendar.v2.shortcutsBody", "They work anywhere on the calendar page, except while you type.") })] }), /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t("dl", {
25
+ className: "grid grid-cols-[minmax(0,auto)_minmax(0,1fr)] gap-x-4 gap-y-2 text-sm",
26
+ children: f.map(([e, r]) => /* @__PURE__ */ n("div", {
27
+ className: "contents",
28
+ children: [/* @__PURE__ */ t("dt", { children: /* @__PURE__ */ t("kbd", {
29
+ className: "rounded border border-border-default bg-bg-sunken px-1.5 py-0.5 font-mono text-xs text-text-primary",
30
+ children: e
31
+ }) }), /* @__PURE__ */ t("dd", {
32
+ className: "text-text-secondary",
33
+ children: r
34
+ })]
35
+ }, e))
36
+ }) })]
37
+ })
38
+ });
39
+ }
40
+ export { l as ShortcutsDialog };
41
+
42
+ //# sourceMappingURL=ShortcutsDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShortcutsDialog.js","names":["ShortcutsDialog","useCalendarPage","rows","tr","ResponsiveDialog","next","onClose","ResponsiveDialogContent","ResponsiveDialogHeader","ResponsiveDialogTitle","ResponsiveDialogDescription","ResponsiveDialogBody","keys","does"],"sources":["../../../src/v2/dialogs/ShortcutsDialog.tsx"],"sourcesContent":["/** The calendar's keyboard shortcuts (BOFF-15698 A1): \"?\" or ⋯ › Keyboard shortcuts. */\nimport {\n ResponsiveDialog,\n ResponsiveDialogBody,\n ResponsiveDialogContent,\n ResponsiveDialogDescription,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n} from '@burdenoff/fe-libs/ui';\nimport { useCalendarPage } from '../page/CalendarPageContext';\n\nexport function ShortcutsDialog({ open, onClose }: { open: boolean; onClose: () => void }) {\n const { tr } = useCalendarPage();\n const rows: [string, string][] = [\n ['T', tr('calendar.v2.keyToday', 'Go to today')],\n ['D · W · M · L', tr('calendar.v2.keyViews', 'Day, Week, Month, List')],\n ['J / K', tr('calendar.v2.keyPeriods', 'Next / previous period')],\n ['N', tr('calendar.v2.keyNew', 'New event')],\n ['/', tr('calendar.v2.keySearch', 'Search events')],\n ['?', tr('calendar.v2.keyHelp', 'Show these shortcuts')],\n [\n tr('calendar.v2.keyArrowsGrid', 'Arrows (in the grid)'),\n tr('calendar.v2.keyArrowsGridDo', 'Pick a half hour; Enter adds an event there'),\n ],\n [\n tr('calendar.v2.keyTabEvents', 'Tab, arrows (on an event)'),\n tr('calendar.v2.keyTabEventsDo', 'Move between events; Enter opens one'),\n ],\n [\n tr('calendar.v2.keyShiftArrows', 'Shift + arrows'),\n tr('calendar.v2.keyShiftArrowsDo', 'Move the event 15 minutes or a day (Undo in the toast)'),\n ],\n [\n tr('calendar.v2.keyDelete', 'Delete'),\n tr('calendar.v2.keyDeleteDo', 'Delete an event you organise (Undo in the toast)'),\n ],\n [\n tr('calendar.v2.keyEscape', 'Esc'),\n tr('calendar.v2.keyEscapeDo', 'Close the peek, a menu or a dialog'),\n ],\n ];\n return (\n <ResponsiveDialog open={open} onOpenChange={(next) => (next ? undefined : onClose())}>\n <ResponsiveDialogContent className=\"sm:max-w-[520px]\">\n <ResponsiveDialogHeader>\n <ResponsiveDialogTitle>\n {tr('calendar.v2.shortcuts', 'Keyboard shortcuts')}\n </ResponsiveDialogTitle>\n <ResponsiveDialogDescription>\n {tr(\n 'calendar.v2.shortcutsBody',\n 'They work anywhere on the calendar page, except while you type.'\n )}\n </ResponsiveDialogDescription>\n </ResponsiveDialogHeader>\n <ResponsiveDialogBody>\n <dl className=\"grid grid-cols-[minmax(0,auto)_minmax(0,1fr)] gap-x-4 gap-y-2 text-sm\">\n {rows.map(([keys, does]) => (\n <div key={keys} className=\"contents\">\n <dt>\n <kbd className=\"rounded border border-border-default bg-bg-sunken px-1.5 py-0.5 font-mono text-xs text-text-primary\">\n {keys}\n </kbd>\n </dt>\n <dd className=\"text-text-secondary\">{does}</dd>\n </div>\n ))}\n </dl>\n </ResponsiveDialogBody>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n );\n}\n"],"mappings":";;;;AAWA,SAAgBA,EAAgB,EAAE,SAAM,cAAmD;CACzF,IAAM,EAAE,UAAOC,EAAgB,GACzBC,IAA2B;EAC/B,CAAC,KAAKC,EAAG,wBAAwB,aAAa,CAAC;EAC/C,CAAC,iBAAiBA,EAAG,wBAAwB,wBAAwB,CAAC;EACtE,CAAC,SAASA,EAAG,0BAA0B,wBAAwB,CAAC;EAChE,CAAC,KAAKA,EAAG,sBAAsB,WAAW,CAAC;EAC3C,CAAC,KAAKA,EAAG,yBAAyB,eAAe,CAAC;EAClD,CAAC,KAAKA,EAAG,uBAAuB,sBAAsB,CAAC;EACvD,CACEA,EAAG,6BAA6B,sBAAsB,GACtDA,EAAG,+BAA+B,6CAA6C,CACjF;EACA,CACEA,EAAG,4BAA4B,2BAA2B,GAC1DA,EAAG,8BAA8B,sCAAsC,CACzE;EACA,CACEA,EAAG,8BAA8B,gBAAgB,GACjDA,EAAG,gCAAgC,wDAAwD,CAC7F;EACA,CACEA,EAAG,yBAAyB,QAAQ,GACpCA,EAAG,2BAA2B,kDAAkD,CAClF;EACA,CACEA,EAAG,yBAAyB,KAAK,GACjCA,EAAG,2BAA2B,oCAAoC,CACpE;CACF;CACA,OACE,kBAACC,GAAD;EAAwB;EAAM,eAAe,MAAUC,IAAO,KAAA,IAAYC,EAAQ;EAChF,UAAA,kBAACC,GAAD;GAAyB,WAAU;GAAnC,UAAA,CACE,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD,EAAA,UACGN,EAAG,yBAAyB,oBAAoB,EAC5B,CAAA,GACvB,kBAACO,GAAD,EAAA,UACGP,EACC,6BACA,iEACF,EAC2B,CAAA,CACP,EAAA,CAAA,GACxB,kBAACQ,GAAD,EAAA,UACE,kBAAC,MAAD;IAAI,WAAU;IACX,UAAAT,EAAK,KAAK,CAACU,GAAMC,OAChB,kBAAC,OAAD;KAAgB,WAAU;KAA1B,UAAA,CACE,kBAAC,MAAD,EAAA,UACE,kBAAC,OAAD;MAAK,WAAU;MACZ,UAAAD;KACE,CAAA,EACH,CAAA,GACJ,kBAAC,MAAD;MAAI,WAAU;MAAuB,UAAAC;KAAS,CAAA,CAC3C;IAPK,GAAAD,CAOL,CACN;GACC,CAAA,EACgB,CAAA,CACC;;CACT,CAAA;AAEtB"}
@@ -0,0 +1,46 @@
1
+ import { Tr } from '../data/useEventActions';
2
+ import { CalendarFormat } from '../format';
3
+ import { CalendarEventV2, CalendarV2, EventResponseV2 } from '../types';
4
+ export interface EventLook {
5
+ /** Someone else's private time: only "Busy" shows. */
6
+ busyOnly: boolean;
7
+ /** Waiting for the person's answer. */
8
+ invitation: boolean;
9
+ maybe: boolean;
10
+ declined: boolean;
11
+ /** Ended, and "Fade past events" is on. */
12
+ faded: boolean;
13
+ happeningNow: boolean;
14
+ editable: boolean;
15
+ /** Can be dragged and moved with the keyboard on the grid. */
16
+ movable: boolean;
17
+ /** The room is waiting for approval. */
18
+ roomPending: boolean;
19
+ /** The room booking was turned down. */
20
+ roomRefused: boolean;
21
+ repeating: boolean;
22
+ /** A video call to join. */
23
+ online: boolean;
24
+ /** "Busy" or the title. */
25
+ title: string;
26
+ /** Where: the room, "Video call", or the first part of the address. */
27
+ place: string | null;
28
+ }
29
+ export interface LookContext {
30
+ tr: Tr;
31
+ me: string | null;
32
+ now: Date;
33
+ timeZone: string;
34
+ dimPast: boolean;
35
+ calendar: CalendarV2 | undefined;
36
+ /** The person's answer, with one given on this page first. */
37
+ answer: EventResponseV2 | null;
38
+ }
39
+ export declare function eventLook(event: CalendarEventV2, context: LookContext): EventLook;
40
+ /** What a screen reader hears for an event: title, when, calendar, and its markers. */
41
+ export declare function eventAriaLabel(event: CalendarEventV2, look: EventLook, context: {
42
+ tr: Tr;
43
+ format: CalendarFormat;
44
+ timeZone: string;
45
+ calendarName: string | null;
46
+ }): string;
@@ -0,0 +1,35 @@
1
+ import { formatDayTimeSpan as e, formatInstantRange as t } from "../format.js";
2
+ import { eventDays as n } from "../time/calendarTime.js";
3
+ import { canEditEvent as r, canMoveOnGrid as i, eventRoom as a, isBusyOnly as o, isHappeningNow as s, isPastEvent as c, joinUrl as l, myPart as u } from "./eventModel.js";
4
+ // src/v2/events/eventLook.ts
5
+ function d(e, t) {
6
+ let n = o(e, t.calendar, t.me), d = u({
7
+ ...e,
8
+ myResponse: t.answer ?? e.myResponse
9
+ }, t.me), f = n ? null : a(e), p = !n && l(e) !== null, m = (e.location ?? e.locationAddress ?? "").split(",")[0]?.trim() ?? "";
10
+ return {
11
+ busyOnly: n,
12
+ invitation: !n && d === "invited",
13
+ maybe: !n && d === "maybe",
14
+ declined: !n && d === "declined",
15
+ faded: t.dimPast && c(e, t.now, t.timeZone),
16
+ happeningNow: s(e, t.now),
17
+ editable: !n && r(e, t.calendar, t.me),
18
+ movable: !n && i(e, t.calendar, t.me, t.timeZone),
19
+ roomPending: f?.status === "PENDING",
20
+ roomRefused: f?.status === "REJECTED",
21
+ repeating: !n && e.isRecurring,
22
+ online: p,
23
+ title: n ? t.tr("calendar.v2.busy", "Busy") : e.title || t.tr("calendar.v2.untitled", "(No title)"),
24
+ place: n ? null : f?.name ?? (p ? t.tr("calendar.v2.videoCall", "Video call") : m || null)
25
+ };
26
+ }
27
+ function f(r, i, a) {
28
+ let { tr: o } = a, s = n(r, a.timeZone), c;
29
+ c = r.allDay ? o("calendar.v2.allDayLower", "all day") : s.start === s.end ? t(r.start, r.end, a.timeZone, a.format) : e(r.start, r.end, a.timeZone, a.format);
30
+ let l = [i.title, c];
31
+ return a.calendarName && l.push(a.calendarName), i.invitation && l.push(o("calendar.v2.markerInvitation", "waiting for your answer")), i.maybe && l.push(o("calendar.v2.markerMaybe", "you said maybe")), i.declined && l.push(o("calendar.v2.markerDeclined", "you declined")), i.roomPending && l.push(o("calendar.v2.markerRoomPending", "room waiting for approval")), i.roomRefused && l.push(o("calendar.v2.markerRoomRefused", "room not available")), i.repeating && l.push(o("calendar.v2.markerRepeats", "repeats")), i.happeningNow && l.push(o("calendar.v2.markerNow", "happening now")), l.join(", ");
32
+ }
33
+ export { f as eventAriaLabel, d as eventLook };
34
+
35
+ //# sourceMappingURL=eventLook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventLook.js","names":["eventLook","busyOnly","isBusyOnly","event","context","part","myPart","room","eventRoom","online","joinUrl","address","isPastEvent","isHappeningNow","canEditEvent","canMoveOnGrid","eventAriaLabel","days","eventDays","when","tr","formatInstantRange","formatDayTimeSpan","parts","look"],"sources":["../../../src/v2/events/eventLook.ts"],"sourcesContent":["/**\n * How an event looks in every view (BOFF-15698 A1): the markers (invitation, maybe, private\n * \"Busy\", ended, on now, room waiting or refused, repeating) and the words a screen reader\n * hears for it. Pure apart from the translations it is given.\n */\nimport type { Tr } from '../data/useEventActions';\nimport type { CalendarFormat } from '../format';\nimport { formatDayTimeSpan, formatInstantRange } from '../format';\nimport { eventDays } from '../time/calendarTime';\nimport type { CalendarEventV2, CalendarV2, EventResponseV2 } from '../types';\nimport {\n canEditEvent,\n canMoveOnGrid,\n eventRoom,\n isBusyOnly,\n isHappeningNow,\n isPastEvent,\n joinUrl,\n myPart,\n} from './eventModel';\n\nexport interface EventLook {\n /** Someone else's private time: only \"Busy\" shows. */\n busyOnly: boolean;\n /** Waiting for the person's answer. */\n invitation: boolean;\n maybe: boolean;\n declined: boolean;\n /** Ended, and \"Fade past events\" is on. */\n faded: boolean;\n happeningNow: boolean;\n editable: boolean;\n /** Can be dragged and moved with the keyboard on the grid. */\n movable: boolean;\n /** The room is waiting for approval. */\n roomPending: boolean;\n /** The room booking was turned down. */\n roomRefused: boolean;\n repeating: boolean;\n /** A video call to join. */\n online: boolean;\n /** \"Busy\" or the title. */\n title: string;\n /** Where: the room, \"Video call\", or the first part of the address. */\n place: string | null;\n}\n\nexport interface LookContext {\n tr: Tr;\n me: string | null;\n now: Date;\n timeZone: string;\n dimPast: boolean;\n calendar: CalendarV2 | undefined;\n /** The person's answer, with one given on this page first. */\n answer: EventResponseV2 | null;\n}\n\nexport function eventLook(event: CalendarEventV2, context: LookContext): EventLook {\n const busyOnly = isBusyOnly(event, context.calendar, context.me);\n const part = myPart({ ...event, myResponse: context.answer ?? event.myResponse }, context.me);\n // Someone else's private time shows nothing but \"Busy\": no room, call or repeat markers.\n const room = busyOnly ? null : eventRoom(event);\n const online = !busyOnly && joinUrl(event) !== null;\n const address = (event.location ?? event.locationAddress ?? '').split(',')[0]?.trim() ?? '';\n return {\n busyOnly,\n invitation: !busyOnly && part === 'invited',\n maybe: !busyOnly && part === 'maybe',\n declined: !busyOnly && part === 'declined',\n faded: context.dimPast && isPastEvent(event, context.now, context.timeZone),\n happeningNow: isHappeningNow(event, context.now),\n editable: !busyOnly && canEditEvent(event, context.calendar, context.me),\n movable: !busyOnly && canMoveOnGrid(event, context.calendar, context.me, context.timeZone),\n roomPending: room?.status === 'PENDING',\n roomRefused: room?.status === 'REJECTED',\n repeating: !busyOnly && event.isRecurring,\n online,\n title: busyOnly\n ? context.tr('calendar.v2.busy', 'Busy')\n : event.title || context.tr('calendar.v2.untitled', '(No title)'),\n place: busyOnly\n ? null\n : (room?.name ??\n (online ? context.tr('calendar.v2.videoCall', 'Video call') : address || null)),\n };\n}\n\n/** What a screen reader hears for an event: title, when, calendar, and its markers. */\nexport function eventAriaLabel(\n event: CalendarEventV2,\n look: EventLook,\n context: { tr: Tr; format: CalendarFormat; timeZone: string; calendarName: string | null }\n): string {\n const { tr } = context;\n const days = eventDays(event, context.timeZone);\n let when: string;\n if (event.allDay) when = tr('calendar.v2.allDayLower', 'all day');\n else if (days.start === days.end) {\n when = formatInstantRange(event.start, event.end, context.timeZone, context.format);\n } else {\n // Over midnight, or a day or more: both ends with their days.\n when = formatDayTimeSpan(event.start, event.end, context.timeZone, context.format);\n }\n const parts = [look.title, when];\n if (context.calendarName) parts.push(context.calendarName);\n if (look.invitation) parts.push(tr('calendar.v2.markerInvitation', 'waiting for your answer'));\n if (look.maybe) parts.push(tr('calendar.v2.markerMaybe', 'you said maybe'));\n if (look.declined) parts.push(tr('calendar.v2.markerDeclined', 'you declined'));\n if (look.roomPending)\n parts.push(tr('calendar.v2.markerRoomPending', 'room waiting for approval'));\n if (look.roomRefused) parts.push(tr('calendar.v2.markerRoomRefused', 'room not available'));\n if (look.repeating) parts.push(tr('calendar.v2.markerRepeats', 'repeats'));\n if (look.happeningNow) parts.push(tr('calendar.v2.markerNow', 'happening now'));\n return parts.join(', ');\n}\n"],"mappings":";;;;AA0DA,SAAgBA,EAAU,GAAwB,GAAiC;CACjF,IAAMC,IAAWC,EAAWC,GAAOC,EAAQ,UAAUA,EAAQ,EAAE,GACzDC,IAAOC,EAAO;EAAE,GAAGH;EAAO,YAAYC,EAAQ,UAAUD,EAAM;CAAW,GAAGC,EAAQ,EAAE,GAEtFG,IAAON,IAAW,OAAOO,EAAUL,CAAK,GACxCM,IAAS,CAACR,KAAYS,EAAQP,CAAK,MAAM,MAC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