@dayflow/core 3.4.1 → 3.4.3

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as preact from 'preact';
2
- import { ComponentChildren, AnyComponent, h, RefObject, JSX } from 'preact';
2
+ import { ComponentChildren, AnyComponent, RefObject, JSX } from 'preact';
3
3
  import { Temporal } from 'temporal-polyfill';
4
4
  import * as preact_compat from 'preact/compat';
5
5
  export { createPortal } from 'preact/compat';
@@ -149,6 +149,12 @@ declare class CalendarRegistry {
149
149
  * Get the default calendar type
150
150
  */
151
151
  getDefaultCalendar(): CalendarType;
152
+ /**
153
+ * Get the first writable (non-readOnly, non-subscription) calendar for event creation.
154
+ * Prefers the default calendar; falls back to the first writable calendar.
155
+ * Returns undefined if every calendar is read-only.
156
+ */
157
+ getDefaultWritableCalendar(): CalendarType | undefined;
152
158
  /**
153
159
  * Set the current theme
154
160
  */
@@ -526,13 +532,14 @@ interface CalendarCallbacks {
526
532
  onCalendarDelete?: (calendarId: string) => void | Promise<void>;
527
533
  onCalendarMerge?: (sourceId: string, targetId: string) => void | Promise<void>;
528
534
  onEventClick?: (event: Event) => void | Promise<void>;
535
+ onEventDoubleClick?: (event: Event, e: MouseEvent) => boolean | undefined | Promise<boolean | undefined>;
529
536
  onMoreEventsClick?: (date: Date) => void | Promise<void>;
530
537
  onDismissUI?: () => void | Promise<void>;
531
538
  }
532
539
  interface CalendarHeaderProps {
533
540
  calendar: ICalendarApp;
534
541
  switcherMode?: ViewSwitcherMode;
535
- onAddCalendar?: (e: h.JSX.TargetedMouseEvent<HTMLElement> | h.JSX.TargetedTouchEvent<HTMLElement>) => void;
542
+ onAddCalendar?: (e: MouseEvent | TouchEvent | any) => void;
536
543
  onSearchChange?: (value: string) => void;
537
544
  /** Triggered when search icon is clicked (typically on mobile) */
538
545
  onSearchClick?: () => void;
@@ -552,6 +559,17 @@ interface EventContentSlotArgs {
552
559
  isDragging: boolean;
553
560
  layout?: EventLayout;
554
561
  }
562
+ /** Args passed to the eventContextMenu slot renderer. */
563
+ interface EventContextMenuSlotArgs {
564
+ event: Event;
565
+ onClose: () => void;
566
+ }
567
+ /** Args passed to the gridContextMenu slot renderer. */
568
+ interface GridContextMenuSlotArgs {
569
+ date: Date;
570
+ viewType?: ViewType;
571
+ onClose: () => void;
572
+ }
555
573
  /**
556
574
  * Calendar application configuration
557
575
  * Used to initialize CalendarApp
@@ -649,6 +667,7 @@ interface ICalendarApp {
649
667
  getEvents: () => Event[];
650
668
  getAllEvents: () => Event[];
651
669
  onEventClick: (event: Event) => void;
670
+ onEventDoubleClick: (event: Event, e: MouseEvent) => boolean | undefined | Promise<boolean | undefined>;
652
671
  onMoreEventsClick: (date: Date) => void;
653
672
  highlightEvent: (eventId: string | null) => void;
654
673
  selectEvent: (eventId: string | null) => void;
@@ -1093,7 +1112,7 @@ interface EventDetailPanelProps {
1093
1112
  /** Whether the event is all-day */
1094
1113
  isAllDay: boolean;
1095
1114
  /** Event visibility state */
1096
- eventVisibility: 'visible' | 'sticky-top' | 'sticky-bottom';
1115
+ eventVisibility: 'visible' | 'sticky-top' | 'sticky-bottom' | 'sticky-left' | 'sticky-right';
1097
1116
  /** Calendar container reference */
1098
1117
  calendarRef: RefObject<HTMLDivElement>;
1099
1118
  /** Selected event element reference */
@@ -1444,13 +1463,6 @@ interface DragPluginConfig {
1444
1463
  supportedViews: ViewType[];
1445
1464
  onEventDrop?: (updatedEvent: Event, originalEvent: Event) => void | Promise<void>;
1446
1465
  onEventResize?: (updatedEvent: Event, originalEvent: Event) => void | Promise<void>;
1447
- /**
1448
- * Controls cursor position relative to the drag indicator when dragging all-day events
1449
- * in month/year views.
1450
- * - `true` (default): cursor anchors to the start (left edge) of the indicator
1451
- * - `false`: cursor anchors to the center of the indicator
1452
- */
1453
- allDayDragCursorAtStart?: boolean;
1454
1466
  [key: string]: unknown;
1455
1467
  }
1456
1468
  /**
@@ -1573,6 +1585,7 @@ declare class CalendarApp implements ICalendarApp {
1573
1585
  getAllEvents: () => Event[];
1574
1586
  getEvents: () => Event[];
1575
1587
  onEventClick: (event: Event) => void;
1588
+ onEventDoubleClick: (event: Event, e: MouseEvent) => boolean | undefined | Promise<boolean | undefined>;
1576
1589
  onMoreEventsClick: (date: Date) => void;
1577
1590
  highlightEvent: (eventId: string | null) => void;
1578
1591
  selectEvent: (eventId: string | null) => void;
@@ -1616,6 +1629,7 @@ declare class CustomRenderingStore {
1616
1629
  private renderings;
1617
1630
  private overrides;
1618
1631
  private listeners;
1632
+ private overrideListeners;
1619
1633
  constructor(initialOverrides?: string[]);
1620
1634
  /**
1621
1635
  * Register a new custom rendering placeholder.
@@ -1640,7 +1654,13 @@ declare class CustomRenderingStore {
1640
1654
  * Called by the framework adapter (React/Vue/etc.)
1641
1655
  */
1642
1656
  subscribe(listener: CustomRenderingListener): () => void;
1657
+ /**
1658
+ * Subscribe only to override changes (setOverrides calls).
1659
+ * Used by ContentSlot components to avoid re-rendering on every register/unregister.
1660
+ */
1661
+ subscribeToOverrides(listener: () => void): () => void;
1643
1662
  private notify;
1663
+ private notifyOverrides;
1644
1664
  }
1645
1665
 
1646
1666
  declare class CalendarRenderer {
@@ -2812,6 +2832,29 @@ declare const restoreTimedDragFromAllDayTransition: ({ wasOriginallyAllDay, mous
2812
2832
 
2813
2833
  declare function normalizeTimeZoneValue(timeZone?: TimeZoneValue): string | undefined;
2814
2834
 
2835
+ type SyncableCalendarAppConfig = Pick<CalendarAppConfig, 'allDaySortComparator' | 'calendars' | 'customMobileEventRenderer' | 'locale' | 'readOnly' | 'switcherMode' | 'theme' | 'timeZone' | 'useCalendarHeader' | 'useEventDetailDialog' | 'views'>;
2836
+ type CalendarAppConfigSyncSnapshot = {
2837
+ callbacks: CalendarAppConfig['callbacks'];
2838
+ syncableConfig: SyncableCalendarAppConfig;
2839
+ };
2840
+ type CalendarAppConfigUpdater = {
2841
+ updateConfig: (config: Partial<CalendarAppConfig>) => void;
2842
+ };
2843
+ declare function pickSyncableConfig(config: CalendarAppConfig): SyncableCalendarAppConfig;
2844
+ declare function createConfigSyncSnapshot(config: CalendarAppConfig): CalendarAppConfigSyncSnapshot;
2845
+ declare function getCallbackConfigUpdate(previous: CalendarAppConfig['callbacks'], next: CalendarAppConfig['callbacks']): Pick<CalendarAppConfig, 'callbacks'> | null;
2846
+ declare function getSyncConfigUpdates(previous: SyncableCalendarAppConfig, next: SyncableCalendarAppConfig): Partial<CalendarAppConfig>;
2847
+ declare function syncCalendarAppConfig(app: CalendarAppConfigUpdater, previousSnapshot: CalendarAppConfigSyncSnapshot, config: CalendarAppConfig): CalendarAppConfigSyncSnapshot;
2848
+
2849
+ type CalendarAppConfigGetter = () => CalendarAppConfig;
2850
+ declare function createNormalizedCalendarAppConfigGetter(getConfig: CalendarAppConfigGetter): () => CalendarAppConfig;
2851
+
2852
+ type ViewConfigComparison = {
2853
+ hasChanges: boolean;
2854
+ requiresRender: boolean;
2855
+ };
2856
+ declare const compareViews: (previousView: CalendarView | undefined, nextView: CalendarView) => ViewConfigComparison;
2857
+
2815
2858
  interface SubscribeResult {
2816
2859
  calendar: CalendarType;
2817
2860
  events: Event[];
@@ -3210,5 +3253,5 @@ declare const sidebarHeaderToggle = "df-sidebar-header-toggle flex h-8 w-8 items
3210
3253
  */
3211
3254
  declare const sidebarHeaderTitle = "df-sidebar-header-title text-sm font-semibold text-gray-700 dark:text-gray-200";
3212
3255
 
3213
- export { AlertCircle, AudioLines, BlossomColorPicker, CalendarApp, CalendarEvent, CalendarRegistry, CalendarRenderer, Check, ChevronDown, ChevronRight, ChevronsUpDown, ContentSlot, ContextMenu, ContextMenuColorPicker, ContextMenuItem, ContextMenuLabel, ContextMenuSeparator, CreateCalendarDialog, CustomRenderingStore, RangePicker as DayflowRangePicker, DefaultColorPicker, DefaultEventDetailDialog, DefaultEventDetailPanel, EventContextMenu, GridContextMenu, LAYOUT_CONFIG, LOCALES, Loader2, LoadingButton, LocaleContext, LocaleProvider, MiniCalendar, PanelRightClose, PanelRightOpen, Plus, TIME_STEP, TimeZone, VIRTUAL_MONTH_SCROLL_CONFIG, ViewType, WeekDataCache, addDays, buildParseRegExp, calculateDayIndex, calendarPickerDropdown, cancelButton, capitalize, clipboardStore, compareAllDayDisplayPriority, conditionalTheme, convertDateEvent, convertDateEventWithTimeZone, convertToDayFlowEvent, createAllDayDisplayComparator, createAllDayEvent, createDateWithHour, createDayView, createEvent, createEventWithDate, createEventWithPlainDateTime, createEventWithRealDate, createEventWithZonedDateTime, createEvents, createEventsPlugin, createMonthView, createStandardViews, createTemporalWithHour, createTimedEvent, createTimezoneEvent, createTimezoneEvents, createWeekView, createYearView, dateToPlainDate, dateToPlainDateTime, dateToZonedDateTime, daysBetween, daysDifference, downloadICS, en, escapeICSValue, extractHourFromDate, extractHourFromTemporal, extractVEvents, foldLine, formatDate, formatDateConsistent, formatDateToICSTimestamp, formatEventTimeRange, formatICSDate, formatMonthYear, formatProperty, formatTemporal, formatTime, generateDayData, generateICS, generateSecondaryTimeSlots, generateUniKey, generateVEvent, generateWeekData, generateWeekRange, generateWeeksData, getAllDayEventsForDay, getAllDayRangeMetrics, getCalendarColorsForHex, getCurrentWeekDates, getDateByDayIndex, getDateObj, getDayIndexByDate, getEndOfDay, getEndOfTemporal, getEventBgColor, getEventEndHour, getEventTextColor, getEventsForDay, getEventsForWeek, getIntlLabel, getLineColor, getMonthLabels, getMonthYearOfWeek, getNextHourRangeInTimeZone, getNowInTimeZone, getPlainDate, getSearchHeaderInfo, getSelectedBgColor, getStartOfDay, getStartOfTemporal, getTestEvents, getTimezoneDisplayLabel, getTodayInTimeZone, getWeekDaysLabels, getWeekNumber, getWeekRange, getZoneId, groupSearchResults, hasEventChanged, importICSFile, isDate, isDeepEqual, isEventDeepEqual, isEventInWeek, isMultiDayEvent, isMultiDayTemporalEvent, isPlainDate, isPlainDateTime, isSameDay, isSamePlainDate, isSameTemporal, isValidLocale, isZonedDateTime, mergeClasses, mergeFormatTemplate, monthNames, normalizeCssWidth, normalizeDate, normalizeLocale, normalizeTimeZoneValue, normalizeToZoned, now, pad, pad2, parseICS, parseICSDate, parseTemporalString, parseVEventLines, plainDateTimeToDate, plainDateToDate, recalculateEventDays, registerDragImplementation, registerLocale, registerSidebarImplementation, resolveAppliedTheme, restoreTimedDragFromAllDayTransition, restoreVisualEventToCanonical, restoreVisualTimedTemporalToCanonical, roundToTimeStep, scrollbarTakesSpace, setHourInTemporal, shortMonthNames, sidebarContainer, sidebarHeader, sidebarHeaderTitle, sidebarHeaderToggle, sortAllDayByTitle, subscribeCalendar, t, temporalToDate, temporalToVisualDate, temporalToVisualTemporal, themeClasses, themeCn, today, unescapeICSValue, updateEventDateAndDay, updateEventWithRealDate, useDragForView, useLocale, useSidebarBridge, weekDays, weekDaysFullName, zonedDateTimeToDate };
3214
- export type { AllDaySortComparator, BalanceStrategy, BaseViewProps, CalendarAppConfig, CalendarAppState, CalendarCallbacks, CalendarColors, CalendarConfig, CalendarEventProps, CalendarHeaderProps, CalendarPlugin, CalendarType, CalendarView, CalendarViewType, CalendarsConfig, ColorPickerProps, CreateCalendarDialogColorPickerProps, CreateCalendarDialogProps, CreateEventParams, CreateTimezoneEventParams, CustomRendering, DayData, DayViewConfig, DayViewProps, DragConfig, DragHookOptions, DragHookReturn, DragIndicatorProps, DragIndicatorRenderer, DragIntegrationProps, DragPluginConfig, DragRef, DragService, Event, EventChange, EventContentSlotArgs, EventDetailContentProps, EventDetailContentRenderer, EventDetailDialogProps, EventDetailDialogRenderer, EventDetailPanelProps, EventDetailPanelRenderer, EventDetailPosition, EventGroup, EventLayout, EventRelations, EventsPluginConfig, EventsService, ICSDateParams, ICSExportOptions, ICSImportOptions, ICSImportResult, ICSParseError, ICSVEvent, ICalendarApp, Locale, LocaleCode, LocaleContextValue, LocaleDict, LocaleMessages, LocaleProviderProps, MobileEventProps, MobileEventRenderer, Mode, MonthDragState, MonthEventDragState, MonthScrollConfig, MonthViewConfig, MonthViewProps, NestedLayer, RangeChangeReason, RangePickerProps, ReadOnlyConfig, SidebarBridgeReturn, SidebarHeaderSlotArgs, SpecialLayoutRule, SubscribeResult, SubtreeAnalysis, SupportedLang, TComponent, TNode, ThemeColors, ThemeConfig, ThemeMode, TimeZoneValue, TitleBarSlotProps, TransferOperation, TranslationKey, UnifiedDragRef, UseCalendarAppReturn, UseCalendarReturn, UseDragCommonReturn, UseDragHandlersParams, UseDragHandlersReturn, UseDragManagerReturn, UseDragStateReturn, UseMonthDragParams, UseMonthDragReturn, UseVirtualMonthScrollProps, UseVirtualMonthScrollReturn, UseVirtualScrollProps, UseVirtualScrollReturn, UseWeekDayDragParams, UseWeekDayDragReturn, ViewAdapterProps, ViewFactory, ViewFactoryConfig, VirtualItem, VirtualScrollIntegrationProps, VirtualWeekItem, WeekDayDragState, WeekViewConfig, WeekViewProps, WeeksData, YearViewConfig, YearViewProps, ZonedRange, useDragProps, useDragReturn };
3256
+ export { AlertCircle, AudioLines, BlossomColorPicker, CalendarApp, CalendarEvent, CalendarRegistry, CalendarRenderer, Check, ChevronDown, ChevronRight, ChevronsUpDown, ContentSlot, ContextMenu, ContextMenuColorPicker, ContextMenuItem, ContextMenuLabel, ContextMenuSeparator, CreateCalendarDialog, CustomRenderingStore, RangePicker as DayflowRangePicker, DefaultColorPicker, DefaultEventDetailDialog, DefaultEventDetailPanel, EventContextMenu, GridContextMenu, LAYOUT_CONFIG, LOCALES, Loader2, LoadingButton, LocaleContext, LocaleProvider, MiniCalendar, PanelRightClose, PanelRightOpen, Plus, TIME_STEP, TimeZone, VIRTUAL_MONTH_SCROLL_CONFIG, ViewType, WeekDataCache, addDays, buildParseRegExp, calculateDayIndex, calendarPickerDropdown, cancelButton, capitalize, clipboardStore, compareAllDayDisplayPriority, compareViews, conditionalTheme, convertDateEvent, convertDateEventWithTimeZone, convertToDayFlowEvent, createAllDayDisplayComparator, createAllDayEvent, createConfigSyncSnapshot, createDateWithHour, createDayView, createEvent, createEventWithDate, createEventWithPlainDateTime, createEventWithRealDate, createEventWithZonedDateTime, createEvents, createEventsPlugin, createMonthView, createNormalizedCalendarAppConfigGetter, createStandardViews, createTemporalWithHour, createTimedEvent, createTimezoneEvent, createTimezoneEvents, createWeekView, createYearView, dateToPlainDate, dateToPlainDateTime, dateToZonedDateTime, daysBetween, daysDifference, downloadICS, en, escapeICSValue, extractHourFromDate, extractHourFromTemporal, extractVEvents, foldLine, formatDate, formatDateConsistent, formatDateToICSTimestamp, formatEventTimeRange, formatICSDate, formatMonthYear, formatProperty, formatTemporal, formatTime, generateDayData, generateICS, generateSecondaryTimeSlots, generateUniKey, generateVEvent, generateWeekData, generateWeekRange, generateWeeksData, getAllDayEventsForDay, getAllDayRangeMetrics, getCalendarColorsForHex, getCallbackConfigUpdate, getCurrentWeekDates, getDateByDayIndex, getDateObj, getDayIndexByDate, getEndOfDay, getEndOfTemporal, getEventBgColor, getEventEndHour, getEventTextColor, getEventsForDay, getEventsForWeek, getIntlLabel, getLineColor, getMonthLabels, getMonthYearOfWeek, getNextHourRangeInTimeZone, getNowInTimeZone, getPlainDate, getSearchHeaderInfo, getSelectedBgColor, getStartOfDay, getStartOfTemporal, getSyncConfigUpdates, getTestEvents, getTimezoneDisplayLabel, getTodayInTimeZone, getWeekDaysLabels, getWeekNumber, getWeekRange, getZoneId, groupSearchResults, hasEventChanged, importICSFile, isDate, isDeepEqual, isEventDeepEqual, isEventInWeek, isMultiDayEvent, isMultiDayTemporalEvent, isPlainDate, isPlainDateTime, isSameDay, isSamePlainDate, isSameTemporal, isValidLocale, isZonedDateTime, mergeClasses, mergeFormatTemplate, monthNames, normalizeCssWidth, normalizeDate, normalizeLocale, normalizeTimeZoneValue, normalizeToZoned, now, pad, pad2, parseICS, parseICSDate, parseTemporalString, parseVEventLines, pickSyncableConfig, plainDateTimeToDate, plainDateToDate, recalculateEventDays, registerDragImplementation, registerLocale, registerSidebarImplementation, resolveAppliedTheme, restoreTimedDragFromAllDayTransition, restoreVisualEventToCanonical, restoreVisualTimedTemporalToCanonical, roundToTimeStep, scrollbarTakesSpace, setHourInTemporal, shortMonthNames, sidebarContainer, sidebarHeader, sidebarHeaderTitle, sidebarHeaderToggle, sortAllDayByTitle, subscribeCalendar, syncCalendarAppConfig, t, temporalToDate, temporalToVisualDate, temporalToVisualTemporal, themeClasses, themeCn, today, unescapeICSValue, updateEventDateAndDay, updateEventWithRealDate, useDragForView, useLocale, useSidebarBridge, weekDays, weekDaysFullName, zonedDateTimeToDate };
3257
+ export type { AllDaySortComparator, BalanceStrategy, BaseViewProps, CalendarAppConfig, CalendarAppConfigSyncSnapshot, CalendarAppState, CalendarCallbacks, CalendarColors, CalendarConfig, CalendarEventProps, CalendarHeaderProps, CalendarPlugin, CalendarType, CalendarView, CalendarViewType, CalendarsConfig, ColorPickerProps, CreateCalendarDialogColorPickerProps, CreateCalendarDialogProps, CreateEventParams, CreateTimezoneEventParams, CustomRendering, DayData, DayViewConfig, DayViewProps, DragConfig, DragHookOptions, DragHookReturn, DragIndicatorProps, DragIndicatorRenderer, DragIntegrationProps, DragPluginConfig, DragRef, DragService, Event, EventChange, EventContentSlotArgs, EventContextMenuSlotArgs, EventDetailContentProps, EventDetailContentRenderer, EventDetailDialogProps, EventDetailDialogRenderer, EventDetailPanelProps, EventDetailPanelRenderer, EventDetailPosition, EventGroup, EventLayout, EventRelations, EventsPluginConfig, EventsService, GridContextMenuSlotArgs, ICSDateParams, ICSExportOptions, ICSImportOptions, ICSImportResult, ICSParseError, ICSVEvent, ICalendarApp, Locale, LocaleCode, LocaleContextValue, LocaleDict, LocaleMessages, LocaleProviderProps, MobileEventProps, MobileEventRenderer, Mode, MonthDragState, MonthEventDragState, MonthScrollConfig, MonthViewConfig, MonthViewProps, NestedLayer, RangeChangeReason, RangePickerProps, ReadOnlyConfig, SidebarBridgeReturn, SidebarHeaderSlotArgs, SpecialLayoutRule, SubscribeResult, SubtreeAnalysis, SupportedLang, SyncableCalendarAppConfig, TComponent, TNode, ThemeColors, ThemeConfig, ThemeMode, TimeZoneValue, TitleBarSlotProps, TransferOperation, TranslationKey, UnifiedDragRef, UseCalendarAppReturn, UseCalendarReturn, UseDragCommonReturn, UseDragHandlersParams, UseDragHandlersReturn, UseDragManagerReturn, UseDragStateReturn, UseMonthDragParams, UseMonthDragReturn, UseVirtualMonthScrollProps, UseVirtualMonthScrollReturn, UseVirtualScrollProps, UseVirtualScrollReturn, UseWeekDayDragParams, UseWeekDayDragReturn, ViewAdapterProps, ViewConfigComparison, ViewFactory, ViewFactoryConfig, VirtualItem, VirtualScrollIntegrationProps, VirtualWeekItem, WeekDayDragState, WeekViewConfig, WeekViewProps, WeeksData, YearViewConfig, YearViewProps, ZonedRange, useDragProps, useDragReturn };