@arbidocs/blocks 0.4.129 → 0.4.131
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/agents/index.cjs +303 -303
- package/dist/agents/index.js +11 -11
- package/dist/calendar/CalendarPrint.d.ts +25 -0
- package/dist/calendar/booking-slots.d.ts +21 -0
- package/dist/calendar/index.cjs +381 -97
- package/dist/calendar/index.cjs.map +1 -1
- package/dist/calendar/index.d.ts +4 -0
- package/dist/calendar/index.js +277 -3
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/print-layout.d.ts +16 -0
- package/dist/calendar/printCalendar.d.ts +6 -0
- package/dist/calls/composite-canvas.d.ts +52 -0
- package/dist/calls/index.cjs +374 -1
- package/dist/calls/index.cjs.map +1 -1
- package/dist/calls/index.d.ts +3 -0
- package/dist/calls/index.js +359 -4
- package/dist/calls/index.js.map +1 -1
- package/dist/calls/ringtone.d.ts +16 -0
- package/dist/calls/voice-levels.d.ts +32 -0
- package/dist/chat/ThreadVisualizer.d.ts +28 -0
- package/dist/chat/index.cjs +151 -135
- package/dist/chat/index.d.ts +2 -0
- package/dist/chat/index.js +4 -4
- package/dist/chat/thread-diagram.d.ts +26 -0
- package/dist/{chunk-H2KQ6OSU.js → chunk-26E6PHD2.js} +231 -6
- package/dist/chunk-26E6PHD2.js.map +1 -0
- package/dist/{chunk-2PNNCEPH.js → chunk-54ANPPMV.js} +4 -4
- package/dist/{chunk-2PNNCEPH.js.map → chunk-54ANPPMV.js.map} +1 -1
- package/dist/{chunk-IBZJYCYM.js → chunk-66TA5IBN.js} +17 -25
- package/dist/chunk-66TA5IBN.js.map +1 -0
- package/dist/{chunk-OYMWV45N.js → chunk-7D4W3SAH.js} +51 -4
- package/dist/chunk-7D4W3SAH.js.map +1 -0
- package/dist/{chunk-2DFDFOM7.js → chunk-7HAM7Y5U.js} +3 -3
- package/dist/{chunk-2DFDFOM7.js.map → chunk-7HAM7Y5U.js.map} +1 -1
- package/dist/{chunk-7423V6RM.cjs → chunk-7KH4M3KY.cjs} +8 -8
- package/dist/{chunk-7423V6RM.cjs.map → chunk-7KH4M3KY.cjs.map} +1 -1
- package/dist/{chunk-TGWTLNXW.cjs → chunk-BIXHB4LV.cjs} +3 -2
- package/dist/{chunk-TGWTLNXW.cjs.map → chunk-BIXHB4LV.cjs.map} +1 -1
- package/dist/{chunk-DZYAAL4H.cjs → chunk-BZF55UCE.cjs} +234 -5
- package/dist/chunk-BZF55UCE.cjs.map +1 -0
- package/dist/{chunk-3BJLNKOB.cjs → chunk-CDZVC32G.cjs} +5 -5
- package/dist/{chunk-3BJLNKOB.cjs.map → chunk-CDZVC32G.cjs.map} +1 -1
- package/dist/{chunk-PUCY3UXN.js → chunk-CXLVI3SB.js} +3 -3
- package/dist/{chunk-PUCY3UXN.js.map → chunk-CXLVI3SB.js.map} +1 -1
- package/dist/{chunk-KYDRUFWT.cjs → chunk-D4YR56FV.cjs} +5 -5
- package/dist/{chunk-KYDRUFWT.cjs.map → chunk-D4YR56FV.cjs.map} +1 -1
- package/dist/{chunk-6BTCDKCK.js → chunk-DI35D756.js} +4 -4
- package/dist/{chunk-6BTCDKCK.js.map → chunk-DI35D756.js.map} +1 -1
- package/dist/{chunk-TGJNPKST.js → chunk-GTCC2VAR.js} +3 -3
- package/dist/{chunk-TGJNPKST.js.map → chunk-GTCC2VAR.js.map} +1 -1
- package/dist/{chunk-6AALMYPS.cjs → chunk-HM23LXUP.cjs} +3 -3
- package/dist/{chunk-6AALMYPS.cjs.map → chunk-HM23LXUP.cjs.map} +1 -1
- package/dist/{chunk-HSFLEVZY.js → chunk-KLOSOT26.js} +10 -10
- package/dist/{chunk-HSFLEVZY.js.map → chunk-KLOSOT26.js.map} +1 -1
- package/dist/{chunk-SARREDFP.cjs → chunk-LC2KJSUS.cjs} +46 -46
- package/dist/{chunk-SARREDFP.cjs.map → chunk-LC2KJSUS.cjs.map} +1 -1
- package/dist/{chunk-MUMH3Z6K.cjs → chunk-LRD7BHAT.cjs} +50 -3
- package/dist/chunk-LRD7BHAT.cjs.map +1 -0
- package/dist/{chunk-CJBN5HIS.js → chunk-P5HOXWYL.js} +3 -3
- package/dist/{chunk-CJBN5HIS.js.map → chunk-P5HOXWYL.js.map} +1 -1
- package/dist/{chunk-5Y7JRY7Y.js → chunk-P5ST47VY.js} +3 -3
- package/dist/{chunk-5Y7JRY7Y.js.map → chunk-P5ST47VY.js.map} +1 -1
- package/dist/{chunk-A7NCSZAP.cjs → chunk-QZTNTP75.cjs} +17 -25
- package/dist/chunk-QZTNTP75.cjs.map +1 -0
- package/dist/{chunk-ENDP7JER.js → chunk-VW2C2AZL.js} +3 -3
- package/dist/{chunk-ENDP7JER.js.map → chunk-VW2C2AZL.js.map} +1 -1
- package/dist/{chunk-JLTXVW25.cjs → chunk-W27VK32R.cjs} +78 -78
- package/dist/{chunk-JLTXVW25.cjs.map → chunk-W27VK32R.cjs.map} +1 -1
- package/dist/{chunk-PJJY6CYL.cjs → chunk-WV4IDVDQ.cjs} +11 -11
- package/dist/{chunk-PJJY6CYL.cjs.map → chunk-WV4IDVDQ.cjs.map} +1 -1
- package/dist/{chunk-NYHGG2IA.cjs → chunk-ZV3BKLFY.cjs} +3 -3
- package/dist/{chunk-NYHGG2IA.cjs.map → chunk-ZV3BKLFY.cjs.map} +1 -1
- package/dist/collaboration/index.cjs +9 -9
- package/dist/collaboration/index.js +1 -1
- package/dist/connect/docx.cjs +4 -4
- package/dist/connect/docx.js +3 -3
- package/dist/connect/index.cjs +183 -146
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -1
- package/dist/connect/index.js +134 -98
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectedSettings.d.ts +42 -7
- package/dist/document-tools/index.cjs +1 -1
- package/dist/document-tools/index.js +1 -1
- package/dist/facts/fact-citations.d.ts +56 -0
- package/dist/facts/fact-table-column-resize.d.ts +18 -0
- package/dist/facts/index.cjs +194 -8
- package/dist/facts/index.cjs.map +1 -1
- package/dist/facts/index.d.ts +2 -0
- package/dist/facts/index.js +180 -5
- package/dist/facts/index.js.map +1 -1
- package/dist/files/index.cjs +1 -1
- package/dist/files/index.js +1 -1
- package/dist/home/index.cjs +17 -17
- package/dist/home/index.js +3 -3
- package/dist/index.cjs +517 -501
- package/dist/index.js +18 -18
- package/dist/settings/MoreInfo.d.ts +25 -0
- package/dist/settings/PlanCard.d.ts +1 -1
- package/dist/settings/index.cjs +79 -225
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.d.ts +1 -1
- package/dist/settings/index.js +70 -215
- package/dist/settings/index.js.map +1 -1
- package/dist/shell/index.cjs +1 -1
- package/dist/shell/index.js +1 -1
- package/dist/site/index.cjs +5 -5
- package/dist/site/index.js +1 -1
- package/dist/studio/index.cjs +8 -8
- package/dist/studio/index.js +6 -6
- package/dist/workflow-canvas/index.cjs +64 -64
- package/dist/workflow-canvas/index.js +12 -12
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +9 -4
- package/dist/chunk-A7NCSZAP.cjs.map +0 -1
- package/dist/chunk-DZYAAL4H.cjs.map +0 -1
- package/dist/chunk-H2KQ6OSU.js.map +0 -1
- package/dist/chunk-IBZJYCYM.js.map +0 -1
- package/dist/chunk-MUMH3Z6K.cjs.map +0 -1
- package/dist/chunk-OYMWV45N.js.map +0 -1
- package/dist/settings/FirmPool.d.ts +0 -82
package/dist/calendar/index.d.ts
CHANGED
|
@@ -28,3 +28,7 @@ export { formatReminder, splitReminderMinutes, reminderToMinutes, REMINDER_PRESE
|
|
|
28
28
|
export { ARBI_WEBINAR_LABEL, attendeeKey, isWebinarConference, isAllDayDraft, allDayInclusiveEnd, draftFromSlot, draftRangeUtc, setDraftAllDay, setDraftEnd, setDraftStart, specDate, specTime, validateDraft, type DraftError, } from './draft';
|
|
29
29
|
export { addDays, addMonths, convertWall, detectTimeZone, diffDays, formatInZone, formatPlainDate, isValidTimeZone, listTimeZones, safeZone, startOfWeek, todayInZone, utcToDate, utcToTime, utcToWall, wallToUtc, zoneCity, zoneOffsetLabel, zoneOffsetMinutes, } from './zone';
|
|
30
30
|
export { CALENDAR_COLORS, contrastText } from './colors';
|
|
31
|
+
export { CalendarPrint, type CalendarPrintProps, type PrintCalendarInfo } from './CalendarPrint';
|
|
32
|
+
export { printCalendar } from './printCalendar';
|
|
33
|
+
export { printRange, eventDays, eventsByDay, type CalendarEvent as PrintableCalendarEvent, type PrintView, } from './print-layout';
|
|
34
|
+
export { formatSlotTime, formatDayLabel, groupSlotsByDay, formatSlotRange, zoneOptions, type SlotView, type SlotDay, } from './booking-slots';
|
package/dist/calendar/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { safeZone, isValidTimeZone, utcToDate, addDays, convertWall, utcToTime, zoneOffsetLabel, formatInZone, zoneCity, todayInZone, startOfWeek, formatPlainDate, addMonths, isoWeekNumber, diffDays, utcToWall, listTimeZones, zoneOffsetMinutes, wallToEpochMs, wallArrayOffset, epochToWallArray, wallToUtc } from '../chunk-
|
|
3
|
-
export { addDays, addMonths, convertWall, detectTimeZone, diffDays, formatInZone, formatPlainDate, isValidTimeZone, listTimeZones, safeZone, startOfWeek, todayInZone, utcToDate, utcToTime, utcToWall, wallToUtc, zoneCity, zoneOffsetLabel, zoneOffsetMinutes } from '../chunk-
|
|
2
|
+
import { safeZone, isValidTimeZone, utcToDate, addDays, convertWall, utcToTime, zoneOffsetLabel, formatInZone, zoneCity, todayInZone, startOfWeek, formatPlainDate, addMonths, isoWeekNumber, diffDays, utcToWall, listTimeZones, zoneOffsetMinutes, wallToEpochMs, dayOfWeekSun0, detectTimeZone, wallArrayOffset, epochToWallArray, wallToUtc } from '../chunk-GTCC2VAR.js';
|
|
3
|
+
export { addDays, addMonths, convertWall, detectTimeZone, diffDays, formatInZone, formatPlainDate, isValidTimeZone, listTimeZones, safeZone, startOfWeek, todayInZone, utcToDate, utcToTime, utcToWall, wallToUtc, zoneCity, zoneOffsetLabel, zoneOffsetMinutes } from '../chunk-GTCC2VAR.js';
|
|
4
4
|
import '../chunk-VUNV25KB.js';
|
|
5
5
|
import { forwardRef, useMemo, useRef, useState, useCallback, useEffect, useId } from 'react';
|
|
6
6
|
import FullCalendar from '@fullcalendar/react';
|
|
@@ -15,6 +15,8 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
15
15
|
import { createPlugin } from '@fullcalendar/core';
|
|
16
16
|
import { NamedTimeZoneImpl } from '@fullcalendar/core/internal';
|
|
17
17
|
import { Temporal } from 'temporal-polyfill';
|
|
18
|
+
import { flushSync } from 'react-dom';
|
|
19
|
+
import { createRoot } from 'react-dom/client';
|
|
18
20
|
|
|
19
21
|
// src/calendar/labels.ts
|
|
20
22
|
var CALENDAR_DEFAULT_LABELS = {
|
|
@@ -3953,6 +3955,278 @@ function CalendarSettingsForm({
|
|
|
3953
3955
|
);
|
|
3954
3956
|
}
|
|
3955
3957
|
|
|
3956
|
-
|
|
3958
|
+
// src/calendar/print-layout.ts
|
|
3959
|
+
function printRange(view, date, weekStart = 1, agendaDays = 30) {
|
|
3960
|
+
if (view === "day") return { from: date, to: addDays(date, 1) };
|
|
3961
|
+
if (view === "agenda") return { from: date, to: addDays(date, agendaDays) };
|
|
3962
|
+
if (view === "week") {
|
|
3963
|
+
const from2 = startOfWeek(date, weekStart);
|
|
3964
|
+
return { from: from2, to: addDays(from2, 7) };
|
|
3965
|
+
}
|
|
3966
|
+
const first = `${date.slice(0, 8)}01`;
|
|
3967
|
+
const from = startOfWeek(first, weekStart);
|
|
3968
|
+
const nextMonth = addMonths(first, 1);
|
|
3969
|
+
const lead = (dayOfWeekSun0(nextMonth) - weekStart + 7) % 7;
|
|
3970
|
+
const to = lead === 0 ? nextMonth : addDays(nextMonth, 7 - lead);
|
|
3971
|
+
return { from, to };
|
|
3972
|
+
}
|
|
3973
|
+
function eachDay(from, to) {
|
|
3974
|
+
const out = [];
|
|
3975
|
+
for (let d = from; d < to; d = addDays(d, 1)) out.push(d);
|
|
3976
|
+
return out;
|
|
3977
|
+
}
|
|
3978
|
+
function eventDays(e, zone) {
|
|
3979
|
+
if (e.all_day) {
|
|
3980
|
+
const start = e.start.date ?? utcToDate(e.start_utc, "UTC");
|
|
3981
|
+
const endExcl = e.end.date ?? addDays(start, 1);
|
|
3982
|
+
return eachDay(start, endExcl > start ? endExcl : addDays(start, 1));
|
|
3983
|
+
}
|
|
3984
|
+
const startDay = utcToDate(e.start_utc, zone);
|
|
3985
|
+
const lastInstant = new Date(
|
|
3986
|
+
Math.max(new Date(e.start_utc).getTime(), new Date(e.end_utc).getTime() - 1)
|
|
3987
|
+
);
|
|
3988
|
+
const endDay = utcToDate(lastInstant, zone);
|
|
3989
|
+
return eachDay(startDay, addDays(endDay, 1));
|
|
3990
|
+
}
|
|
3991
|
+
function timeLabel(e, day, zone) {
|
|
3992
|
+
if (e.all_day) return "All day";
|
|
3993
|
+
const fmt = new Intl.DateTimeFormat(void 0, {
|
|
3994
|
+
timeZone: zone,
|
|
3995
|
+
hour: "numeric",
|
|
3996
|
+
minute: "2-digit"
|
|
3997
|
+
});
|
|
3998
|
+
const sDay = utcToDate(e.start_utc, zone);
|
|
3999
|
+
const eDay = utcToDate(new Date(new Date(e.end_utc).getTime() - 1), zone);
|
|
4000
|
+
const s = sDay === day ? fmt.format(new Date(e.start_utc)) : "\u2026";
|
|
4001
|
+
const en = eDay === day ? fmt.format(new Date(e.end_utc)) : "\u2026";
|
|
4002
|
+
return `${s} \u2013 ${en}`;
|
|
4003
|
+
}
|
|
4004
|
+
function eventsByDay(events, zone, from, to) {
|
|
4005
|
+
const map = /* @__PURE__ */ new Map();
|
|
4006
|
+
for (const e of events) {
|
|
4007
|
+
for (const d of eventDays(e, zone)) {
|
|
4008
|
+
if (d < from || d >= to) continue;
|
|
4009
|
+
const list = map.get(d) ?? [];
|
|
4010
|
+
list.push(e);
|
|
4011
|
+
map.set(d, list);
|
|
4012
|
+
}
|
|
4013
|
+
}
|
|
4014
|
+
for (const list of map.values())
|
|
4015
|
+
list.sort(
|
|
4016
|
+
(a, b) => Number(b.all_day) - Number(a.all_day) || new Date(a.start_utc).getTime() - new Date(b.start_utc).getTime() || a.title.localeCompare(b.title)
|
|
4017
|
+
);
|
|
4018
|
+
return map;
|
|
4019
|
+
}
|
|
4020
|
+
function heading(view, date, from, to) {
|
|
4021
|
+
const last = addDays(to, -1);
|
|
4022
|
+
if (view === "day")
|
|
4023
|
+
return formatPlainDate(from, {
|
|
4024
|
+
weekday: "long",
|
|
4025
|
+
year: "numeric",
|
|
4026
|
+
month: "long",
|
|
4027
|
+
day: "numeric"
|
|
4028
|
+
});
|
|
4029
|
+
if (view === "month")
|
|
4030
|
+
return formatPlainDate(`${date.slice(0, 7)}-15`, { year: "numeric", month: "long" });
|
|
4031
|
+
const opts = { year: "numeric", month: "short", day: "numeric" };
|
|
4032
|
+
return `${formatPlainDate(from, opts)} \u2013 ${formatPlainDate(last, opts)}`;
|
|
4033
|
+
}
|
|
4034
|
+
var STYLE = `
|
|
4035
|
+
.arbi-calendar-print { color: #111; background: #fff; font: 12px/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif; }
|
|
4036
|
+
.arbi-calendar-print h1 { font-size: 18px; margin: 0 0 8px; }
|
|
4037
|
+
.arbi-calendar-print .acp-zone { color: #555; font-size: 11px; margin-bottom: 12px; }
|
|
4038
|
+
.arbi-calendar-print table { border-collapse: collapse; width: 100%; table-layout: fixed; }
|
|
4039
|
+
.arbi-calendar-print th, .arbi-calendar-print td { border: 1px solid #bbb; padding: 4px; vertical-align: top; text-align: left; }
|
|
4040
|
+
.arbi-calendar-print th { background: #f3f3f3; font-weight: 600; }
|
|
4041
|
+
.arbi-calendar-print .acp-day { break-inside: avoid; margin-bottom: 10px; }
|
|
4042
|
+
.arbi-calendar-print .acp-day h2 { font-size: 13px; margin: 0 0 4px; border-bottom: 1px solid #bbb; padding-bottom: 2px; }
|
|
4043
|
+
.arbi-calendar-print .acp-ev { display: flex; gap: 6px; margin: 2px 0; break-inside: avoid; }
|
|
4044
|
+
.arbi-calendar-print .acp-time { flex: 0 0 auto; min-width: 92px; color: #333; font-variant-numeric: tabular-nums; }
|
|
4045
|
+
.arbi-calendar-print .acp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
|
|
4046
|
+
.arbi-calendar-print .acp-meta { color: #555; font-size: 11px; white-space: pre-line; }
|
|
4047
|
+
.arbi-calendar-print .acp-muted { color: #888; }
|
|
4048
|
+
.arbi-calendar-print .acp-cancelled { text-decoration: line-through; color: #888; }
|
|
4049
|
+
.arbi-calendar-print .acp-month td { height: 90px; }
|
|
4050
|
+
.arbi-calendar-print .acp-month .acp-out { color: #aaa; }
|
|
4051
|
+
.arbi-calendar-print .acp-cell-ev { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
4052
|
+
@media screen { .arbi-calendar-print[data-screen-hidden='true'] { display: none; } }
|
|
4053
|
+
@media print {
|
|
4054
|
+
@page { margin: 12mm; }
|
|
4055
|
+
body.arbi-printing-calendar > *:not(.arbi-calendar-print-host) { display: none !important; }
|
|
4056
|
+
body.arbi-printing-calendar .arbi-calendar-print-host { display: block !important; }
|
|
4057
|
+
body.arbi-printing-calendar .arbi-calendar-print { display: block !important; }
|
|
4058
|
+
}
|
|
4059
|
+
`;
|
|
4060
|
+
function CalendarPrint({
|
|
4061
|
+
events,
|
|
4062
|
+
view,
|
|
4063
|
+
date,
|
|
4064
|
+
timeZone,
|
|
4065
|
+
weekStart = 1,
|
|
4066
|
+
agendaDays = 30,
|
|
4067
|
+
title,
|
|
4068
|
+
calendars,
|
|
4069
|
+
screenHidden = false,
|
|
4070
|
+
showDetails = true
|
|
4071
|
+
}) {
|
|
4072
|
+
const zone = safeZone(timeZone, detectTimeZone());
|
|
4073
|
+
const { from, to } = printRange(view, date, weekStart, agendaDays);
|
|
4074
|
+
const byDay = eventsByDay(events, zone, from, to);
|
|
4075
|
+
const color = (e) => e.color || calendars?.find((c) => c.id === e.calendar_id)?.color || "#3b82f6";
|
|
4076
|
+
const label = (e) => e.restricted && !e.title ? "Busy" : e.title || "(no title)";
|
|
4077
|
+
const evLine = (e, day, details) => /* @__PURE__ */ jsxs("div", { className: "acp-ev", "data-testid": "calendar-print-event", children: [
|
|
4078
|
+
/* @__PURE__ */ jsx("span", { className: "acp-time", children: timeLabel(e, day, zone) }),
|
|
4079
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
4080
|
+
/* @__PURE__ */ jsx("span", { className: "acp-dot", style: { background: color(e) } }),
|
|
4081
|
+
/* @__PURE__ */ jsx("span", { className: e.status === "cancelled" ? "acp-cancelled" : void 0, children: label(e) }),
|
|
4082
|
+
details && e.location && /* @__PURE__ */ jsx("div", { className: "acp-meta", children: e.location }),
|
|
4083
|
+
details && e.description && /* @__PURE__ */ jsx("div", { className: "acp-meta", children: e.description.slice(0, 500) })
|
|
4084
|
+
] })
|
|
4085
|
+
] }, `${e.instance_id}-${day}`);
|
|
4086
|
+
let body;
|
|
4087
|
+
if (view === "agenda" || view === "day") {
|
|
4088
|
+
const days = view === "day" ? [from] : eachDay(from, to).filter((d) => byDay.has(d));
|
|
4089
|
+
body = days.length ? days.map((d) => /* @__PURE__ */ jsxs("section", { className: "acp-day", children: [
|
|
4090
|
+
/* @__PURE__ */ jsx("h2", { children: formatPlainDate(d, { weekday: "long", month: "long", day: "numeric" }) }),
|
|
4091
|
+
(byDay.get(d) ?? []).map((e) => evLine(e, d, showDetails)),
|
|
4092
|
+
!byDay.get(d)?.length && /* @__PURE__ */ jsx("div", { className: "acp-muted", children: "No events" })
|
|
4093
|
+
] }, d)) : /* @__PURE__ */ jsx("p", { className: "acp-muted", children: "No events" });
|
|
4094
|
+
} else if (view === "week") {
|
|
4095
|
+
const days = eachDay(from, to);
|
|
4096
|
+
body = /* @__PURE__ */ jsxs("table", { children: [
|
|
4097
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: days.map((d) => /* @__PURE__ */ jsx("th", { children: formatPlainDate(d, { weekday: "short", day: "numeric", month: "short" }) }, d)) }) }),
|
|
4098
|
+
/* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsx("tr", { children: days.map((d) => /* @__PURE__ */ jsx("td", { style: { height: 480 }, children: (byDay.get(d) ?? []).map((e) => evLine(e, d, false)) }, d)) }) })
|
|
4099
|
+
] });
|
|
4100
|
+
} else {
|
|
4101
|
+
const days = eachDay(from, to);
|
|
4102
|
+
const weeks = [];
|
|
4103
|
+
for (let i = 0; i < days.length; i += 7) weeks.push(days.slice(i, i + 7));
|
|
4104
|
+
const month = date.slice(0, 7);
|
|
4105
|
+
body = /* @__PURE__ */ jsxs("table", { className: "acp-month", children: [
|
|
4106
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: weeks[0].map((d) => /* @__PURE__ */ jsx("th", { children: formatPlainDate(d, { weekday: "short" }) }, d)) }) }),
|
|
4107
|
+
/* @__PURE__ */ jsx("tbody", { children: weeks.map((w) => /* @__PURE__ */ jsx("tr", { children: w.map((d) => /* @__PURE__ */ jsxs("td", { className: d.slice(0, 7) === month ? void 0 : "acp-out", children: [
|
|
4108
|
+
/* @__PURE__ */ jsx("div", { children: Number(d.slice(8)) }),
|
|
4109
|
+
(byDay.get(d) ?? []).slice(0, 6).map((e) => /* @__PURE__ */ jsxs(
|
|
4110
|
+
"div",
|
|
4111
|
+
{
|
|
4112
|
+
className: "acp-cell-ev",
|
|
4113
|
+
"data-testid": "calendar-print-event",
|
|
4114
|
+
children: [
|
|
4115
|
+
/* @__PURE__ */ jsx("span", { className: "acp-dot", style: { background: color(e) } }),
|
|
4116
|
+
!e.all_day && `${timeLabel(e, d, zone).split(" \u2013 ")[0]} `,
|
|
4117
|
+
label(e)
|
|
4118
|
+
]
|
|
4119
|
+
},
|
|
4120
|
+
`${e.instance_id}-${d}`
|
|
4121
|
+
)),
|
|
4122
|
+
(byDay.get(d)?.length ?? 0) > 6 && /* @__PURE__ */ jsxs("div", { className: "acp-cell-ev acp-muted", children: [
|
|
4123
|
+
"+",
|
|
4124
|
+
(byDay.get(d)?.length ?? 0) - 6,
|
|
4125
|
+
" more"
|
|
4126
|
+
] })
|
|
4127
|
+
] }, d)) }, w[0])) })
|
|
4128
|
+
] });
|
|
4129
|
+
}
|
|
4130
|
+
return /* @__PURE__ */ jsxs(
|
|
4131
|
+
"div",
|
|
4132
|
+
{
|
|
4133
|
+
className: "arbi-calendar-print",
|
|
4134
|
+
"data-screen-hidden": screenHidden ? "true" : "false",
|
|
4135
|
+
"data-testid": "calendar-print",
|
|
4136
|
+
children: [
|
|
4137
|
+
/* @__PURE__ */ jsx("style", { children: STYLE }),
|
|
4138
|
+
/* @__PURE__ */ jsx("h1", { children: title ?? heading(view, date, from, to) }),
|
|
4139
|
+
/* @__PURE__ */ jsxs("div", { className: "acp-zone", children: [
|
|
4140
|
+
"Times in ",
|
|
4141
|
+
zone.replace(/_/g, " ")
|
|
4142
|
+
] }),
|
|
4143
|
+
body
|
|
4144
|
+
]
|
|
4145
|
+
}
|
|
4146
|
+
);
|
|
4147
|
+
}
|
|
4148
|
+
function printCalendar(props) {
|
|
4149
|
+
const host = document.createElement("div");
|
|
4150
|
+
host.className = "arbi-calendar-print-host";
|
|
4151
|
+
host.style.display = "none";
|
|
4152
|
+
document.body.appendChild(host);
|
|
4153
|
+
let unmount = null;
|
|
4154
|
+
if (props) {
|
|
4155
|
+
const root = createRoot(host);
|
|
4156
|
+
flushSync(() => root.render(/* @__PURE__ */ jsx(CalendarPrint, { ...props, screenHidden: false })));
|
|
4157
|
+
unmount = () => root.unmount();
|
|
4158
|
+
} else {
|
|
4159
|
+
const existing = document.querySelector(".arbi-calendar-print");
|
|
4160
|
+
if (!existing) {
|
|
4161
|
+
host.remove();
|
|
4162
|
+
return;
|
|
4163
|
+
}
|
|
4164
|
+
const clone = existing.cloneNode(true);
|
|
4165
|
+
clone.setAttribute("data-screen-hidden", "false");
|
|
4166
|
+
host.appendChild(clone);
|
|
4167
|
+
}
|
|
4168
|
+
document.body.classList.add("arbi-printing-calendar");
|
|
4169
|
+
let done = false;
|
|
4170
|
+
const cleanup = () => {
|
|
4171
|
+
if (done) return;
|
|
4172
|
+
done = true;
|
|
4173
|
+
window.removeEventListener("afterprint", cleanup);
|
|
4174
|
+
document.body.classList.remove("arbi-printing-calendar");
|
|
4175
|
+
unmount?.();
|
|
4176
|
+
host.remove();
|
|
4177
|
+
};
|
|
4178
|
+
window.addEventListener("afterprint", cleanup);
|
|
4179
|
+
try {
|
|
4180
|
+
window.print();
|
|
4181
|
+
} finally {
|
|
4182
|
+
if (!("onafterprint" in window)) setTimeout(cleanup, 1e3);
|
|
4183
|
+
}
|
|
4184
|
+
}
|
|
4185
|
+
|
|
4186
|
+
// src/calendar/booking-slots.ts
|
|
4187
|
+
function formatSlotTime(instant, zone, locale) {
|
|
4188
|
+
return formatInZone(instant, zone, { hour: "numeric", minute: "2-digit" }, locale);
|
|
4189
|
+
}
|
|
4190
|
+
function formatDayLabel(date, locale) {
|
|
4191
|
+
return formatPlainDate(date, { weekday: "long", month: "long", day: "numeric" }, locale);
|
|
4192
|
+
}
|
|
4193
|
+
function groupSlotsByDay(slots, zone, locale) {
|
|
4194
|
+
const tz = safeZone(zone, detectTimeZone());
|
|
4195
|
+
const byDay = /* @__PURE__ */ new Map();
|
|
4196
|
+
const sorted = [...slots].sort((a, b) => new Date(a).getTime() - new Date(b).getTime());
|
|
4197
|
+
for (const start of sorted) {
|
|
4198
|
+
const date = utcToDate(start, tz);
|
|
4199
|
+
const list = byDay.get(date) ?? [];
|
|
4200
|
+
list.push({ start, label: formatSlotTime(start, tz, locale) });
|
|
4201
|
+
byDay.set(date, list);
|
|
4202
|
+
}
|
|
4203
|
+
return [...byDay.entries()].map(([date, list]) => ({
|
|
4204
|
+
date,
|
|
4205
|
+
label: formatDayLabel(date, locale),
|
|
4206
|
+
slots: list
|
|
4207
|
+
}));
|
|
4208
|
+
}
|
|
4209
|
+
function formatSlotRange(start, end, zone, locale) {
|
|
4210
|
+
const tz = safeZone(zone, detectTimeZone());
|
|
4211
|
+
const fmt = new Intl.DateTimeFormat(locale, {
|
|
4212
|
+
timeZone: tz,
|
|
4213
|
+
weekday: "long",
|
|
4214
|
+
month: "long",
|
|
4215
|
+
day: "numeric",
|
|
4216
|
+
hour: "numeric",
|
|
4217
|
+
minute: "2-digit"
|
|
4218
|
+
});
|
|
4219
|
+
const s = new Date(start);
|
|
4220
|
+
const e = new Date(end);
|
|
4221
|
+
const range = fmt.formatRange;
|
|
4222
|
+
const text = range ? range.call(fmt, s, e) : `${fmt.format(s)} \u2013 ${formatSlotTime(end, tz, locale)}`;
|
|
4223
|
+
return `${text} (${tz.replace(/_/g, " ")})`;
|
|
4224
|
+
}
|
|
4225
|
+
function zoneOptions(current) {
|
|
4226
|
+
const zones = listTimeZones();
|
|
4227
|
+
return zones.includes(current) ? zones : [current, ...zones];
|
|
4228
|
+
}
|
|
4229
|
+
|
|
4230
|
+
export { ARBI_WEBINAR_LABEL, CALENDAR_COLORS, CALENDAR_DEFAULT_LABELS, CALENDAR_NARROW_WIDTH, CalendarGrid, CalendarList, CalendarPrint, CalendarSettingsForm, DEFAULT_RECURRENCE_DESCRIBE_LABELS, DEFAULT_RECURRENCE_EDITOR_LABELS, DEFAULT_REMINDER_FORMAT_LABELS, EventDetails, EventEditor, MiniMonth, REMINDER_PRESETS, RRULE_WEEKDAYS, RecurrenceEditor, RoomFinder, SchedulingAssistant, ScopeDialog, TimeZonePicker, allDayInclusiveEnd, attendeeKey, buildRRule, contrastText, dayWindow, defaultRecurrenceForm, describeRecurrence, draftFromSlot, draftRangeUtc, effectiveCalendarView, eventDays, eventStateClasses, eventsByDay, formatDayLabel, formatEventWhen, formatReminder, formatSlotRange, formatSlotTime, formatZoneLabel, getTemporalTimeZonePlugin, groupSlotsByDay, hourTicks, isAllDayDraft, isWebinarConference, outsideIntervals, parseRRule, placeIntervals, printCalendar, printRange, reminderToMinutes, setDraftAllDay, setDraftEnd, setDraftStart, setPosOf, specDate, specTime, splitReminderMinutes, toBusinessHours, validateDraft, weekdayOf, workWeekHiddenDays, zoneOptions };
|
|
3957
4231
|
//# sourceMappingURL=index.js.map
|
|
3958
4232
|
//# sourceMappingURL=index.js.map
|