@arbidocs/blocks 0.5.8 → 0.5.10

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 (95) hide show
  1. package/dist/{ConnectedNativeDocxComparison-VZLB7WWW.cjs → ConnectedNativeDocxComparison-E2QVYVVI.cjs} +8 -7
  2. package/dist/{ConnectedNativeDocxComparison-VZLB7WWW.cjs.map → ConnectedNativeDocxComparison-E2QVYVVI.cjs.map} +1 -1
  3. package/dist/{ConnectedNativeDocxComparison-4MI22H2R.js → ConnectedNativeDocxComparison-KPAQMOIF.js} +7 -6
  4. package/dist/{ConnectedNativeDocxComparison-4MI22H2R.js.map → ConnectedNativeDocxComparison-KPAQMOIF.js.map} +1 -1
  5. package/dist/{ConnectedNativeDocxEditor-YBHAQQSY.js → ConnectedNativeDocxEditor-5PF7J3CP.js} +6 -5
  6. package/dist/{ConnectedNativeDocxEditor-YBHAQQSY.js.map → ConnectedNativeDocxEditor-5PF7J3CP.js.map} +1 -1
  7. package/dist/{ConnectedNativeDocxEditor-74PFGTMR.cjs → ConnectedNativeDocxEditor-XV3K77ZB.cjs} +8 -7
  8. package/dist/{ConnectedNativeDocxEditor-74PFGTMR.cjs.map → ConnectedNativeDocxEditor-XV3K77ZB.cjs.map} +1 -1
  9. package/dist/{ConnectedStreamedWordArtifact-63ME4QD5.cjs → ConnectedStreamedWordArtifact-3N5CIXZU.cjs} +8 -7
  10. package/dist/ConnectedStreamedWordArtifact-3N5CIXZU.cjs.map +1 -0
  11. package/dist/{ConnectedStreamedWordArtifact-ELHQ2VYL.js → ConnectedStreamedWordArtifact-L45BLBRH.js} +7 -6
  12. package/dist/{ConnectedStreamedWordArtifact-ELHQ2VYL.js.map → ConnectedStreamedWordArtifact-L45BLBRH.js.map} +1 -1
  13. package/dist/{WorkspaceTableView-3TIMUU2J.js → WorkspaceTableView-EZAFYKAJ.js} +4 -3
  14. package/dist/WorkspaceTableView-EZAFYKAJ.js.map +1 -0
  15. package/dist/{WorkspaceTableView-FROHEPCT.cjs → WorkspaceTableView-MQXVE3JB.cjs} +4 -3
  16. package/dist/WorkspaceTableView-MQXVE3JB.cjs.map +1 -0
  17. package/dist/agents/index.cjs +327 -326
  18. package/dist/agents/index.js +5 -4
  19. package/dist/calendar/EventAttachments.d.ts +17 -0
  20. package/dist/calendar/EventEditor.d.ts +1 -1
  21. package/dist/calendar/conference.d.ts +2 -0
  22. package/dist/calendar/index.cjs +117 -120
  23. package/dist/calendar/index.d.ts +0 -1
  24. package/dist/calendar/index.js +2 -1
  25. package/dist/calendar/types.d.ts +15 -35
  26. package/dist/{chunk-2A2QX3MS.js → chunk-3SKLWW5D.js} +4 -3
  27. package/dist/chunk-3SKLWW5D.js.map +1 -0
  28. package/dist/{chunk-Z7KGBVKI.js → chunk-6NSGSEYS.js} +5 -5
  29. package/dist/{chunk-Z7KGBVKI.js.map → chunk-6NSGSEYS.js.map} +1 -1
  30. package/dist/{chunk-FEYRHZYB.js → chunk-6SPVTPUQ.js} +3 -3
  31. package/dist/{chunk-FEYRHZYB.js.map → chunk-6SPVTPUQ.js.map} +1 -1
  32. package/dist/{chunk-M6Z7HTJ2.cjs → chunk-6TE3QA3Y.cjs} +6 -5
  33. package/dist/chunk-6TE3QA3Y.cjs.map +1 -0
  34. package/dist/{chunk-BJ24VPOA.js → chunk-AFIJCK66.js} +210 -214
  35. package/dist/chunk-AFIJCK66.js.map +1 -0
  36. package/dist/{chunk-2VHYOTWW.cjs → chunk-AQPZ4QMV.cjs} +3 -201
  37. package/dist/chunk-AQPZ4QMV.cjs.map +1 -0
  38. package/dist/{chunk-TUODUKDK.cjs → chunk-DP4GMPI3.cjs} +4 -4
  39. package/dist/{chunk-TUODUKDK.cjs.map → chunk-DP4GMPI3.cjs.map} +1 -1
  40. package/dist/{chunk-IK4AWPDW.js → chunk-ELH375VC.js} +3 -3
  41. package/dist/{chunk-IK4AWPDW.js.map → chunk-ELH375VC.js.map} +1 -1
  42. package/dist/{chunk-X5FS27BM.js → chunk-FJCSJLTM.js} +4 -4
  43. package/dist/{chunk-X5FS27BM.js.map → chunk-FJCSJLTM.js.map} +1 -1
  44. package/dist/{chunk-AQ2XKOQ7.js → chunk-FT22URKT.js} +4 -4
  45. package/dist/{chunk-AQ2XKOQ7.js.map → chunk-FT22URKT.js.map} +1 -1
  46. package/dist/{chunk-NUSBINUM.js → chunk-G4GLDQLY.js} +7 -203
  47. package/dist/chunk-G4GLDQLY.js.map +1 -0
  48. package/dist/{chunk-2CTG4DHL.cjs → chunk-I7GQO43N.cjs} +7 -7
  49. package/dist/{chunk-2CTG4DHL.cjs.map → chunk-I7GQO43N.cjs.map} +1 -1
  50. package/dist/{chunk-PSTA227J.cjs → chunk-NG6AGVZ4.cjs} +10 -10
  51. package/dist/{chunk-PSTA227J.cjs.map → chunk-NG6AGVZ4.cjs.map} +1 -1
  52. package/dist/{chunk-M7LMEVXY.cjs → chunk-PFJIGGNN.cjs} +50 -50
  53. package/dist/{chunk-M7LMEVXY.cjs.map → chunk-PFJIGGNN.cjs.map} +1 -1
  54. package/dist/{chunk-LLYZGH3L.cjs → chunk-PXVSZRCA.cjs} +208 -213
  55. package/dist/chunk-PXVSZRCA.cjs.map +1 -0
  56. package/dist/{chunk-AY66THUZ.cjs → chunk-RPWWMOYP.cjs} +9 -9
  57. package/dist/{chunk-AY66THUZ.cjs.map → chunk-RPWWMOYP.cjs.map} +1 -1
  58. package/dist/{chunk-3IQUMSJI.js → chunk-VMMRK4SR.js} +3 -3
  59. package/dist/{chunk-3IQUMSJI.js.map → chunk-VMMRK4SR.js.map} +1 -1
  60. package/dist/chunk-VZOOGA47.cjs +210 -0
  61. package/dist/chunk-VZOOGA47.cjs.map +1 -0
  62. package/dist/chunk-WNDIVNPT.js +207 -0
  63. package/dist/chunk-WNDIVNPT.js.map +1 -0
  64. package/dist/{chunk-6HPBSKXG.cjs → chunk-XUKQQCOK.cjs} +4 -4
  65. package/dist/{chunk-6HPBSKXG.cjs.map → chunk-XUKQQCOK.cjs.map} +1 -1
  66. package/dist/connect/docx.cjs +10 -9
  67. package/dist/connect/docx.js +6 -5
  68. package/dist/connect/index.cjs +381 -381
  69. package/dist/connect/index.cjs.map +1 -1
  70. package/dist/connect/index.js +90 -90
  71. package/dist/connect/index.js.map +1 -1
  72. package/dist/connect/viewer.cjs +3 -3
  73. package/dist/connect/viewer.js +3 -3
  74. package/dist/index.cjs +382 -381
  75. package/dist/index.cjs.map +1 -1
  76. package/dist/index.js +6 -5
  77. package/dist/index.js.map +1 -1
  78. package/dist/settings/index.cjs +10 -9
  79. package/dist/settings/index.js +2 -1
  80. package/dist/workflow-canvas/index.cjs +18 -17
  81. package/dist/workflow-canvas/index.cjs.map +1 -1
  82. package/dist/workflow-canvas/index.js +5 -4
  83. package/dist/workflow-canvas/index.js.map +1 -1
  84. package/node_modules/@arbidocs/coedit/package.json +1 -1
  85. package/package.json +5 -5
  86. package/dist/ConnectedStreamedWordArtifact-63ME4QD5.cjs.map +0 -1
  87. package/dist/WorkspaceTableView-3TIMUU2J.js.map +0 -1
  88. package/dist/WorkspaceTableView-FROHEPCT.cjs.map +0 -1
  89. package/dist/calendar/RoomFinder.d.ts +0 -2
  90. package/dist/chunk-2A2QX3MS.js.map +0 -1
  91. package/dist/chunk-2VHYOTWW.cjs.map +0 -1
  92. package/dist/chunk-BJ24VPOA.js.map +0 -1
  93. package/dist/chunk-LLYZGH3L.cjs.map +0 -1
  94. package/dist/chunk-M6Z7HTJ2.cjs.map +0 -1
  95. package/dist/chunk-NUSBINUM.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { safeZone, isValidTimeZone, utcToDate, addDays, convertWall, utcToTime, zoneOffsetLabel, formatInZone, zoneCity, todayInZone, startOfWeek, formatPlainDate, addMonths, isoWeekNumber, diffDays, utcToWall, listTimeZones, zoneOffsetMinutes, wallToEpochMs, dayOfWeekSun0, detectTimeZone, wallToUtc, wallArrayOffset, epochToWallArray } from './chunk-GTCC2VAR.js';
