@app-studio/web 0.9.27 → 0.9.28
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/components/Calendar/Calendar/Calendar.props.d.ts +70 -0
- package/dist/components/Calendar/Calendar/Calendar.utils.d.ts +10 -0
- package/dist/components/Calendar/Calendar/Calendar.view.d.ts +20 -0
- package/dist/components/Calendar/Calendar.d.ts +3 -0
- package/dist/components/ChatInput/ChatInput/ChatInput.props.d.ts +8 -0
- package/dist/components/ChatInput/ChatInput/ChatInput.state.d.ts +2 -0
- package/dist/components/Formik/Formik.Uploader.d.ts +38 -0
- package/dist/components/Formik/index.d.ts +1 -0
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.props.d.ts +46 -0
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.state.d.ts +12 -0
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.view.d.ts +3 -0
- package/dist/components/KanbanBoard/KanbanBoard.d.ts +3 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/pages/calendar.page.d.ts +3 -0
- package/dist/pages/kanbanBoard.page.d.ts +3 -0
- package/dist/web.cjs.development.js +6553 -5653
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +6554 -5657
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +5654 -4758
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewProps } from 'app-studio';
|
|
3
|
+
import { ButtonProps } from '../../Button/Button/Button.props';
|
|
4
|
+
import { TextProps } from '../../Text/Text/Text.props';
|
|
5
|
+
export declare type CalendarView = 'day' | 'week' | 'month';
|
|
6
|
+
export interface CalendarEvent {
|
|
7
|
+
/** Unique identifier for the event. */
|
|
8
|
+
id?: string | number;
|
|
9
|
+
/** Event title shown in the calendar cell. */
|
|
10
|
+
title: string;
|
|
11
|
+
/** Start date/time of the event. */
|
|
12
|
+
start: Date | string;
|
|
13
|
+
/** Optional end date/time of the event. */
|
|
14
|
+
end?: Date | string;
|
|
15
|
+
/** Optional description or supporting information. */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** Additional metadata the consumer wants to keep with the event. */
|
|
18
|
+
metadata?: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
export interface CalendarRenderEventContext {
|
|
21
|
+
/** Date of the cell currently being rendered. */
|
|
22
|
+
day: Date;
|
|
23
|
+
/** Active calendar view. */
|
|
24
|
+
view: CalendarView;
|
|
25
|
+
/** Whether the given day is today. */
|
|
26
|
+
isToday: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface CalendarViews {
|
|
29
|
+
container?: ViewProps;
|
|
30
|
+
header?: ViewProps;
|
|
31
|
+
headerTitle?: TextProps;
|
|
32
|
+
navigation?: ViewProps;
|
|
33
|
+
viewSwitcher?: ViewProps;
|
|
34
|
+
grid?: ViewProps;
|
|
35
|
+
weekdayRow?: ViewProps;
|
|
36
|
+
weekdayHeader?: ViewProps;
|
|
37
|
+
weekdayLabel?: TextProps;
|
|
38
|
+
weekRow?: ViewProps;
|
|
39
|
+
dayColumn?: ViewProps;
|
|
40
|
+
dayHeader?: ViewProps;
|
|
41
|
+
dayNumber?: TextProps;
|
|
42
|
+
dayMeta?: TextProps;
|
|
43
|
+
events?: ViewProps;
|
|
44
|
+
event?: ViewProps;
|
|
45
|
+
eventTitle?: TextProps;
|
|
46
|
+
eventTime?: TextProps;
|
|
47
|
+
emptyState?: TextProps;
|
|
48
|
+
navigationButton?: Partial<ButtonProps>;
|
|
49
|
+
viewButton?: Partial<ButtonProps>;
|
|
50
|
+
}
|
|
51
|
+
export interface CalendarProps {
|
|
52
|
+
/** Calendar events to render. */
|
|
53
|
+
events?: CalendarEvent[];
|
|
54
|
+
/** Starting date displayed in the calendar. */
|
|
55
|
+
initialDate?: Date | string;
|
|
56
|
+
/** Initial visible view. */
|
|
57
|
+
initialView?: CalendarView;
|
|
58
|
+
/** First day of the week, defaults to Sunday. */
|
|
59
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
60
|
+
/** Height of the calendar container. */
|
|
61
|
+
height?: string | number;
|
|
62
|
+
/** Optional custom render method for events. */
|
|
63
|
+
renderEvent?: (event: CalendarEvent, context: CalendarRenderEventContext) => React.ReactNode;
|
|
64
|
+
/** Called when the visible anchor date changes. */
|
|
65
|
+
onDateChange?: (date: Date) => void;
|
|
66
|
+
/** Called when the active view changes. */
|
|
67
|
+
onViewChange?: (view: CalendarView) => void;
|
|
68
|
+
/** Customise styling of calendar areas. */
|
|
69
|
+
views?: CalendarViews;
|
|
70
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CalendarEvent } from './Calendar.props';
|
|
2
|
+
export interface CalendarEventInternal extends CalendarEvent {
|
|
3
|
+
startDate: Date;
|
|
4
|
+
endDate: Date;
|
|
5
|
+
}
|
|
6
|
+
export declare const toDate: (value: Date | string) => Date;
|
|
7
|
+
export declare const normalizeEvent: (event: CalendarEvent) => CalendarEventInternal;
|
|
8
|
+
export declare const formatDayKey: (date: Date) => string;
|
|
9
|
+
export declare const getEventsForDay: (events: CalendarEventInternal[], day: Date) => CalendarEventInternal[];
|
|
10
|
+
export declare const chunk: <T>(items: T[], size: number) => T[][];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CalendarEvent, CalendarRenderEventContext, CalendarView, CalendarViews } from './Calendar.props';
|
|
3
|
+
import { CalendarEventInternal } from './Calendar.utils';
|
|
4
|
+
interface CalendarViewProps {
|
|
5
|
+
currentDate: Date;
|
|
6
|
+
view: CalendarView;
|
|
7
|
+
label: string;
|
|
8
|
+
weeks: Date[][];
|
|
9
|
+
weekdayLabels: Date[];
|
|
10
|
+
eventsByDay: Map<string, CalendarEventInternal[]>;
|
|
11
|
+
onPrevious: () => void;
|
|
12
|
+
onNext: () => void;
|
|
13
|
+
onToday: () => void;
|
|
14
|
+
onViewChange: (view: CalendarView) => void;
|
|
15
|
+
renderEvent?: (event: CalendarEvent, context: CalendarRenderEventContext) => React.ReactNode;
|
|
16
|
+
views?: CalendarViews;
|
|
17
|
+
height?: string | number;
|
|
18
|
+
}
|
|
19
|
+
declare const CalendarViewComponent: React.FC<CalendarViewProps>;
|
|
20
|
+
export default CalendarViewComponent;
|
|
@@ -176,6 +176,10 @@ export interface ChatInputViewProps extends ChatInputProps {
|
|
|
176
176
|
* Whether files are being uploaded
|
|
177
177
|
*/
|
|
178
178
|
isUploading: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Current upload progress (0-100)
|
|
181
|
+
*/
|
|
182
|
+
uploadProgress?: number;
|
|
179
183
|
leftButtons?: React.ReactNode;
|
|
180
184
|
rightButtons?: React.ReactNode;
|
|
181
185
|
/**
|
|
@@ -202,6 +206,10 @@ export interface ChatInputViewProps extends ChatInputProps {
|
|
|
202
206
|
* Callback function to set whether files are being uploaded
|
|
203
207
|
*/
|
|
204
208
|
setIsUploading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
209
|
+
/**
|
|
210
|
+
* Start uploading newly added files
|
|
211
|
+
*/
|
|
212
|
+
startUpload: (files: File[]) => void;
|
|
205
213
|
/**
|
|
206
214
|
* Currently selected model
|
|
207
215
|
*/
|
|
@@ -11,6 +11,7 @@ export declare const useChatInputState: (props: ChatInputProps) => {
|
|
|
11
11
|
editableRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
12
12
|
fileInputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
13
13
|
isUploading: boolean;
|
|
14
|
+
uploadProgress: number;
|
|
14
15
|
isDraggingOver: boolean;
|
|
15
16
|
uploadedFiles: File[];
|
|
16
17
|
pendingFiles: File[];
|
|
@@ -18,6 +19,7 @@ export declare const useChatInputState: (props: ChatInputProps) => {
|
|
|
18
19
|
setPendingFiles: import("react").Dispatch<import("react").SetStateAction<File[]>>;
|
|
19
20
|
setUploadedFiles: import("react").Dispatch<import("react").SetStateAction<File[]>>;
|
|
20
21
|
setIsUploading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
22
|
+
startUpload: (files: File[]) => void;
|
|
21
23
|
selectedModel: string;
|
|
22
24
|
handleModelChange: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
23
25
|
modelOptions: ModelOption[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { UploadProps } from '../Uploader/Uploader/Uploader.props';
|
|
3
|
+
export declare type UploadFileHandler = (file: File, onProgress: (progress: number) => void) => Promise<any>;
|
|
4
|
+
export interface FormikUploaderProps extends Omit<UploadProps, 'onFileSelect' | 'onMultipleFileSelect' | 'isLoading' | 'progress'> {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the field that will receive the uploaded file responses
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* Custom upload handler. Defaults to the platform UploadService
|
|
11
|
+
*/
|
|
12
|
+
uploadFile?: UploadFileHandler;
|
|
13
|
+
/**
|
|
14
|
+
* Callback fired when a single file upload succeeds
|
|
15
|
+
*/
|
|
16
|
+
onUploadSuccess?: (file: File, response: any) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Callback fired when a single file upload fails
|
|
19
|
+
*/
|
|
20
|
+
onUploadError?: (file: File, error: unknown) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Transform the raw upload response before storing it in the form state
|
|
23
|
+
*/
|
|
24
|
+
transformResponse?: (response: any, file: File) => any;
|
|
25
|
+
/**
|
|
26
|
+
* Optional external handler mirroring the Uploader prop
|
|
27
|
+
*/
|
|
28
|
+
onMultipleFileSelect?: (files: File[]) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Optional external handler mirroring the Uploader prop for single upload mode
|
|
31
|
+
*/
|
|
32
|
+
onFileSelect?: (file: File) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Enable/disable multiple uploads. Defaults to true
|
|
35
|
+
*/
|
|
36
|
+
multiple?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare const FormikUploader: React.FC<FormikUploaderProps>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewProps } from 'app-studio';
|
|
3
|
+
import { TextProps } from '../../Text/Text/Text.props';
|
|
4
|
+
export interface KanbanBoardCard {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
metadata?: Record<string, unknown>;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
export interface KanbanBoardColumn {
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
cards: KanbanBoardCard[];
|
|
15
|
+
footer?: React.ReactNode;
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface KanbanBoardProps {
|
|
20
|
+
columns: KanbanBoardColumn[];
|
|
21
|
+
onChange?: (columns: KanbanBoardColumn[]) => void;
|
|
22
|
+
renderCard?: (card: KanbanBoardCard, column: KanbanBoardColumn) => React.ReactNode;
|
|
23
|
+
renderColumnHeader?: (column: KanbanBoardColumn) => React.ReactNode;
|
|
24
|
+
renderEmptyState?: (column: KanbanBoardColumn) => React.ReactNode;
|
|
25
|
+
views?: {
|
|
26
|
+
board?: ViewProps;
|
|
27
|
+
column?: ViewProps;
|
|
28
|
+
columnHeader?: ViewProps;
|
|
29
|
+
columnTitle?: TextProps;
|
|
30
|
+
columnBody?: ViewProps;
|
|
31
|
+
columnFooter?: ViewProps;
|
|
32
|
+
card?: ViewProps;
|
|
33
|
+
cardContent?: ViewProps;
|
|
34
|
+
emptyState?: ViewProps;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface KanbanBoardViewProps extends KanbanBoardProps {
|
|
38
|
+
columns: KanbanBoardColumn[];
|
|
39
|
+
draggedCardId: string | null;
|
|
40
|
+
onCardDragStart: (columnId: string, cardId: string, event: React.DragEvent<HTMLDivElement>) => void;
|
|
41
|
+
onCardDragEnd: () => void;
|
|
42
|
+
onCardDrop: (columnId: string, cardId: string | null, event: React.DragEvent<HTMLDivElement>) => void;
|
|
43
|
+
onColumnDrop: (columnId: string, event: React.DragEvent<HTMLDivElement>) => void;
|
|
44
|
+
onCardDragOver: (columnId: string, cardId: string | null, event: React.DragEvent<HTMLDivElement>) => void;
|
|
45
|
+
onColumnDragOver: (columnId: string, event: React.DragEvent<HTMLDivElement>) => void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { KanbanBoardProps } from './KanbanBoard.props';
|
|
3
|
+
export declare const useKanbanBoardState: ({ columns: initialColumns, onChange, }: KanbanBoardProps) => {
|
|
4
|
+
columns: import("./KanbanBoard.props").KanbanBoardColumn[];
|
|
5
|
+
draggedCardId: string | null;
|
|
6
|
+
onCardDragStart: (columnId: string, cardId: string, event: React.DragEvent<HTMLDivElement>) => void;
|
|
7
|
+
onCardDragEnd: () => void;
|
|
8
|
+
onColumnDragOver: (_columnId: string, event: React.DragEvent<HTMLDivElement>) => void;
|
|
9
|
+
onCardDragOver: (_columnId: string, _cardId: string | null, event: React.DragEvent<HTMLDivElement>) => void;
|
|
10
|
+
onColumnDrop: (columnId: string, event: React.DragEvent<HTMLDivElement>) => void;
|
|
11
|
+
onCardDrop: (columnId: string, cardId: string | null, event: React.DragEvent<HTMLDivElement>) => void;
|
|
12
|
+
};
|
|
@@ -9,6 +9,8 @@ export * from './Button/Button';
|
|
|
9
9
|
export * from './Card/Card';
|
|
10
10
|
export * from './Carousel/Carousel';
|
|
11
11
|
export * from './Chart/Chart';
|
|
12
|
+
export * from './KanbanBoard/KanbanBoard';
|
|
13
|
+
export * from './Calendar/Calendar';
|
|
12
14
|
export * from './CookieConsent/CookieConsent';
|
|
13
15
|
export * from './ContextMenu/ContextMenu';
|
|
14
16
|
export * from './File/File';
|
|
@@ -74,8 +76,10 @@ export * from './Avatar/Avatar/Avatar.props';
|
|
|
74
76
|
export * from './Badge/Badge/Badge.props';
|
|
75
77
|
export * from './Button/Button/Button.props';
|
|
76
78
|
export * from './Card/Card/Card.props';
|
|
79
|
+
export * from './KanbanBoard/KanbanBoard/KanbanBoard.props';
|
|
77
80
|
export * from './Carousel/Carousel/Carousel.props';
|
|
78
81
|
export * from './Chart/Chart/Chart.props';
|
|
82
|
+
export * from './Calendar/Calendar/Calendar.props';
|
|
79
83
|
export * from './CookieConsent/CookieConsent/CookieConsent.props';
|
|
80
84
|
export * from './ContextMenu/ContextMenu/ContextMenu.props';
|
|
81
85
|
export * from './Form/Select/Select/Select.props';
|