@dayflow/core 3.1.0 → 3.1.1
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/README.md +3 -3
- package/dist/index.d.ts +36 -8
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +118 -124
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,17 +16,17 @@ views, and plugin architecture.
|
|
|
16
16
|
|
|
17
17
|
| Monthly | Weekly |
|
|
18
18
|
| --------------------------------------- | -------------------------------------- |
|
|
19
|
-
|  |  |
|
|
20
20
|
|
|
21
21
|
| Daily | Event Stack Level |
|
|
22
22
|
| ------------------------------------- | ---------------------------------------- |
|
|
23
|
-
|  |  |
|
|
24
24
|
|
|
25
25
|
### Default Panel (with multiple Event Detail Panel options available)
|
|
26
26
|
|
|
27
27
|
| Detail Popup | Detail Dialog |
|
|
28
28
|
| ----------------------------------- | ------------------------------------ |
|
|
29
|
-
|  |  |
|
|
30
30
|
|
|
31
31
|
### Easy to resize and drag
|
|
32
32
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Temporal } from 'temporal-polyfill';
|
|
2
2
|
import * as preact from 'preact';
|
|
3
3
|
import { ComponentChildren, RefObject, h } from 'preact';
|
|
4
|
-
import { Event as Event$1 } from '@/types';
|
|
5
4
|
import * as preact_compat from 'preact/compat';
|
|
6
5
|
export { createPortal } from 'preact/compat';
|
|
7
6
|
import { BlossomColorPickerOptions } from '@dayflow/blossom-color-picker';
|
|
@@ -200,7 +199,7 @@ declare function getCalendarColorsForHex(hex: string): {
|
|
|
200
199
|
};
|
|
201
200
|
|
|
202
201
|
type LocaleCode = string;
|
|
203
|
-
type TranslationKey = 'allDay' | 'noEvents' | 'more' | 'eventTitle' | 'dateRange' | 'timeRange' | 'note' | 'addNotePlaceholder' | 'setAsAllDay' | 'setAsTimed' | 'delete' | 'confirm' | 'cancel' | 'today' | 'day' | 'week' | 'month' | 'year' | 'newEvent' | 'newAllDayEvent' | 'newCalendarEvent' | 'newAllDayCalendarEvent' | 'save' | 'deleteCalendar' | 'deleteCalendarMessage' | 'merge' | 'confirmDeleteTitle' | 'confirmDeleteMessage' | 'mergeConfirmTitle' | 'mergeConfirmMessage' | 'expandSidebar' | 'collapseSidebar' | 'calendars' | 'createCalendar' | 'calendarNamePlaceholder' | 'customColor' | 'create' | 'calendarOptions' | 'untitled' | 'search' | 'noResults' | 'calendar' | 'starts' | 'ends' | 'notes' | 'titlePlaceholder' | 'notesPlaceholder' | 'editEvent' | 'done' | 'quickCreateEvent' | 'quickCreatePlaceholder' | 'noSuggestions' | 'newCalendar' | 'refreshAll' | 'tomorrow' | 'importCalendar' | 'exportCalendar' | 'addSchedule' | 'importCalendarMessage' | 'ok' | 'cut' | 'copy' | 'pasteHere' | 'eventSummary';
|
|
202
|
+
type TranslationKey = 'allDay' | 'noEvents' | 'more' | 'eventTitle' | 'dateRange' | 'timeRange' | 'note' | 'addNotePlaceholder' | 'setAsAllDay' | 'setAsTimed' | 'delete' | 'confirm' | 'cancel' | 'today' | 'day' | 'week' | 'month' | 'year' | 'newEvent' | 'newAllDayEvent' | 'newCalendarEvent' | 'newAllDayCalendarEvent' | 'save' | 'deleteCalendar' | 'deleteCalendarMessage' | 'merge' | 'confirmDeleteTitle' | 'confirmDeleteMessage' | 'mergeConfirmTitle' | 'mergeConfirmMessage' | 'expandSidebar' | 'collapseSidebar' | 'calendars' | 'createCalendar' | 'calendarNamePlaceholder' | 'customColor' | 'create' | 'calendarOptions' | 'untitled' | 'search' | 'noResults' | 'calendar' | 'starts' | 'ends' | 'notes' | 'titlePlaceholder' | 'notesPlaceholder' | 'editEvent' | 'viewEvent' | 'done' | 'quickCreateEvent' | 'quickCreatePlaceholder' | 'noSuggestions' | 'newCalendar' | 'refreshAll' | 'tomorrow' | 'importCalendar' | 'exportCalendar' | 'addSchedule' | 'importCalendarMessage' | 'ok' | 'cut' | 'copy' | 'pasteHere' | 'eventSummary';
|
|
204
203
|
type LocaleDict = Partial<Record<TranslationKey, string>>;
|
|
205
204
|
type LocaleMessages = Partial<Record<TranslationKey, string>>;
|
|
206
205
|
interface Locale {
|
|
@@ -218,6 +217,8 @@ interface MobileEventProps {
|
|
|
218
217
|
onClose: () => void;
|
|
219
218
|
/** Callback to save the event (creates or updates) */
|
|
220
219
|
onSave: (event: Event) => void;
|
|
220
|
+
/** Callback to delete an existing event by id */
|
|
221
|
+
onEventDelete?: (id: string) => void;
|
|
221
222
|
/** Current event data (newly created template or existing event) */
|
|
222
223
|
draftEvent: Event | null;
|
|
223
224
|
/** The ICalendarApp instance providing built-in services */
|
|
@@ -260,18 +261,35 @@ interface CalendarView {
|
|
|
260
261
|
component: TComponent;
|
|
261
262
|
config?: Record<string, unknown>;
|
|
262
263
|
}
|
|
264
|
+
type RangeChangeReason = 'initial' | 'navigation' | 'viewChange' | 'scroll';
|
|
265
|
+
type EventChange = {
|
|
266
|
+
type: 'create';
|
|
267
|
+
event: Event;
|
|
268
|
+
} | {
|
|
269
|
+
type: 'update';
|
|
270
|
+
before: Event;
|
|
271
|
+
after: Event;
|
|
272
|
+
} | {
|
|
273
|
+
type: 'delete';
|
|
274
|
+
event: Event;
|
|
275
|
+
};
|
|
263
276
|
/**
|
|
264
277
|
* Calendar callbacks interface
|
|
265
278
|
* Defines calendar event callback functions
|
|
266
279
|
*/
|
|
267
280
|
interface CalendarCallbacks {
|
|
281
|
+
onEventBatchChange?: (changes: EventChange[]) => void | Promise<void>;
|
|
268
282
|
onViewChange?: (view: ViewType) => void | Promise<void>;
|
|
269
283
|
onEventCreate?: (event: Event) => void | Promise<void>;
|
|
270
284
|
onEventUpdate?: (event: Event) => void | Promise<void>;
|
|
271
285
|
onEventDelete?: (eventId: string) => void | Promise<void>;
|
|
272
286
|
onDateChange?: (date: Date) => void | Promise<void>;
|
|
273
287
|
onRender?: () => void | Promise<void>;
|
|
288
|
+
/**
|
|
289
|
+
* @deprecated This method is retained for backward compatibility and will be removed in future releases. Use ``onVisibleRangeChange`` instead.
|
|
290
|
+
*/
|
|
274
291
|
onVisibleMonthChange?: (date: Date) => void | Promise<void>;
|
|
292
|
+
onVisibleRangeChange?: (start: Date, end: Date, reason: RangeChangeReason) => void | Promise<void>;
|
|
275
293
|
onCalendarUpdate?: (calendar: CalendarType) => void | Promise<void>;
|
|
276
294
|
onCalendarCreate?: (calendar: CalendarType) => void | Promise<void>;
|
|
277
295
|
onCalendarDelete?: (calendarId: string) => void | Promise<void>;
|
|
@@ -283,7 +301,7 @@ interface CalendarCallbacks {
|
|
|
283
301
|
interface CreateCalendarDialogProps {
|
|
284
302
|
onClose: () => void;
|
|
285
303
|
onCreate: (calendar: CalendarType) => void;
|
|
286
|
-
colorPickerMode?: '
|
|
304
|
+
colorPickerMode?: 'default' | 'custom';
|
|
287
305
|
}
|
|
288
306
|
interface CalendarHeaderProps {
|
|
289
307
|
calendar: ICalendarApp;
|
|
@@ -387,6 +405,7 @@ interface ICalendarApp {
|
|
|
387
405
|
mergeCalendars: (sourceId: string, targetId: string) => void;
|
|
388
406
|
setVisibleMonth: (date: Date) => void;
|
|
389
407
|
getVisibleMonth: () => Date;
|
|
408
|
+
emitVisibleRange: (start: Date, end: Date, reason?: RangeChangeReason) => void;
|
|
390
409
|
dismissUI: () => void;
|
|
391
410
|
getPlugin: <T = unknown>(name: string) => T | undefined;
|
|
392
411
|
hasPlugin: (name: string) => boolean;
|
|
@@ -437,6 +456,7 @@ interface UseCalendarAppReturn {
|
|
|
437
456
|
highlightEvent: (eventId: string | null) => void;
|
|
438
457
|
setVisibleMonth: (date: Date) => void;
|
|
439
458
|
getVisibleMonth: () => Date;
|
|
459
|
+
emitVisibleRange: (start: Date, end: Date, reason?: RangeChangeReason) => void;
|
|
440
460
|
readOnlyConfig: ReadOnlyConfig;
|
|
441
461
|
}
|
|
442
462
|
/**
|
|
@@ -889,6 +909,7 @@ interface UseVirtualMonthScrollReturn {
|
|
|
889
909
|
currentMonth: string;
|
|
890
910
|
currentYear: number;
|
|
891
911
|
isScrolling: boolean;
|
|
912
|
+
isNavigating: boolean;
|
|
892
913
|
virtualData: {
|
|
893
914
|
totalHeight: number;
|
|
894
915
|
visibleItems: VirtualWeekItem[];
|
|
@@ -1262,6 +1283,7 @@ declare class CalendarApp implements ICalendarApp {
|
|
|
1262
1283
|
state: CalendarAppState;
|
|
1263
1284
|
private callbacks;
|
|
1264
1285
|
private calendarRegistry;
|
|
1286
|
+
private store;
|
|
1265
1287
|
private visibleMonth;
|
|
1266
1288
|
private useEventDetailDialog;
|
|
1267
1289
|
private useCalendarHeader;
|
|
@@ -1272,6 +1294,7 @@ declare class CalendarApp implements ICalendarApp {
|
|
|
1272
1294
|
private pendingSnapshot;
|
|
1273
1295
|
private readonly MAX_UNDO_STACK;
|
|
1274
1296
|
constructor(config: CalendarAppConfig);
|
|
1297
|
+
private setupStoreListeners;
|
|
1275
1298
|
private resolveLocale;
|
|
1276
1299
|
subscribe: (listener: (app: ICalendarApp) => void) => (() => void);
|
|
1277
1300
|
private notify;
|
|
@@ -1285,6 +1308,8 @@ declare class CalendarApp implements ICalendarApp {
|
|
|
1285
1308
|
private isInternalEditable;
|
|
1286
1309
|
changeView: (view: ViewType) => void;
|
|
1287
1310
|
getCurrentView: () => CalendarView;
|
|
1311
|
+
emitVisibleRange: (start: Date, end: Date, reason?: RangeChangeReason) => void;
|
|
1312
|
+
handleVisibleRangeChange: (reason: RangeChangeReason) => void;
|
|
1288
1313
|
setCurrentDate: (date: Date) => void;
|
|
1289
1314
|
getCurrentDate: () => Date;
|
|
1290
1315
|
setVisibleMonth: (date: Date) => void;
|
|
@@ -1365,6 +1390,7 @@ declare class CustomRenderingStore {
|
|
|
1365
1390
|
private renderings;
|
|
1366
1391
|
private overrides;
|
|
1367
1392
|
private listeners;
|
|
1393
|
+
constructor(initialOverrides?: string[]);
|
|
1368
1394
|
/**
|
|
1369
1395
|
* Register a new custom rendering placeholder.
|
|
1370
1396
|
* Called by the ContentSlot Preact component.
|
|
@@ -1397,7 +1423,9 @@ declare class CalendarRenderer {
|
|
|
1397
1423
|
private customRenderingStore;
|
|
1398
1424
|
private unsubscribe;
|
|
1399
1425
|
private renderRequested;
|
|
1400
|
-
|
|
1426
|
+
private extraProps;
|
|
1427
|
+
constructor(app: ICalendarApp, initialOverrides?: string[]);
|
|
1428
|
+
setProps(props: Record<string, any>): void;
|
|
1401
1429
|
private requestRender;
|
|
1402
1430
|
/**
|
|
1403
1431
|
* Mount the calendar to a DOM container.
|
|
@@ -2259,8 +2287,8 @@ declare const groupSearchResults: (results: CalendarSearchEvent[], today: Date)
|
|
|
2259
2287
|
|
|
2260
2288
|
declare class ClipboardStore {
|
|
2261
2289
|
private lastCopiedEvent;
|
|
2262
|
-
setEvent(event: Event
|
|
2263
|
-
getEvent(): Event
|
|
2290
|
+
setEvent(event: Event): void;
|
|
2291
|
+
getEvent(): Event | null;
|
|
2264
2292
|
hasEvent(): boolean;
|
|
2265
2293
|
clear(): void;
|
|
2266
2294
|
}
|
|
@@ -2646,7 +2674,7 @@ declare const sidebarContainer = "df-sidebar flex h-full flex-col border-r borde
|
|
|
2646
2674
|
/**
|
|
2647
2675
|
* Sidebar header
|
|
2648
2676
|
*/
|
|
2649
|
-
declare const sidebarHeader = "df-sidebar-header flex items-center px-2 py-
|
|
2677
|
+
declare const sidebarHeader = "df-sidebar-header flex items-center px-2 py-1";
|
|
2650
2678
|
/**
|
|
2651
2679
|
* Sidebar header toggle button
|
|
2652
2680
|
*/
|
|
@@ -2657,4 +2685,4 @@ declare const sidebarHeaderToggle = "df-sidebar-header-toggle flex h-8 w-8 items
|
|
|
2657
2685
|
declare const sidebarHeaderTitle = "df-sidebar-header-title text-sm font-semibold text-gray-700 dark:text-gray-200";
|
|
2658
2686
|
|
|
2659
2687
|
export { BlossomColorPicker, CalendarApp, CalendarRegistry, CalendarRenderer, Check, ChevronRight, ChevronsUpDown, ContentSlot, ContextMenu, ContextMenuColorPicker, ContextMenuItem, ContextMenuLabel, ContextMenuSeparator, CreateCalendarDialog, CustomRenderingStore, DefaultColorPicker, LAYOUT_CONFIG, LOCALES, LocaleContext, LocaleProvider, MiniCalendar, PanelRightClose, PanelRightOpen, Plus, TIME_STEP, VIRTUAL_MONTH_SCROLL_CONFIG, ViewType, WeekDataCache, addDays, buildParseRegExp, calculateDayIndex, calendarPickerDropdown, cancelButton, capitalize, clipboardStore, conditionalTheme, convertDateEvent, convertDateEventWithTimeZone, createAllDayEvent, createDateWithHour, createDayView, createEvent, createEventWithDate, createEventWithRealDate, createEvents, createEventsPlugin, createMonthView, createStandardViews, createTemporalWithHour, createTimedEvent, createTimezoneEvent, createTimezoneEvents, createWeekView, createYearView, dateToPlainDate, dateToPlainDateTime, dateToZonedDateTime, daysBetween, daysDifference, downloadICS, en, extractHourFromDate, extractHourFromTemporal, formatDate, formatDateConsistent, formatDateToICSTimestamp, formatEventTimeRange, formatICSDate, formatMonthYear, formatTemporal, formatTime, generateDayData, generateICS, generateUniKey, generateWeekData, generateWeekRange, generateWeeksData, getAllDayEventsForDay, getCalendarColorsForHex, getCurrentWeekDates, getDateByDayIndex, getDateObj, getDayIndexByDate, getEndOfDay, getEndOfTemporal, getEventBgColor, getEventEndHour, getEventTextColor, getEventsForDay, getEventsForWeek, getIntlLabel, getLineColor, getMonthLabels, getMonthYearOfWeek, getPlainDate, getSearchHeaderInfo, getSelectedBgColor, getStartOfDay, getStartOfTemporal, getTestEvents, getWeekDaysLabels, getWeekRange, getZoneId, groupSearchResults, importICSFile, isDate, isDeepEqual, isEventEqual, isEventInWeek, isMultiDayEvent, isMultiDayTemporalEvent, isPlainDate, isPlainDateTime, isSameDay, isSamePlainDate, isSameTemporal, isValidLocale, isZonedDateTime, mergeClasses, mergeFormatTemplate, monthNames, normalizeCssWidth, normalizeDate, normalizeLocale, normalizeToZoned, now, pad, parseICS, parseICSDate, parseTemporalString, plainDateTimeToDate, plainDateToDate, recalculateEventDays, registerDragImplementation, registerLocale, registerSidebarImplementation, resolveAppliedTheme, roundToTimeStep, scrollbarTakesSpace, setHourInTemporal, shortMonthNames, sidebarContainer, sidebarHeader, sidebarHeaderTitle, sidebarHeaderToggle, t, temporalToDate, themeClasses, themeCn, today, updateEventDateAndDay, updateEventWithRealDate, useDragForView, useLocale, useSidebarBridge, weekDays, weekDaysFullName, zonedDateTimeToDate };
|
|
2660
|
-
export type { BalanceStrategy, BaseViewProps, CalendarAppConfig, CalendarAppState, CalendarCallbacks, CalendarColors, CalendarConfig, CalendarHeaderProps, CalendarPlugin, CalendarType, CalendarView, CalendarsConfig, CreateCalendarDialogProps, CreateEventParams, CreateTimezoneEventParams, CustomRendering, DayData, DayViewConfig, DayViewProps, DragConfig, DragHookOptions, DragHookReturn, DragIndicatorProps, DragIndicatorRenderer, DragIntegrationProps, DragPluginConfig, DragRef, DragService, Event, 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, MonthViewConfig, MonthViewProps, NestedLayer, ReadOnlyConfig, SidebarBridgeReturn, SpecialLayoutRule, SubtreeAnalysis, SupportedLang, TComponent, TNode, ThemeColors, ThemeConfig, ThemeMode, 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, useDragProps, useDragReturn };
|
|
2688
|
+
export type { BalanceStrategy, BaseViewProps, CalendarAppConfig, CalendarAppState, CalendarCallbacks, CalendarColors, CalendarConfig, CalendarHeaderProps, CalendarPlugin, CalendarType, CalendarView, CalendarsConfig, CreateCalendarDialogProps, CreateEventParams, CreateTimezoneEventParams, CustomRendering, DayData, DayViewConfig, DayViewProps, DragConfig, DragHookOptions, DragHookReturn, DragIndicatorProps, DragIndicatorRenderer, DragIntegrationProps, DragPluginConfig, DragRef, DragService, Event, EventChange, 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, MonthViewConfig, MonthViewProps, NestedLayer, RangeChangeReason, ReadOnlyConfig, SidebarBridgeReturn, SpecialLayoutRule, SubtreeAnalysis, SupportedLang, TComponent, TNode, ThemeColors, ThemeConfig, ThemeMode, 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, useDragProps, useDragReturn };
|