3
+ import { DocumentPicker } from './chunk-WNDIVNPT.js';
3
4
  import { forwardRef, useMemo, useRef, useState, useCallback, useEffect, useId } from 'react';
4
5
  import FullCalendar from '@fullcalendar/react';
5
6
  import dayGridPlugin from '@fullcalendar/daygrid';
@@ -7,7 +8,7 @@ import timeGridPlugin from '@fullcalendar/timegrid';
7
8
  import listPlugin from '@fullcalendar/list';
8
9
  import interactionPlugin from '@fullcalendar/interaction';
9
10
  import multiMonthPlugin from '@fullcalendar/multimonth';
10
- import { ChevronLeft, ChevronRight, Plus, Lightbulb, Workflow, ListTodo, Lock, EllipsisVertical, Globe, ChevronDown, Check, Clock, Repeat, CalendarDays, X, Video, MapPin, Users, TextAlignStart, Bell, Tag, Palette, Paperclip, Trash2, Pencil, CircleCheck, CircleX, DoorOpen, User, Sparkles } from 'lucide-react';
11
+ import { ChevronLeft, ChevronRight, Plus, Lightbulb, Workflow, ListTodo, Lock, EllipsisVertical, Globe, ChevronDown, Check, Clock, Repeat, CalendarDays, X, Video, MapPin, Users, TextAlignStart, Bell, Tag, Palette, Trash2, Pencil, CircleCheck, CircleX, DoorOpen, Paperclip, User, Sparkles } from 'lucide-react';
11
12
  import { cn, Button, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, Input, Popover, PopoverTrigger, PopoverContent, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, Switch, Textarea, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from '@arbidocs/react/ui';
12
13
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
13
14
  import { createPlugin } from '@fullcalendar/core';
@@ -80,7 +81,7 @@ var CALENDAR_DEFAULT_LABELS = {
80
81
  reminders: "Reminders",
81
82
  addReminder: "Add reminder",
82
83
  useDefaultReminders: "Use calendar default reminders",
83
- conference: "Video call",
84
+ conference: "Audio or video call",
84
85
  addArbiCall: "Add ARBI call",
85
86
  addArbiWebinar: "Add ARBI webinar",
86
87
  webinar: "Webinar",
@@ -90,9 +91,9 @@ var CALENDAR_DEFAULT_LABELS = {
90
91
  panelist: "Panelist",
91
92
  webinarAttendee: "Attendee",
92
93
  joinWebinar: "Join webinar",
93
- addMeetingLink: "Add meeting link",
94
- meetingLinkPlaceholder: "https://\u2026",
95
- removeConference: "Remove video call",
94
+ addMeetingLink: "Add call link or dial-in",
95
+ meetingLinkPlaceholder: "https://\u2026 or phone number",
96
+ removeConference: "Remove call",
96
97
  attachments: "Attachments",
97
98
  addAttachment: "Add link",
98
99
  attachmentUrlPlaceholder: "https://\u2026",
@@ -175,14 +176,6 @@ var CALENDAR_DEFAULT_LABELS = {
175
176
  unknownAvailability: "Availability not shared",
176
177
  outsideWorkingHours: "Outside working hours",
177
178
  rooms: "Rooms",
178
- findRoom: "Find a room",
179
- minCapacity: "Min. capacity",
180
- featureFilter: "Feature",
181
- addRoom: "Add",
182
- roomAdded: "Added",
183
- roomFree: "Free",
184
- roomBusy: "Busy",
185
- noRooms: "No rooms match.",
186
179
  room: "Room",
187
180
  you: "You",
188
181
  addCalendar: "Add calendar",
@@ -1297,6 +1290,31 @@ function CalendarList({
1297
1290
  ] });
1298
1291
  }
1299
1292
 
1293
+ // src/calendar/conference.ts
1294
+ var JOIN_EARLY_MS = 10 * 6e4;
1295
+ function normalizeConferenceAddress(value) {
1296
+ const trimmed = value.trim();
1297
+ if (/^https?:\/\//i.test(trimmed) || /^tel:/i.test(trimmed)) return trimmed;
1298
+ const digits = trimmed.replace(/\D/g, "");
1299
+ if (digits.length >= 7 && /^[+\d\s().-]+$/.test(trimmed))
1300
+ return `tel:${trimmed.replace(/[\s().-]/g, "")}`;
1301
+ return trimmed;
1302
+ }
1303
+ function conferenceUrl(event) {
1304
+ const url = event.conference?.url;
1305
+ return url && /^(https?:\/\/|tel:)/i.test(url) ? url : null;
1306
+ }
1307
+ function canJoinEvent(event, now = Date.now()) {
1308
+ if (!conferenceUrl(event)) return false;
1309
+ return now >= new Date(event.start_utc).getTime() - JOIN_EARLY_MS && now <= new Date(event.end_utc).getTime();
1310
+ }
1311
+ function upcomingOf(events, now, {
1312
+ showDeclined = false,
1313
+ hidden = /* @__PURE__ */ new Set()
1314
+ } = {}) {
1315
+ return events.filter((e) => Date.parse(e.end_utc) > now).filter((e) => showDeclined || e.my_partstat !== "declined").filter((e) => e.status !== "cancelled" && !hidden.has(e.calendar_id)).sort((a, b) => a.start_utc.localeCompare(b.start_utc));
1316
+ }
1317
+
1300
1318
  // src/calendar/draft.ts
1301
1319
  var isAllDayDraft = (d) => !!d.start.date;
1302
1320
  var datePart = (spec) => spec.date ?? (spec.date_time ?? "").slice(0, 10);
@@ -2113,6 +2131,153 @@ function formatReminder(minutesBefore, labels = DEFAULT_REMINDER_FORMAT_LABELS)
2113
2131
  return `${value} ${word} ${minutesBefore > 0 ? labels.before : labels.after}`;
2114
2132
  }
2115
2133
  var REMINDER_PRESETS = [0, 5, 10, 15, 30, 60, 120, 24 * 60, 2 * 24 * 60, 7 * 24 * 60];
2134
+ function EventAttachments({
2135
+ attachments,
2136
+ documents,
2137
+ workspaces,
2138
+ currentWorkspaceId,
2139
+ onChange,
2140
+ onUpload,
2141
+ labels
2142
+ }) {
2143
+ const [attachUrl, setAttachUrl] = useState("");
2144
+ const [attachTitle, setAttachTitle] = useState("");
2145
+ const [workspaceId, setWorkspaceId] = useState(currentWorkspaceId ?? "");
2146
+ const [uploading, setUploading] = useState(false);
2147
+ const [error, setError] = useState(null);
2148
+ const groups = [
2149
+ {
2150
+ id: "workspace",
2151
+ heading: "In this workspace",
2152
+ docs: documents.map((doc) => ({ id: doc.doc_id, title: doc.title }))
2153
+ }
2154
+ ];
2155
+ const addLink = () => {
2156
+ const url = attachUrl.trim();
2157
+ if (!url) return;
2158
+ onChange([...attachments, { url, title: attachTitle.trim() || null }]);
2159
+ setAttachUrl("");
2160
+ setAttachTitle("");
2161
+ };
2162
+ const toggleDocument = (id) => {
2163
+ const document2 = documents.find((item) => item.doc_id === id);
2164
+ if (!document2) return;
2165
+ const exists = attachments.some((item) => item.doc_id === id);
2166
+ onChange(exists ? attachments.filter((item) => item.doc_id !== id) : [...attachments, document2]);
2167
+ };
2168
+ const uploadFiles = async (selected) => {
2169
+ if (!selected?.length || !onUpload || !workspaceId) return;
2170
+ setUploading(true);
2171
+ setError(null);
2172
+ try {
2173
+ onChange([...attachments, ...await onUpload(Array.from(selected), workspaceId)]);
2174
+ } catch (err) {
2175
+ setError(err instanceof Error ? err.message : "Could not upload attachments");
2176
+ } finally {
2177
+ setUploading(false);
2178
+ }
2179
+ };
2180
+ return /* @__PURE__ */ jsxs(FieldRow, { icon: /* @__PURE__ */ jsx(Paperclip, { className: "h-4 w-4" }), label: labels.attachments, children: [
2181
+ attachments.length > 0 && /* @__PURE__ */ jsx("ul", { className: "space-y-1", children: attachments.map((attachment, index) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2 text-sm", children: [
2182
+ /* @__PURE__ */ jsx(
2183
+ "a",
2184
+ {
2185
+ href: attachment.url,
2186
+ target: "_blank",
2187
+ rel: "noreferrer",
2188
+ className: "min-w-0 flex-1 truncate text-primary hover:underline",
2189
+ children: attachment.title || attachment.url
2190
+ }
2191
+ ),
2192
+ /* @__PURE__ */ jsx(
2193
+ "button",
2194
+ {
2195
+ type: "button",
2196
+ className: "rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
2197
+ "aria-label": `${labels.remove} ${attachment.title || attachment.url}`,
2198
+ onClick: () => onChange(attachments.filter((_, itemIndex) => itemIndex !== index)),
2199
+ children: /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\xD7" })
2200
+ }
2201
+ )
2202
+ ] }, `${attachment.url}-${index}`)) }),
2203
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
2204
+ /* @__PURE__ */ jsx(
2205
+ Input,
2206
+ {
2207
+ type: "url",
2208
+ "aria-label": labels.attachmentUrlPlaceholder,
2209
+ placeholder: labels.attachmentUrlPlaceholder,
2210
+ className: "h-8 min-w-0 flex-1",
2211
+ value: attachUrl,
2212
+ onChange: (event) => setAttachUrl(event.target.value)
2213
+ }
2214
+ ),
2215
+ /* @__PURE__ */ jsx(
2216
+ Input,
2217
+ {
2218
+ "aria-label": labels.attachmentTitlePlaceholder,
2219
+ placeholder: labels.attachmentTitlePlaceholder,
2220
+ className: "h-8 w-40",
2221
+ value: attachTitle,
2222
+ onChange: (event) => setAttachTitle(event.target.value)
2223
+ }
2224
+ ),
2225
+ /* @__PURE__ */ jsx(
2226
+ Button,
2227
+ {
2228
+ type: "button",
2229
+ size: "sm",
2230
+ variant: "outline",
2231
+ onClick: addLink,
2232
+ disabled: !attachUrl.trim(),
2233
+ children: labels.addAttachment
2234
+ }
2235
+ )
2236
+ ] }),
2237
+ documents.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-2 space-y-1", children: [
2238
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Choose existing documents" }),
2239
+ /* @__PURE__ */ jsx(
2240
+ DocumentPicker,
2241
+ {
2242
+ groups,
2243
+ value: "",
2244
+ selectedIds: attachments.flatMap((item) => item.doc_id ? [item.doc_id] : []),
2245
+ onValueChange: toggleDocument,
2246
+ labels: { placeholder: "Search this workspace\u2026" }
2247
+ }
2248
+ )
2249
+ ] }),
2250
+ onUpload && workspaces.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: [
2251
+ /* @__PURE__ */ jsx("span", { className: "w-full text-xs text-muted-foreground", children: "Attach files (saved to a workspace)" }),
2252
+ /* @__PURE__ */ jsx(
2253
+ NativeSelect,
2254
+ {
2255
+ "aria-label": "Save attachment to workspace",
2256
+ value: workspaceId,
2257
+ onChange: (event) => setWorkspaceId(event.target.value),
2258
+ className: "h-8 max-w-56",
2259
+ children: workspaces.map((workspace) => /* @__PURE__ */ jsx("option", { value: workspace.id, children: workspace.id === currentWorkspaceId ? `${workspace.name} (current workspace)` : workspace.name }, workspace.id))
2260
+ }
2261
+ ),
2262
+ /* @__PURE__ */ jsx(
2263
+ Input,
2264
+ {
2265
+ type: "file",
2266
+ multiple: true,
2267
+ "aria-label": "Choose files to attach",
2268
+ className: "h-8 min-w-0 flex-1",
2269
+ disabled: uploading,
2270
+ onChange: (event) => {
2271
+ void uploadFiles(event.target.files);
2272
+ event.currentTarget.value = "";
2273
+ }
2274
+ }
2275
+ ),
2276
+ uploading && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "Saving attachments\u2026" })
2277
+ ] }),
2278
+ error && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", role: "alert", children: error })
2279
+ ] });
2280
+ }
2116
2281
  var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
