@dayflow/plugin-sidebar 1.0.0
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/LICENSE +21 -0
- package/README.md +49 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.esm.js +747 -0
- package/dist/index.js +749 -0
- package/dist/types/DefaultCalendarSidebar.d.ts +3 -0
- package/dist/types/components/CalendarList.d.ts +16 -0
- package/dist/types/components/DeleteCalendarDialog.d.ts +13 -0
- package/dist/types/components/ImportCalendarDialog.d.ts +10 -0
- package/dist/types/components/MergeCalendarDialog.d.ts +8 -0
- package/dist/types/components/MergeMenuItem.d.ts +8 -0
- package/dist/types/components/SidebarHeader.d.ts +6 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/plugin.d.ts +28 -0
- package/package.json +47 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CalendarSidebarRenderProps } from './plugin';
|
|
2
|
+
declare const DefaultCalendarSidebar: ({ app, calendars, toggleCalendarVisibility, isCollapsed, setCollapsed, renderCalendarContextMenu, editingCalendarId: propEditingCalendarId, setEditingCalendarId: propSetEditingCalendarId, onCreateCalendar, colorPickerMode, }: CalendarSidebarRenderProps) => import("preact").JSX.Element;
|
|
3
|
+
export default DefaultCalendarSidebar;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CalendarType } from '@dayflow/core';
|
|
2
|
+
interface CalendarListProps {
|
|
3
|
+
calendars: CalendarType[];
|
|
4
|
+
onToggleVisibility: (id: string, visible: boolean) => void;
|
|
5
|
+
onReorder: (fromIndex: number, toIndex: number) => void;
|
|
6
|
+
onRename: (id: string, newName: string) => void;
|
|
7
|
+
onContextMenu: (e: any, id: string) => void;
|
|
8
|
+
onColorClick?: (e: any, id: string) => void;
|
|
9
|
+
editingId: string | null;
|
|
10
|
+
setEditingId: (id: string | null) => void;
|
|
11
|
+
activeContextMenuCalendarId?: string | null;
|
|
12
|
+
isDraggable?: boolean;
|
|
13
|
+
isEditable?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const CalendarList: ({ calendars, onToggleVisibility, onReorder, onRename, onContextMenu, onColorClick, editingId, setEditingId, activeContextMenuCalendarId, isDraggable, isEditable, }: CalendarListProps) => import("preact").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CalendarType } from '@dayflow/core';
|
|
2
|
+
interface DeleteCalendarDialogProps {
|
|
3
|
+
calendarId: string;
|
|
4
|
+
calendarName: string;
|
|
5
|
+
calendars: CalendarType[];
|
|
6
|
+
step: 'initial' | 'confirm_delete';
|
|
7
|
+
onStepChange: (step: 'initial' | 'confirm_delete') => void;
|
|
8
|
+
onConfirmDelete: () => void;
|
|
9
|
+
onCancel: () => void;
|
|
10
|
+
onMergeSelect: (targetId: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const DeleteCalendarDialog: ({ calendarId, calendarName, calendars, step, onStepChange, onConfirmDelete, onCancel, onMergeSelect, }: DeleteCalendarDialogProps) => import("preact").VNode<any>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CalendarType } from '@dayflow/core';
|
|
2
|
+
interface ImportCalendarDialogProps {
|
|
3
|
+
calendars: CalendarType[];
|
|
4
|
+
filename: string;
|
|
5
|
+
onConfirm: (targetCalendarId: string) => void;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const NEW_CALENDAR_ID = "new-calendar";
|
|
9
|
+
export declare const ImportCalendarDialog: ({ calendars, filename, onConfirm, onCancel, }: ImportCalendarDialogProps) => import("preact").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface MergeCalendarDialogProps {
|
|
2
|
+
sourceName: string;
|
|
3
|
+
targetName: string;
|
|
4
|
+
onConfirm: () => void;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const MergeCalendarDialog: ({ sourceName, targetName, onConfirm, onCancel, }: MergeCalendarDialogProps) => import("preact").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CalendarType } from '@dayflow/core';
|
|
2
|
+
interface MergeMenuItemProps {
|
|
3
|
+
calendars: CalendarType[];
|
|
4
|
+
currentCalendarId: string;
|
|
5
|
+
onMergeSelect: (targetId: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const MergeMenuItem: ({ calendars, currentCalendarId, onMergeSelect, }: MergeMenuItemProps) => import("preact").JSX.Element | null;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './plugin';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CalendarPlugin, ICalendarApp, CalendarType, TNode, CreateCalendarDialogProps } from '@dayflow/core';
|
|
2
|
+
export interface CalendarSidebarRenderProps {
|
|
3
|
+
app: ICalendarApp;
|
|
4
|
+
calendars: CalendarType[];
|
|
5
|
+
toggleCalendarVisibility: (calendarId: string, visible: boolean) => void;
|
|
6
|
+
toggleAll: (visible: boolean) => void;
|
|
7
|
+
isCollapsed: boolean;
|
|
8
|
+
setCollapsed: (collapsed: boolean) => void;
|
|
9
|
+
renderCalendarContextMenu?: (calendar: CalendarType, onClose: () => void) => TNode;
|
|
10
|
+
createCalendarMode?: 'inline' | 'modal';
|
|
11
|
+
renderCreateCalendarDialog?: (props: CreateCalendarDialogProps) => TNode;
|
|
12
|
+
editingCalendarId?: string | null;
|
|
13
|
+
setEditingCalendarId?: (id: string | null) => void;
|
|
14
|
+
onCreateCalendar?: () => void;
|
|
15
|
+
colorPickerMode?: 'blossom' | 'default';
|
|
16
|
+
}
|
|
17
|
+
export interface SidebarPluginConfig {
|
|
18
|
+
width?: number | string;
|
|
19
|
+
miniWidth?: string;
|
|
20
|
+
initialCollapsed?: boolean;
|
|
21
|
+
createCalendarMode?: 'inline' | 'modal';
|
|
22
|
+
colorPickerMode?: 'blossom' | 'default';
|
|
23
|
+
render?: (props: CalendarSidebarRenderProps) => TNode;
|
|
24
|
+
renderCalendarContextMenu?: (calendar: CalendarType, onClose: () => void) => TNode;
|
|
25
|
+
renderCreateCalendarDialog?: (props: CreateCalendarDialogProps) => TNode;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
export declare function createSidebarPlugin(config?: SidebarPluginConfig): CalendarPlugin;
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dayflow/plugin-sidebar",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Sidebar plugin for DayFlow calendar",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.esm.js",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"keywords": [
|
|
21
|
+
"calendar",
|
|
22
|
+
"sidebar",
|
|
23
|
+
"dayflow",
|
|
24
|
+
"plugin"
|
|
25
|
+
],
|
|
26
|
+
"author": "Jayce Li",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@dayflow/core": "3.1.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@dayflow/blossom-color-picker": "^2.0.1",
|
|
33
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
34
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
35
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
36
|
+
"rollup": "^4.29.1",
|
|
37
|
+
"rollup-plugin-dts": "^6.3.0",
|
|
38
|
+
"preact": "^10.25.4",
|
|
39
|
+
"temporal-polyfill": "^0.3.0",
|
|
40
|
+
"typescript": "^5.7.2",
|
|
41
|
+
"@dayflow/core": "3.1.0"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc -p tsconfig.build.json && rollup -c",
|
|
45
|
+
"typecheck": "tsc --noEmit"
|
|
46
|
+
}
|
|
47
|
+
}
|