@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.
- package/dist/{ConnectedNativeDocxComparison-VZLB7WWW.cjs → ConnectedNativeDocxComparison-E2QVYVVI.cjs} +8 -7
- package/dist/{ConnectedNativeDocxComparison-VZLB7WWW.cjs.map → ConnectedNativeDocxComparison-E2QVYVVI.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-4MI22H2R.js → ConnectedNativeDocxComparison-KPAQMOIF.js} +7 -6
- package/dist/{ConnectedNativeDocxComparison-4MI22H2R.js.map → ConnectedNativeDocxComparison-KPAQMOIF.js.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-YBHAQQSY.js → ConnectedNativeDocxEditor-5PF7J3CP.js} +6 -5
- package/dist/{ConnectedNativeDocxEditor-YBHAQQSY.js.map → ConnectedNativeDocxEditor-5PF7J3CP.js.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-74PFGTMR.cjs → ConnectedNativeDocxEditor-XV3K77ZB.cjs} +8 -7
- package/dist/{ConnectedNativeDocxEditor-74PFGTMR.cjs.map → ConnectedNativeDocxEditor-XV3K77ZB.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-63ME4QD5.cjs → ConnectedStreamedWordArtifact-3N5CIXZU.cjs} +8 -7
- package/dist/ConnectedStreamedWordArtifact-3N5CIXZU.cjs.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-ELHQ2VYL.js → ConnectedStreamedWordArtifact-L45BLBRH.js} +7 -6
- package/dist/{ConnectedStreamedWordArtifact-ELHQ2VYL.js.map → ConnectedStreamedWordArtifact-L45BLBRH.js.map} +1 -1
- package/dist/{WorkspaceTableView-3TIMUU2J.js → WorkspaceTableView-EZAFYKAJ.js} +4 -3
- package/dist/WorkspaceTableView-EZAFYKAJ.js.map +1 -0
- package/dist/{WorkspaceTableView-FROHEPCT.cjs → WorkspaceTableView-MQXVE3JB.cjs} +4 -3
- package/dist/WorkspaceTableView-MQXVE3JB.cjs.map +1 -0
- package/dist/agents/index.cjs +327 -326
- package/dist/agents/index.js +5 -4
- package/dist/calendar/EventAttachments.d.ts +17 -0
- package/dist/calendar/EventEditor.d.ts +1 -1
- package/dist/calendar/conference.d.ts +2 -0
- package/dist/calendar/index.cjs +117 -120
- package/dist/calendar/index.d.ts +0 -1
- package/dist/calendar/index.js +2 -1
- package/dist/calendar/types.d.ts +15 -35
- package/dist/{chunk-2A2QX3MS.js → chunk-3SKLWW5D.js} +4 -3
- package/dist/chunk-3SKLWW5D.js.map +1 -0
- package/dist/{chunk-Z7KGBVKI.js → chunk-6NSGSEYS.js} +5 -5
- package/dist/{chunk-Z7KGBVKI.js.map → chunk-6NSGSEYS.js.map} +1 -1
- package/dist/{chunk-FEYRHZYB.js → chunk-6SPVTPUQ.js} +3 -3
- package/dist/{chunk-FEYRHZYB.js.map → chunk-6SPVTPUQ.js.map} +1 -1
- package/dist/{chunk-M6Z7HTJ2.cjs → chunk-6TE3QA3Y.cjs} +6 -5
- package/dist/chunk-6TE3QA3Y.cjs.map +1 -0
- package/dist/{chunk-BJ24VPOA.js → chunk-AFIJCK66.js} +210 -214
- package/dist/chunk-AFIJCK66.js.map +1 -0
- package/dist/{chunk-2VHYOTWW.cjs → chunk-AQPZ4QMV.cjs} +3 -201
- package/dist/chunk-AQPZ4QMV.cjs.map +1 -0
- package/dist/{chunk-TUODUKDK.cjs → chunk-DP4GMPI3.cjs} +4 -4
- package/dist/{chunk-TUODUKDK.cjs.map → chunk-DP4GMPI3.cjs.map} +1 -1
- package/dist/{chunk-IK4AWPDW.js → chunk-ELH375VC.js} +3 -3
- package/dist/{chunk-IK4AWPDW.js.map → chunk-ELH375VC.js.map} +1 -1
- package/dist/{chunk-X5FS27BM.js → chunk-FJCSJLTM.js} +4 -4
- package/dist/{chunk-X5FS27BM.js.map → chunk-FJCSJLTM.js.map} +1 -1
- package/dist/{chunk-AQ2XKOQ7.js → chunk-FT22URKT.js} +4 -4
- package/dist/{chunk-AQ2XKOQ7.js.map → chunk-FT22URKT.js.map} +1 -1
- package/dist/{chunk-NUSBINUM.js → chunk-G4GLDQLY.js} +7 -203
- package/dist/chunk-G4GLDQLY.js.map +1 -0
- package/dist/{chunk-2CTG4DHL.cjs → chunk-I7GQO43N.cjs} +7 -7
- package/dist/{chunk-2CTG4DHL.cjs.map → chunk-I7GQO43N.cjs.map} +1 -1
- package/dist/{chunk-PSTA227J.cjs → chunk-NG6AGVZ4.cjs} +10 -10
- package/dist/{chunk-PSTA227J.cjs.map → chunk-NG6AGVZ4.cjs.map} +1 -1
- package/dist/{chunk-M7LMEVXY.cjs → chunk-PFJIGGNN.cjs} +50 -50
- package/dist/{chunk-M7LMEVXY.cjs.map → chunk-PFJIGGNN.cjs.map} +1 -1
- package/dist/{chunk-LLYZGH3L.cjs → chunk-PXVSZRCA.cjs} +208 -213
- package/dist/chunk-PXVSZRCA.cjs.map +1 -0
- package/dist/{chunk-AY66THUZ.cjs → chunk-RPWWMOYP.cjs} +9 -9
- package/dist/{chunk-AY66THUZ.cjs.map → chunk-RPWWMOYP.cjs.map} +1 -1
- package/dist/{chunk-3IQUMSJI.js → chunk-VMMRK4SR.js} +3 -3
- package/dist/{chunk-3IQUMSJI.js.map → chunk-VMMRK4SR.js.map} +1 -1
- package/dist/chunk-VZOOGA47.cjs +210 -0
- package/dist/chunk-VZOOGA47.cjs.map +1 -0
- package/dist/chunk-WNDIVNPT.js +207 -0
- package/dist/chunk-WNDIVNPT.js.map +1 -0
- package/dist/{chunk-6HPBSKXG.cjs → chunk-XUKQQCOK.cjs} +4 -4
- package/dist/{chunk-6HPBSKXG.cjs.map → chunk-XUKQQCOK.cjs.map} +1 -1
- package/dist/connect/docx.cjs +10 -9
- package/dist/connect/docx.js +6 -5
- package/dist/connect/index.cjs +381 -381
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +90 -90
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/viewer.cjs +3 -3
- package/dist/connect/viewer.js +3 -3
- package/dist/index.cjs +382 -381
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/settings/index.cjs +10 -9
- package/dist/settings/index.js +2 -1
- package/dist/workflow-canvas/index.cjs +18 -17
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/index.js +5 -4
- package/dist/workflow-canvas/index.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ConnectedStreamedWordArtifact-63ME4QD5.cjs.map +0 -1
- package/dist/WorkspaceTableView-3TIMUU2J.js.map +0 -1
- package/dist/WorkspaceTableView-FROHEPCT.cjs.map +0 -1
- package/dist/calendar/RoomFinder.d.ts +0 -2
- package/dist/chunk-2A2QX3MS.js.map +0 -1
- package/dist/chunk-2VHYOTWW.cjs.map +0 -1
- package/dist/chunk-BJ24VPOA.js.map +0 -1
- package/dist/chunk-LLYZGH3L.cjs.map +0 -1
- package/dist/chunk-M6Z7HTJ2.cjs.map +0 -1
- package/dist/chunk-NUSBINUM.js.map +0 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkBIXHB4LV_cjs = require('./chunk-BIXHB4LV.cjs');
|
|
5
|
+
var chunkVZOOGA47_cjs = require('./chunk-VZOOGA47.cjs');
|
|
5
6
|
var react = require('react');
|
|
6
7
|
var FullCalendar = require('@fullcalendar/react');
|
|
7
8
|
var dayGridPlugin = require('@fullcalendar/daygrid');
|
|
@@ -91,7 +92,7 @@ var CALENDAR_DEFAULT_LABELS = {
|
|
|
91
92
|
reminders: "Reminders",
|
|
92
93
|
addReminder: "Add reminder",
|
|
93
94
|
useDefaultReminders: "Use calendar default reminders",
|
|
94
|
-
conference: "
|
|
95
|
+
conference: "Audio or video call",
|
|
95
96
|
addArbiCall: "Add ARBI call",
|
|
96
97
|
addArbiWebinar: "Add ARBI webinar",
|
|
97
98
|
webinar: "Webinar",
|
|
@@ -101,9 +102,9 @@ var CALENDAR_DEFAULT_LABELS = {
|
|
|
101
102
|
panelist: "Panelist",
|
|
102
103
|
webinarAttendee: "Attendee",
|
|
103
104
|
joinWebinar: "Join webinar",
|
|
104
|
-
addMeetingLink: "Add
|
|
105
|
-
meetingLinkPlaceholder: "https://\u2026",
|
|
106
|
-
removeConference: "Remove
|
|
105
|
+
addMeetingLink: "Add call link or dial-in",
|
|
106
|
+
meetingLinkPlaceholder: "https://\u2026 or phone number",
|
|
107
|
+
removeConference: "Remove call",
|
|
107
108
|
attachments: "Attachments",
|
|
108
109
|
addAttachment: "Add link",
|
|
109
110
|
attachmentUrlPlaceholder: "https://\u2026",
|
|
@@ -186,14 +187,6 @@ var CALENDAR_DEFAULT_LABELS = {
|
|
|
186
187
|
unknownAvailability: "Availability not shared",
|
|
187
188
|
outsideWorkingHours: "Outside working hours",
|
|
188
189
|
rooms: "Rooms",
|
|
189
|
-
findRoom: "Find a room",
|
|
190
|
-
minCapacity: "Min. capacity",
|
|
191
|
-
featureFilter: "Feature",
|
|
192
|
-
addRoom: "Add",
|
|
193
|
-
roomAdded: "Added",
|
|
194
|
-
roomFree: "Free",
|
|
195
|
-
roomBusy: "Busy",
|
|
196
|
-
noRooms: "No rooms match.",
|
|
197
190
|
room: "Room",
|
|
198
191
|
you: "You",
|
|
199
192
|
addCalendar: "Add calendar",
|
|
@@ -1308,6 +1301,31 @@ function CalendarList({
|
|
|
1308
1301
|
] });
|
|
1309
1302
|
}
|
|
1310
1303
|
|
|
1304
|
+
// src/calendar/conference.ts
|
|
1305
|
+
var JOIN_EARLY_MS = 10 * 6e4;
|
|
1306
|
+
function normalizeConferenceAddress(value) {
|
|
1307
|
+
const trimmed = value.trim();
|
|
1308
|
+
if (/^https?:\/\//i.test(trimmed) || /^tel:/i.test(trimmed)) return trimmed;
|
|
1309
|
+
const digits = trimmed.replace(/\D/g, "");
|
|
1310
|
+
if (digits.length >= 7 && /^[+\d\s().-]+$/.test(trimmed))
|
|
1311
|
+
return `tel:${trimmed.replace(/[\s().-]/g, "")}`;
|
|
1312
|
+
return trimmed;
|
|
1313
|
+
}
|
|
1314
|
+
function conferenceUrl(event) {
|
|
1315
|
+
const url = event.conference?.url;
|
|
1316
|
+
return url && /^(https?:\/\/|tel:)/i.test(url) ? url : null;
|
|
1317
|
+
}
|
|
1318
|
+
function canJoinEvent(event, now = Date.now()) {
|
|
1319
|
+
if (!conferenceUrl(event)) return false;
|
|
1320
|
+
return now >= new Date(event.start_utc).getTime() - JOIN_EARLY_MS && now <= new Date(event.end_utc).getTime();
|
|
1321
|
+
}
|
|
1322
|
+
function upcomingOf(events, now, {
|
|
1323
|
+
showDeclined = false,
|
|
1324
|
+
hidden = /* @__PURE__ */ new Set()
|
|
1325
|
+
} = {}) {
|
|
1326
|
+
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));
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1311
1329
|
// src/calendar/draft.ts
|
|
1312
1330
|
var isAllDayDraft = (d) => !!d.start.date;
|
|
1313
1331
|
var datePart = (spec) => spec.date ?? (spec.date_time ?? "").slice(0, 10);
|
|
@@ -2124,6 +2142,153 @@ function formatReminder(minutesBefore, labels = DEFAULT_REMINDER_FORMAT_LABELS)
|
|
|
2124
2142
|
return `${value} ${word} ${minutesBefore > 0 ? labels.before : labels.after}`;
|
|
2125
2143
|
}
|
|
2126
2144
|
var REMINDER_PRESETS = [0, 5, 10, 15, 30, 60, 120, 24 * 60, 2 * 24 * 60, 7 * 24 * 60];
|
|
2145
|
+
function EventAttachments({
|
|
2146
|
+
attachments,
|
|
2147
|
+
documents,
|
|
2148
|
+
workspaces,
|
|
2149
|
+
currentWorkspaceId,
|
|
2150
|
+
onChange,
|
|
2151
|
+
onUpload,
|
|
2152
|
+
labels
|
|
2153
|
+
}) {
|
|
2154
|
+
const [attachUrl, setAttachUrl] = react.useState("");
|
|
2155
|
+
const [attachTitle, setAttachTitle] = react.useState("");
|
|
2156
|
+
const [workspaceId, setWorkspaceId] = react.useState(currentWorkspaceId ?? "");
|
|
2157
|
+
const [uploading, setUploading] = react.useState(false);
|
|
2158
|
+
const [error, setError] = react.useState(null);
|
|
2159
|
+
const groups = [
|
|
2160
|
+
{
|
|
2161
|
+
id: "workspace",
|
|
2162
|
+
heading: "In this workspace",
|
|
2163
|
+
docs: documents.map((doc) => ({ id: doc.doc_id, title: doc.title }))
|
|
2164
|
+
}
|
|
2165
|
+
];
|
|
2166
|
+
const addLink = () => {
|
|
2167
|
+
const url = attachUrl.trim();
|
|
2168
|
+
if (!url) return;
|
|
2169
|
+
onChange([...attachments, { url, title: attachTitle.trim() || null }]);
|
|
2170
|
+
setAttachUrl("");
|
|
2171
|
+
setAttachTitle("");
|
|
2172
|
+
};
|
|
2173
|
+
const toggleDocument = (id) => {
|
|
2174
|
+
const document2 = documents.find((item) => item.doc_id === id);
|
|
2175
|
+
if (!document2) return;
|
|
2176
|
+
const exists = attachments.some((item) => item.doc_id === id);
|
|
2177
|
+
onChange(exists ? attachments.filter((item) => item.doc_id !== id) : [...attachments, document2]);
|
|
2178
|
+
};
|
|
2179
|
+
const uploadFiles = async (selected) => {
|
|
2180
|
+
if (!selected?.length || !onUpload || !workspaceId) return;
|
|
2181
|
+
setUploading(true);
|
|
2182
|
+
setError(null);
|
|
2183
|
+
try {
|
|
2184
|
+
onChange([...attachments, ...await onUpload(Array.from(selected), workspaceId)]);
|
|
2185
|
+
} catch (err) {
|
|
2186
|
+
setError(err instanceof Error ? err.message : "Could not upload attachments");
|
|
2187
|
+
} finally {
|
|
2188
|
+
setUploading(false);
|
|
2189
|
+
}
|
|
2190
|
+
};
|
|
2191
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(FieldRow, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Paperclip, { className: "h-4 w-4" }), label: labels.attachments, children: [
|
|
2192
|
+
attachments.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "space-y-1", children: attachments.map((attachment, index) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center gap-2 text-sm", children: [
|
|
2193
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2194
|
+
"a",
|
|
2195
|
+
{
|
|
2196
|
+
href: attachment.url,
|
|
2197
|
+
target: "_blank",
|
|
2198
|
+
rel: "noreferrer",
|
|
2199
|
+
className: "min-w-0 flex-1 truncate text-primary hover:underline",
|
|
2200
|
+
children: attachment.title || attachment.url
|
|
2201
|
+
}
|
|
2202
|
+
),
|
|
2203
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2204
|
+
"button",
|
|
2205
|
+
{
|
|
2206
|
+
type: "button",
|
|
2207
|
+
className: "rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2208
|
+
"aria-label": `${labels.remove} ${attachment.title || attachment.url}`,
|
|
2209
|
+
onClick: () => onChange(attachments.filter((_, itemIndex) => itemIndex !== index)),
|
|
2210
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: "\xD7" })
|
|
2211
|
+
}
|
|
2212
|
+
)
|
|
2213
|
+
] }, `${attachment.url}-${index}`)) }),
|
|
2214
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2215
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2216
|
+
ui.Input,
|
|
2217
|
+
{
|
|
2218
|
+
type: "url",
|
|
2219
|
+
"aria-label": labels.attachmentUrlPlaceholder,
|
|
2220
|
+
placeholder: labels.attachmentUrlPlaceholder,
|
|
2221
|
+
className: "h-8 min-w-0 flex-1",
|
|
2222
|
+
value: attachUrl,
|
|
2223
|
+
onChange: (event) => setAttachUrl(event.target.value)
|
|
2224
|
+
}
|
|
2225
|
+
),
|
|
2226
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2227
|
+
ui.Input,
|
|
2228
|
+
{
|
|
2229
|
+
"aria-label": labels.attachmentTitlePlaceholder,
|
|
2230
|
+
placeholder: labels.attachmentTitlePlaceholder,
|
|
2231
|
+
className: "h-8 w-40",
|
|
2232
|
+
value: attachTitle,
|
|
2233
|
+
onChange: (event) => setAttachTitle(event.target.value)
|
|
2234
|
+
}
|
|
2235
|
+
),
|
|
2236
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2237
|
+
ui.Button,
|
|
2238
|
+
{
|
|
2239
|
+
type: "button",
|
|
2240
|
+
size: "sm",
|
|
2241
|
+
variant: "outline",
|
|
2242
|
+
onClick: addLink,
|
|
2243
|
+
disabled: !attachUrl.trim(),
|
|
2244
|
+
children: labels.addAttachment
|
|
2245
|
+
}
|
|
2246
|
+
)
|
|
2247
|
+
] }),
|
|
2248
|
+
documents.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 space-y-1", children: [
|
|
2249
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Choose existing documents" }),
|
|
2250
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2251
|
+
chunkVZOOGA47_cjs.DocumentPicker,
|
|
2252
|
+
{
|
|
2253
|
+
groups,
|
|
2254
|
+
value: "",
|
|
2255
|
+
selectedIds: attachments.flatMap((item) => item.doc_id ? [item.doc_id] : []),
|
|
2256
|
+
onValueChange: toggleDocument,
|
|
2257
|
+
labels: { placeholder: "Search this workspace\u2026" }
|
|
2258
|
+
}
|
|
2259
|
+
)
|
|
2260
|
+
] }),
|
|
2261
|
+
onUpload && workspaces.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: [
|
|
2262
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-full text-xs text-muted-foreground", children: "Attach files (saved to a workspace)" }),
|
|
2263
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2264
|
+
NativeSelect,
|
|
2265
|
+
{
|
|
2266
|
+
"aria-label": "Save attachment to workspace",
|
|
2267
|
+
value: workspaceId,
|
|
2268
|
+
onChange: (event) => setWorkspaceId(event.target.value),
|
|
2269
|
+
className: "h-8 max-w-56",
|
|
2270
|
+
children: workspaces.map((workspace) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: workspace.id, children: workspace.id === currentWorkspaceId ? `${workspace.name} (current workspace)` : workspace.name }, workspace.id))
|
|
2271
|
+
}
|
|
2272
|
+
),
|
|
2273
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2274
|
+
ui.Input,
|
|
2275
|
+
{
|
|
2276
|
+
type: "file",
|
|
2277
|
+
multiple: true,
|
|
2278
|
+
"aria-label": "Choose files to attach",
|
|
2279
|
+
className: "h-8 min-w-0 flex-1",
|
|
2280
|
+
disabled: uploading,
|
|
2281
|
+
onChange: (event) => {
|
|
2282
|
+
void uploadFiles(event.target.files);
|
|
2283
|
+
event.currentTarget.value = "";
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
),
|
|
2287
|
+
uploading && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "Saving attachments\u2026" })
|
|
2288
|
+
] }),
|
|
2289
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive", role: "alert", children: error })
|
|
2290
|
+
] });
|
|
2291
|
+
}
|
|
2127
2292
|
var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
2128
2293
|
function Chip({
|
|
2129
2294
|
children,
|
|
@@ -2167,6 +2332,10 @@ function EventEditor({
|
|
|
2167
2332
|
isWebinarAttendee,
|
|
2168
2333
|
defaultTimeZone,
|
|
2169
2334
|
schedulingSlot,
|
|
2335
|
+
attachmentDocuments = [],
|
|
2336
|
+
attachmentWorkspaces = [],
|
|
2337
|
+
currentWorkspaceId,
|
|
2338
|
+
onUploadAttachments,
|
|
2170
2339
|
attendeeSuggestions,
|
|
2171
2340
|
onAttendeeQueryChange,
|
|
2172
2341
|
saving,
|
|
@@ -2187,8 +2356,6 @@ function EventEditor({
|
|
|
2187
2356
|
const [attendeeInput, setAttendeeInput] = react.useState("");
|
|
2188
2357
|
const [categoryInput, setCategoryInput] = react.useState("");
|
|
2189
2358
|
const [linkInput, setLinkInput] = react.useState(null);
|
|
2190
|
-
const [attachUrl, setAttachUrl] = react.useState("");
|
|
2191
|
-
const [attachTitle, setAttachTitle] = react.useState("");
|
|
2192
2359
|
const [addingCall, setAddingCall] = react.useState(false);
|
|
2193
2360
|
const [webinar, setWebinar] = react.useState(false);
|
|
2194
2361
|
const [touched, setTouched] = react.useState(false);
|
|
@@ -2250,14 +2417,6 @@ function EventEditor({
|
|
|
2250
2417
|
const isWebinar = isWebinarConference(value.conference);
|
|
2251
2418
|
const roles = value.conference?.roles ?? {};
|
|
2252
2419
|
const setRole = (a, role) => value.conference && set({ conference: { ...value.conference, roles: { ...roles, [attendeeKey(a)]: role } } });
|
|
2253
|
-
const attachments = value.attachments ?? [];
|
|
2254
|
-
const addAttachment = () => {
|
|
2255
|
-
const url = attachUrl.trim();
|
|
2256
|
-
if (!url) return;
|
|
2257
|
-
set({ attachments: [...attachments, { url, title: attachTitle.trim() || null }] });
|
|
2258
|
-
setAttachUrl("");
|
|
2259
|
-
setAttachTitle("");
|
|
2260
|
-
};
|
|
2261
2420
|
const startDate = specDate(value.start);
|
|
2262
2421
|
const submit = () => {
|
|
2263
2422
|
setTouched(true);
|
|
@@ -2464,7 +2623,7 @@ function EventEditor({
|
|
|
2464
2623
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2465
2624
|
ui.Input,
|
|
2466
2625
|
{
|
|
2467
|
-
type: "
|
|
2626
|
+
type: "text",
|
|
2468
2627
|
"aria-label": l.addMeetingLink,
|
|
2469
2628
|
placeholder: l.meetingLinkPlaceholder,
|
|
2470
2629
|
value: linkInput,
|
|
@@ -2474,7 +2633,12 @@ function EventEditor({
|
|
|
2474
2633
|
if (e.key === "Enter") {
|
|
2475
2634
|
e.preventDefault();
|
|
2476
2635
|
if (linkInput.trim())
|
|
2477
|
-
set({
|
|
2636
|
+
set({
|
|
2637
|
+
conference: {
|
|
2638
|
+
type: "external",
|
|
2639
|
+
url: normalizeConferenceAddress(linkInput)
|
|
2640
|
+
}
|
|
2641
|
+
});
|
|
2478
2642
|
setLinkInput(null);
|
|
2479
2643
|
} else if (e.key === "Escape") setLinkInput(null);
|
|
2480
2644
|
},
|
|
@@ -2489,7 +2653,9 @@ function EventEditor({
|
|
|
2489
2653
|
variant: "outline",
|
|
2490
2654
|
onClick: () => {
|
|
2491
2655
|
if (linkInput.trim())
|
|
2492
|
-
set({
|
|
2656
|
+
set({
|
|
2657
|
+
conference: { type: "external", url: normalizeConferenceAddress(linkInput) }
|
|
2658
|
+
});
|
|
2493
2659
|
setLinkInput(null);
|
|
2494
2660
|
},
|
|
2495
2661
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4" })
|
|
@@ -2539,7 +2705,7 @@ function EventEditor({
|
|
|
2539
2705
|
ui.Input,
|
|
2540
2706
|
{
|
|
2541
2707
|
"aria-label": l.location,
|
|
2542
|
-
placeholder:
|
|
2708
|
+
placeholder: "Physical location (optional)",
|
|
2543
2709
|
value: value.location ?? "",
|
|
2544
2710
|
onChange: (e) => set({ location: e.target.value || null }),
|
|
2545
2711
|
"data-testid": "calendar-editor-location"
|
|
@@ -2903,65 +3069,18 @@ function EventEditor({
|
|
|
2903
3069
|
),
|
|
2904
3070
|
!value.color && calendarColor && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: calendarColor })
|
|
2905
3071
|
] }),
|
|
2906
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2919
|
-
"button",
|
|
2920
|
-
{
|
|
2921
|
-
type: "button",
|
|
2922
|
-
className: "rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2923
|
-
"aria-label": `${l.remove} ${a.title || a.url}`,
|
|
2924
|
-
onClick: () => set({ attachments: attachments.filter((_, j) => j !== i) }),
|
|
2925
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3.5 w-3.5" })
|
|
2926
|
-
}
|
|
2927
|
-
)
|
|
2928
|
-
] }, `${a.url}-${i}`)) }),
|
|
2929
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2930
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2931
|
-
ui.Input,
|
|
2932
|
-
{
|
|
2933
|
-
type: "url",
|
|
2934
|
-
"aria-label": l.attachmentUrlPlaceholder,
|
|
2935
|
-
placeholder: l.attachmentUrlPlaceholder,
|
|
2936
|
-
className: "h-8 min-w-0 flex-1",
|
|
2937
|
-
value: attachUrl,
|
|
2938
|
-
onChange: (e) => setAttachUrl(e.target.value),
|
|
2939
|
-
"data-testid": "calendar-editor-attachment-url"
|
|
2940
|
-
}
|
|
2941
|
-
),
|
|
2942
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2943
|
-
ui.Input,
|
|
2944
|
-
{
|
|
2945
|
-
"aria-label": l.attachmentTitlePlaceholder,
|
|
2946
|
-
placeholder: l.attachmentTitlePlaceholder,
|
|
2947
|
-
className: "h-8 w-40",
|
|
2948
|
-
value: attachTitle,
|
|
2949
|
-
onChange: (e) => setAttachTitle(e.target.value)
|
|
2950
|
-
}
|
|
2951
|
-
),
|
|
2952
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2953
|
-
ui.Button,
|
|
2954
|
-
{
|
|
2955
|
-
type: "button",
|
|
2956
|
-
size: "sm",
|
|
2957
|
-
variant: "outline",
|
|
2958
|
-
onClick: addAttachment,
|
|
2959
|
-
disabled: !attachUrl.trim(),
|
|
2960
|
-
children: l.addAttachment
|
|
2961
|
-
}
|
|
2962
|
-
)
|
|
2963
|
-
] })
|
|
2964
|
-
] })
|
|
3072
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3073
|
+
EventAttachments,
|
|
3074
|
+
{
|
|
3075
|
+
attachments: value.attachments ?? [],
|
|
3076
|
+
documents: attachmentDocuments,
|
|
3077
|
+
workspaces: attachmentWorkspaces,
|
|
3078
|
+
currentWorkspaceId,
|
|
3079
|
+
onChange: (attachments) => set({ attachments }),
|
|
3080
|
+
onUpload: onUploadAttachments,
|
|
3081
|
+
labels: l
|
|
3082
|
+
}
|
|
3083
|
+
)
|
|
2965
3084
|
] }),
|
|
2966
3085
|
(error || shownProblem) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2967
3086
|
"p",
|
|
@@ -3603,113 +3722,6 @@ function SchedulingAssistant({
|
|
|
3603
3722
|
] })
|
|
3604
3723
|
] });
|
|
3605
3724
|
}
|
|
3606
|
-
function RoomFinder({
|
|
3607
|
-
rooms,
|
|
3608
|
-
loading,
|
|
3609
|
-
minCapacity,
|
|
3610
|
-
feature,
|
|
3611
|
-
onFiltersChange,
|
|
3612
|
-
addedEmails,
|
|
3613
|
-
onAdd,
|
|
3614
|
-
labels: labelOverrides,
|
|
3615
|
-
className
|
|
3616
|
-
}) {
|
|
3617
|
-
const l = mergeLabels(labelOverrides);
|
|
3618
|
-
const added = new Set(addedEmails.map((e) => e.toLowerCase()));
|
|
3619
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("space-y-2", className), "data-testid": "calendar-room-finder", children: [
|
|
3620
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3621
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium", children: l.findRoom }),
|
|
3622
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3623
|
-
ui.Input,
|
|
3624
|
-
{
|
|
3625
|
-
type: "number",
|
|
3626
|
-
min: 1,
|
|
3627
|
-
className: "h-8 w-28",
|
|
3628
|
-
placeholder: l.minCapacity,
|
|
3629
|
-
"aria-label": l.minCapacity,
|
|
3630
|
-
value: minCapacity ?? "",
|
|
3631
|
-
onChange: (e) => onFiltersChange({
|
|
3632
|
-
minCapacity: e.target.value ? Math.max(1, Number(e.target.value)) : null,
|
|
3633
|
-
feature
|
|
3634
|
-
}),
|
|
3635
|
-
"data-testid": "calendar-room-capacity"
|
|
3636
|
-
}
|
|
3637
|
-
),
|
|
3638
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3639
|
-
ui.Input,
|
|
3640
|
-
{
|
|
3641
|
-
className: "h-8 w-32",
|
|
3642
|
-
placeholder: l.featureFilter,
|
|
3643
|
-
"aria-label": l.featureFilter,
|
|
3644
|
-
value: feature,
|
|
3645
|
-
onChange: (e) => onFiltersChange({ minCapacity, feature: e.target.value }),
|
|
3646
|
-
"data-testid": "calendar-room-feature"
|
|
3647
|
-
}
|
|
3648
|
-
)
|
|
3649
|
-
] }),
|
|
3650
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3651
|
-
"ul",
|
|
3652
|
-
{
|
|
3653
|
-
className: ui.cn(
|
|
3654
|
-
"divide-y divide-border rounded-md border border-border",
|
|
3655
|
-
loading && "opacity-60"
|
|
3656
|
-
),
|
|
3657
|
-
children: [
|
|
3658
|
-
rooms.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("li", { className: "px-3 py-2 text-xs text-muted-foreground", children: l.noRooms }),
|
|
3659
|
-
rooms.map((r) => {
|
|
3660
|
-
const isAdded = added.has(r.email.toLowerCase());
|
|
3661
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3662
|
-
"li",
|
|
3663
|
-
{
|
|
3664
|
-
className: "flex items-center gap-2 px-3 py-1.5 text-sm",
|
|
3665
|
-
"data-testid": "calendar-room",
|
|
3666
|
-
"data-room-email": r.email,
|
|
3667
|
-
children: [
|
|
3668
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.DoorOpen, { className: "h-4 w-4 shrink-0 text-muted-foreground", "aria-hidden": true }),
|
|
3669
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
3670
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate font-medium", children: r.name }),
|
|
3671
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-x-2 text-xs text-muted-foreground", children: [
|
|
3672
|
-
r.capacity != null && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-0.5", children: [
|
|
3673
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Users, { className: "h-3 w-3", "aria-hidden": true }),
|
|
3674
|
-
r.capacity
|
|
3675
|
-
] }),
|
|
3676
|
-
(r.building || r.floor) && /* @__PURE__ */ jsxRuntime.jsx("span", { children: [r.building, r.floor].filter(Boolean).join(" \xB7 ") }),
|
|
3677
|
-
(r.features ?? []).length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { children: r.features?.join(", ") })
|
|
3678
|
-
] })
|
|
3679
|
-
] }),
|
|
3680
|
-
r.free != null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3681
|
-
"span",
|
|
3682
|
-
{
|
|
3683
|
-
className: ui.cn(
|
|
3684
|
-
"rounded-full px-2 py-0.5 text-xs",
|
|
3685
|
-
r.free ? "bg-green-500/15 text-green-700 dark:text-green-400" : "bg-destructive/15 text-destructive"
|
|
3686
|
-
),
|
|
3687
|
-
"data-testid": "calendar-room-availability",
|
|
3688
|
-
children: r.free ? l.roomFree : l.roomBusy
|
|
3689
|
-
}
|
|
3690
|
-
),
|
|
3691
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3692
|
-
ui.Button,
|
|
3693
|
-
{
|
|
3694
|
-
type: "button",
|
|
3695
|
-
size: "sm",
|
|
3696
|
-
variant: "outline",
|
|
3697
|
-
disabled: isAdded,
|
|
3698
|
-
onClick: () => onAdd(r),
|
|
3699
|
-
"data-testid": "calendar-room-add",
|
|
3700
|
-
children: isAdded ? l.roomAdded : l.addRoom
|
|
3701
|
-
}
|
|
3702
|
-
)
|
|
3703
|
-
]
|
|
3704
|
-
},
|
|
3705
|
-
r.id
|
|
3706
|
-
);
|
|
3707
|
-
})
|
|
3708
|
-
]
|
|
3709
|
-
}
|
|
3710
|
-
)
|
|
3711
|
-
] });
|
|
3712
|
-
}
|
|
3713
3725
|
var mondayFirstName = (day) => chunkBIXHB4LV_cjs.formatPlainDate(`2024-01-0${day + 1}`, { weekday: "long" });
|
|
3714
3726
|
var sundayFirstName = (day) => chunkBIXHB4LV_cjs.formatPlainDate(day === 0 ? "2023-12-31" : `2024-01-0${day}`, { weekday: "long" });
|
|
3715
3727
|
var VIEWS = ["day", "work_week", "week", "month", "agenda", "year"];
|
|
@@ -4407,7 +4419,8 @@ function eventToDraft(event, master) {
|
|
|
4407
4419
|
attachments: (event.attachments ?? []).map((a) => ({
|
|
4408
4420
|
url: a.url,
|
|
4409
4421
|
title: a.title ?? null,
|
|
4410
|
-
doc_id: a.doc_id ?? null
|
|
4422
|
+
doc_id: a.doc_id ?? null,
|
|
4423
|
+
mime_type: a.mime_type ?? null
|
|
4411
4424
|
})),
|
|
4412
4425
|
url: event.url ?? null,
|
|
4413
4426
|
conversation_id: event.conversation_id ?? null,
|
|
@@ -4586,23 +4599,6 @@ function toSettingsValue(s) {
|
|
|
4586
4599
|
};
|
|
4587
4600
|
}
|
|
4588
4601
|
|
|
4589
|
-
// src/calendar/conference.ts
|
|
4590
|
-
var JOIN_EARLY_MS = 10 * 6e4;
|
|
4591
|
-
function conferenceUrl(event) {
|
|
4592
|
-
const url = event.conference?.url;
|
|
4593
|
-
return url && /^https?:\/\//i.test(url) ? url : null;
|
|
4594
|
-
}
|
|
4595
|
-
function canJoinEvent(event, now = Date.now()) {
|
|
4596
|
-
if (!conferenceUrl(event)) return false;
|
|
4597
|
-
return now >= new Date(event.start_utc).getTime() - JOIN_EARLY_MS && now <= new Date(event.end_utc).getTime();
|
|
4598
|
-
}
|
|
4599
|
-
function upcomingOf(events, now, {
|
|
4600
|
-
showDeclined = false,
|
|
4601
|
-
hidden = /* @__PURE__ */ new Set()
|
|
4602
|
-
} = {}) {
|
|
4603
|
-
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));
|
|
4604
|
-
}
|
|
4605
|
-
|
|
4606
4602
|
// src/calendar/ics.ts
|
|
4607
4603
|
function icsProps(text) {
|
|
4608
4604
|
const lines = text.replace(/\r\n/g, "\n").replace(/\n[ \t]/g, "").split("\n");
|
|
@@ -5185,7 +5181,6 @@ exports.ProposeTimeDialog = ProposeTimeDialog;
|
|
|
5185
5181
|
exports.REMINDER_PRESETS = REMINDER_PRESETS;
|
|
5186
5182
|
exports.RRULE_WEEKDAYS = RRULE_WEEKDAYS;
|
|
5187
5183
|
exports.RecurrenceEditor = RecurrenceEditor;
|
|
5188
|
-
exports.RoomFinder = RoomFinder;
|
|
5189
5184
|
exports.SchedulingAssistant = SchedulingAssistant;
|
|
5190
5185
|
exports.ScopeDialog = ScopeDialog;
|
|
5191
5186
|
exports.TimeZonePicker = TimeZonePicker;
|
|
@@ -5277,5 +5272,5 @@ exports.weeklyToPayload = weeklyToPayload;
|
|
|
5277
5272
|
exports.workWeekHiddenDays = workWeekHiddenDays;
|
|
5278
5273
|
exports.workingIntervals = workingIntervals;
|
|
5279
5274
|
exports.zoneOptions = zoneOptions;
|
|
5280
|
-
//# sourceMappingURL=chunk-
|
|
5281
|
-
//# sourceMappingURL=chunk-
|
|
5275
|
+
//# sourceMappingURL=chunk-PXVSZRCA.cjs.map
|
|
5276
|
+
//# sourceMappingURL=chunk-PXVSZRCA.cjs.map
|