2117
2282
  function Chip({
2118
2283
  children,
@@ -2156,6 +2321,10 @@ function EventEditor({
2156
2321
  isWebinarAttendee,
2157
2322
  defaultTimeZone,
2158
2323
  schedulingSlot,
2324
+ attachmentDocuments = [],
2325
+ attachmentWorkspaces = [],
2326
+ currentWorkspaceId,
2327
+ onUploadAttachments,
2159
2328
  attendeeSuggestions,
2160
2329
  onAttendeeQueryChange,
2161
2330
  saving,
@@ -2176,8 +2345,6 @@ function EventEditor({
2176
2345
  const [attendeeInput, setAttendeeInput] = useState("");
2177
2346
  const [categoryInput, setCategoryInput] = useState("");
2178
2347
  const [linkInput, setLinkInput] = useState(null);
2179
- const [attachUrl, setAttachUrl] = useState("");
2180
- const [attachTitle, setAttachTitle] = useState("");
2181
2348
  const [addingCall, setAddingCall] = useState(false);
2182
2349
  const [webinar, setWebinar] = useState(false);
2183
2350
  const [touched, setTouched] = useState(false);
@@ -2239,14 +2406,6 @@ function EventEditor({
2239
2406
  const isWebinar = isWebinarConference(value.conference);
2240
2407
  const roles = value.conference?.roles ?? {};
2241
2408
  const setRole = (a, role) => value.conference && set({ conference: { ...value.conference, roles: { ...roles, [attendeeKey(a)]: role } } });
2242
- const attachments = value.attachments ?? [];
2243
- const addAttachment = () => {
2244
- const url = attachUrl.trim();
2245
- if (!url) return;
2246
- set({ attachments: [...attachments, { url, title: attachTitle.trim() || null }] });
2247
- setAttachUrl("");
2248
- setAttachTitle("");
2249
- };
2250
2409
  const startDate = specDate(value.start);
2251
2410
  const submit = () => {
2252
2411
  setTouched(true);
@@ -2453,7 +2612,7 @@ function EventEditor({
2453
2612
  /* @__PURE__ */ jsx(
2454
2613
  Input,
2455
2614
  {
2456
- type: "url",
2615
+ type: "text",
2457
2616
  "aria-label": l.addMeetingLink,
2458
2617
  placeholder: l.meetingLinkPlaceholder,
2459
2618
  value: linkInput,
@@ -2463,7 +2622,12 @@ function EventEditor({
2463
2622
  if (e.key === "Enter") {
2464
2623
  e.preventDefault();
2465
2624
  if (linkInput.trim())
2466
- set({ conference: { type: "external", url: linkInput.trim() } });
2625
+ set({
2626
+ conference: {
2627
+ type: "external",
2628
+ url: normalizeConferenceAddress(linkInput)
2629
+ }
2630
+ });
2467
2631
  setLinkInput(null);
2468
2632
  } else if (e.key === "Escape") setLinkInput(null);
2469
2633
  },
@@ -2478,7 +2642,9 @@ function EventEditor({
2478
2642
  variant: "outline",
2479
2643
  onClick: () => {
2480
2644
  if (linkInput.trim())
2481
- set({ conference: { type: "external", url: linkInput.trim() } });
2645
+ set({
2646
+ conference: { type: "external", url: normalizeConferenceAddress(linkInput) }
2647
+ });
2482
2648
  setLinkInput(null);
2483
2649
  },
2484
2650
  children: /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" })
@@ -2528,7 +2694,7 @@ function EventEditor({
2528
2694
  Input,
2529
2695
  {
2530
2696
  "aria-label": l.location,
2531
- placeholder: l.location,
2697
+ placeholder: "Physical location (optional)",
2532
2698
  value: value.location ?? "",
2533
2699
  onChange: (e) => set({ location: e.target.value || null }),
2534
2700
  "data-testid": "calendar-editor-location"
@@ -2892,65 +3058,18 @@ function EventEditor({
2892
3058
  ),
2893
3059
  !value.color && calendarColor && /* @__PURE__ */ jsx("span", { className: "sr-only", children: calendarColor })
2894
3060
  ] }),
2895
- /* @__PURE__ */ jsxs(FieldRow, { icon: /* @__PURE__ */ jsx(Paperclip, { className: "h-4 w-4" }), label: l.attachments, children: [
2896
- attachments.length > 0 && /* @__PURE__ */ jsx("ul", { className: "space-y-1", children: attachments.map((a, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2 text-sm", children: [
2897
- /* @__PURE__ */ jsx(
2898
- "a",
2899
- {
2900
- href: a.url,
2901
- target: "_blank",
2902
- rel: "noreferrer",
2903
- className: "min-w-0 flex-1 truncate text-primary hover:underline",
2904
- children: a.title || a.url
2905
- }
2906
- ),
2907
- /* @__PURE__ */ jsx(
2908
- "button",
2909
- {
2910
- type: "button",
2911
- className: "rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
2912
- "aria-label": `${l.remove} ${a.title || a.url}`,
2913
- onClick: () => set({ attachments: attachments.filter((_, j) => j !== i) }),
2914
- children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" })
2915
- }
2916
- )
2917
- ] }, `${a.url}-${i}`)) }),
2918
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
2919
- /* @__PURE__ */ jsx(
2920
- Input,
2921
- {
2922
- type: "url",
2923
- "aria-label": l.attachmentUrlPlaceholder,
2924
- placeholder: l.attachmentUrlPlaceholder,
2925
- className: "h-8 min-w-0 flex-1",
2926
- value: attachUrl,
2927
- onChange: (e) => setAttachUrl(e.target.value),
2928
- "data-testid": "calendar-editor-attachment-url"
2929
- }
2930
- ),
2931
- /* @__PURE__ */ jsx(
2932
- Input,
2933
- {
2934
- "aria-label": l.attachmentTitlePlaceholder,
2935
- placeholder: l.attachmentTitlePlaceholder,
2936
- className: "h-8 w-40",
2937
- value: attachTitle,
2938
- onChange: (e) => setAttachTitle(e.target.value)
2939
- }
2940
- ),
2941
- /* @__PURE__ */ jsx(
2942
- Button,
2943
- {
2944
- type: "button",
2945
- size: "sm",
2946
- variant: "outline",
2947
- onClick: addAttachment,
2948
- disabled: !attachUrl.trim(),
2949
- children: l.addAttachment
2950
- }
2951
- )
2952
- ] })
2953
- ] })
3061
+ /* @__PURE__ */ jsx(
3062
+ EventAttachments,
3063
+ {
3064
+ attachments: value.attachments ?? [],
3065
+ documents: attachmentDocuments,
3066
+ workspaces: attachmentWorkspaces,
3067
+ currentWorkspaceId,
3068
+ onChange: (attachments) => set({ attachments }),
3069
+ onUpload: onUploadAttachments,
3070
+ labels: l
3071
+ }
3072
+ )
2954
3073
  ] }),
2955
3074
  (error || shownProblem) && /* @__PURE__ */ jsx(
2956
3075
  "p",
@@ -3592,113 +3711,6 @@ function SchedulingAssistant({
3592
3711
  ] })
3593
3712
  ] });
3594
3713
  }
3595
- function RoomFinder({
3596
- rooms,
3597
- loading,
3598
- minCapacity,
3599
- feature,
3600
- onFiltersChange,
3601
- addedEmails,
3602
- onAdd,
3603
- labels: labelOverrides,
3604
- className
3605
- }) {
3606
- const l = mergeLabels(labelOverrides);
3607
- const added = new Set(addedEmails.map((e) => e.toLowerCase()));
3608
- return /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", className), "data-testid": "calendar-room-finder", children: [
3609
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
3610
- /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: l.findRoom }),
3611
- /* @__PURE__ */ jsx(
3612
- Input,
3613
- {
3614
- type: "number",
3615
- min: 1,
3616
- className: "h-8 w-28",
3617
- placeholder: l.minCapacity,
3618
- "aria-label": l.minCapacity,
3619
- value: minCapacity ?? "",
3620
- onChange: (e) => onFiltersChange({
3621
- minCapacity: e.target.value ? Math.max(1, Number(e.target.value)) : null,
3622
- feature
3623
- }),
3624
- "data-testid": "calendar-room-capacity"
3625
- }
3626
- ),
3627
- /* @__PURE__ */ jsx(
3628
- Input,
3629
- {
3630
- className: "h-8 w-32",
3631
- placeholder: l.featureFilter,
3632
- "aria-label": l.featureFilter,
3633
- value: feature,
3634
- onChange: (e) => onFiltersChange({ minCapacity, feature: e.target.value }),
3635
- "data-testid": "calendar-room-feature"
3636
- }
3637
- )
3638
- ] }),
3639
- /* @__PURE__ */ jsxs(
3640
- "ul",
3641
- {
3642
- className: cn(
3643
- "divide-y divide-border rounded-md border border-border",
3644
- loading && "opacity-60"
3645
- ),
3646
- children: [
3647
- rooms.length === 0 && /* @__PURE__ */ jsx("li", { className: "px-3 py-2 text-xs text-muted-foreground", children: l.noRooms }),
3648
- rooms.map((r) => {
3649
- const isAdded = added.has(r.email.toLowerCase());
3650
- return /* @__PURE__ */ jsxs(
3651
- "li",
3652
- {
3653
- className: "flex items-center gap-2 px-3 py-1.5 text-sm",
3654
- "data-testid": "calendar-room",
3655
- "data-room-email": r.email,
3656
- children: [
3657
- /* @__PURE__ */ jsx(DoorOpen, { className: "h-4 w-4 shrink-0 text-muted-foreground", "aria-hidden": true }),
3658
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
3659
- /* @__PURE__ */ jsx("div", { className: "truncate font-medium", children: r.name }),
3660
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-x-2 text-xs text-muted-foreground", children: [
3661
- r.capacity != null && /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-0.5", children: [
3662
- /* @__PURE__ */ jsx(Users, { className: "h-3 w-3", "aria-hidden": true }),
3663
- r.capacity
3664
- ] }),
3665
- (r.building || r.floor) && /* @__PURE__ */ jsx("span", { children: [r.building, r.floor].filter(Boolean).join(" \xB7 ") }),
3666
- (r.features ?? []).length > 0 && /* @__PURE__ */ jsx("span", { children: r.features?.join(", ") })
3667
- ] })
3668
- ] }),
3669
- r.free != null && /* @__PURE__ */ jsx(
3670
- "span",
3671
- {
3672
- className: cn(
3673
- "rounded-full px-2 py-0.5 text-xs",
3674
- r.free ? "bg-green-500/15 text-green-700 dark:text-green-400" : "bg-destructive/15 text-destructive"
3675
- ),
3676
- "data-testid": "calendar-room-availability",
3677
- children: r.free ? l.roomFree : l.roomBusy
3678
- }
3679
- ),
3680
- /* @__PURE__ */ jsx(
3681
- Button,
3682
- {
3683
- type: "button",
3684
- size: "sm",
3685
- variant: "outline",
3686
- disabled: isAdded,
3687
- onClick: () => onAdd(r),
3688
- "data-testid": "calendar-room-add",
3689
- children: isAdded ? l.roomAdded : l.addRoom
3690
- }
3691
- )
3692
- ]
3693
- },
3694
- r.id
3695
- );
3696
- })
3697
- ]
3698
- }
3699
- )
3700
- ] });
3701
- }
3702
3714
  var mondayFirstName = (day) => formatPlainDate(`2024-01-0${day + 1}`, { weekday: "long" });
3703
3715
  var sundayFirstName = (day) => formatPlainDate(day === 0 ? "2023-12-31" : `2024-01-0${day}`, { weekday: "long" });
3704
3716
  var VIEWS = ["day", "work_week", "week", "month", "agenda", "year"];
@@ -4396,7 +4408,8 @@ function eventToDraft(event, master) {
4396
4408
  attachments: (event.attachments ?? []).map((a) => ({
4397
4409
  url: a.url,
4398
4410
  title: a.title ?? null,
4399
- doc_id: a.doc_id ?? null
4411
+ doc_id: a.doc_id ?? null,
4412
+ mime_type: a.mime_type ?? null
4400
4413
  })),
4401
4414
  url: event.url ?? null,
4402
4415
  conversation_id: event.conversation_id ?? null,
@@ -4575,23 +4588,6 @@ function toSettingsValue(s) {
4575
4588
  };
4576
4589
  }
4577
4590
 
4578
- // src/calendar/conference.ts
4579
- var JOIN_EARLY_MS = 10 * 6e4;
4580
- function conferenceUrl(event) {
4581
- const url = event.conference?.url;
4582
- return url && /^https?:\/\//i.test(url) ? url : null;
4583
- }
4584
- function canJoinEvent(event, now = Date.now()) {
4585
- if (!conferenceUrl(event)) return false;
4586
- return now >= new Date(event.start_utc).getTime() - JOIN_EARLY_MS && now <= new Date(event.end_utc).getTime();
4587
- }
4588
- function upcomingOf(events, now, {
4589
- showDeclined = false,
4590
- hidden = /* @__PURE__ */ new Set()
4591
- } = {}) {
4592
- return events.filter((e) => Date.parse(e.end_utc) > now).filter((e) => showDeclined || e.my_partstat !== "declined").filter((e) => e.status !== "cancelled" && !hidden.has(e.calendar_id)).sort((a, b) => a.start_utc.localeCompare(b.start_utc));
4593
- }
4594
-
4595
4591
  // src/calendar/ics.ts
4596
4592
  function icsProps(text) {
4597
4593
  const lines = text.replace(/\r\n/g, "\n").replace(/\n[ \t]/g, "").split("\n");
@@ -5150,6 +5146,6 @@ function ProposeTimeDialog({
5150
5146
  ] }) });
5151
5147
  }
5152
5148
 
5153
- export { ARBI_WEBINAR_LABEL, CALENDAR_COLORS, CALENDAR_DEFAULT_LABELS, CALENDAR_NARROW_WIDTH, CalendarFormDialog, CalendarGrid, CalendarList, CalendarPrint, CalendarSettingsForm, DEFAULT_EVENT_COLOR, DEFAULT_INTERVAL, DEFAULT_RECURRENCE_DESCRIBE_LABELS, DEFAULT_RECURRENCE_EDITOR_LABELS, DEFAULT_REMINDER_FORMAT_LABELS, EventDetails, EventEditor, JOIN_EARLY_MS, MiniMonth, OVERLAY_COLORS, PENDING_EVENT_COLOR, ProposeTimeDialog, REMINDER_PRESETS, RRULE_WEEKDAYS, RecurrenceEditor, RoomFinder, SchedulingAssistant, ScopeDialog, TimeZonePicker, WEEKDAY_NAMES, WeeklyHoursEditor, allDayInclusiveEnd, applySuggestion, attendeeKey, bookingLink, bookingToForm, buildCreateBody, buildDeleteTarget, buildEditRequest, buildGridEvents, buildRRule, buildTimeChangeRequest, calendarGroup, calendarToListItem, canJoinEvent, conferenceUrl, contrastText, dayWindow, defaultRecurrenceForm, defaultRoomWindow, defaultWeeklyHours, describeCalendarError, describeRecurrence, diffDraft, draftFromSlot, draftRangeUtc, effectiveCalendarView, emptyBookingForm, eventDays, eventStateClasses, eventToDraft, eventToGrid, eventsByDay, formToBookingBody, formatBusy, formatDayLabel, formatEventWhen, formatReminder, formatSlotRange, formatSlotTime, formatZoneLabel, freeBusyToRows, getTemporalTimeZonePlugin, groupSlotsByDay, hourTicks, icsProps, isAllDayDraft, isCalendarAttachment, isWebinarConference, needsScope, newEventDraft, normalizeFeedUrl, outsideIntervals, overlayToGrid, parseDurations, parseIcsInvite, parseOverlayLink, parseRRule, pendingCreateToGrid, placeIntervals, printCalendar, printRange, publicBookingMessage, reminderToMinutes, scopedTarget, setDraftAllDay, setDraftEnd, setDraftStart, setPosOf, slugify, specDate, specTime, splitReminderMinutes, toBusinessHours, toSettingsValue, toSuggestionViews, upcomingOf, validateBookingForm, validateDraft, validateWeekly, weekdayMon0, weekdayOf, weeklyFromApi, weeklyToPayload, workWeekHiddenDays, workingIntervals, zoneOptions };
5154
- //# sourceMappingURL=chunk-BJ24VPOA.js.map
5155
- //# sourceMappingURL=chunk-BJ24VPOA.js.map
5149
+ export { ARBI_WEBINAR_LABEL, CALENDAR_COLORS, CALENDAR_DEFAULT_LABELS, CALENDAR_NARROW_WIDTH, CalendarFormDialog, CalendarGrid, CalendarList, CalendarPrint, CalendarSettingsForm, DEFAULT_EVENT_COLOR, DEFAULT_INTERVAL, DEFAULT_RECURRENCE_DESCRIBE_LABELS, DEFAULT_RECURRENCE_EDITOR_LABELS, DEFAULT_REMINDER_FORMAT_LABELS, EventDetails, EventEditor, JOIN_EARLY_MS, MiniMonth, OVERLAY_COLORS, PENDING_EVENT_COLOR, ProposeTimeDialog, REMINDER_PRESETS, RRULE_WEEKDAYS, RecurrenceEditor, SchedulingAssistant, ScopeDialog, TimeZonePicker, WEEKDAY_NAMES, WeeklyHoursEditor, allDayInclusiveEnd, applySuggestion, attendeeKey, bookingLink, bookingToForm, buildCreateBody, buildDeleteTarget, buildEditRequest, buildGridEvents, buildRRule, buildTimeChangeRequest, calendarGroup, calendarToListItem, canJoinEvent, conferenceUrl, contrastText, dayWindow, defaultRecurrenceForm, defaultRoomWindow, defaultWeeklyHours, describeCalendarError, describeRecurrence, diffDraft, draftFromSlot, draftRangeUtc, effectiveCalendarView, emptyBookingForm, eventDays, eventStateClasses, eventToDraft, eventToGrid, eventsByDay, formToBookingBody, formatBusy, formatDayLabel, formatEventWhen, formatReminder, formatSlotRange, formatSlotTime, formatZoneLabel, freeBusyToRows, getTemporalTimeZonePlugin, groupSlotsByDay, hourTicks, icsProps, isAllDayDraft, isCalendarAttachment, isWebinarConference, needsScope, newEventDraft, normalizeFeedUrl, outsideIntervals, overlayToGrid, parseDurations, parseIcsInvite, parseOverlayLink, parseRRule, pendingCreateToGrid, placeIntervals, printCalendar, printRange, publicBookingMessage, reminderToMinutes, scopedTarget, setDraftAllDay, setDraftEnd, setDraftStart, setPosOf, slugify, specDate, specTime, splitReminderMinutes, toBusinessHours, toSettingsValue, toSuggestionViews, upcomingOf, validateBookingForm, validateDraft, validateWeekly, weekdayMon0, weekdayOf, weeklyFromApi, weeklyToPayload, workWeekHiddenDays, workingIntervals, zoneOptions };
5150
+ //# sourceMappingURL=chunk-AFIJCK66.js.map
5151
+ //# sourceMappingURL=chunk-AFIJCK66.js.map